diff --git a/backend/.python-version b/backend/.python-version index 24ee5b1be9961e38a503c8e764b7385dbb6ba124..e4fba2183587225f216eeada4c78dfab6b2e65f5 100644 --- a/backend/.python-version +++ b/backend/.python-version @@ -1 +1 @@ -3.13 +3.12 diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5453098ae6f60d146e6c81ec3ad92f9709cabf0b --- /dev/null +++ b/backend/README.md @@ -0,0 +1,10 @@ +# Optimisation backend + +Python run in the browser by Pyodide (see `frontends/react/src/pyodide.worker.ts`). + +- `src/logic.py`: parsing the function, its derivatives, the optimisers and runs +- `src/manager.py`: the `Manager` methods the UI calls +- `src/algorithms.json`: each optimiser's settings, shared with the UI +- `contract/`: example calls, checked by `tests/test_contract.py` and the frontend's `contract.check.ts` + +Run the tests with `uv run pytest`. They use the Python, NumPy and SymPy versions Pyodide 0.26.1 ships (pinned in `pyproject.toml`), so they match the browser. diff --git a/backend/contract/gradient_descent_quadratic.json b/backend/contract/gradient_descent_quadratic.json new file mode 100644 index 0000000000000000000000000000000000000000..30302582bef3ee8e495f4596b099d8160d9b37d5 --- /dev/null +++ b/backend/contract/gradient_descent_quadratic.json @@ -0,0 +1,11 @@ +{ + "description": "Gradient descent on x^2 from x = 1 with learning rate 0.25 halves x each iteration", + "calls": { + "handle_set_function": { "args": { "variables": 1, "expression": "x^2" }, "result": null }, + "handle_set_runs": { "args": { "runs": [{ "algorithm": "gradient_descent", "start": [1.0], "params": { "learning_rate": 0.25 } }] }, "result": null }, + "handle_state": { + "args": { "iteration": 2 }, + "result": { "runs": [{ "point": { "position": [0.25], "value": 0.0625, "gradient": [0.5], "hessian": [[2.0]] }, "stopped": null }] } + } + } +} diff --git a/backend/contract/invalid_function.json b/backend/contract/invalid_function.json new file mode 100644 index 0000000000000000000000000000000000000000..bc72f7101937bd1510bc76a6f95c4271cd8c97bf --- /dev/null +++ b/backend/contract/invalid_function.json @@ -0,0 +1,6 @@ +{ + "description": "A function of one variable can't use y", + "calls": { + "handle_set_function": { "args": { "variables": 1, "expression": "x^2 + y" }, "error": { "kind": "user", "message": "Unknown name y: functions can use x, and" } } + } +} diff --git a/backend/contract/newton_singular_hessian.json b/backend/contract/newton_singular_hessian.json new file mode 100644 index 0000000000000000000000000000000000000000..4511621a4a2946d01ab59cfaf143d69e422264f7 --- /dev/null +++ b/backend/contract/newton_singular_hessian.json @@ -0,0 +1,20 @@ +{ + "description": "Two runs stepped together on x^2 + 0y: Newton stops at once (singular Hessian), gradient descent (default learning rate 0.1) carries on", + "calls": { + "handle_set_function": { "args": { "variables": 2, "expression": "x^2 + 0y" }, "result": null }, + "handle_set_runs": { + "args": { "runs": [ + { "algorithm": "gradient_descent", "start": [1.0, 1.0], "params": {} }, + { "algorithm": "newton", "start": [1.0, 1.0], "params": {} } + ] }, + "result": null + }, + "handle_state": { + "args": { "iteration": 1 }, + "result": { "runs": [ + { "point": { "position": [0.8, 1.0], "value": 0.64, "gradient": [1.6, 0.0], "hessian": [[2.0, 0.0], [0.0, 0.0]] }, "stopped": null }, + { "point": null, "stopped": "The Hessian is singular here, so Newton's method can't take a step." } + ] } + } + } +} diff --git a/backend/contract/past_the_end.json b/backend/contract/past_the_end.json new file mode 100644 index 0000000000000000000000000000000000000000..c79a30a60f989c3e6e1b891344d67ea5bb9327dc --- /dev/null +++ b/backend/contract/past_the_end.json @@ -0,0 +1,6 @@ +{ + "description": "Before any runs are set there is no state, so the stepper finds the end at iteration 0", + "calls": { + "handle_state": { "args": { "iteration": 0 }, "result": null } + } +} diff --git a/backend/pyproject.toml b/backend/pyproject.toml index a95e09867d9a7994fd4f32045afe9bddd51ca0c6..a8603163920e1a2c80f069c0e5ae4a84f4cdebcb 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -1,12 +1,21 @@ [project] name = "backend" version = "0.1.0" -description = "Add your description here" -readme = "README.md" -requires-python = ">=3.13" +description = "Optimisation visualisation: objective functions and optimisers, run in the browser by Pyodide" +requires-python = ">=3.12,<3.13" +# The versions Pyodide 0.26.1 ships (pyodide-lock.json), so tests run on the +# browser's stack; update these with the Pyodide version in packages/pyodide dependencies = [ - "fastapi>=0.128.0", - "numpy>=2.4.0", - "sympy>=1.14.0", - "uvicorn[standard]>=0.40.0", + "numpy==1.26.4", + "sympy==1.12", + "mpmath==1.3.0", ] + +[dependency-groups] +dev = [ + "pytest>=9.2.0", +] + +[tool.pytest.ini_options] +pythonpath = ["src", "."] +testpaths = ["tests"] diff --git a/backend/requirements.txt b/backend/requirements.txt deleted file mode 100644 index ecb573ea9efa8d4c78311a37c69594c1bc00d375..0000000000000000000000000000000000000000 --- a/backend/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -fastapi -uvicorn[standard] -numpy -sympy diff --git a/backend/src/__pycache__/opimization_logic.cpython-313.pyc b/backend/src/__pycache__/opimization_logic.cpython-313.pyc deleted file mode 100644 index a23bfbfedf84aa2010ef00f7f16b423b503e8ead..0000000000000000000000000000000000000000 Binary files a/backend/src/__pycache__/opimization_logic.cpython-313.pyc and /dev/null differ diff --git a/backend/src/__pycache__/optimization_logic.cpython-314.pyc b/backend/src/__pycache__/optimization_logic.cpython-314.pyc deleted file mode 100644 index ee3a0ded2e1ac70d13aed781c2aac057ffd1f98e..0000000000000000000000000000000000000000 Binary files a/backend/src/__pycache__/optimization_logic.cpython-314.pyc and /dev/null differ diff --git a/backend/src/__pycache__/optimization_manager.cpython-313.pyc b/backend/src/__pycache__/optimization_manager.cpython-313.pyc deleted file mode 100644 index 014f4a8ecf2037975ecc66b78ca43c90612c9bcd..0000000000000000000000000000000000000000 Binary files a/backend/src/__pycache__/optimization_manager.cpython-313.pyc and /dev/null differ diff --git a/backend/src/algorithms.json b/backend/src/algorithms.json new file mode 100644 index 0000000000000000000000000000000000000000..33ae2440bab626f2d6cd61d9f3edadaea0aef3b3 --- /dev/null +++ b/backend/src/algorithms.json @@ -0,0 +1,60 @@ +{ + "algorithms": [ + { + "id": "gradient_descent", + "label": "Gradient descent", + "params": [ + { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "How far each step moves along the negative gradient." }, + { "name": "momentum", "label": "Momentum μ", "symbol": "μ", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.0, "description": "How much of the previous step carries over into the next one." } + ] + }, + { + "id": "nesterov", + "label": "Nesterov momentum", + "params": [ + { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "How far each step moves along the negative gradient." }, + { "name": "momentum", "label": "Momentum μ", "symbol": "μ", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.1, "description": "How much of the previous step carries over; the gradient is taken at the look-ahead point." } + ] + }, + { + "id": "newton", + "label": "Newton's method", + "params": [] + }, + { + "id": "adam", + "label": "Adam", + "params": [ + { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "The largest step size, roughly." }, + { "name": "beta1", "label": "Decay β₁", "symbol": "β₁", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving average of gradients (first moment)." }, + { "name": "beta2", "label": "Decay β₂", "symbol": "β₂", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.999, "description": "Decay rate of the moving average of squared gradients (second moment)." }, + { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." } + ] + }, + { + "id": "adagrad", + "label": "Adagrad", + "params": [ + { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "Divided by the root of the summed squared gradients." }, + { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." } + ] + }, + { + "id": "rmsprop", + "label": "RMSProp", + "params": [ + { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "Divided by the root of the moving average of squared gradients." }, + { "name": "beta", "label": "Decay β", "symbol": "β", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving average of squared gradients." }, + { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." } + ] + }, + { + "id": "adadelta", + "label": "Adadelta", + "params": [ + { "name": "beta", "label": "Decay β", "symbol": "β", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving averages of squared gradients and squared updates." }, + { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 0.001, "description": "Sets the first step size, and avoids dividing by zero." } + ] + } + ] +} diff --git a/backend/src/logic.py b/backend/src/logic.py new file mode 100644 index 0000000000000000000000000000000000000000..5286b1f54609e91fe49256247d38b7116b11c79f --- /dev/null +++ b/backend/src/logic.py @@ -0,0 +1,256 @@ +"""Objective functions and optimisers, in one or two variables. + +Positions, gradients and Hessians are NumPy arrays of length 1 or 2, so each +optimiser is written once for both. +""" + +import re + +import numpy as np +from sympy import Abs, DiracDelta, Expr, Float, Integer, Rational, Symbol, acos, asin, atan, cos, exp, lambdify, log, pi, sin, sqrt, symbols, tan +from sympy.parsing.sympy_parser import ( + convert_xor, + implicit_multiplication_application, + parse_expr, + standard_transformations, +) + +# Real, so that e.g. d/dx |x| is sign(x) +VARIABLES = symbols("x y", real=True) + +ALLOWED_NAMES = { + "sin": sin, "cos": cos, "tan": tan, "asin": asin, "acos": acos, "atan": atan, + "log": log, "ln": log, "sqrt": sqrt, "abs": Abs, "exp": exp, + "e": exp(1), "pi": pi, "π": pi, +} +# The parser's own helpers for numbers and names, and nothing else: no other +# sympy functions and no Python builtins +PARSER_NAMES = {"Integer": Integer, "Float": Float, "Rational": Rational, "Symbol": Symbol, "__builtins__": {}} +FUNCTION_NAMES = "sin, cos, tan, asin, acos, atan, exp, log, sqrt, abs, e and pi" + + +def _unknown_names(expression: str, variables: list[str]) -> list[str]: + """Words that aren't a variable, a run of variables (xy is x·y) or an allowed name.""" + words = re.findall(r"[A-Za-z_]\w*", expression) + return sorted({w for w in words if w not in ALLOWED_NAMES and not set(w) <= set(variables)}) + + +def parse_function(expression: str, n_variables: int) -> Expr: + """Parse e.g. "x^2 + 3y^2"; raises ValueError with a message for students.""" + if not expression.strip(): + raise ValueError("Enter a function.") + variables = VARIABLES[:n_variables] + allowed = " and ".join(str(v) for v in variables) + unknown = _unknown_names(expression, [str(v) for v in variables]) + if unknown: + raise ValueError(f"Unknown name {', '.join(unknown)}: functions can use {allowed}, and {FUNCTION_NAMES}.") + names = {str(v): v for v in VARIABLES} | ALLOWED_NAMES + try: + expr = parse_expr( + expression, + local_dict=names, + global_dict=PARSER_NAMES, + transformations=standard_transformations + (implicit_multiplication_application, convert_xor), + ) + except Exception: + raise ValueError("This isn't a function sympy can read. Check the brackets and operators.") + if not isinstance(expr, Expr): + raise ValueError("This isn't a function sympy can read. Check the brackets and operators.") + unknown = expr.free_symbols - set(variables) + if unknown: + raise ValueError(f"Unknown name {', '.join(sorted(map(str, unknown)))}: functions can use {allowed}, and {FUNCTION_NAMES}.") + return expr + + +def derivative(expr: Expr, *variables) -> Expr: + """∂expr/∂variables, with kinks treated as PyTorch's autograd does: d|x|/dx is + sign(x) (0 at x = 0) and sign has no curvature, so the Dirac delta sympy + gives for d²|x|/dx² becomes 0. NumPy has no Dirac delta to evaluate anyway.""" + return expr.diff(*variables).replace(DiracDelta, lambda *args: 0) + + +class Objective: + """f with its gradient and Hessian, evaluated at a point or on a grid.""" + + def __init__(self, expr: Expr, n_variables: int): + variables = VARIABLES[:n_variables] + self.n = n_variables + self._f = lambdify(variables, expr, modules="numpy") + self._gradient = [lambdify(variables, derivative(expr, v), modules="numpy") for v in variables] + self._hessian = [[lambdify(variables, derivative(expr, a, b), modules="numpy") for b in variables] for a in variables] + + def value(self, p: np.ndarray) -> float: + return float(self._f(*p)) + + def gradient(self, p: np.ndarray) -> np.ndarray: + return np.array([float(g(*p)) for g in self._gradient]) + + def hessian(self, p: np.ndarray) -> np.ndarray: + return np.array([[float(h(*p)) for h in row] for row in self._hessian]) + + def values_on(self, *grid: np.ndarray) -> np.ndarray: + # Constant expressions give a scalar; spread it over the grid + return np.broadcast_to(np.asarray(self._f(*grid), dtype=float), grid[0].shape) + + def gradient_on(self, *grid: np.ndarray) -> list[np.ndarray]: + return [np.broadcast_to(np.asarray(g(*grid), dtype=float), grid[0].shape) for g in self._gradient] + + +class SingularHessian(Exception): + pass + + +# Each optimiser keeps its own state between steps; step(p) returns the next position. + +class GradientDescent: + """Heavy-ball momentum: v ← μv − η∇f(x), x ← x + v.""" + + def __init__(self, objective: Objective, learning_rate: float, momentum: float): + self.f, self.lr, self.momentum = objective, learning_rate, momentum + self.v = 0.0 + + def step(self, p: np.ndarray) -> np.ndarray: + self.v = self.momentum * self.v - self.lr * self.f.gradient(p) + return p + self.v + + +class Nesterov: + """Gradient taken at the look-ahead point x + μv.""" + + def __init__(self, objective: Objective, learning_rate: float, momentum: float): + self.f, self.lr, self.momentum = objective, learning_rate, momentum + self.v = 0.0 + + def step(self, p: np.ndarray) -> np.ndarray: + self.v = self.momentum * self.v - self.lr * self.f.gradient(p + self.momentum * self.v) + return p + self.v + + +class Newton: + """x ← x − H⁻¹∇f(x).""" + + def __init__(self, objective: Objective): + self.f = objective + + def step(self, p: np.ndarray) -> np.ndarray: + h, g = self.f.hessian(p), self.f.gradient(p) + try: + delta = np.linalg.solve(h, g) + except np.linalg.LinAlgError: + raise SingularHessian() + # Pyodide's NumPy can't see floating-point errors, so solve returns inf or nan instead of raising + if np.all(np.isfinite(h)) and np.all(np.isfinite(g)) and not np.all(np.isfinite(delta)): + raise SingularHessian() + return p - delta + + +class Adagrad: + def __init__(self, objective: Objective, learning_rate: float, epsilon: float): + self.f, self.lr, self.eps = objective, learning_rate, epsilon + self.v = 0.0 # sum of squared gradients + + def step(self, p: np.ndarray) -> np.ndarray: + g = self.f.gradient(p) + self.v = self.v + g**2 + # ε outside the square root, as PyTorch does + return p - self.lr / (np.sqrt(self.v) + self.eps) * g + + +class RMSProp: + def __init__(self, objective: Objective, learning_rate: float, beta: float, epsilon: float): + self.f, self.lr, self.beta, self.eps = objective, learning_rate, beta, epsilon + self.v = 0.0 # moving average of squared gradients + + def step(self, p: np.ndarray) -> np.ndarray: + g = self.f.gradient(p) + self.v = self.beta * self.v + (1 - self.beta) * g**2 + # ε outside the square root, as PyTorch does + return p - self.lr / (np.sqrt(self.v) + self.eps) * g + + +class Adadelta: + def __init__(self, objective: Objective, beta: float, epsilon: float): + self.f, self.beta, self.eps = objective, beta, epsilon + self.v = 0.0 # moving average of squared gradients + self.s = 0.0 # moving average of squared updates + + def step(self, p: np.ndarray) -> np.ndarray: + g = self.f.gradient(p) + self.v = self.beta * self.v + (1 - self.beta) * g**2 + delta = -np.sqrt(self.s + self.eps) / np.sqrt(self.v + self.eps) * g + self.s = self.beta * self.s + (1 - self.beta) * delta**2 + return p + delta + + +class Adam: + def __init__(self, objective: Objective, learning_rate: float, beta1: float, beta2: float, epsilon: float): + self.f, self.lr, self.beta1, self.beta2, self.eps = objective, learning_rate, beta1, beta2, epsilon + self.m = 0.0 # first moment + self.v = 0.0 # second moment + self.t = 0 + + def step(self, p: np.ndarray) -> np.ndarray: + g = self.f.gradient(p) + self.t += 1 + self.m = self.beta1 * self.m + (1 - self.beta1) * g + self.v = self.beta2 * self.v + (1 - self.beta2) * g**2 + m_hat = self.m / (1 - self.beta1**self.t) + v_hat = self.v / (1 - self.beta2**self.t) + return p - self.lr / (np.sqrt(v_hat) + self.eps) * m_hat + + +# Ids match backend/src/algorithms.json +OPTIMISERS = { + "gradient_descent": GradientDescent, + "nesterov": Nesterov, + "newton": Newton, + "adam": Adam, + "adagrad": Adagrad, + "rmsprop": RMSProp, + "adadelta": Adadelta, +} + +# A run that gets further than this from the origin has diverged +DIVERGENCE_LIMIT = 1e6 + +DIVERGED = "The next point has no finite value or is beyond 1,000,000: the run diverged or left the function's domain." +SINGULAR = "The Hessian is singular here, so Newton's method can't take a step." + + +class Run: + """One optimiser's trajectory, computed as far as it has been asked for.""" + + def __init__(self, objective: Objective, optimiser, start: np.ndarray): + self.f = objective + self.optimiser = optimiser + self.points = [self._describe(start)] + self.position = start + # Why the run ended, once it has + self.stopped: str | None = None + + def point(self, k: int) -> dict | None: + """The point after k iterations, or None if the run stopped before then.""" + with np.errstate(all="ignore"): + while len(self.points) <= k and self.stopped is None: + self._advance() + return self.points[k] if k < len(self.points) else None + + def _advance(self) -> None: + try: + p = self.optimiser.step(self.position) + except SingularHessian: + self.stopped = SINGULAR + return + if not np.all(np.abs(p) <= DIVERGENCE_LIMIT) or not np.isfinite(self.f.value(p)): + self.stopped = DIVERGED + return + self.position = p + self.points.append(self._describe(p)) + + def _describe(self, p: np.ndarray) -> dict: + return { + "position": p.tolist(), + "value": self.f.value(p), + "gradient": self.f.gradient(p).tolist(), + "hessian": self.f.hessian(p).tolist(), + } diff --git a/backend/src/main.py b/backend/src/main.py deleted file mode 100644 index 302c3aefc6db19ef97170aea1aa05abb6e17273d..0000000000000000000000000000000000000000 --- a/backend/src/main.py +++ /dev/null @@ -1,102 +0,0 @@ -from fastapi import FastAPI, WebSocket, WebSocketDisconnect -from fastapi.staticfiles import StaticFiles -from optimization_manager import OptimizationManager - -app = FastAPI() -PORT = 7860 - - -@app.websocket("/ws") -async def websocket_endpoint(websocket: WebSocket): - print("starting") - await websocket.accept() - manager = OptimizationManager() - - try: - while True: - # Receive message from client - message = await websocket.receive_json() - message_type = message.get("type") - - # Handle different message types - if message_type == "init": - await handle_init(websocket, manager, message.get("settings", {})) - - elif message_type == "reset": - await handle_reset(websocket, manager) - - elif message_type == "next-step": - await handle_next_step(websocket, manager) - - elif message_type == "prev-step": - await handle_prev_step(websocket, manager) - - elif message_type == "play": - await handle_play(websocket, manager) - - elif message_type == "pause": - await handle_pause(websocket, manager) - - else: - await send_error(websocket, f"Unknown message type: {message_type}") - - except WebSocketDisconnect: - print("Client disconnected") - except Exception as e: - print(f"Error: {e}") - await send_error(websocket, str(e)) - - -async def handle_init(websocket: WebSocket, manager: OptimizationManager, settings: dict): - """Handle settings update.""" - data = manager.handle_update_settings(settings) - if data: - await websocket.send_json(data) - - -async def handle_reset(websocket: WebSocket, manager: OptimizationManager): - """Handle trajectory reset.""" - data = manager.handle_reset() - if data: - await websocket.send_json(data) - - -async def handle_next_step(websocket: WebSocket, manager: OptimizationManager): - """Handle next step request.""" - data = manager.handle_next_step() - if data: - await websocket.send_json(data) - - -async def handle_prev_step(websocket: WebSocket, manager: OptimizationManager): - """Handle previous step request.""" - data = manager.handle_prev_step() - if data: - await websocket.send_json(data) - - -async def handle_play(websocket: WebSocket, manager: OptimizationManager): - """Handle play request (to be implemented).""" - # TODO: Implement play functionality with automatic step advancement - pass - - -async def handle_pause(websocket: WebSocket, manager: OptimizationManager): - """Handle pause request (to be implemented).""" - # TODO: Implement pause functionality - pass - - -async def send_error(websocket: WebSocket, error_message: str): - """Send error message to client.""" - await websocket.send_json({ - "type": "error", - "message": error_message - }) - - -app.mount("/", StaticFiles(directory="../frontend/dist", html=True), name="frontend") - -if __name__ == "__main__": - import uvicorn - uvicorn.run(app, host="0.0.0.0", port=PORT) diff --git a/backend/src/manager.py b/backend/src/manager.py new file mode 100644 index 0000000000000000000000000000000000000000..ecaa2ebd8f995e3dfe4e36d1c0c22ff66ee97e6a --- /dev/null +++ b/backend/src/manager.py @@ -0,0 +1,125 @@ +import json +from pathlib import Path + +import numpy as np + +from logic import OPTIMISERS, Objective, Run, parse_function + +ALGORITHMS = { + spec["id"]: spec + for spec in json.loads((Path(__file__).parent / "algorithms.json").read_text())["algorithms"] +} + +# Iterations a run can take before stepping stops +MAX_ITERATIONS = 1000 +LIMIT_REACHED = f"Reached the {MAX_ITERATIONS}-iteration limit." +# Sample points for the plotted curve (one variable) or surface (two, per side) +CURVE_POINTS = 401 +GRID_POINTS = 101 +# Gradient arrows per side +ARROW_POINTS = 15 + + +class UserError(Exception): + """A mistake the student can fix; its message is shown in the UI.""" + + +def _json_values(values: np.ndarray) -> list: + """Values as JSON numbers, with null where f has no finite value.""" + return [float(v) if np.isfinite(v) else None for v in values] + + +class Manager: + def __init__(self): + self._objective: Objective | None = None + self._runs: list[Run] = [] + + def handle_set_function(self, args: dict) -> None: + """{variables: 1 | 2, expression}; clears the runs.""" + self._objective = None + self._runs = [] + n = int(args["variables"]) + try: + expr = parse_function(str(args["expression"]), n) + except ValueError as e: + raise UserError(str(e)) + try: + objective = Objective(expr, n) + # Evaluate everything once, so a failure shows here rather than mid-run. + # Values may be inf or nan (outside the domain); only errors count. + p = np.full(n, 0.5) + with np.errstate(all="ignore"): + objective.value(p), objective.gradient(p), objective.hessian(p) + except Exception: + raise UserError("This function can't be evaluated or differentiated. Try writing it another way.") + self._objective = objective + + def handle_function_values(self, args: dict) -> dict | None: + """f sampled over the plot's {x_range, y_range}; None with no function.""" + f = self._objective + if f is None: + return None + with np.errstate(all="ignore"): + if f.n == 1: + x = np.linspace(*args["x_range"], CURVE_POINTS) + return {"x": x.tolist(), "f": _json_values(f.values_on(x))} + + x = np.linspace(*args["x_range"], GRID_POINTS) + y = np.linspace(*args["y_range"], GRID_POINTS) + z = f.values_on(*np.meshgrid(x, y)) + ax, ay = np.meshgrid(np.linspace(*args["x_range"], ARROW_POINTS), np.linspace(*args["y_range"], ARROW_POINTS)) + u, v = f.gradient_on(ax, ay) + return { + "x": x.tolist(), + "y": y.tolist(), + # Rows follow y, columns follow x + "f": [_json_values(row) for row in z], + "arrows": { + "x": ax.ravel().tolist(), + "y": ay.ravel().tolist(), + "u": _json_values(u.ravel()), + "v": _json_values(v.ravel()), + }, + } + + def handle_set_runs(self, args: dict) -> None: + """{runs: [{algorithm, start, params}]}: the optimisers to step together.""" + self._runs = [] + f = self._objective + if f is None: + raise ValueError("Function not set") + runs = [] + for run in args["runs"]: + spec = ALGORITHMS[run["algorithm"]] + given = dict(run.get("params", {})) + params = {p["name"]: float(given.get(p["name"], p["default"])) for p in spec["params"]} + start = np.array(run["start"], dtype=float) + if start.shape != (f.n,): + raise ValueError(f"Start point needs {f.n} coordinates, got {start.tolist()}") + with np.errstate(all="ignore"): + if not np.isfinite(f.value(start)): + point = ", ".join(f"{c:g}" for c in start) + raise UserError(f"The function has no finite value at the initial point ({point}).") + runs.append(Run(f, OPTIMISERS[spec["id"]](f, **params), start)) + self._runs = runs + + def handle_state(self, args: dict) -> dict | None: + """Every run after {iteration} iterations; None once all have stopped. + + "stopped" says why a run ended, at its last point and after it (where + point is None). It is None while the run carries on. + """ + k = int(args["iteration"]) + if not self._runs or k > MAX_ITERATIONS: + return None + points = [run.point(k) for run in self._runs] + if all(p is None for p in points): + return None + # Look one iteration ahead to know whether this is a run's last point + ended = [p is None or run.point(k + 1) is None for run, p in zip(self._runs, points)] + return { + "runs": [ + {"point": p, "stopped": run.stopped if end else (LIMIT_REACHED if k == MAX_ITERATIONS else None)} + for run, p, end in zip(self._runs, points, ended) + ] + } diff --git a/backend/src/optimization_logic.py b/backend/src/optimization_logic.py deleted file mode 100644 index c1f1f9ecaf044dbbafa3a195ea5b5455766a5137..0000000000000000000000000000000000000000 --- a/backend/src/optimization_logic.py +++ /dev/null @@ -1,663 +0,0 @@ -import numpy as np -from sympy import lambdify, Expr - - -def _gradient_values(fx, fy, x: float, y: float) -> list: - return [float(fx(x, y)), float(fy(x, y))] - - -def _hessian_values(fxx, fxy, fyy, x: float, y: float) -> list: - return [ - [float(fxx(x, y)), float(fxy(x, y))], - [float(fxy(x, y)), float(fyy(x, y))], - ] - - -def gd_univariate( - function: Expr, - x0: float, - learning_rate: float, - momentum: float, - steps: int, -) -> dict: - """ - Perform gradient descent on a univariate function. - - Assumes function is valid and in terms of x - """ - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - for i in range(steps - 1): - if i == 0: - m = 0 - else: - m = momentum * (x_values[-1] - x_values[-2]) - - x = x - learning_rate * f_prime(x) + m - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def gd_bivariate( - function: Expr, - x0: float, - y0: float, - learning_rate: float, - momentum: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - for i in range(steps - 1): - if i == 0: - mx = 0 - my = 0 - else: - mx = momentum * (x_values[-1] - x_values[-2]) - my = momentum * (y_values[-1] - y_values[-2]) - - x_new = x - learning_rate * fx(x, y) + mx - y_new = y - learning_rate * fy(x, y) + my - x = x_new - y = y_new - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def nesterov_univariate( - function: Expr, - x0: float, - learning_rate: float, - momentum: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - for i in range(steps - 1): - if i == 0: - m = 0 - else: - m = momentum * (x_values[-1] - x_values[-2]) - - x_lookahead = x + m - x = x_lookahead - learning_rate * f_prime(x_lookahead) - - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def nesterov_bivariate( - function: Expr, - x0: float, - y0: float, - learning_rate: float, - momentum: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - for i in range(steps - 1): - if i == 0: - mx = 0 - my = 0 - else: - mx = momentum * (x_values[-1] - x_values[-2]) - my = momentum * (y_values[-1] - y_values[-2]) - - x_lookahead = x + mx - y_lookahead = y + my - - x = x_lookahead - learning_rate * fx(x_lookahead, y_lookahead) - y = y_lookahead - learning_rate * fy(x_lookahead, y_lookahead) - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def newton_univariate( - function: Expr, - x0: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - for i in range(steps - 1): - x = x - f_prime(x) / f_prime_prime(x) - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def newton_bivariate( - function: Expr, - x0: float, - y0: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - for i in range(steps - 1): - hessian = np.array( - [ - [fxx(x, y), fxy(x, y)], - [fxy(x, y), fyy(x, y)], - ], - ) - grad = np.array([fx(x, y), fy(x, y)]) - - try: - # delta = hessian^-1 * grad - delta = np.linalg.solve(hessian, grad) - except np.linalg.LinAlgError: - # singular hessian - cannot proceed - break - - x = x - delta[0] - y = y - delta[1] - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def adagrad_univariate( - function: Expr, - x0: float, - learning_rate: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - v = 0 # accumulated squared gradients - for i in range(steps - 1): - g = f_prime(x) - v += g ** 2 - x = x - (learning_rate / (np.sqrt(v + epsilon))) * g - - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def adagrad_bivariate( - function: Expr, - x0: float, - y0: float, - learning_rate: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - # accumulated squared gradients - vx = 0 - vy = 0 - for i in range(steps - 1): - gx = fx(x, y) - gy = fy(x, y) - vx += gx ** 2 - vy += gy ** 2 - - x = x - (learning_rate / (np.sqrt(vx + epsilon))) * gx - y = y - (learning_rate / (np.sqrt(vy + epsilon))) * gy - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def rmsprop_univariate( - function: Expr, - x0: float, - learning_rate: float, - beta: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - v = 0 # exponentially weighted average of squared gradients - for i in range(steps - 1): - g = f_prime(x) - v = beta * v + (1 - beta) * g ** 2 - x = x - (learning_rate / (np.sqrt(v + epsilon))) * g - - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def rmsprop_bivariate( - function: Expr, - x0: float, - y0: float, - learning_rate: float, - beta: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - # exponentially weighted average of squared gradients - vx = 0 - vy = 0 - for i in range(steps - 1): - gx = fx(x, y) - gy = fy(x, y) - vx = beta * vx + (1 - beta) * gx ** 2 - vy = beta * vy + (1 - beta) * gy ** 2 - - x = x - (learning_rate / (np.sqrt(vx + epsilon))) * gx - y = y - (learning_rate / (np.sqrt(vy + epsilon))) * gy - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def adadelta_univariate( - function: Expr, - x0: float, - beta: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - v = 0 # exponentially weighted average of squared gradients - s = 0 # exponentially weighted average of squared updates - for i in range(steps - 1): - g = f_prime(x) - v = beta * v + (1 - beta) * g ** 2 - delta_x = - (np.sqrt(s + epsilon) / np.sqrt(v + epsilon)) * g - x = x + delta_x - - s = beta * s + (1 - beta) * delta_x ** 2 - - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def adadelta_bivariate( - function: Expr, - x0: float, - y0: float, - beta: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - # exponentially weighted average of squared gradients - vx = 0 - vy = 0 - # exponentially weighted average of squared updates - sx = 0 - sy = 0 - for i in range(steps - 1): - gx = fx(x, y) - gy = fy(x, y) - vx = beta * vx + (1 - beta) * gx ** 2 - vy = beta * vy + (1 - beta) * gy ** 2 - - delta_x = - (np.sqrt(sx + epsilon) / np.sqrt(vx + epsilon)) * gx - delta_y = - (np.sqrt(sy + epsilon) / np.sqrt(vy + epsilon)) * gy - - x = x + delta_x - y = y + delta_y - - sx = beta * sx + (1 - beta) * delta_x ** 2 - sy = beta * sy + (1 - beta) * delta_y ** 2 - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def adam_univariate( - function: Expr, - x0: float, - learning_rate: float, - beta1: float, - beta2: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - m = 0 # first moment - v = 0 # second moment - for i in range(steps - 1): - g = f_prime(x) - m = beta1 * m + (1 - beta1) * g - v = beta2 * v + (1 - beta2) * g ** 2 - - m_hat = m / (1 - beta1 ** (i + 1)) - v_hat = v / (1 - beta2 ** (i + 1)) - - x = x - (learning_rate / (np.sqrt(v_hat) + epsilon)) * m_hat - - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def adam_bivariate( - function: Expr, - x0: float, - y0: float, - learning_rate: float, - beta1: float, - beta2: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - # first moments - mx = 0 - my = 0 - # second moments - vx = 0 - vy = 0 - for i in range(steps - 1): - gx = fx(x, y) - gy = fy(x, y) - - mx = beta1 * mx + (1 - beta1) * gx - my = beta1 * my + (1 - beta1) * gy - - vx = beta2 * vx + (1 - beta2) * gx ** 2 - vy = beta2 * vy + (1 - beta2) * gy ** 2 - - mx_hat = mx / (1 - beta1 ** (i + 1)) - my_hat = my / (1 - beta1 ** (i + 1)) - - vx_hat = vx / (1 - beta2 ** (i + 1)) - vy_hat = vy / (1 - beta2 ** (i + 1)) - - x = x - (learning_rate / (np.sqrt(vx_hat) + epsilon)) * mx_hat - y = y - (learning_rate / (np.sqrt(vy_hat) + epsilon)) * my_hat - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } diff --git a/backend/src/optimization_manager.py b/backend/src/optimization_manager.py deleted file mode 100644 index 70c055ac81b09990062f6b157081386f190bef53..0000000000000000000000000000000000000000 --- a/backend/src/optimization_manager.py +++ /dev/null @@ -1,356 +0,0 @@ -import numpy as np -from sympy import ( - lambdify, - symbols, - sin, - cos, - tan, - asin, - acos, - atan, - exp, - log, - sqrt, - pi, - Abs, -) - -from sympy.parsing.sympy_parser import ( - standard_transformations, - implicit_multiplication_application, - convert_xor, - parse_expr, -) - -from optimization_logic import * - - -class OptimizationManager: - def __init__(self): - self.function_values = {"x": [], "y": []} - self.trajectory_values = {"x": [], "y": []} - self.settings = {} - - def handle_update_settings(self, new_settings) -> dict[str, dict] | None: - if new_settings == self.settings: - return None - - non_relayout_settings = (new_settings.keys() | self.settings.keys()) - {"xlim", "ylim"} - non_relayout_settings_changed = any( - new_settings.get(k) != self.settings.get(k) - for k in non_relayout_settings - ) - - self.settings = new_settings - - function = new_settings.get("functionExpr", "").strip() - mode = new_settings.get("mode", "").lower().strip() - xlim = new_settings.get("xlim", []) - ylim = new_settings.get("ylim", []) - - if not self._is_valid_function(function, mode, xlim, ylim): - return { - "trajectoryValues": {"x": [], "y": []}, - "functionValues": {"x": [], "y": []}, - } - - if non_relayout_settings_changed: - self._reset_trajectory() - - if not self._function_changed(function, mode): - return { - "trajectoryValues": self.trajectory_values, - } - - try: - self._compute_function_values(function, mode, xlim, ylim) - except Exception as e: - self.function_values = {"x": [], "y": []} - self.trajectory_values = {"x": [], "y": []} - - return { - "functionValues": self.function_values, - "trajectoryValues": self.trajectory_values, - } - - def handle_reset(self) -> dict[str, list]: - self._reset_trajectory() - return { - "trajectoryValues": self.trajectory_values, - } - - def handle_next_step(self) -> dict[str, list]: - current_steps = len(self.trajectory_values["x"]) - self._compute_trajectory_values(self.settings, current_steps + 1) - return { - "trajectoryValues": self.trajectory_values, - } - - def handle_prev_step(self) -> dict[str, list]: - current_steps = len(self.trajectory_values["x"]) - if current_steps > 1: - self._compute_trajectory_values(self.settings, current_steps - 1) - return { - "trajectoryValues": self.trajectory_values, - } - - def handle_play(self) -> dict[str, list]: - pass - - def handle_pause(self) -> dict[str, list]: - pass - - def _is_valid_function( - self, function: str, mode: str, xlim: list, ylim: list - ) -> bool: - # axis limit checks - if len(xlim) != 2 or len(ylim) != 2: - return False - if xlim[0] >= xlim[1] or ylim[0] >= ylim[1]: - return False - - # function expression check - try: - expr = self._parse_function(function) - except Exception as e: - return False - - if mode == "univariate" and symbols("y") in expr.free_symbols: - return False - - return True - - def _function_changed(self, function: str, mode: str) -> bool: - function = function.strip() - previous_function = self.settings.get("function", "").strip() - previous_mode = self.settings.get("mode", "") - return function != previous_function or mode != previous_mode - - def _reset_trajectory(self) -> None: - try: - self._compute_trajectory_values(self.settings, steps=1) - except Exception as e: - self.trajectory_values = {"x": [], "y": []} - - def _parse_function(self, function: str) -> Expr: - if not function.strip(): - raise ValueError("Function expression cannot be empty") - - x, y = symbols("x y") - allowed_locals = { - 'x': x, - 'y': y, - 'sin': sin, - 'cos': cos, - 'tan': tan, - 'asin': asin, - 'acos': acos, - 'atan': atan, - 'log': log, - 'ln': log, - 'sqrt': sqrt, - 'abs': Abs, - 'exp': exp, - 'e': exp(1), - 'pi': pi, - 'π': pi, - } - - try: - parsed_function = parse_expr( - function, - local_dict=allowed_locals, - transformations=standard_transformations + ( - implicit_multiplication_application, - convert_xor, - ), - evaluate=True, - ) - except Exception as e: - raise ValueError(f"Invalid function expression: {e}") - - unknown_symbols = parsed_function.free_symbols - {x, y} - if unknown_symbols: - unknown_names = ", ".join(sorted(str(s) for s in unknown_symbols)) - raise ValueError(f"Unknown variable(s): {unknown_names}. Allowed: x, y") - - return parsed_function - - def _compute_function_values(self, function: str, mode: str, xlim: list, ylim: list) -> None: - expr = self._parse_function(function) - - if mode == "univariate": - x = np.linspace(xlim[0], xlim[1], 101) - f = lambdify('x', expr, modules=['numpy']) - y = f(x) - - if not isinstance(y, np.ndarray): - y = np.full_like(x, y) - - self.function_values = { - "x": x.tolist(), - "y": y.tolist(), - } - - elif mode == "bivariate": - x = np.linspace(xlim[0], xlim[1], 101) - y = np.linspace(ylim[0], ylim[1], 101) - X, Y = np.meshgrid(x, y) - f = lambdify(('x', 'y'), expr, modules=['numpy']) - gradient_x = lambdify(('x', 'y'), expr.diff('x'), modules=['numpy']) - gradient_y = lambdify(('x', 'y'), expr.diff('y'), modules=['numpy']) - Z = f(X, Y) - gradient_x_values = gradient_x(X, Y) - gradient_y_values = gradient_y(X, Y) - - if not isinstance(Z, np.ndarray): - Z = np.full_like(X, Z) - if not isinstance(gradient_x_values, np.ndarray): - gradient_x_values = np.full_like(X, gradient_x_values) - if not isinstance(gradient_y_values, np.ndarray): - gradient_y_values = np.full_like(Y, gradient_y_values) - - self.function_values = { - "x": x.tolist(), - "y": y.tolist(), - "z": Z.tolist(), - "gradientX": gradient_x_values.tolist(), - "gradientY": gradient_y_values.tolist(), - } - - else: - raise ValueError("Unsupported mode") - - def _compute_trajectory_values(self, settings: dict, steps: int) -> None: - mode = settings.get("mode", "").lower().strip() - algorithm = settings.get("algorithm", "").lower().strip().replace(" ", "_") - function = self._parse_function(settings.get("functionExpr", "").strip()) - - if mode == "univariate": - if algorithm == "gradient_descent": - self.trajectory_values = gd_univariate( - function, - float(settings["x0"]), - float(settings["learningRate"]), - float(settings["momentum"]), - steps, - ) - elif algorithm == "nesterov": - self.trajectory_values = nesterov_univariate( - function, - float(settings["x0"]), - float(settings["learningRate"]), - float(settings["momentum"]), - steps, - ) - elif algorithm == "adam": - self.trajectory_values = adam_univariate( - function, - float(settings["x0"]), - float(settings["learningRate"]), - float(settings["beta1"]), - float(settings["beta2"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "adagrad": - self.trajectory_values = adagrad_univariate( - function, - float(settings["x0"]), - float(settings["learningRate"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "rmsprop": - self.trajectory_values = rmsprop_univariate( - function, - float(settings["x0"]), - float(settings["learningRate"]), - float(settings["beta"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "adadelta": - self.trajectory_values = adadelta_univariate( - function, - float(settings["x0"]), - float(settings["beta"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "newton": - self.trajectory_values = newton_univariate( - function, - float(settings["x0"]), - steps, - ) - else: - raise ValueError("Unsupported algorithm for univariate mode") - - elif mode == "bivariate": - if algorithm == "gradient_descent": - self.trajectory_values = gd_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["learningRate"]), - float(settings["momentum"]), - steps, - ) - elif algorithm == "nesterov": - self.trajectory_values = nesterov_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["learningRate"]), - float(settings["momentum"]), - steps, - ) - elif algorithm == "adam": - self.trajectory_values = adam_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["learningRate"]), - float(settings["beta1"]), - float(settings["beta2"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "adagrad": - self.trajectory_values = adagrad_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["learningRate"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "rmsprop": - self.trajectory_values = rmsprop_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["learningRate"]), - float(settings["beta"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "adadelta": - self.trajectory_values = adadelta_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["beta"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "newton": - self.trajectory_values = newton_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - steps, - ) - else: - raise ValueError("Unsupported algorithm for bivariate mode") diff --git a/backend/tests/test_contract.py b/backend/tests/test_contract.py new file mode 100644 index 0000000000000000000000000000000000000000..0d484e88972ed1249c196930d303766eb11342de --- /dev/null +++ b/backend/tests/test_contract.py @@ -0,0 +1,53 @@ +"""Replay each contract example in ../contract against a fresh Manager. + +Each example lists calls in order, keyed by method name. A call has "args" +(omitted for methods that take none) and either "result" (the expected return +value as JSON; floats are compared to 6 significant figures) or "error" (a +UserError of "kind": "user", whose text contains "message" if given). This +mirrors what @elvis/pyodide's worker sends to the UI. +""" + +import json +from pathlib import Path + +import pytest + +from manager import Manager + +CONTRACT_DIR = Path(__file__).parent.parent / "contract" +EXAMPLES = sorted(CONTRACT_DIR.glob("*.json")) + + +def same(actual, expected) -> bool: + """Equal JSON values, with floats compared approximately.""" + if isinstance(expected, float) or isinstance(actual, float): + return isinstance(actual, (int, float)) and actual == pytest.approx(expected, rel=1e-6, abs=1e-12) + if isinstance(expected, dict): + return isinstance(actual, dict) and actual.keys() == expected.keys() and all(same(actual[k], expected[k]) for k in expected) + if isinstance(expected, list): + return isinstance(actual, list) and len(actual) == len(expected) and all(same(a, e) for a, e in zip(actual, expected)) + return actual == expected + + +@pytest.mark.parametrize("path", EXAMPLES, ids=[p.stem for p in EXAMPLES]) +def test_contract_example(path: Path) -> None: + example = json.loads(path.read_text()) + manager = Manager() + + for method, call in example["calls"].items(): + fn = getattr(manager, method) + try: + data = fn(call["args"]) if "args" in call else fn() + except Exception as e: + # The worker treats only UserError as a user error; anything else is a bug + if type(e).__name__ != "UserError": + raise + assert "error" in call, f"{method} raised UserError: {e}" + assert call["error"]["kind"] == "user" + assert call["error"].get("message", "") in str(e) + continue + + assert "error" not in call, f"{method} returned {data!r} instead of raising UserError" + # Results must be plain JSON values (no NumPy types) to reach the UI unchanged + actual = json.loads(json.dumps(data)) + assert same(actual, call["result"]), f"{method} returned {actual!r}" diff --git a/backend/tests/test_logic.py b/backend/tests/test_logic.py new file mode 100644 index 0000000000000000000000000000000000000000..82fb22d2a44d2d9ce9d2c9d3777ab42bfdfe9a93 --- /dev/null +++ b/backend/tests/test_logic.py @@ -0,0 +1,244 @@ +import inspect +import json +from pathlib import Path + +import numpy as np +import pytest + +from logic import DIVERGED, OPTIMISERS, SINGULAR, Objective, Run, parse_function +from manager import MAX_ITERATIONS, Manager, UserError + +SPEC = json.loads((Path(__file__).parent.parent / "src" / "algorithms.json").read_text())["algorithms"] +DEFAULTS = {spec["id"]: {p["name"]: p["default"] for p in spec["params"]} for spec in SPEC} + + +def run(expression: str, algorithm: str, start: list[float], **params) -> Run: + f = Objective(parse_function(expression, len(start)), len(start)) + return Run(f, OPTIMISERS[algorithm](f, **(DEFAULTS[algorithm] | params)), np.array(start, dtype=float)) + + +def test_spec_matches_optimisers(): + assert [spec["id"] for spec in SPEC] == list(OPTIMISERS) + for spec in SPEC: + names = list(inspect.signature(OPTIMISERS[spec["id"]]).parameters)[1:] + assert names == [p["name"] for p in spec["params"]], spec["id"] + + +@pytest.mark.parametrize("expression, n, expected", [ + ("x^2 - 0.1cos(20x)", 1, 0.81 - 0.1 * np.cos(18)), + ("2x y + e", 2, 2 * 0.9 * -0.5 + np.e), + ("sqrt(abs(x)) + ln(exp(y))", 2, np.sqrt(0.9) - 0.5), +]) +def test_parse_function(expression, n, expected): + f = Objective(parse_function(expression, n), n) + point = np.array([0.9, -0.5][:n]) + assert f.value(point) == pytest.approx(expected) + + +@pytest.mark.parametrize("expression, message", [ + ("", "Enter a function"), + ("x^2 + (", "can read"), + ("x + z", "Unknown name z"), + # Only the listed functions: none of sympy's others, and nothing from Python + ("gamma(x)", "Unknown name gamma"), + ("factorial(x) + y", "Unknown name factorial"), + ("Max(x, y)", "Unknown name Max"), + ("__import__('os')", "Unknown name __import__"), + ("x.__class__", "Unknown name __class__"), +]) +def test_parse_function_errors(expression, message): + with pytest.raises(ValueError, match=message): + parse_function(expression, 2) + + +def test_unknown_names_list_what_can_be_used(): + with pytest.raises(ValueError, match="x and y, and sin, cos"): + parse_function("gamma(x)", 2) + with pytest.raises(ValueError, match="Unknown name y: functions can use x, and sin"): + parse_function("x + y", 1) + + +@pytest.mark.parametrize("expression, expected", [ + ("xy", 0.9 * -0.5), + ("2x y", 2 * 0.9 * -0.5), + ("π x", np.pi * 0.9), + ("e^x", np.exp(0.9)), + ("sin(x)cos(y)", np.sin(0.9) * np.cos(-0.5)), +]) +def test_implicit_multiplication_still_works(expression, expected): + f = Objective(parse_function(expression, 2), 2) + assert f.value(np.array([0.9, -0.5])) == pytest.approx(expected) + + +def test_a_function_that_fails_to_evaluate_is_a_user_error(monkeypatch): + # E.g. a derivative NumPy can't evaluate: caught when the function is set, not mid-run + import logic + from sympy import DiracDelta + monkeypatch.setattr(logic, "derivative", lambda expr, *v: DiracDelta(v[0])) + with pytest.raises(UserError, match="can't be evaluated"): + Manager().handle_set_function({"variables": 1, "expression": "x^2"}) + + +def test_gradient_and_hessian(): + f = Objective(parse_function("x^2 y + y^3", 2), 2) + p = np.array([1.0, 2.0]) + assert f.gradient(p).tolist() == [4.0, 13.0] + assert f.hessian(p).tolist() == [[4.0, 2.0], [2.0, 12.0]] + + +def test_abs_has_pytorch_derivatives(): + # As PyTorch's autograd: d|x|/dx = sign(x), 0 at the kink, and no curvature (not a Dirac delta) + f = Objective(parse_function("abs(x) + abs(x y)", 2), 2) + assert f.gradient(np.array([-2.0, 3.0])).tolist() == [-1.0 - 3.0, 2.0] + assert f.gradient(np.array([0.0, 0.0])).tolist() == [0.0, 0.0] + assert f.hessian(np.array([0.0, 0.0])).tolist() == [[0.0, 0.0], [0.0, 0.0]] + assert f.hessian(np.array([1.0, 2.0])).tolist() == [[0.0, 1.0], [1.0, 0.0]] + + +@pytest.mark.parametrize("algorithm", [spec["id"] for spec in SPEC if spec["id"] != "newton"]) +def test_every_first_order_optimiser_runs_on_abs(algorithm): + r = run("abs(x) + y^2", algorithm, [0.8, -0.6]) + assert r.point(50)["value"] < r.point(0)["value"] + + +def test_newton_stops_on_abs_with_no_curvature(): + r = run("abs(x)", "newton", [1.0]) + assert r.point(1) is None + assert r.stopped == SINGULAR + + +def test_gradient_descent_on_a_quadratic(): + # x_k = (1 - 2η)^k x_0 + r = run("x^2", "gradient_descent", [1.0], learning_rate=0.1) + assert r.point(10)["position"][0] == pytest.approx(0.8**10) + + +def test_momentum_overshoots_and_nesterov_damps_it(): + plain = run("x^2", "gradient_descent", [1.0], learning_rate=0.1, momentum=0.9) + nesterov = run("x^2", "nesterov", [1.0], learning_rate=0.1, momentum=0.9) + assert min(plain.point(k)["position"][0] for k in range(20)) < -0.5 + assert abs(nesterov.point(20)["position"][0]) < abs(plain.point(20)["position"][0]) + + +def test_newton_solves_a_quadratic_in_one_step(): + r = run("(x - 1)^2 + 3(y + 2)^2 + x y", "newton", [5.0, 5.0]) + assert r.point(1)["gradient"] == pytest.approx([0, 0], abs=1e-12) + + +@pytest.mark.parametrize("algorithm", [spec["id"] for spec in SPEC]) +def test_every_optimiser_goes_downhill_on_a_bowl(algorithm): + r = run("x^2 + 3y^2", algorithm, [0.8, -0.6]) + assert r.point(50)["value"] < r.point(0)["value"] + + +@pytest.mark.parametrize("algorithm, extra", [("adagrad", {}), ("rmsprop", {"beta": 0.0}), ("adam", {"beta1": 0.0, "beta2": 0.0})]) +def test_epsilon_is_outside_the_square_root(algorithm, extra): + # As PyTorch: x ← x − η g / (√v + ε). On x² from x = 1, g = 2 and v = g² = 4 + # (beta 0 keeps only the latest gradient), so the step is 0.1 · 2 / (2 + 1) + r = run("x^2", algorithm, [1.0], learning_rate=0.1, epsilon=1.0, **extra) + assert r.point(1)["position"][0] == pytest.approx(1 - 0.1 * 2 / 3) + + +def test_divergence_stops_the_run(): + r = run("x^2", "gradient_descent", [1.0], learning_rate=1.5) + # |x| doubles each step, so it passes 1e6 after 20 steps + assert r.point(20) is None and r.point(19) is not None + assert r.stopped == DIVERGED + + +def test_leaving_the_domain_stops_the_run(): + r = run("sqrt(x)", "gradient_descent", [0.5], learning_rate=1.0) + assert r.point(3) is None + assert r.stopped == DIVERGED + + +def test_singular_hessian_stops_newton(): + r = run("x^3", "newton", [0.0]) + assert r.point(1) is None + assert r.stopped == SINGULAR + + +def test_singular_hessian_stops_newton_in_pyodide(monkeypatch): + # Pyodide's solve returns inf rather than raising LinAlgError + monkeypatch.setattr(np.linalg, "solve", lambda a, b: np.full_like(b, np.inf)) + r = run("x^2 + 0y", "newton", [1.0, 1.0]) + assert r.point(1) is None + assert r.stopped == SINGULAR + + +def test_points_are_cached_and_asked_for_in_any_order(): + r = run("x^2 + y^2", "adam", [1.0, 1.0]) + late = r.point(30) + assert r.point(3) == r.points[3] + assert r.point(30) == late + + +def manager_with(expression: str, *runs: dict) -> Manager: + m = Manager() + m.handle_set_function({"variables": len(runs[0]["start"]), "expression": expression}) + m.handle_set_runs({"runs": list(runs)}) + return m + + +def test_state_past_the_last_iteration(): + m = manager_with("x^2", {"algorithm": "gradient_descent", "start": [1.0], "params": {}}) + assert m.handle_state({"iteration": MAX_ITERATIONS}) is not None + assert m.handle_state({"iteration": MAX_ITERATIONS + 1}) is None + + +def test_reaching_the_iteration_limit_says_so(): + m = manager_with("x^2", {"algorithm": "gradient_descent", "start": [1.0], "params": {"learning_rate": 0.001}}) + assert m.handle_state({"iteration": MAX_ITERATIONS - 1})["runs"][0]["stopped"] is None + assert m.handle_state({"iteration": MAX_ITERATIONS})["runs"][0]["stopped"] == "Reached the 1000-iteration limit." + + +def test_state_ends_when_every_run_has_stopped(): + m = manager_with( + "x^3 + x^2", + {"algorithm": "gradient_descent", "start": [1.0], "params": {"learning_rate": 1.5}}, + {"algorithm": "newton", "start": [-1/3], "params": {}}, # f'' = 0 here + ) + states = [m.handle_state({"iteration": k}) for k in range(MAX_ITERATIONS)] + end = states.index(None) + assert 1 < end and all(s is None for s in states[end:]) + # Newton stops first and says why while gradient descent carries on + assert states[1]["runs"][1] == {"point": None, "stopped": SINGULAR} + assert states[1]["runs"][0]["point"] is not None + # Each run says why at its last point + assert states[0]["runs"][1]["stopped"] == SINGULAR + assert states[end - 2]["runs"][0]["stopped"] is None + assert states[end - 1]["runs"][0]["stopped"] == DIVERGED + + +def test_start_point_outside_the_domain(): + m = Manager() + m.handle_set_function({"variables": 1, "expression": "log(x)"}) + with pytest.raises(UserError, match="no finite value at the initial point"): + m.handle_set_runs({"runs": [{"algorithm": "adam", "start": [-1.0], "params": {}}]}) + + +def test_failed_runs_replace_the_old_ones(): + m = manager_with("log(x)", {"algorithm": "adam", "start": [1.0], "params": {}}) + with pytest.raises(UserError): + m.handle_set_runs({"runs": [{"algorithm": "adam", "start": [-1.0], "params": {}}]}) + assert m.handle_state({"iteration": 0}) is None + + +def test_function_values_one_variable(): + m = Manager() + m.handle_set_function({"variables": 1, "expression": "log(x)"}) + values = m.handle_function_values({"x_range": [-1, 1], "y_range": [0, 1]}) + assert len(values["x"]) == len(values["f"]) + assert values["f"][0] is None and values["f"][-1] == 0.0 + + +def test_function_values_two_variables(): + m = Manager() + m.handle_set_function({"variables": 2, "expression": "x + 2y"}) + values = m.handle_function_values({"x_range": [0, 1], "y_range": [0, 2]}) + assert values["f"][-1][0] == 4.0 # rows follow y + assert set(values["arrows"]["u"]) == {1.0} and set(values["arrows"]["v"]) == {2.0} + + +def test_no_function_values_without_a_function(): + assert Manager().handle_function_values({"x_range": [0, 1], "y_range": [0, 1]}) is None diff --git a/backend/uv.lock b/backend/uv.lock index 4396599e8af15c1a161c6342a2795143de16d0c4..4668464235e1138bd0b5fdb6350d4f94da8d8bf1 100644 --- a/backend/uv.lock +++ b/backend/uv.lock @@ -1,67 +1,31 @@ version = 1 -revision = 3 -requires-python = ">=3.13" - -[[package]] -name = "annotated-doc" -version = "0.0.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4", size = 7288, upload-time = "2025-11-10T22:07:42.062Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1e/d3/26bf1008eb3d2daa8ef4cacc7f3bfdc11818d111f7e2d0201bc6e3b49d45/annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320", size = 5303, upload-time = "2025-11-10T22:07:40.673Z" }, -] - -[[package]] -name = "annotated-types" -version = "0.7.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, -] - -[[package]] -name = "anyio" -version = "4.12.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "idna" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/96/f0/5eb65b2bb0d09ac6776f2eb54adee6abe8228ea05b20a5ad0e4945de8aac/anyio-4.12.1.tar.gz", hash = "sha256:41cfcc3a4c85d3f05c932da7c26d0201ac36f72abd4435ba90d0464a3ffed703", size = 228685, upload-time = "2026-01-06T11:45:21.246Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/38/0e/27be9fdef66e72d64c0cdc3cc2823101b80585f8119b5c112c2e8f5f7dab/anyio-4.12.1-py3-none-any.whl", hash = "sha256:d405828884fc140aa80a3c667b8beed277f1dfedec42ba031bd6ac3db606ab6c", size = 113592, upload-time = "2026-01-06T11:45:19.497Z" }, -] +revision = 5 +requires-python = "==3.12.*" [[package]] name = "backend" version = "0.1.0" source = { virtual = "." } dependencies = [ - { name = "fastapi" }, + { name = "mpmath" }, { name = "numpy" }, { name = "sympy" }, - { name = "uvicorn", extra = ["standard"] }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, ] [package.metadata] requires-dist = [ - { name = "fastapi", specifier = ">=0.128.0" }, - { name = "numpy", specifier = ">=2.4.0" }, - { name = "sympy", specifier = ">=1.14.0" }, - { name = "uvicorn", extras = ["standard"], specifier = ">=0.40.0" }, + { name = "mpmath", specifier = "==1.3.0" }, + { name = "numpy", specifier = "==1.26.4" }, + { name = "sympy", specifier = "==1.12" }, ] -[[package]] -name = "click" -version = "8.3.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/3d/fa/656b739db8587d7b5dfa22e22ed02566950fbfbcdc20311993483657a5c0/click-8.3.1.tar.gz", hash = "sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a", size = 295065, upload-time = "2025-11-15T20:45:42.706Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/98/78/01c019cdb5d6498122777c1a43056ebb3ebfeef2076d9d026bfe15583b2b/click-8.3.1-py3-none-any.whl", hash = "sha256:981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6", size = 108274, upload-time = "2025-11-15T20:45:41.139Z" }, -] +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=9.2.0" }] [[package]] name = "colorama" @@ -73,58 +37,12 @@ wheels = [ ] [[package]] -name = "fastapi" -version = "0.128.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "annotated-doc" }, - { name = "pydantic" }, - { name = "starlette" }, - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/52/08/8c8508db6c7b9aae8f7175046af41baad690771c9bcde676419965e338c7/fastapi-0.128.0.tar.gz", hash = "sha256:1cc179e1cef10a6be60ffe429f79b829dce99d8de32d7acb7e6c8dfdf7f2645a", size = 365682, upload-time = "2025-12-27T15:21:13.714Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5c/05/5cbb59154b093548acd0f4c7c474a118eda06da25aa75c616b72d8fcd92a/fastapi-0.128.0-py3-none-any.whl", hash = "sha256:aebd93f9716ee3b4f4fcfe13ffb7cf308d99c9f3ab5622d8877441072561582d", size = 103094, upload-time = "2025-12-27T15:21:12.154Z" }, -] - -[[package]] -name = "h11" -version = "0.16.0" +name = "iniconfig" +version = "2.3.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +sdist = { url = "https://files.pythonhosted.org/packages/01/e1/2069291243c926a2ff1cd706c7f3eeb9b62144bf60f77c9fb9ff2fb26bd3/iniconfig-2.3.1.tar.gz", hash = "sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960", size = 21209, upload-time = "2026-10-06T22:48:38.076Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, -] - -[[package]] -name = "httptools" -version = "0.7.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b5/46/120a669232c7bdedb9d52d4aeae7e6c7dfe151e99dc70802e2fc7a5e1993/httptools-0.7.1.tar.gz", hash = "sha256:abd72556974f8e7c74a259655924a717a2365b236c882c3f6f8a45fe94703ac9", size = 258961, upload-time = "2025-10-10T03:55:08.559Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/09/8f/c77b1fcbfd262d422f12da02feb0d218fa228d52485b77b953832105bb90/httptools-0.7.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6babce6cfa2a99545c60bfef8bee0cc0545413cb0018f617c8059a30ad985de3", size = 202889, upload-time = "2025-10-10T03:54:47.089Z" }, - { url = "https://files.pythonhosted.org/packages/0a/1a/22887f53602feaa066354867bc49a68fc295c2293433177ee90870a7d517/httptools-0.7.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:601b7628de7504077dd3dcb3791c6b8694bbd967148a6d1f01806509254fb1ca", size = 108180, upload-time = "2025-10-10T03:54:48.052Z" }, - { url = "https://files.pythonhosted.org/packages/32/6a/6aaa91937f0010d288d3d124ca2946d48d60c3a5ee7ca62afe870e3ea011/httptools-0.7.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:04c6c0e6c5fb0739c5b8a9eb046d298650a0ff38cf42537fc372b28dc7e4472c", size = 478596, upload-time = "2025-10-10T03:54:48.919Z" }, - { url = "https://files.pythonhosted.org/packages/6d/70/023d7ce117993107be88d2cbca566a7c1323ccbaf0af7eabf2064fe356f6/httptools-0.7.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:69d4f9705c405ae3ee83d6a12283dc9feba8cc6aaec671b412917e644ab4fa66", size = 473268, upload-time = "2025-10-10T03:54:49.993Z" }, - { url = "https://files.pythonhosted.org/packages/32/4d/9dd616c38da088e3f436e9a616e1d0cc66544b8cdac405cc4e81c8679fc7/httptools-0.7.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:44c8f4347d4b31269c8a9205d8a5ee2df5322b09bbbd30f8f862185bb6b05346", size = 455517, upload-time = "2025-10-10T03:54:51.066Z" }, - { url = "https://files.pythonhosted.org/packages/1d/3a/a6c595c310b7df958e739aae88724e24f9246a514d909547778d776799be/httptools-0.7.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:465275d76db4d554918aba40bf1cbebe324670f3dfc979eaffaa5d108e2ed650", size = 458337, upload-time = "2025-10-10T03:54:52.196Z" }, - { url = "https://files.pythonhosted.org/packages/fd/82/88e8d6d2c51edc1cc391b6e044c6c435b6aebe97b1abc33db1b0b24cd582/httptools-0.7.1-cp313-cp313-win_amd64.whl", hash = "sha256:322d00c2068d125bd570f7bf78b2d367dad02b919d8581d7476d8b75b294e3e6", size = 85743, upload-time = "2025-10-10T03:54:53.448Z" }, - { url = "https://files.pythonhosted.org/packages/34/50/9d095fcbb6de2d523e027a2f304d4551855c2f46e0b82befd718b8b20056/httptools-0.7.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:c08fe65728b8d70b6923ce31e3956f859d5e1e8548e6f22ec520a962c6757270", size = 203619, upload-time = "2025-10-10T03:54:54.321Z" }, - { url = "https://files.pythonhosted.org/packages/07/f0/89720dc5139ae54b03f861b5e2c55a37dba9a5da7d51e1e824a1f343627f/httptools-0.7.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:7aea2e3c3953521c3c51106ee11487a910d45586e351202474d45472db7d72d3", size = 108714, upload-time = "2025-10-10T03:54:55.163Z" }, - { url = "https://files.pythonhosted.org/packages/b3/cb/eea88506f191fb552c11787c23f9a405f4c7b0c5799bf73f2249cd4f5228/httptools-0.7.1-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:0e68b8582f4ea9166be62926077a3334064d422cf08ab87d8b74664f8e9058e1", size = 472909, upload-time = "2025-10-10T03:54:56.056Z" }, - { url = "https://files.pythonhosted.org/packages/e0/4a/a548bdfae6369c0d078bab5769f7b66f17f1bfaa6fa28f81d6be6959066b/httptools-0.7.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:df091cf961a3be783d6aebae963cc9b71e00d57fa6f149025075217bc6a55a7b", size = 470831, upload-time = "2025-10-10T03:54:57.219Z" }, - { url = "https://files.pythonhosted.org/packages/4d/31/14df99e1c43bd132eec921c2e7e11cda7852f65619bc0fc5bdc2d0cb126c/httptools-0.7.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:f084813239e1eb403ddacd06a30de3d3e09a9b76e7894dcda2b22f8a726e9c60", size = 452631, upload-time = "2025-10-10T03:54:58.219Z" }, - { url = "https://files.pythonhosted.org/packages/22/d2/b7e131f7be8d854d48cb6d048113c30f9a46dca0c9a8b08fcb3fcd588cdc/httptools-0.7.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:7347714368fb2b335e9063bc2b96f2f87a9ceffcd9758ac295f8bbcd3ffbc0ca", size = 452910, upload-time = "2025-10-10T03:54:59.366Z" }, - { url = "https://files.pythonhosted.org/packages/53/cf/878f3b91e4e6e011eff6d1fa9ca39f7eb17d19c9d7971b04873734112f30/httptools-0.7.1-cp314-cp314-win_amd64.whl", hash = "sha256:cfabda2a5bb85aa2a904ce06d974a3f30fb36cc63d7feaddec05d2050acede96", size = 88205, upload-time = "2025-10-10T03:55:00.389Z" }, -] - -[[package]] -name = "idna" -version = "3.11" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" }, + { url = "https://files.pythonhosted.org/packages/56/43/4ca9e49d27a1fcf6bece6f6aec0ea46bb9112489b93d4b688fb415457bdb/iniconfig-2.3.1-py3-none-any.whl", hash = "sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7", size = 7552, upload-time = "2026-10-06T22:48:36.959Z" }, ] [[package]] @@ -138,335 +56,71 @@ wheels = [ [[package]] name = "numpy" -version = "2.4.0" +version = "1.26.4" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a4/7a/6a3d14e205d292b738db449d0de649b373a59edb0d0b4493821d0a3e8718/numpy-2.4.0.tar.gz", hash = "sha256:6e504f7b16118198f138ef31ba24d985b124c2c469fe8467007cf30fd992f934", size = 20685720, upload-time = "2025-12-20T16:18:19.023Z" } +sdist = { url = "https://files.pythonhosted.org/packages/65/6e/09db70a523a96d25e115e71cc56a6f9031e7b8cd166c1ac8438307c14058/numpy-1.26.4.tar.gz", hash = "sha256:2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010", size = 15786129, upload-time = "2024-02-06T00:26:44.495Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a7/0d/853fd96372eda07c824d24adf02e8bc92bb3731b43a9b2a39161c3667cc4/numpy-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a152d86a3ae00ba5f47b3acf3b827509fd0b6cb7d3259665e63dafbad22a75ea", size = 16649088, upload-time = "2025-12-20T16:16:31.421Z" }, - { url = "https://files.pythonhosted.org/packages/e3/37/cc636f1f2a9f585434e20a3e6e63422f70bfe4f7f6698e941db52ea1ac9a/numpy-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:39b19251dec4de8ff8496cd0806cbe27bf0684f765abb1f4809554de93785f2d", size = 12364065, upload-time = "2025-12-20T16:16:33.491Z" }, - { url = "https://files.pythonhosted.org/packages/ed/69/0b78f37ca3690969beee54103ce5f6021709134e8020767e93ba691a72f1/numpy-2.4.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:009bd0ea12d3c784b6639a8457537016ce5172109e585338e11334f6a7bb88ee", size = 5192640, upload-time = "2025-12-20T16:16:35.636Z" }, - { url = "https://files.pythonhosted.org/packages/1d/2a/08569f8252abf590294dbb09a430543ec8f8cc710383abfb3e75cc73aeda/numpy-2.4.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:5fe44e277225fd3dff6882d86d3d447205d43532c3627313d17e754fb3905a0e", size = 6541556, upload-time = "2025-12-20T16:16:37.276Z" }, - { url = "https://files.pythonhosted.org/packages/93/e9/a949885a4e177493d61519377952186b6cbfdf1d6002764c664ba28349b5/numpy-2.4.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f935c4493eda9069851058fa0d9e39dbf6286be690066509305e52912714dbb2", size = 14396562, upload-time = "2025-12-20T16:16:38.953Z" }, - { url = "https://files.pythonhosted.org/packages/99/98/9d4ad53b0e9ef901c2ef1d550d2136f5ac42d3fd2988390a6def32e23e48/numpy-2.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8cfa5f29a695cb7438965e6c3e8d06e0416060cf0d709c1b1c1653a939bf5c2a", size = 16351719, upload-time = "2025-12-20T16:16:41.503Z" }, - { url = "https://files.pythonhosted.org/packages/28/de/5f3711a38341d6e8dd619f6353251a0cdd07f3d6d101a8fd46f4ef87f895/numpy-2.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ba0cb30acd3ef11c94dc27fbfba68940652492bc107075e7ffe23057f9425681", size = 16176053, upload-time = "2025-12-20T16:16:44.552Z" }, - { url = "https://files.pythonhosted.org/packages/2a/5b/2a3753dc43916501b4183532e7ace862e13211042bceafa253afb5c71272/numpy-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:60e8c196cd82cbbd4f130b5290007e13e6de3eca79f0d4d38014769d96a7c475", size = 18277859, upload-time = "2025-12-20T16:16:47.174Z" }, - { url = "https://files.pythonhosted.org/packages/2c/c5/a18bcdd07a941db3076ef489d036ab16d2bfc2eae0cf27e5a26e29189434/numpy-2.4.0-cp313-cp313-win32.whl", hash = "sha256:5f48cb3e88fbc294dc90e215d86fbaf1c852c63dbdb6c3a3e63f45c4b57f7344", size = 5953849, upload-time = "2025-12-20T16:16:49.554Z" }, - { url = "https://files.pythonhosted.org/packages/4f/f1/719010ff8061da6e8a26e1980cf090412d4f5f8060b31f0c45d77dd67a01/numpy-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:a899699294f28f7be8992853c0c60741f16ff199205e2e6cdca155762cbaa59d", size = 12302840, upload-time = "2025-12-20T16:16:51.227Z" }, - { url = "https://files.pythonhosted.org/packages/f5/5a/b3d259083ed8b4d335270c76966cb6cf14a5d1b69e1a608994ac57a659e6/numpy-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:9198f447e1dc5647d07c9a6bbe2063cc0132728cc7175b39dbc796da5b54920d", size = 10308509, upload-time = "2025-12-20T16:16:53.313Z" }, - { url = "https://files.pythonhosted.org/packages/31/01/95edcffd1bb6c0633df4e808130545c4f07383ab629ac7e316fb44fff677/numpy-2.4.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:74623f2ab5cc3f7c886add4f735d1031a1d2be4a4ae63c0546cfd74e7a31ddf6", size = 12491815, upload-time = "2025-12-20T16:16:55.496Z" }, - { url = "https://files.pythonhosted.org/packages/59/ea/5644b8baa92cc1c7163b4b4458c8679852733fa74ca49c942cfa82ded4e0/numpy-2.4.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:0804a8e4ab070d1d35496e65ffd3cf8114c136a2b81f61dfab0de4b218aacfd5", size = 5320321, upload-time = "2025-12-20T16:16:57.468Z" }, - { url = "https://files.pythonhosted.org/packages/26/4e/e10938106d70bc21319bd6a86ae726da37edc802ce35a3a71ecdf1fdfe7f/numpy-2.4.0-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:02a2038eb27f9443a8b266a66911e926566b5a6ffd1a689b588f7f35b81e7dc3", size = 6641635, upload-time = "2025-12-20T16:16:59.379Z" }, - { url = "https://files.pythonhosted.org/packages/b3/8d/a8828e3eaf5c0b4ab116924df82f24ce3416fa38d0674d8f708ddc6c8aac/numpy-2.4.0-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1889b3a3f47a7b5bee16bc25a2145bd7cb91897f815ce3499db64c7458b6d91d", size = 14456053, upload-time = "2025-12-20T16:17:01.768Z" }, - { url = "https://files.pythonhosted.org/packages/68/a1/17d97609d87d4520aa5ae2dcfb32305654550ac6a35effb946d303e594ce/numpy-2.4.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:85eef4cb5625c47ee6425c58a3502555e10f45ee973da878ac8248ad58c136f3", size = 16401702, upload-time = "2025-12-20T16:17:04.235Z" }, - { url = "https://files.pythonhosted.org/packages/18/32/0f13c1b2d22bea1118356b8b963195446f3af124ed7a5adfa8fdecb1b6ca/numpy-2.4.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:6dc8b7e2f4eb184b37655195f421836cfae6f58197b67e3ffc501f1333d993fa", size = 16242493, upload-time = "2025-12-20T16:17:06.856Z" }, - { url = "https://files.pythonhosted.org/packages/ae/23/48f21e3d309fbc137c068a1475358cbd3a901b3987dcfc97a029ab3068e2/numpy-2.4.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:44aba2f0cafd287871a495fb3163408b0bd25bbce135c6f621534a07f4f7875c", size = 18324222, upload-time = "2025-12-20T16:17:09.392Z" }, - { url = "https://files.pythonhosted.org/packages/ac/52/41f3d71296a3dcaa4f456aaa3c6fc8e745b43d0552b6bde56571bb4b4a0f/numpy-2.4.0-cp313-cp313t-win32.whl", hash = "sha256:20c115517513831860c573996e395707aa9fb691eb179200125c250e895fcd93", size = 6076216, upload-time = "2025-12-20T16:17:11.437Z" }, - { url = "https://files.pythonhosted.org/packages/35/ff/46fbfe60ab0710d2a2b16995f708750307d30eccbb4c38371ea9e986866e/numpy-2.4.0-cp313-cp313t-win_amd64.whl", hash = "sha256:b48e35f4ab6f6a7597c46e301126ceba4c44cd3280e3750f85db48b082624fa4", size = 12444263, upload-time = "2025-12-20T16:17:13.182Z" }, - { url = "https://files.pythonhosted.org/packages/a3/e3/9189ab319c01d2ed556c932ccf55064c5d75bb5850d1df7a482ce0badead/numpy-2.4.0-cp313-cp313t-win_arm64.whl", hash = "sha256:4d1cfce39e511069b11e67cd0bd78ceff31443b7c9e5c04db73c7a19f572967c", size = 10378265, upload-time = "2025-12-20T16:17:15.211Z" }, - { url = "https://files.pythonhosted.org/packages/ab/ed/52eac27de39d5e5a6c9aadabe672bc06f55e24a3d9010cd1183948055d76/numpy-2.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:c95eb6db2884917d86cde0b4d4cf31adf485c8ec36bf8696dd66fa70de96f36b", size = 16647476, upload-time = "2025-12-20T16:17:17.671Z" }, - { url = "https://files.pythonhosted.org/packages/77/c0/990ce1b7fcd4e09aeaa574e2a0a839589e4b08b2ca68070f1acb1fea6736/numpy-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:65167da969cd1ec3a1df31cb221ca3a19a8aaa25370ecb17d428415e93c1935e", size = 12374563, upload-time = "2025-12-20T16:17:20.216Z" }, - { url = "https://files.pythonhosted.org/packages/37/7c/8c5e389c6ae8f5fd2277a988600d79e9625db3fff011a2d87ac80b881a4c/numpy-2.4.0-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:3de19cfecd1465d0dcf8a5b5ea8b3155b42ed0b639dba4b71e323d74f2a3be5e", size = 5203107, upload-time = "2025-12-20T16:17:22.47Z" }, - { url = "https://files.pythonhosted.org/packages/e6/94/ca5b3bd6a8a70a5eec9a0b8dd7f980c1eff4b8a54970a9a7fef248ef564f/numpy-2.4.0-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:6c05483c3136ac4c91b4e81903cb53a8707d316f488124d0398499a4f8e8ef51", size = 6538067, upload-time = "2025-12-20T16:17:24.001Z" }, - { url = "https://files.pythonhosted.org/packages/79/43/993eb7bb5be6761dde2b3a3a594d689cec83398e3f58f4758010f3b85727/numpy-2.4.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36667db4d6c1cea79c8930ab72fadfb4060feb4bfe724141cd4bd064d2e5f8ce", size = 14411926, upload-time = "2025-12-20T16:17:25.822Z" }, - { url = "https://files.pythonhosted.org/packages/03/75/d4c43b61de473912496317a854dac54f1efec3eeb158438da6884b70bb90/numpy-2.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9a818668b674047fd88c4cddada7ab8f1c298812783e8328e956b78dc4807f9f", size = 16354295, upload-time = "2025-12-20T16:17:28.308Z" }, - { url = "https://files.pythonhosted.org/packages/b8/0a/b54615b47ee8736a6461a4bb6749128dd3435c5a759d5663f11f0e9af4ac/numpy-2.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:1ee32359fb7543b7b7bd0b2f46294db27e29e7bbdf70541e81b190836cd83ded", size = 16190242, upload-time = "2025-12-20T16:17:30.993Z" }, - { url = "https://files.pythonhosted.org/packages/98/ce/ea207769aacad6246525ec6c6bbd66a2bf56c72443dc10e2f90feed29290/numpy-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:e493962256a38f58283de033d8af176c5c91c084ea30f15834f7545451c42059", size = 18280875, upload-time = "2025-12-20T16:17:33.327Z" }, - { url = "https://files.pythonhosted.org/packages/17/ef/ec409437aa962ea372ed601c519a2b141701683ff028f894b7466f0ab42b/numpy-2.4.0-cp314-cp314-win32.whl", hash = "sha256:6bbaebf0d11567fa8926215ae731e1d58e6ec28a8a25235b8a47405d301332db", size = 6002530, upload-time = "2025-12-20T16:17:35.729Z" }, - { url = "https://files.pythonhosted.org/packages/5f/4a/5cb94c787a3ed1ac65e1271b968686521169a7b3ec0b6544bb3ca32960b0/numpy-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:3d857f55e7fdf7c38ab96c4558c95b97d1c685be6b05c249f5fdafcbd6f9899e", size = 12435890, upload-time = "2025-12-20T16:17:37.599Z" }, - { url = "https://files.pythonhosted.org/packages/48/a0/04b89db963af9de1104975e2544f30de89adbf75b9e75f7dd2599be12c79/numpy-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:bb50ce5fb202a26fd5404620e7ef820ad1ab3558b444cb0b55beb7ef66cd2d63", size = 10591892, upload-time = "2025-12-20T16:17:39.649Z" }, - { url = "https://files.pythonhosted.org/packages/53/e5/d74b5ccf6712c06c7a545025a6a71bfa03bdc7e0568b405b0d655232fd92/numpy-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:355354388cba60f2132df297e2d53053d4063f79077b67b481d21276d61fc4df", size = 12494312, upload-time = "2025-12-20T16:17:41.714Z" }, - { url = "https://files.pythonhosted.org/packages/c2/08/3ca9cc2ddf54dfee7ae9a6479c071092a228c68aef08252aa08dac2af002/numpy-2.4.0-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:1d8f9fde5f6dc1b6fc34df8162f3b3079365468703fee7f31d4e0cc8c63baed9", size = 5322862, upload-time = "2025-12-20T16:17:44.145Z" }, - { url = "https://files.pythonhosted.org/packages/87/74/0bb63a68394c0c1e52670cfff2e309afa41edbe11b3327d9af29e4383f34/numpy-2.4.0-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:e0434aa22c821f44eeb4c650b81c7fbdd8c0122c6c4b5a576a76d5a35625ecd9", size = 6644986, upload-time = "2025-12-20T16:17:46.203Z" }, - { url = "https://files.pythonhosted.org/packages/06/8f/9264d9bdbcf8236af2823623fe2f3981d740fc3461e2787e231d97c38c28/numpy-2.4.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:40483b2f2d3ba7aad426443767ff5632ec3156ef09742b96913787d13c336471", size = 14457958, upload-time = "2025-12-20T16:17:48.017Z" }, - { url = "https://files.pythonhosted.org/packages/8c/d9/f9a69ae564bbc7236a35aa883319364ef5fd41f72aa320cc1cbe66148fe2/numpy-2.4.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d9e6a7664ddd9746e20b7325351fe1a8408d0a2bf9c63b5e898290ddc8f09544", size = 16398394, upload-time = "2025-12-20T16:17:50.409Z" }, - { url = "https://files.pythonhosted.org/packages/34/c7/39241501408dde7f885d241a98caba5421061a2c6d2b2197ac5e3aa842d8/numpy-2.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ecb0019d44f4cdb50b676c5d0cb4b1eae8e15d1ed3d3e6639f986fc92b2ec52c", size = 16241044, upload-time = "2025-12-20T16:17:52.661Z" }, - { url = "https://files.pythonhosted.org/packages/7c/95/cae7effd90e065a95e59fe710eeee05d7328ed169776dfdd9f789e032125/numpy-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:d0ffd9e2e4441c96a9c91ec1783285d80bf835b677853fc2770a89d50c1e48ac", size = 18321772, upload-time = "2025-12-20T16:17:54.947Z" }, - { url = "https://files.pythonhosted.org/packages/96/df/3c6c279accd2bfb968a76298e5b276310bd55d243df4fa8ac5816d79347d/numpy-2.4.0-cp314-cp314t-win32.whl", hash = "sha256:77f0d13fa87036d7553bf81f0e1fe3ce68d14c9976c9851744e4d3e91127e95f", size = 6148320, upload-time = "2025-12-20T16:17:57.249Z" }, - { url = "https://files.pythonhosted.org/packages/92/8d/f23033cce252e7a75cae853d17f582e86534c46404dea1c8ee094a9d6d84/numpy-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b1f5b45829ac1848893f0ddf5cb326110604d6df96cdc255b0bf9edd154104d4", size = 12623460, upload-time = "2025-12-20T16:17:58.963Z" }, - { url = "https://files.pythonhosted.org/packages/a4/4f/1f8475907d1a7c4ef9020edf7f39ea2422ec896849245f00688e4b268a71/numpy-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:23a3e9d1a6f360267e8fbb38ba5db355a6a7e9be71d7fce7ab3125e88bb646c8", size = 10661799, upload-time = "2025-12-20T16:18:01.078Z" }, + { url = "https://files.pythonhosted.org/packages/95/12/8f2020a8e8b8383ac0177dc9570aad031a3beb12e38847f7129bacd96228/numpy-1.26.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b3ce300f3644fb06443ee2222c2201dd3a89ea6040541412b8fa189341847218", size = 20335901, upload-time = "2024-02-05T23:55:32.801Z" }, + { url = "https://files.pythonhosted.org/packages/75/5b/ca6c8bd14007e5ca171c7c03102d17b4f4e0ceb53957e8c44343a9546dcc/numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:03a8c78d01d9781b28a6989f6fa1bb2c4f2d51201cf99d3dd875df6fbd96b23b", size = 13685868, upload-time = "2024-02-05T23:55:56.28Z" }, + { url = "https://files.pythonhosted.org/packages/79/f8/97f10e6755e2a7d027ca783f63044d5b1bc1ae7acb12afe6a9b4286eac17/numpy-1.26.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9fad7dcb1aac3c7f0584a5a8133e3a43eeb2fe127f47e3632d43d677c66c102b", size = 13925109, upload-time = "2024-02-05T23:56:20.368Z" }, + { url = "https://files.pythonhosted.org/packages/0f/50/de23fde84e45f5c4fda2488c759b69990fd4512387a8632860f3ac9cd225/numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:675d61ffbfa78604709862923189bad94014bef562cc35cf61d3a07bba02a7ed", size = 17950613, upload-time = "2024-02-05T23:56:56.054Z" }, + { url = "https://files.pythonhosted.org/packages/4c/0c/9c603826b6465e82591e05ca230dfc13376da512b25ccd0894709b054ed0/numpy-1.26.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ab47dbe5cc8210f55aa58e4805fe224dac469cde56b9f731a4c098b91917159a", size = 13572172, upload-time = "2024-02-05T23:57:21.56Z" }, + { url = "https://files.pythonhosted.org/packages/76/8c/2ba3902e1a0fc1c74962ea9bb33a534bb05984ad7ff9515bf8d07527cadd/numpy-1.26.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:1dda2e7b4ec9dd512f84935c5f126c8bd8b9f2fc001e9f54af255e8c5f16b0e0", size = 17786643, upload-time = "2024-02-05T23:57:56.585Z" }, + { url = "https://files.pythonhosted.org/packages/28/4a/46d9e65106879492374999e76eb85f87b15328e06bd1550668f79f7b18c6/numpy-1.26.4-cp312-cp312-win32.whl", hash = "sha256:50193e430acfc1346175fcbdaa28ffec49947a06918b7b92130744e81e640110", size = 5677803, upload-time = "2024-02-05T23:58:08.963Z" }, + { url = "https://files.pythonhosted.org/packages/16/2e/86f24451c2d530c88daf997cb8d6ac622c1d40d19f5a031ed68a4b73a374/numpy-1.26.4-cp312-cp312-win_amd64.whl", hash = "sha256:08beddf13648eb95f8d867350f6a018a4be2e5ad54c8d8caed89ebca558b2818", size = 15517754, upload-time = "2024-02-05T23:58:36.364Z" }, ] [[package]] -name = "pydantic" -version = "2.12.5" +name = "packaging" +version = "26.3" source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "annotated-types" }, - { name = "pydantic-core" }, - { name = "typing-extensions" }, - { name = "typing-inspection" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" }, + { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" }, ] [[package]] -name = "pydantic-core" -version = "2.41.5" +name = "pluggy" +version = "1.7.0" source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/87/06/8806241ff1f70d9939f9af039c6c35f2360cf16e93c2ca76f184e76b1564/pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9", size = 2120403, upload-time = "2025-11-04T13:40:25.248Z" }, - { url = "https://files.pythonhosted.org/packages/94/02/abfa0e0bda67faa65fef1c84971c7e45928e108fe24333c81f3bfe35d5f5/pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34", size = 1896206, upload-time = "2025-11-04T13:40:27.099Z" }, - { url = "https://files.pythonhosted.org/packages/15/df/a4c740c0943e93e6500f9eb23f4ca7ec9bf71b19e608ae5b579678c8d02f/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0", size = 1919307, upload-time = "2025-11-04T13:40:29.806Z" }, - { url = "https://files.pythonhosted.org/packages/9a/e3/6324802931ae1d123528988e0e86587c2072ac2e5394b4bc2bc34b61ff6e/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:03ca43e12fab6023fc79d28ca6b39b05f794ad08ec2feccc59a339b02f2b3d33", size = 2063258, upload-time = "2025-11-04T13:40:33.544Z" }, - { url = "https://files.pythonhosted.org/packages/c9/d4/2230d7151d4957dd79c3044ea26346c148c98fbf0ee6ebd41056f2d62ab5/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc799088c08fa04e43144b164feb0c13f9a0bc40503f8df3e9fde58a3c0c101e", size = 2214917, upload-time = "2025-11-04T13:40:35.479Z" }, - { url = "https://files.pythonhosted.org/packages/e6/9f/eaac5df17a3672fef0081b6c1bb0b82b33ee89aa5cec0d7b05f52fd4a1fa/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97aeba56665b4c3235a0e52b2c2f5ae9cd071b8a8310ad27bddb3f7fb30e9aa2", size = 2332186, upload-time = "2025-11-04T13:40:37.436Z" }, - { url = "https://files.pythonhosted.org/packages/cf/4e/35a80cae583a37cf15604b44240e45c05e04e86f9cfd766623149297e971/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:406bf18d345822d6c21366031003612b9c77b3e29ffdb0f612367352aab7d586", size = 2073164, upload-time = "2025-11-04T13:40:40.289Z" }, - { url = "https://files.pythonhosted.org/packages/bf/e3/f6e262673c6140dd3305d144d032f7bd5f7497d3871c1428521f19f9efa2/pydantic_core-2.41.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b93590ae81f7010dbe380cdeab6f515902ebcbefe0b9327cc4804d74e93ae69d", size = 2179146, upload-time = "2025-11-04T13:40:42.809Z" }, - { url = "https://files.pythonhosted.org/packages/75/c7/20bd7fc05f0c6ea2056a4565c6f36f8968c0924f19b7d97bbfea55780e73/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:01a3d0ab748ee531f4ea6c3e48ad9dac84ddba4b0d82291f87248f2f9de8d740", size = 2137788, upload-time = "2025-11-04T13:40:44.752Z" }, - { url = "https://files.pythonhosted.org/packages/3a/8d/34318ef985c45196e004bc46c6eab2eda437e744c124ef0dbe1ff2c9d06b/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:6561e94ba9dacc9c61bce40e2d6bdc3bfaa0259d3ff36ace3b1e6901936d2e3e", size = 2340133, upload-time = "2025-11-04T13:40:46.66Z" }, - { url = "https://files.pythonhosted.org/packages/9c/59/013626bf8c78a5a5d9350d12e7697d3d4de951a75565496abd40ccd46bee/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:915c3d10f81bec3a74fbd4faebe8391013ba61e5a1a8d48c4455b923bdda7858", size = 2324852, upload-time = "2025-11-04T13:40:48.575Z" }, - { url = "https://files.pythonhosted.org/packages/1a/d9/c248c103856f807ef70c18a4f986693a46a8ffe1602e5d361485da502d20/pydantic_core-2.41.5-cp313-cp313-win32.whl", hash = "sha256:650ae77860b45cfa6e2cdafc42618ceafab3a2d9a3811fcfbd3bbf8ac3c40d36", size = 1994679, upload-time = "2025-11-04T13:40:50.619Z" }, - { url = "https://files.pythonhosted.org/packages/9e/8b/341991b158ddab181cff136acd2552c9f35bd30380422a639c0671e99a91/pydantic_core-2.41.5-cp313-cp313-win_amd64.whl", hash = "sha256:79ec52ec461e99e13791ec6508c722742ad745571f234ea6255bed38c6480f11", size = 2019766, upload-time = "2025-11-04T13:40:52.631Z" }, - { url = "https://files.pythonhosted.org/packages/73/7d/f2f9db34af103bea3e09735bb40b021788a5e834c81eedb541991badf8f5/pydantic_core-2.41.5-cp313-cp313-win_arm64.whl", hash = "sha256:3f84d5c1b4ab906093bdc1ff10484838aca54ef08de4afa9de0f5f14d69639cd", size = 1981005, upload-time = "2025-11-04T13:40:54.734Z" }, - { url = "https://files.pythonhosted.org/packages/ea/28/46b7c5c9635ae96ea0fbb779e271a38129df2550f763937659ee6c5dbc65/pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a", size = 2119622, upload-time = "2025-11-04T13:40:56.68Z" }, - { url = "https://files.pythonhosted.org/packages/74/1a/145646e5687e8d9a1e8d09acb278c8535ebe9e972e1f162ed338a622f193/pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14", size = 1891725, upload-time = "2025-11-04T13:40:58.807Z" }, - { url = "https://files.pythonhosted.org/packages/23/04/e89c29e267b8060b40dca97bfc64a19b2a3cf99018167ea1677d96368273/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1", size = 1915040, upload-time = "2025-11-04T13:41:00.853Z" }, - { url = "https://files.pythonhosted.org/packages/84/a3/15a82ac7bd97992a82257f777b3583d3e84bdb06ba6858f745daa2ec8a85/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66", size = 2063691, upload-time = "2025-11-04T13:41:03.504Z" }, - { url = "https://files.pythonhosted.org/packages/74/9b/0046701313c6ef08c0c1cf0e028c67c770a4e1275ca73131563c5f2a310a/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869", size = 2213897, upload-time = "2025-11-04T13:41:05.804Z" }, - { url = "https://files.pythonhosted.org/packages/8a/cd/6bac76ecd1b27e75a95ca3a9a559c643b3afcd2dd62086d4b7a32a18b169/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2", size = 2333302, upload-time = "2025-11-04T13:41:07.809Z" }, - { url = "https://files.pythonhosted.org/packages/4c/d2/ef2074dc020dd6e109611a8be4449b98cd25e1b9b8a303c2f0fca2f2bcf7/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375", size = 2064877, upload-time = "2025-11-04T13:41:09.827Z" }, - { url = "https://files.pythonhosted.org/packages/18/66/e9db17a9a763d72f03de903883c057b2592c09509ccfe468187f2a2eef29/pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553", size = 2180680, upload-time = "2025-11-04T13:41:12.379Z" }, - { url = "https://files.pythonhosted.org/packages/d3/9e/3ce66cebb929f3ced22be85d4c2399b8e85b622db77dad36b73c5387f8f8/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90", size = 2138960, upload-time = "2025-11-04T13:41:14.627Z" }, - { url = "https://files.pythonhosted.org/packages/a6/62/205a998f4327d2079326b01abee48e502ea739d174f0a89295c481a2272e/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07", size = 2339102, upload-time = "2025-11-04T13:41:16.868Z" }, - { url = "https://files.pythonhosted.org/packages/3c/0d/f05e79471e889d74d3d88f5bd20d0ed189ad94c2423d81ff8d0000aab4ff/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb", size = 2326039, upload-time = "2025-11-04T13:41:18.934Z" }, - { url = "https://files.pythonhosted.org/packages/ec/e1/e08a6208bb100da7e0c4b288eed624a703f4d129bde2da475721a80cab32/pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23", size = 1995126, upload-time = "2025-11-04T13:41:21.418Z" }, - { url = "https://files.pythonhosted.org/packages/48/5d/56ba7b24e9557f99c9237e29f5c09913c81eeb2f3217e40e922353668092/pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf", size = 2015489, upload-time = "2025-11-04T13:41:24.076Z" }, - { url = "https://files.pythonhosted.org/packages/4e/bb/f7a190991ec9e3e0ba22e4993d8755bbc4a32925c0b5b42775c03e8148f9/pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0", size = 1977288, upload-time = "2025-11-04T13:41:26.33Z" }, - { url = "https://files.pythonhosted.org/packages/92/ed/77542d0c51538e32e15afe7899d79efce4b81eee631d99850edc2f5e9349/pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a", size = 2120255, upload-time = "2025-11-04T13:41:28.569Z" }, - { url = "https://files.pythonhosted.org/packages/bb/3d/6913dde84d5be21e284439676168b28d8bbba5600d838b9dca99de0fad71/pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3", size = 1863760, upload-time = "2025-11-04T13:41:31.055Z" }, - { url = "https://files.pythonhosted.org/packages/5a/f0/e5e6b99d4191da102f2b0eb9687aaa7f5bea5d9964071a84effc3e40f997/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c", size = 1878092, upload-time = "2025-11-04T13:41:33.21Z" }, - { url = "https://files.pythonhosted.org/packages/71/48/36fb760642d568925953bcc8116455513d6e34c4beaa37544118c36aba6d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612", size = 2053385, upload-time = "2025-11-04T13:41:35.508Z" }, - { url = "https://files.pythonhosted.org/packages/20/25/92dc684dd8eb75a234bc1c764b4210cf2646479d54b47bf46061657292a8/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d", size = 2218832, upload-time = "2025-11-04T13:41:37.732Z" }, - { url = "https://files.pythonhosted.org/packages/e2/09/f53e0b05023d3e30357d82eb35835d0f6340ca344720a4599cd663dca599/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9", size = 2327585, upload-time = "2025-11-04T13:41:40Z" }, - { url = "https://files.pythonhosted.org/packages/aa/4e/2ae1aa85d6af35a39b236b1b1641de73f5a6ac4d5a7509f77b814885760c/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660", size = 2041078, upload-time = "2025-11-04T13:41:42.323Z" }, - { url = "https://files.pythonhosted.org/packages/cd/13/2e215f17f0ef326fc72afe94776edb77525142c693767fc347ed6288728d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9", size = 2173914, upload-time = "2025-11-04T13:41:45.221Z" }, - { url = "https://files.pythonhosted.org/packages/02/7a/f999a6dcbcd0e5660bc348a3991c8915ce6599f4f2c6ac22f01d7a10816c/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3", size = 2129560, upload-time = "2025-11-04T13:41:47.474Z" }, - { url = "https://files.pythonhosted.org/packages/3a/b1/6c990ac65e3b4c079a4fb9f5b05f5b013afa0f4ed6780a3dd236d2cbdc64/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf", size = 2329244, upload-time = "2025-11-04T13:41:49.992Z" }, - { url = "https://files.pythonhosted.org/packages/d9/02/3c562f3a51afd4d88fff8dffb1771b30cfdfd79befd9883ee094f5b6c0d8/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470", size = 2331955, upload-time = "2025-11-04T13:41:54.079Z" }, - { url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" }, - { url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" }, - { url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" }, -] - -[[package]] -name = "python-dotenv" -version = "1.2.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f0/26/19cadc79a718c5edbec86fd4919a6b6d3f681039a2f6d66d14be94e75fb9/python_dotenv-1.2.1.tar.gz", hash = "sha256:42667e897e16ab0d66954af0e60a9caa94f0fd4ecf3aaf6d2d260eec1aa36ad6", size = 44221, upload-time = "2025-10-26T15:12:10.434Z" } +sdist = { url = "https://files.pythonhosted.org/packages/bf/db/7fc19e6f2dc92a966727031389fc2e08b558f0f25eb7403c1119ad4713cd/pluggy-1.7.0.tar.gz", hash = "sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8", size = 123304, upload-time = "2026-10-15T09:50:58.343Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/14/1b/a298b06749107c305e1fe0f814c6c74aea7b2f1e10989cb30f544a1b3253/python_dotenv-1.2.1-py3-none-any.whl", hash = "sha256:b81ee9561e9ca4004139c6cbba3a238c32b03e4894671e181b671e8cb8425d61", size = 21230, upload-time = "2025-10-26T15:12:09.109Z" }, + { url = "https://files.pythonhosted.org/packages/40/9e/2b38731e0fc536806f16490e1a12d7f0dc2a1235aa8cc07bcc75416a7daa/pluggy-1.7.0-py3-none-any.whl", hash = "sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec", size = 27082, upload-time = "2026-10-15T09:50:56.808Z" }, ] [[package]] -name = "pyyaml" -version = "6.0.3" +name = "pygments" +version = "2.21.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } +sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" }, - { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" }, - { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" }, - { url = "https://files.pythonhosted.org/packages/49/1e/a55ca81e949270d5d4432fbbd19dfea5321eda7c41a849d443dc92fd1ff7/pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5", size = 841159, upload-time = "2025-09-25T21:32:27.727Z" }, - { url = "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6", size = 801626, upload-time = "2025-09-25T21:32:28.878Z" }, - { url = "https://files.pythonhosted.org/packages/f9/11/ba845c23988798f40e52ba45f34849aa8a1f2d4af4b798588010792ebad6/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6", size = 753613, upload-time = "2025-09-25T21:32:30.178Z" }, - { url = "https://files.pythonhosted.org/packages/3d/e0/7966e1a7bfc0a45bf0a7fb6b98ea03fc9b8d84fa7f2229e9659680b69ee3/pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be", size = 794115, upload-time = "2025-09-25T21:32:31.353Z" }, - { url = "https://files.pythonhosted.org/packages/de/94/980b50a6531b3019e45ddeada0626d45fa85cbe22300844a7983285bed3b/pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26", size = 137427, upload-time = "2025-09-25T21:32:32.58Z" }, - { url = "https://files.pythonhosted.org/packages/97/c9/39d5b874e8b28845e4ec2202b5da735d0199dbe5b8fb85f91398814a9a46/pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c", size = 154090, upload-time = "2025-09-25T21:32:33.659Z" }, - { url = "https://files.pythonhosted.org/packages/73/e8/2bdf3ca2090f68bb3d75b44da7bbc71843b19c9f2b9cb9b0f4ab7a5a4329/pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb", size = 140246, upload-time = "2025-09-25T21:32:34.663Z" }, - { url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" }, - { url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" }, - { url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" }, - { url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" }, - { url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" }, - { url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" }, - { url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" }, - { url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" }, - { url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" }, - { url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" }, - { url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" }, - { url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" }, - { url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" }, - { url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" }, - { url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" }, - { url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" }, - { url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" }, - { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, + { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" }, ] [[package]] -name = "starlette" -version = "0.50.0" +name = "pytest" +version = "9.2.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "anyio" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ba/b8/73a0e6a6e079a9d9cfa64113d771e421640b6f679a52eeb9b32f72d871a1/starlette-0.50.0.tar.gz", hash = "sha256:a2a17b22203254bcbc2e1f926d2d55f3f9497f769416b3190768befe598fa3ca", size = 2646985, upload-time = "2025-11-01T15:25:27.516Z" } +sdist = { url = "https://files.pythonhosted.org/packages/79/42/bb4641652e58dedeac2ec51abc1f8cae4fee4ec63899a0999016229a0f2a/pytest-9.2.0.tar.gz", hash = "sha256:97c4f3b1f3c7414aa36465e09b8220f1d03627993bd51b1282e193753c80557b", size = 1797555, upload-time = "2026-10-27T21:30:20.728Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d9/52/1064f510b141bd54025f9b55105e26d1fa970b9be67ad766380a3c9b74b0/starlette-0.50.0-py3-none-any.whl", hash = "sha256:9e5391843ec9b6e472eed1365a78c8098cfceb7a74bfd4d6b1c0c0095efb3bca", size = 74033, upload-time = "2025-11-01T15:25:25.461Z" }, + { url = "https://files.pythonhosted.org/packages/51/39/1f5d8c8877a0fa327db959c19341d4be61660de1ab6b7391f9eb805bcd67/pytest-9.2.0-py3-none-any.whl", hash = "sha256:07acdcf88ec174f907dc01af70bf52d49b014bbab03faeeade31c96b18c2e588", size = 411776, upload-time = "2026-10-27T21:30:19.131Z" }, ] [[package]] name = "sympy" -version = "1.14.0" +version = "1.12" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "mpmath" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2bb238361cd4ae6125a569b4db67cd9e79846ba2d68c/sympy-1.14.0.tar.gz", hash = "sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517", size = 7793921, upload-time = "2025-04-27T18:05:01.611Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5", size = 6299353, upload-time = "2025-04-27T18:04:59.103Z" }, -] - -[[package]] -name = "typing-extensions" -version = "4.15.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, -] - -[[package]] -name = "typing-inspection" -version = "0.4.2" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" }, -] - -[[package]] -name = "uvicorn" -version = "0.40.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "click" }, - { name = "h11" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/c3/d1/8f3c683c9561a4e6689dd3b1d345c815f10f86acd044ee1fb9a4dcd0b8c5/uvicorn-0.40.0.tar.gz", hash = "sha256:839676675e87e73694518b5574fd0f24c9d97b46bea16df7b8c05ea1a51071ea", size = 81761, upload-time = "2025-12-21T14:16:22.45Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3d/d8/2083a1daa7439a66f3a48589a57d576aa117726762618f6bb09fe3798796/uvicorn-0.40.0-py3-none-any.whl", hash = "sha256:c6c8f55bc8bf13eb6fa9ff87ad62308bbbc33d0b67f84293151efe87e0d5f2ee", size = 68502, upload-time = "2025-12-21T14:16:21.041Z" }, -] - -[package.optional-dependencies] -standard = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, - { name = "httptools" }, - { name = "python-dotenv" }, - { name = "pyyaml" }, - { name = "uvloop", marker = "platform_python_implementation != 'PyPy' and sys_platform != 'cygwin' and sys_platform != 'win32'" }, - { name = "watchfiles" }, - { name = "websockets" }, -] - -[[package]] -name = "uvloop" -version = "0.22.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/06/f0/18d39dbd1971d6d62c4629cc7fa67f74821b0dc1f5a77af43719de7936a7/uvloop-0.22.1.tar.gz", hash = "sha256:6c84bae345b9147082b17371e3dd5d42775bddce91f885499017f4607fdaf39f", size = 2443250, upload-time = "2025-10-16T22:17:19.342Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/89/8c/182a2a593195bfd39842ea68ebc084e20c850806117213f5a299dfc513d9/uvloop-0.22.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:561577354eb94200d75aca23fbde86ee11be36b00e52a4eaf8f50fb0c86b7705", size = 1358611, upload-time = "2025-10-16T22:16:36.833Z" }, - { url = "https://files.pythonhosted.org/packages/d2/14/e301ee96a6dc95224b6f1162cd3312f6d1217be3907b79173b06785f2fe7/uvloop-0.22.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1cdf5192ab3e674ca26da2eada35b288d2fa49fdd0f357a19f0e7c4e7d5077c8", size = 751811, upload-time = "2025-10-16T22:16:38.275Z" }, - { url = "https://files.pythonhosted.org/packages/b7/02/654426ce265ac19e2980bfd9ea6590ca96a56f10c76e63801a2df01c0486/uvloop-0.22.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e2ea3d6190a2968f4a14a23019d3b16870dd2190cd69c8180f7c632d21de68d", size = 4288562, upload-time = "2025-10-16T22:16:39.375Z" }, - { url = "https://files.pythonhosted.org/packages/15/c0/0be24758891ef825f2065cd5db8741aaddabe3e248ee6acc5e8a80f04005/uvloop-0.22.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0530a5fbad9c9e4ee3f2b33b148c6a64d47bbad8000ea63704fa8260f4cf728e", size = 4366890, upload-time = "2025-10-16T22:16:40.547Z" }, - { url = "https://files.pythonhosted.org/packages/d2/53/8369e5219a5855869bcee5f4d317f6da0e2c669aecf0ef7d371e3d084449/uvloop-0.22.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bc5ef13bbc10b5335792360623cc378d52d7e62c2de64660616478c32cd0598e", size = 4119472, upload-time = "2025-10-16T22:16:41.694Z" }, - { url = "https://files.pythonhosted.org/packages/f8/ba/d69adbe699b768f6b29a5eec7b47dd610bd17a69de51b251126a801369ea/uvloop-0.22.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1f38ec5e3f18c8a10ded09742f7fb8de0108796eb673f30ce7762ce1b8550cad", size = 4239051, upload-time = "2025-10-16T22:16:43.224Z" }, - { url = "https://files.pythonhosted.org/packages/90/cd/b62bdeaa429758aee8de8b00ac0dd26593a9de93d302bff3d21439e9791d/uvloop-0.22.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:3879b88423ec7e97cd4eba2a443aa26ed4e59b45e6b76aabf13fe2f27023a142", size = 1362067, upload-time = "2025-10-16T22:16:44.503Z" }, - { url = "https://files.pythonhosted.org/packages/0d/f8/a132124dfda0777e489ca86732e85e69afcd1ff7686647000050ba670689/uvloop-0.22.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:4baa86acedf1d62115c1dc6ad1e17134476688f08c6efd8a2ab076e815665c74", size = 752423, upload-time = "2025-10-16T22:16:45.968Z" }, - { url = "https://files.pythonhosted.org/packages/a3/94/94af78c156f88da4b3a733773ad5ba0b164393e357cc4bd0ab2e2677a7d6/uvloop-0.22.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:297c27d8003520596236bdb2335e6b3f649480bd09e00d1e3a99144b691d2a35", size = 4272437, upload-time = "2025-10-16T22:16:47.451Z" }, - { url = "https://files.pythonhosted.org/packages/b5/35/60249e9fd07b32c665192cec7af29e06c7cd96fa1d08b84f012a56a0b38e/uvloop-0.22.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c1955d5a1dd43198244d47664a5858082a3239766a839b2102a269aaff7a4e25", size = 4292101, upload-time = "2025-10-16T22:16:49.318Z" }, - { url = "https://files.pythonhosted.org/packages/02/62/67d382dfcb25d0a98ce73c11ed1a6fba5037a1a1d533dcbb7cab033a2636/uvloop-0.22.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b31dc2fccbd42adc73bc4e7cdbae4fc5086cf378979e53ca5d0301838c5682c6", size = 4114158, upload-time = "2025-10-16T22:16:50.517Z" }, - { url = "https://files.pythonhosted.org/packages/f0/7a/f1171b4a882a5d13c8b7576f348acfe6074d72eaf52cccef752f748d4a9f/uvloop-0.22.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:93f617675b2d03af4e72a5333ef89450dfaa5321303ede6e67ba9c9d26878079", size = 4177360, upload-time = "2025-10-16T22:16:52.646Z" }, - { url = "https://files.pythonhosted.org/packages/79/7b/b01414f31546caf0919da80ad57cbfe24c56b151d12af68cee1b04922ca8/uvloop-0.22.1-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:37554f70528f60cad66945b885eb01f1bb514f132d92b6eeed1c90fd54ed6289", size = 1454790, upload-time = "2025-10-16T22:16:54.355Z" }, - { url = "https://files.pythonhosted.org/packages/d4/31/0bb232318dd838cad3fa8fb0c68c8b40e1145b32025581975e18b11fab40/uvloop-0.22.1-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:b76324e2dc033a0b2f435f33eb88ff9913c156ef78e153fb210e03c13da746b3", size = 796783, upload-time = "2025-10-16T22:16:55.906Z" }, - { url = "https://files.pythonhosted.org/packages/42/38/c9b09f3271a7a723a5de69f8e237ab8e7803183131bc57c890db0b6bb872/uvloop-0.22.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:badb4d8e58ee08dad957002027830d5c3b06aea446a6a3744483c2b3b745345c", size = 4647548, upload-time = "2025-10-16T22:16:57.008Z" }, - { url = "https://files.pythonhosted.org/packages/c1/37/945b4ca0ac27e3dc4952642d4c900edd030b3da6c9634875af6e13ae80e5/uvloop-0.22.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b91328c72635f6f9e0282e4a57da7470c7350ab1c9f48546c0f2866205349d21", size = 4467065, upload-time = "2025-10-16T22:16:58.206Z" }, - { url = "https://files.pythonhosted.org/packages/97/cc/48d232f33d60e2e2e0b42f4e73455b146b76ebe216487e862700457fbf3c/uvloop-0.22.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:daf620c2995d193449393d6c62131b3fbd40a63bf7b307a1527856ace637fe88", size = 4328384, upload-time = "2025-10-16T22:16:59.36Z" }, - { url = "https://files.pythonhosted.org/packages/e4/16/c1fd27e9549f3c4baf1dc9c20c456cd2f822dbf8de9f463824b0c0357e06/uvloop-0.22.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6cde23eeda1a25c75b2e07d39970f3374105d5eafbaab2a4482be82f272d5a5e", size = 4296730, upload-time = "2025-10-16T22:17:00.744Z" }, -] - -[[package]] -name = "watchfiles" -version = "1.1.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/c2/c9/8869df9b2a2d6c59d79220a4db37679e74f807c559ffe5265e08b227a210/watchfiles-1.1.1.tar.gz", hash = "sha256:a173cb5c16c4f40ab19cecf48a534c409f7ea983ab8fed0741304a1c0a31b3f2", size = 94440, upload-time = "2025-10-14T15:06:21.08Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/bb/f4/f750b29225fe77139f7ae5de89d4949f5a99f934c65a1f1c0b248f26f747/watchfiles-1.1.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:130e4876309e8686a5e37dba7d5e9bc77e6ed908266996ca26572437a5271e18", size = 404321, upload-time = "2025-10-14T15:05:02.063Z" }, - { url = "https://files.pythonhosted.org/packages/2b/f9/f07a295cde762644aa4c4bb0f88921d2d141af45e735b965fb2e87858328/watchfiles-1.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5f3bde70f157f84ece3765b42b4a52c6ac1a50334903c6eaf765362f6ccca88a", size = 391783, upload-time = "2025-10-14T15:05:03.052Z" }, - { url = "https://files.pythonhosted.org/packages/bc/11/fc2502457e0bea39a5c958d86d2cb69e407a4d00b85735ca724bfa6e0d1a/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:14e0b1fe858430fc0251737ef3824c54027bedb8c37c38114488b8e131cf8219", size = 449279, upload-time = "2025-10-14T15:05:04.004Z" }, - { url = "https://files.pythonhosted.org/packages/e3/1f/d66bc15ea0b728df3ed96a539c777acfcad0eb78555ad9efcaa1274688f0/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f27db948078f3823a6bb3b465180db8ebecf26dd5dae6f6180bd87383b6b4428", size = 459405, upload-time = "2025-10-14T15:05:04.942Z" }, - { url = "https://files.pythonhosted.org/packages/be/90/9f4a65c0aec3ccf032703e6db02d89a157462fbb2cf20dd415128251cac0/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:059098c3a429f62fc98e8ec62b982230ef2c8df68c79e826e37b895bc359a9c0", size = 488976, upload-time = "2025-10-14T15:05:05.905Z" }, - { url = "https://files.pythonhosted.org/packages/37/57/ee347af605d867f712be7029bb94c8c071732a4b44792e3176fa3c612d39/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bfb5862016acc9b869bb57284e6cb35fdf8e22fe59f7548858e2f971d045f150", size = 595506, upload-time = "2025-10-14T15:05:06.906Z" }, - { url = "https://files.pythonhosted.org/packages/a8/78/cc5ab0b86c122047f75e8fc471c67a04dee395daf847d3e59381996c8707/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:319b27255aacd9923b8a276bb14d21a5f7ff82564c744235fc5eae58d95422ae", size = 474936, upload-time = "2025-10-14T15:05:07.906Z" }, - { url = "https://files.pythonhosted.org/packages/62/da/def65b170a3815af7bd40a3e7010bf6ab53089ef1b75d05dd5385b87cf08/watchfiles-1.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c755367e51db90e75b19454b680903631d41f9e3607fbd941d296a020c2d752d", size = 456147, upload-time = "2025-10-14T15:05:09.138Z" }, - { url = "https://files.pythonhosted.org/packages/57/99/da6573ba71166e82d288d4df0839128004c67d2778d3b566c138695f5c0b/watchfiles-1.1.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c22c776292a23bfc7237a98f791b9ad3144b02116ff10d820829ce62dff46d0b", size = 630007, upload-time = "2025-10-14T15:05:10.117Z" }, - { url = "https://files.pythonhosted.org/packages/a8/51/7439c4dd39511368849eb1e53279cd3454b4a4dbace80bab88feeb83c6b5/watchfiles-1.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:3a476189be23c3686bc2f4321dd501cb329c0a0469e77b7b534ee10129ae6374", size = 622280, upload-time = "2025-10-14T15:05:11.146Z" }, - { url = "https://files.pythonhosted.org/packages/95/9c/8ed97d4bba5db6fdcdb2b298d3898f2dd5c20f6b73aee04eabe56c59677e/watchfiles-1.1.1-cp313-cp313-win32.whl", hash = "sha256:bf0a91bfb5574a2f7fc223cf95eeea79abfefa404bf1ea5e339c0c1560ae99a0", size = 272056, upload-time = "2025-10-14T15:05:12.156Z" }, - { url = "https://files.pythonhosted.org/packages/1f/f3/c14e28429f744a260d8ceae18bf58c1d5fa56b50d006a7a9f80e1882cb0d/watchfiles-1.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:52e06553899e11e8074503c8e716d574adeeb7e68913115c4b3653c53f9bae42", size = 288162, upload-time = "2025-10-14T15:05:13.208Z" }, - { url = "https://files.pythonhosted.org/packages/dc/61/fe0e56c40d5cd29523e398d31153218718c5786b5e636d9ae8ae79453d27/watchfiles-1.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:ac3cc5759570cd02662b15fbcd9d917f7ecd47efe0d6b40474eafd246f91ea18", size = 277909, upload-time = "2025-10-14T15:05:14.49Z" }, - { url = "https://files.pythonhosted.org/packages/79/42/e0a7d749626f1e28c7108a99fb9bf524b501bbbeb9b261ceecde644d5a07/watchfiles-1.1.1-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:563b116874a9a7ce6f96f87cd0b94f7faf92d08d0021e837796f0a14318ef8da", size = 403389, upload-time = "2025-10-14T15:05:15.777Z" }, - { url = "https://files.pythonhosted.org/packages/15/49/08732f90ce0fbbc13913f9f215c689cfc9ced345fb1bcd8829a50007cc8d/watchfiles-1.1.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3ad9fe1dae4ab4212d8c91e80b832425e24f421703b5a42ef2e4a1e215aff051", size = 389964, upload-time = "2025-10-14T15:05:16.85Z" }, - { url = "https://files.pythonhosted.org/packages/27/0d/7c315d4bd5f2538910491a0393c56bf70d333d51bc5b34bee8e68e8cea19/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce70f96a46b894b36eba678f153f052967a0d06d5b5a19b336ab0dbbd029f73e", size = 448114, upload-time = "2025-10-14T15:05:17.876Z" }, - { url = "https://files.pythonhosted.org/packages/c3/24/9e096de47a4d11bc4df41e9d1e61776393eac4cb6eb11b3e23315b78b2cc/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cb467c999c2eff23a6417e58d75e5828716f42ed8289fe6b77a7e5a91036ca70", size = 460264, upload-time = "2025-10-14T15:05:18.962Z" }, - { url = "https://files.pythonhosted.org/packages/cc/0f/e8dea6375f1d3ba5fcb0b3583e2b493e77379834c74fd5a22d66d85d6540/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:836398932192dae4146c8f6f737d74baeac8b70ce14831a239bdb1ca882fc261", size = 487877, upload-time = "2025-10-14T15:05:20.094Z" }, - { url = "https://files.pythonhosted.org/packages/ac/5b/df24cfc6424a12deb41503b64d42fbea6b8cb357ec62ca84a5a3476f654a/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:743185e7372b7bc7c389e1badcc606931a827112fbbd37f14c537320fca08620", size = 595176, upload-time = "2025-10-14T15:05:21.134Z" }, - { url = "https://files.pythonhosted.org/packages/8f/b5/853b6757f7347de4e9b37e8cc3289283fb983cba1ab4d2d7144694871d9c/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:afaeff7696e0ad9f02cbb8f56365ff4686ab205fcf9c4c5b6fdfaaa16549dd04", size = 473577, upload-time = "2025-10-14T15:05:22.306Z" }, - { url = "https://files.pythonhosted.org/packages/e1/f7/0a4467be0a56e80447c8529c9fce5b38eab4f513cb3d9bf82e7392a5696b/watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f7eb7da0eb23aa2ba036d4f616d46906013a68caf61b7fdbe42fc8b25132e77", size = 455425, upload-time = "2025-10-14T15:05:23.348Z" }, - { url = "https://files.pythonhosted.org/packages/8e/e0/82583485ea00137ddf69bc84a2db88bd92ab4a6e3c405e5fb878ead8d0e7/watchfiles-1.1.1-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:831a62658609f0e5c64178211c942ace999517f5770fe9436be4c2faeba0c0ef", size = 628826, upload-time = "2025-10-14T15:05:24.398Z" }, - { url = "https://files.pythonhosted.org/packages/28/9a/a785356fccf9fae84c0cc90570f11702ae9571036fb25932f1242c82191c/watchfiles-1.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:f9a2ae5c91cecc9edd47e041a930490c31c3afb1f5e6d71de3dc671bfaca02bf", size = 622208, upload-time = "2025-10-14T15:05:25.45Z" }, - { url = "https://files.pythonhosted.org/packages/c3/f4/0872229324ef69b2c3edec35e84bd57a1289e7d3fe74588048ed8947a323/watchfiles-1.1.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:d1715143123baeeaeadec0528bb7441103979a1d5f6fd0e1f915383fea7ea6d5", size = 404315, upload-time = "2025-10-14T15:05:26.501Z" }, - { url = "https://files.pythonhosted.org/packages/7b/22/16d5331eaed1cb107b873f6ae1b69e9ced582fcf0c59a50cd84f403b1c32/watchfiles-1.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:39574d6370c4579d7f5d0ad940ce5b20db0e4117444e39b6d8f99db5676c52fd", size = 390869, upload-time = "2025-10-14T15:05:27.649Z" }, - { url = "https://files.pythonhosted.org/packages/b2/7e/5643bfff5acb6539b18483128fdc0ef2cccc94a5b8fbda130c823e8ed636/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7365b92c2e69ee952902e8f70f3ba6360d0d596d9299d55d7d386df84b6941fb", size = 449919, upload-time = "2025-10-14T15:05:28.701Z" }, - { url = "https://files.pythonhosted.org/packages/51/2e/c410993ba5025a9f9357c376f48976ef0e1b1aefb73b97a5ae01a5972755/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bfff9740c69c0e4ed32416f013f3c45e2ae42ccedd1167ef2d805c000b6c71a5", size = 460845, upload-time = "2025-10-14T15:05:30.064Z" }, - { url = "https://files.pythonhosted.org/packages/8e/a4/2df3b404469122e8680f0fcd06079317e48db58a2da2950fb45020947734/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b27cf2eb1dda37b2089e3907d8ea92922b673c0c427886d4edc6b94d8dfe5db3", size = 489027, upload-time = "2025-10-14T15:05:31.064Z" }, - { url = "https://files.pythonhosted.org/packages/ea/84/4587ba5b1f267167ee715b7f66e6382cca6938e0a4b870adad93e44747e6/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:526e86aced14a65a5b0ec50827c745597c782ff46b571dbfe46192ab9e0b3c33", size = 595615, upload-time = "2025-10-14T15:05:32.074Z" }, - { url = "https://files.pythonhosted.org/packages/6a/0f/c6988c91d06e93cd0bb3d4a808bcf32375ca1904609835c3031799e3ecae/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04e78dd0b6352db95507fd8cb46f39d185cf8c74e4cf1e4fbad1d3df96faf510", size = 474836, upload-time = "2025-10-14T15:05:33.209Z" }, - { url = "https://files.pythonhosted.org/packages/b4/36/ded8aebea91919485b7bbabbd14f5f359326cb5ec218cd67074d1e426d74/watchfiles-1.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c85794a4cfa094714fb9c08d4a218375b2b95b8ed1666e8677c349906246c05", size = 455099, upload-time = "2025-10-14T15:05:34.189Z" }, - { url = "https://files.pythonhosted.org/packages/98/e0/8c9bdba88af756a2fce230dd365fab2baf927ba42cd47521ee7498fd5211/watchfiles-1.1.1-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:74d5012b7630714b66be7b7b7a78855ef7ad58e8650c73afc4c076a1f480a8d6", size = 630626, upload-time = "2025-10-14T15:05:35.216Z" }, - { url = "https://files.pythonhosted.org/packages/2a/84/a95db05354bf2d19e438520d92a8ca475e578c647f78f53197f5a2f17aaf/watchfiles-1.1.1-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:8fbe85cb3201c7d380d3d0b90e63d520f15d6afe217165d7f98c9c649654db81", size = 622519, upload-time = "2025-10-14T15:05:36.259Z" }, - { url = "https://files.pythonhosted.org/packages/1d/ce/d8acdc8de545de995c339be67711e474c77d643555a9bb74a9334252bd55/watchfiles-1.1.1-cp314-cp314-win32.whl", hash = "sha256:3fa0b59c92278b5a7800d3ee7733da9d096d4aabcfabb9a928918bd276ef9b9b", size = 272078, upload-time = "2025-10-14T15:05:37.63Z" }, - { url = "https://files.pythonhosted.org/packages/c4/c9/a74487f72d0451524be827e8edec251da0cc1fcf111646a511ae752e1a3d/watchfiles-1.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:c2047d0b6cea13b3316bdbafbfa0c4228ae593d995030fda39089d36e64fc03a", size = 287664, upload-time = "2025-10-14T15:05:38.95Z" }, - { url = "https://files.pythonhosted.org/packages/df/b8/8ac000702cdd496cdce998c6f4ee0ca1f15977bba51bdf07d872ebdfc34c/watchfiles-1.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:842178b126593addc05acf6fce960d28bc5fae7afbaa2c6c1b3a7b9460e5be02", size = 277154, upload-time = "2025-10-14T15:05:39.954Z" }, - { url = "https://files.pythonhosted.org/packages/47/a8/e3af2184707c29f0f14b1963c0aace6529f9d1b8582d5b99f31bbf42f59e/watchfiles-1.1.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:88863fbbc1a7312972f1c511f202eb30866370ebb8493aef2812b9ff28156a21", size = 403820, upload-time = "2025-10-14T15:05:40.932Z" }, - { url = "https://files.pythonhosted.org/packages/c0/ec/e47e307c2f4bd75f9f9e8afbe3876679b18e1bcec449beca132a1c5ffb2d/watchfiles-1.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:55c7475190662e202c08c6c0f4d9e345a29367438cf8e8037f3155e10a88d5a5", size = 390510, upload-time = "2025-10-14T15:05:41.945Z" }, - { url = "https://files.pythonhosted.org/packages/d5/a0/ad235642118090f66e7b2f18fd5c42082418404a79205cdfca50b6309c13/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f53fa183d53a1d7a8852277c92b967ae99c2d4dcee2bfacff8868e6e30b15f7", size = 448408, upload-time = "2025-10-14T15:05:43.385Z" }, - { url = "https://files.pythonhosted.org/packages/df/85/97fa10fd5ff3332ae17e7e40e20784e419e28521549780869f1413742e9d/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6aae418a8b323732fa89721d86f39ec8f092fc2af67f4217a2b07fd3e93c6101", size = 458968, upload-time = "2025-10-14T15:05:44.404Z" }, - { url = "https://files.pythonhosted.org/packages/47/c2/9059c2e8966ea5ce678166617a7f75ecba6164375f3b288e50a40dc6d489/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f096076119da54a6080e8920cbdaac3dbee667eb91dcc5e5b78840b87415bd44", size = 488096, upload-time = "2025-10-14T15:05:45.398Z" }, - { url = "https://files.pythonhosted.org/packages/94/44/d90a9ec8ac309bc26db808a13e7bfc0e4e78b6fc051078a554e132e80160/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:00485f441d183717038ed2e887a7c868154f216877653121068107b227a2f64c", size = 596040, upload-time = "2025-10-14T15:05:46.502Z" }, - { url = "https://files.pythonhosted.org/packages/95/68/4e3479b20ca305cfc561db3ed207a8a1c745ee32bf24f2026a129d0ddb6e/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a55f3e9e493158d7bfdb60a1165035f1cf7d320914e7b7ea83fe22c6023b58fc", size = 473847, upload-time = "2025-10-14T15:05:47.484Z" }, - { url = "https://files.pythonhosted.org/packages/4f/55/2af26693fd15165c4ff7857e38330e1b61ab8c37d15dc79118cdba115b7a/watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c91ed27800188c2ae96d16e3149f199d62f86c7af5f5f4d2c61a3ed8cd3666c", size = 455072, upload-time = "2025-10-14T15:05:48.928Z" }, - { url = "https://files.pythonhosted.org/packages/66/1d/d0d200b10c9311ec25d2273f8aad8c3ef7cc7ea11808022501811208a750/watchfiles-1.1.1-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:311ff15a0bae3714ffb603e6ba6dbfba4065ab60865d15a6ec544133bdb21099", size = 629104, upload-time = "2025-10-14T15:05:49.908Z" }, - { url = "https://files.pythonhosted.org/packages/e3/bd/fa9bb053192491b3867ba07d2343d9f2252e00811567d30ae8d0f78136fe/watchfiles-1.1.1-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:a916a2932da8f8ab582f242c065f5c81bed3462849ca79ee357dd9551b0e9b01", size = 622112, upload-time = "2025-10-14T15:05:50.941Z" }, -] - -[[package]] -name = "websockets" -version = "15.0.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/21/e6/26d09fab466b7ca9c7737474c52be4f76a40301b08362eb2dbc19dcc16c1/websockets-15.0.1.tar.gz", hash = "sha256:82544de02076bafba038ce055ee6412d68da13ab47f0c60cab827346de828dee", size = 177016, upload-time = "2025-03-05T20:03:41.606Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e5/57/3485a1a3dff51bfd691962768b14310dae452431754bfc091250be50dd29/sympy-1.12.tar.gz", hash = "sha256:ebf595c8dac3e0fdc4152c51878b498396ec7f30e7a914d6071e674d49420fb8", size = 6722203, upload-time = "2023-05-10T18:23:00.378Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cb/9f/51f0cf64471a9d2b4d0fc6c534f323b664e7095640c34562f5182e5a7195/websockets-15.0.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ee443ef070bb3b6ed74514f5efaa37a252af57c90eb33b956d35c8e9c10a1931", size = 175440, upload-time = "2025-03-05T20:02:36.695Z" }, - { url = "https://files.pythonhosted.org/packages/8a/05/aa116ec9943c718905997412c5989f7ed671bc0188ee2ba89520e8765d7b/websockets-15.0.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5a939de6b7b4e18ca683218320fc67ea886038265fd1ed30173f5ce3f8e85675", size = 173098, upload-time = "2025-03-05T20:02:37.985Z" }, - { url = "https://files.pythonhosted.org/packages/ff/0b/33cef55ff24f2d92924923c99926dcce78e7bd922d649467f0eda8368923/websockets-15.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:746ee8dba912cd6fc889a8147168991d50ed70447bf18bcda7039f7d2e3d9151", size = 173329, upload-time = "2025-03-05T20:02:39.298Z" }, - { url = "https://files.pythonhosted.org/packages/31/1d/063b25dcc01faa8fada1469bdf769de3768b7044eac9d41f734fd7b6ad6d/websockets-15.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:595b6c3969023ecf9041b2936ac3827e4623bfa3ccf007575f04c5a6aa318c22", size = 183111, upload-time = "2025-03-05T20:02:40.595Z" }, - { url = "https://files.pythonhosted.org/packages/93/53/9a87ee494a51bf63e4ec9241c1ccc4f7c2f45fff85d5bde2ff74fcb68b9e/websockets-15.0.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c714d2fc58b5ca3e285461a4cc0c9a66bd0e24c5da9911e30158286c9b5be7f", size = 182054, upload-time = "2025-03-05T20:02:41.926Z" }, - { url = "https://files.pythonhosted.org/packages/ff/b2/83a6ddf56cdcbad4e3d841fcc55d6ba7d19aeb89c50f24dd7e859ec0805f/websockets-15.0.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f3c1e2ab208db911594ae5b4f79addeb3501604a165019dd221c0bdcabe4db8", size = 182496, upload-time = "2025-03-05T20:02:43.304Z" }, - { url = "https://files.pythonhosted.org/packages/98/41/e7038944ed0abf34c45aa4635ba28136f06052e08fc2168520bb8b25149f/websockets-15.0.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:229cf1d3ca6c1804400b0a9790dc66528e08a6a1feec0d5040e8b9eb14422375", size = 182829, upload-time = "2025-03-05T20:02:48.812Z" }, - { url = "https://files.pythonhosted.org/packages/e0/17/de15b6158680c7623c6ef0db361da965ab25d813ae54fcfeae2e5b9ef910/websockets-15.0.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:756c56e867a90fb00177d530dca4b097dd753cde348448a1012ed6c5131f8b7d", size = 182217, upload-time = "2025-03-05T20:02:50.14Z" }, - { url = "https://files.pythonhosted.org/packages/33/2b/1f168cb6041853eef0362fb9554c3824367c5560cbdaad89ac40f8c2edfc/websockets-15.0.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:558d023b3df0bffe50a04e710bc87742de35060580a293c2a984299ed83bc4e4", size = 182195, upload-time = "2025-03-05T20:02:51.561Z" }, - { url = "https://files.pythonhosted.org/packages/86/eb/20b6cdf273913d0ad05a6a14aed4b9a85591c18a987a3d47f20fa13dcc47/websockets-15.0.1-cp313-cp313-win32.whl", hash = "sha256:ba9e56e8ceeeedb2e080147ba85ffcd5cd0711b89576b83784d8605a7df455fa", size = 176393, upload-time = "2025-03-05T20:02:53.814Z" }, - { url = "https://files.pythonhosted.org/packages/1b/6c/c65773d6cab416a64d191d6ee8a8b1c68a09970ea6909d16965d26bfed1e/websockets-15.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:e09473f095a819042ecb2ab9465aee615bd9c2028e4ef7d933600a8401c79561", size = 176837, upload-time = "2025-03-05T20:02:55.237Z" }, - { url = "https://files.pythonhosted.org/packages/fa/a8/5b41e0da817d64113292ab1f8247140aac61cbf6cfd085d6a0fa77f4984f/websockets-15.0.1-py3-none-any.whl", hash = "sha256:f7a866fbc1e97b5c617ee4116daaa09b722101d4a3c170c787450ba409f9736f", size = 169743, upload-time = "2025-03-05T20:03:39.41Z" }, + { url = "https://files.pythonhosted.org/packages/d2/05/e6600db80270777c4a64238a98d442f0fd07cc8915be2a1c16da7f2b9e74/sympy-1.12-py3-none-any.whl", hash = "sha256:c3588cd4295d0c0f603d0f2ae780587e64e2efeedb3521e46b9bb1d08d184fa5", size = 5742435, upload-time = "2023-05-10T18:22:14.76Z" }, ] diff --git a/dist/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 b/dist/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..20e72b01579543fe0cb4aed955a146b6b949709f Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 differ diff --git a/dist/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff b/dist/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff new file mode 100644 index 0000000000000000000000000000000000000000..1487d93d8ab5bcc7b7d885166537a932b2f68314 Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff differ diff --git a/dist/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff b/dist/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff new file mode 100644 index 0000000000000000000000000000000000000000..7e53f599659b74de7a800d3261e924cade84555c Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff differ diff --git a/dist/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 b/dist/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..328efe3dbc8c2e910c3827d51fcf450a809bbb60 Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 differ diff --git a/dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff b/dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff new file mode 100644 index 0000000000000000000000000000000000000000..eff6edd7ebf1249b57421ff033388b1b12a882fa Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff differ diff --git a/dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 b/dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..b54e556623a2593ff7e029b3e1bbbc3f305e5303 Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 differ diff --git a/dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff b/dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff new file mode 100644 index 0000000000000000000000000000000000000000..626c775ae55209a9b5daff9a0cf1169106f7739f Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff differ diff --git a/dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 b/dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..7d066e9264cbb8e831f941d5f8f867285582fc5c Binary files /dev/null and b/dist/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 differ diff --git a/dist/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff b/dist/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff new file mode 100644 index 0000000000000000000000000000000000000000..8c83fdc0351f0d6451158a64bd5b638d951a8983 Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff differ diff --git a/dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 b/dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..0804aaff92260b5359330f63e05b9ac25ccabeee Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 differ diff --git a/dist/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff b/dist/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff new file mode 100644 index 0000000000000000000000000000000000000000..780de71bc414a580ed244d1a60afdfd284ede41b Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff differ diff --git a/dist/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 b/dist/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..090f82f7ec7997047324e07650865305a099969a Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 differ diff --git a/dist/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 b/dist/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..732c64d4dfd589bd5a7abebc1c91d972f678f077 Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 differ diff --git a/dist/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff b/dist/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff new file mode 100644 index 0000000000000000000000000000000000000000..338fc76a84ce2f71519547ec38f882c15c5cf48b Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff differ diff --git a/dist/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 b/dist/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..6f33f8c0578588d14260678edb9bffe9c10d2bd3 Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 differ diff --git a/dist/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff b/dist/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff new file mode 100644 index 0000000000000000000000000000000000000000..370da9c897037a4cdfa5b3e8be1070b674fa20fa Binary files /dev/null and b/dist/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff differ diff --git a/dist/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 b/dist/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..21612f479ed33f94abf24d978f4e7c1613155b34 Binary files /dev/null and b/dist/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 differ diff --git a/dist/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff b/dist/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff new file mode 100644 index 0000000000000000000000000000000000000000..dfa68b0a6ec90690c57fe74baf850fe248e5ee36 Binary files /dev/null and b/dist/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff differ diff --git a/dist/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff b/dist/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff new file mode 100644 index 0000000000000000000000000000000000000000..b1a1d1278c0789d1d17866cbf2978f63b8754f47 Binary files /dev/null and b/dist/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff differ diff --git a/dist/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 b/dist/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..392089009854b61c7db04965bab86d7b7712badc Binary files /dev/null and b/dist/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 differ diff --git a/dist/assets/index-D36_PHax.js b/dist/assets/index-B28BwTux.js similarity index 59% rename from dist/assets/index-D36_PHax.js rename to dist/assets/index-B28BwTux.js index 0d8ba3b25c8fa7e265882e405542098d3effeec8..109d42f8058c38487e556ce5a8e73bf8dcdd6d0d 100644 --- a/dist/assets/index-D36_PHax.js +++ b/dist/assets/index-B28BwTux.js @@ -1,97 +1,97 @@ -(function(){const ut=document.createElement("link").relList;if(ut&&ut.supports&&ut.supports("modulepreload"))return;for(const sr of document.querySelectorAll('link[rel="modulepreload"]'))wt(sr);new MutationObserver(sr=>{for(const vr of sr)if(vr.type==="childList")for(const br of vr.addedNodes)br.tagName==="LINK"&&br.rel==="modulepreload"&&wt(br)}).observe(document,{childList:!0,subtree:!0});function Tt(sr){const vr={};return sr.integrity&&(vr.integrity=sr.integrity),sr.referrerPolicy&&(vr.referrerPolicy=sr.referrerPolicy),sr.crossOrigin==="use-credentials"?vr.credentials="include":sr.crossOrigin==="anonymous"?vr.credentials="omit":vr.credentials="same-origin",vr}function wt(sr){if(sr.ep)return;sr.ep=!0;const vr=Tt(sr);fetch(sr.href,vr)}})();function sk(Ie){return Ie&&Ie.__esModule&&Object.prototype.hasOwnProperty.call(Ie,"default")?Ie.default:Ie}var E6={exports:{}},_T={};var $L;function mO(){if($L)return _T;$L=1;var Ie=Symbol.for("react.transitional.element"),ut=Symbol.for("react.fragment");function Tt(wt,sr,vr){var br=null;if(vr!==void 0&&(br=""+vr),sr.key!==void 0&&(br=""+sr.key),"key"in sr){vr={};for(var tn in sr)tn!=="key"&&(vr[tn]=sr[tn])}else vr=sr;return sr=vr.ref,{$$typeof:Ie,type:wt,key:br,ref:sr!==void 0?sr:null,props:vr}}return _T.Fragment=ut,_T.jsx=Tt,_T.jsxs=Tt,_T}var JL;function gO(){return JL||(JL=1,E6.exports=mO()),E6.exports}var Si=gO(),k6={exports:{}},Au={};var QL;function yO(){if(QL)return Au;QL=1;var Ie=Symbol.for("react.transitional.element"),ut=Symbol.for("react.portal"),Tt=Symbol.for("react.fragment"),wt=Symbol.for("react.strict_mode"),sr=Symbol.for("react.profiler"),vr=Symbol.for("react.consumer"),br=Symbol.for("react.context"),tn=Symbol.for("react.forward_ref"),an=Symbol.for("react.suspense"),Zr=Symbol.for("react.memo"),Sn=Symbol.for("react.lazy"),Ln=Symbol.for("react.activity"),fa=Symbol.iterator;function Gn(Sa){return Sa===null||typeof Sa!="object"?null:(Sa=fa&&Sa[fa]||Sa["@@iterator"],typeof Sa=="function"?Sa:null)}var ao={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qi=Object.assign,Lo={};function si(Sa,Vi,Xn){this.props=Sa,this.context=Vi,this.refs=Lo,this.updater=Xn||ao}si.prototype.isReactComponent={},si.prototype.setState=function(Sa,Vi){if(typeof Sa!="object"&&typeof Sa!="function"&&Sa!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Sa,Vi,"setState")},si.prototype.forceUpdate=function(Sa){this.updater.enqueueForceUpdate(this,Sa,"forceUpdate")};function Ge(){}Ge.prototype=si.prototype;function zo(Sa,Vi,Xn){this.props=Sa,this.context=Vi,this.refs=Lo,this.updater=Xn||ao}var xl=zo.prototype=new Ge;xl.constructor=zo,qi(xl,si.prototype),xl.isPureReactComponent=!0;var go=Array.isArray;function mi(){}var Yi={H:null,A:null,T:null,S:null},As=Object.prototype.hasOwnProperty;function Za(Sa,Vi,Xn){var os=Xn.ref;return{$$typeof:Ie,type:Sa,key:Vi,ref:os!==void 0?os:null,props:Xn}}function Oo(Sa,Vi){return Za(Sa.type,Vi,Sa.props)}function Mi(Sa){return typeof Sa=="object"&&Sa!==null&&Sa.$$typeof===Ie}function po(Sa){var Vi={"=":"=0",":":"=2"};return"$"+Sa.replace(/[=:]/g,function(Xn){return Vi[Xn]})}var js=/\/+/g;function Ga(Sa,Vi){return typeof Sa=="object"&&Sa!==null&&Sa.key!=null?po(""+Sa.key):Vi.toString(36)}function hi(Sa){switch(Sa.status){case"fulfilled":return Sa.value;case"rejected":throw Sa.reason;default:switch(typeof Sa.status=="string"?Sa.then(mi,mi):(Sa.status="pending",Sa.then(function(Vi){Sa.status==="pending"&&(Sa.status="fulfilled",Sa.value=Vi)},function(Vi){Sa.status==="pending"&&(Sa.status="rejected",Sa.reason=Vi)})),Sa.status){case"fulfilled":return Sa.value;case"rejected":throw Sa.reason}}throw Sa}function ai(Sa,Vi,Xn,os,ks){var Qi=typeof Sa;(Qi==="undefined"||Qi==="boolean")&&(Sa=null);var Fs=!1;if(Sa===null)Fs=!0;else switch(Qi){case"bigint":case"string":case"number":Fs=!0;break;case"object":switch(Sa.$$typeof){case Ie:case ut:Fs=!0;break;case Sn:return Fs=Sa._init,ai(Fs(Sa._payload),Vi,Xn,os,ks)}}if(Fs)return ks=ks(Sa),Fs=os===""?"."+Ga(Sa,0):os,go(ks)?(Xn="",Fs!=null&&(Xn=Fs.replace(js,"$&/")+"/"),ai(ks,Vi,Xn,"",function(td){return td})):ks!=null&&(Mi(ks)&&(ks=Oo(ks,Xn+(ks.key==null||Sa&&Sa.key===ks.key?"":(""+ks.key).replace(js,"$&/")+"/")+Fs)),Vi.push(ks)),1;Fs=0;var Wc=os===""?".":os+":";if(go(Sa))for(var Ju=0;Ju>>1,ma=ai[Ll];if(0>>1;Llsr(Xn,ro))ossr(ks,Xn)?(ai[Ll]=ks,ai[os]=ro,Ll=os):(ai[Ll]=Xn,ai[Vi]=ro,Ll=Vi);else if(ossr(ks,ro))ai[Ll]=ks,ai[os]=ro,Ll=os;else break e}}return yo}function sr(ai,yo){var ro=ai.sortIndex-yo.sortIndex;return ro!==0?ro:ai.id-yo.id}if(Ie.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var vr=performance;Ie.unstable_now=function(){return vr.now()}}else{var br=Date,tn=br.now();Ie.unstable_now=function(){return br.now()-tn}}var an=[],Zr=[],Sn=1,Ln=null,fa=3,Gn=!1,ao=!1,qi=!1,Lo=!1,si=typeof setTimeout=="function"?setTimeout:null,Ge=typeof clearTimeout=="function"?clearTimeout:null,zo=typeof setImmediate<"u"?setImmediate:null;function xl(ai){for(var yo=Tt(Zr);yo!==null;){if(yo.callback===null)wt(Zr);else if(yo.startTime<=ai)wt(Zr),yo.sortIndex=yo.expirationTime,ut(an,yo);else break;yo=Tt(Zr)}}function go(ai){if(qi=!1,xl(ai),!ao)if(Tt(an)!==null)ao=!0,mi||(mi=!0,po());else{var yo=Tt(Zr);yo!==null&&hi(go,yo.startTime-ai)}}var mi=!1,Yi=-1,As=5,Za=-1;function Oo(){return Lo?!0:!(Ie.unstable_now()-Zaai&&Oo());){var Ll=Ln.callback;if(typeof Ll=="function"){Ln.callback=null,fa=Ln.priorityLevel;var ma=Ll(Ln.expirationTime<=ai);if(ai=Ie.unstable_now(),typeof ma=="function"){Ln.callback=ma,xl(ai),yo=!0;break t}Ln===Tt(an)&&wt(an),xl(ai)}else wt(an);Ln=Tt(an)}if(Ln!==null)yo=!0;else{var Sa=Tt(Zr);Sa!==null&&hi(go,Sa.startTime-ai),yo=!1}}break e}finally{Ln=null,fa=ro,Gn=!1}yo=void 0}}finally{yo?po():mi=!1}}}var po;if(typeof zo=="function")po=function(){zo(Mi)};else if(typeof MessageChannel<"u"){var js=new MessageChannel,Ga=js.port2;js.port1.onmessage=Mi,po=function(){Ga.postMessage(null)}}else po=function(){si(Mi,0)};function hi(ai,yo){Yi=si(function(){ai(Ie.unstable_now())},yo)}Ie.unstable_IdlePriority=5,Ie.unstable_ImmediatePriority=1,Ie.unstable_LowPriority=4,Ie.unstable_NormalPriority=3,Ie.unstable_Profiling=null,Ie.unstable_UserBlockingPriority=2,Ie.unstable_cancelCallback=function(ai){ai.callback=null},Ie.unstable_forceFrameRate=function(ai){0>ai||125Ll?(ai.sortIndex=ro,ut(Zr,ai),Tt(an)===null&&ai===Tt(Zr)&&(qi?(Ge(Yi),Yi=-1):qi=!0,hi(go,ro-Ll))):(ai.sortIndex=ma,ut(an,ai),ao||Gn||(ao=!0,mi||(mi=!0,po()))),ai},Ie.unstable_shouldYield=Oo,Ie.unstable_wrapCallback=function(ai){var yo=fa;return function(){var ro=fa;fa=yo;try{return ai.apply(this,arguments)}finally{fa=ro}}}})(P6)),P6}var r8;function xO(){return r8||(r8=1,L6.exports=_O()),L6.exports}var R6={exports:{}},Yd={};var n8;function bO(){if(n8)return Yd;n8=1;var Ie=aM();function ut(an){var Zr="https://react.dev/errors/"+an;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ie)}catch(ut){console.error(ut)}}return Ie(),R6.exports=bO(),R6.exports}var i8;function TO(){if(i8)return xT;i8=1;var Ie=xO(),ut=aM(),Tt=wO();function wt(O){var W="https://react.dev/errors/"+O;if(1ma||(O.current=Ll[ma],Ll[ma]=null,ma--)}function Xn(O,W){ma++,Ll[ma]=O.current,O.current=W}var os=Sa(null),ks=Sa(null),Qi=Sa(null),Fs=Sa(null);function Wc(O,W){switch(Xn(Qi,W),Xn(ks,O),Xn(os,null),W.nodeType){case 9:case 11:O=(O=W.documentElement)&&(O=O.namespaceURI)?p3(O):0;break;default:if(O=W.tagName,W=W.namespaceURI)W=p3(W),O=m3(W,O);else switch(O){case"svg":O=1;break;case"math":O=2;break;default:O=0}}Vi(os),Xn(os,O)}function Ju(){Vi(os),Vi(ks),Vi(Qi)}function td(O){O.memoizedState!==null&&Xn(Fs,O);var W=os.current,de=m3(W,O.type);W!==de&&(Xn(ks,O),Xn(os,de))}function nu(O){ks.current===O&&(Vi(os),Vi(ks)),Fs.current===O&&(Vi(Fs),By._currentValue=ro)}var r0,rh;function So(O){if(r0===void 0)try{throw Error()}catch(de){var W=de.stack.trim().match(/\n( *(at )?)/);r0=W&&W[1]||"",rh=-1)":-1ct||Ma[Re]!==ki[ct]){var io=` -`+Ma[Re].replace(" at new "," at ");return O.displayName&&io.includes("")&&(io=io.replace("",O.displayName)),io}while(1<=Re&&0<=ct);break}}}finally{up=!1,Error.prepareStackTrace=de}return(de=O?O.displayName||O.name:"")?So(de):""}function J_(O,W){switch(O.tag){case 26:case 27:case 5:return So(O.type);case 16:return So("Lazy");case 13:return O.child!==W&&W!==null?So("Suspense Fallback"):So("Suspense");case 19:return So("SuspenseList");case 0:case 15:return n0(O.type,!1);case 11:return n0(O.type.render,!1);case 1:return n0(O.type,!0);case 31:return So("Activity");default:return""}}function A0(O){try{var W="",de=null;do W+=J_(O,de),de=O,O=O.return;while(O);return W}catch(Re){return` -Error generating stack: `+Re.message+` -`+Re.stack}}var Wm=Object.prototype.hasOwnProperty,cp=Ie.unstable_scheduleCallback,Km=Ie.unstable_cancelCallback,Q_=Ie.unstable_shouldYield,Dw=Ie.unstable_requestPaint,md=Ie.unstable_now,zw=Ie.unstable_getCurrentPriorityLevel,lo=Ie.unstable_ImmediatePriority,hs=Ie.unstable_UserBlockingPriority,eu=Ie.unstable_NormalPriority,Qu=Ie.unstable_LowPriority,Kc=Ie.unstable_IdlePriority,Wd=Ie.log,S0=Ie.unstable_setDisableYieldValue,gd=null,fv=null;function Td(O){if(typeof Wd=="function"&&S0(O),fv&&typeof fv.setStrictMode=="function")try{fv.setStrictMode(gd,O)}catch{}}var Cf=Math.clz32?Math.clz32:lM,Q0=Math.log,kp=Math.LN2;function lM(O){return O>>>=0,O===0?32:31-(Q0(O)/kp|0)|0}var ex=256,tx=262144,rx=4194304;function $m(O){var W=O&42;if(W!==0)return W;switch(O&-O){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return O&261888;case 262144:case 524288:case 1048576:case 2097152:return O&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return O&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return O}}function nx(O,W,de){var Re=O.pendingLanes;if(Re===0)return 0;var ct=0,Pt=O.suspendedLanes,Rr=O.pingedLanes;O=O.warmLanes;var bn=Re&134217727;return bn!==0?(Re=bn&~Pt,Re!==0?ct=$m(Re):(Rr&=bn,Rr!==0?ct=$m(Rr):de||(de=bn&~O,de!==0&&(ct=$m(de))))):(bn=Re&~Pt,bn!==0?ct=$m(bn):Rr!==0?ct=$m(Rr):de||(de=Re&~O,de!==0&&(ct=$m(de)))),ct===0?0:W!==0&&W!==ct&&(W&Pt)===0&&(Pt=ct&-ct,de=W&-W,Pt>=de||Pt===32&&(de&4194048)!==0)?W:ct}function m1(O,W){return(O.pendingLanes&~(O.suspendedLanes&~O.pingedLanes)&W)===0}function uM(O,W){switch(O){case 1:case 2:case 4:case 8:case 64:return W+250;case 16:case 32: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 W+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function RT(){var O=rx;return rx<<=1,(rx&62914560)===0&&(rx=4194304),O}function Ow(O){for(var W=[],de=0;31>de;de++)W.push(O);return W}function g1(O,W){O.pendingLanes|=W,W!==268435456&&(O.suspendedLanes=0,O.pingedLanes=0,O.warmLanes=0)}function cM(O,W,de,Re,ct,Pt){var Rr=O.pendingLanes;O.pendingLanes=de,O.suspendedLanes=0,O.pingedLanes=0,O.warmLanes=0,O.expiredLanes&=de,O.entangledLanes&=de,O.errorRecoveryDisabledLanes&=de,O.shellSuspendCounter=0;var bn=O.entanglements,Ma=O.expirationTimes,ki=O.hiddenUpdates;for(de=Rr&~de;0"u")return null;try{return O.activeElement||O.body}catch{return O.body}}var x1=/[\n"\\]/g;function hp(O){return O.replace(x1,function(W){return"\\"+W.charCodeAt(0).toString(16)+" "})}function sx(O,W,de,Re,ct,Pt,Rr,bn){O.name="",Rr!=null&&typeof Rr!="function"&&typeof Rr!="symbol"&&typeof Rr!="boolean"?O.type=Rr:O.removeAttribute("type"),W!=null?Rr==="number"?(W===0&&O.value===""||O.value!=W)&&(O.value=""+fp(W)):O.value!==""+fp(W)&&(O.value=""+fp(W)):Rr!=="submit"&&Rr!=="reset"||O.removeAttribute("value"),W!=null?mu(O,Rr,fp(W)):de!=null?mu(O,Rr,fp(de)):Re!=null&&O.removeAttribute("value"),ct==null&&Pt!=null&&(O.defaultChecked=!!Pt),ct!=null&&(O.checked=ct&&typeof ct!="function"&&typeof ct!="symbol"),bn!=null&&typeof bn!="function"&&typeof bn!="symbol"&&typeof bn!="boolean"?O.name=""+fp(bn):O.removeAttribute("name")}function Jg(O,W,de,Re,ct,Pt,Rr,bn){if(Pt!=null&&typeof Pt!="function"&&typeof Pt!="symbol"&&typeof Pt!="boolean"&&(O.type=Pt),W!=null||de!=null){if(!(Pt!=="submit"&&Pt!=="reset"||W!=null)){ox(O);return}de=de!=null?""+fp(de):"",W=W!=null?""+fp(W):de,bn||W===O.value||(O.value=W),O.defaultValue=W}Re=Re??ct,Re=typeof Re!="function"&&typeof Re!="symbol"&&!!Re,O.checked=bn?O.checked:!!Re,O.defaultChecked=!!Re,Rr!=null&&typeof Rr!="function"&&typeof Rr!="symbol"&&typeof Rr!="boolean"&&(O.name=Rr),ox(O)}function mu(O,W,de){W==="number"&&L0(O.ownerDocument)===O||O.defaultValue===""+de||(O.defaultValue=""+de)}function nh(O,W,de,Re){if(O=O.options,W){W={};for(var ct=0;ct"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dv=!1;if(a0)try{var Lp={};Object.defineProperty(Lp,"passive",{get:function(){dv=!0}}),window.addEventListener("test",Lp,Lp),window.removeEventListener("test",Lp,Lp)}catch{dv=!1}var Sd=null,ux=null,dh=null;function UT(){if(dh)return dh;var O,W=ux,de=W.length,Re,ct="value"in Sd?Sd.value:Sd.textContent,Pt=ct.length;for(O=0;O=T1),A1=" ",hx=!1;function vx(O,W){switch(O){case"keyup":return wM.indexOf(W.keyCode)!==-1;case"keydown":return W.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dx(O){return O=O.detail,typeof O=="object"&&"data"in O?O.data:null}var vp=!1;function Zw(O,W){switch(O){case"compositionend":return dx(W);case"keypress":return W.which!==32?null:(hx=!0,A1);case"textInput":return O=W.data,O===A1&&hx?null:O;default:return null}}function $T(O,W){if(vp)return O==="compositionend"||!Yw&&vx(O,W)?(O=UT(),dh=ux=Sd=null,vp=!1,O):null;switch(O){case"paste":return null;case"keypress":if(!(W.ctrlKey||W.altKey||W.metaKey)||W.ctrlKey&&W.altKey){if(W.char&&1=W)return{node:de,offset:W-O};O=Re}e:{for(;de;){if(de.nextSibling){de=de.nextSibling;break e}de=de.parentNode}de=void 0}de=t5(de)}}function n5(O,W){return O&&W?O===W?!0:O&&O.nodeType===3?!1:W&&W.nodeType===3?n5(O,W.parentNode):"contains"in O?O.contains(W):O.compareDocumentPosition?!!(O.compareDocumentPosition(W)&16):!1:!1}function a5(O){O=O!=null&&O.ownerDocument!=null&&O.ownerDocument.defaultView!=null?O.ownerDocument.defaultView:window;for(var W=L0(O.document);W instanceof O.HTMLIFrameElement;){try{var de=typeof W.contentWindow.location.href=="string"}catch{de=!1}if(de)O=W.contentWindow;else break;W=L0(O.document)}return W}function Qg(O){var W=O&&O.nodeName&&O.nodeName.toLowerCase();return W&&(W==="input"&&(O.type==="text"||O.type==="search"||O.type==="tel"||O.type==="url"||O.type==="password")||W==="textarea"||O.contentEditable==="true")}var MM=a0&&"documentMode"in document&&11>=document.documentMode,ey=null,gx=null,sm=null,lm=!1;function i0(O,W,de){var Re=de.window===de?de.document:de.nodeType===9?de:de.ownerDocument;lm||ey==null||ey!==L0(Re)||(Re=ey,"selectionStart"in Re&&Qg(Re)?Re={start:Re.selectionStart,end:Re.selectionEnd}:(Re=(Re.ownerDocument&&Re.ownerDocument.defaultView||window).getSelection(),Re={anchorNode:Re.anchorNode,anchorOffset:Re.anchorOffset,focusNode:Re.focusNode,focusOffset:Re.focusOffset}),sm&&M1(sm,Re)||(sm=Re,Re=h_(gx,"onSelect"),0>=Rr,ct-=Rr,Vf=1<<32-Cf(W)+ct|de<gu?(Vu=qs,qs=null):Vu=qs.sibling;var Cc=Ii(ci,qs,Ti[gu],oo);if(Cc===null){qs===null&&(qs=Vu);break}O&&qs&&Cc.alternate===null&&W(ci,qs),Xa=Pt(Cc,Xa,gu),gc===null?bl=Cc:gc.sibling=Cc,gc=Cc,qs=Vu}if(gu===Ti.length)return de(ci,qs),Uu&&Eh(ci,gu),bl;if(qs===null){for(;gugu?(Vu=qs,qs=null):Vu=qs.sibling;var Dm=Ii(ci,qs,Cc.value,oo);if(Dm===null){qs===null&&(qs=Vu);break}O&&qs&&Dm.alternate===null&&W(ci,qs),Xa=Pt(Dm,Xa,gu),gc===null?bl=Dm:gc.sibling=Dm,gc=Dm,qs=Vu}if(Cc.done)return de(ci,qs),Uu&&Eh(ci,gu),bl;if(qs===null){for(;!Cc.done;gu++,Cc=Ti.next())Cc=fo(ci,Cc.value,oo),Cc!==null&&(Xa=Pt(Cc,Xa,gu),gc===null?bl=Cc:gc.sibling=Cc,gc=Cc);return Uu&&Eh(ci,gu),bl}for(qs=Re(qs);!Cc.done;gu++,Cc=Ti.next())Cc=Ui(qs,ci,gu,Cc.value,oo),Cc!==null&&(O&&Cc.alternate!==null&&qs.delete(Cc.key===null?gu:Cc.key),Xa=Pt(Cc,Xa,gu),gc===null?bl=Cc:gc.sibling=Cc,gc=Cc);return O&&qs.forEach(function(rE){return W(ci,rE)}),Uu&&Eh(ci,gu),bl}function bf(ci,Xa,Ti,oo){if(typeof Ti=="object"&&Ti!==null&&Ti.type===qi&&Ti.key===null&&(Ti=Ti.props.children),typeof Ti=="object"&&Ti!==null){switch(Ti.$$typeof){case Gn:e:{for(var bl=Ti.key;Xa!==null;){if(Xa.key===bl){if(bl=Ti.type,bl===qi){if(Xa.tag===7){de(ci,Xa.sibling),oo=ct(Xa,Ti.props.children),oo.return=ci,ci=oo;break e}}else if(Xa.elementType===bl||typeof bl=="object"&&bl!==null&&bl.$$typeof===As&&fg(bl)===Xa.type){de(ci,Xa.sibling),oo=ct(Xa,Ti.props),z1(oo,Ti),oo.return=ci,ci=oo;break e}de(ci,Xa);break}else W(ci,Xa);Xa=Xa.sibling}Ti.type===qi?(oo=um(Ti.props.children,ci.mode,oo,Ti.key),oo.return=ci,ci=oo):(oo=R0(Ti.type,Ti.key,Ti.props,null,ci.mode,oo),z1(oo,Ti),oo.return=ci,ci=oo)}return Rr(ci);case ao:e:{for(bl=Ti.key;Xa!==null;){if(Xa.key===bl)if(Xa.tag===4&&Xa.stateNode.containerInfo===Ti.containerInfo&&Xa.stateNode.implementation===Ti.implementation){de(ci,Xa.sibling),oo=ct(Xa,Ti.children||[]),oo.return=ci,ci=oo;break e}else{de(ci,Xa);break}else W(ci,Xa);Xa=Xa.sibling}oo=tp(Ti,ci.mode,oo),oo.return=ci,ci=oo}return Rr(ci);case As:return Ti=fg(Ti),bf(ci,Xa,Ti,oo)}if(hi(Ti))return $s(ci,Xa,Ti,oo);if(po(Ti)){if(bl=po(Ti),typeof bl!="function")throw Error(wt(150));return Ti=bl.call(Ti),Ul(ci,Xa,Ti,oo)}if(typeof Ti.then=="function")return bf(ci,Xa,kx(Ti),oo);if(Ti.$$typeof===zo)return bf(ci,Xa,Tx(ci,Ti),oo);Sc(ci,Ti)}return typeof Ti=="string"&&Ti!==""||typeof Ti=="number"||typeof Ti=="bigint"?(Ti=""+Ti,Xa!==null&&Xa.tag===6?(de(ci,Xa.sibling),oo=ct(Xa,Ti),oo.return=ci,ci=oo):(de(ci,Xa),oo=a2(Ti,ci.mode,oo),oo.return=ci,ci=oo),Rr(ci)):de(ci,Xa)}return function(ci,Xa,Ti,oo){try{D1=0;var bl=bf(ci,Xa,Ti,oo);return uy=null,bl}catch(qs){if(qs===vm||qs===ly)throw qs;var gc=Xv(29,qs,null,ci.mode);return gc.lanes=oo,gc.return=ci,gc}}}var dm=v2(!0),g5=v2(!1),O0=!1;function d2(O){O.updateQueue={baseState:O.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function p2(O,W){O=O.updateQueue,W.updateQueue===O&&(W.updateQueue={baseState:O.baseState,firstBaseUpdate:O.firstBaseUpdate,lastBaseUpdate:O.lastBaseUpdate,shared:O.shared,callbacks:null})}function pm(O){return{lane:O,tag:0,payload:null,callback:null,next:null}}function mm(O,W,de){var Re=O.updateQueue;if(Re===null)return null;if(Re=Re.shared,(Ec&2)!==0){var ct=Re.pending;return ct===null?W.next=W:(W.next=ct.next,ct.next=W),Re.pending=W,W=bx(O),Op(O,null,de),W}return xx(O,Re,W,de),bx(O)}function O1(O,W,de){if(W=W.updateQueue,W!==null&&(W=W.shared,(de&4194048)!==0)){var Re=W.lanes;Re&=O.pendingLanes,de|=Re,W.lanes=de,Fw(O,de)}}function m2(O,W){var de=O.updateQueue,Re=O.alternate;if(Re!==null&&(Re=Re.updateQueue,de===Re)){var ct=null,Pt=null;if(de=de.firstBaseUpdate,de!==null){do{var Rr={lane:de.lane,tag:de.tag,payload:de.payload,callback:null,next:null};Pt===null?ct=Pt=Rr:Pt=Pt.next=Rr,de=de.next}while(de!==null);Pt===null?ct=Pt=W:Pt=Pt.next=W}else ct=Pt=W;de={baseState:Re.baseState,firstBaseUpdate:ct,lastBaseUpdate:Pt,shared:Re.shared,callbacks:Re.callbacks},O.updateQueue=de;return}O=de.lastBaseUpdate,O===null?de.firstBaseUpdate=W:O.next=W,de.lastBaseUpdate=W}var g2=!1;function F1(){if(g2){var O=sy;if(O!==null)throw O}}function B1(O,W,de,Re){g2=!1;var ct=O.updateQueue;O0=!1;var Pt=ct.firstBaseUpdate,Rr=ct.lastBaseUpdate,bn=ct.shared.pending;if(bn!==null){ct.shared.pending=null;var Ma=bn,ki=Ma.next;Ma.next=null,Rr===null?Pt=ki:Rr.next=ki,Rr=Ma;var io=O.alternate;io!==null&&(io=io.updateQueue,bn=io.lastBaseUpdate,bn!==Rr&&(bn===null?io.firstBaseUpdate=ki:bn.next=ki,io.lastBaseUpdate=Ma))}if(Pt!==null){var fo=ct.baseState;Rr=0,io=ki=Ma=null,bn=Pt;do{var Ii=bn.lane&-536870913,Ui=Ii!==bn.lane;if(Ui?(rc&Ii)===Ii:(Re&Ii)===Ii){Ii!==0&&Ii===cg&&(g2=!0),io!==null&&(io=io.next={lane:0,tag:bn.tag,payload:bn.payload,callback:null,next:null});e:{var $s=O,Ul=bn;Ii=W;var bf=de;switch(Ul.tag){case 1:if($s=Ul.payload,typeof $s=="function"){fo=$s.call(bf,fo,Ii);break e}fo=$s;break e;case 3:$s.flags=$s.flags&-65537|128;case 0:if($s=Ul.payload,Ii=typeof $s=="function"?$s.call(bf,fo,Ii):$s,Ii==null)break e;fo=Ln({},fo,Ii);break e;case 2:O0=!0}}Ii=bn.callback,Ii!==null&&(O.flags|=64,Ui&&(O.flags|=8192),Ui=ct.callbacks,Ui===null?ct.callbacks=[Ii]:Ui.push(Ii))}else Ui={lane:Ii,tag:bn.tag,payload:bn.payload,callback:bn.callback,next:null},io===null?(ki=io=Ui,Ma=fo):io=io.next=Ui,Rr|=Ii;if(bn=bn.next,bn===null){if(bn=ct.shared.pending,bn===null)break;Ui=bn,bn=Ui.next,Ui.next=null,ct.lastBaseUpdate=Ui,ct.shared.pending=null}}while(!0);io===null&&(Ma=fo),ct.baseState=Ma,ct.firstBaseUpdate=ki,ct.lastBaseUpdate=io,Pt===null&&(ct.shared.lanes=0),H0|=Rr,O.lanes=Rr,O.memoizedState=fo}}function y5(O,W){if(typeof O!="function")throw Error(wt(191,O));O.call(W)}function y2(O,W){var de=O.callbacks;if(de!==null)for(O.callbacks=null,O=0;OPt?Pt:8;var Rr=ai.T,bn={};ai.T=bn,Y1(O,!1,W,de);try{var Ma=ct(),ki=ai.S;if(ki!==null&&ki(bn,Ma),Ma!==null&&typeof Ma=="object"&&typeof Ma.then=="function"){var io=RM(Ma,Re);py(O,W,io,od(O))}else py(O,W,Re,od(O))}catch(fo){py(O,W,{then:function(){},status:"rejected",reason:fo},od())}finally{yo.p=Pt,Rr!==null&&bn.types!==null&&(Rr.types=bn.types),ai.T=Rr}}function Jx(){}function Qx(O,W,de,Re){if(O.tag!==5)throw Error(wt(476));var ct=X1(O).queue;C2(O,ct,W,ro,de===null?Jx:function(){return L2(O),de(Re)})}function X1(O){var W=O.memoizedState;if(W!==null)return W;W={memoizedState:ro,baseState:ro,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:u0,lastRenderedState:ro},next:null};var de={};return W.next={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:u0,lastRenderedState:de},next:null},O.memoizedState=W,O=O.alternate,O!==null&&(O.memoizedState=W),W}function L2(O){var W=X1(O);W.next===null&&(W=O.alternate.memoizedState),py(O,W.next.queue,{},od())}function eb(){return Ov(By)}function C5(){return gh().memoizedState}function P2(){return gh().memoizedState}function L5(O){for(var W=O.return;W!==null;){switch(W.tag){case 24:case 3:var de=od();O=pm(de);var Re=mm(W,O,de);Re!==null&&(Id(Re,W,de),O1(Re,W,de)),W={cache:c2()},O.payload=W;return}W=W.return}}function P5(O,W,de){var Re=od();de={lane:Re,revertLane:0,gesture:null,action:de,hasEagerState:!1,eagerState:null,next:null},my(O)?R2(W,de):(de=n2(O,W,de,Re),de!==null&&(Id(de,O,Re),R5(de,W,Re)))}function tb(O,W,de){var Re=od();py(O,W,de,Re)}function py(O,W,de,Re){var ct={lane:Re,revertLane:0,gesture:null,action:de,hasEagerState:!1,eagerState:null,next:null};if(my(O))R2(W,ct);else{var Pt=O.alternate;if(O.lanes===0&&(Pt===null||Pt.lanes===0)&&(Pt=W.lastRenderedReducer,Pt!==null))try{var Rr=W.lastRenderedState,bn=Pt(Rr,de);if(ct.hasEagerState=!0,ct.eagerState=bn,$d(bn,Rr))return xx(O,W,ct,0),Rf===null&&k1(),!1}catch{}if(de=n2(O,W,ct,Re),de!==null)return Id(de,O,Re),R5(de,W,Re),!0}return!1}function Y1(O,W,de,Re){if(Re={lane:2,revertLane:Cy(),gesture:null,action:Re,hasEagerState:!1,eagerState:null,next:null},my(O)){if(W)throw Error(wt(479))}else W=n2(O,de,Re,2),W!==null&&Id(W,O,2)}function my(O){var W=O.alternate;return O===au||W!==null&&W===au}function R2(O,W){hy=ym=!0;var de=O.pending;de===null?W.next=W:(W.next=de.next,de.next=W),O.pending=W}function R5(O,W,de){if((de&4194048)!==0){var Re=W.lanes;Re&=O.pendingLanes,de|=Re,W.lanes=de,Fw(O,de)}}var Z1={readContext:Ov,use:Rx,useCallback:mh,useContext:mh,useEffect:mh,useImperativeHandle:mh,useLayoutEffect:mh,useInsertionEffect:mh,useMemo:mh,useReducer:mh,useRef:mh,useState:mh,useDebugValue:mh,useDeferredValue:mh,useTransition:mh,useSyncExternalStore:mh,useId:mh,useHostTransitionStatus:mh,useFormState:mh,useActionState:mh,useOptimistic:mh,useMemoCache:mh,useCacheRefresh:mh};Z1.useEffectEvent=mh;var I2={readContext:Ov,use:Rx,useCallback:function(O,W){return gv().memoizedState=[O,W===void 0?null:W],O},useContext:Ov,useEffect:Yx,useImperativeHandle:function(O,W,de){de=de!=null?de.concat([O]):null,Gx(4194308,4,Wx.bind(null,W,O),de)},useLayoutEffect:function(O,W){return Gx(4194308,4,O,W)},useInsertionEffect:function(O,W){Gx(4,2,O,W)},useMemo:function(O,W){var de=gv();W=W===void 0?null:W;var Re=O();if(vg){Td(!0);try{O()}finally{Td(!1)}}return de.memoizedState=[Re,W],Re},useReducer:function(O,W,de){var Re=gv();if(de!==void 0){var ct=de(W);if(vg){Td(!0);try{de(W)}finally{Td(!1)}}}else ct=W;return Re.memoizedState=Re.baseState=ct,O={pending:null,lanes:0,dispatch:null,lastRenderedReducer:O,lastRenderedState:ct},Re.queue=O,O=O.dispatch=P5.bind(null,au,O),[Re.memoizedState,O]},useRef:function(O){var W=gv();return O={current:O},W.memoizedState=O},useState:function(O){O=q1(O);var W=O.queue,de=tb.bind(null,au,W);return W.dispatch=de,[O.memoizedState,de]},useDebugValue:Kx,useDeferredValue:function(O,W){var de=gv();return G1(de,O,W)},useTransition:function(){var O=q1(!1);return O=C2.bind(null,au,O.queue,!0,!1),gv().memoizedState=O,[!1,O]},useSyncExternalStore:function(O,W,de){var Re=au,ct=gv();if(Uu){if(de===void 0)throw Error(wt(407));de=de()}else{if(de=W(),Rf===null)throw Error(wt(349));(rc&127)!==0||Ox(Re,W,de)}ct.memoizedState=de;var Pt={value:de,getSnapshot:W};return ct.queue=Pt,Yx(Bx.bind(null,Re,Pt,O),[O]),Re.flags|=2048,dy(9,{destroy:void 0},Fx.bind(null,Re,Pt,de,W),null),de},useId:function(){var O=gv(),W=Rf.identifierPrefix;if(Uu){var de=pp,Re=Vf;de=(Re&~(1<<32-Cf(Re)-1)).toString(32)+de,W="_"+W+"R_"+de,de=dg++,0<\/script>",Pt=Pt.removeChild(Pt.firstChild);break;case"select":Pt=typeof Re.is=="string"?Rr.createElement("select",{is:Re.is}):Rr.createElement("select"),Re.multiple?Pt.multiple=!0:Re.size&&(Pt.size=Re.size);break;default:Pt=typeof Re.is=="string"?Rr.createElement(ct,{is:Re.is}):Rr.createElement(ct)}}Pt[Sl]=W,Pt[rd]=Re;e:for(Rr=W.child;Rr!==null;){if(Rr.tag===5||Rr.tag===6)Pt.appendChild(Rr.stateNode);else if(Rr.tag!==4&&Rr.tag!==27&&Rr.child!==null){Rr.child.return=Rr,Rr=Rr.child;continue}if(Rr===W)break e;for(;Rr.sibling===null;){if(Rr.return===null||Rr.return===W)break e;Rr=Rr.return}Rr.sibling.return=Rr.return,Rr=Rr.sibling}W.stateNode=Pt;e:switch(ov(Pt,ct,Re),ct){case"button":case"input":case"select":case"textarea":Re=!!Re.autoFocus;break e;case"img":Re=!0;break e;default:Re=!1}Re&&c0(W)}}return Wf(W),Z2(W,W.type,O===null?null:O.memoizedProps,W.pendingProps,de),null;case 6:if(O&&W.stateNode!=null)O.memoizedProps!==Re&&c0(W);else{if(typeof Re!="string"&&W.stateNode===null)throw Error(wt(166));if(O=Qi.current,iy(W)){if(O=W.stateNode,de=W.memoizedProps,Re=null,ct=zv,ct!==null)switch(ct.tag){case 27:case 5:Re=ct.memoizedProps}O[Sl]=W,O=!!(O.nodeValue===de||Re!==null&&Re.suppressHydrationWarning===!0||wb(O.nodeValue,de)),O||cm(W,!0)}else O=Dd(O).createTextNode(Re),O[Sl]=W,W.stateNode=O}return Wf(W),null;case 31:if(de=W.memoizedState,O===null||O.memoizedState!==null){if(Re=iy(W),de!==null){if(O===null){if(!Re)throw Error(wt(318));if(O=W.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(wt(557));O[Sl]=W}else D0(),(W.flags&128)===0&&(W.memoizedState=null),W.flags|=4;Wf(W),O=!1}else de=o2(),O!==null&&O.memoizedState!==null&&(O.memoizedState.hydrationErrors=de),O=!0;if(!O)return W.flags&256?(ap(W),W):(ap(W),null);if((W.flags&128)!==0)throw Error(wt(558))}return Wf(W),null;case 13:if(Re=W.memoizedState,O===null||O.memoizedState!==null&&O.memoizedState.dehydrated!==null){if(ct=iy(W),Re!==null&&Re.dehydrated!==null){if(O===null){if(!ct)throw Error(wt(318));if(ct=W.memoizedState,ct=ct!==null?ct.dehydrated:null,!ct)throw Error(wt(317));ct[Sl]=W}else D0(),(W.flags&128)===0&&(W.memoizedState=null),W.flags|=4;Wf(W),ct=!1}else ct=o2(),O!==null&&O.memoizedState!==null&&(O.memoizedState.hydrationErrors=ct),ct=!0;if(!ct)return W.flags&256?(ap(W),W):(ap(W),null)}return ap(W),(W.flags&128)!==0?(W.lanes=de,W):(de=Re!==null,O=O!==null&&O.memoizedState!==null,de&&(Re=W.child,ct=null,Re.alternate!==null&&Re.alternate.memoizedState!==null&&Re.alternate.memoizedState.cachePool!==null&&(ct=Re.alternate.memoizedState.cachePool.pool),Pt=null,Re.memoizedState!==null&&Re.memoizedState.cachePool!==null&&(Pt=Re.memoizedState.cachePool.pool),Pt!==ct&&(Re.flags|=2048)),de!==O&&de&&(W.child.flags|=8192),ub(W,W.updateQueue),Wf(W),null);case 4:return Ju(),O===null&&Iy(W.stateNode.containerInfo),Wf(W),null;case 10:return Up(W.type),Wf(W),null;case 19:if(Vi(sc),Re=W.memoizedState,Re===null)return Wf(W),null;if(ct=(W.flags&128)!==0,Pt=Re.rendering,Pt===null)if(ct)K1(Re,!1);else{if(Ch!==0||O!==null&&(O.flags&128)!==0)for(O=W.child;O!==null;){if(Pt=fy(O),Pt!==null){for(W.flags|=128,K1(Re,!1),O=Pt.updateQueue,W.updateQueue=O,ub(W,O),W.subtreeFlags=0,O=de,de=W.child;de!==null;)l5(de,O),de=de.sibling;return Xn(sc,sc.current&1|2),Uu&&Eh(W,Re.treeForkCount),W.child}O=O.sibling}Re.tail!==null&&md()>hb&&(W.flags|=128,ct=!0,K1(Re,!1),W.lanes=4194304)}else{if(!ct)if(O=fy(Pt),O!==null){if(W.flags|=128,ct=!0,O=O.updateQueue,W.updateQueue=O,ub(W,O),K1(Re,!0),Re.tail===null&&Re.tailMode==="hidden"&&!Pt.alternate&&!Uu)return Wf(W),null}else 2*md()-Re.renderingStartTime>hb&&de!==536870912&&(W.flags|=128,ct=!0,K1(Re,!1),W.lanes=4194304);Re.isBackwards?(Pt.sibling=W.child,W.child=Pt):(O=Re.last,O!==null?O.sibling=Pt:W.child=Pt,Re.last=Pt)}return Re.tail!==null?(O=Re.tail,Re.rendering=O,Re.tail=O.sibling,Re.renderingStartTime=md(),O.sibling=null,de=sc.current,Xn(sc,ct?de&1|2:de&1),Uu&&Eh(W,Re.treeForkCount),O):(Wf(W),null);case 22:case 23:return ap(W),gm(),Re=W.memoizedState!==null,O!==null?O.memoizedState!==null!==Re&&(W.flags|=8192):Re&&(W.flags|=8192),Re?(de&536870912)!==0&&(W.flags&128)===0&&(Wf(W),W.subtreeFlags&6&&(W.flags|=8192)):Wf(W),de=W.updateQueue,de!==null&&ub(W,de.retryQueue),de=null,O!==null&&O.memoizedState!==null&&O.memoizedState.cachePool!==null&&(de=O.memoizedState.cachePool.pool),Re=null,W.memoizedState!==null&&W.memoizedState.cachePool!==null&&(Re=W.memoizedState.cachePool.pool),Re!==de&&(W.flags|=2048),O!==null&&Vi(hm),null;case 24:return de=null,O!==null&&(de=O.memoizedState.cache),W.memoizedState.cache!==de&&(W.flags|=2048),Up(rv),Wf(W),null;case 25:return null;case 30:return null}throw Error(wt(156,W.tag))}function NM(O,W){switch(og(W),W.tag){case 1:return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 3:return Up(rv),Ju(),O=W.flags,(O&65536)!==0&&(O&128)===0?(W.flags=O&-65537|128,W):null;case 26:case 27:case 5:return nu(W),null;case 31:if(W.memoizedState!==null){if(ap(W),W.alternate===null)throw Error(wt(340));D0()}return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 13:if(ap(W),O=W.memoizedState,O!==null&&O.dehydrated!==null){if(W.alternate===null)throw Error(wt(340));D0()}return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 19:return Vi(sc),null;case 4:return Ju(),null;case 10:return Up(W.type),null;case 22:case 23:return ap(W),gm(),O!==null&&Vi(hm),O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 24:return Up(rv),null;case 25:return null;default:return null}}function $5(O,W){switch(og(W),W.tag){case 3:Up(rv),Ju();break;case 26:case 27:case 5:nu(W);break;case 4:Ju();break;case 31:W.memoizedState!==null&&ap(W);break;case 13:ap(W);break;case 19:Vi(sc);break;case 10:Up(W.type);break;case 22:case 23:ap(W),gm(),O!==null&&Vi(hm);break;case 24:Up(rv)}}function $1(O,W){try{var de=W.updateQueue,Re=de!==null?de.lastEffect:null;if(Re!==null){var ct=Re.next;de=ct;do{if((de.tag&O)===O){Re=void 0;var Pt=de.create,Rr=de.inst;Re=Pt(),Rr.destroy=Re}de=de.next}while(de!==ct)}}catch(bn){lf(W,W.return,bn)}}function mp(O,W,de){try{var Re=W.updateQueue,ct=Re!==null?Re.lastEffect:null;if(ct!==null){var Pt=ct.next;Re=Pt;do{if((Re.tag&O)===O){var Rr=Re.inst,bn=Rr.destroy;if(bn!==void 0){Rr.destroy=void 0,ct=W;var Ma=de,ki=bn;try{ki()}catch(io){lf(ct,Ma,io)}}}Re=Re.next}while(Re!==Pt)}}catch(io){lf(W,W.return,io)}}function W2(O){var W=O.updateQueue;if(W!==null){var de=O.stateNode;try{y2(W,de)}catch(Re){lf(O,O.return,Re)}}}function J5(O,W,de){de.props=mg(O.type,O.memoizedProps),de.state=O.memoizedState;try{de.componentWillUnmount()}catch(Re){lf(O,W,Re)}}function gp(O,W){try{var de=O.ref;if(de!==null){switch(O.tag){case 26:case 27:case 5:var Re=O.stateNode;break;case 30:Re=O.stateNode;break;default:Re=O.stateNode}typeof de=="function"?O.refCleanup=de(Re):de.current=Re}}catch(ct){lf(O,W,ct)}}function qp(O,W){var de=O.ref,Re=O.refCleanup;if(de!==null)if(typeof Re=="function")try{Re()}catch(ct){lf(O,W,ct)}finally{O.refCleanup=null,O=O.alternate,O!=null&&(O.refCleanup=null)}else if(typeof de=="function")try{de(null)}catch(ct){lf(O,W,ct)}else de.current=null}function Q5(O){var W=O.type,de=O.memoizedProps,Re=O.stateNode;try{e:switch(W){case"button":case"input":case"select":case"textarea":de.autoFocus&&Re.focus();break e;case"img":de.src?Re.src=de.src:de.srcSet&&(Re.srcset=de.srcSet)}}catch(ct){lf(O,O.return,ct)}}function K2(O,W,de){try{var Re=O.stateNode;d3(Re,O.type,de,W),Re[rd]=W}catch(ct){lf(O,O.return,ct)}}function gg(O){return O.tag===5||O.tag===3||O.tag===26||O.tag===27&&m0(O.type)||O.tag===4}function J1(O){e:for(;;){for(;O.sibling===null;){if(O.return===null||gg(O.return))return null;O=O.return}for(O.sibling.return=O.return,O=O.sibling;O.tag!==5&&O.tag!==6&&O.tag!==18;){if(O.tag===27&&m0(O.type)||O.flags&2||O.child===null||O.tag===4)continue e;O.child.return=O,O=O.child}if(!(O.flags&2))return O.stateNode}}function yy(O,W,de){var Re=O.tag;if(Re===5||Re===6)O=O.stateNode,W?(de.nodeType===9?de.body:de.nodeName==="HTML"?de.ownerDocument.body:de).insertBefore(O,W):(W=de.nodeType===9?de.body:de.nodeName==="HTML"?de.ownerDocument.body:de,W.appendChild(O),de=de._reactRootContainer,de!=null||W.onclick!==null||(W.onclick=hc));else if(Re!==4&&(Re===27&&m0(O.type)&&(de=O.stateNode,W=null),O=O.child,O!==null))for(yy(O,W,de),O=O.sibling;O!==null;)yy(O,W,de),O=O.sibling}function Q1(O,W,de){var Re=O.tag;if(Re===5||Re===6)O=O.stateNode,W?de.insertBefore(O,W):de.appendChild(O);else if(Re!==4&&(Re===27&&m0(O.type)&&(de=O.stateNode),O=O.child,O!==null))for(Q1(O,W,de),O=O.sibling;O!==null;)Q1(O,W,de),O=O.sibling}function eA(O){var W=O.stateNode,de=O.memoizedProps;try{for(var Re=O.type,ct=W.attributes;ct.length;)W.removeAttributeNode(ct[0]);ov(W,Re,de),W[Sl]=O,W[rd]=de}catch(Pt){lf(O,O.return,Pt)}}var U0=!1,av=!1,$2=!1,J2=typeof WeakSet=="function"?WeakSet:Set,kh=null;function UM(O,W){if(O=O.containerInfo,Y0=S_,O=a5(O),Qg(O)){if("selectionStart"in O)var de={start:O.selectionStart,end:O.selectionEnd};else e:{de=(de=O.ownerDocument)&&de.defaultView||window;var Re=de.getSelection&&de.getSelection();if(Re&&Re.rangeCount!==0){de=Re.anchorNode;var ct=Re.anchorOffset,Pt=Re.focusNode;Re=Re.focusOffset;try{de.nodeType,Pt.nodeType}catch{de=null;break e}var Rr=0,bn=-1,Ma=-1,ki=0,io=0,fo=O,Ii=null;t:for(;;){for(var Ui;fo!==de||ct!==0&&fo.nodeType!==3||(bn=Rr+ct),fo!==Pt||Re!==0&&fo.nodeType!==3||(Ma=Rr+Re),fo.nodeType===3&&(Rr+=fo.nodeValue.length),(Ui=fo.firstChild)!==null;)Ii=fo,fo=Ui;for(;;){if(fo===O)break t;if(Ii===de&&++ki===ct&&(bn=Rr),Ii===Pt&&++io===Re&&(Ma=Rr),(Ui=fo.nextSibling)!==null)break;fo=Ii,Ii=fo.parentNode}fo=Ui}de=bn===-1||Ma===-1?null:{start:bn,end:Ma}}else de=null}de=de||{start:0,end:0}}else de=null;for(Cm={focusedElem:O,selectionRange:de},S_=!1,kh=W;kh!==null;)if(W=kh,O=W.child,(W.subtreeFlags&1028)!==0&&O!==null)O.return=W,kh=O;else for(;kh!==null;){switch(W=kh,Pt=W.alternate,O=W.flags,W.tag){case 0:if((O&4)!==0&&(O=W.updateQueue,O=O!==null?O.events:null,O!==null))for(de=0;de title"))),ov(Pt,Re,de),Pt[Sl]=O,Rv(Pt),Re=Pt;break e;case"link":var Rr=OA("link","href",ct).get(Re+(de.href||""));if(Rr){for(var bn=0;bnbf&&(Rr=bf,bf=Ul,Ul=Rr);var ci=r5(bn,Ul),Xa=r5(bn,bf);if(ci&&Xa&&(Ui.rangeCount!==1||Ui.anchorNode!==ci.node||Ui.anchorOffset!==ci.offset||Ui.focusNode!==Xa.node||Ui.focusOffset!==Xa.offset)){var Ti=fo.createRange();Ti.setStart(ci.node,ci.offset),Ui.removeAllRanges(),Ul>bf?(Ui.addRange(Ti),Ui.extend(Xa.node,Xa.offset)):(Ti.setEnd(Xa.node,Xa.offset),Ui.addRange(Ti))}}}}for(fo=[],Ui=bn;Ui=Ui.parentNode;)Ui.nodeType===1&&fo.push({element:Ui,left:Ui.scrollLeft,top:Ui.scrollTop});for(typeof bn.focus=="function"&&bn.focus(),bn=0;bnde?32:de,ai.T=null,de=a3,a3=null;var Pt=Sm,Rr=G0;if(iv=0,xg=Sm=null,G0=0,(Ec&6)!==0)throw Error(wt(331));var bn=Ec;if(Ec|=4,by(Pt.current),sA(Pt,Pt.current,Rr,de),Ec=bn,i_(0,!1),fv&&typeof fv.onPostCommitFiberRoot=="function")try{fv.onPostCommitFiberRoot(gd,Pt)}catch{}return!0}finally{yo.p=ct,ai.T=Re,AA(O,W)}}function MA(O,W,de){W=Mh(de,W),W=B0(O.stateNode,W,2),O=mm(O,W,2),O!==null&&(g1(O,2),d0(O))}function lf(O,W,de){if(O.tag===3)MA(O,O,de);else for(;W!==null;){if(W.tag===3){MA(W,O,de);break}else if(W.tag===1){var Re=W.stateNode;if(typeof W.type.getDerivedStateFromError=="function"||typeof Re.componentDidCatch=="function"&&(_p===null||!_p.has(Re))){O=Mh(de,O),de=N5(2),Re=mm(W,de,2),Re!==null&&(U5(de,Re,W,O),g1(Re,2),d0(Re));break}}W=W.return}}function s3(O,W,de){var Re=O.pingCache;if(Re===null){Re=O.pingCache=new cA;var ct=new Set;Re.set(W,ct)}else ct=Re.get(W),ct===void 0&&(ct=new Set,Re.set(W,ct));ct.has(de)||(Tm=!0,ct.add(de),O=YM.bind(null,O,W,de),W.then(O,O))}function YM(O,W,de){var Re=O.pingCache;Re!==null&&Re.delete(W),O.pingedLanes|=O.suspendedLanes&de,O.warmLanes&=~de,Rf===O&&(rc&de)===de&&(Ch===4||Ch===3&&(rc&62914560)===rc&&300>md()-r_?(Ec&2)===0&&Ay(O,0):n3|=de,Am===rc&&(Am=0)),d0(O)}function EA(O,W){W===0&&(W=RT()),O=zp(O,W),O!==null&&(g1(O,W),d0(O))}function My(O){var W=O.memoizedState,de=0;W!==null&&(de=W.retryLane),EA(O,de)}function Ey(O,W){var de=0;switch(O.tag){case 31:case 13:var Re=O.stateNode,ct=O.memoizedState;ct!==null&&(de=ct.retryLane);break;case 19:Re=O.stateNode;break;case 22:Re=O.stateNode._retryCache;break;default:throw Error(wt(314))}Re!==null&&Re.delete(W),EA(O,de)}function l3(O,W){return cp(O,W)}var _b=null,v0=null,u3=!1,ky=!1,c3=!1,Em=0;function d0(O){O!==v0&&O.next===null&&(v0===null?_b=v0=O:v0=v0.next=O),ky=!0,u3||(u3=!0,WM())}function i_(O,W){if(!c3&&ky){c3=!0;do for(var de=!1,Re=_b;Re!==null;){if(O!==0){var ct=Re.pendingLanes;if(ct===0)var Pt=0;else{var Rr=Re.suspendedLanes,bn=Re.pingedLanes;Pt=(1<<31-Cf(42|O)+1)-1,Pt&=ct&~(Rr&~bn),Pt=Pt&201326741?Pt&201326741|1:Pt?Pt|2:0}Pt!==0&&(de=!0,kA(Re,Pt))}else Pt=rc,Pt=nx(Re,Re===Rf?Pt:0,Re.cancelPendingCommit!==null||Re.timeoutHandle!==-1),(Pt&3)===0||m1(Re,Pt)||(de=!0,kA(Re,Pt));Re=Re.next}while(de);c3=!1}}function ZM(){f3()}function f3(){ky=u3=!1;var O=0;Em!==0&&RA()&&(O=Em);for(var W=md(),de=null,Re=_b;Re!==null;){var ct=Re.next,Pt=o_(Re,W);Pt===0?(Re.next=null,de===null?_b=ct:de.next=ct,ct===null&&(v0=de)):(de=Re,(O!==0||(Pt&3)!==0)&&(ky=!0)),Re=ct}iv!==0&&iv!==5||i_(O),Em!==0&&(Em=0)}function o_(O,W){for(var de=O.suspendedLanes,Re=O.pingedLanes,ct=O.expirationTimes,Pt=O.pendingLanes&-62914561;0bn)break;var io=Ma.transferSize,fo=Ma.initiatorType;io&&X0(fo)&&(Ma=Ma.responseEnd,Rr+=io*(Ma"u"?null:document;function Lb(O,W,de){var Re=zy;if(Re&&typeof W=="string"&&W){var ct=hp(W);ct='link[rel="'+O+'"][href="'+ct+'"]',typeof de=="string"&&(ct+='[crossorigin="'+de+'"]'),Cb.has(ct)||(Cb.add(ct),O={rel:O,crossOrigin:de,href:W},Re.querySelector(ct)===null&&(W=Re.createElement("link"),ov(W,"link",O),Rv(W),Re.head.appendChild(W)))}}function Sg(O){Xp.D(O),Lb("dns-prefetch",O,null)}function A3(O,W){Xp.C(O,W),Lb("preconnect",O,W)}function Pb(O,W,de){Xp.L(O,W,de);var Re=zy;if(Re&&O&&W){var ct='link[rel="preload"][as="'+hp(W)+'"]';W==="image"&&de&&de.imageSrcSet?(ct+='[imagesrcset="'+hp(de.imageSrcSet)+'"]',typeof de.imageSizes=="string"&&(ct+='[imagesizes="'+hp(de.imageSizes)+'"]')):ct+='[href="'+hp(O)+'"]';var Pt=ct;switch(W){case"style":Pt=Lm(O);break;case"script":Pt=Eg(O)}Od.has(Pt)||(O=Ln({rel:"preload",href:W==="image"&&de&&de.imageSrcSet?void 0:O,as:W},de),Od.set(Pt,O),Re.querySelector(ct)!==null||W==="style"&&Re.querySelector(g_(Pt))||W==="script"&&Re.querySelector(kg(Pt))||(W=Re.createElement("link"),ov(W,"link",O),Rv(W),Re.head.appendChild(W)))}}function Rb(O,W){Xp.m(O,W);var de=zy;if(de&&O){var Re=W&&typeof W.as=="string"?W.as:"script",ct='link[rel="modulepreload"][as="'+hp(Re)+'"][href="'+hp(O)+'"]',Pt=ct;switch(Re){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":Pt=Eg(O)}if(!Od.has(Pt)&&(O=Ln({rel:"modulepreload",href:O},W),Od.set(Pt,O),de.querySelector(ct)===null)){switch(Re){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(de.querySelector(kg(Pt)))return}Re=de.createElement("link"),ov(Re,"link",O),Rv(Re),de.head.appendChild(Re)}}}function m_(O,W,de){Xp.S(O,W,de);var Re=zy;if(Re&&O){var ct=Kg(Re).hoistableStyles,Pt=Lm(O);W=W||"default";var Rr=ct.get(Pt);if(!Rr){var bn={loading:0,preload:null};if(Rr=Re.querySelector(g_(Pt)))bn.loading=5;else{O=Ln({rel:"stylesheet",href:O,"data-precedence":W},de),(de=Od.get(Pt))&&Cg(O,de);var Ma=Rr=Re.createElement("link");Rv(Ma),ov(Ma,"link",O),Ma._p=new Promise(function(ki,io){Ma.onload=ki,Ma.onerror=io}),Ma.addEventListener("load",function(){bn.loading|=1}),Ma.addEventListener("error",function(){bn.loading|=2}),bn.loading|=4,y_(Rr,W,Re)}Rr={type:"stylesheet",instance:Rr,count:1,state:bn},ct.set(Pt,Rr)}}}function Oy(O,W){Xp.X(O,W);var de=zy;if(de&&O){var Re=Kg(de).hoistableScripts,ct=Eg(O),Pt=Re.get(ct);Pt||(Pt=de.querySelector(kg(ct)),Pt||(O=Ln({src:O,async:!0},W),(W=Od.get(ct))&&Db(O,W),Pt=de.createElement("script"),Rv(Pt),ov(Pt,"link",O),de.head.appendChild(Pt)),Pt={type:"script",instance:Pt,count:1,state:null},Re.set(ct,Pt))}}function S3(O,W){Xp.M(O,W);var de=zy;if(de&&O){var Re=Kg(de).hoistableScripts,ct=Eg(O),Pt=Re.get(ct);Pt||(Pt=de.querySelector(kg(ct)),Pt||(O=Ln({src:O,async:!0,type:"module"},W),(W=Od.get(ct))&&Db(O,W),Pt=de.createElement("script"),Rv(Pt),ov(Pt,"link",O),de.head.appendChild(Pt)),Pt={type:"script",instance:Pt,count:1,state:null},Re.set(ct,Pt))}}function Ib(O,W,de,Re){var ct=(ct=Qi.current)?y0(ct):null;if(!ct)throw Error(wt(446));switch(O){case"meta":case"title":return null;case"style":return typeof de.precedence=="string"&&typeof de.href=="string"?(W=Lm(de.href),de=Kg(ct).hoistableStyles,Re=de.get(W),Re||(Re={type:"style",instance:null,count:0,state:null},de.set(W,Re)),Re):{type:"void",instance:null,count:0,state:null};case"link":if(de.rel==="stylesheet"&&typeof de.href=="string"&&typeof de.precedence=="string"){O=Lm(de.href);var Pt=Kg(ct).hoistableStyles,Rr=Pt.get(O);if(Rr||(ct=ct.ownerDocument||ct,Rr={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},Pt.set(O,Rr),(Pt=ct.querySelector(g_(O)))&&!Pt._p&&(Rr.instance=Pt,Rr.state.loading=5),Od.has(O)||(de={rel:"preload",as:"style",href:de.href,crossOrigin:de.crossOrigin,integrity:de.integrity,media:de.media,hrefLang:de.hrefLang,referrerPolicy:de.referrerPolicy},Od.set(O,de),Pt||zA(ct,O,de,Rr.state))),W&&Re===null)throw Error(wt(528,""));return Rr}if(W&&Re!==null)throw Error(wt(529,""));return null;case"script":return W=de.async,de=de.src,typeof de=="string"&&W&&typeof W!="function"&&typeof W!="symbol"?(W=Eg(de),de=Kg(ct).hoistableScripts,Re=de.get(W),Re||(Re={type:"script",instance:null,count:0,state:null},de.set(W,Re)),Re):{type:"void",instance:null,count:0,state:null};default:throw Error(wt(444,O))}}function Lm(O){return'href="'+hp(O)+'"'}function g_(O){return'link[rel="stylesheet"]['+O+"]"}function Mg(O){return Ln({},O,{"data-precedence":O.precedence,precedence:null})}function zA(O,W,de,Re){O.querySelector('link[rel="preload"][as="style"]['+W+"]")?Re.loading=1:(W=O.createElement("link"),Re.preload=W,W.addEventListener("load",function(){return Re.loading|=1}),W.addEventListener("error",function(){return Re.loading|=2}),ov(W,"link",de),Rv(W),O.head.appendChild(W))}function Eg(O){return'[src="'+hp(O)+'"]'}function kg(O){return"script[async]"+O}function M3(O,W,de){if(W.count++,W.instance===null)switch(W.type){case"style":var Re=O.querySelector('style[data-href~="'+hp(de.href)+'"]');if(Re)return W.instance=Re,Rv(Re),Re;var ct=Ln({},de,{"data-href":de.href,"data-precedence":de.precedence,href:null,precedence:null});return Re=(O.ownerDocument||O).createElement("style"),Rv(Re),ov(Re,"style",ct),y_(Re,de.precedence,O),W.instance=Re;case"stylesheet":ct=Lm(de.href);var Pt=O.querySelector(g_(ct));if(Pt)return W.state.loading|=4,W.instance=Pt,Rv(Pt),Pt;Re=Mg(de),(ct=Od.get(ct))&&Cg(Re,ct),Pt=(O.ownerDocument||O).createElement("link"),Rv(Pt);var Rr=Pt;return Rr._p=new Promise(function(bn,Ma){Rr.onload=bn,Rr.onerror=Ma}),ov(Pt,"link",Re),W.state.loading|=4,y_(Pt,de.precedence,O),W.instance=Pt;case"script":return Pt=Eg(de.src),(ct=O.querySelector(kg(Pt)))?(W.instance=ct,Rv(ct),ct):(Re=de,(ct=Od.get(Pt))&&(Re=Ln({},de),Db(Re,ct)),O=O.ownerDocument||O,ct=O.createElement("script"),Rv(ct),ov(ct,"link",Re),O.head.appendChild(ct),W.instance=ct);case"void":return null;default:throw Error(wt(443,W.type))}else W.type==="stylesheet"&&(W.state.loading&4)===0&&(Re=W.instance,W.state.loading|=4,y_(Re,de.precedence,O));return W.instance}function y_(O,W,de){for(var Re=de.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),ct=Re.length?Re[Re.length-1]:null,Pt=ct,Rr=0;Rr title"):null)}function QM(O,W,de){if(de===1||W.itemProp!=null)return!1;switch(O){case"meta":case"title":return!0;case"style":if(typeof W.precedence!="string"||typeof W.href!="string"||W.href==="")break;return!0;case"link":if(typeof W.rel!="string"||typeof W.href!="string"||W.href===""||W.onLoad||W.onError)break;return W.rel==="stylesheet"?(O=W.disabled,typeof W.precedence=="string"&&O==null):!0;case"script":if(W.async&&typeof W.async!="function"&&typeof W.async!="symbol"&&!W.onLoad&&!W.onError&&W.src&&typeof W.src=="string")return!0}return!1}function _v(O){return!(O.type==="stylesheet"&&(O.state.loading&3)===0)}function Fy(O,W,de,Re){if(de.type==="stylesheet"&&(typeof Re.media!="string"||matchMedia(Re.media).matches!==!1)&&(de.state.loading&4)===0){if(de.instance===null){var ct=Lm(Re.href),Pt=W.querySelector(g_(ct));if(Pt){W=Pt._p,W!==null&&typeof W=="object"&&typeof W.then=="function"&&(O.count++,O=b_.bind(O),W.then(O,O)),de.state.loading|=4,de.instance=Pt,Rv(Pt);return}Pt=W.ownerDocument||W,Re=Mg(Re),(ct=Od.get(ct))&&Cg(Re,ct),Pt=Pt.createElement("link"),Rv(Pt);var Rr=Pt;Rr._p=new Promise(function(bn,Ma){Rr.onload=bn,Rr.onerror=Ma}),ov(Pt,"link",Re),de.instance=Pt}O.stylesheets===null&&(O.stylesheets=new Map),O.stylesheets.set(de,W),(W=de.state.preload)&&(de.state.loading&3)===0&&(O.count++,de=b_.bind(O),W.addEventListener("load",de),W.addEventListener("error",de))}}var zb=0;function Ob(O,W){return O.stylesheets&&O.count===0&&T_(O,O.stylesheets),0zb?50:800)+W);return O.unsuspend=de,function(){O.unsuspend=null,clearTimeout(Re),clearTimeout(ct)}}:null}function b_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)T_(this,this.stylesheets);else if(this.unsuspend){var O=this.unsuspend;this.unsuspend=null,O()}}}var w_=null;function T_(O,W){O.stylesheets=null,O.unsuspend!==null&&(O.count++,w_=new Map,W.forEach(E3,O),w_=null,b_.call(O))}function E3(O,W){if(!(W.state.loading&4)){var de=w_.get(O);if(de)var Re=de.get(null);else{de=new Map,w_.set(O,de);for(var ct=O.querySelectorAll("link[data-precedence],style[data-precedence]"),Pt=0;Pt"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ie)}catch(ut){console.error(ut)}}return Ie(),C6.exports=TO(),C6.exports}var SO=AO(),I6={},D6={},z6={exports:{}},O6,s8;function MO(){if(s8)return O6;s8=1;var Ie="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return O6=Ie,O6}var F6,l8;function EO(){if(l8)return F6;l8=1;var Ie=MO();function ut(){}function Tt(){}return Tt.resetWarningCache=ut,F6=function(){function wt(br,tn,an,Zr,Sn,Ln){if(Ln!==Ie){var fa=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 fa.name="Invariant Violation",fa}}wt.isRequired=wt;function sr(){return wt}var vr={array:wt,bigint:wt,bool:wt,func:wt,number:wt,object:wt,string:wt,symbol:wt,any:wt,arrayOf:sr,element:wt,elementType:wt,instanceOf:sr,node:wt,objectOf:sr,oneOf:sr,oneOfType:sr,shape:sr,exact:sr,checkPropTypes:Tt,resetWarningCache:ut};return vr.PropTypes=vr,vr},F6}var u8;function kO(){return u8||(u8=1,z6.exports=EO()()),z6.exports}var c8;function CO(){return c8||(c8=1,(function(Ie){function ut(go){"@babel/helpers - typeof";return ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(mi){return typeof mi}:function(mi){return mi&&typeof Symbol=="function"&&mi.constructor===Symbol&&mi!==Symbol.prototype?"symbol":typeof mi},ut(go)}Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.default=xl;var Tt=br(aM()),wt=sr(kO());function sr(go){return go&&go.__esModule?go:{default:go}}function vr(go){if(typeof WeakMap!="function")return null;var mi=new WeakMap,Yi=new WeakMap;return(vr=function(Za){return Za?Yi:mi})(go)}function br(go,mi){if(go&&go.__esModule)return go;if(go===null||ut(go)!=="object"&&typeof go!="function")return{default:go};var Yi=vr(mi);if(Yi&&Yi.has(go))return Yi.get(go);var As={},Za=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Oo in go)if(Oo!=="default"&&Object.prototype.hasOwnProperty.call(go,Oo)){var Mi=Za?Object.getOwnPropertyDescriptor(go,Oo):null;Mi&&(Mi.get||Mi.set)?Object.defineProperty(As,Oo,Mi):As[Oo]=go[Oo]}return As.default=go,Yi&&Yi.set(go,As),As}function tn(go,mi){if(!(go instanceof mi))throw new TypeError("Cannot call a class as a function")}function an(go,mi){for(var Yi=0;Yi"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 Lo(go){return Lo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Yi){return Yi.__proto__||Object.getPrototypeOf(Yi)},Lo(go)}var si=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],Ge=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],zo=typeof window<"u";function xl(go){var mi=(function(Yi){Sn(Za,Yi);var As=fa(Za);function Za(Oo){var Mi;return tn(this,Za),Mi=As.call(this,Oo),Mi.p=Promise.resolve(),Mi.resizeHandler=null,Mi.handlers={},Mi.syncWindowResize=Mi.syncWindowResize.bind(ao(Mi)),Mi.syncEventHandlers=Mi.syncEventHandlers.bind(ao(Mi)),Mi.attachUpdateEvents=Mi.attachUpdateEvents.bind(ao(Mi)),Mi.getRef=Mi.getRef.bind(ao(Mi)),Mi.handleUpdate=Mi.handleUpdate.bind(ao(Mi)),Mi.figureCallback=Mi.figureCallback.bind(ao(Mi)),Mi.updatePlotly=Mi.updatePlotly.bind(ao(Mi)),Mi}return Zr(Za,[{key:"updatePlotly",value:function(Mi,po,js){var Ga=this;this.p=this.p.then(function(){if(!Ga.unmounting){if(!Ga.el)throw new Error("Missing element reference");return go.react(Ga.el,{data:Ga.props.data,layout:Ga.props.layout,config:Ga.props.config,frames:Ga.props.frames})}}).then(function(){Ga.unmounting||(Ga.syncWindowResize(Mi),Ga.syncEventHandlers(),Ga.figureCallback(po),js&&Ga.attachUpdateEvents())}).catch(function(hi){Ga.props.onError&&Ga.props.onError(hi)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(Mi){this.unmounting=!1;var po=Mi.frames&&Mi.frames.length?Mi.frames.length:0,js=this.props.frames&&this.props.frames.length?this.props.frames.length:0,Ga=!(Mi.layout===this.props.layout&&Mi.data===this.props.data&&Mi.config===this.props.config&&js===po),hi=Mi.revision!==void 0,ai=Mi.revision!==this.props.revision;!Ga&&(!hi||hi&&!ai)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&zo&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),go.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var Mi=this;!this.el||!this.el.removeListener||Ge.forEach(function(po){Mi.el.on(po,Mi.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var Mi=this;!this.el||!this.el.removeListener||Ge.forEach(function(po){Mi.el.removeListener(po,Mi.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(Mi){if(typeof Mi=="function"){var po=this.el,js=po.data,Ga=po.layout,hi=this.el._transitionData?this.el._transitionData._frames:null,ai={data:js,layout:Ga,frames:hi};Mi(ai,this.el)}}},{key:"syncWindowResize",value:function(Mi){var po=this;zo&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return go.Plots.resize(po.el)},window.addEventListener("resize",this.resizeHandler),Mi&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(Mi){this.el=Mi,this.props.debug&&zo&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var Mi=this;si.forEach(function(po){var js=Mi.props["on"+po],Ga=Mi.handlers[po],hi=!!Ga;js&&!hi?Mi.addEventHandler(po,js):!js&&hi?Mi.removeEventHandler(po):js&&hi&&js!==Ga&&(Mi.removeEventHandler(po),Mi.addEventHandler(po,js))})}},{key:"addEventHandler",value:function(Mi,po){this.handlers[Mi]=po,this.el.on(this.getPlotlyEventName(Mi),this.handlers[Mi])}},{key:"removeEventHandler",value:function(Mi){this.el.removeListener(this.getPlotlyEventName(Mi),this.handlers[Mi]),delete this.handlers[Mi]}},{key:"getPlotlyEventName",value:function(Mi){return"plotly_"+Mi.toLowerCase()}},{key:"render",value:function(){return Tt.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),Za})(Tt.Component);return mi.propTypes={data:wt.default.arrayOf(wt.default.object),config:wt.default.object,layout:wt.default.object,frames:wt.default.arrayOf(wt.default.object),revision:wt.default.number,onInitialized:wt.default.func,onPurge:wt.default.func,onError:wt.default.func,onUpdate:wt.default.func,debug:wt.default.bool,style:wt.default.object,className:wt.default.string,useResizeHandler:wt.default.bool,divId:wt.default.string},si.forEach(function(Yi){mi.propTypes["on"+Yi]=wt.default.func}),mi.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},mi}})(D6)),D6}var QS={exports:{}},LO=QS.exports,f8;function PO(){return f8||(f8=1,(function(Ie){var ut={};(function(Tt,wt){Ie.exports?Ie.exports=wt():Tt.moduleName=wt()})(typeof self<"u"?self:LO,()=>{var Tt=(()=>{var wt=Object.create,sr=Object.defineProperty,vr=Object.defineProperties,br=Object.getOwnPropertyDescriptor,tn=Object.getOwnPropertyDescriptors,an=Object.getOwnPropertyNames,Zr=Object.getOwnPropertySymbols,Sn=Object.getPrototypeOf,Ln=Object.prototype.hasOwnProperty,fa=Object.prototype.propertyIsEnumerable,Gn=($,G,h)=>G in $?sr($,G,{enumerable:!0,configurable:!0,writable:!0,value:h}):$[G]=h,ao=($,G)=>{for(var h in G||(G={}))Ln.call(G,h)&&Gn($,h,G[h]);if(Zr)for(var h of Zr(G))fa.call(G,h)&&Gn($,h,G[h]);return $},qi=($,G)=>vr($,tn(G)),Lo=($,G)=>{var h={};for(var b in $)Ln.call($,b)&&G.indexOf(b)<0&&(h[b]=$[b]);if($!=null&&Zr)for(var b of Zr($))G.indexOf(b)<0&&fa.call($,b)&&(h[b]=$[b]);return h},si=($,G)=>function(){return $&&(G=(0,$[an($)[0]])($=0)),G},Ge=($,G)=>function(){return G||(0,$[an($)[0]])((G={exports:{}}).exports,G),G.exports},zo=($,G)=>{for(var h in G)sr($,h,{get:G[h],enumerable:!0})},xl=($,G,h,b)=>{if(G&&typeof G=="object"||typeof G=="function")for(let S of an(G))!Ln.call($,S)&&S!==h&&sr($,S,{get:()=>G[S],enumerable:!(b=br(G,S))||b.enumerable});return $},go=($,G,h)=>(h=$!=null?wt(Sn($)):{},xl(sr(h,"default",{value:$,enumerable:!0}),$)),mi=$=>xl(sr({},"__esModule",{value:!0}),$),Yi=Ge({"src/version.js"($){$.version="3.3.1"}}),As=Ge({"node_modules/native-promise-only/lib/npo.src.js"($,G){(function(b,S,E){S[b]=S[b]||E(),typeof G<"u"&&G.exports&&(G.exports=S[b])})("Promise",typeof window<"u"?window:$,function(){var b,S,E,e=Object.prototype.toString,t=typeof setImmediate<"u"?function(g){return setImmediate(g)}:setTimeout;try{Object.defineProperty({},"x",{}),b=function(g,x,A,M){return Object.defineProperty(g,x,{value:A,writable:!0,configurable:M!==!1})}}catch{b=function(x,A,M){return x[A]=M,x}}E=(function(){var g,x,A;function M(_,w){this.fn=_,this.self=w,this.next=void 0}return{add:function(w,m){A=new M(w,m),x?x.next=A:g=A,x=A,A=void 0},drain:function(){var w=g;for(g=x=S=void 0;w;)w.fn.call(w.self),w=w.next}}})();function r(l,g){E.add(l,g),S||(S=t(E.drain))}function o(l){var g,x=typeof l;return l!=null&&(x=="object"||x=="function")&&(g=l.then),typeof g=="function"?g:!1}function n(){for(var l=0;l0&&r(n,x))}catch(A){s.call(new c(x),A)}}}function s(l){var g=this;g.triggered||(g.triggered=!0,g.def&&(g=g.def),g.msg=l,g.state=2,g.chain.length>0&&r(n,g))}function f(l,g,x,A){for(var M=0;MOe?1:ge>=Oe?0:NaN}h.descending=function(ge,Oe){return Oege?1:Oe>=ge?0:NaN},h.min=function(ge,Oe){var tt=-1,xt=ge.length,St,It;if(arguments.length===1){for(;++tt=It){St=It;break}for(;++ttIt&&(St=It)}else{for(;++tt=It){St=It;break}for(;++ttIt&&(St=It)}return St},h.max=function(ge,Oe){var tt=-1,xt=ge.length,St,It;if(arguments.length===1){for(;++tt=It){St=It;break}for(;++ttSt&&(St=It)}else{for(;++tt=It){St=It;break}for(;++ttSt&&(St=It)}return St},h.extent=function(ge,Oe){var tt=-1,xt=ge.length,St,It,Qt;if(arguments.length===1){for(;++tt=It){St=Qt=It;break}for(;++ttIt&&(St=It),Qt=It){St=Qt=It;break}for(;++ttIt&&(St=It),Qt1)return Qt/(yr-1)},h.deviation=function(){var ge=h.variance.apply(this,arguments);return ge&&Math.sqrt(ge)};function p(ge){return{left:function(Oe,tt,xt,St){for(arguments.length<3&&(xt=0),arguments.length<4&&(St=Oe.length);xt>>1;ge(Oe[It],tt)<0?xt=It+1:St=It}return xt},right:function(Oe,tt,xt,St){for(arguments.length<3&&(xt=0),arguments.length<4&&(St=Oe.length);xt>>1;ge(Oe[It],tt)>0?St=It:xt=It+1}return xt}}}var d=p(s);h.bisectLeft=d.left,h.bisect=h.bisectRight=d.right,h.bisector=function(ge){return p(ge.length===1?function(Oe,tt){return s(ge(Oe),tt)}:ge)},h.shuffle=function(ge,Oe,tt){(xt=arguments.length)<3&&(tt=ge.length,xt<2&&(Oe=0));for(var xt=tt-Oe,St,It;xt;)It=Math.random()*xt--|0,St=ge[xt+Oe],ge[xt+Oe]=ge[It+Oe],ge[It+Oe]=St;return ge},h.permute=function(ge,Oe){for(var tt=Oe.length,xt=new Array(tt);tt--;)xt[tt]=ge[Oe[tt]];return xt},h.pairs=function(ge){for(var Oe=0,tt=ge.length-1,xt=ge[0],St=new Array(tt<0?0:tt);Oe=0;)for(Qt=ge[Oe],tt=Qt.length;--tt>=0;)It[--St]=Qt[tt];return It};var l=Math.abs;h.range=function(ge,Oe,tt){if(arguments.length<3&&(tt=1,arguments.length<2&&(Oe=ge,ge=0)),(Oe-ge)/tt===1/0)throw new Error("infinite range");var xt=[],St=g(l(tt)),It=-1,Qt;if(ge*=St,Oe*=St,tt*=St,tt<0)for(;(Qt=ge+tt*++It)>Oe;)xt.push(Qt/St);else for(;(Qt=ge+tt*++It)=Oe.length)return St?St.call(ge,yr):xt?yr.sort(xt):yr;for(var Hr=-1,hn=yr.length,An=Oe[Xr++],kn,La,zn,Qn=new A,oa;++Hr=Oe.length)return Jt;var Xr=[],Hr=tt[yr++];return Jt.forEach(function(hn,An){Xr.push({key:hn,values:Qt(An,yr)})}),Hr?Xr.sort(function(hn,An){return Hr(hn.key,An.key)}):Xr}return ge.map=function(Jt,yr){return It(yr,Jt,0)},ge.entries=function(Jt){return Qt(It(h.map,Jt,0),0)},ge.key=function(Jt){return Oe.push(Jt),ge},ge.sortKeys=function(Jt){return tt[Oe.length-1]=Jt,ge},ge.sortValues=function(Jt){return xt=Jt,ge},ge.rollup=function(Jt){return St=Jt,ge},ge},h.set=function(ge){var Oe=new z;if(ge)for(var tt=0,xt=ge.length;tt=0&&(xt=ge.slice(tt+1),ge=ge.slice(0,tt)),ge)return arguments.length<2?this[ge].on(xt):this[ge].on(xt,Oe);if(arguments.length===2){if(Oe==null)for(ge in this)this.hasOwnProperty(ge)&&this[ge].on(xt,null);return this}};function Z(ge){var Oe=[],tt=new A;function xt(){for(var St=Oe,It=-1,Qt=St.length,Jt;++It=0&&(tt=ge.slice(0,Oe))!=="xmlns"&&(ge=ge.slice(Oe+1)),ve.hasOwnProperty(tt)?{space:ve[tt],local:ge}:ge}},te.attr=function(ge,Oe){if(arguments.length<2){if(typeof ge=="string"){var tt=this.node();return ge=h.ns.qualify(ge),ge.local?tt.getAttributeNS(ge.space,ge.local):tt.getAttribute(ge)}for(Oe in ge)this.each(Ae(Oe,ge[Oe]));return this}return this.each(Ae(ge,Oe))};function Ae(ge,Oe){ge=h.ns.qualify(ge);function tt(){this.removeAttribute(ge)}function xt(){this.removeAttributeNS(ge.space,ge.local)}function St(){this.setAttribute(ge,Oe)}function It(){this.setAttributeNS(ge.space,ge.local,Oe)}function Qt(){var yr=Oe.apply(this,arguments);yr==null?this.removeAttribute(ge):this.setAttribute(ge,yr)}function Jt(){var yr=Oe.apply(this,arguments);yr==null?this.removeAttributeNS(ge.space,ge.local):this.setAttributeNS(ge.space,ge.local,yr)}return Oe==null?ge.local?xt:tt:typeof Oe=="function"?ge.local?Jt:Qt:ge.local?It:St}function Ce(ge){return ge.trim().replace(/\s+/g," ")}te.classed=function(ge,Oe){if(arguments.length<2){if(typeof ge=="string"){var tt=this.node(),xt=(ge=ze(ge)).length,St=-1;if(Oe=tt.classList){for(;++St=0;)(It=tt[xt])&&(St&&St!==It.nextSibling&&St.parentNode.insertBefore(It,St),St=It);return this},te.sort=function(ge){ge=Ne.apply(this,arguments);for(var Oe=-1,tt=this.length;++Oe=Oe&&(Oe=St+1);!(yr=Qt[Oe])&&++Oe0&&(ge=ge.slice(0,St));var Qt=$t.get(ge);Qt&&(ge=Qt,It=Er);function Jt(){var Hr=this[xt];Hr&&(this.removeEventListener(ge,Hr,Hr.$),delete this[xt])}function yr(){var Hr=It(Oe,S(arguments));Jt.call(this),this.addEventListener(ge,this[xt]=Hr,Hr.$=tt),Hr._=Oe}function Xr(){var Hr=new RegExp("^__on([^.]+)"+h.requote(ge)+"$"),hn;for(var An in this)if(hn=An.match(Hr)){var kn=this[An];this.removeEventListener(hn[1],kn,kn.$),delete this[An]}}return St?Oe?yr:Jt:Oe?U:Xr}var $t=h.map({mouseenter:"mouseover",mouseleave:"mouseout"});E&&$t.forEach(function(ge){"on"+ge in E&&$t.remove(ge)});function rr(ge,Oe){return function(tt){var xt=h.event;h.event=tt,Oe[0]=this.__data__;try{ge.apply(this,Oe)}finally{h.event=xt}}}function Er(ge,Oe){var tt=rr(ge,Oe);return function(xt){var St=this,It=xt.relatedTarget;(!It||It!==St&&!(It.compareDocumentPosition(St)&8))&&tt.call(St,xt)}}var Mr,Wr=0;function Sr(ge){var Oe=".dragsuppress-"+ ++Wr,tt="click"+Oe,xt=h.select(t(ge)).on("touchmove"+Oe,re).on("dragstart"+Oe,re).on("selectstart"+Oe,re);if(Mr==null&&(Mr="onselectstart"in ge?!1:B(ge.style,"userSelect")),Mr){var St=e(ge).style,It=St[Mr];St[Mr]="none"}return function(Qt){if(xt.on(Oe,null),Mr&&(St[Mr]=It),Qt){var Jt=function(){xt.on(tt,null)};xt.on(tt,function(){re(),Jt()},!0),setTimeout(Jt,0)}}}h.mouse=function(ge){return Mt(ge,fe())};var Br=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Mt(ge,Oe){Oe.changedTouches&&(Oe=Oe.changedTouches[0]);var tt=ge.ownerSVGElement||ge;if(tt.createSVGPoint){var xt=tt.createSVGPoint();if(Br<0){var St=t(ge);if(St.scrollX||St.scrollY){tt=h.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var It=tt[0][0].getScreenCTM();Br=!(It.f||It.e),tt.remove()}}return Br?(xt.x=Oe.pageX,xt.y=Oe.pageY):(xt.x=Oe.clientX,xt.y=Oe.clientY),xt=xt.matrixTransform(ge.getScreenCTM().inverse()),[xt.x,xt.y]}var Qt=ge.getBoundingClientRect();return[Oe.clientX-Qt.left-ge.clientLeft,Oe.clientY-Qt.top-ge.clientTop]}h.touch=function(ge,Oe,tt){if(arguments.length<3&&(tt=Oe,Oe=fe().changedTouches),Oe){for(var xt=0,St=Oe.length,It;xt1?Xe:ge<-1?-Xe:Math.asin(ge)}function Wt(ge){return((ge=Math.exp(ge))-1/ge)/2}function _r(ge){return((ge=Math.exp(ge))+1/ge)/2}function pr(ge){return((ge=Math.exp(2*ge))-1)/(ge+1)}var hr=Math.SQRT2,Fr=2,En=4;h.interpolateZoom=function(ge,Oe){var tt=ge[0],xt=ge[1],St=ge[2],It=Oe[0],Qt=Oe[1],Jt=Oe[2],yr=It-tt,Xr=Qt-xt,Hr=yr*yr+Xr*Xr,hn,An;if(Hr0&&(co=co.transition().duration(Qt)),co.call(Ra.event)}function wo(){Qn&&Qn.domain(zn.range().map(function(co){return(co-ge.x)/ge.k}).map(zn.invert)),Aa&&Aa.domain(oa.range().map(function(co){return(co-ge.y)/ge.k}).map(oa.invert))}function ko(co){Jt++||co({type:"zoomstart"})}function Ks(co){wo(),co({type:"zoom",scale:ge.k,translate:[ge.x,ge.y]})}function Ro(co){--Jt||(co({type:"zoomend"}),tt=null)}function us(){var co=this,Is=La.of(co,arguments),el=0,Zl=h.select(t(co)).on(Xr,El).on(Hr,Wl),Ol=ia(h.mouse(co)),bc=Sr(co);wa.call(co),ko(Is);function El(){el=1,zi(h.mouse(co),Ol),Ks(Is)}function Wl(){Zl.on(Xr,null).on(Hr,null),bc(el),Ro(Is)}}function nl(){var co=this,Is=La.of(co,arguments),el={},Zl=0,Ol,bc=".zoom-"+h.event.changedTouches[0].identifier,El="touchmove"+bc,Wl="touchend"+bc,Yc=[],Eu=h.select(co),dt=Sr(co);wr(),ko(Is),Eu.on(yr,null).on(An,wr);function gr(){var gn=h.touches(co);return Ol=ge.k,gn.forEach(function(pn){pn.identifier in el&&(el[pn.identifier]=ia(pn))}),gn}function wr(){var gn=h.event.target;h.select(gn).on(El,Cn).on(Wl,ua),Yc.push(gn);for(var pn=h.event.changedTouches,za=0,Ia=pn.length;za1){var Bi=Da[0],bi=Da[1],Ha=Bi[0]-bi[0],ga=Bi[1]-bi[1];Zl=Ha*Ha+ga*ga}}function Cn(){var gn=h.touches(co),pn,za,Ia,Da;wa.call(co);for(var Wa=0,Bi=gn.length;Wa1?1:Oe,tt=tt<0?0:tt>1?1:tt,St=tt<=.5?tt*(1+Oe):tt+Oe-tt*Oe,xt=2*tt-St;function It(Jt){return Jt>360?Jt-=360:Jt<0&&(Jt+=360),Jt<60?xt+(St-xt)*Jt/60:Jt<180?St:Jt<240?xt+(St-xt)*(240-Jt)/60:xt}function Qt(Jt){return Math.round(It(Jt)*255)}return new yi(Qt(ge+120),Qt(ge),Qt(ge-120))}h.hcl=ir;function ir(ge,Oe,tt){return this instanceof ir?(this.h=+ge,this.c=+Oe,void(this.l=+tt)):arguments.length<2?ge instanceof ir?new ir(ge.h,ge.c,ge.l):ge instanceof lr?ha(ge.l,ge.a,ge.b):ha((ge=Ir((ge=h.rgb(ge)).r,ge.g,ge.b)).l,ge.a,ge.b):new ir(ge,Oe,tt)}var qt=ir.prototype=new ra;qt.brighter=function(ge){return new ir(this.h,this.c,Math.min(100,this.l+Vr*(arguments.length?ge:1)))},qt.darker=function(ge){return new ir(this.h,this.c,Math.max(0,this.l-Vr*(arguments.length?ge:1)))},qt.rgb=function(){return ar(this.h,this.c,this.l).rgb()};function ar(ge,Oe,tt){return isNaN(ge)&&(ge=0),isNaN(Oe)&&(Oe=0),new lr(tt,Math.cos(ge*=Je)*Oe,Math.sin(ge)*Oe)}h.lab=lr;function lr(ge,Oe,tt){return this instanceof lr?(this.l=+ge,this.a=+Oe,void(this.b=+tt)):arguments.length<2?ge instanceof lr?new lr(ge.l,ge.a,ge.b):ge instanceof ir?ar(ge.h,ge.c,ge.l):Ir((ge=yi(ge)).r,ge.g,ge.b):new lr(ge,Oe,tt)}var Vr=18,sn=.95047,mn=1,wn=1.08883,Jn=lr.prototype=new ra;Jn.brighter=function(ge){return new lr(Math.min(100,this.l+Vr*(arguments.length?ge:1)),this.a,this.b)},Jn.darker=function(ge){return new lr(Math.max(0,this.l-Vr*(arguments.length?ge:1)),this.a,this.b)},Jn.rgb=function(){return pa(this.l,this.a,this.b)};function pa(ge,Oe,tt){var xt=(ge+16)/116,St=xt+Oe/500,It=xt-tt/200;return St=_a(St)*sn,xt=_a(xt)*mn,It=_a(It)*wn,new yi(Vn(3.2404542*St-1.5371385*xt-.4985314*It),Vn(-.969266*St+1.8760108*xt+.041556*It),Vn(.0556434*St-.2040259*xt+1.0572252*It))}function ha(ge,Oe,tt){return ge>0?new ir(Math.atan2(tt,Oe)*Lt,Math.sqrt(Oe*Oe+tt*tt),ge):new ir(NaN,NaN,ge)}function _a(ge){return ge>.206893034?ge*ge*ge:(ge-4/29)/7.787037}function Ca(ge){return ge>.008856?Math.pow(ge,1/3):7.787037*ge+4/29}function Vn(ge){return Math.round(255*(ge<=.00304?12.92*ge:1.055*Math.pow(ge,1/2.4)-.055))}h.rgb=yi;function yi(ge,Oe,tt){return this instanceof yi?(this.r=~~ge,this.g=~~Oe,void(this.b=~~tt)):arguments.length<2?ge instanceof yi?new yi(ge.r,ge.g,ge.b):Nr(""+ge,yi,qa):new yi(ge,Oe,tt)}function Ci(ge){return new yi(ge>>16,ge>>8&255,ge&255)}function Dt(ge){return Ci(ge)+""}var yt=yi.prototype=new ra;yt.brighter=function(ge){ge=Math.pow(.7,arguments.length?ge:1);var Oe=this.r,tt=this.g,xt=this.b,St=30;return!Oe&&!tt&&!xt?new yi(St,St,St):(Oe&&Oe>4,xt=xt>>4|xt,St=yr&240,St=St>>4|St,It=yr&15,It=It<<4|It):ge.length===7&&(xt=(yr&16711680)>>16,St=(yr&65280)>>8,It=yr&255)),Oe(xt,St,It))}function jr(ge,Oe,tt){var xt=Math.min(ge/=255,Oe/=255,tt/=255),St=Math.max(ge,Oe,tt),It=St-xt,Qt,Jt,yr=(St+xt)/2;return It?(Jt=yr<.5?It/(St+xt):It/(2-St-xt),ge==St?Qt=(Oe-tt)/It+(Oe0&&yr<1?0:Qt),new Nn(Qt,Jt,yr)}function Ir(ge,Oe,tt){ge=Ur(ge),Oe=Ur(Oe),tt=Ur(tt);var xt=Ca((.4124564*ge+.3575761*Oe+.1804375*tt)/sn),St=Ca((.2126729*ge+.7151522*Oe+.072175*tt)/mn),It=Ca((.0193339*ge+.119192*Oe+.9503041*tt)/wn);return lr(116*St-16,500*(xt-St),200*(St-It))}function Ur(ge){return(ge/=255)<=.04045?ge/12.92:Math.pow((ge+.055)/1.055,2.4)}function ln(ge){var Oe=parseFloat(ge);return ge.charAt(ge.length-1)==="%"?Math.round(Oe*2.55):Oe}var $r=h.map({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});$r.forEach(function(ge,Oe){$r.set(ge,Ci(Oe))});function At(ge){return typeof ge=="function"?ge:function(){return ge}}h.functor=At,h.xhr=or(F);function or(ge){return function(Oe,tt,xt){return arguments.length===2&&typeof tt=="function"&&(xt=tt,tt=null),Dr(Oe,tt,ge,xt)}}function Dr(ge,Oe,tt,xt){var St={},It=h.dispatch("beforesend","progress","load","error"),Qt={},Jt=new XMLHttpRequest,yr=null;self.XDomainRequest&&!("withCredentials"in Jt)&&/^(http(s)?:)?\/\//.test(ge)&&(Jt=new XDomainRequest),"onload"in Jt?Jt.onload=Jt.onerror=Xr:Jt.onreadystatechange=function(){Jt.readyState>3&&Xr()};function Xr(){var Hr=Jt.status,hn;if(!Hr&&Rn(Jt)||Hr>=200&&Hr<300||Hr===304){try{hn=tt.call(St,Jt)}catch(An){It.error.call(St,An);return}It.load.call(St,hn)}else It.error.call(St,Jt)}return Jt.onprogress=function(Hr){var hn=h.event;h.event=Hr;try{It.progress.call(St,Jt)}finally{h.event=hn}},St.header=function(Hr,hn){return Hr=(Hr+"").toLowerCase(),arguments.length<2?Qt[Hr]:(hn==null?delete Qt[Hr]:Qt[Hr]=hn+"",St)},St.mimeType=function(Hr){return arguments.length?(Oe=Hr==null?null:Hr+"",St):Oe},St.responseType=function(Hr){return arguments.length?(yr=Hr,St):yr},St.response=function(Hr){return tt=Hr,St},["get","post"].forEach(function(Hr){St[Hr]=function(){return St.send.apply(St,[Hr].concat(S(arguments)))}}),St.send=function(Hr,hn,An){if(arguments.length===2&&typeof hn=="function"&&(An=hn,hn=null),Jt.open(Hr,ge,!0),Oe!=null&&!("accept"in Qt)&&(Qt.accept=Oe+",*/*"),Jt.setRequestHeader)for(var kn in Qt)Jt.setRequestHeader(kn,Qt[kn]);return Oe!=null&&Jt.overrideMimeType&&Jt.overrideMimeType(Oe),yr!=null&&(Jt.responseType=yr),An!=null&&St.on("error",An).on("load",function(La){An(null,La)}),It.beforesend.call(St,Jt),Jt.send(hn??null),St},St.abort=function(){return Jt.abort(),St},h.rebind(St,It,"on"),xt==null?St:St.get(un(xt))}function un(ge){return ge.length===1?function(Oe,tt){ge(Oe==null?tt:null)}:ge}function Rn(ge){var Oe=ge.responseType;return Oe&&Oe!=="text"?ge.response:ge.responseText}h.dsv=function(ge,Oe){var tt=new RegExp('["'+ge+` -]`),xt=ge.charCodeAt(0);function St(Xr,Hr,hn){arguments.length<3&&(hn=Hr,Hr=null);var An=Dr(Xr,Oe,Hr==null?It:Qt(Hr),hn);return An.row=function(kn){return arguments.length?An.response((Hr=kn)==null?It:Qt(kn)):Hr},An}function It(Xr){return St.parse(Xr.responseText)}function Qt(Xr){return function(Hr){return St.parse(Hr.responseText,Xr)}}St.parse=function(Xr,Hr){var hn;return St.parseRows(Xr,function(An,kn){if(hn)return hn(An,kn-1);var La=function(zn){for(var Qn={},oa=An.length,Aa=0;Aa=La)return An;if(Aa)return Aa=!1,hn;var oi=zn;if(Xr.charCodeAt(oi)===34){for(var Wi=oi;Wi++24?(isFinite(Oe)&&(clearTimeout(In),In=setTimeout(Pi,Oe)),cn=0):(cn=1,xi(Pi))}h.timer.flush=function(){Xi(),uo()};function Xi(){for(var ge=Date.now(),Oe=jn;Oe;)ge>=Oe.t&&Oe.c(ge-Oe.t)&&(Oe.c=null),Oe=Oe.n;return ge}function uo(){for(var ge,Oe=jn,tt=1/0;Oe;)Oe.c?(Oe.t=0;--Jt)zn.push(St[Xr[hn[Jt]][2]]);for(Jt=+kn;Jt1&&Ct(ge[tt[xt-2]],ge[tt[xt-1]],ge[St])<=0;)--xt;tt[xt++]=St}return tt.slice(0,xt)}function ns(ge,Oe){return ge[0]-Oe[0]||ge[1]-Oe[1]}h.geom.polygon=function(ge){return V(ge,Xo),ge};var Xo=h.geom.polygon.prototype=[];Xo.area=function(){for(var ge=-1,Oe=this.length,tt,xt=this[Oe-1],St=0;++ge$e)Jt=Jt.L;else if(Qt=Oe-no(Jt,tt),Qt>$e){if(!Jt.R){xt=Jt;break}Jt=Jt.R}else{It>-$e?(xt=Jt.P,St=Jt):Qt>-$e?(xt=Jt,St=Jt.N):xt=St=Jt;break}var yr=ll(ge);if(Hs.insert(xt,yr),!(!xt&&!St)){if(xt===St){ul(xt),St=ll(xt.site),Hs.insert(yr,St),yr.edge=St.edge=Hl(xt.site,yr.site),Ws(xt),Ws(St);return}if(!St){yr.edge=Hl(xt.site,yr.site);return}ul(xt),ul(St);var Xr=xt.site,Hr=Xr.x,hn=Xr.y,An=ge.x-Hr,kn=ge.y-hn,La=St.site,zn=La.x-Hr,Qn=La.y-hn,oa=2*(An*Qn-kn*zn),Aa=An*An+kn*kn,Ra=zn*zn+Qn*Qn,ia={x:(Qn*Aa-kn*Ra)/oa+Hr,y:(An*Ra-zn*Aa)/oa+hn};Do(St.edge,Xr,La,ia),yr.edge=Hl(Xr,ge,null,ia),St.edge=Hl(ge,La,null,ia),Ws(xt),Ws(St)}}function pi(ge,Oe){var tt=ge.site,xt=tt.x,St=tt.y,It=St-Oe;if(!It)return xt;var Qt=ge.P;if(!Qt)return-1/0;tt=Qt.site;var Jt=tt.x,yr=tt.y,Xr=yr-Oe;if(!Xr)return Jt;var Hr=Jt-xt,hn=1/It-1/Xr,An=Hr/Xr;return hn?(-An+Math.sqrt(An*An-2*hn*(Hr*Hr/(-2*Xr)-yr+Xr/2+St-It/2)))/hn+xt:(xt+Jt)/2}function no(ge,Oe){var tt=ge.N;if(tt)return pi(tt,Oe);var xt=ge.site;return xt.y===Oe?xt.x:1/0}function Cl(ge){this.site=ge,this.edges=[]}Cl.prototype.prepare=function(){for(var ge=this.edges,Oe=ge.length,tt;Oe--;)tt=ge[Oe].edge,(!tt.b||!tt.a)&&ge.splice(Oe,1);return ge.sort(No),ge.length};function Ds(ge){for(var Oe=ge[0][0],tt=ge[1][0],xt=ge[0][1],St=ge[1][1],It,Qt,Jt,yr,Xr=Zs,Hr=Xr.length,hn,An,kn,La,zn,Qn;Hr--;)if(hn=Xr[Hr],!(!hn||!hn.prepare()))for(kn=hn.edges,La=kn.length,An=0;An$e||l(yr-Qt)>$e)&&(kn.splice(An,0,new su(Gl(hn.site,Qn,l(Jt-Oe)<$e&&St-yr>$e?{x:Oe,y:l(It-Oe)<$e?Qt:St}:l(yr-St)<$e&&tt-Jt>$e?{x:l(Qt-St)<$e?It:tt,y:St}:l(Jt-tt)<$e&&yr-xt>$e?{x:tt,y:l(It-tt)<$e?Qt:xt}:l(yr-xt)<$e&&Jt-Oe>$e?{x:l(Qt-xt)<$e?It:Oe,y:xt}:null),hn.site,null)),++La)}function No(ge,Oe){return Oe.angle-ge.angle}function Il(){Bs(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ws(ge){var Oe=ge.P,tt=ge.N;if(!(!Oe||!tt)){var xt=Oe.site,St=ge.site,It=tt.site;if(xt!==It){var Qt=St.x,Jt=St.y,yr=xt.x-Qt,Xr=xt.y-Jt,Hr=It.x-Qt,Qn=It.y-Jt,hn=2*(yr*Qn-Xr*Hr);if(!(hn>=-Ee)){var An=yr*yr+Xr*Xr,kn=Hr*Hr+Qn*Qn,La=(Qn*An-Xr*kn)/hn,zn=(yr*kn-Hr*An)/hn,Qn=zn+Jt,oa=_o.pop()||new Il;oa.arc=ge,oa.site=St,oa.x=La+Qt,oa.y=Qn+Math.sqrt(La*La+zn*zn),oa.cy=Qn,ge.circle=oa;for(var Aa=null,Ra=Ko._;Ra;)if(oa.y0)){if(zn/=kn,kn<0){if(zn0){if(zn>An)return;zn>hn&&(hn=zn)}if(zn=tt-Jt,!(!kn&&zn<0)){if(zn/=kn,kn<0){if(zn>An)return;zn>hn&&(hn=zn)}else if(kn>0){if(zn0)){if(zn/=La,La<0){if(zn0){if(zn>An)return;zn>hn&&(hn=zn)}if(zn=xt-yr,!(!La&&zn<0)){if(zn/=La,La<0){if(zn>An)return;zn>hn&&(hn=zn)}else if(La>0){if(zn0&&(St.a={x:Jt+hn*kn,y:yr+hn*La}),An<1&&(St.b={x:Jt+An*kn,y:yr+An*La}),St}}}}}}function eo(ge){for(var Oe=qo,tt=xu(ge[0][0],ge[0][1],ge[1][0],ge[1][1]),xt=Oe.length,St;xt--;)St=Oe[xt],(!_s(St,ge)||!tt(St)||l(St.a.x-St.b.x)<$e&&l(St.a.y-St.b.y)<$e)&&(St.a=St.b=null,Oe.splice(xt,1))}function _s(ge,Oe){var tt=ge.b;if(tt)return!0;var xt=ge.a,St=Oe[0][0],It=Oe[1][0],Qt=Oe[0][1],Jt=Oe[1][1],yr=ge.l,Xr=ge.r,Hr=yr.x,hn=yr.y,An=Xr.x,kn=Xr.y,La=(Hr+An)/2,zn=(hn+kn)/2,Qn,oa;if(kn===hn){if(La=It)return;if(Hr>An){if(!xt)xt={x:La,y:Qt};else if(xt.y>=Jt)return;tt={x:La,y:Jt}}else{if(!xt)xt={x:La,y:Jt};else if(xt.y1)if(Hr>An){if(!xt)xt={x:(Qt-oa)/Qn,y:Qt};else if(xt.y>=Jt)return;tt={x:(Jt-oa)/Qn,y:Jt}}else{if(!xt)xt={x:(Jt-oa)/Qn,y:Jt};else if(xt.y=It)return;tt={x:It,y:Qn*It+oa}}else{if(!xt)xt={x:It,y:Qn*It+oa};else if(xt.x=Hr&&oa.x<=An&&oa.y>=hn&&oa.y<=kn?[[Hr,kn],[An,kn],[An,hn],[Hr,hn]]:[];Aa.point=yr[zn]}),Xr}function Jt(yr){return yr.map(function(Xr,Hr){return{x:Math.round(xt(Xr,Hr)/$e)*$e,y:Math.round(St(Xr,Hr)/$e)*$e,i:Hr}})}return Qt.links=function(yr){return Hu(Jt(yr)).edges.filter(function(Xr){return Xr.l&&Xr.r}).map(function(Xr){return{source:yr[Xr.l.i],target:yr[Xr.r.i]}})},Qt.triangles=function(yr){var Xr=[];return Hu(Jt(yr)).cells.forEach(function(Hr,hn){for(var An=Hr.site,kn=Hr.edges.sort(No),La=-1,zn=kn.length,Qn,oa=kn[zn-1].edge,Aa=oa.l===An?oa.r:oa.l;++LaRa&&(Ra=Hr.x),Hr.y>ia&&(ia=Hr.y),kn.push(Hr.x),La.push(Hr.y);else for(zn=0;znRa&&(Ra=oi),Wi>ia&&(ia=Wi),kn.push(oi),La.push(Wi)}var zi=Ra-oa,Gi=ia-Aa;zi>Gi?ia=Aa+zi:Ra=oa+Gi;function wo(Ro,us,nl,Lu,Jl,co,Is,el){if(!(isNaN(nl)||isNaN(Lu)))if(Ro.leaf){var Zl=Ro.x,Ol=Ro.y;if(Zl!=null)if(l(Zl-nl)+l(Ol-Lu)<.01)ko(Ro,us,nl,Lu,Jl,co,Is,el);else{var bc=Ro.point;Ro.x=Ro.y=Ro.point=null,ko(Ro,bc,Zl,Ol,Jl,co,Is,el),ko(Ro,us,nl,Lu,Jl,co,Is,el)}else Ro.x=nl,Ro.y=Lu,Ro.point=us}else ko(Ro,us,nl,Lu,Jl,co,Is,el)}function ko(Ro,us,nl,Lu,Jl,co,Is,el){var Zl=(Jl+Is)*.5,Ol=(co+el)*.5,bc=nl>=Zl,El=Lu>=Ol,Wl=El<<1|bc;Ro.leaf=!1,Ro=Ro.nodes[Wl]||(Ro.nodes[Wl]=Tl()),bc?Jl=Zl:Is=Zl,El?co=Ol:el=Ol,wo(Ro,us,nl,Lu,Jl,co,Is,el)}var Ks=Tl();if(Ks.add=function(Ro){wo(Ks,Ro,+hn(Ro,++zn),+An(Ro,zn),oa,Aa,Ra,ia)},Ks.visit=function(Ro){Lc(Ro,Ks,oa,Aa,Ra,ia)},Ks.find=function(Ro){return Ph(Ks,Ro[0],Ro[1],oa,Aa,Ra,ia)},zn=-1,Oe==null){for(;++znIt||An>Qt||kn=oi,Gi=tt>=Wi,wo=Gi<<1|zi,ko=wo+4;wott&&(It=Oe.slice(tt,It),Jt[Qt]?Jt[Qt]+=It:Jt[++Qt]=It),(xt=xt[0])===(St=St[0])?Jt[Qt]?Jt[Qt]+=St:Jt[++Qt]=St:(Jt[++Qt]=null,yr.push({i:Qt,x:ac(xt,St)})),tt=Xu.lastIndex;return tt=0&&!(xt=h.interpolators[tt](ge,Oe)););return xt}h.interpolators=[function(ge,Oe){var tt=typeof Oe;return(tt==="string"?$r.has(Oe.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Oe)?nc:ef:Oe instanceof ra?nc:Array.isArray(Oe)?Dl:tt==="object"&&isNaN(Oe)?Gu:ac)(ge,Oe)}],h.interpolateArray=Dl;function Dl(ge,Oe){var tt=[],xt=[],St=ge.length,It=Oe.length,Qt=Math.min(ge.length,Oe.length),Jt;for(Jt=0;Jt=0?ge.slice(0,Oe):ge,xt=Oe>=0?ge.slice(Oe+1):"in";return tt=yc.get(tt)||wf,xt=If.get(xt)||F,lu(xt(tt.apply(null,b.call(arguments,1))))};function lu(ge){return function(Oe){return Oe<=0?0:Oe>=1?1:ge(Oe)}}function bv(ge){return function(Oe){return 1-ge(1-Oe)}}function Ns(ge){return function(Oe){return .5*(Oe<.5?ge(2*Oe):2-ge(2-2*Oe))}}function Bv(ge){return ge*ge}function dl(ge){return ge*ge*ge}function Bo(ge){if(ge<=0)return 0;if(ge>=1)return 1;var Oe=ge*ge,tt=Oe*ge;return 4*(ge<.5?tt:3*(ge-Oe)+tt-.75)}function Kf(ge){return function(Oe){return Math.pow(Oe,ge)}}function tf(ge){return 1-Math.cos(ge*Xe)}function Iu(ge){return Math.pow(2,10*(ge-1))}function Rh(ge){return 1-Math.sqrt(1-ge*ge)}function Df(ge,Oe){var tt;return arguments.length<2&&(Oe=.45),arguments.length?tt=Oe/ye*Math.asin(1/ge):(ge=1,tt=Oe/4),function(xt){return 1+ge*Math.pow(2,-10*xt)*Math.sin((xt-tt)*ye/Oe)}}function ih(ge){return ge||(ge=1.70158),function(Oe){return Oe*Oe*((ge+1)*Oe-ge)}}function Yu(ge){return ge<1/2.75?7.5625*ge*ge:ge<2/2.75?7.5625*(ge-=1.5/2.75)*ge+.75:ge<2.5/2.75?7.5625*(ge-=2.25/2.75)*ge+.9375:7.5625*(ge-=2.625/2.75)*ge+.984375}h.interpolateHcl=sv;function sv(ge,Oe){ge=h.hcl(ge),Oe=h.hcl(Oe);var tt=ge.h,xt=ge.c,St=ge.l,It=Oe.h-tt,Qt=Oe.c-xt,Jt=Oe.l-St;return isNaN(Qt)&&(Qt=0,xt=isNaN(xt)?Oe.c:xt),isNaN(It)?(It=0,tt=isNaN(tt)?Oe.h:tt):It>180?It-=360:It<-180&&(It+=360),function(yr){return ar(tt+It*yr,xt+Qt*yr,St+Jt*yr)+""}}h.interpolateHsl=Uh;function Uh(ge,Oe){ge=h.hsl(ge),Oe=h.hsl(Oe);var tt=ge.h,xt=ge.s,St=ge.l,It=Oe.h-tt,Qt=Oe.s-xt,Jt=Oe.l-St;return isNaN(Qt)&&(Qt=0,xt=isNaN(xt)?Oe.s:xt),isNaN(It)?(It=0,tt=isNaN(tt)?Oe.h:tt):It>180?It-=360:It<-180&&(It+=360),function(yr){return qa(tt+It*yr,xt+Qt*yr,St+Jt*yr)+""}}h.interpolateLab=oh;function oh(ge,Oe){ge=h.lab(ge),Oe=h.lab(Oe);var tt=ge.l,xt=ge.a,St=ge.b,It=Oe.l-tt,Qt=Oe.a-xt,Jt=Oe.b-St;return function(yr){return pa(tt+It*yr,xt+Qt*yr,St+Jt*yr)+""}}h.interpolateRound=zf;function zf(ge,Oe){return Oe-=ge,function(tt){return Math.round(ge+Oe*tt)}}h.transform=function(ge){var Oe=E.createElementNS(h.ns.prefix.svg,"g");return(h.transform=function(tt){if(tt!=null){Oe.setAttribute("transform",tt);var xt=Oe.transform.baseVal.consolidate()}return new Ih(xt?xt.matrix:Tf)})(ge)};function Ih(ge){var Oe=[ge.a,ge.b],tt=[ge.c,ge.d],xt=rf(Oe),St=Dh(Oe,tt),It=rf(jh(tt,Oe,-St))||0;Oe[0]*tt[1]180?Oe+=360:Oe-ge>180&&(ge+=360),xt.push({i:tt.push(cf(tt)+"rotate(",null,")")-2,x:ac(ge,Oe)})):Oe&&tt.push(cf(tt)+"rotate("+Oe+")")}function zh(ge,Oe,tt,xt){ge!==Oe?xt.push({i:tt.push(cf(tt)+"skewX(",null,")")-2,x:ac(ge,Oe)}):Oe&&tt.push(cf(tt)+"skewX("+Oe+")")}function Nl(ge,Oe,tt,xt){if(ge[0]!==Oe[0]||ge[1]!==Oe[1]){var St=tt.push(cf(tt)+"scale(",null,",",null,")");xt.push({i:St-4,x:ac(ge[0],Oe[0])},{i:St-2,x:ac(ge[1],Oe[1])})}else(Oe[0]!==1||Oe[1]!==1)&&tt.push(cf(tt)+"scale("+Oe+")")}function _h(ge,Oe){var tt=[],xt=[];return ge=h.transform(ge),Oe=h.transform(Oe),Zu(ge.translate,Oe.translate,tt,xt),Hf(ge.rotate,Oe.rotate,tt,xt),zh(ge.skew,Oe.skew,tt,xt),Nl(ge.scale,Oe.scale,tt,xt),ge=Oe=null,function(St){for(var It=-1,Qt=xt.length,Jt;++It0?It=ia:(tt.c=null,tt.t=NaN,tt=null,Oe.end({type:"end",alpha:It=0})):ia>0&&(Oe.start({type:"start",alpha:It=ia}),tt=Ea(ge.tick)),ge):It},ge.start=function(){var ia,oi=kn.length,Wi=La.length,zi=xt[0],Gi=xt[1],wo,ko;for(ia=0;ia=0;)It.push(Hr=Xr[yr]),Hr.parent=Jt,Hr.depth=Jt.depth+1;tt&&(Jt.value=0),Jt.children=Xr}else tt&&(Jt.value=+tt.call(xt,Jt,Jt.depth)||0),delete Jt.children;return ff(St,function(hn){var An,kn;ge&&(An=hn.children)&&An.sort(ge),tt&&(kn=hn.parent)&&(kn.value+=hn.value)}),Qt}return xt.sort=function(St){return arguments.length?(ge=St,xt):ge},xt.children=function(St){return arguments.length?(Oe=St,xt):Oe},xt.value=function(St){return arguments.length?(tt=St,xt):tt},xt.revalue=function(St){return tt&&($f(St,function(It){It.children&&(It.value=0)}),ff(St,function(It){var Qt;It.children||(It.value=+tt.call(xt,It,It.depth)||0),(Qt=It.parent)&&(Qt.value+=It.value)})),St},xt};function uu(ge,Oe){return h.rebind(ge,Oe,"sort","children","value"),ge.nodes=ge,ge.links=Zv,ge}function $f(ge,Oe){for(var tt=[ge];(ge=tt.pop())!=null;)if(Oe(ge),(St=ge.children)&&(xt=St.length))for(var xt,St;--xt>=0;)tt.push(St[xt])}function ff(ge,Oe){for(var tt=[ge],xt=[];(ge=tt.pop())!=null;)if(xt.push(ge),(Qt=ge.children)&&(It=Qt.length))for(var St=-1,It,Qt;++StSt&&(St=Jt),xt.push(Jt)}for(Qt=0;Qtxt&&(tt=Oe,xt=St);return tt}function Dc(ge){return ge.reduce(nf,0)}function nf(ge,Oe){return ge+Oe[1]}h.layout.histogram=function(){var ge=!0,Oe=Number,tt=lh,xt=Oh;function St(It,An){for(var Jt=[],yr=It.map(Oe,this),Xr=tt.call(this,yr,An),Hr=xt.call(this,Xr,yr,An),hn,An=-1,kn=yr.length,La=Hr.length-1,zn=ge?1:1/kn,Qn;++An0)for(An=-1;++An=Xr[0]&&Qn<=Xr[1]&&(hn=Jt[h.bisect(Hr,Qn,1,La)-1],hn.y+=zn,hn.push(It[An]));return Jt}return St.value=function(It){return arguments.length?(Oe=It,St):Oe},St.range=function(It){return arguments.length?(tt=At(It),St):tt},St.bins=function(It){return arguments.length?(xt=typeof It=="number"?function(Qt){return iu(Qt,It)}:At(It),St):xt},St.frequency=function(It){return arguments.length?(ge=!!It,St):ge},St};function Oh(ge,Oe){return iu(ge,Math.ceil(Math.log(Oe.length)/Math.LN2+1))}function iu(ge,Oe){for(var tt=-1,xt=+ge[0],St=(ge[1]-xt)/Oe,It=[];++tt<=Oe;)It[tt]=St*tt+xt;return It}function lh(ge){return[h.min(ge),h.max(ge)]}h.layout.pack=function(){var ge=h.layout.hierarchy().sort(Bf),Oe=0,tt=[1,1],xt;function St(It,Qt){var Jt=ge.call(this,It,Qt),yr=Jt[0],Xr=tt[0],Hr=tt[1],hn=xt==null?Math.sqrt:typeof xt=="function"?xt:function(){return xt};if(yr.x=yr.y=0,ff(yr,function(kn){kn.r=+hn(kn.value)}),ff(yr,ch),Oe){var An=Oe*(xt?1:Math.max(2*yr.r/Xr,2*yr.r/Hr))/2;ff(yr,function(kn){kn.r+=An}),ff(yr,ch),ff(yr,function(kn){kn.r-=An})}return Xh(yr,Xr/2,Hr/2,xt?1:1/Math.max(2*yr.r/Xr,2*yr.r/Hr)),Jt}return St.size=function(It){return arguments.length?(tt=It,St):tt},St.radius=function(It){return arguments.length?(xt=It==null||typeof It=="function"?It:+It,St):xt},St.padding=function(It){return arguments.length?(Oe=+It,St):Oe},uu(St,ge)};function Bf(ge,Oe){return ge.value-Oe.value}function Hc(ge,Oe){var tt=ge._pack_next;ge._pack_next=Oe,Oe._pack_prev=ge,Oe._pack_next=tt,tt._pack_prev=Oe}function uh(ge,Oe){ge._pack_next=Oe,Oe._pack_prev=ge}function hf(ge,Oe){var tt=Oe.x-ge.x,xt=Oe.y-ge.y,St=ge.r+Oe.r;return .999*St*St>tt*tt+xt*xt}function ch(ge){if(!(Oe=ge.children)||!(An=Oe.length))return;var Oe,tt=1/0,xt=-1/0,St=1/0,It=-1/0,Qt,Jt,yr,Xr,Hr,hn,An;function kn(ia){tt=Math.min(ia.x-ia.r,tt),xt=Math.max(ia.x+ia.r,xt),St=Math.min(ia.y-ia.r,St),It=Math.max(ia.y+ia.r,It)}if(Oe.forEach(Av),Qt=Oe[0],Qt.x=-Qt.r,Qt.y=0,kn(Qt),An>1&&(Jt=Oe[1],Jt.x=Jt.r,Jt.y=0,kn(Jt),An>2))for(yr=Oe[2],Gc(Qt,Jt,yr),kn(yr),Hc(Qt,yr),Qt._pack_prev=yr,Hc(yr,Jt),Jt=Qt._pack_next,Xr=3;XrQn.x&&(Qn=oi),oi.depth>oa.depth&&(oa=oi)});var Aa=Oe(zn,Qn)/2-zn.x,Ra=tt[0]/(Qn.x+Oe(Qn,zn)/2+Aa),ia=tt[1]/(oa.depth||1);$f(kn,function(oi){oi.x=(oi.x+Aa)*Ra,oi.y=oi.depth*ia})}return An}function It(Hr){for(var hn={A:null,children:[Hr]},An=[hn],kn;(kn=An.pop())!=null;)for(var La=kn.children,zn,Qn=0,oa=La.length;Qn0&&(_c(Nf(zn,Hr,An),Hr,oi),oa+=oi,Aa+=oi),Ra+=zn.m,oa+=kn.m,ia+=Qn.m,Aa+=La.m;zn&&!bu(La)&&(La.t=zn,La.m+=Ra-Aa),kn&&!vf(Qn)&&(Qn.t=kn,Qn.m+=oa-ia,An=Hr)}return An}function Xr(Hr){Hr.x*=tt[0],Hr.y=Hr.depth*tt[1]}return St.separation=function(Hr){return arguments.length?(Oe=Hr,St):Oe},St.size=function(Hr){return arguments.length?(xt=(tt=Hr)==null?Xr:null,St):xt?null:tt},St.nodeSize=function(Hr){return arguments.length?(xt=(tt=Hr)==null?null:Xr,St):xt?tt:null},uu(St,ge)};function Sf(ge,Oe){return ge.parent==Oe.parent?1:2}function vf(ge){var Oe=ge.children;return Oe.length?Oe[0]:ge.t}function bu(ge){var Oe=ge.children,tt;return(tt=Oe.length)?Oe[tt-1]:ge.t}function _c(ge,Oe,tt){var xt=tt/(Oe.i-ge.i);Oe.c-=xt,Oe.s+=tt,ge.c+=xt,Oe.z+=tt,Oe.m+=tt}function hu(ge){for(var Oe=0,tt=0,xt=ge.children,St=xt.length,It;--St>=0;)It=xt[St],It.z+=Oe,It.m+=Oe,Oe+=It.s+(tt+=It.c)}function Nf(ge,Oe,tt){return ge.a.parent===Oe.parent?ge.a:tt}h.layout.cluster=function(){var ge=h.layout.hierarchy().sort(null).value(null),Oe=Sf,tt=[1,1],xt=!1;function St(It,Qt){var Jt=ge.call(this,It,Qt),yr=Jt[0],Xr,Hr=0;ff(yr,function(zn){var Qn=zn.children;Qn&&Qn.length?(zn.x=Fh(Qn),zn.y=df(Qn)):(zn.x=Xr?Hr+=Oe(zn,Xr):0,zn.y=0,Xr=zn)});var hn=ur(yr),An=Pr(yr),kn=hn.x-Oe(hn,An)/2,La=An.x+Oe(An,hn)/2;return ff(yr,xt?function(zn){zn.x=(zn.x-yr.x)*tt[0],zn.y=(yr.y-zn.y)*tt[1]}:function(zn){zn.x=(zn.x-kn)/(La-kn)*tt[0],zn.y=(1-(yr.y?zn.y/yr.y:1))*tt[1]}),Jt}return St.separation=function(It){return arguments.length?(Oe=It,St):Oe},St.size=function(It){return arguments.length?(xt=(tt=It)==null,St):xt?null:tt},St.nodeSize=function(It){return arguments.length?(xt=(tt=It)!=null,St):xt?tt:null},uu(St,ge)};function df(ge){return 1+h.max(ge,function(Oe){return Oe.y})}function Fh(ge){return ge.reduce(function(Oe,tt){return Oe+tt.x},0)/ge.length}function ur(ge){var Oe=ge.children;return Oe&&Oe.length?ur(Oe[0]):ge}function Pr(ge){var Oe=ge.children,tt;return Oe&&(tt=Oe.length)?Pr(Oe[tt-1]):ge}h.layout.treemap=function(){var ge=h.layout.hierarchy(),Oe=Math.round,tt=[1,1],xt=null,St=dn,It=!1,Qt,Jt="squarify",yr=.5*(1+Math.sqrt(5));function Xr(zn,Qn){for(var oa=-1,Aa=zn.length,Ra,ia;++oa0;)Aa.push(ia=Ra[Gi-1]),Aa.area+=ia.area,Jt!=="squarify"||(Wi=An(Aa,zi))<=oi?(Ra.pop(),oi=Wi):(Aa.area-=Aa.pop().area,kn(Aa,zi,oa,!1),zi=Math.min(oa.dx,oa.dy),Aa.length=Aa.area=0,oi=1/0);Aa.length&&(kn(Aa,zi,oa,!0),Aa.length=Aa.area=0),Qn.forEach(Hr)}}function hn(zn){var Qn=zn.children;if(Qn&&Qn.length){var oa=St(zn),Aa=Qn.slice(),Ra,ia=[];for(Xr(Aa,oa.dx*oa.dy/zn.value),ia.area=0;Ra=Aa.pop();)ia.push(Ra),ia.area+=Ra.area,Ra.z!=null&&(kn(ia,Ra.z?oa.dx:oa.dy,oa,!Aa.length),ia.length=ia.area=0);Qn.forEach(hn)}}function An(zn,Qn){for(var oa=zn.area,Aa,Ra=0,ia=1/0,oi=-1,Wi=zn.length;++oiRa&&(Ra=Aa));return oa*=oa,Qn*=Qn,oa?Math.max(Qn*Ra*yr/oa,oa/(Qn*ia*yr)):1/0}function kn(zn,Qn,oa,Aa){var Ra=-1,ia=zn.length,oi=oa.x,Wi=oa.y,zi=Qn?Oe(zn.area/Qn):0,Gi;if(Qn==oa.dx){for((Aa||zi>oa.dy)&&(zi=oa.dy);++Raoa.dx)&&(zi=oa.dx);++Ra1);return ge+Oe*xt*Math.sqrt(-2*Math.log(It)/It)}},logNormal:function(){var ge=h.random.normal.apply(h,arguments);return function(){return Math.exp(ge())}},bates:function(ge){var Oe=h.random.irwinHall(ge);return function(){return Oe()/ge}},irwinHall:function(ge){return function(){for(var Oe=0,tt=0;tt2?Va:xa,Xr=xt?qh:wv;return St=yr(ge,Oe,Xr,tt),It=yr(Oe,ge,Xr,Gs),Jt}function Jt(yr){return St(yr)}return Jt.invert=function(yr){return It(yr)},Jt.domain=function(yr){return arguments.length?(ge=yr.map(Number),Qt()):ge},Jt.range=function(yr){return arguments.length?(Oe=yr,Qt()):Oe},Jt.rangeRound=function(yr){return Jt.range(yr).interpolate(zf)},Jt.clamp=function(yr){return arguments.length?(xt=yr,Qt()):xt},Jt.interpolate=function(yr){return arguments.length?(tt=yr,Qt()):tt},Jt.ticks=function(yr){return jo(ge,yr)},Jt.tickFormat=function(yr,Xr){return d3_scale_linearTickFormat(ge,yr,Xr)},Jt.nice=function(yr){return Na(ge,yr),Qt()},Jt.copy=function(){return Ai(ge,Oe,tt,xt)},Qt()}function ei(ge,Oe){return h.rebind(ge,Oe,"range","rangeRound","interpolate","clamp")}function Na(ge,Oe){return ri(ge,fi(Zi(ge,Oe)[2])),ri(ge,fi(Zi(ge,Oe)[2])),ge}function Zi(ge,Oe){Oe==null&&(Oe=10);var tt=On(ge),xt=tt[1]-tt[0],St=Math.pow(10,Math.floor(Math.log(xt/Oe)/Math.LN10)),It=Oe/xt*St;return It<=.15?St*=10:It<=.35?St*=5:It<=.75&&(St*=2),tt[0]=Math.ceil(tt[0]/St)*St,tt[1]=Math.floor(tt[1]/St)*St+St*.5,tt[2]=St,tt}function jo(ge,Oe){return h.range.apply(h,Zi(ge,Oe))}h.scale.log=function(){return Fo(h.scale.linear().domain([0,1]),10,!0,[1,10])};function Fo(ge,Oe,tt,xt){function St(Jt){return(tt?Math.log(Jt<0?0:Jt):-Math.log(Jt>0?0:-Jt))/Math.log(Oe)}function It(Jt){return tt?Math.pow(Oe,Jt):-Math.pow(Oe,-Jt)}function Qt(Jt){return ge(St(Jt))}return Qt.invert=function(Jt){return It(ge.invert(Jt))},Qt.domain=function(Jt){return arguments.length?(tt=Jt[0]>=0,ge.domain((xt=Jt.map(Number)).map(St)),Qt):xt},Qt.base=function(Jt){return arguments.length?(Oe=+Jt,ge.domain(xt.map(St)),Qt):Oe},Qt.nice=function(){var Jt=ri(xt.map(St),tt?Math:Yo);return ge.domain(Jt),xt=Jt.map(It),Qt},Qt.ticks=function(){var Jt=On(xt),yr=[],Xr=Jt[0],Hr=Jt[1],hn=Math.floor(St(Xr)),An=Math.ceil(St(Hr)),kn=Oe%1?2:Oe;if(isFinite(An-hn)){if(tt){for(;hn0;La--)yr.push(It(hn)*La);for(hn=0;yr[hn]Hr;An--);yr=yr.slice(hn,An)}return yr},Qt.copy=function(){return Fo(ge.copy(),Oe,tt,xt)},ei(Qt,ge)}var Yo={floor:function(ge){return-Math.ceil(-ge)},ceil:function(ge){return-Math.floor(-ge)}};h.scale.pow=function(){return Vo(h.scale.linear(),1,[0,1])};function Vo(ge,Oe,tt){var xt=Ki(Oe),St=Ki(1/Oe);function It(Qt){return ge(xt(Qt))}return It.invert=function(Qt){return St(ge.invert(Qt))},It.domain=function(Qt){return arguments.length?(ge.domain((tt=Qt.map(Number)).map(xt)),It):tt},It.ticks=function(Qt){return jo(tt,Qt)},It.tickFormat=function(Qt,Jt){return d3_scale_linearTickFormat(tt,Qt,Jt)},It.nice=function(Qt){return It.domain(Na(tt,Qt))},It.exponent=function(Qt){return arguments.length?(xt=Ki(Oe=Qt),St=Ki(1/Oe),ge.domain(tt.map(xt)),It):Oe},It.copy=function(){return Vo(ge.copy(),Oe,tt)},ei(It,ge)}function Ki(ge){return function(Oe){return Oe<0?-Math.pow(-Oe,ge):Math.pow(Oe,ge)}}h.scale.sqrt=function(){return h.scale.pow().exponent(.5)},h.scale.ordinal=function(){return Ri([],{t:"range",a:[[]]})};function Ri(ge,Oe){var tt,xt,St;function It(Jt){return xt[((tt.get(Jt)||(Oe.t==="range"?tt.set(Jt,ge.push(Jt)):NaN))-1)%xt.length]}function Qt(Jt,yr){return h.range(ge.length).map(function(Xr){return Jt+yr*Xr})}return It.domain=function(Jt){if(!arguments.length)return ge;ge=[],tt=new A;for(var yr=-1,Xr=Jt.length,Hr;++yr0?tt[It-1]:ge[0],ItAn?0:1;if(Hr=Me)return yr(Hr,La)+(Xr?yr(Xr,1-La):"")+"Z";var zn,Qn,oa,Aa,Ra=0,ia=0,oi,Wi,zi,Gi,wo,ko,Ks,Ro,us=[];if((Aa=(+Qt.apply(this,arguments)||0)/2)&&(oa=xt===ql?Math.sqrt(Xr*Xr+Hr*Hr):+xt.apply(this,arguments),La||(ia*=-1),Hr&&(ia=Ot(oa/Hr*Math.sin(Aa))),Xr&&(Ra=Ot(oa/Xr*Math.sin(Aa)))),Hr){oi=Hr*Math.cos(hn+ia),Wi=Hr*Math.sin(hn+ia),zi=Hr*Math.cos(An-ia),Gi=Hr*Math.sin(An-ia);var nl=Math.abs(An-hn-2*ia)<=xe?0:1;if(ia&&pc(oi,Wi,zi,Gi)===La^nl){var Lu=(hn+An)/2;oi=Hr*Math.cos(Lu),Wi=Hr*Math.sin(Lu),zi=Gi=null}}else oi=Wi=0;if(Xr){wo=Xr*Math.cos(An-Ra),ko=Xr*Math.sin(An-Ra),Ks=Xr*Math.cos(hn+Ra),Ro=Xr*Math.sin(hn+Ra);var Jl=Math.abs(hn-An+2*Ra)<=xe?0:1;if(Ra&&pc(wo,ko,Ks,Ro)===1-La^Jl){var co=(hn+An)/2;wo=Xr*Math.cos(co),ko=Xr*Math.sin(co),Ks=Ro=null}}else wo=ko=0;if(kn>$e&&(zn=Math.min(Math.abs(Hr-Xr)/2,+tt.apply(this,arguments)))>.001){Qn=Xr0?0:1}function xc(ge,Oe,tt,xt,St){var It=ge[0]-Oe[0],Qt=ge[1]-Oe[1],Jt=(St?xt:-xt)/Math.sqrt(It*It+Qt*Qt),yr=Jt*Qt,Xr=-Jt*It,Hr=ge[0]+yr,hn=ge[1]+Xr,An=Oe[0]+yr,kn=Oe[1]+Xr,La=(Hr+An)/2,zn=(hn+kn)/2,Qn=An-Hr,oa=kn-hn,Aa=Qn*Qn+oa*oa,Ra=tt-xt,ia=Hr*kn-An*hn,oi=(oa<0?-1:1)*Math.sqrt(Math.max(0,Ra*Ra*Aa-ia*ia)),Wi=(ia*oa-Qn*oi)/Aa,zi=(-ia*Qn-oa*oi)/Aa,Gi=(ia*oa+Qn*oi)/Aa,wo=(-ia*Qn+oa*oi)/Aa,ko=Wi-La,Ks=zi-zn,Ro=Gi-La,us=wo-zn;return ko*ko+Ks*Ks>Ro*Ro+us*us&&(Wi=Gi,zi=wo),[[Wi-yr,zi-Xr],[Wi*tt/Ra,zi*tt/Ra]]}function Gf(){return!0}function mc(ge){var Oe=so,tt=Eo,xt=Gf,St=Mu,It=St.key,Qt=.7;function Jt(yr){var Xr=[],Hr=[],hn=-1,An=yr.length,kn,La=At(Oe),zn=At(tt);function Qn(){Xr.push("M",St(ge(Hr),Qt))}for(;++hn1?ge.join("L"):ge+"Z"}function Ef(ge){return ge.join("L")+"Z"}function Zo(ge){for(var Oe=0,tt=ge.length,xt=ge[0],St=[xt[0],",",xt[1]];++Oe1&&St.push("H",xt[0]),St.join("")}function ss(ge){for(var Oe=0,tt=ge.length,xt=ge[0],St=[xt[0],",",xt[1]];++Oe1){Jt=Oe[1],It=ge[yr],yr++,xt+="C"+(St[0]+Qt[0])+","+(St[1]+Qt[1])+","+(It[0]-Jt[0])+","+(It[1]-Jt[1])+","+It[0]+","+It[1];for(var Xr=2;Xr9&&(It=tt*3/Math.sqrt(It),Qt[Jt]=It*xt,Qt[Jt+1]=It*St));for(Jt=-1;++Jt<=yr;)It=(ge[Math.min(yr,Jt+1)][0]-ge[Math.max(0,Jt-1)][0])/(6*(1+Qt[Jt]*Qt[Jt])),Oe.push([It||0,Qt[Jt]*It||0]);return Oe}function et(ge){return ge.length<3?Mu(ge):ge[0]+P(ge,Ze(ge))}h.svg.line.radial=function(){var ge=mc(ht);return ge.radius=ge.x,delete ge.x,ge.angle=ge.y,delete ge.y,ge};function ht(ge){for(var Oe,tt=-1,xt=ge.length,St,It;++ttxe)+",1 "+hn}function Xr(Hr,hn,An,kn){return"Q 0,0 "+kn}return It.radius=function(Hr){return arguments.length?(tt=At(Hr),It):tt},It.source=function(Hr){return arguments.length?(ge=At(Hr),It):ge},It.target=function(Hr){return arguments.length?(Oe=At(Hr),It):Oe},It.startAngle=function(Hr){return arguments.length?(xt=At(Hr),It):xt},It.endAngle=function(Hr){return arguments.length?(St=At(Hr),It):St},It};function Ut(ge){return ge.radius}h.svg.diagonal=function(){var ge=zt,Oe=Et,tt=mr;function xt(St,It){var Qt=ge.call(this,St,It),Jt=Oe.call(this,St,It),yr=(Qt.y+Jt.y)/2,Xr=[Qt,{x:Qt.x,y:yr},{x:Jt.x,y:yr},Jt];return Xr=Xr.map(tt),"M"+Xr[0]+"C"+Xr[1]+" "+Xr[2]+" "+Xr[3]}return xt.source=function(St){return arguments.length?(ge=At(St),xt):ge},xt.target=function(St){return arguments.length?(Oe=At(St),xt):Oe},xt.projection=function(St){return arguments.length?(tt=St,xt):tt},xt};function mr(ge){return[ge.x,ge.y]}h.svg.diagonal.radial=function(){var ge=h.svg.diagonal(),Oe=mr,tt=ge.projection;return ge.projection=function(xt){return arguments.length?tt(Tr(Oe=xt)):Oe},ge};function Tr(ge){return function(){var Oe=ge.apply(this,arguments),tt=Oe[0],xt=Oe[1]-Xe;return[tt*Math.cos(xt),tt*Math.sin(xt)]}}h.svg.symbol=function(){var ge=Gr,Oe=Lr;function tt(xt,St){return(Mn.get(ge.call(this,xt,St))||on)(Oe.call(this,xt,St))}return tt.type=function(xt){return arguments.length?(ge=At(xt),tt):ge},tt.size=function(xt){return arguments.length?(Oe=At(xt),tt):Oe},tt};function Lr(){return 64}function Gr(){return"circle"}function on(ge){var Oe=Math.sqrt(ge/xe);return"M0,"+Oe+"A"+Oe+","+Oe+" 0 1,1 0,"+-Oe+"A"+Oe+","+Oe+" 0 1,1 0,"+Oe+"Z"}var Mn=h.map({circle:on,cross:function(ge){var Oe=Math.sqrt(ge/5)/2;return"M"+-3*Oe+","+-Oe+"H"+-Oe+"V"+-3*Oe+"H"+Oe+"V"+-Oe+"H"+3*Oe+"V"+Oe+"H"+Oe+"V"+3*Oe+"H"+-Oe+"V"+Oe+"H"+-3*Oe+"Z"},diamond:function(ge){var Oe=Math.sqrt(ge/(2*Yn)),tt=Oe*Yn;return"M0,"+-Oe+"L"+tt+",0 0,"+Oe+" "+-tt+",0Z"},square:function(ge){var Oe=Math.sqrt(ge)/2;return"M"+-Oe+","+-Oe+"L"+Oe+","+-Oe+" "+Oe+","+Oe+" "+-Oe+","+Oe+"Z"},"triangle-down":function(ge){var Oe=Math.sqrt(ge/Pn),tt=Oe*Pn/2;return"M0,"+tt+"L"+Oe+","+-tt+" "+-Oe+","+-tt+"Z"},"triangle-up":function(ge){var Oe=Math.sqrt(ge/Pn),tt=Oe*Pn/2;return"M0,"+-tt+"L"+Oe+","+tt+" "+-Oe+","+tt+"Z"}});h.svg.symbolTypes=Mn.keys();var Pn=Math.sqrt(3),Yn=Math.tan(30*Je);te.transition=function(ge){for(var Oe=Ao||++$i,tt=Qs(ge),xt=[],St,It,Qt=mo||{time:Date.now(),ease:Bo,delay:0,duration:250},Jt=-1,yr=this.length;++Jt0;)hn[--Aa].call(ge,oa);if(Qn>=1)return Qt.event&&Qt.event.end.call(ge,ge.__data__,Oe),--It.count?delete It[xt]:delete ge[tt],1}Qt||(Jt=St.time,yr=Ea(An,0,Jt),Qt=It[xt]={tween:new A,time:Jt,timer:yr,delay:St.delay,duration:St.duration,ease:St.ease,index:Oe},St=null,++It.count)}h.svg.axis=function(){var ge=h.scale.linear(),Oe=al,tt=6,xt=6,St=3,It=[10],Qt=null,Jt;function yr(Xr){Xr.each(function(){var Hr=h.select(this),hn=this.__chart__||ge,An=this.__chart__=ge.copy(),kn=Qt??(An.ticks?An.ticks.apply(An,It):An.domain()),La=Jt??(An.tickFormat?An.tickFormat.apply(An,It):F),zn=Hr.selectAll(".tick").data(kn,An),Qn=zn.enter().insert("g",".domain").attr("class","tick").style("opacity",$e),oa=h.transition(zn.exit()).style("opacity",$e).remove(),Aa=h.transition(zn.order()).style("opacity",1),Ra=Math.max(tt,0)+St,ia,oi=Ta(An),Wi=Hr.selectAll(".domain").data([0]),zi=(Wi.enter().append("path").attr("class","domain"),h.transition(Wi));Qn.append("line"),Qn.append("text");var Gi=Qn.select("line"),wo=Aa.select("line"),ko=zn.select("text").text(La),Ks=Qn.select("text"),Ro=Aa.select("text"),us=Oe==="top"||Oe==="left"?-1:1,nl,Lu,Jl,co;if(Oe==="bottom"||Oe==="top"?(ia=ru,nl="x",Jl="y",Lu="x2",co="y2",ko.attr("dy",us<0?"0em":".71em").style("text-anchor","middle"),zi.attr("d","M"+oi[0]+","+us*xt+"V0H"+oi[1]+"V"+us*xt)):(ia=Ps,nl="y",Jl="x",Lu="y2",co="x2",ko.attr("dy",".32em").style("text-anchor",us<0?"end":"start"),zi.attr("d","M"+us*xt+","+oi[0]+"H0V"+oi[1]+"H"+us*xt)),Gi.attr(co,us*tt),Ks.attr(Jl,us*Ra),wo.attr(Lu,0).attr(co,us*tt),Ro.attr(nl,0).attr(Jl,us*Ra),An.rangeBand){var Is=An,el=Is.rangeBand()/2;hn=An=function(Zl){return Is(Zl)+el}}else hn.rangeBand?hn=An:oa.call(ia,An,hn);Qn.call(ia,hn,An),Aa.call(ia,An,An)})}return yr.scale=function(Xr){return arguments.length?(ge=Xr,yr):ge},yr.orient=function(Xr){return arguments.length?(Oe=Xr in vu?Xr+"":al,yr):Oe},yr.ticks=function(){return arguments.length?(It=S(arguments),yr):It},yr.tickValues=function(Xr){return arguments.length?(Qt=Xr,yr):Qt},yr.tickFormat=function(Xr){return arguments.length?(Jt=Xr,yr):Jt},yr.tickSize=function(Xr){var Hr=arguments.length;return Hr?(tt=+Xr,xt=+arguments[Hr-1],yr):tt},yr.innerTickSize=function(Xr){return arguments.length?(tt=+Xr,yr):tt},yr.outerTickSize=function(Xr){return arguments.length?(xt=+Xr,yr):xt},yr.tickPadding=function(Xr){return arguments.length?(St=+Xr,yr):St},yr.tickSubdivide=function(){return arguments.length&&yr},yr};var al="bottom",vu={top:1,right:1,bottom:1,left:1};function ru(ge,Oe,tt){ge.attr("transform",function(xt){var St=Oe(xt);return"translate("+(isFinite(St)?St:tt(xt))+",0)"})}function Ps(ge,Oe,tt){ge.attr("transform",function(xt){var St=Oe(xt);return"translate(0,"+(isFinite(St)?St:tt(xt))+")"})}h.svg.brush=function(){var ge=le(Hr,"brushstart","brush","brushend"),Oe=null,tt=null,xt=[0,0],St=[0,0],It,Qt,Jt=!0,yr=!0,Xr=Cu[0];function Hr(zn){zn.each(function(){var Qn=h.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",La).on("touchstart.brush",La),oa=Qn.selectAll(".background").data([0]);oa.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Qn.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Aa=Qn.selectAll(".resize").data(Xr,F);Aa.exit().remove(),Aa.enter().append("g").attr("class",function(Wi){return"resize "+Wi}).style("cursor",function(Wi){return Rs[Wi]}).append("rect").attr("x",function(Wi){return/[ew]$/.test(Wi)?-3:null}).attr("y",function(Wi){return/^[ns]/.test(Wi)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Aa.style("display",Hr.empty()?"none":null);var Ra=h.transition(Qn),ia=h.transition(oa),oi;Oe&&(oi=Ta(Oe),ia.attr("x",oi[0]).attr("width",oi[1]-oi[0]),An(Ra)),tt&&(oi=Ta(tt),ia.attr("y",oi[0]).attr("height",oi[1]-oi[0]),kn(Ra)),hn(Ra)})}Hr.event=function(zn){zn.each(function(){var Qn=ge.of(this,arguments),oa={x:xt,y:St,i:It,j:Qt},Aa=this.__chart__||oa;this.__chart__=oa,Ao?h.select(this).transition().each("start.brush",function(){It=Aa.i,Qt=Aa.j,xt=Aa.x,St=Aa.y,Qn({type:"brushstart"})}).tween("brush:brush",function(){var Ra=Dl(xt,oa.x),ia=Dl(St,oa.y);return It=Qt=null,function(oi){xt=oa.x=Ra(oi),St=oa.y=ia(oi),Qn({type:"brush",mode:"resize"})}}).each("end.brush",function(){It=oa.i,Qt=oa.j,Qn({type:"brush",mode:"resize"}),Qn({type:"brushend"})}):(Qn({type:"brushstart"}),Qn({type:"brush",mode:"resize"}),Qn({type:"brushend"}))})};function hn(zn){zn.selectAll(".resize").attr("transform",function(Qn){return"translate("+xt[+/e$/.test(Qn)]+","+St[+/^s/.test(Qn)]+")"})}function An(zn){zn.select(".extent").attr("x",xt[0]),zn.selectAll(".extent,.n>rect,.s>rect").attr("width",xt[1]-xt[0])}function kn(zn){zn.select(".extent").attr("y",St[0]),zn.selectAll(".extent,.e>rect,.w>rect").attr("height",St[1]-St[0])}function La(){var zn=this,Qn=h.select(h.event.target),oa=ge.of(zn,arguments),Aa=h.select(zn),Ra=Qn.datum(),ia=!/^(n|s)$/.test(Ra)&&Oe,oi=!/^(e|w)$/.test(Ra)&&tt,Wi=Qn.classed("extent"),zi=Sr(zn),Gi,wo=h.mouse(zn),ko,Ks=h.select(t(zn)).on("keydown.brush",nl).on("keyup.brush",Lu);if(h.event.changedTouches?Ks.on("touchmove.brush",Jl).on("touchend.brush",Is):Ks.on("mousemove.brush",Jl).on("mouseup.brush",Is),Aa.interrupt().selectAll("*").interrupt(),Wi)wo[0]=xt[0]-wo[0],wo[1]=St[0]-wo[1];else if(Ra){var Ro=+/w$/.test(Ra),us=+/^n/.test(Ra);ko=[xt[1-Ro]-wo[0],St[1-us]-wo[1]],wo[0]=xt[Ro],wo[1]=St[us]}else h.event.altKey&&(Gi=wo.slice());Aa.style("pointer-events","none").selectAll(".resize").style("display",null),h.select("body").style("cursor",Qn.style("cursor")),oa({type:"brushstart"}),Jl();function nl(){h.event.keyCode==32&&(Wi||(Gi=null,wo[0]-=xt[1],wo[1]-=St[1],Wi=2),re())}function Lu(){h.event.keyCode==32&&Wi==2&&(wo[0]+=xt[1],wo[1]+=St[1],Wi=0,re())}function Jl(){var el=h.mouse(zn),Zl=!1;ko&&(el[0]+=ko[0],el[1]+=ko[1]),Wi||(h.event.altKey?(Gi||(Gi=[(xt[0]+xt[1])/2,(St[0]+St[1])/2]),wo[0]=xt[+(el[0]0))return rr;do rr.push(Er=new Date(+Ft)),Ne(Ft,$t),pe(Ft);while(Er=Nt)for(;pe(Nt),!Ft(Nt);)Nt.setTime(Nt-1)},function(Nt,$t){if(Nt>=Nt)if($t<0)for(;++$t<=0;)for(;Ne(Nt,-1),!Ft(Nt););else for(;--$t>=0;)for(;Ne(Nt,1),!Ft(Nt););})},ot&&(rt.count=function(Ft,Nt){return b.setTime(+Ft),S.setTime(+Nt),pe(b),pe(S),Math.floor(ot(b,S))},rt.every=function(Ft){return Ft=Math.floor(Ft),!isFinite(Ft)||!(Ft>0)?null:Ft>1?rt.filter(ft?function(Nt){return ft(Nt)%Ft===0}:function(Nt){return rt.count(0,Nt)%Ft===0}):rt}),rt}var e=E(function(){},function(pe,Ne){pe.setTime(+pe+Ne)},function(pe,Ne){return Ne-pe});e.every=function(pe){return pe=Math.floor(pe),!isFinite(pe)||!(pe>0)?null:pe>1?E(function(Ne){Ne.setTime(Math.floor(Ne/pe)*pe)},function(Ne,ot){Ne.setTime(+Ne+ot*pe)},function(Ne,ot){return(ot-Ne)/pe}):e};var t=e.range,r=1e3,o=6e4,n=36e5,i=864e5,a=6048e5,s=E(function(pe){pe.setTime(pe-pe.getMilliseconds())},function(pe,Ne){pe.setTime(+pe+Ne*r)},function(pe,Ne){return(Ne-pe)/r},function(pe){return pe.getUTCSeconds()}),f=s.range,c=E(function(pe){pe.setTime(pe-pe.getMilliseconds()-pe.getSeconds()*r)},function(pe,Ne){pe.setTime(+pe+Ne*o)},function(pe,Ne){return(Ne-pe)/o},function(pe){return pe.getMinutes()}),p=c.range,d=E(function(pe){pe.setTime(pe-pe.getMilliseconds()-pe.getSeconds()*r-pe.getMinutes()*o)},function(pe,Ne){pe.setTime(+pe+Ne*n)},function(pe,Ne){return(Ne-pe)/n},function(pe){return pe.getHours()}),T=d.range,l=E(function(pe){pe.setHours(0,0,0,0)},function(pe,Ne){pe.setDate(pe.getDate()+Ne)},function(pe,Ne){return(Ne-pe-(Ne.getTimezoneOffset()-pe.getTimezoneOffset())*o)/i},function(pe){return pe.getDate()-1}),g=l.range;function x(pe){return E(function(Ne){Ne.setDate(Ne.getDate()-(Ne.getDay()+7-pe)%7),Ne.setHours(0,0,0,0)},function(Ne,ot){Ne.setDate(Ne.getDate()+ot*7)},function(Ne,ot){return(ot-Ne-(ot.getTimezoneOffset()-Ne.getTimezoneOffset())*o)/a})}var A=x(0),M=x(1),_=x(2),w=x(3),m=x(4),u=x(5),v=x(6),y=A.range,I=M.range,L=_.range,z=w.range,F=m.range,N=u.range,B=v.range,R=E(function(pe){pe.setDate(1),pe.setHours(0,0,0,0)},function(pe,Ne){pe.setMonth(pe.getMonth()+Ne)},function(pe,Ne){return Ne.getMonth()-pe.getMonth()+(Ne.getFullYear()-pe.getFullYear())*12},function(pe){return pe.getMonth()}),U=R.range,j=E(function(pe){pe.setMonth(0,1),pe.setHours(0,0,0,0)},function(pe,Ne){pe.setFullYear(pe.getFullYear()+Ne)},function(pe,Ne){return Ne.getFullYear()-pe.getFullYear()},function(pe){return pe.getFullYear()});j.every=function(pe){return!isFinite(pe=Math.floor(pe))||!(pe>0)?null:E(function(Ne){Ne.setFullYear(Math.floor(Ne.getFullYear()/pe)*pe),Ne.setMonth(0,1),Ne.setHours(0,0,0,0)},function(Ne,ot){Ne.setFullYear(Ne.getFullYear()+ot*pe)})};var Z=j.range,re=E(function(pe){pe.setUTCSeconds(0,0)},function(pe,Ne){pe.setTime(+pe+Ne*o)},function(pe,Ne){return(Ne-pe)/o},function(pe){return pe.getUTCMinutes()}),fe=re.range,le=E(function(pe){pe.setUTCMinutes(0,0,0)},function(pe,Ne){pe.setTime(+pe+Ne*n)},function(pe,Ne){return(Ne-pe)/n},function(pe){return pe.getUTCHours()}),ce=le.range,V=E(function(pe){pe.setUTCHours(0,0,0,0)},function(pe,Ne){pe.setUTCDate(pe.getUTCDate()+Ne)},function(pe,Ne){return(Ne-pe)/i},function(pe){return pe.getUTCDate()-1}),ee=V.range;function ne(pe){return E(function(Ne){Ne.setUTCDate(Ne.getUTCDate()-(Ne.getUTCDay()+7-pe)%7),Ne.setUTCHours(0,0,0,0)},function(Ne,ot){Ne.setUTCDate(Ne.getUTCDate()+ot*7)},function(Ne,ot){return(ot-Ne)/a})}var K=ne(0),ue=ne(1),te=ne(2),H=ne(3),ae=ne(4),ie=ne(5),ve=ne(6),Ae=K.range,Ce=ue.range,Fe=te.range,ze=H.range,Ye=ae.range,it=ie.range,st=ve.range,nt=E(function(pe){pe.setUTCDate(1),pe.setUTCHours(0,0,0,0)},function(pe,Ne){pe.setUTCMonth(pe.getUTCMonth()+Ne)},function(pe,Ne){return Ne.getUTCMonth()-pe.getUTCMonth()+(Ne.getUTCFullYear()-pe.getUTCFullYear())*12},function(pe){return pe.getUTCMonth()}),Qe=nt.range,Le=E(function(pe){pe.setUTCMonth(0,1),pe.setUTCHours(0,0,0,0)},function(pe,Ne){pe.setUTCFullYear(pe.getUTCFullYear()+Ne)},function(pe,Ne){return Ne.getUTCFullYear()-pe.getUTCFullYear()},function(pe){return pe.getUTCFullYear()});Le.every=function(pe){return!isFinite(pe=Math.floor(pe))||!(pe>0)?null:E(function(Ne){Ne.setUTCFullYear(Math.floor(Ne.getUTCFullYear()/pe)*pe),Ne.setUTCMonth(0,1),Ne.setUTCHours(0,0,0,0)},function(Ne,ot){Ne.setUTCFullYear(Ne.getUTCFullYear()+ot*pe)})};var Te=Le.range;h.timeDay=l,h.timeDays=g,h.timeFriday=u,h.timeFridays=N,h.timeHour=d,h.timeHours=T,h.timeInterval=E,h.timeMillisecond=e,h.timeMilliseconds=t,h.timeMinute=c,h.timeMinutes=p,h.timeMonday=M,h.timeMondays=I,h.timeMonth=R,h.timeMonths=U,h.timeSaturday=v,h.timeSaturdays=B,h.timeSecond=s,h.timeSeconds=f,h.timeSunday=A,h.timeSundays=y,h.timeThursday=m,h.timeThursdays=F,h.timeTuesday=_,h.timeTuesdays=L,h.timeWednesday=w,h.timeWednesdays=z,h.timeWeek=A,h.timeWeeks=y,h.timeYear=j,h.timeYears=Z,h.utcDay=V,h.utcDays=ee,h.utcFriday=ie,h.utcFridays=it,h.utcHour=le,h.utcHours=ce,h.utcMillisecond=e,h.utcMilliseconds=t,h.utcMinute=re,h.utcMinutes=fe,h.utcMonday=ue,h.utcMondays=Ce,h.utcMonth=nt,h.utcMonths=Qe,h.utcSaturday=ve,h.utcSaturdays=st,h.utcSecond=s,h.utcSeconds=f,h.utcSunday=K,h.utcSundays=Ae,h.utcThursday=ae,h.utcThursdays=Ye,h.utcTuesday=te,h.utcTuesdays=Fe,h.utcWednesday=H,h.utcWednesdays=ze,h.utcWeek=K,h.utcWeeks=Ae,h.utcYear=Le,h.utcYears=Te,Object.defineProperty(h,"__esModule",{value:!0})})}}),Mi=Ge({"node_modules/d3-time-format/dist/d3-time-format.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($,Oo()):(h=h||self,b(h.d3=h.d3||{},h.d3))})($,function(h,b){function S(je){if(0<=je.y&&je.y<100){var $e=new Date(-1,je.m,je.d,je.H,je.M,je.S,je.L);return $e.setFullYear(je.y),$e}return new Date(je.y,je.m,je.d,je.H,je.M,je.S,je.L)}function E(je){if(0<=je.y&&je.y<100){var $e=new Date(Date.UTC(-1,je.m,je.d,je.H,je.M,je.S,je.L));return $e.setUTCFullYear(je.y),$e}return new Date(Date.UTC(je.y,je.m,je.d,je.H,je.M,je.S,je.L))}function e(je,$e,Ee){return{y:je,m:$e,d:Ee,H:0,M:0,S:0,L:0}}function t(je){var $e=je.dateTime,Ee=je.date,xe=je.time,ye=je.periods,Me=je.days,Xe=je.shortDays,Je=je.months,Lt=je.shortMonths,Ct=f(ye),Ot=c(ye),Wt=f(Me),_r=c(Me),pr=f(Xe),hr=c(Xe),Fr=f(Je),En=c(Je),Kn=f(Lt),qn=c(Lt),ta={a:pa,A:ha,b:_a,B:Ca,c:null,d:R,e:R,f:fe,H:U,I:j,j:Z,L:re,m:le,M:ce,p:Vn,q:yi,Q:Nt,s:$t,S:V,u:ee,U:ne,V:K,w:ue,W:te,x:null,X:null,y:H,Y:ae,Z:ie,"%":Ft},ra={a:Ci,A:Dt,b:yt,B:kr,c:null,d:ve,e:ve,f:Ye,H:Ae,I:Ce,j:Fe,L:ze,m:it,M:st,p:Nr,q:jr,Q:Nt,s:$t,S:nt,u:Qe,U:Le,V:Te,w:pe,W:Ne,x:null,X:null,y:ot,Y:ft,Z:rt,"%":Ft},Nn={a:ar,A:lr,b:Vr,B:sn,c:mn,d:m,e:m,f:z,H:v,I:v,j:u,L,m:w,M:y,p:qt,q:_,Q:N,s:B,S:I,u:d,U:T,V:l,w:p,W:g,x:wn,X:Jn,y:A,Y:x,Z:M,"%":F};ta.x=ka(Ee,ta),ta.X=ka(xe,ta),ta.c=ka($e,ta),ra.x=ka(Ee,ra),ra.X=ka(xe,ra),ra.c=ka($e,ra);function ka(Ir,Ur){return function(ln){var $r=[],At=-1,or=0,Dr=Ir.length,un,Rn,jn;for(ln instanceof Date||(ln=new Date(+ln));++At53)return null;"w"in $r||($r.w=1),"Z"in $r?(or=E(e($r.y,0,1)),Dr=or.getUTCDay(),or=Dr>4||Dr===0?b.utcMonday.ceil(or):b.utcMonday(or),or=b.utcDay.offset(or,($r.V-1)*7),$r.y=or.getUTCFullYear(),$r.m=or.getUTCMonth(),$r.d=or.getUTCDate()+($r.w+6)%7):(or=S(e($r.y,0,1)),Dr=or.getDay(),or=Dr>4||Dr===0?b.timeMonday.ceil(or):b.timeMonday(or),or=b.timeDay.offset(or,($r.V-1)*7),$r.y=or.getFullYear(),$r.m=or.getMonth(),$r.d=or.getDate()+($r.w+6)%7)}else("W"in $r||"U"in $r)&&("w"in $r||($r.w="u"in $r?$r.u%7:"W"in $r?1:0),Dr="Z"in $r?E(e($r.y,0,1)).getUTCDay():S(e($r.y,0,1)).getDay(),$r.m=0,$r.d="W"in $r?($r.w+6)%7+$r.W*7-(Dr+5)%7:$r.w+$r.U*7-(Dr+6)%7);return"Z"in $r?($r.H+=$r.Z/100|0,$r.M+=$r.Z%100,E($r)):S($r)}}function ir(Ir,Ur,ln,$r){for(var At=0,or=Ur.length,Dr=ln.length,un,Rn;At=Dr)return-1;if(un=Ur.charCodeAt(At++),un===37){if(un=Ur.charAt(At++),Rn=Nn[un in r?Ur.charAt(At++):un],!Rn||($r=Rn(Ir,ln,$r))<0)return-1}else if(un!=ln.charCodeAt($r++))return-1}return $r}function qt(Ir,Ur,ln){var $r=Ct.exec(Ur.slice(ln));return $r?(Ir.p=Ot[$r[0].toLowerCase()],ln+$r[0].length):-1}function ar(Ir,Ur,ln){var $r=pr.exec(Ur.slice(ln));return $r?(Ir.w=hr[$r[0].toLowerCase()],ln+$r[0].length):-1}function lr(Ir,Ur,ln){var $r=Wt.exec(Ur.slice(ln));return $r?(Ir.w=_r[$r[0].toLowerCase()],ln+$r[0].length):-1}function Vr(Ir,Ur,ln){var $r=Kn.exec(Ur.slice(ln));return $r?(Ir.m=qn[$r[0].toLowerCase()],ln+$r[0].length):-1}function sn(Ir,Ur,ln){var $r=Fr.exec(Ur.slice(ln));return $r?(Ir.m=En[$r[0].toLowerCase()],ln+$r[0].length):-1}function mn(Ir,Ur,ln){return ir(Ir,$e,Ur,ln)}function wn(Ir,Ur,ln){return ir(Ir,Ee,Ur,ln)}function Jn(Ir,Ur,ln){return ir(Ir,xe,Ur,ln)}function pa(Ir){return Xe[Ir.getDay()]}function ha(Ir){return Me[Ir.getDay()]}function _a(Ir){return Lt[Ir.getMonth()]}function Ca(Ir){return Je[Ir.getMonth()]}function Vn(Ir){return ye[+(Ir.getHours()>=12)]}function yi(Ir){return 1+~~(Ir.getMonth()/3)}function Ci(Ir){return Xe[Ir.getUTCDay()]}function Dt(Ir){return Me[Ir.getUTCDay()]}function yt(Ir){return Lt[Ir.getUTCMonth()]}function kr(Ir){return Je[Ir.getUTCMonth()]}function Nr(Ir){return ye[+(Ir.getUTCHours()>=12)]}function jr(Ir){return 1+~~(Ir.getUTCMonth()/3)}return{format:function(Ir){var Ur=ka(Ir+="",ta);return Ur.toString=function(){return Ir},Ur},parse:function(Ir){var Ur=qa(Ir+="",!1);return Ur.toString=function(){return Ir},Ur},utcFormat:function(Ir){var Ur=ka(Ir+="",ra);return Ur.toString=function(){return Ir},Ur},utcParse:function(Ir){var Ur=qa(Ir+="",!0);return Ur.toString=function(){return Ir},Ur}}}var r={"-":"",_:" ",0:"0"},o=/^\s*\d+/,n=/^%/,i=/[\\^$*+?|[\]().{}]/g;function a(je,$e,Ee){var xe=je<0?"-":"",ye=(xe?-je:je)+"",Me=ye.length;return xe+(Me68?1900:2e3),Ee+xe[0].length):-1}function M(je,$e,Ee){var xe=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec($e.slice(Ee,Ee+6));return xe?(je.Z=xe[1]?0:-(xe[2]+(xe[3]||"00")),Ee+xe[0].length):-1}function _(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+1));return xe?(je.q=xe[0]*3-3,Ee+xe[0].length):-1}function w(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+2));return xe?(je.m=xe[0]-1,Ee+xe[0].length):-1}function m(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+2));return xe?(je.d=+xe[0],Ee+xe[0].length):-1}function u(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+3));return xe?(je.m=0,je.d=+xe[0],Ee+xe[0].length):-1}function v(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+2));return xe?(je.H=+xe[0],Ee+xe[0].length):-1}function y(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+2));return xe?(je.M=+xe[0],Ee+xe[0].length):-1}function I(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+2));return xe?(je.S=+xe[0],Ee+xe[0].length):-1}function L(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+3));return xe?(je.L=+xe[0],Ee+xe[0].length):-1}function z(je,$e,Ee){var xe=o.exec($e.slice(Ee,Ee+6));return xe?(je.L=Math.floor(xe[0]/1e3),Ee+xe[0].length):-1}function F(je,$e,Ee){var xe=n.exec($e.slice(Ee,Ee+1));return xe?Ee+xe[0].length:-1}function N(je,$e,Ee){var xe=o.exec($e.slice(Ee));return xe?(je.Q=+xe[0],Ee+xe[0].length):-1}function B(je,$e,Ee){var xe=o.exec($e.slice(Ee));return xe?(je.s=+xe[0],Ee+xe[0].length):-1}function R(je,$e){return a(je.getDate(),$e,2)}function U(je,$e){return a(je.getHours(),$e,2)}function j(je,$e){return a(je.getHours()%12||12,$e,2)}function Z(je,$e){return a(1+b.timeDay.count(b.timeYear(je),je),$e,3)}function re(je,$e){return a(je.getMilliseconds(),$e,3)}function fe(je,$e){return re(je,$e)+"000"}function le(je,$e){return a(je.getMonth()+1,$e,2)}function ce(je,$e){return a(je.getMinutes(),$e,2)}function V(je,$e){return a(je.getSeconds(),$e,2)}function ee(je){var $e=je.getDay();return $e===0?7:$e}function ne(je,$e){return a(b.timeSunday.count(b.timeYear(je)-1,je),$e,2)}function K(je,$e){var Ee=je.getDay();return je=Ee>=4||Ee===0?b.timeThursday(je):b.timeThursday.ceil(je),a(b.timeThursday.count(b.timeYear(je),je)+(b.timeYear(je).getDay()===4),$e,2)}function ue(je){return je.getDay()}function te(je,$e){return a(b.timeMonday.count(b.timeYear(je)-1,je),$e,2)}function H(je,$e){return a(je.getFullYear()%100,$e,2)}function ae(je,$e){return a(je.getFullYear()%1e4,$e,4)}function ie(je){var $e=je.getTimezoneOffset();return($e>0?"-":($e*=-1,"+"))+a($e/60|0,"0",2)+a($e%60,"0",2)}function ve(je,$e){return a(je.getUTCDate(),$e,2)}function Ae(je,$e){return a(je.getUTCHours(),$e,2)}function Ce(je,$e){return a(je.getUTCHours()%12||12,$e,2)}function Fe(je,$e){return a(1+b.utcDay.count(b.utcYear(je),je),$e,3)}function ze(je,$e){return a(je.getUTCMilliseconds(),$e,3)}function Ye(je,$e){return ze(je,$e)+"000"}function it(je,$e){return a(je.getUTCMonth()+1,$e,2)}function st(je,$e){return a(je.getUTCMinutes(),$e,2)}function nt(je,$e){return a(je.getUTCSeconds(),$e,2)}function Qe(je){var $e=je.getUTCDay();return $e===0?7:$e}function Le(je,$e){return a(b.utcSunday.count(b.utcYear(je)-1,je),$e,2)}function Te(je,$e){var Ee=je.getUTCDay();return je=Ee>=4||Ee===0?b.utcThursday(je):b.utcThursday.ceil(je),a(b.utcThursday.count(b.utcYear(je),je)+(b.utcYear(je).getUTCDay()===4),$e,2)}function pe(je){return je.getUTCDay()}function Ne(je,$e){return a(b.utcMonday.count(b.utcYear(je)-1,je),$e,2)}function ot(je,$e){return a(je.getUTCFullYear()%100,$e,2)}function ft(je,$e){return a(je.getUTCFullYear()%1e4,$e,4)}function rt(){return"+0000"}function Ft(){return"%"}function Nt(je){return+je}function $t(je){return Math.floor(+je/1e3)}var rr;Er({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 Er(je){return rr=t(je),h.timeFormat=rr.format,h.timeParse=rr.parse,h.utcFormat=rr.utcFormat,h.utcParse=rr.utcParse,rr}var Mr="%Y-%m-%dT%H:%M:%S.%LZ";function Wr(je){return je.toISOString()}var Sr=Date.prototype.toISOString?Wr:h.utcFormat(Mr);function Br(je){var $e=new Date(je);return isNaN($e)?null:$e}var Mt=+new Date("2000-01-01T00:00:00.000Z")?Br:h.utcParse(Mr);h.isoFormat=Sr,h.isoParse=Mt,h.timeFormatDefaultLocale=Er,h.timeFormatLocale=t,Object.defineProperty(h,"__esModule",{value:!0})})}}),po=Ge({"node_modules/d3-format/dist/d3-format.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($):(h=typeof globalThis<"u"?globalThis:h||self,b(h.d3=h.d3||{}))})($,function(h){function b(w){return Math.abs(w=Math.round(w))>=1e21?w.toLocaleString("en").replace(/,/g,""):w.toString(10)}function S(w,m){if((u=(w=m?w.toExponential(m-1):w.toExponential()).indexOf("e"))<0)return null;var u,v=w.slice(0,u);return[v.length>1?v[0]+v.slice(2):v,+w.slice(u+1)]}function E(w){return w=S(Math.abs(w)),w?w[1]:NaN}function e(w,m){return function(u,v){for(var y=u.length,I=[],L=0,z=w[0],F=0;y>0&&z>0&&(F+z+1>v&&(z=Math.max(1,v-F)),I.push(u.substring(y-=z,y+z)),!((F+=z+1)>v));)z=w[L=(L+1)%w.length];return I.reverse().join(m)}}function t(w){return function(m){return m.replace(/[0-9]/g,function(u){return w[+u]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(w){if(!(m=r.exec(w)))throw new Error("invalid format: "+w);var m;return new n({fill:m[1],align:m[2],sign:m[3],symbol:m[4],zero:m[5],width:m[6],comma:m[7],precision:m[8]&&m[8].slice(1),trim:m[9],type:m[10]})}o.prototype=n.prototype;function n(w){this.fill=w.fill===void 0?" ":w.fill+"",this.align=w.align===void 0?">":w.align+"",this.sign=w.sign===void 0?"-":w.sign+"",this.symbol=w.symbol===void 0?"":w.symbol+"",this.zero=!!w.zero,this.width=w.width===void 0?void 0:+w.width,this.comma=!!w.comma,this.precision=w.precision===void 0?void 0:+w.precision,this.trim=!!w.trim,this.type=w.type===void 0?"":w.type+""}n.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 i(w){e:for(var m=w.length,u=1,v=-1,y;u0&&(v=0);break}return v>0?w.slice(0,v)+w.slice(y+1):w}var a;function s(w,m){var u=S(w,m);if(!u)return w+"";var v=u[0],y=u[1],I=y-(a=Math.max(-8,Math.min(8,Math.floor(y/3)))*3)+1,L=v.length;return I===L?v:I>L?v+new Array(I-L+1).join("0"):I>0?v.slice(0,I)+"."+v.slice(I):"0."+new Array(1-I).join("0")+S(w,Math.max(0,m+I-1))[0]}function f(w,m){var u=S(w,m);if(!u)return w+"";var v=u[0],y=u[1];return y<0?"0."+new Array(-y).join("0")+v:v.length>y+1?v.slice(0,y+1)+"."+v.slice(y+1):v+new Array(y-v.length+2).join("0")}var c={"%":function(w,m){return(w*100).toFixed(m)},b:function(w){return Math.round(w).toString(2)},c:function(w){return w+""},d:b,e:function(w,m){return w.toExponential(m)},f:function(w,m){return w.toFixed(m)},g:function(w,m){return w.toPrecision(m)},o:function(w){return Math.round(w).toString(8)},p:function(w,m){return f(w*100,m)},r:f,s,X:function(w){return Math.round(w).toString(16).toUpperCase()},x:function(w){return Math.round(w).toString(16)}};function p(w){return w}var d=Array.prototype.map,T=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function l(w){var m=w.grouping===void 0||w.thousands===void 0?p:e(d.call(w.grouping,Number),w.thousands+""),u=w.currency===void 0?"":w.currency[0]+"",v=w.currency===void 0?"":w.currency[1]+"",y=w.decimal===void 0?".":w.decimal+"",I=w.numerals===void 0?p:t(d.call(w.numerals,String)),L=w.percent===void 0?"%":w.percent+"",z=w.minus===void 0?"-":w.minus+"",F=w.nan===void 0?"NaN":w.nan+"";function N(R){R=o(R);var U=R.fill,j=R.align,Z=R.sign,re=R.symbol,fe=R.zero,le=R.width,ce=R.comma,V=R.precision,ee=R.trim,ne=R.type;ne==="n"?(ce=!0,ne="g"):c[ne]||(V===void 0&&(V=12),ee=!0,ne="g"),(fe||U==="0"&&j==="=")&&(fe=!0,U="0",j="=");var K=re==="$"?u:re==="#"&&/[boxX]/.test(ne)?"0"+ne.toLowerCase():"",ue=re==="$"?v:/[%p]/.test(ne)?L:"",te=c[ne],H=/[defgprs%]/.test(ne);V=V===void 0?6:/[gprs]/.test(ne)?Math.max(1,Math.min(21,V)):Math.max(0,Math.min(20,V));function ae(ie){var ve=K,Ae=ue,Ce,Fe,ze;if(ne==="c")Ae=te(ie)+Ae,ie="";else{ie=+ie;var Ye=ie<0||1/ie<0;if(ie=isNaN(ie)?F:te(Math.abs(ie),V),ee&&(ie=i(ie)),Ye&&+ie==0&&Z!=="+"&&(Ye=!1),ve=(Ye?Z==="("?Z:z:Z==="-"||Z==="("?"":Z)+ve,Ae=(ne==="s"?T[8+a/3]:"")+Ae+(Ye&&Z==="("?")":""),H){for(Ce=-1,Fe=ie.length;++Ceze||ze>57){Ae=(ze===46?y+ie.slice(Ce+1):ie.slice(Ce))+Ae,ie=ie.slice(0,Ce);break}}}ce&&!fe&&(ie=m(ie,1/0));var it=ve.length+ie.length+Ae.length,st=it>1)+ve+ie+Ae+st.slice(it);break;default:ie=st+ve+ie+Ae;break}return I(ie)}return ae.toString=function(){return R+""},ae}function B(R,U){var j=N((R=o(R),R.type="f",R)),Z=Math.max(-8,Math.min(8,Math.floor(E(U)/3)))*3,re=Math.pow(10,-Z),fe=T[8+Z/3];return function(le){return j(re*le)+fe}}return{format:N,formatPrefix:B}}var g;x({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function x(w){return g=l(w),h.format=g.format,h.formatPrefix=g.formatPrefix,g}function A(w){return Math.max(0,-E(Math.abs(w)))}function M(w,m){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(E(m)/3)))*3-E(Math.abs(w)))}function _(w,m){return w=Math.abs(w),m=Math.abs(m)-w,Math.max(0,E(m)-E(w))+1}h.FormatSpecifier=n,h.formatDefaultLocale=x,h.formatLocale=l,h.formatSpecifier=o,h.precisionFixed=A,h.precisionPrefix=M,h.precisionRound=_,Object.defineProperty(h,"__esModule",{value:!0})})}}),js=Ge({"node_modules/is-string-blank/index.js"($,G){G.exports=function(h){for(var b=h.length,S,E=0;E13)&&S!==32&&S!==133&&S!==160&&S!==5760&&S!==6158&&(S<8192||S>8205)&&S!==8232&&S!==8233&&S!==8239&&S!==8287&&S!==8288&&S!==12288&&S!==65279)return!1;return!0}}}),Ga=Ge({"node_modules/fast-isnumeric/index.js"($,G){var h=js();G.exports=function(b){var S=typeof b;if(S==="string"){var E=b;if(b=+b,b===0&&h(E))return!1}else if(S!=="number")return!1;return b-b<1}}}),hi=Ge({"src/constants/numerical.js"($,G){G.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}}),ai=Ge({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($):(h=typeof globalThis<"u"?globalThis:h||self,b(h["base64-arraybuffer"]={}))})($,function(h){for(var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S=typeof Uint8Array>"u"?[]:new Uint8Array(256),E=0;E>2],a+=b[(o[n]&3)<<4|o[n+1]>>4],a+=b[(o[n+1]&15)<<2|o[n+2]>>6],a+=b[o[n+2]&63];return i%3===2?a=a.substring(0,a.length-1)+"=":i%3===1&&(a=a.substring(0,a.length-2)+"=="),a},t=function(r){var o=r.length*.75,n=r.length,i,a=0,s,f,c,p;r[r.length-1]==="="&&(o--,r[r.length-2]==="="&&o--);var d=new ArrayBuffer(o),T=new Uint8Array(d);for(i=0;i>4,T[a++]=(f&15)<<4|c>>2,T[a++]=(c&3)<<6|p&63;return d};h.decode=t,h.encode=e,Object.defineProperty(h,"__esModule",{value:!0})})}}),yo=Ge({"src/lib/is_plain_object.js"($,G){G.exports=function(b){return window&&window.process&&window.process.versions?Object.prototype.toString.call(b)==="[object Object]":Object.prototype.toString.call(b)==="[object Object]"&&Object.getPrototypeOf(b).hasOwnProperty("hasOwnProperty")}}}),ro=Ge({"src/lib/array.js"($){var G=ai().decode,h=yo(),b=Array.isArray,S=ArrayBuffer,E=DataView;function e(s){return S.isView(s)&&!(s instanceof E)}$.isTypedArray=e;function t(s){return b(s)||e(s)}$.isArrayOrTypedArray=t;function r(s){return!t(s[0])}$.isArray1D=r,$.ensureArray=function(s,f){return b(s)||(s=[]),s.length=f,s};var o={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};o.uint8c=o.u1c,o.uint8=o.u1,o.int8=o.i1,o.uint16=o.u2,o.int16=o.i2,o.uint32=o.u4,o.int32=o.i4,o.float32=o.f4,o.float64=o.f8;function n(s){return s.constructor===ArrayBuffer}$.isArrayBuffer=n,$.decodeTypedArraySpec=function(s){var f=[],c=i(s),p=c.dtype,d=o[p];if(!d)throw new Error('Error in dtype: "'+p+'"');var T=d.BYTES_PER_ELEMENT,l=c.bdata;n(l)||(l=G(l));var g=c.shape===void 0?[l.byteLength/T]:(""+c.shape).split(",");g.reverse();var x=g.length,A,M,_=+g[0],w=T*_,m=0;if(x===1)f=new d(l);else if(x===2)for(A=+g[1],M=0;M2)return d[A]=d[A]|e,g.set(x,null);if(l){for(f=A;f0)return Math.log(S)/Math.LN10;var e=Math.log(Math.min(E[0],E[1]))/Math.LN10;return h(e)||(e=Math.log(Math.max(E[0],E[1]))/Math.LN10-6),e}}}),Xn=Ge({"src/lib/relink_private.js"($,G){var h=ro().isArrayOrTypedArray,b=yo();G.exports=function S(E,e){for(var t in e){var r=e[t],o=E[t];if(o!==r)if(t.charAt(0)==="_"||typeof r=="function"){if(t in E)continue;E[t]=r}else if(h(r)&&h(o)&&b(r[0])){if(t==="customdata"||t==="ids")continue;for(var n=Math.min(r.length,o.length),i=0;iE/2?S-Math.round(S/E)*E:S}G.exports={mod:h,modHalf:b}}}),ks=Ge({"node_modules/tinycolor2/tinycolor.js"($,G){(function(h){var b=/^\s+/,S=/\s+$/,E=0,e=h.round,t=h.min,r=h.max,o=h.random;function n(H,ae){if(H=H||"",ae=ae||{},H instanceof n)return H;if(!(this instanceof n))return new n(H,ae);var ie=i(H);this._originalInput=H,this._r=ie.r,this._g=ie.g,this._b=ie.b,this._a=ie.a,this._roundA=e(100*this._a)/100,this._format=ae.format||ie.format,this._gradientType=ae.gradientType,this._r<1&&(this._r=e(this._r)),this._g<1&&(this._g=e(this._g)),this._b<1&&(this._b=e(this._b)),this._ok=ie.ok,this._tc_id=E++}n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var H=this.toRgb();return(H.r*299+H.g*587+H.b*114)/1e3},getLuminance:function(){var H=this.toRgb(),ae,ie,ve,Ae,Ce,Fe;return ae=H.r/255,ie=H.g/255,ve=H.b/255,ae<=.03928?Ae=ae/12.92:Ae=h.pow((ae+.055)/1.055,2.4),ie<=.03928?Ce=ie/12.92:Ce=h.pow((ie+.055)/1.055,2.4),ve<=.03928?Fe=ve/12.92:Fe=h.pow((ve+.055)/1.055,2.4),.2126*Ae+.7152*Ce+.0722*Fe},setAlpha:function(H){return this._a=R(H),this._roundA=e(100*this._a)/100,this},toHsv:function(){var H=c(this._r,this._g,this._b);return{h:H.h*360,s:H.s,v:H.v,a:this._a}},toHsvString:function(){var H=c(this._r,this._g,this._b),ae=e(H.h*360),ie=e(H.s*100),ve=e(H.v*100);return this._a==1?"hsv("+ae+", "+ie+"%, "+ve+"%)":"hsva("+ae+", "+ie+"%, "+ve+"%, "+this._roundA+")"},toHsl:function(){var H=s(this._r,this._g,this._b);return{h:H.h*360,s:H.s,l:H.l,a:this._a}},toHslString:function(){var H=s(this._r,this._g,this._b),ae=e(H.h*360),ie=e(H.s*100),ve=e(H.l*100);return this._a==1?"hsl("+ae+", "+ie+"%, "+ve+"%)":"hsla("+ae+", "+ie+"%, "+ve+"%, "+this._roundA+")"},toHex:function(H){return d(this._r,this._g,this._b,H)},toHexString:function(H){return"#"+this.toHex(H)},toHex8:function(H){return T(this._r,this._g,this._b,this._a,H)},toHex8String:function(H){return"#"+this.toHex8(H)},toRgb:function(){return{r:e(this._r),g:e(this._g),b:e(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+e(this._r)+", "+e(this._g)+", "+e(this._b)+")":"rgba("+e(this._r)+", "+e(this._g)+", "+e(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:e(U(this._r,255)*100)+"%",g:e(U(this._g,255)*100)+"%",b:e(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+e(U(this._r,255)*100)+"%, "+e(U(this._g,255)*100)+"%, "+e(U(this._b,255)*100)+"%)":"rgba("+e(U(this._r,255)*100)+"%, "+e(U(this._g,255)*100)+"%, "+e(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:N[d(this._r,this._g,this._b,!0)]||!1},toFilter:function(H){var ae="#"+l(this._r,this._g,this._b,this._a),ie=ae,ve=this._gradientType?"GradientType = 1, ":"";if(H){var Ae=n(H);ie="#"+l(Ae._r,Ae._g,Ae._b,Ae._a)}return"progid:DXImageTransform.Microsoft.gradient("+ve+"startColorstr="+ae+",endColorstr="+ie+")"},toString:function(H){var ae=!!H;H=H||this._format;var ie=!1,ve=this._a<1&&this._a>=0,Ae=!ae&&ve&&(H==="hex"||H==="hex6"||H==="hex3"||H==="hex4"||H==="hex8"||H==="name");return Ae?H==="name"&&this._a===0?this.toName():this.toRgbString():(H==="rgb"&&(ie=this.toRgbString()),H==="prgb"&&(ie=this.toPercentageRgbString()),(H==="hex"||H==="hex6")&&(ie=this.toHexString()),H==="hex3"&&(ie=this.toHexString(!0)),H==="hex4"&&(ie=this.toHex8String(!0)),H==="hex8"&&(ie=this.toHex8String()),H==="name"&&(ie=this.toName()),H==="hsl"&&(ie=this.toHslString()),H==="hsv"&&(ie=this.toHsvString()),ie||this.toHexString())},clone:function(){return n(this.toString())},_applyModification:function(H,ae){var ie=H.apply(null,[this].concat([].slice.call(ae)));return this._r=ie._r,this._g=ie._g,this._b=ie._b,this.setAlpha(ie._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(x,arguments)},greyscale:function(){return this._applyModification(A,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(H,ae){return H.apply(null,[this].concat([].slice.call(ae)))},analogous:function(){return this._applyCombination(L,arguments)},complement:function(){return this._applyCombination(u,arguments)},monochromatic:function(){return this._applyCombination(z,arguments)},splitcomplement:function(){return this._applyCombination(I,arguments)},triad:function(){return this._applyCombination(v,arguments)},tetrad:function(){return this._applyCombination(y,arguments)}},n.fromRatio=function(H,ae){if(typeof H=="object"){var ie={};for(var ve in H)H.hasOwnProperty(ve)&&(ve==="a"?ie[ve]=H[ve]:ie[ve]=ce(H[ve]));H=ie}return n(H,ae)};function i(H){var ae={r:0,g:0,b:0},ie=1,ve=null,Ae=null,Ce=null,Fe=!1,ze=!1;return typeof H=="string"&&(H=ue(H)),typeof H=="object"&&(K(H.r)&&K(H.g)&&K(H.b)?(ae=a(H.r,H.g,H.b),Fe=!0,ze=String(H.r).substr(-1)==="%"?"prgb":"rgb"):K(H.h)&&K(H.s)&&K(H.v)?(ve=ce(H.s),Ae=ce(H.v),ae=p(H.h,ve,Ae),Fe=!0,ze="hsv"):K(H.h)&&K(H.s)&&K(H.l)&&(ve=ce(H.s),Ce=ce(H.l),ae=f(H.h,ve,Ce),Fe=!0,ze="hsl"),H.hasOwnProperty("a")&&(ie=H.a)),ie=R(ie),{ok:Fe,format:H.format||ze,r:t(255,r(ae.r,0)),g:t(255,r(ae.g,0)),b:t(255,r(ae.b,0)),a:ie}}function a(H,ae,ie){return{r:U(H,255)*255,g:U(ae,255)*255,b:U(ie,255)*255}}function s(H,ae,ie){H=U(H,255),ae=U(ae,255),ie=U(ie,255);var ve=r(H,ae,ie),Ae=t(H,ae,ie),Ce,Fe,ze=(ve+Ae)/2;if(ve==Ae)Ce=Fe=0;else{var Ye=ve-Ae;switch(Fe=ze>.5?Ye/(2-ve-Ae):Ye/(ve+Ae),ve){case H:Ce=(ae-ie)/Ye+(ae1&&(nt-=1),nt<1/6?it+(st-it)*6*nt:nt<1/2?st:nt<2/3?it+(st-it)*(2/3-nt)*6:it}if(ae===0)ve=Ae=Ce=ie;else{var ze=ie<.5?ie*(1+ae):ie+ae-ie*ae,Ye=2*ie-ze;ve=Fe(Ye,ze,H+1/3),Ae=Fe(Ye,ze,H),Ce=Fe(Ye,ze,H-1/3)}return{r:ve*255,g:Ae*255,b:Ce*255}}function c(H,ae,ie){H=U(H,255),ae=U(ae,255),ie=U(ie,255);var ve=r(H,ae,ie),Ae=t(H,ae,ie),Ce,Fe,ze=ve,Ye=ve-Ae;if(Fe=ve===0?0:Ye/ve,ve==Ae)Ce=0;else{switch(ve){case H:Ce=(ae-ie)/Ye+(ae>1)+720)%360;--ae;)ve.h=(ve.h+Ae)%360,Ce.push(n(ve));return Ce}function z(H,ae){ae=ae||6;for(var ie=n(H).toHsv(),ve=ie.h,Ae=ie.s,Ce=ie.v,Fe=[],ze=1/ae;ae--;)Fe.push(n({h:ve,s:Ae,v:Ce})),Ce=(Ce+ze)%1;return Fe}n.mix=function(H,ae,ie){ie=ie===0?0:ie||50;var ve=n(H).toRgb(),Ae=n(ae).toRgb(),Ce=ie/100,Fe={r:(Ae.r-ve.r)*Ce+ve.r,g:(Ae.g-ve.g)*Ce+ve.g,b:(Ae.b-ve.b)*Ce+ve.b,a:(Ae.a-ve.a)*Ce+ve.a};return n(Fe)},n.readability=function(H,ae){var ie=n(H),ve=n(ae);return(h.max(ie.getLuminance(),ve.getLuminance())+.05)/(h.min(ie.getLuminance(),ve.getLuminance())+.05)},n.isReadable=function(H,ae,ie){var ve=n.readability(H,ae),Ae,Ce;switch(Ce=!1,Ae=te(ie),Ae.level+Ae.size){case"AAsmall":case"AAAlarge":Ce=ve>=4.5;break;case"AAlarge":Ce=ve>=3;break;case"AAAsmall":Ce=ve>=7;break}return Ce},n.mostReadable=function(H,ae,ie){var ve=null,Ae=0,Ce,Fe,ze,Ye;ie=ie||{},Fe=ie.includeFallbackColors,ze=ie.level,Ye=ie.size;for(var it=0;itAe&&(Ae=Ce,ve=n(ae[it]));return n.isReadable(H,ve,{level:ze,size:Ye})||!Fe?ve:(ie.includeFallbackColors=!1,n.mostReadable(H,["#fff","#000"],ie))};var F=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",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:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",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",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},N=n.hexNames=B(F);function B(H){var ae={};for(var ie in H)H.hasOwnProperty(ie)&&(ae[H[ie]]=ie);return ae}function R(H){return H=parseFloat(H),(isNaN(H)||H<0||H>1)&&(H=1),H}function U(H,ae){re(H)&&(H="100%");var ie=fe(H);return H=t(ae,r(0,parseFloat(H))),ie&&(H=parseInt(H*ae,10)/100),h.abs(H-ae)<1e-6?1:H%ae/parseFloat(ae)}function j(H){return t(1,r(0,H))}function Z(H){return parseInt(H,16)}function re(H){return typeof H=="string"&&H.indexOf(".")!=-1&&parseFloat(H)===1}function fe(H){return typeof H=="string"&&H.indexOf("%")!=-1}function le(H){return H.length==1?"0"+H:""+H}function ce(H){return H<=1&&(H=H*100+"%"),H}function V(H){return h.round(parseFloat(H)*255).toString(16)}function ee(H){return Z(H)/255}var ne=(function(){var H="[-\\+]?\\d+%?",ae="[-\\+]?\\d*\\.\\d+%?",ie="(?:"+ae+")|(?:"+H+")",ve="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?",Ae="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?";return{CSS_UNIT:new RegExp(ie),rgb:new RegExp("rgb"+ve),rgba:new RegExp("rgba"+Ae),hsl:new RegExp("hsl"+ve),hsla:new RegExp("hsla"+Ae),hsv:new RegExp("hsv"+ve),hsva:new RegExp("hsva"+Ae),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function K(H){return!!ne.CSS_UNIT.exec(H)}function ue(H){H=H.replace(b,"").replace(S,"").toLowerCase();var ae=!1;if(F[H])H=F[H],ae=!0;else if(H=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ie;return(ie=ne.rgb.exec(H))?{r:ie[1],g:ie[2],b:ie[3]}:(ie=ne.rgba.exec(H))?{r:ie[1],g:ie[2],b:ie[3],a:ie[4]}:(ie=ne.hsl.exec(H))?{h:ie[1],s:ie[2],l:ie[3]}:(ie=ne.hsla.exec(H))?{h:ie[1],s:ie[2],l:ie[3],a:ie[4]}:(ie=ne.hsv.exec(H))?{h:ie[1],s:ie[2],v:ie[3]}:(ie=ne.hsva.exec(H))?{h:ie[1],s:ie[2],v:ie[3],a:ie[4]}:(ie=ne.hex8.exec(H))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),a:ee(ie[4]),format:ae?"name":"hex8"}:(ie=ne.hex6.exec(H))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),format:ae?"name":"hex"}:(ie=ne.hex4.exec(H))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),a:ee(ie[4]+""+ie[4]),format:ae?"name":"hex8"}:(ie=ne.hex3.exec(H))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),format:ae?"name":"hex"}:!1}function te(H){var ae,ie;return H=H||{level:"AA",size:"small"},ae=(H.level||"AA").toUpperCase(),ie=(H.size||"small").toLowerCase(),ae!=="AA"&&ae!=="AAA"&&(ae="AA"),ie!=="small"&&ie!=="large"&&(ie="small"),{level:ae,size:ie}}typeof G<"u"&&G.exports?G.exports=n:window.tinycolor=n})(Math)}}),Qi=Ge({"src/lib/extend.js"($){var G=yo(),h=Array.isArray;function b(E,e){var t,r;for(t=0;t=0)))return n;if(c===3)s[c]>1&&(s[c]=1);else if(s[c]>=1)return n}var p=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return f?"rgba("+p+", "+s[3]+")":"rgb("+p+")"}}}),up=Ge({"src/constants/interactions.js"($,G){G.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),n0=Ge({"src/lib/regex.js"($){$.counter=function(G,h,b,S){var E=(h||"")+(b?"":"$"),e=S===!1?"":"^";return G==="xy"?new RegExp(e+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+E):new RegExp(e+G+"([2-9]|[1-9][0-9]+)?"+E)}}}),J_=Ge({"src/lib/coerce.js"($){var G=Ga(),h=ks(),b=Qi().extendFlat,S=nu(),E=r0(),e=So(),t=up().DESELECTDIM,r=Ll(),o=n0().counter,n=os().modHalf,i=ro().isArrayOrTypedArray,a=ro().isTypedArraySpec,s=ro().decodeTypedArraySpec;$.valObjectMeta={data_array:{coerceFunction:function(c,p,d){p.set(i(c)?c:a(c)?s(c):d)}},enumerated:{coerceFunction:function(c,p,d,T){T.coerceNumber&&(c=+c),T.values.indexOf(c)===-1?p.set(d):p.set(c)},validateFunction:function(c,p){p.coerceNumber&&(c=+c);for(var d=p.values,T=0;Tg===!0||g===!1;l(c)||T.arrayOk&&Array.isArray(c)&&c.length>0&&c.every(l)?p.set(c):p.set(d)}},number:{coerceFunction:function(c,p,d,T){a(c)&&(c=s(c)),!G(c)||T.min!==void 0&&cT.max?p.set(d):p.set(+c)}},integer:{coerceFunction:function(c,p,d,T){if((T.extras||[]).indexOf(c)!==-1){p.set(c);return}a(c)&&(c=s(c)),c%1||!G(c)||T.min!==void 0&&cT.max?p.set(d):p.set(+c)}},string:{coerceFunction:function(c,p,d,T){if(typeof c!="string"){var l=typeof c=="number";T.strict===!0||!l?p.set(d):p.set(String(c))}else T.noBlank&&!c?p.set(d):p.set(c)}},color:{coerceFunction:function(c,p,d){a(c)&&(c=s(c)),h(c).isValid()?p.set(c):p.set(d)}},colorlist:{coerceFunction:function(c,p,d){function T(l){return h(l).isValid()}!Array.isArray(c)||!c.length?p.set(d):c.every(T)?p.set(c):p.set(d)}},colorscale:{coerceFunction:function(c,p,d){p.set(E.get(c,d))}},angle:{coerceFunction:function(c,p,d){a(c)&&(c=s(c)),c==="auto"?p.set("auto"):G(c)?p.set(n(+c,360)):p.set(d)}},subplotid:{coerceFunction:function(c,p,d,T){var l=T.regex||o(d);const g=x=>typeof x=="string"&&l.test(x);g(c)||T.arrayOk&&i(c)&&c.length>0&&c.every(g)?p.set(c):p.set(d)},validateFunction:function(c,p){var d=p.dflt;return c===d?!0:typeof c!="string"?!1:!!o(d).test(c)}},flaglist:{coerceFunction:function(c,p,d,T){if((T.extras||[]).indexOf(c)!==-1){p.set(c);return}if(typeof c!="string"){p.set(d);return}for(var l=c.split("+"),g=0;g/g),c=0;c1){var e=["LOG:"];for(E=0;E1){var t=[];for(E=0;E"),"long")}},S.warn=function(){var E;if(h.logging>0){var e=["WARN:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}},S.error=function(){var E;if(h.logging>0){var e=["ERROR:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}}}}),Km=Ge({"src/lib/noop.js"($,G){G.exports=function(){}}}),Q_=Ge({"src/lib/push_unique.js"($,G){G.exports=function(b,S){if(S instanceof RegExp){for(var E=S.toString(),e=0;eao({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),$.texttemplateAttrs=({editType:E="calc",arrayOk:e}={},t={})=>ao({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),$.shapeTexttemplateAttrs=({editType:E="arraydraw",newshape:e}={},t={})=>({valType:"string",dflt:"",editType:E}),$.templatefallbackAttrs=({editType:E="none"}={})=>({valType:"any",dflt:"-",editType:E})}}),rd=Ge({"src/components/shapes/label_texttemplate.js"($,G){function h(g,x){return x?x.d2l(g):g}function b(g,x){return x?x.l2d(g):g}function S(g){return g.x0}function E(g){return g.x1}function e(g){return g.y0}function t(g){return g.y1}function r(g){return g.x0shift||0}function o(g){return g.x1shift||0}function n(g){return g.y0shift||0}function i(g){return g.y1shift||0}function a(g,x){return h(g.x1,x)+o(g)-h(g.x0,x)-r(g)}function s(g,x,A){return h(g.y1,A)+i(g)-h(g.y0,A)-n(g)}function f(g,x){return Math.abs(a(g,x))}function c(g,x,A){return Math.abs(s(g,x,A))}function p(g,x,A){return g.type!=="line"?void 0:Math.sqrt(Math.pow(a(g,x),2)+Math.pow(s(g,x,A),2))}function d(g,x){return b((h(g.x1,x)+o(g)+h(g.x0,x)+r(g))/2,x)}function T(g,x,A){return b((h(g.y1,A)+i(g)+h(g.y0,A)+n(g))/2,A)}function l(g,x,A){return g.type!=="line"?void 0:s(g,x,A)/a(g,x)}G.exports={x0:S,x1:E,y0:e,y1:t,slope:l,dx:a,dy:s,width:f,height:c,length:p,xcenter:d,ycenter:T}}}),Wg=Ge({"src/components/shapes/draw_newshape/attributes.js"($,G){var h=Uc().overrideAll,b=nu(),S=Fs(),E=hv().dash,e=Qi().extendFlat,{shapeTexttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=rd();G.exports=h({newshape:{visible:e({},b.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:e({},b.legend,{}),legendgroup:e({},b.legendgroup,{}),legendgrouptitle:{text:e({},b.legendgrouptitle.text,{}),font:S({})},legendrank:e({},b.legendrank,{}),legendwidth:e({},b.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:e({},E,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:e({},b.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:t({newshape:!0},{keys:Object.keys(o)}),texttemplatefallback:r({editType:"arraydraw"}),font:S({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),Bw=Ge({"src/components/selections/draw_newselection/attributes.js"($,G){var h=hv().dash,b=Qi().extendFlat;G.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:b({},h,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}}),Nw=Ge({"src/plots/pad_attributes.js"($,G){G.exports=function(h){var b=h.editType;return{t:{valType:"number",dflt:0,editType:b},r:{valType:"number",dflt:0,editType:b},b:{valType:"number",dflt:0,editType:b},l:{valType:"number",dflt:0,editType:b},editType:b}}}}),y1=Ge({"src/plots/layout_attributes.js"($,G){var h=Fs(),b=Zg(),S=rh(),E=Wg(),e=Bw(),t=Nw(),r=Qi().extendFlat,o=h({editType:"calc"});o.family.dflt='"Open Sans", verdana, arial, sans-serif',o.size.dflt=12,o.color.dflt=S.defaultLine,G.exports={font:o,title:{text:{valType:"string",editType:"layoutstyle"},font:h({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:h({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:r(t({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:S.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:S.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:S.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:E.newshape,activeshape:E.activeshape,newselection:e.newselection,activeselection:e.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:r({},b.transition,{editType:"none"})}}}),DT=Ge({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){(function(){if(!document.getElementById("696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97")){var $=document.createElement("style");$.id="696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97",$.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild($)}})()}}),Io=Ge({"src/registry.js"($){var G=cp(),h=Km(),b=Q_(),S=yo(),E=Yg().addStyleRule,e=Qi(),t=nu(),r=y1(),o=e.extendFlat,n=e.extendDeepAll;$.modules={},$.allCategories={},$.allTypes=[],$.subplotsRegistry={},$.componentsRegistry={},$.layoutArrayContainers=[],$.layoutArrayRegexes=[],$.traceLayoutAttributes={},$.localeRegistry={},$.apiMethodRegistry={},$.collectableSubplotTypes=null,$.register=function(x){if($.collectableSubplotTypes=null,x)x&&!Array.isArray(x)&&(x=[x]);else throw new Error("No argument passed to Plotly.register.");for(var A=0;A=l&&F<=g?F:e}if(typeof F!="string"&&typeof F!="number")return e;F=String(F);var j=d(N),Z=F.charAt(0);j&&(Z==="G"||Z==="g")&&(F=F.slice(1),N="");var re=j&&N.slice(0,7)==="chinese",fe=F.match(re?c:f);if(!fe)return e;var le=fe[1],ce=fe[3]||"1",V=Number(fe[5]||1),ee=Number(fe[7]||0),ne=Number(fe[9]||0),K=Number(fe[11]||0);if(j){if(le.length===2)return e;le=Number(le);var ue;try{var te=a.getComponentMethod("calendars","getCal")(N);if(re){var H=ce.charAt(ce.length-1)==="i";ce=parseInt(ce,10),ue=te.newDate(le,te.toMonthIndex(le,ce,H),V)}else ue=te.newDate(le,Number(ce),V)}catch{return e}return ue?(ue.toJD()-i)*t+ee*r+ne*o+K*n:e}le.length===2?le=(Number(le)+2e3-p)%100+p:le=Number(le),ce-=1;var ae=new Date(Date.UTC(2e3,ce,V,ee,ne));return ae.setUTCFullYear(le),ae.getUTCMonth()!==ce||ae.getUTCDate()!==V?e:ae.getTime()+K*n},l=$.MIN_MS=$.dateTime2ms("-9999"),g=$.MAX_MS=$.dateTime2ms("9999-12-31 23:59:59.9999"),$.isDateTime=function(F,N){return $.dateTime2ms(F,N)!==e};function x(F,N){return String(F+Math.pow(10,N)).slice(1)}var A=90*t,M=3*r,_=5*o;$.ms2DateTime=function(F,N,B){if(typeof F!="number"||!(F>=l&&F<=g))return e;N||(N=0);var R=Math.floor(S(F+.05,1)*10),U=Math.round(F-R/10),j,Z,re,fe,le,ce;if(d(B)){var V=Math.floor(U/t)+i,ee=Math.floor(S(F,t));try{j=a.getComponentMethod("calendars","getCal")(B).fromJD(V).formatDate("yyyy-mm-dd")}catch{j=s("G%Y-%m-%d")(new Date(U))}if(j.charAt(0)==="-")for(;j.length<11;)j="-0"+j.slice(1);else for(;j.length<10;)j="0"+j;Z=N=l+t&&F<=g-t))return e;var N=Math.floor(S(F+.05,1)*10),B=new Date(Math.round(F-N/10)),R=G("%Y-%m-%d")(B),U=B.getHours(),j=B.getMinutes(),Z=B.getSeconds(),re=B.getUTCMilliseconds()*10+N;return w(R,U,j,Z,re)};function w(F,N,B,R,U){if((N||B||R||U)&&(F+=" "+x(N,2)+":"+x(B,2),(R||U)&&(F+=":"+x(R,2),U))){for(var j=4;U%10===0;)j-=1,U/=10;F+="."+x(U,j)}return F}$.cleanDate=function(F,N,B){if(F===e)return N;if($.isJSDate(F)||typeof F=="number"&&isFinite(F)){if(d(B))return b.error("JS Dates and milliseconds are incompatible with world calendars",F),N;if(F=$.ms2DateTimeLocal(+F),!F&&N!==void 0)return N}else if(!$.isDateTime(F,B))return b.error("unrecognized date",F),N;return F};var m=/%\d?f/g,u=/%h/g,v={1:"1",2:"1",3:"2",4:"2"};function y(F,N,B,R){F=F.replace(m,function(j){var Z=Math.min(+j.charAt(1)||6,6),re=(N/1e3%1+2).toFixed(Z).slice(2).replace(/0+$/,"")||"0";return re});var U=new Date(Math.floor(N+.05));if(F=F.replace(u,function(){return v[B("%q")(U)]}),d(R))try{F=a.getComponentMethod("calendars","worldCalFmt")(F,N,R)}catch{return"Invalid"}return B(F)(U)}var I=[59,59.9,59.99,59.999,59.9999];function L(F,N){var B=S(F+.05,t),R=x(Math.floor(B/r),2)+":"+x(S(Math.floor(B/o),60),2);if(N!=="M"){h(N)||(N=0);var U=Math.min(S(F/n,60),I[N]),j=(100+U).toFixed(N).slice(1);N>0&&(j=j.replace(/0+$/,"").replace(/[\.]$/,"")),R+=":"+j}return R}$.formatDate=function(F,N,B,R,U,j){if(U=d(U)&&U,!N)if(B==="y")N=j.year;else if(B==="m")N=j.month;else if(B==="d")N=j.dayMonth+` +(function(){const Ke=document.createElement("link").relList;if(Ke&&Ke.supports&&Ke.supports("modulepreload"))return;for(const jt of document.querySelectorAll('link[rel="modulepreload"]'))lt(jt);new MutationObserver(jt=>{for(const Yt of jt)if(Yt.type==="childList")for(const hr of Yt.addedNodes)hr.tagName==="LINK"&&hr.rel==="modulepreload"&<(hr)}).observe(document,{childList:!0,subtree:!0});function ot(jt){const Yt={};return jt.integrity&&(Yt.integrity=jt.integrity),jt.referrerPolicy&&(Yt.referrerPolicy=jt.referrerPolicy),jt.crossOrigin==="use-credentials"?Yt.credentials="include":jt.crossOrigin==="anonymous"?Yt.credentials="omit":Yt.credentials="same-origin",Yt}function lt(jt){if(jt.ep)return;jt.ep=!0;const Yt=ot(jt);fetch(jt.href,Yt)}})();function qk(we){return we&&we.__esModule&&Object.prototype.hasOwnProperty.call(we,"default")?we.default:we}var G6={exports:{}},AT={};var I8;function jF(){if(I8)return AT;I8=1;var we=Symbol.for("react.transitional.element"),Ke=Symbol.for("react.fragment");function ot(lt,jt,Yt){var hr=null;if(Yt!==void 0&&(hr=""+Yt),jt.key!==void 0&&(hr=""+jt.key),"key"in jt){Yt={};for(var Mr in jt)Mr!=="key"&&(Yt[Mr]=jt[Mr])}else Yt=jt;return jt=Yt.ref,{$$typeof:we,type:lt,key:hr,ref:jt!==void 0?jt:null,props:Yt}}return AT.Fragment=Ke,AT.jsx=ot,AT.jsxs=ot,AT}var D8;function qF(){return D8||(D8=1,G6.exports=jF()),G6.exports}var ga=qF(),X6={exports:{}},ku={};var z8;function VF(){if(z8)return ku;z8=1;var we=Symbol.for("react.transitional.element"),Ke=Symbol.for("react.portal"),ot=Symbol.for("react.fragment"),lt=Symbol.for("react.strict_mode"),jt=Symbol.for("react.profiler"),Yt=Symbol.for("react.consumer"),hr=Symbol.for("react.context"),Mr=Symbol.for("react.forward_ref"),en=Symbol.for("react.suspense"),Br=Symbol.for("react.memo"),on=Symbol.for("react.lazy"),wn=Symbol.for("react.activity"),Wn=Symbol.iterator;function Bn(qa){return qa===null||typeof qa!="object"?null:(qa=Wn&&qa[Wn]||qa["@@iterator"],typeof qa=="function"?qa:null)}var Hi={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wo=Object.assign,Gi={};function hi(qa,ro,Jn){this.props=qa,this.context=ro,this.refs=Gi,this.updater=Jn||Hi}hi.prototype.isReactComponent={},hi.prototype.setState=function(qa,ro){if(typeof qa!="object"&&typeof qa!="function"&&qa!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,qa,ro,"setState")},hi.prototype.forceUpdate=function(qa){this.updater.enqueueForceUpdate(this,qa,"forceUpdate")};function Ge(){}Ge.prototype=hi.prototype;function Ao(qa,ro,Jn){this.props=qa,this.context=ro,this.refs=Gi,this.updater=Jn||Hi}var Ns=Ao.prototype=new Ge;Ns.constructor=Ao,wo(Ns,hi.prototype),Ns.isPureReactComponent=!0;var uo=Array.isArray;function di(){}var Eo={H:null,A:null,T:null,S:null},zs=Object.prototype.hasOwnProperty;function ki(qa,ro,Jn){var vs=Jn.ref;return{$$typeof:we,type:qa,key:ro,ref:vs!==void 0?vs:null,props:Jn}}function tl(qa,ro){return ki(qa.type,ro,qa.props)}function Bi(qa){return typeof qa=="object"&&qa!==null&&qa.$$typeof===we}function zo(qa){var ro={"=":"=0",":":"=2"};return"$"+qa.replace(/[=:]/g,function(Jn){return ro[Jn]})}var Ll=/\/+/g;function Ei(qa,ro){return typeof qa=="object"&&qa!==null&&qa.key!=null?zo(""+qa.key):ro.toString(36)}function Ii(qa){switch(qa.status){case"fulfilled":return qa.value;case"rejected":throw qa.reason;default:switch(typeof qa.status=="string"?qa.then(di,di):(qa.status="pending",qa.then(function(ro){qa.status==="pending"&&(qa.status="fulfilled",qa.value=ro)},function(ro){qa.status==="pending"&&(qa.status="rejected",qa.reason=ro)})),qa.status){case"fulfilled":return qa.value;case"rejected":throw qa.reason}}throw qa}function Ti(qa,ro,Jn,vs,Rs){var Ji=typeof qa;(Ji==="undefined"||Ji==="boolean")&&(qa=null);var Us=!1;if(qa===null)Us=!0;else switch(Ji){case"bigint":case"string":case"number":Us=!0;break;case"object":switch(qa.$$typeof){case we:case Ke:Us=!0;break;case on:return Us=qa._init,Ti(Us(qa._payload),ro,Jn,vs,Rs)}}if(Us)return Rs=Rs(qa),Us=vs===""?"."+Ei(qa,0):vs,uo(Rs)?(Jn="",Us!=null&&(Jn=Us.replace(Ll,"$&/")+"/"),Ti(Rs,ro,Jn,"",function(Od){return Od})):Rs!=null&&(Bi(Rs)&&(Rs=tl(Rs,Jn+(Rs.key==null||qa&&qa.key===Rs.key?"":(""+Rs.key).replace(Ll,"$&/")+"/")+Us)),ro.push(Rs)),1;Us=0;var ff=vs===""?".":vs+":";if(uo(qa))for(var cc=0;cc>>1,ba=Ti[bu];if(0>>1;bujt(Jn,ws))vsjt(Rs,Jn)?(Ti[bu]=Rs,Ti[vs]=ws,bu=vs):(Ti[bu]=Jn,Ti[ro]=ws,bu=ro);else if(vsjt(Rs,ws))Ti[bu]=Rs,Ti[vs]=ws,bu=vs;else break e}}return So}function jt(Ti,So){var ws=Ti.sortIndex-So.sortIndex;return ws!==0?ws:Ti.id-So.id}if(we.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var Yt=performance;we.unstable_now=function(){return Yt.now()}}else{var hr=Date,Mr=hr.now();we.unstable_now=function(){return hr.now()-Mr}}var en=[],Br=[],on=1,wn=null,Wn=3,Bn=!1,Hi=!1,wo=!1,Gi=!1,hi=typeof setTimeout=="function"?setTimeout:null,Ge=typeof clearTimeout=="function"?clearTimeout:null,Ao=typeof setImmediate<"u"?setImmediate:null;function Ns(Ti){for(var So=ot(Br);So!==null;){if(So.callback===null)lt(Br);else if(So.startTime<=Ti)lt(Br),So.sortIndex=So.expirationTime,Ke(en,So);else break;So=ot(Br)}}function uo(Ti){if(wo=!1,Ns(Ti),!Hi)if(ot(en)!==null)Hi=!0,di||(di=!0,zo());else{var So=ot(Br);So!==null&&Ii(uo,So.startTime-Ti)}}var di=!1,Eo=-1,zs=5,ki=-1;function tl(){return Gi?!0:!(we.unstable_now()-kiTi&&tl());){var bu=wn.callback;if(typeof bu=="function"){wn.callback=null,Wn=wn.priorityLevel;var ba=bu(wn.expirationTime<=Ti);if(Ti=we.unstable_now(),typeof ba=="function"){wn.callback=ba,Ns(Ti),So=!0;break t}wn===ot(en)&<(en),Ns(Ti)}else lt(en);wn=ot(en)}if(wn!==null)So=!0;else{var qa=ot(Br);qa!==null&&Ii(uo,qa.startTime-Ti),So=!1}}break e}finally{wn=null,Wn=ws,Bn=!1}So=void 0}}finally{So?zo():di=!1}}}var zo;if(typeof Ao=="function")zo=function(){Ao(Bi)};else if(typeof MessageChannel<"u"){var Ll=new MessageChannel,Ei=Ll.port2;Ll.port1.onmessage=Bi,zo=function(){Ei.postMessage(null)}}else zo=function(){hi(Bi,0)};function Ii(Ti,So){Eo=hi(function(){Ti(we.unstable_now())},So)}we.unstable_IdlePriority=5,we.unstable_ImmediatePriority=1,we.unstable_LowPriority=4,we.unstable_NormalPriority=3,we.unstable_Profiling=null,we.unstable_UserBlockingPriority=2,we.unstable_cancelCallback=function(Ti){Ti.callback=null},we.unstable_forceFrameRate=function(Ti){0>Ti||125bu?(Ti.sortIndex=ws,Ke(Br,Ti),ot(en)===null&&Ti===ot(Br)&&(wo?(Ge(Eo),Eo=-1):wo=!0,Ii(uo,ws-bu))):(Ti.sortIndex=ba,Ke(en,Ti),Hi||Bn||(Hi=!0,di||(di=!0,zo()))),Ti},we.unstable_shouldYield=tl,we.unstable_wrapCallback=function(Ti){var So=Wn;return function(){var ws=Wn;Wn=So;try{return Ti.apply(this,arguments)}finally{Wn=ws}}}})(W6)),W6}var B8;function GF(){return B8||(B8=1,Z6.exports=HF()),Z6.exports}var $6={exports:{}},Qv={};var N8;function XF(){if(N8)return Qv;N8=1;var we=bM();function Ke(en){var Br="https://react.dev/errors/"+en;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(we)}catch(Ke){console.error(Ke)}}return we(),$6.exports=XF(),$6.exports}var j8;function ZF(){if(j8)return ST;j8=1;var we=GF(),Ke=bM(),ot=YF();function lt(O){var W="https://react.dev/errors/"+O;if(1ba||(O.current=bu[ba],bu[ba]=null,ba--)}function Jn(O,W){ba++,bu[ba]=O.current,O.current=W}var vs=qa(null),Rs=qa(null),Ji=qa(null),Us=qa(null);function ff(O,W){switch(Jn(Ji,W),Jn(Rs,O),Jn(vs,null),W.nodeType){case 9:case 11:O=(O=W.documentElement)&&(O=O.namespaceURI)?x3(O):0;break;default:if(O=W.tagName,W=W.namespaceURI)W=x3(W),O=b3(W,O);else switch(O){case"svg":O=1;break;case"math":O=2;break;default:O=0}}ro(vs),Jn(vs,O)}function cc(){ro(vs),ro(Rs),ro(Ji)}function Od(O){O.memoizedState!==null&&Jn(Us,O);var W=vs.current,ve=b3(W,O.type);W!==ve&&(Jn(Rs,O),Jn(vs,ve))}function Jl(O){Rs.current===O&&(ro(vs),ro(Rs)),Us.current===O&&(ro(Us),qy._currentValue=ws)}var pp,Xf;function go(O){if(pp===void 0)try{throw Error()}catch(ve){var W=ve.stack.trim().match(/\n( *(at )?)/);pp=W&&W[1]||"",Xf=-1)":-1ht||Ma[Ie]!==Ai[ht]){var no=` +`+Ma[Ie].replace(" at new "," at ");return O.displayName&&no.includes("")&&(no=no.replace("",O.displayName)),no}while(1<=Ie&&0<=ht);break}}}finally{kv=!1,Error.prepareStackTrace=ve}return(ve=O?O.displayName||O.name:"")?go(ve):""}function $g(O,W){switch(O.tag){case 26:case 27:case 5:return go(O.type);case 16:return go("Lazy");case 13:return O.child!==W&&W!==null?go("Suspense Fallback"):go("Suspense");case 19:return go("SuspenseList");case 0:case 15:return mp(O.type,!1);case 11:return mp(O.type.render,!1);case 1:return mp(O.type,!0);case 31:return go("Activity");default:return""}}function al(O){try{var W="",ve=null;do W+=$g(O,ve),ve=O,O=O.return;while(O);return W}catch(Ie){return` +Error generating stack: `+Ie.message+` +`+Ie.stack}}var jl=Object.prototype.hasOwnProperty,Ql=we.unstable_scheduleCallback,Vu=we.unstable_cancelCallback,Wd=we.unstable_shouldYield,nm=we.unstable_requestPaint,$d=we.unstable_now,Uw=we.unstable_getCurrentPriorityLevel,oo=we.unstable_ImmediatePriority,us=we.unstable_UserBlockingPriority,au=we.unstable_NormalPriority,rc=we.unstable_LowPriority,Qc=we.unstable_IdlePriority,tp=we.log,C0=we.unstable_setDisableYieldValue,wv=null,pd=null;function Cv(O){if(typeof tp=="function"&&C0(O),pd&&typeof pd.setStrictMode=="function")try{pd.setStrictMode(wv,O)}catch{}}var If=Math.clz32?Math.clz32:MM,am=Math.log,zp=Math.LN2;function MM(O){return O>>>=0,O===0?32:31-(am(O)/zp|0)|0}var nx=256,ax=262144,ix=4194304;function eg(O){var W=O&42;if(W!==0)return W;switch(O&-O){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return O&261888;case 262144:case 524288:case 1048576:case 2097152:return O&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return O&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return O}}function ox(O,W,ve){var Ie=O.pendingLanes;if(Ie===0)return 0;var ht=0,Pt=O.suspendedLanes,Ir=O.pingedLanes;O=O.warmLanes;var Tn=Ie&134217727;return Tn!==0?(Ie=Tn&~Pt,Ie!==0?ht=eg(Ie):(Ir&=Tn,Ir!==0?ht=eg(Ir):ve||(ve=Tn&~O,ve!==0&&(ht=eg(ve))))):(Tn=Ie&~Pt,Tn!==0?ht=eg(Tn):Ir!==0?ht=eg(Ir):ve||(ve=Ie&~O,ve!==0&&(ht=eg(ve)))),ht===0?0:W!==0&&W!==ht&&(W&Pt)===0&&(Pt=ht&-ht,ve=W&-W,Pt>=ve||Pt===32&&(ve&4194048)!==0)?W:ht}function x1(O,W){return(O.pendingLanes&~(O.suspendedLanes&~O.pingedLanes)&W)===0}function EM(O,W){switch(O){case 1:case 2:case 4:case 8:case 64:return W+250;case 16:case 32: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 W+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jT(){var O=ix;return ix<<=1,(ix&62914560)===0&&(ix=4194304),O}function jw(O){for(var W=[],ve=0;31>ve;ve++)W.push(O);return W}function b1(O,W){O.pendingLanes|=W,W!==268435456&&(O.suspendedLanes=0,O.pingedLanes=0,O.warmLanes=0)}function kM(O,W,ve,Ie,ht,Pt){var Ir=O.pendingLanes;O.pendingLanes=ve,O.suspendedLanes=0,O.pingedLanes=0,O.warmLanes=0,O.expiredLanes&=ve,O.entangledLanes&=ve,O.errorRecoveryDisabledLanes&=ve,O.shellSuspendCounter=0;var Tn=O.entanglements,Ma=O.expirationTimes,Ai=O.hiddenUpdates;for(ve=Ir&~ve;0"u")return null;try{return O.activeElement||O.body}catch{return O.body}}var A1=/[\n"\\]/g;function yp(O){return O.replace(A1,function(W){return"\\"+W.charCodeAt(0).toString(16)+" "})}function cx(O,W,ve,Ie,ht,Pt,Ir,Tn){O.name="",Ir!=null&&typeof Ir!="function"&&typeof Ir!="symbol"&&typeof Ir!="boolean"?O.type=Ir:O.removeAttribute("type"),W!=null?Ir==="number"?(W===0&&O.value===""||O.value!=W)&&(O.value=""+gp(W)):O.value!==""+gp(W)&&(O.value=""+gp(W)):Ir!=="submit"&&Ir!=="reset"||O.removeAttribute("value"),W!=null?_u(O,Ir,gp(W)):ve!=null?_u(O,Ir,gp(ve)):Ie!=null&&O.removeAttribute("value"),ht==null&&Pt!=null&&(O.defaultChecked=!!Pt),ht!=null&&(O.checked=ht&&typeof ht!="function"&&typeof ht!="symbol"),Tn!=null&&typeof Tn!="function"&&typeof Tn!="symbol"&&typeof Tn!="boolean"?O.name=""+gp(Tn):O.removeAttribute("name")}function ry(O,W,ve,Ie,ht,Pt,Ir,Tn){if(Pt!=null&&typeof Pt!="function"&&typeof Pt!="symbol"&&typeof Pt!="boolean"&&(O.type=Pt),W!=null||ve!=null){if(!(Pt!=="submit"&&Pt!=="reset"||W!=null)){ux(O);return}ve=ve!=null?""+gp(ve):"",W=W!=null?""+gp(W):ve,Tn||W===O.value||(O.value=W),O.defaultValue=W}Ie=Ie??ht,Ie=typeof Ie!="function"&&typeof Ie!="symbol"&&!!Ie,O.checked=Tn?O.checked:!!Ie,O.defaultChecked=!!Ie,Ir!=null&&typeof Ir!="function"&&typeof Ir!="symbol"&&typeof Ir!="boolean"&&(O.name=Ir),ux(O)}function _u(O,W,ve){W==="number"&&D0(O.ownerDocument)===O||O.defaultValue===""+ve||(O.defaultValue=""+ve)}function sh(O,W,ve,Ie){if(O=O.options,W){W={};for(var ht=0;ht"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yd=!1;if(u0)try{var Fp={};Object.defineProperty(Fp,"passive",{get:function(){yd=!0}}),window.addEventListener("test",Fp,Fp),window.removeEventListener("test",Fp,Fp)}catch{yd=!1}var Pv=null,hx=null,yh=null;function WT(){if(yh)return yh;var O,W=hx,ve=W.length,Ie,ht="value"in Pv?Pv.value:Pv.textContent,Pt=ht.length;for(O=0;O=E1),k1=" ",px=!1;function mx(O,W){switch(O){case"keyup":return UM.indexOf(W.keyCode)!==-1;case"keydown":return W.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gx(O){return O=O.detail,typeof O=="object"&&"data"in O?O.data:null}var _p=!1;function Qw(O,W){switch(O){case"compositionend":return gx(W);case"keypress":return W.which!==32?null:(px=!0,k1);case"textInput":return O=W.data,O===k1&&px?null:O;default:return null}}function o5(O,W){if(_p)return O==="compositionend"||!Jw&&mx(O,W)?(O=WT(),yh=hx=Pv=null,_p=!1,O):null;switch(O){case"paste":return null;case"keypress":if(!(W.ctrlKey||W.altKey||W.metaKey)||W.ctrlKey&&W.altKey){if(W.char&&1=W)return{node:ve,offset:W-O};O=Ie}e:{for(;ve;){if(ve.nextSibling){ve=ve.nextSibling;break e}ve=ve.parentNode}ve=void 0}ve=c5(ve)}}function h5(O,W){return O&&W?O===W?!0:O&&O.nodeType===3?!1:W&&W.nodeType===3?h5(O,W.parentNode):"contains"in O?O.contains(W):O.compareDocumentPosition?!!(O.compareDocumentPosition(W)&16):!1:!1}function d5(O){O=O!=null&&O.ownerDocument!=null&&O.ownerDocument.defaultView!=null?O.ownerDocument.defaultView:window;for(var W=D0(O.document);W instanceof O.HTMLIFrameElement;){try{var ve=typeof W.contentWindow.location.href=="string"}catch{ve=!1}if(ve)O=W.contentWindow;else break;W=D0(O.document)}return W}function ny(O){var W=O&&O.nodeName&&O.nodeName.toLowerCase();return W&&(W==="input"&&(O.type==="text"||O.type==="search"||O.type==="tel"||O.type==="url"||O.type==="password")||W==="textarea"||O.contentEditable==="true")}var HM=u0&&"documentMode"in document&&11>=document.documentMode,ay=null,xx=null,hm=null,dm=!1;function c0(O,W,ve){var Ie=ve.window===ve?ve.document:ve.nodeType===9?ve:ve.ownerDocument;dm||ay==null||ay!==D0(Ie)||(Ie=ay,"selectionStart"in Ie&&ny(Ie)?Ie={start:Ie.selectionStart,end:Ie.selectionEnd}:(Ie=(Ie.ownerDocument&&Ie.ownerDocument.defaultView||window).getSelection(),Ie={anchorNode:Ie.anchorNode,anchorOffset:Ie.anchorOffset,focusNode:Ie.focusNode,focusOffset:Ie.focusOffset}),hm&&L1(hm,Ie)||(hm=Ie,Ie=m_(xx,"onSelect"),0>=Ir,ht-=Ir,Zf=1<<32-If(W)+ht|ve<xu?(Yu=js,js=null):Yu=js.sibling;var Ic=Pi(si,js,xi[xu],ao);if(Ic===null){js===null&&(js=Yu);break}O&&js&&Ic.alternate===null&&W(si,js),Xa=Pt(Ic,Xa,xu),bc===null?bl=Ic:bc.sibling=Ic,bc=Ic,js=Yu}if(xu===xi.length)return ve(si,js),Hu&&Ph(si,xu),bl;if(js===null){for(;xuxu?(Yu=js,js=null):Yu=js.sibling;var Nm=Pi(si,js,Ic.value,ao);if(Nm===null){js===null&&(js=Yu);break}O&&js&&Nm.alternate===null&&W(si,js),Xa=Pt(Nm,Xa,xu),bc===null?bl=Nm:bc.sibling=Nm,bc=Nm,js=Yu}if(Ic.done)return ve(si,js),Hu&&Ph(si,xu),bl;if(js===null){for(;!Ic.done;xu++,Ic=xi.next())Ic=co(si,Ic.value,ao),Ic!==null&&(Xa=Pt(Ic,Xa,xu),bc===null?bl=Ic:bc.sibling=Ic,bc=Ic);return Hu&&Ph(si,xu),bl}for(js=Ie(js);!Ic.done;xu++,Ic=xi.next())Ic=Ui(js,si,xu,Ic.value,ao),Ic!==null&&(O&&Ic.alternate!==null&&js.delete(Ic.key===null?xu:Ic.key),Xa=Pt(Ic,Xa,xu),bc===null?bl=Ic:bc.sibling=Ic,bc=Ic);return O&&js.forEach(function(xE){return W(si,xE)}),Hu&&Ph(si,xu),bl}function Sf(si,Xa,xi,ao){if(typeof xi=="object"&&xi!==null&&xi.type===wo&&xi.key===null&&(xi=xi.props.children),typeof xi=="object"&&xi!==null){switch(xi.$$typeof){case Bn:e:{for(var bl=xi.key;Xa!==null;){if(Xa.key===bl){if(bl=xi.type,bl===wo){if(Xa.tag===7){ve(si,Xa.sibling),ao=ht(Xa,xi.props.children),ao.return=si,si=ao;break e}}else if(Xa.elementType===bl||typeof bl=="object"&&bl!==null&&bl.$$typeof===zs&&vg(bl)===Xa.type){ve(si,Xa.sibling),ao=ht(Xa,xi.props),N1(ao,xi),ao.return=si,si=ao;break e}ve(si,Xa);break}else W(si,Xa);Xa=Xa.sibling}xi.type===wo?(ao=vm(xi.props.children,si.mode,ao,xi.key),ao.return=si,si=ao):(ao=O0(xi.type,xi.key,xi.props,null,si.mode,ao),N1(ao,xi),ao.return=si,si=ao)}return Ir(si);case Hi:e:{for(bl=xi.key;Xa!==null;){if(Xa.key===bl)if(Xa.tag===4&&Xa.stateNode.containerInfo===xi.containerInfo&&Xa.stateNode.implementation===xi.implementation){ve(si,Xa.sibling),ao=ht(Xa,xi.children||[]),ao.return=si,si=ao;break e}else{ve(si,Xa);break}else W(si,Xa);Xa=Xa.sibling}ao=sp(xi,si.mode,ao),ao.return=si,si=ao}return Ir(si);case zs:return xi=vg(xi),Sf(si,Xa,xi,ao)}if(Ii(xi))return $s(si,Xa,xi,ao);if(zo(xi)){if(bl=zo(xi),typeof bl!="function")throw Error(lt(150));return xi=bl.call(xi),ql(si,Xa,xi,ao)}if(typeof xi.then=="function")return Sf(si,Xa,Px(xi),ao);if(xi.$$typeof===Ao)return Sf(si,Xa,Mx(si,xi),ao);Cc(si,xi)}return typeof xi=="string"&&xi!==""||typeof xi=="number"||typeof xi=="bigint"?(xi=""+xi,Xa!==null&&Xa.tag===6?(ve(si,Xa.sibling),ao=ht(Xa,xi),ao.return=si,si=ao):(ve(si,Xa),ao=u2(xi,si.mode,ao),ao.return=si,si=ao),Ir(si)):ve(si,Xa)}return function(si,Xa,xi,ao){try{B1=0;var bl=Sf(si,Xa,xi,ao);return dy=null,bl}catch(js){if(js===ym||js===hy)throw js;var bc=Qd(29,js,null,si.mode);return bc.lanes=ao,bc.return=si,bc}}}var _m=y2(!0),M5=y2(!1),U0=!1;function _2(O){O.updateQueue={baseState:O.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function x2(O,W){O=O.updateQueue,W.updateQueue===O&&(W.updateQueue={baseState:O.baseState,firstBaseUpdate:O.firstBaseUpdate,lastBaseUpdate:O.lastBaseUpdate,shared:O.shared,callbacks:null})}function xm(O){return{lane:O,tag:0,payload:null,callback:null,next:null}}function bm(O,W,ve){var Ie=O.updateQueue;if(Ie===null)return null;if(Ie=Ie.shared,(Pc&2)!==0){var ht=Ie.pending;return ht===null?W.next=W:(W.next=ht.next,ht.next=W),Ie.pending=W,W=Ax(O),Vp(O,null,ve),W}return Tx(O,Ie,W,ve),Ax(O)}function U1(O,W,ve){if(W=W.updateQueue,W!==null&&(W=W.shared,(ve&4194048)!==0)){var Ie=W.lanes;Ie&=O.pendingLanes,ve|=Ie,W.lanes=ve,qw(O,ve)}}function b2(O,W){var ve=O.updateQueue,Ie=O.alternate;if(Ie!==null&&(Ie=Ie.updateQueue,ve===Ie)){var ht=null,Pt=null;if(ve=ve.firstBaseUpdate,ve!==null){do{var Ir={lane:ve.lane,tag:ve.tag,payload:ve.payload,callback:null,next:null};Pt===null?ht=Pt=Ir:Pt=Pt.next=Ir,ve=ve.next}while(ve!==null);Pt===null?ht=Pt=W:Pt=Pt.next=W}else ht=Pt=W;ve={baseState:Ie.baseState,firstBaseUpdate:ht,lastBaseUpdate:Pt,shared:Ie.shared,callbacks:Ie.callbacks},O.updateQueue=ve;return}O=ve.lastBaseUpdate,O===null?ve.firstBaseUpdate=W:O.next=W,ve.lastBaseUpdate=W}var w2=!1;function j1(){if(w2){var O=fy;if(O!==null)throw O}}function q1(O,W,ve,Ie){w2=!1;var ht=O.updateQueue;U0=!1;var Pt=ht.firstBaseUpdate,Ir=ht.lastBaseUpdate,Tn=ht.shared.pending;if(Tn!==null){ht.shared.pending=null;var Ma=Tn,Ai=Ma.next;Ma.next=null,Ir===null?Pt=Ai:Ir.next=Ai,Ir=Ma;var no=O.alternate;no!==null&&(no=no.updateQueue,Tn=no.lastBaseUpdate,Tn!==Ir&&(Tn===null?no.firstBaseUpdate=Ai:Tn.next=Ai,no.lastBaseUpdate=Ma))}if(Pt!==null){var co=ht.baseState;Ir=0,no=Ai=Ma=null,Tn=Pt;do{var Pi=Tn.lane&-536870913,Ui=Pi!==Tn.lane;if(Ui?(ic&Pi)===Pi:(Ie&Pi)===Pi){Pi!==0&&Pi===dg&&(w2=!0),no!==null&&(no=no.next={lane:0,tag:Tn.tag,payload:Tn.payload,callback:null,next:null});e:{var $s=O,ql=Tn;Pi=W;var Sf=ve;switch(ql.tag){case 1:if($s=ql.payload,typeof $s=="function"){co=$s.call(Sf,co,Pi);break e}co=$s;break e;case 3:$s.flags=$s.flags&-65537|128;case 0:if($s=ql.payload,Pi=typeof $s=="function"?$s.call(Sf,co,Pi):$s,Pi==null)break e;co=wn({},co,Pi);break e;case 2:U0=!0}}Pi=Tn.callback,Pi!==null&&(O.flags|=64,Ui&&(O.flags|=8192),Ui=ht.callbacks,Ui===null?ht.callbacks=[Pi]:Ui.push(Pi))}else Ui={lane:Pi,tag:Tn.tag,payload:Tn.payload,callback:Tn.callback,next:null},no===null?(Ai=no=Ui,Ma=co):no=no.next=Ui,Ir|=Pi;if(Tn=Tn.next,Tn===null){if(Tn=ht.shared.pending,Tn===null)break;Ui=Tn,Tn=Ui.next,Ui.next=null,ht.lastBaseUpdate=Ui,ht.shared.pending=null}}while(!0);no===null&&(Ma=co),ht.baseState=Ma,ht.firstBaseUpdate=Ai,ht.lastBaseUpdate=no,Pt===null&&(ht.shared.lanes=0),Z0|=Ir,O.lanes=Ir,O.memoizedState=co}}function E5(O,W){if(typeof O!="function")throw Error(lt(191,O));O.call(W)}function T2(O,W){var ve=O.callbacks;if(ve!==null)for(O.callbacks=null,O=0;OPt?Pt:8;var Ir=Ti.T,Tn={};Ti.T=Tn,K1(O,!1,W,ve);try{var Ma=ht(),Ai=Ti.S;if(Ai!==null&&Ai(Tn,Ma),Ma!==null&&typeof Ma=="object"&&typeof Ma.then=="function"){var no=$M(Ma,Ie);_y(O,W,no,hv(O))}else _y(O,W,Ie,hv(O))}catch(co){_y(O,W,{then:function(){},status:"rejected",reason:co},hv())}finally{So.p=Pt,Ir!==null&&Tn.types!==null&&(Ir.types=Tn.types),Ti.T=Ir}}function tb(){}function rb(O,W,ve,Ie){if(O.tag!==5)throw Error(lt(476));var ht=$1(O).queue;D2(O,ht,W,ws,ve===null?tb:function(){return z2(O),ve(Ie)})}function $1(O){var W=O.memoizedState;if(W!==null)return W;W={memoizedState:ws,baseState:ws,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:v0,lastRenderedState:ws},next:null};var ve={};return W.next={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:v0,lastRenderedState:ve},next:null},O.memoizedState=W,O=O.alternate,O!==null&&(O.memoizedState=W),W}function z2(O){var W=$1(O);W.next===null&&(W=O.alternate.memoizedState),_y(O,W.next.queue,{},hv())}function nb(){return jd(qy)}function B5(){return bh().memoizedState}function O2(){return bh().memoizedState}function N5(O){for(var W=O.return;W!==null;){switch(W.tag){case 24:case 3:var ve=hv();O=xm(ve);var Ie=bm(W,O,ve);Ie!==null&&(Nv(Ie,W,ve),U1(Ie,W,ve)),W={cache:p2()},O.payload=W;return}W=W.return}}function U5(O,W,ve){var Ie=hv();ve={lane:Ie,revertLane:0,gesture:null,action:ve,hasEagerState:!1,eagerState:null,next:null},xy(O)?F2(W,ve):(ve=l2(O,W,ve,Ie),ve!==null&&(Nv(ve,O,Ie),j5(ve,W,Ie)))}function ab(O,W,ve){var Ie=hv();_y(O,W,ve,Ie)}function _y(O,W,ve,Ie){var ht={lane:Ie,revertLane:0,gesture:null,action:ve,hasEagerState:!1,eagerState:null,next:null};if(xy(O))F2(W,ht);else{var Pt=O.alternate;if(O.lanes===0&&(Pt===null||Pt.lanes===0)&&(Pt=W.lastRenderedReducer,Pt!==null))try{var Ir=W.lastRenderedState,Tn=Pt(Ir,ve);if(ht.hasEagerState=!0,ht.eagerState=Tn,np(Tn,Ir))return Tx(O,W,ht,0),Of===null&&R1(),!1}catch{}if(ve=l2(O,W,ht,Ie),ve!==null)return Nv(ve,O,Ie),j5(ve,W,Ie),!0}return!1}function K1(O,W,ve,Ie){if(Ie={lane:2,revertLane:Iy(),gesture:null,action:Ie,hasEagerState:!1,eagerState:null,next:null},xy(O)){if(W)throw Error(lt(479))}else W=l2(O,ve,Ie,2),W!==null&&Nv(W,O,2)}function xy(O){var W=O.alternate;return O===su||W!==null&&W===su}function F2(O,W){my=Tm=!0;var ve=O.pending;ve===null?W.next=W:(W.next=ve.next,ve.next=W),O.pending=W}function j5(O,W,ve){if((ve&4194048)!==0){var Ie=W.lanes;Ie&=O.pendingLanes,ve|=Ie,W.lanes=ve,qw(O,ve)}}var J1={readContext:jd,use:zx,useCallback:xh,useContext:xh,useEffect:xh,useImperativeHandle:xh,useLayoutEffect:xh,useInsertionEffect:xh,useMemo:xh,useReducer:xh,useRef:xh,useState:xh,useDebugValue:xh,useDeferredValue:xh,useTransition:xh,useSyncExternalStore:xh,useId:xh,useHostTransitionStatus:xh,useFormState:xh,useActionState:xh,useOptimistic:xh,useMemoCache:xh,useCacheRefresh:xh};J1.useEffectEvent=xh;var B2={readContext:jd,use:zx,useCallback:function(O,W){return bd().memoizedState=[O,W===void 0?null:W],O},useContext:jd,useEffect:$x,useImperativeHandle:function(O,W,ve){ve=ve!=null?ve.concat([O]):null,Zx(4194308,4,Jx.bind(null,W,O),ve)},useLayoutEffect:function(O,W){return Zx(4194308,4,O,W)},useInsertionEffect:function(O,W){Zx(4,2,O,W)},useMemo:function(O,W){var ve=bd();W=W===void 0?null:W;var Ie=O();if(mg){Cv(!0);try{O()}finally{Cv(!1)}}return ve.memoizedState=[Ie,W],Ie},useReducer:function(O,W,ve){var Ie=bd();if(ve!==void 0){var ht=ve(W);if(mg){Cv(!0);try{ve(W)}finally{Cv(!1)}}}else ht=W;return Ie.memoizedState=Ie.baseState=ht,O={pending:null,lanes:0,dispatch:null,lastRenderedReducer:O,lastRenderedState:ht},Ie.queue=O,O=O.dispatch=U5.bind(null,su,O),[Ie.memoizedState,O]},useRef:function(O){var W=bd();return O={current:O},W.memoizedState=O},useState:function(O){O=X1(O);var W=O.queue,ve=ab.bind(null,su,W);return W.dispatch=ve,[O.memoizedState,ve]},useDebugValue:Qx,useDeferredValue:function(O,W){var ve=bd();return W1(ve,O,W)},useTransition:function(){var O=X1(!1);return O=D2.bind(null,su,O.queue,!0,!1),bd().memoizedState=O,[!1,O]},useSyncExternalStore:function(O,W,ve){var Ie=su,ht=bd();if(Hu){if(ve===void 0)throw Error(lt(407));ve=ve()}else{if(ve=W(),Of===null)throw Error(lt(349));(ic&127)!==0||Nx(Ie,W,ve)}ht.memoizedState=ve;var Pt={value:ve,getSnapshot:W};return ht.queue=Pt,$x(jx.bind(null,Ie,Pt,O),[O]),Ie.flags|=2048,yy(9,{destroy:void 0},Ux.bind(null,Ie,Pt,ve,W),null),ve},useId:function(){var O=bd(),W=Of.identifierPrefix;if(Hu){var ve=bp,Ie=Zf;ve=(Ie&~(1<<32-If(Ie)-1)).toString(32)+ve,W="_"+W+"R_"+ve,ve=gg++,0<\/script>",Pt=Pt.removeChild(Pt.firstChild);break;case"select":Pt=typeof Ie.is=="string"?Ir.createElement("select",{is:Ie.is}):Ir.createElement("select"),Ie.multiple?Pt.multiple=!0:Ie.size&&(Pt.size=Ie.size);break;default:Pt=typeof Ie.is=="string"?Ir.createElement(ht,{is:Ie.is}):Ir.createElement(ht)}}Pt[Sl]=W,Pt[lv]=Ie;e:for(Ir=W.child;Ir!==null;){if(Ir.tag===5||Ir.tag===6)Pt.appendChild(Ir.stateNode);else if(Ir.tag!==4&&Ir.tag!==27&&Ir.child!==null){Ir.child.return=Ir,Ir=Ir.child;continue}if(Ir===W)break e;for(;Ir.sibling===null;){if(Ir.return===null||Ir.return===W)break e;Ir=Ir.return}Ir.sibling.return=Ir.return,Ir=Ir.sibling}W.stateNode=Pt;e:switch(cd(Pt,ht,Ie),ht){case"button":case"input":case"select":case"textarea":Ie=!!Ie.autoFocus;break e;case"img":Ie=!0;break e;default:Ie=!1}Ie&&p0(W)}}return eh(W),Q2(W,W.type,O===null?null:O.memoizedProps,W.pendingProps,ve),null;case 6:if(O&&W.stateNode!=null)O.memoizedProps!==Ie&&p0(W);else{if(typeof Ie!="string"&&W.stateNode===null)throw Error(lt(166));if(O=Ji.current,uy(W)){if(O=W.stateNode,ve=W.memoizedProps,Ie=null,ht=Ud,ht!==null)switch(ht.tag){case 27:case 5:Ie=ht.memoizedProps}O[Sl]=W,O=!!(O.nodeValue===ve||Ie!==null&&Ie.suppressHydrationWarning===!0||Sb(O.nodeValue,ve)),O||pm(W,!0)}else O=Uv(O).createTextNode(Ie),O[Sl]=W,W.stateNode=O}return eh(W),null;case 31:if(ve=W.memoizedState,O===null||O.memoizedState!==null){if(Ie=uy(W),ve!==null){if(O===null){if(!Ie)throw Error(lt(318));if(O=W.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(lt(557));O[Sl]=W}else B0(),(W.flags&128)===0&&(W.memoizedState=null),W.flags|=4;eh(W),O=!1}else ve=f2(),O!==null&&O.memoizedState!==null&&(O.memoizedState.hydrationErrors=ve),O=!0;if(!O)return W.flags&256?(cp(W),W):(cp(W),null);if((W.flags&128)!==0)throw Error(lt(558))}return eh(W),null;case 13:if(Ie=W.memoizedState,O===null||O.memoizedState!==null&&O.memoizedState.dehydrated!==null){if(ht=uy(W),Ie!==null&&Ie.dehydrated!==null){if(O===null){if(!ht)throw Error(lt(318));if(ht=W.memoizedState,ht=ht!==null?ht.dehydrated:null,!ht)throw Error(lt(317));ht[Sl]=W}else B0(),(W.flags&128)===0&&(W.memoizedState=null),W.flags|=4;eh(W),ht=!1}else ht=f2(),O!==null&&O.memoizedState!==null&&(O.memoizedState.hydrationErrors=ht),ht=!0;if(!ht)return W.flags&256?(cp(W),W):(cp(W),null)}return cp(W),(W.flags&128)!==0?(W.lanes=ve,W):(ve=Ie!==null,O=O!==null&&O.memoizedState!==null,ve&&(Ie=W.child,ht=null,Ie.alternate!==null&&Ie.alternate.memoizedState!==null&&Ie.alternate.memoizedState.cachePool!==null&&(ht=Ie.alternate.memoizedState.cachePool.pool),Pt=null,Ie.memoizedState!==null&&Ie.memoizedState.cachePool!==null&&(Pt=Ie.memoizedState.cachePool.pool),Pt!==ht&&(Ie.flags|=2048)),ve!==O&&ve&&(W.child.flags|=8192),hb(W,W.updateQueue),eh(W),null);case 4:return cc(),O===null&&Fy(W.stateNode.containerInfo),eh(W),null;case 10:return Yp(W.type),eh(W),null;case 19:if(ro(fc),Ie=W.memoizedState,Ie===null)return eh(W),null;if(ht=(W.flags&128)!==0,Pt=Ie.rendering,Pt===null)if(ht)e_(Ie,!1);else{if(Ih!==0||O!==null&&(O.flags&128)!==0)for(O=W.child;O!==null;){if(Pt=py(O),Pt!==null){for(W.flags|=128,e_(Ie,!1),O=Pt.updateQueue,W.updateQueue=O,hb(W,O),W.subtreeFlags=0,O=ve,ve=W.child;ve!==null;)g5(ve,O),ve=ve.sibling;return Jn(fc,fc.current&1|2),Hu&&Ph(W,Ie.treeForkCount),W.child}O=O.sibling}Ie.tail!==null&&$d()>pb&&(W.flags|=128,ht=!0,e_(Ie,!1),W.lanes=4194304)}else{if(!ht)if(O=py(Pt),O!==null){if(W.flags|=128,ht=!0,O=O.updateQueue,W.updateQueue=O,hb(W,O),e_(Ie,!0),Ie.tail===null&&Ie.tailMode==="hidden"&&!Pt.alternate&&!Hu)return eh(W),null}else 2*$d()-Ie.renderingStartTime>pb&&ve!==536870912&&(W.flags|=128,ht=!0,e_(Ie,!1),W.lanes=4194304);Ie.isBackwards?(Pt.sibling=W.child,W.child=Pt):(O=Ie.last,O!==null?O.sibling=Pt:W.child=Pt,Ie.last=Pt)}return Ie.tail!==null?(O=Ie.tail,Ie.rendering=O,Ie.tail=O.sibling,Ie.renderingStartTime=$d(),O.sibling=null,ve=fc.current,Jn(fc,ht?ve&1|2:ve&1),Hu&&Ph(W,Ie.treeForkCount),O):(eh(W),null);case 22:case 23:return cp(W),wm(),Ie=W.memoizedState!==null,O!==null?O.memoizedState!==null!==Ie&&(W.flags|=8192):Ie&&(W.flags|=8192),Ie?(ve&536870912)!==0&&(W.flags&128)===0&&(eh(W),W.subtreeFlags&6&&(W.flags|=8192)):eh(W),ve=W.updateQueue,ve!==null&&hb(W,ve.retryQueue),ve=null,O!==null&&O.memoizedState!==null&&O.memoizedState.cachePool!==null&&(ve=O.memoizedState.cachePool.pool),Ie=null,W.memoizedState!==null&&W.memoizedState.cachePool!==null&&(Ie=W.memoizedState.cachePool.pool),Ie!==ve&&(W.flags|=2048),O!==null&&ro(gm),null;case 24:return ve=null,O!==null&&(ve=O.memoizedState.cache),W.memoizedState.cache!==ve&&(W.flags|=2048),Yp(od),eh(W),null;case 25:return null;case 30:return null}throw Error(lt(156,W.tag))}function nE(O,W){switch(ug(W),W.tag){case 1:return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 3:return Yp(od),cc(),O=W.flags,(O&65536)!==0&&(O&128)===0?(W.flags=O&-65537|128,W):null;case 26:case 27:case 5:return Jl(W),null;case 31:if(W.memoizedState!==null){if(cp(W),W.alternate===null)throw Error(lt(340));B0()}return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 13:if(cp(W),O=W.memoizedState,O!==null&&O.dehydrated!==null){if(W.alternate===null)throw Error(lt(340));B0()}return O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 19:return ro(fc),null;case 4:return cc(),null;case 10:return Yp(W.type),null;case 22:case 23:return cp(W),wm(),O!==null&&ro(gm),O=W.flags,O&65536?(W.flags=O&-65537|128,W):null;case 24:return Yp(od),null;case 25:return null;default:return null}}function oA(O,W){switch(ug(W),W.tag){case 3:Yp(od),cc();break;case 26:case 27:case 5:Jl(W);break;case 4:cc();break;case 31:W.memoizedState!==null&&cp(W);break;case 13:cp(W);break;case 19:ro(fc);break;case 10:Yp(W.type);break;case 22:case 23:cp(W),wm(),O!==null&&ro(gm);break;case 24:Yp(od)}}function t_(O,W){try{var ve=W.updateQueue,Ie=ve!==null?ve.lastEffect:null;if(Ie!==null){var ht=Ie.next;ve=ht;do{if((ve.tag&O)===O){Ie=void 0;var Pt=ve.create,Ir=ve.inst;Ie=Pt(),Ir.destroy=Ie}ve=ve.next}while(ve!==ht)}}catch(Tn){hf(W,W.return,Tn)}}function wp(O,W,ve){try{var Ie=W.updateQueue,ht=Ie!==null?Ie.lastEffect:null;if(ht!==null){var Pt=ht.next;Ie=Pt;do{if((Ie.tag&O)===O){var Ir=Ie.inst,Tn=Ir.destroy;if(Tn!==void 0){Ir.destroy=void 0,ht=W;var Ma=ve,Ai=Tn;try{Ai()}catch(no){hf(ht,Ma,no)}}}Ie=Ie.next}while(Ie!==Pt)}}catch(no){hf(W,W.return,no)}}function e3(O){var W=O.updateQueue;if(W!==null){var ve=O.stateNode;try{T2(W,ve)}catch(Ie){hf(O,O.return,Ie)}}}function sA(O,W,ve){ve.props=_g(O.type,O.memoizedProps),ve.state=O.memoizedState;try{ve.componentWillUnmount()}catch(Ie){hf(O,W,Ie)}}function Tp(O,W){try{var ve=O.ref;if(ve!==null){switch(O.tag){case 26:case 27:case 5:var Ie=O.stateNode;break;case 30:Ie=O.stateNode;break;default:Ie=O.stateNode}typeof ve=="function"?O.refCleanup=ve(Ie):ve.current=Ie}}catch(ht){hf(O,W,ht)}}function Wp(O,W){var ve=O.ref,Ie=O.refCleanup;if(ve!==null)if(typeof Ie=="function")try{Ie()}catch(ht){hf(O,W,ht)}finally{O.refCleanup=null,O=O.alternate,O!=null&&(O.refCleanup=null)}else if(typeof ve=="function")try{ve(null)}catch(ht){hf(O,W,ht)}else ve.current=null}function lA(O){var W=O.type,ve=O.memoizedProps,Ie=O.stateNode;try{e:switch(W){case"button":case"input":case"select":case"textarea":ve.autoFocus&&Ie.focus();break e;case"img":ve.src?Ie.src=ve.src:ve.srcSet&&(Ie.srcset=ve.srcSet)}}catch(ht){hf(O,O.return,ht)}}function t3(O,W,ve){try{var Ie=O.stateNode;_3(Ie,O.type,ve,W),Ie[lv]=W}catch(ht){hf(O,O.return,ht)}}function xg(O){return O.tag===5||O.tag===3||O.tag===26||O.tag===27&&b0(O.type)||O.tag===4}function r_(O){e:for(;;){for(;O.sibling===null;){if(O.return===null||xg(O.return))return null;O=O.return}for(O.sibling.return=O.return,O=O.sibling;O.tag!==5&&O.tag!==6&&O.tag!==18;){if(O.tag===27&&b0(O.type)||O.flags&2||O.child===null||O.tag===4)continue e;O.child.return=O,O=O.child}if(!(O.flags&2))return O.stateNode}}function wy(O,W,ve){var Ie=O.tag;if(Ie===5||Ie===6)O=O.stateNode,W?(ve.nodeType===9?ve.body:ve.nodeName==="HTML"?ve.ownerDocument.body:ve).insertBefore(O,W):(W=ve.nodeType===9?ve.body:ve.nodeName==="HTML"?ve.ownerDocument.body:ve,W.appendChild(O),ve=ve._reactRootContainer,ve!=null||W.onclick!==null||(W.onclick=mc));else if(Ie!==4&&(Ie===27&&b0(O.type)&&(ve=O.stateNode,W=null),O=O.child,O!==null))for(wy(O,W,ve),O=O.sibling;O!==null;)wy(O,W,ve),O=O.sibling}function n_(O,W,ve){var Ie=O.tag;if(Ie===5||Ie===6)O=O.stateNode,W?ve.insertBefore(O,W):ve.appendChild(O);else if(Ie!==4&&(Ie===27&&b0(O.type)&&(ve=O.stateNode),O=O.child,O!==null))for(n_(O,W,ve),O=O.sibling;O!==null;)n_(O,W,ve),O=O.sibling}function uA(O){var W=O.stateNode,ve=O.memoizedProps;try{for(var Ie=O.type,ht=W.attributes;ht.length;)W.removeAttributeNode(ht[0]);cd(W,Ie,ve),W[Sl]=O,W[lv]=ve}catch(Pt){hf(O,O.return,Pt)}}var H0=!1,ld=!1,r3=!1,n3=typeof WeakSet=="function"?WeakSet:Set,Rh=null;function aE(O,W){if(O=O.containerInfo,K0=C_,O=d5(O),ny(O)){if("selectionStart"in O)var ve={start:O.selectionStart,end:O.selectionEnd};else e:{ve=(ve=O.ownerDocument)&&ve.defaultView||window;var Ie=ve.getSelection&&ve.getSelection();if(Ie&&Ie.rangeCount!==0){ve=Ie.anchorNode;var ht=Ie.anchorOffset,Pt=Ie.focusNode;Ie=Ie.focusOffset;try{ve.nodeType,Pt.nodeType}catch{ve=null;break e}var Ir=0,Tn=-1,Ma=-1,Ai=0,no=0,co=O,Pi=null;t:for(;;){for(var Ui;co!==ve||ht!==0&&co.nodeType!==3||(Tn=Ir+ht),co!==Pt||Ie!==0&&co.nodeType!==3||(Ma=Ir+Ie),co.nodeType===3&&(Ir+=co.nodeValue.length),(Ui=co.firstChild)!==null;)Pi=co,co=Ui;for(;;){if(co===O)break t;if(Pi===ve&&++Ai===ht&&(Tn=Ir),Pi===Pt&&++no===Ie&&(Ma=Ir),(Ui=co.nextSibling)!==null)break;co=Pi,Pi=co.parentNode}co=Ui}ve=Tn===-1||Ma===-1?null:{start:Tn,end:Ma}}else ve=null}ve=ve||{start:0,end:0}}else ve=null;for(Dm={focusedElem:O,selectionRange:ve},C_=!1,Rh=W;Rh!==null;)if(W=Rh,O=W.child,(W.subtreeFlags&1028)!==0&&O!==null)O.return=W,Rh=O;else for(;Rh!==null;){switch(W=Rh,Pt=W.alternate,O=W.flags,W.tag){case 0:if((O&4)!==0&&(O=W.updateQueue,O=O!==null?O.events:null,O!==null))for(ve=0;ve title"))),cd(Pt,Ie,ve),Pt[Sl]=O,Fd(Pt),Ie=Pt;break e;case"link":var Ir=GA("link","href",ht).get(Ie+(ve.href||""));if(Ir){for(var Tn=0;TnSf&&(Ir=Sf,Sf=ql,ql=Ir);var si=f5(Tn,ql),Xa=f5(Tn,Sf);if(si&&Xa&&(Ui.rangeCount!==1||Ui.anchorNode!==si.node||Ui.anchorOffset!==si.offset||Ui.focusNode!==Xa.node||Ui.focusOffset!==Xa.offset)){var xi=co.createRange();xi.setStart(si.node,si.offset),Ui.removeAllRanges(),ql>Sf?(Ui.addRange(xi),Ui.extend(Xa.node,Xa.offset)):(xi.setEnd(Xa.node,Xa.offset),Ui.addRange(xi))}}}}for(co=[],Ui=Tn;Ui=Ui.parentNode;)Ui.nodeType===1&&co.push({element:Ui,left:Ui.scrollLeft,top:Ui.scrollTop});for(typeof Tn.focus=="function"&&Tn.focus(),Tn=0;Tnve?32:ve,Ti.T=null,ve=u3,u3=null;var Pt=Lm,Ir=W0;if(ud=0,Tg=Lm=null,W0=0,(Pc&6)!==0)throw Error(lt(331));var Tn=Pc;if(Pc|=4,Sy(Pt.current),mA(Pt,Pt.current,Ir,ve),Pc=Tn,u_(0,!1),pd&&typeof pd.onPostCommitFiberRoot=="function")try{pd.onPostCommitFiberRoot(wv,Pt)}catch{}return!0}finally{So.p=ht,Ti.T=Ie,IA(O,W)}}function zA(O,W,ve){W=Lh(ve,W),W=q0(O.stateNode,W,2),O=bm(O,W,2),O!==null&&(b1(O,2),_0(O))}function hf(O,W,ve){if(O.tag===3)zA(O,O,ve);else for(;W!==null;){if(W.tag===3){zA(W,O,ve);break}else if(W.tag===1){var Ie=W.stateNode;if(typeof W.type.getDerivedStateFromError=="function"||typeof Ie.componentDidCatch=="function"&&(Sp===null||!Sp.has(Ie))){O=Lh(ve,O),ve=Z5(2),Ie=bm(W,ve,2),Ie!==null&&(W5(ve,Ie,W,O),b1(Ie,2),_0(Ie));break}}W=W.return}}function h3(O,W,ve){var Ie=O.pingCache;if(Ie===null){Ie=O.pingCache=new _A;var ht=new Set;Ie.set(W,ht)}else ht=Ie.get(W),ht===void 0&&(ht=new Set,Ie.set(W,ht));ht.has(ve)||(km=!0,ht.add(ve),O=fE.bind(null,O,W,ve),W.then(O,O))}function fE(O,W,ve){var Ie=O.pingCache;Ie!==null&&Ie.delete(W),O.pingedLanes|=O.suspendedLanes&ve,O.warmLanes&=~ve,Of===O&&(ic&ve)===ve&&(Ih===4||Ih===3&&(ic&62914560)===ic&&300>$d()-o_?(Pc&2)===0&&ky(O,0):l3|=ve,Cm===ic&&(Cm=0)),_0(O)}function OA(O,W){W===0&&(W=jT()),O=qp(O,W),O!==null&&(b1(O,W),_0(O))}function Ly(O){var W=O.memoizedState,ve=0;W!==null&&(ve=W.retryLane),OA(O,ve)}function Py(O,W){var ve=0;switch(O.tag){case 31:case 13:var Ie=O.stateNode,ht=O.memoizedState;ht!==null&&(ve=ht.retryLane);break;case 19:Ie=O.stateNode;break;case 22:Ie=O.stateNode._retryCache;break;default:throw Error(lt(314))}Ie!==null&&Ie.delete(W),OA(O,ve)}function d3(O,W){return Ql(O,W)}var wb=null,y0=null,v3=!1,Ry=!1,p3=!1,Rm=0;function _0(O){O!==y0&&O.next===null&&(y0===null?wb=y0=O:y0=y0.next=O),Ry=!0,v3||(v3=!0,dE())}function u_(O,W){if(!p3&&Ry){p3=!0;do for(var ve=!1,Ie=wb;Ie!==null;){if(O!==0){var ht=Ie.pendingLanes;if(ht===0)var Pt=0;else{var Ir=Ie.suspendedLanes,Tn=Ie.pingedLanes;Pt=(1<<31-If(42|O)+1)-1,Pt&=ht&~(Ir&~Tn),Pt=Pt&201326741?Pt&201326741|1:Pt?Pt|2:0}Pt!==0&&(ve=!0,FA(Ie,Pt))}else Pt=ic,Pt=ox(Ie,Ie===Of?Pt:0,Ie.cancelPendingCommit!==null||Ie.timeoutHandle!==-1),(Pt&3)===0||x1(Ie,Pt)||(ve=!0,FA(Ie,Pt));Ie=Ie.next}while(ve);p3=!1}}function hE(){m3()}function m3(){Ry=v3=!1;var O=0;Rm!==0&&jA()&&(O=Rm);for(var W=$d(),ve=null,Ie=wb;Ie!==null;){var ht=Ie.next,Pt=c_(Ie,W);Pt===0?(Ie.next=null,ve===null?wb=ht:ve.next=ht,ht===null&&(y0=ve)):(ve=Ie,(O!==0||(Pt&3)!==0)&&(Ry=!0)),Ie=ht}ud!==0&&ud!==5||u_(O),Rm!==0&&(Rm=0)}function c_(O,W){for(var ve=O.suspendedLanes,Ie=O.pingedLanes,ht=O.expirationTimes,Pt=O.pendingLanes&-62914561;0Tn)break;var no=Ma.transferSize,co=Ma.initiatorType;no&&$0(co)&&(Ma=Ma.responseEnd,Ir+=no*(Ma"u"?null:document;function Ib(O,W,ve){var Ie=Ny;if(Ie&&typeof W=="string"&&W){var ht=yp(W);ht='link[rel="'+O+'"][href="'+ht+'"]',typeof ve=="string"&&(ht+='[crossorigin="'+ve+'"]'),Rb.has(ht)||(Rb.add(ht),O={rel:O,crossOrigin:ve,href:W},Ie.querySelector(ht)===null&&(W=Ie.createElement("link"),cd(W,"link",O),Fd(W),Ie.head.appendChild(W)))}}function kg(O){Qp.D(O),Ib("dns-prefetch",O,null)}function C3(O,W){Qp.C(O,W),Ib("preconnect",O,W)}function Db(O,W,ve){Qp.L(O,W,ve);var Ie=Ny;if(Ie&&O&&W){var ht='link[rel="preload"][as="'+yp(W)+'"]';W==="image"&&ve&&ve.imageSrcSet?(ht+='[imagesrcset="'+yp(ve.imageSrcSet)+'"]',typeof ve.imageSizes=="string"&&(ht+='[imagesizes="'+yp(ve.imageSizes)+'"]')):ht+='[href="'+yp(O)+'"]';var Pt=ht;switch(W){case"style":Pt=zm(O);break;case"script":Pt=Lg(O)}qv.has(Pt)||(O=wn({rel:"preload",href:W==="image"&&ve&&ve.imageSrcSet?void 0:O,as:W},ve),qv.set(Pt,O),Ie.querySelector(ht)!==null||W==="style"&&Ie.querySelector(b_(Pt))||W==="script"&&Ie.querySelector(Pg(Pt))||(W=Ie.createElement("link"),cd(W,"link",O),Fd(W),Ie.head.appendChild(W)))}}function zb(O,W){Qp.m(O,W);var ve=Ny;if(ve&&O){var Ie=W&&typeof W.as=="string"?W.as:"script",ht='link[rel="modulepreload"][as="'+yp(Ie)+'"][href="'+yp(O)+'"]',Pt=ht;switch(Ie){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":Pt=Lg(O)}if(!qv.has(Pt)&&(O=wn({rel:"modulepreload",href:O},W),qv.set(Pt,O),ve.querySelector(ht)===null)){switch(Ie){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(ve.querySelector(Pg(Pt)))return}Ie=ve.createElement("link"),cd(Ie,"link",O),Fd(Ie),ve.head.appendChild(Ie)}}}function x_(O,W,ve){Qp.S(O,W,ve);var Ie=Ny;if(Ie&&O){var ht=ey(Ie).hoistableStyles,Pt=zm(O);W=W||"default";var Ir=ht.get(Pt);if(!Ir){var Tn={loading:0,preload:null};if(Ir=Ie.querySelector(b_(Pt)))Tn.loading=5;else{O=wn({rel:"stylesheet",href:O,"data-precedence":W},ve),(ve=qv.get(Pt))&&Rg(O,ve);var Ma=Ir=Ie.createElement("link");Fd(Ma),cd(Ma,"link",O),Ma._p=new Promise(function(Ai,no){Ma.onload=Ai,Ma.onerror=no}),Ma.addEventListener("load",function(){Tn.loading|=1}),Ma.addEventListener("error",function(){Tn.loading|=2}),Tn.loading|=4,w_(Ir,W,Ie)}Ir={type:"stylesheet",instance:Ir,count:1,state:Tn},ht.set(Pt,Ir)}}}function Uy(O,W){Qp.X(O,W);var ve=Ny;if(ve&&O){var Ie=ey(ve).hoistableScripts,ht=Lg(O),Pt=Ie.get(ht);Pt||(Pt=ve.querySelector(Pg(ht)),Pt||(O=wn({src:O,async:!0},W),(W=qv.get(ht))&&Fb(O,W),Pt=ve.createElement("script"),Fd(Pt),cd(Pt,"link",O),ve.head.appendChild(Pt)),Pt={type:"script",instance:Pt,count:1,state:null},Ie.set(ht,Pt))}}function L3(O,W){Qp.M(O,W);var ve=Ny;if(ve&&O){var Ie=ey(ve).hoistableScripts,ht=Lg(O),Pt=Ie.get(ht);Pt||(Pt=ve.querySelector(Pg(ht)),Pt||(O=wn({src:O,async:!0,type:"module"},W),(W=qv.get(ht))&&Fb(O,W),Pt=ve.createElement("script"),Fd(Pt),cd(Pt,"link",O),ve.head.appendChild(Pt)),Pt={type:"script",instance:Pt,count:1,state:null},Ie.set(ht,Pt))}}function Ob(O,W,ve,Ie){var ht=(ht=Ji.current)?T0(ht):null;if(!ht)throw Error(lt(446));switch(O){case"meta":case"title":return null;case"style":return typeof ve.precedence=="string"&&typeof ve.href=="string"?(W=zm(ve.href),ve=ey(ht).hoistableStyles,Ie=ve.get(W),Ie||(Ie={type:"style",instance:null,count:0,state:null},ve.set(W,Ie)),Ie):{type:"void",instance:null,count:0,state:null};case"link":if(ve.rel==="stylesheet"&&typeof ve.href=="string"&&typeof ve.precedence=="string"){O=zm(ve.href);var Pt=ey(ht).hoistableStyles,Ir=Pt.get(O);if(Ir||(ht=ht.ownerDocument||ht,Ir={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},Pt.set(O,Ir),(Pt=ht.querySelector(b_(O)))&&!Pt._p&&(Ir.instance=Pt,Ir.state.loading=5),qv.has(O)||(ve={rel:"preload",as:"style",href:ve.href,crossOrigin:ve.crossOrigin,integrity:ve.integrity,media:ve.media,hrefLang:ve.hrefLang,referrerPolicy:ve.referrerPolicy},qv.set(O,ve),Pt||HA(ht,O,ve,Ir.state))),W&&Ie===null)throw Error(lt(528,""));return Ir}if(W&&Ie!==null)throw Error(lt(529,""));return null;case"script":return W=ve.async,ve=ve.src,typeof ve=="string"&&W&&typeof W!="function"&&typeof W!="symbol"?(W=Lg(ve),ve=ey(ht).hoistableScripts,Ie=ve.get(W),Ie||(Ie={type:"script",instance:null,count:0,state:null},ve.set(W,Ie)),Ie):{type:"void",instance:null,count:0,state:null};default:throw Error(lt(444,O))}}function zm(O){return'href="'+yp(O)+'"'}function b_(O){return'link[rel="stylesheet"]['+O+"]"}function Cg(O){return wn({},O,{"data-precedence":O.precedence,precedence:null})}function HA(O,W,ve,Ie){O.querySelector('link[rel="preload"][as="style"]['+W+"]")?Ie.loading=1:(W=O.createElement("link"),Ie.preload=W,W.addEventListener("load",function(){return Ie.loading|=1}),W.addEventListener("error",function(){return Ie.loading|=2}),cd(W,"link",ve),Fd(W),O.head.appendChild(W))}function Lg(O){return'[src="'+yp(O)+'"]'}function Pg(O){return"script[async]"+O}function P3(O,W,ve){if(W.count++,W.instance===null)switch(W.type){case"style":var Ie=O.querySelector('style[data-href~="'+yp(ve.href)+'"]');if(Ie)return W.instance=Ie,Fd(Ie),Ie;var ht=wn({},ve,{"data-href":ve.href,"data-precedence":ve.precedence,href:null,precedence:null});return Ie=(O.ownerDocument||O).createElement("style"),Fd(Ie),cd(Ie,"style",ht),w_(Ie,ve.precedence,O),W.instance=Ie;case"stylesheet":ht=zm(ve.href);var Pt=O.querySelector(b_(ht));if(Pt)return W.state.loading|=4,W.instance=Pt,Fd(Pt),Pt;Ie=Cg(ve),(ht=qv.get(ht))&&Rg(Ie,ht),Pt=(O.ownerDocument||O).createElement("link"),Fd(Pt);var Ir=Pt;return Ir._p=new Promise(function(Tn,Ma){Ir.onload=Tn,Ir.onerror=Ma}),cd(Pt,"link",Ie),W.state.loading|=4,w_(Pt,ve.precedence,O),W.instance=Pt;case"script":return Pt=Lg(ve.src),(ht=O.querySelector(Pg(Pt)))?(W.instance=ht,Fd(ht),ht):(Ie=ve,(ht=qv.get(Pt))&&(Ie=wn({},ve),Fb(Ie,ht)),O=O.ownerDocument||O,ht=O.createElement("script"),Fd(ht),cd(ht,"link",Ie),O.head.appendChild(ht),W.instance=ht);case"void":return null;default:throw Error(lt(443,W.type))}else W.type==="stylesheet"&&(W.state.loading&4)===0&&(Ie=W.instance,W.state.loading|=4,w_(Ie,ve.precedence,O));return W.instance}function w_(O,W,ve){for(var Ie=ve.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),ht=Ie.length?Ie[Ie.length-1]:null,Pt=ht,Ir=0;Ir title"):null)}function gE(O,W,ve){if(ve===1||W.itemProp!=null)return!1;switch(O){case"meta":case"title":return!0;case"style":if(typeof W.precedence!="string"||typeof W.href!="string"||W.href==="")break;return!0;case"link":if(typeof W.rel!="string"||typeof W.href!="string"||W.href===""||W.onLoad||W.onError)break;return W.rel==="stylesheet"?(O=W.disabled,typeof W.precedence=="string"&&O==null):!0;case"script":if(W.async&&typeof W.async!="function"&&typeof W.async!="symbol"&&!W.onLoad&&!W.onError&&W.src&&typeof W.src=="string")return!0}return!1}function Td(O){return!(O.type==="stylesheet"&&(O.state.loading&3)===0)}function jy(O,W,ve,Ie){if(ve.type==="stylesheet"&&(typeof Ie.media!="string"||matchMedia(Ie.media).matches!==!1)&&(ve.state.loading&4)===0){if(ve.instance===null){var ht=zm(Ie.href),Pt=W.querySelector(b_(ht));if(Pt){W=Pt._p,W!==null&&typeof W=="object"&&typeof W.then=="function"&&(O.count++,O=S_.bind(O),W.then(O,O)),ve.state.loading|=4,ve.instance=Pt,Fd(Pt);return}Pt=W.ownerDocument||W,Ie=Cg(Ie),(ht=qv.get(ht))&&Rg(Ie,ht),Pt=Pt.createElement("link"),Fd(Pt);var Ir=Pt;Ir._p=new Promise(function(Tn,Ma){Ir.onload=Tn,Ir.onerror=Ma}),cd(Pt,"link",Ie),ve.instance=Pt}O.stylesheets===null&&(O.stylesheets=new Map),O.stylesheets.set(ve,W),(W=ve.state.preload)&&(ve.state.loading&3)===0&&(O.count++,ve=S_.bind(O),W.addEventListener("load",ve),W.addEventListener("error",ve))}}var Bb=0;function Nb(O,W){return O.stylesheets&&O.count===0&&E_(O,O.stylesheets),0Bb?50:800)+W);return O.unsuspend=ve,function(){O.unsuspend=null,clearTimeout(Ie),clearTimeout(ht)}}:null}function S_(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)E_(this,this.stylesheets);else if(this.unsuspend){var O=this.unsuspend;this.unsuspend=null,O()}}}var M_=null;function E_(O,W){O.stylesheets=null,O.unsuspend!==null&&(O.count++,M_=new Map,W.forEach(R3,O),M_=null,S_.call(O))}function R3(O,W){if(!(W.state.loading&4)){var ve=M_.get(O);if(ve)var Ie=ve.get(null);else{ve=new Map,M_.set(O,ve);for(var ht=O.querySelectorAll("link[data-precedence],style[data-precedence]"),Pt=0;Pt"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(we)}catch(Ke){console.error(Ke)}}return we(),Y6.exports=ZF(),Y6.exports}var $F=WF();const KF=we=>we?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function JF(we,Ke,ot=[]){if(Ke==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:KF(we),size:24,node:Ke,...ot.length>0?{aliases:ot}:{}}}const QF=we=>{let Ke="",ot=!1;for(const lt of we){if(lt==="-"||lt==="_"||lt<=" "){ot=Ke.length>0;continue}Ke.length===0?Ke+=lt.toLowerCase():Ke+=ot?lt.toUpperCase():lt,ot=!1}return Ke};const eB=we=>{const Ke=QF(we);return Ke.charAt(0).toUpperCase()+Ke.slice(1)};const Tk=(...we)=>we.filter((Ke,ot,lt)=>!!Ke&&Ke.trim()!==""&<.indexOf(Ke)===ot).join(" ").trim();const ex={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function K6(we){return we!=null}function tB(we,Ke={}){const ot=Ke.attributeNames??{},lt=Wn=>ot[Wn]??Wn,jt=we.size??we.width??ex.width,Yt=we.size??we.height??ex.height,hr=we.aliases?.filter(Wn=>typeof Wn=="string"&&Wn.trim()!=="").map(Wn=>`lucide-${Wn}`)??[],Mr=[...we.name?[`lucide-${we.name}`]:[],...hr],en=Ke.className?.split(" ").filter(Boolean)??[],Br=Ke.includeDefaultClasses===!1?Tk(...en):Tk("lucide",...Mr,...en),on=Ke.absoluteStrokeWidth?Number(Ke.strokeWidth??ex["stroke-width"])*Number(we.size??we.width??ex.width)/Number(Ke.size??Ke.width??ex.width):Ke.strokeWidth??ex["stroke-width"];return["svg",{...Object.entries(ex).reduce((Wn,[Bn,Hi])=>(Wn[lt(Bn)]=Hi,Wn),{}),..."color"in Ke&&Ke.color&&{[lt("stroke")]:Ke.color},..."size"in Ke&&K6(Ke.size)&&{[lt("width")]:Ke.size,[lt("height")]:Ke.size},..."width"in Ke&&K6(Ke.width)&&{[lt("width")]:Ke.width},..."height"in Ke&&K6(Ke.height)&&{[lt("height")]:Ke.height},[lt("stroke-width")]:on,...Br&&{[lt("class")]:Br},[lt("viewBox")]:`0 0 ${jt} ${Yt}`,...Ke.hasA11yProp===!1?{[lt("aria-hidden")]:"true"}:{},..."attributes"in Ke&&Ke.attributes},we.node.map(Wn=>{const[Bn,Hi,wo]=Wn,Gi=Ke.nonScalingStroke?{[lt("vector-effect")]:"non-scaling-stroke",...Hi}:Hi;return wo?[Bn,Gi,wo]:[Bn,Gi]})]}function rB(we,Ke={}){return tB(we,{...Ke,attributeNames:{...Ke.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const nB=we=>{for(const Ke in we)if(Ke.startsWith("aria-")||Ke==="role"||Ke==="title")return!0;return!1},aB=Bl.createContext({}),iB=()=>Bl.useContext(aB),oB=Bl.forwardRef(({color:we,size:Ke,width:ot,height:lt,strokeWidth:jt,absoluteStrokeWidth:Yt,nonScalingStroke:hr,className:Mr="",children:en,iconNode:Br=[],icon:on={node:Br,aliases:[],size:24},...wn},Wn)=>{const{size:Bn=24,strokeWidth:Hi=2,absoluteStrokeWidth:wo=!1,nonScalingStroke:Gi=!1,color:hi="currentColor",className:Ge=""}=iB()??{},Ao=!!en||nB(wn),[Ns,uo,di=[]]=rB(on,{color:we??hi,width:ot??Ke??Bn,height:lt??Ke??Bn,strokeWidth:jt??Hi,absoluteStrokeWidth:Yt??wo,nonScalingStroke:hr??Gi,className:Tk(Ge,Mr),hasA11yProp:Ao,attributes:wn});return Bl.createElement(Ns,{ref:Wn,...uo},[...di.map(([Eo,zs])=>Bl.createElement(Eo,zs)),...Array.isArray(en)?en:[en]])});function Ip(we,Ke=[],ot=[]){const lt=typeof we=="string"?JF(we,Ke,ot):we,jt=Bl.forwardRef(({className:Yt,...hr},Mr)=>Bl.createElement(oB,{ref:Mr,icon:lt,className:Yt,...hr}));return lt.name&&(jt.displayName=eB(lt.name)),jt}const W4={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};W4.node;const sB=Ip(W4);const $4={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};$4.node;const lB=Ip($4);const K4={name:"dices",size:24,node:[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]};K4.node;const uB=Ip(K4);const J4={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};J4.node;const cB=Ip(J4);const Q4={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};Q4.node;const fB=Ip(Q4);const eP={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};eP.node;const hB=Ip(eP);const tP={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};tP.node;const dB=Ip(tP);const rP={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};rP.node;const vB=Ip(rP);const nP={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};nP.node;const pB=Ip(nP);const aP={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};aP.node;const dM=Ip(aP);const iP={name:"step-back",size:24,node:[["path",{d:"M13.971 4.285A2 2 0 0 1 17 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z",key:"19qhus"}],["path",{d:"M21 20V4",key:"cb8qj8"}]]};iP.node;const mB=Ip(iP);const oP={name:"step-forward",size:24,node:[["path",{d:"M10.029 4.285A2 2 0 0 0 7 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"1ystz2"}],["path",{d:"M3 4v16",key:"1ph11n"}]]};oP.node;const gB=Ip(oP);const sP={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};sP.node;const yB=Ip(sP);const lP={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};lP.node;const uP=Ip(lP);function Vk({title:we,open:Ke,onClose:ot,wide:lt=!1,children:jt}){const Yt=Bl.useRef(null);return Bl.useEffect(()=>{const hr=Yt.current;Ke&&!hr?.open?hr?.showModal():!Ke&&hr?.open&&hr.close()},[Ke]),ga.jsxs("dialog",{ref:Yt,"aria-label":we,onClose:ot,onClick:hr=>hr.target===Yt.current&&ot(),className:`m-auto ${lt?"w-[min(72rem,calc(100vw-2rem))]":"w-[min(48rem,calc(100vw-2rem))]"} max-h-[85dvh] p-0 bg-surface border-[1.5px] border-ink rounded-md text-ink backdrop:bg-ink/40 dark:backdrop:bg-black/60`,children:[ga.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b border-grid bg-surface pl-5 pr-2 py-1",children:[ga.jsx("h2",{className:"text-lg font-semibold",children:we}),ga.jsx("button",{type:"button",onClick:ot,"aria-label":`Close ${we}`,className:"flex items-center justify-center size-11 shrink-0 rounded cursor-pointer hover:bg-paper",children:ga.jsx(uP,{size:18,"aria-hidden":!0})})]}),ga.jsx("div",{className:"p-5",children:jt})]})}const _B="https://huggingface.co/spaces/elvis-hf/homepage",cP="elvis-theme",Ak=new Set;function xB(){try{const we=localStorage.getItem(cP);if(we==="light"||we==="dark")return we}catch{}return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}document.documentElement.dataset.theme=xB();function bB(){return document.documentElement.dataset.theme==="dark"?"dark":"light"}function wB(we){document.documentElement.dataset.theme=we;try{localStorage.setItem(cP,we)}catch{}Ak.forEach(Ke=>Ke())}function TB(we){return Ak.add(we),()=>Ak.delete(we)}function wM(){return Bl.useSyncExternalStore(TB,bB)}function vM(we,Ke){return Ke==="dark"&&we.toUpperCase()==="#000000"?"#E4E9F2":we}function Iw(we,Ke){return Ke==="dark"&&we==="Black"?"White":we}const V8="bg-surface border-[1.5px] border-ink rounded-md",Sk="flex items-center gap-2 h-11 px-3.5 text-sm font-medium bg-surface border-[1.5px] border-ink rounded cursor-pointer hover:bg-paper";function AB({title:we,tabs:Ke,panel:ot,footer:lt,usage:jt,examples:Yt,homeUrl:hr=_B,children:Mr}){const[en,Br]=Bl.useState(0),on=wM(),wn=on==="dark"?"light":"dark";return Bl.useEffect(()=>{window.dispatchEvent(new Event("resize"))},[en]),ga.jsxs("div",{className:"flex flex-col gap-5 p-4 lg:p-7 lg:h-dvh mx-auto w-full lg:max-w-[calc(100dvh-44px+24rem)]",children:[ga.jsxs("header",{className:"flex flex-wrap items-center gap-3",children:[ga.jsxs("h1",{className:"mr-auto flex items-baseline gap-3 text-2xl lg:text-3xl font-bold tracking-tight",children:[ga.jsx("span",{className:"px-1 bg-[linear-gradient(transparent_58%,var(--color-marker-band)_58%,var(--color-marker-band)_92%,transparent_92%)]",children:"ELVIS"}),ga.jsx("span",{className:"font-normal text-ink-muted",children:"—"}),ga.jsx("span",{className:"font-semibold",children:we})]}),jt&&ga.jsx(H8,{label:"Usage",icon:sB,children:jt}),Yt&&ga.jsx(H8,{label:"Examples",icon:hB,children:Yt}),ga.jsxs("a",{href:hr,target:"_blank",rel:"noopener noreferrer",className:Sk,children:[ga.jsx(cB,{size:16,"aria-hidden":!0}),"Home"]}),ga.jsx("button",{type:"button",onClick:()=>wB(wn),"aria-label":`Switch to ${wn} mode`,title:`Switch to ${wn} mode`,className:`${Sk} w-11 justify-center px-0`,children:on==="dark"?ga.jsx(yB,{size:16,"aria-hidden":!0}):ga.jsx(dB,{size:16,"aria-hidden":!0})})]}),ga.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_24rem] gap-5 flex-1 min-h-0",children:[ga.jsx("main",{className:`${V8} flex flex-col min-h-[320px] lg:min-h-0 p-4`,children:Mr}),ga.jsxs("aside",{"aria-label":"Controls",className:`${V8} flex flex-col min-h-0`,children:[Ke?ga.jsx(SB,{tabs:Ke,active:en,onSelect:Br}):ga.jsx("div",{className:fP,children:ot}),lt&&ga.jsx("div",{className:"flex shrink-0 flex-col gap-3 border-t-[1.5px] border-ink p-4",children:lt})]})]})]})}const fP="flex flex-1 flex-col gap-6 min-h-0 overflow-auto p-4";function SB({tabs:we,active:Ke,onSelect:ot}){return ga.jsxs(ga.Fragment,{children:[ga.jsx("div",{role:"tablist",className:"flex gap-1 pt-2 px-2 border-b-[1.5px] border-ink",children:we.map(({label:lt},jt)=>ga.jsx("button",{type:"button",role:"tab","aria-selected":jt===Ke,onClick:()=>ot(jt),className:`flex-1 h-11 px-3 text-sm cursor-pointer rounded-t border-[1.5px] ${jt===Ke?"-mb-[1.5px] font-semibold border-ink border-b-surface bg-surface":"font-medium border-grid border-b-transparent text-ink-muted hover:bg-paper"}`,children:lt},lt))}),we.map(({label:lt,content:jt},Yt)=>ga.jsx("div",{role:"tabpanel",className:Yt===Ke?fP:"hidden",children:jt},lt))]})}function H8({label:we,icon:Ke,children:ot}){const[lt,jt]=Bl.useState(!1);return ga.jsxs(ga.Fragment,{children:[ga.jsxs("button",{type:"button",onClick:()=>jt(!0),className:Sk,children:[ga.jsx("span",{"aria-hidden":!0,children:ga.jsx(Ke,{size:16})}),we]}),ga.jsx(Vk,{title:we,open:lt,onClose:()=>jt(!1),children:typeof ot=="function"?ot(()=>jt(!1)):ot})]})}const MB="px-4 rounded bg-surface text-ink enabled:cursor-pointer enabled:hover:bg-marker-soft disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink",EB={primary:"h-11 text-sm border-2 border-ink font-semibold shadow-[3px_3px_0_var(--color-marker)] enabled:active:translate-x-px enabled:active:translate-y-px enabled:active:shadow-[2px_2px_0_var(--color-marker)]",secondary:"h-8 text-xs border-[1.5px] border-ink font-medium"};function pM({label:we,onClick:Ke,variant:ot="secondary",disabled:lt=!1}){return ga.jsx("button",{type:"button",onClick:Ke,disabled:lt,className:`${MB} ${EB[ot]}`,children:we})}function kB({label:we,checked:Ke,onChange:ot,disabled:lt=!1,title:jt}){return ga.jsxs("label",{title:jt,className:`flex items-center gap-2 whitespace-nowrap text-sm text-label ${lt?"opacity-50":"cursor-pointer"}`,children:[ga.jsx("input",{type:"checkbox",checked:Ke,disabled:lt,onChange:Yt=>ot(Yt.target.checked),className:"size-4 accent-ink"}),we]})}function PT({label:we,onClick:Ke,disabled:ot=!1,children:lt}){return ga.jsx("button",{type:"button","aria-label":we,title:we,onClick:Ke,disabled:ot,className:"flex size-9 shrink-0 items-center justify-center rounded border-[1.5px] border-ink bg-surface text-ink enabled:cursor-pointer enabled:hover:bg-marker-soft disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink",children:ga.jsx("span",{"aria-hidden":!0,children:lt})})}function CB({label:we,colors:Ke,value:ot,onChange:lt,taken:jt=[]}){const[Yt,hr]=Bl.useState(!1),Mr=Bl.useRef(null),en=Ke.find(on=>on.value===ot),Br=wM();return Bl.useEffect(()=>{if(!Yt)return;function on(Wn){Mr.current?.contains(Wn.target)||hr(!1)}function wn(Wn){Wn.key==="Escape"&&hr(!1)}return document.addEventListener("pointerdown",on),document.addEventListener("keydown",wn),()=>{document.removeEventListener("pointerdown",on),document.removeEventListener("keydown",wn)}},[Yt]),ga.jsxs("div",{ref:Mr,className:"relative shrink-0",children:[ga.jsx("button",{type:"button","aria-label":`${we}: ${en?Iw(en.name,Br):ot}`,title:`${we}: ${en?Iw(en.name,Br):ot}`,"aria-expanded":Yt,onClick:()=>hr(!Yt),className:"flex size-9 items-center justify-center rounded cursor-pointer hover:bg-paper focus-visible:outline-2 focus-visible:outline-ink",children:ga.jsx("span",{"aria-hidden":!0,className:"block size-6 rounded-full border-2 border-surface ring-[1.5px] ring-grid",style:{backgroundColor:vM(ot,Br)}})}),Yt&&ga.jsx("div",{role:"group","aria-label":we,className:"absolute left-0 top-full z-20 mt-1 grid w-max grid-cols-5 gap-1 rounded-md border-[1.5px] border-ink bg-surface p-2",children:Ke.map(on=>{const wn=on.value!==ot&&jt.includes(on.value);return ga.jsx("button",{type:"button","aria-label":Iw(on.name,Br),"aria-pressed":on.value===ot,title:wn?`${Iw(on.name,Br)} (used by another run)`:Iw(on.name,Br),disabled:wn,onClick:()=>{lt(on.value),hr(!1)},className:"flex size-8 items-center justify-center rounded enabled:cursor-pointer enabled:hover:bg-paper disabled:cursor-not-allowed disabled:opacity-25",children:ga.jsx("span",{"aria-hidden":!0,className:`block size-6 rounded-full border-2 border-surface ${on.value===ot?"ring-[3px] ring-ink":"ring-[1.5px] ring-grid"}`,style:{backgroundColor:vM(on.value,Br)}})},on.value)})})]})}const G8="\0action";function hP({label:we,hideLabel:Ke=!1,options:ot=[],groupedOptions:lt=[],activeOption:jt,onChange:Yt,action:hr}){return ga.jsxs("div",{className:"flex flex-col gap-1",children:[ga.jsx("label",{className:Ke?"sr-only":"text-label text-sm",children:we}),ga.jsxs("select",{"aria-label":we,value:jt,onChange:Mr=>{hr&&Mr.target.value===G8?hr.onSelect():Yt(Mr.target.value)},className:"p-2 rounded bg-surface border border-line",children:[ot.map(Mr=>ga.jsx("option",{value:Mr,children:Mr},Mr)),lt.map(Mr=>ga.jsx("optgroup",{label:Mr.label,children:Mr.options.map(en=>ga.jsx("option",{value:en,children:en},en))},Mr.label)),hr&&ga.jsxs(ga.Fragment,{children:[ga.jsx("option",{disabled:!0,children:"──────────"}),ga.jsx("option",{value:G8,children:hr.label})]})]})]})}function Mk({label:we,value:Ke,onChange:ot,readonly:lt=!1,rows:jt,error:Yt,mono:hr=!1,prefix:Mr,hideLabel:en=!1}){const Br=Bl.useId(),on=!!jt&&jt>1,wn=[on?"items-start":"items-center","flex w-full rounded border text-sm text-ink focus-within:outline-2 focus-within:outline-ink",hr?"font-mono":"",lt?"bg-paper":"bg-surface",Yt?"border-danger focus-within:outline-danger":"border-line"].join(" "),Wn="min-w-0 flex-1 bg-transparent px-2 outline-none";return ga.jsxs("div",{className:"flex flex-col gap-1",children:[ga.jsx("label",{htmlFor:Br,className:en?"sr-only":"text-label text-sm",children:we}),ga.jsxs("div",{className:wn,children:[Mr&&ga.jsx("span",{"aria-hidden":!0,className:`shrink-0 select-none pl-2 text-ink-muted ${on?"py-1.5":""}`,children:Mr}),on?ga.jsx("textarea",{id:Br,value:Ke,rows:jt,readOnly:lt,spellCheck:!1,"aria-invalid":!!Yt,onChange:Bn=>ot&&ot(Bn.target.value),className:`${Wn} py-1.5 resize-none`}):ga.jsx("input",{id:Br,type:"text",value:Ke,readOnly:lt,spellCheck:!1,"aria-invalid":!!Yt,onChange:Bn=>ot&&ot(Bn.target.value),className:`${Wn} h-9`})]}),Yt&&ga.jsx("p",{className:"text-danger font-semibold text-sm",children:Yt})]})}function LB({children:we}){return ga.jsx("h3",{className:"text-xs font-bold uppercase tracking-widest text-ink",children:we})}function iM({label:we,children:Ke}){return ga.jsxs("section",{className:"flex flex-col gap-4",children:[ga.jsx(LB,{children:we}),Ke]})}function PB({label:we,options:Ke,value:ot,onChange:lt}){return ga.jsx("div",{role:"group","aria-label":we,className:"grid gap-2",style:{gridTemplateColumns:`repeat(${Ke.length}, minmax(0, 1fr))`},children:Ke.map(jt=>ga.jsx("button",{type:"button","aria-pressed":ot===jt.value,disabled:jt.disabled,title:jt.title,onClick:()=>ot!==jt.value&<(jt.value),className:`h-8 px-1 rounded border-[1.5px] bg-surface text-xs font-medium enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 ${ot===jt.value?"border-ink":"border-grid enabled:hover:bg-paper"}`,children:jt.label},jt.value))})}function RB(we,Ke){Bl.useEffect(()=>{const ot=we();if(!ot||!Ke)return;function lt(jt){const Yt=ot._fullLayout;if(!Yt)return;const hr=ot.getBoundingClientRect(),Mr=Yt.xaxis.p2c(jt.clientX-hr.left-Yt.xaxis._offset),en=Yt.yaxis.p2c(jt.clientY-hr.top-Yt.yaxis._offset);X8(Mr,Yt.xaxis.range)&&X8(en,Yt.yaxis.range)&&Ke(Mr,en)}return ot.addEventListener("click",lt),()=>ot.removeEventListener("click",lt)})}function X8(we,[Ke,ot]){return Number.isFinite(we)&&we>=Math.min(Ke,ot)&&we<=Math.max(Ke,ot)}const IB={layout:{},axis:{},ink:"#1B2A4A",halo:"white",legend:"rgba(255,255,255,0.8)",color:we=>we,name:we=>we},DB={layout:{paper_bgcolor:"#172036",plot_bgcolor:"#172036",font:{color:"#C4CCDA"},modebar:{color:"rgba(228,233,242,0.35)",activecolor:"rgba(228,233,242,0.8)"}},axis:{gridcolor:"#2C3852",zerolinecolor:"#A3AEC4",linecolor:"#A3AEC4"},ink:"#E4E9F2",halo:"#172036",legend:"rgba(23,32,54,0.8)",color:we=>vM(we,"dark"),name:we=>Iw(we,"dark")};function dP(){return wM()==="dark"?DB:IB}class zB{constructor(Ke,ot={}){this.fetchState=Ke,this.options=ot,this.states=new Map,this.listeners=new Set,this.timer=null,this.playing=!1,this.generation=0,this.getSnapshot=()=>this.current,this.subscribe=lt=>(this.listeners.add(lt),()=>this.listeners.delete(lt)),this.setStepSize=lt=>this.set({stepSize:Math.max(1,Math.round(lt))}),this.setAnimate=lt=>this.set({animate:lt}),this.start=async()=>{const lt=this.generation;this.set({busy:!0});const jt=await this.get(0,lt);lt===this.generation&&this.set({busy:!1,...jt!==null&&{state:jt,iteration:0}})},this.step=async()=>{if(this.current.busy||this.current.running&&!this.playing)return!1;const{stepSize:lt,animate:jt}=this.current;jt&<>1&&!this.playing&&this.set({running:!0});const Yt=await this.advance(lt,jt,this.generation);return!this.playing&&this.current.running&&this.set({running:!1}),Yt},this.back=()=>{if(this.current.busy)return;const lt=Math.max(0,this.current.iteration-this.current.stepSize);this.states.has(lt)&&this.set({iteration:lt,state:this.states.get(lt)})},this.reset=()=>{this.pause(),this.states.has(0)&&this.set({iteration:0,state:this.states.get(0)})},this.play=()=>{this.current.running||(this.playing=!0,this.set({running:!0}),this.schedule())},this.pause=()=>{this.playing=!1,this.timer!==null&&(clearTimeout(this.timer),this.timer=null),this.current.running&&(this.generation++,this.set({running:!1,busy:!1}))},this.restart=(lt=this.options)=>(this.pause(),this.options=lt,this.generation++,this.states.clear(),this.set({iteration:0,state:void 0,lastIteration:lt.total??null,busy:!1,error:null}),this.start()),this.current={iteration:0,state:void 0,lastIteration:ot.total??null,stepSize:1,animate:!0,running:!1,busy:!1,error:null}}setFetchState(Ke){this.fetchState=Ke}schedule(){this.timer=setTimeout(async()=>{if(this.timer=null,!this.playing)return;await this.advance(this.current.stepSize,this.current.animate,this.generation)&&this.playing&&!this.atEnd()?this.schedule():this.pause()},this.interval())}async advance(Ke,ot,lt){const jt=this.current.iteration;let Yt=jt,hr=this.current.state;this.set({busy:!0,error:null});for(let Mr=0;MrsetTimeout(Br,this.interval())),lt!==this.generation))return!1}return this.set({busy:!1,iteration:Yt,state:hr}),Yt!==jt}async get(Ke,ot){const lt=this.states.get(Ke);if(lt!==void 0)return lt;try{const jt=await this.fetchState(Ke);return ot!==this.generation?null:jt===null?(this.set({lastIteration:Math.max(Ke-1,0)}),null):(this.states.set(Ke,jt),jt)}catch(jt){return ot===this.generation&&this.set({error:jt instanceof Error?jt.message:String(jt)}),null}}atEnd(Ke=this.current.iteration){return this.current.lastIteration!==null&&Ke>=this.current.lastIteration}interval(){const{intervalMs:Ke=400}=this.options;return typeof Ke=="function"?Ke(this.current.state):Ke}set(Ke){this.current={...this.current,...Ke},this.listeners.forEach(ot=>ot())}}function OB(we,Ke){const[ot]=Bl.useState(()=>new zB(we,Ke));return ot.setFetchState(we),Bl.useEffect(()=>(ot.start(),()=>ot.pause()),[ot]),{...Bl.useSyncExternalStore(ot.subscribe,ot.getSnapshot),stepper:ot}}const FB="flex size-11 shrink-0 items-center justify-center rounded border-[1.5px] border-ink bg-surface text-ink enabled:cursor-pointer enabled:hover:bg-marker-soft disabled:cursor-not-allowed disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink";function BB({stepper:we}){const{stepper:Ke,iteration:ot,lastIteration:lt,running:jt,busy:Yt,stepSize:hr}=we,[Mr,en]=Bl.useState(String(hr)),Br=/^[1-9]\d*$/.test(Mr.trim()),on=ot===0,wn=lt!==null&&ot>=lt;return ga.jsxs("section",{className:"flex flex-col gap-3",children:[ga.jsxs("div",{className:"flex gap-2",children:[ga.jsx(J6,{label:"Reset to iteration 0",onClick:Ke.reset,disabled:on&&!jt,children:ga.jsx(dM,{size:18})}),ga.jsx(J6,{label:`Step back ${hr}`,onClick:Ke.back,disabled:on||jt||Yt,children:ga.jsx(mB,{size:18})}),ga.jsxs("button",{type:"button",onClick:jt?Ke.pause:Ke.play,disabled:!jt&&wn,className:"flex h-11 flex-1 items-center justify-center gap-2 rounded border-2 border-ink bg-ink text-sm font-semibold text-surface dark:bg-surface dark:text-ink shadow-[3px_3px_0_var(--color-marker)] enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink",children:[ga.jsx("span",{"aria-hidden":!0,children:jt?ga.jsx(vB,{size:16}):ga.jsx(pB,{size:16})}),jt?"Pause":"Play"]}),ga.jsx(J6,{label:`Step forward ${hr}`,onClick:Ke.step,disabled:wn||jt||Yt,children:ga.jsx(gB,{size:18})}),ga.jsxs("label",{title:"Iterations per step",className:"flex shrink-0 items-center gap-1 font-mono text-sm text-ink-muted",children:["×",ga.jsx("input",{type:"number",min:1,step:1,inputMode:"numeric","aria-label":"Iterations per step","aria-invalid":!Br,value:Mr,onChange:Wn=>{en(Wn.target.value),/^[1-9]\d*$/.test(Wn.target.value.trim())&&Ke.setStepSize(Number(Wn.target.value))},className:`h-11 w-14 rounded border-[1.5px] bg-surface px-1.5 text-center text-ink ${Br?"border-ink":"border-danger outline-danger"}`})]})]}),ga.jsxs("p",{className:"font-mono text-sm text-ink-muted","aria-live":"polite",children:["iteration ",ot,lt!==null?` / ${lt}`:""]}),we.error&&ga.jsx("p",{className:"text-danger font-semibold",children:we.error})]})}function J6({label:we,onClick:Ke,disabled:ot,children:lt}){return ga.jsx("button",{type:"button","aria-label":we,title:we,onClick:Ke,disabled:ot,className:FB,children:ga.jsx("span",{"aria-hidden":!0,children:lt})})}const Ek="h-9 shrink-0 rounded border border-line bg-surface px-2 font-mono text-sm text-ink",Q6="\0none",ek="\0number";function kk({param:we,value:Ke,onChange:ot,fill:lt=!1}){const jt=Yt=>lt?"w-full min-w-0":Yt;switch(we.kind){case"boolean":return ga.jsx("input",{type:"checkbox",checked:Ke===!0,onChange:Yt=>ot(Yt.target.checked),className:"size-4 accent-ink cursor-pointer"});case"choice":return ga.jsx("select",{value:Ke,onChange:Yt=>ot(Yt.target.value),className:`${Ek} ${jt("w-28")} font-sans`,children:we.options.map(Yt=>ga.jsx("option",{value:Yt.value,children:Yt.label},Yt.value))});case"mixed":{const Yt=we.number,hr=typeof Ke=="number";return ga.jsxs("span",{className:`flex gap-1 ${lt?"w-full":""}`,children:[ga.jsxs("select",{value:hr?ek:Ke===null?Q6:String(Ke),onChange:Mr=>{const en=Mr.target.value;ot(en===ek?UB(Yt):en===Q6?null:en)},className:`${Ek} ${lt?"min-w-0 flex-1":hr?"w-24":"w-28"} font-sans`,children:[we.options.map(Mr=>ga.jsx("option",{value:Mr.value??Q6,children:Mr.label},Mr.label)),Yt&&ga.jsx("option",{value:ek,children:"Number…"})]}),hr&&ga.jsx(Y8,{range:Yt,value:Ke,onChange:ot,className:lt?"min-w-0 flex-1":"w-20"})]})}default:return ga.jsx(Y8,{range:{...we,integer:we.kind==="integer"},nullable:we.nullable,value:Ke,onChange:ot,className:jt("w-28")})}}function Y8({range:we,label:Ke,nullable:ot,value:lt,onChange:jt,className:Yt}){const[hr,Mr]=Bl.useState(Z8(lt)),en=tk(we,ot,hr)!==void 0;return Bl.useEffect(()=>{tk(we,ot,hr)!==lt&&Mr(Z8(lt))},[lt]),ga.jsx("input",{type:"number",inputMode:"decimal",min:we.min,max:we.max,step:we.integer?1:"any",placeholder:ot,"aria-label":Ke,value:hr,"aria-invalid":!en,title:en?void 0:NB(we),onChange:Br=>{Mr(Br.target.value);const on=tk(we,ot,Br.target.value);on!==void 0&&jt(on)},className:`${Ek} ${Yt} ${en?"":"border-danger outline-danger"}`})}function Z8(we){return we===null?"":String(we)}function tk(we,Ke,ot){if(ot.trim()==="")return Ke?null:void 0;const lt=Number(ot);return Number.isFinite(lt)&&vP(we,lt)?lt:void 0}function vP({integer:we,min:Ke,max:ot,minExclusive:lt,maxExclusive:jt},Yt){return!(we&&!Number.isInteger(Yt)||Ke!==void 0&&(lt?Yt<=Ke:Yt=ot:Yt>ot))}function NB({integer:we,min:Ke,max:ot,minExclusive:lt,maxExclusive:jt}){const Yt=Ke===void 0?null:`${lt?"more than":"at least"} ${Ke}`,hr=ot===void 0?null:`${jt?"less than":"at most"} ${ot}`;return[Ke!==void 0&&ot!==void 0&&!lt&&!jt?`${Ke} to ${ot}`:[Yt,hr].filter(Boolean).join(" and "),we?"a whole number":null].filter(Boolean).join(", ")||"a number"}function UB(we){return vP(we,1)?1:we.max!==void 0&&we.max<1?we.max:we.min!==void 0?Math.ceil(we.min+(we.minExclusive?1:0)):0}function pP(we,Ke){return Object.fromEntries(we.map(ot=>[ot.name,ot.name in Ke?Ke[ot.name]:ot.default]))}function mP(we,Ke){return Object.entries(we.when??{}).every(([ot,lt])=>lt.includes(String(Ke[ot])))}function gP(we,Ke){return we.name in Ke&&Ke[we.name]!==we.default}function jB(we,Ke=!1){return we===null?"None":typeof we=="boolean"?we?"True":"False":typeof we=="string"?JSON.stringify(we):Number.isInteger(we)&&!Ke?we.toFixed(1):String(we)}function qB(we){return we.kind==="integer"||we.kind==="mixed"&&!!we.number?.integer}function yP({model:we,values:Ke,onChange:ot,onResetOne:lt,onReset:jt}){const Yt=[...we.params,...we.otherParams??[]],hr=pP(Yt,Ke);return ga.jsxs("div",{className:"flex flex-col gap-3",children:[ga.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[ga.jsxs("p",{className:"text-sm text-ink-muted",children:["Every setting of ",ga.jsx("code",{className:"font-mono text-ink",children:we.estimator??we.label}),". Changed settings are highlighted."]}),ga.jsx(pM,{label:"Reset all",onClick:jt})]}),ga.jsx("div",{className:"overflow-auto max-h-[65dvh] rounded border-[1.5px] border-ink",children:ga.jsxs("table",{className:"w-full border-collapse text-sm",children:[ga.jsx("thead",{className:"sticky top-0 z-10 bg-surface",children:ga.jsxs("tr",{className:"border-b-[1.5px] border-ink text-left text-xs uppercase tracking-widest text-ink-muted",children:[ga.jsx("th",{scope:"col",className:"px-3 py-2 font-semibold",children:"Setting"}),ga.jsx("th",{scope:"col",className:"px-3 py-2 font-semibold",children:"Value"}),ga.jsx("th",{scope:"col",className:"px-3 py-2 font-semibold",children:"Default"}),ga.jsx("th",{scope:"col",className:"w-11",children:ga.jsx("span",{className:"sr-only",children:"Reset"})})]})}),ga.jsx("tbody",{children:Yt.map(Mr=>{const en=gP(Mr,Ke),Br=mP(Mr,hr);return ga.jsxs("tr",{className:`border-t border-grid align-top ${en?"bg-marker-soft":""}`,children:[ga.jsxs("td",{className:`px-3 py-2 ${Br?"":"opacity-50"}`,children:[ga.jsxs("div",{children:[ga.jsx("span",{className:"font-medium",children:Mr.label})," ",Mr.label!==Mr.name&&ga.jsx("code",{className:"font-mono text-xs text-ink-muted",children:Mr.name})]}),Mr.description&&ga.jsx("p",{className:"mt-0.5 max-w-prose text-xs text-ink-muted",children:Mr.description}),!Br&&ga.jsx("p",{className:"mt-0.5 text-xs italic text-ink-muted",children:"Not used with the current settings."})]}),ga.jsx("td",{className:"px-3 py-2",children:ga.jsx("label",{className:"flex min-h-9 items-center","aria-label":Mr.label,children:ga.jsx(kk,{param:Mr,value:hr[Mr.name],onChange:on=>ot(Mr.name,on)})})}),ga.jsx("td",{className:"px-3 py-2 pt-3.5 font-mono text-xs text-ink-muted whitespace-nowrap",children:jB(Mr.default,qB(Mr))}),ga.jsx("td",{className:"py-1 pr-1",children:Mr.name in Ke&&ga.jsx("button",{type:"button",onClick:()=>lt(Mr.name),"aria-label":`Reset ${Mr.label}`,title:"Reset to default",className:"flex size-9 items-center justify-center rounded text-ink-muted cursor-pointer hover:bg-paper",children:ga.jsx(dM,{size:16,"aria-hidden":!0})})})]},Mr.name)})})]})})]})}function VB({model:we,values:Ke,onChange:ot,showQuickSettings:lt=!0,inline:jt=!1,actions:Yt}){const[hr,Mr]=Bl.useState(!1),en=we.otherParams??[],Br=[...we.params,...en],on=pP(Br,Ke),wn=Object.keys(Ke).map(Gi=>en.find(hi=>hi.name===Gi)).filter(Gi=>Gi!==void 0).slice(-3).reverse(),Wn=lt?[...we.params.filter(Gi=>mP(Gi,on)),...wn]:[],Bn=Br.filter(Gi=>gP(Gi,Ke)).length;function Hi(Gi,hi){const{[Gi]:Ge,...Ao}=Ke;ot({...Ao,[Gi]:hi})}function wo(Gi){const{[Gi]:hi,...Ge}=Ke;ot(Ge)}return jt?ga.jsxs("div",{className:"flex min-h-15 gap-2",children:[Wn.length===0&&ga.jsxs("p",{className:"self-center text-sm text-ink-muted",children:[we.label," has no settings."]}),Wn.map(Gi=>ga.jsxs("label",{title:[`${Gi.label} (${Gi.name})`,Gi.description].filter(Boolean).join(": "),className:"flex min-w-0 flex-1 flex-col gap-1",children:[ga.jsx("span",{"aria-hidden":!0,className:"text-sm text-label",children:Gi.symbol??Gi.label}),ga.jsx("span",{className:"sr-only",children:Gi.label}),ga.jsx(kk,{param:Gi,value:on[Gi.name],onChange:hi=>Hi(Gi.name,hi),fill:!0})]},Gi.name))]}):ga.jsxs("div",{className:"flex flex-col gap-2",children:[Wn.map(Gi=>ga.jsxs("label",{className:"flex items-center justify-between gap-3 text-sm text-label",children:[ga.jsxs("span",{className:"min-w-0",children:[Gi.label," ",Gi.label!==Gi.name&&ga.jsx("code",{className:"font-mono text-xs text-ink-muted",children:Gi.name})]}),ga.jsx(kk,{param:Gi,value:on[Gi.name],onChange:hi=>Hi(Gi.name,hi)})]},Gi.name)),ga.jsxs("div",{className:Yt?"grid grid-flow-col auto-cols-fr gap-2":"contents",children:[en.length>0||!lt&&Br.length>0?ga.jsx(pM,{label:`Customise settings${Bn>0?` · ${Bn} changed`:""}`,onClick:()=>Mr(!0)}):Wn.length>0&&ga.jsx(pM,{label:"Reset to defaults",onClick:()=>ot({})}),Yt]}),ga.jsx(Vk,{title:`${we.label} settings`,open:hr,onClose:()=>Mr(!1),wide:!0,children:ga.jsx(yP,{model:we,values:Ke,onChange:Hi,onResetOne:wo,onReset:()=>ot({})})})]})}const RT=[{name:"Dark Orange",value:"#D55E00"},{name:"Pink",value:"#CC79A7"},{name:"Light Blue",value:"#56B4E9"},{name:"Light Orange",value:"#E69F00"},{name:"Wine",value:"#882255"},{name:"Green",value:"#009E73"},{name:"Grey",value:"#999999"},{name:"Dark Blue",value:"#0072B2"},{name:"Yellow",value:"#F0E442"},{name:"Black",value:"#000000"}],Fw={1:[{name:"Quadratic",expression:"x^2",x:[-1.5,1.5],start:[1]},{name:"Local minima",expression:"x^2 - 0.1cos(20x)",x:[-1.5,1.5],start:[1]},{name:"Plateau",expression:"x^4",x:[-1.5,1.5],start:[1]}],2:[{name:"Quadratic bowl",expression:"x^2 + 3y^2",x:[-1.5,1.5],y:[-1.5,1.5],start:[1,1]},{name:"Small",expression:"(0.05x)^2 + 3(0.05y)^2",x:[-1.5,1.5],y:[-1.5,1.5],start:[1,1]},{name:"Ackley",expression:"-20exp(-0.2 sqrt(0.5(x^2 + y^2))) - exp(0.5(cos(2 pi x) + cos(2 pi y))) + e + 20",x:[-4,4],y:[-4,4],start:[2.6,1.7]},{name:"Rastrigin",expression:"20 + (x^2 - 10cos(2 pi x)) + (y^2 - 10cos(2 pi y))",x:[-5.12,5.12],y:[-5.12,5.12],start:[3.2,2.1]},{name:"Rosenbrock",expression:"(1 - x)^2 + 100(y - x^2)^2",x:[-2,2],y:[-1,3],start:[-1.5,2]}]},Ck=[...Fw[1],...Fw[2]],W8="Custom",HB=/asin|acos|atan|sin|cos|tan|sqrt|abs|exp|log|ln|pi/g;function $8(we){return/y/.test(we.replace(HB,""))?2:1}var rk={},nk={},ak={exports:{}},ik,K8;function GB(){if(K8)return ik;K8=1;var we="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ik=we,ik}var ok,J8;function XB(){if(J8)return ok;J8=1;var we=GB();function Ke(){}function ot(){}return ot.resetWarningCache=Ke,ok=function(){function lt(hr,Mr,en,Br,on,wn){if(wn!==we){var Wn=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 Wn.name="Invariant Violation",Wn}}lt.isRequired=lt;function jt(){return lt}var Yt={array:lt,bigint:lt,bool:lt,func:lt,number:lt,object:lt,string:lt,symbol:lt,any:lt,arrayOf:jt,element:lt,elementType:lt,instanceOf:jt,node:lt,objectOf:jt,oneOf:jt,oneOfType:jt,shape:jt,exact:jt,checkPropTypes:ot,resetWarningCache:Ke};return Yt.PropTypes=Yt,Yt},ok}var Q8;function YB(){return Q8||(Q8=1,ak.exports=XB()()),ak.exports}var e4;function ZB(){return e4||(e4=1,(function(we){function Ke(uo){"@babel/helpers - typeof";return Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(di){return typeof di}:function(di){return di&&typeof Symbol=="function"&&di.constructor===Symbol&&di!==Symbol.prototype?"symbol":typeof di},Ke(uo)}Object.defineProperty(we,"__esModule",{value:!0}),we.default=Ns;var ot=hr(bM()),lt=jt(YB());function jt(uo){return uo&&uo.__esModule?uo:{default:uo}}function Yt(uo){if(typeof WeakMap!="function")return null;var di=new WeakMap,Eo=new WeakMap;return(Yt=function(ki){return ki?Eo:di})(uo)}function hr(uo,di){if(uo&&uo.__esModule)return uo;if(uo===null||Ke(uo)!=="object"&&typeof uo!="function")return{default:uo};var Eo=Yt(di);if(Eo&&Eo.has(uo))return Eo.get(uo);var zs={},ki=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var tl in uo)if(tl!=="default"&&Object.prototype.hasOwnProperty.call(uo,tl)){var Bi=ki?Object.getOwnPropertyDescriptor(uo,tl):null;Bi&&(Bi.get||Bi.set)?Object.defineProperty(zs,tl,Bi):zs[tl]=uo[tl]}return zs.default=uo,Eo&&Eo.set(uo,zs),zs}function Mr(uo,di){if(!(uo instanceof di))throw new TypeError("Cannot call a class as a function")}function en(uo,di){for(var Eo=0;Eo"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 Gi(uo){return Gi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Eo){return Eo.__proto__||Object.getPrototypeOf(Eo)},Gi(uo)}var hi=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],Ge=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],Ao=typeof window<"u";function Ns(uo){var di=(function(Eo){on(ki,Eo);var zs=Wn(ki);function ki(tl){var Bi;return Mr(this,ki),Bi=zs.call(this,tl),Bi.p=Promise.resolve(),Bi.resizeHandler=null,Bi.handlers={},Bi.syncWindowResize=Bi.syncWindowResize.bind(Hi(Bi)),Bi.syncEventHandlers=Bi.syncEventHandlers.bind(Hi(Bi)),Bi.attachUpdateEvents=Bi.attachUpdateEvents.bind(Hi(Bi)),Bi.getRef=Bi.getRef.bind(Hi(Bi)),Bi.handleUpdate=Bi.handleUpdate.bind(Hi(Bi)),Bi.figureCallback=Bi.figureCallback.bind(Hi(Bi)),Bi.updatePlotly=Bi.updatePlotly.bind(Hi(Bi)),Bi}return Br(ki,[{key:"updatePlotly",value:function(Bi,zo,Ll){var Ei=this;this.p=this.p.then(function(){if(!Ei.unmounting){if(!Ei.el)throw new Error("Missing element reference");return uo.react(Ei.el,{data:Ei.props.data,layout:Ei.props.layout,config:Ei.props.config,frames:Ei.props.frames})}}).then(function(){Ei.unmounting||(Ei.syncWindowResize(Bi),Ei.syncEventHandlers(),Ei.figureCallback(zo),Ll&&Ei.attachUpdateEvents())}).catch(function(Ii){Ei.props.onError&&Ei.props.onError(Ii)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(Bi){this.unmounting=!1;var zo=Bi.frames&&Bi.frames.length?Bi.frames.length:0,Ll=this.props.frames&&this.props.frames.length?this.props.frames.length:0,Ei=!(Bi.layout===this.props.layout&&Bi.data===this.props.data&&Bi.config===this.props.config&&Ll===zo),Ii=Bi.revision!==void 0,Ti=Bi.revision!==this.props.revision;!Ei&&(!Ii||Ii&&!Ti)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&Ao&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),uo.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var Bi=this;!this.el||!this.el.removeListener||Ge.forEach(function(zo){Bi.el.on(zo,Bi.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var Bi=this;!this.el||!this.el.removeListener||Ge.forEach(function(zo){Bi.el.removeListener(zo,Bi.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(Bi){if(typeof Bi=="function"){var zo=this.el,Ll=zo.data,Ei=zo.layout,Ii=this.el._transitionData?this.el._transitionData._frames:null,Ti={data:Ll,layout:Ei,frames:Ii};Bi(Ti,this.el)}}},{key:"syncWindowResize",value:function(Bi){var zo=this;Ao&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return uo.Plots.resize(zo.el)},window.addEventListener("resize",this.resizeHandler),Bi&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(Bi){this.el=Bi,this.props.debug&&Ao&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var Bi=this;hi.forEach(function(zo){var Ll=Bi.props["on"+zo],Ei=Bi.handlers[zo],Ii=!!Ei;Ll&&!Ii?Bi.addEventHandler(zo,Ll):!Ll&&Ii?Bi.removeEventHandler(zo):Ll&&Ii&&Ll!==Ei&&(Bi.removeEventHandler(zo),Bi.addEventHandler(zo,Ll))})}},{key:"addEventHandler",value:function(Bi,zo){this.handlers[Bi]=zo,this.el.on(this.getPlotlyEventName(Bi),this.handlers[Bi])}},{key:"removeEventHandler",value:function(Bi){this.el.removeListener(this.getPlotlyEventName(Bi),this.handlers[Bi]),delete this.handlers[Bi]}},{key:"getPlotlyEventName",value:function(Bi){return"plotly_"+Bi.toLowerCase()}},{key:"render",value:function(){return ot.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),ki})(ot.Component);return di.propTypes={data:lt.default.arrayOf(lt.default.object),config:lt.default.object,layout:lt.default.object,frames:lt.default.arrayOf(lt.default.object),revision:lt.default.number,onInitialized:lt.default.func,onPurge:lt.default.func,onError:lt.default.func,onUpdate:lt.default.func,debug:lt.default.bool,style:lt.default.object,className:lt.default.string,useResizeHandler:lt.default.bool,divId:lt.default.string},hi.forEach(function(Eo){di.propTypes["on"+Eo]=lt.default.func}),di.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},di}})(nk)),nk}var cM={exports:{}},WB=cM.exports,t4;function $B(){return t4||(t4=1,(function(we){var Ke={};(function(ot,lt){we.exports?we.exports=lt():ot.moduleName=lt()})(typeof self<"u"?self:WB,()=>{var ot=(()=>{var lt=Object.create,jt=Object.defineProperty,Yt=Object.defineProperties,hr=Object.getOwnPropertyDescriptor,Mr=Object.getOwnPropertyDescriptors,en=Object.getOwnPropertyNames,Br=Object.getOwnPropertySymbols,on=Object.getPrototypeOf,wn=Object.prototype.hasOwnProperty,Wn=Object.prototype.propertyIsEnumerable,Bn=(K,G,h)=>G in K?jt(K,G,{enumerable:!0,configurable:!0,writable:!0,value:h}):K[G]=h,Hi=(K,G)=>{for(var h in G||(G={}))wn.call(G,h)&&Bn(K,h,G[h]);if(Br)for(var h of Br(G))Wn.call(G,h)&&Bn(K,h,G[h]);return K},wo=(K,G)=>Yt(K,Mr(G)),Gi=(K,G)=>{var h={};for(var b in K)wn.call(K,b)&&G.indexOf(b)<0&&(h[b]=K[b]);if(K!=null&&Br)for(var b of Br(K))G.indexOf(b)<0&&Wn.call(K,b)&&(h[b]=K[b]);return h},hi=(K,G)=>function(){return K&&(G=(0,K[en(K)[0]])(K=0)),G},Ge=(K,G)=>function(){return G||(0,K[en(K)[0]])((G={exports:{}}).exports,G),G.exports},Ao=(K,G)=>{for(var h in G)jt(K,h,{get:G[h],enumerable:!0})},Ns=(K,G,h,b)=>{if(G&&typeof G=="object"||typeof G=="function")for(let S of en(G))!wn.call(K,S)&&S!==h&&jt(K,S,{get:()=>G[S],enumerable:!(b=hr(G,S))||b.enumerable});return K},uo=(K,G,h)=>(h=K!=null?lt(on(K)):{},Ns(jt(h,"default",{value:K,enumerable:!0}),K)),di=K=>Ns(jt({},"__esModule",{value:!0}),K),Eo=Ge({"src/version.js"(K){K.version="3.3.1"}}),zs=Ge({"node_modules/native-promise-only/lib/npo.src.js"(K,G){(function(b,S,E){S[b]=S[b]||E(),typeof G<"u"&&G.exports&&(G.exports=S[b])})("Promise",typeof window<"u"?window:K,function(){var b,S,E,e=Object.prototype.toString,t=typeof setImmediate<"u"?function(g){return setImmediate(g)}:setTimeout;try{Object.defineProperty({},"x",{}),b=function(g,x,A,M){return Object.defineProperty(g,x,{value:A,writable:!0,configurable:M!==!1})}}catch{b=function(x,A,M){return x[A]=M,x}}E=(function(){var g,x,A;function M(_,w){this.fn=_,this.self=w,this.next=void 0}return{add:function(w,m){A=new M(w,m),x?x.next=A:g=A,x=A,A=void 0},drain:function(){var w=g;for(g=x=S=void 0;w;)w.fn.call(w.self),w=w.next}}})();function r(l,g){E.add(l,g),S||(S=t(E.drain))}function o(l){var g,x=typeof l;return l!=null&&(x=="object"||x=="function")&&(g=l.then),typeof g=="function"?g:!1}function n(){for(var l=0;l0&&r(n,x))}catch(A){s.call(new c(x),A)}}}function s(l){var g=this;g.triggered||(g.triggered=!0,g.def&&(g=g.def),g.msg=l,g.state=2,g.chain.length>0&&r(n,g))}function f(l,g,x,A){for(var M=0;MOe?1:ge>=Oe?0:NaN}h.descending=function(ge,Oe){return Oege?1:Oe>=ge?0:NaN},h.min=function(ge,Oe){var rt=-1,wt=ge.length,St,It;if(arguments.length===1){for(;++rt=It){St=It;break}for(;++rtIt&&(St=It)}else{for(;++rt=It){St=It;break}for(;++rtIt&&(St=It)}return St},h.max=function(ge,Oe){var rt=-1,wt=ge.length,St,It;if(arguments.length===1){for(;++rt=It){St=It;break}for(;++rtSt&&(St=It)}else{for(;++rt=It){St=It;break}for(;++rtSt&&(St=It)}return St},h.extent=function(ge,Oe){var rt=-1,wt=ge.length,St,It,tr;if(arguments.length===1){for(;++rt=It){St=tr=It;break}for(;++rtIt&&(St=It),tr=It){St=tr=It;break}for(;++rtIt&&(St=It),tr1)return tr/(_r-1)},h.deviation=function(){var ge=h.variance.apply(this,arguments);return ge&&Math.sqrt(ge)};function p(ge){return{left:function(Oe,rt,wt,St){for(arguments.length<3&&(wt=0),arguments.length<4&&(St=Oe.length);wt>>1;ge(Oe[It],rt)<0?wt=It+1:St=It}return wt},right:function(Oe,rt,wt,St){for(arguments.length<3&&(wt=0),arguments.length<4&&(St=Oe.length);wt>>1;ge(Oe[It],rt)>0?St=It:wt=It+1}return wt}}}var v=p(s);h.bisectLeft=v.left,h.bisect=h.bisectRight=v.right,h.bisector=function(ge){return p(ge.length===1?function(Oe,rt){return s(ge(Oe),rt)}:ge)},h.shuffle=function(ge,Oe,rt){(wt=arguments.length)<3&&(rt=ge.length,wt<2&&(Oe=0));for(var wt=rt-Oe,St,It;wt;)It=Math.random()*wt--|0,St=ge[wt+Oe],ge[wt+Oe]=ge[It+Oe],ge[It+Oe]=St;return ge},h.permute=function(ge,Oe){for(var rt=Oe.length,wt=new Array(rt);rt--;)wt[rt]=ge[Oe[rt]];return wt},h.pairs=function(ge){for(var Oe=0,rt=ge.length-1,wt=ge[0],St=new Array(rt<0?0:rt);Oe=0;)for(tr=ge[Oe],rt=tr.length;--rt>=0;)It[--St]=tr[rt];return It};var l=Math.abs;h.range=function(ge,Oe,rt){if(arguments.length<3&&(rt=1,arguments.length<2&&(Oe=ge,ge=0)),(Oe-ge)/rt===1/0)throw new Error("infinite range");var wt=[],St=g(l(rt)),It=-1,tr;if(ge*=St,Oe*=St,rt*=St,rt<0)for(;(tr=ge+rt*++It)>Oe;)wt.push(tr/St);else for(;(tr=ge+rt*++It)=Oe.length)return St?St.call(ge,_r):wt?_r.sort(wt):_r;for(var Xr=-1,dn=_r.length,Mn=Oe[Zr++],Cn,La,zn,ea=new A,sa;++Xr=Oe.length)return er;var Zr=[],Xr=rt[_r++];return er.forEach(function(dn,Mn){Zr.push({key:dn,values:tr(Mn,_r)})}),Xr?Zr.sort(function(dn,Mn){return Xr(dn.key,Mn.key)}):Zr}return ge.map=function(er,_r){return It(_r,er,0)},ge.entries=function(er){return tr(It(h.map,er,0),0)},ge.key=function(er){return Oe.push(er),ge},ge.sortKeys=function(er){return rt[Oe.length-1]=er,ge},ge.sortValues=function(er){return wt=er,ge},ge.rollup=function(er){return St=er,ge},ge},h.set=function(ge){var Oe=new z;if(ge)for(var rt=0,wt=ge.length;rt=0&&(wt=ge.slice(rt+1),ge=ge.slice(0,rt)),ge)return arguments.length<2?this[ge].on(wt):this[ge].on(wt,Oe);if(arguments.length===2){if(Oe==null)for(ge in this)this.hasOwnProperty(ge)&&this[ge].on(wt,null);return this}};function Z(ge){var Oe=[],rt=new A;function wt(){for(var St=Oe,It=-1,tr=St.length,er;++It=0&&(rt=ge.slice(0,Oe))!=="xmlns"&&(ge=ge.slice(Oe+1)),de.hasOwnProperty(rt)?{space:de[rt],local:ge}:ge}},te.attr=function(ge,Oe){if(arguments.length<2){if(typeof ge=="string"){var rt=this.node();return ge=h.ns.qualify(ge),ge.local?rt.getAttributeNS(ge.space,ge.local):rt.getAttribute(ge)}for(Oe in ge)this.each(Se(Oe,ge[Oe]));return this}return this.each(Se(ge,Oe))};function Se(ge,Oe){ge=h.ns.qualify(ge);function rt(){this.removeAttribute(ge)}function wt(){this.removeAttributeNS(ge.space,ge.local)}function St(){this.setAttribute(ge,Oe)}function It(){this.setAttributeNS(ge.space,ge.local,Oe)}function tr(){var _r=Oe.apply(this,arguments);_r==null?this.removeAttribute(ge):this.setAttribute(ge,_r)}function er(){var _r=Oe.apply(this,arguments);_r==null?this.removeAttributeNS(ge.space,ge.local):this.setAttributeNS(ge.space,ge.local,_r)}return Oe==null?ge.local?wt:rt:typeof Oe=="function"?ge.local?er:tr:ge.local?It:St}function Le(ge){return ge.trim().replace(/\s+/g," ")}te.classed=function(ge,Oe){if(arguments.length<2){if(typeof ge=="string"){var rt=this.node(),wt=(ge=ze(ge)).length,St=-1;if(Oe=rt.classList){for(;++St=0;)(It=rt[wt])&&(St&&St!==It.nextSibling&&St.parentNode.insertBefore(It,St),St=It);return this},te.sort=function(ge){ge=Ne.apply(this,arguments);for(var Oe=-1,rt=this.length;++Oe=Oe&&(Oe=St+1);!(_r=tr[Oe])&&++Oe0&&(ge=ge.slice(0,St));var tr=Qt.get(ge);tr&&(ge=tr,It=kr);function er(){var Xr=this[wt];Xr&&(this.removeEventListener(ge,Xr,Xr.$),delete this[wt])}function _r(){var Xr=It(Oe,S(arguments));er.call(this),this.addEventListener(ge,this[wt]=Xr,Xr.$=rt),Xr._=Oe}function Zr(){var Xr=new RegExp("^__on([^.]+)"+h.requote(ge)+"$"),dn;for(var Mn in this)if(dn=Mn.match(Xr)){var Cn=this[Mn];this.removeEventListener(dn[1],Cn,Cn.$),delete this[Mn]}}return St?Oe?_r:er:Oe?U:Zr}var Qt=h.map({mouseenter:"mouseover",mouseleave:"mouseout"});E&&Qt.forEach(function(ge){"on"+ge in E&&Qt.remove(ge)});function ar(ge,Oe){return function(rt){var wt=h.event;h.event=rt,Oe[0]=this.__data__;try{ge.apply(this,Oe)}finally{h.event=wt}}}function kr(ge,Oe){var rt=ar(ge,Oe);return function(wt){var St=this,It=wt.relatedTarget;(!It||It!==St&&!(It.compareDocumentPosition(St)&8))&&rt.call(St,wt)}}var Er,$r=0;function Sr(ge){var Oe=".dragsuppress-"+ ++$r,rt="click"+Oe,wt=h.select(t(ge)).on("touchmove"+Oe,re).on("dragstart"+Oe,re).on("selectstart"+Oe,re);if(Er==null&&(Er="onselectstart"in ge?!1:B(ge.style,"userSelect")),Er){var St=e(ge).style,It=St[Er];St[Er]="none"}return function(tr){if(wt.on(Oe,null),Er&&(St[Er]=It),tr){var er=function(){wt.on(rt,null)};wt.on(rt,function(){re(),er()},!0),setTimeout(er,0)}}}h.mouse=function(ge){return Mt(ge,fe())};var Ur=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Mt(ge,Oe){Oe.changedTouches&&(Oe=Oe.changedTouches[0]);var rt=ge.ownerSVGElement||ge;if(rt.createSVGPoint){var wt=rt.createSVGPoint();if(Ur<0){var St=t(ge);if(St.scrollX||St.scrollY){rt=h.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var It=rt[0][0].getScreenCTM();Ur=!(It.f||It.e),rt.remove()}}return Ur?(wt.x=Oe.pageX,wt.y=Oe.pageY):(wt.x=Oe.clientX,wt.y=Oe.clientY),wt=wt.matrixTransform(ge.getScreenCTM().inverse()),[wt.x,wt.y]}var tr=ge.getBoundingClientRect();return[Oe.clientX-tr.left-ge.clientLeft,Oe.clientY-tr.top-ge.clientTop]}h.touch=function(ge,Oe,rt){if(arguments.length<3&&(rt=Oe,Oe=fe().changedTouches),Oe){for(var wt=0,St=Oe.length,It;wt1?Xe:ge<-1?-Xe:Math.asin(ge)}function Kt(ge){return((ge=Math.exp(ge))-1/ge)/2}function xr(ge){return((ge=Math.exp(ge))+1/ge)/2}function mr(ge){return((ge=Math.exp(2*ge))-1)/(ge+1)}var vr=Math.SQRT2,Nr=2,kn=4;h.interpolateZoom=function(ge,Oe){var rt=ge[0],wt=ge[1],St=ge[2],It=Oe[0],tr=Oe[1],er=Oe[2],_r=It-rt,Zr=tr-wt,Xr=_r*_r+Zr*Zr,dn,Mn;if(Xr0&&(lo=lo.transition().duration(tr)),lo.call(Ra.event)}function _o(){ea&&ea.domain(zn.range().map(function(lo){return(lo-ge.x)/ge.k}).map(zn.invert)),Sa&&Sa.domain(sa.range().map(function(lo){return(lo-ge.y)/ge.k}).map(sa.invert))}function ko(lo){er++||lo({type:"zoomstart"})}function Ws(lo){_o(),lo({type:"zoom",scale:ge.k,translate:[ge.x,ge.y]})}function Po(lo){--er||(lo({type:"zoomend"}),rt=null)}function os(){var lo=this,Ls=La.of(lo,arguments),Qs=0,$l=h.select(t(lo)).on(Zr,El).on(Xr,Kl),Ol=oa(h.mouse(lo)),Sc=Sr(lo);Ta.call(lo),ko(Ls);function El(){Qs=1,Di(h.mouse(lo),Ol),Ws(Ls)}function Kl(){$l.on(Zr,null).on(Xr,null),Sc(Qs),Po(Ls)}}function nl(){var lo=this,Ls=La.of(lo,arguments),Qs={},$l=0,Ol,Sc=".zoom-"+h.event.changedTouches[0].identifier,El="touchmove"+Sc,Kl="touchend"+Sc,Kc=[],Pu=h.select(lo),mt=Sr(lo);wr(),ko(Ls),Pu.on(_r,null).on(Mn,wr);function yr(){var yn=h.touches(lo);return Ol=ge.k,yn.forEach(function(mn){mn.identifier in Qs&&(Qs[mn.identifier]=oa(mn))}),yn}function wr(){var yn=h.event.target;h.select(yn).on(El,Ln).on(Kl,ca),Kc.push(yn);for(var mn=h.event.changedTouches,za=0,Ia=mn.length;za1){var Fi=Da[0],yi=Da[1],Ga=Fi[0]-yi[0],ma=Fi[1]-yi[1];$l=Ga*Ga+ma*ma}}function Ln(){var yn=h.touches(lo),mn,za,Ia,Da;Ta.call(lo);for(var Za=0,Fi=yn.length;Za1?1:Oe,rt=rt<0?0:rt>1?1:rt,St=rt<=.5?rt*(1+Oe):rt+Oe-rt*Oe,wt=2*rt-St;function It(er){return er>360?er-=360:er<0&&(er+=360),er<60?wt+(St-wt)*er/60:er<180?St:er<240?wt+(St-wt)*(240-er)/60:wt}function tr(er){return Math.round(It(er)*255)}return new pi(tr(ge+120),tr(ge),tr(ge-120))}h.hcl=sr;function sr(ge,Oe,rt){return this instanceof sr?(this.h=+ge,this.c=+Oe,void(this.l=+rt)):arguments.length<2?ge instanceof sr?new sr(ge.h,ge.c,ge.l):ge instanceof ur?ha(ge.l,ge.a,ge.b):ha((ge=Dr((ge=h.rgb(ge)).r,ge.g,ge.b)).l,ge.a,ge.b):new sr(ge,Oe,rt)}var Vt=sr.prototype=new na;Vt.brighter=function(ge){return new sr(this.h,this.c,Math.min(100,this.l+Gr*(arguments.length?ge:1)))},Vt.darker=function(ge){return new sr(this.h,this.c,Math.max(0,this.l-Gr*(arguments.length?ge:1)))},Vt.rgb=function(){return or(this.h,this.c,this.l).rgb()};function or(ge,Oe,rt){return isNaN(ge)&&(ge=0),isNaN(Oe)&&(Oe=0),new ur(rt,Math.cos(ge*=Qe)*Oe,Math.sin(ge)*Oe)}h.lab=ur;function ur(ge,Oe,rt){return this instanceof ur?(this.l=+ge,this.a=+Oe,void(this.b=+rt)):arguments.length<2?ge instanceof ur?new ur(ge.l,ge.a,ge.b):ge instanceof sr?or(ge.h,ge.c,ge.l):Dr((ge=pi(ge)).r,ge.g,ge.b):new ur(ge,Oe,rt)}var Gr=18,ln=.95047,gn=1,An=1.08883,Qn=ur.prototype=new na;Qn.brighter=function(ge){return new ur(Math.min(100,this.l+Gr*(arguments.length?ge:1)),this.a,this.b)},Qn.darker=function(ge){return new ur(Math.max(0,this.l-Gr*(arguments.length?ge:1)),this.a,this.b)},Qn.rgb=function(){return pa(this.l,this.a,this.b)};function pa(ge,Oe,rt){var wt=(ge+16)/116,St=wt+Oe/500,It=wt-rt/200;return St=_a(St)*ln,wt=_a(wt)*gn,It=_a(It)*An,new pi(Hn(3.2404542*St-1.5371385*wt-.4985314*It),Hn(-.969266*St+1.8760108*wt+.041556*It),Hn(.0556434*St-.2040259*wt+1.0572252*It))}function ha(ge,Oe,rt){return ge>0?new sr(Math.atan2(rt,Oe)*Lt,Math.sqrt(Oe*Oe+rt*rt),ge):new sr(NaN,NaN,ge)}function _a(ge){return ge>.206893034?ge*ge*ge:(ge-4/29)/7.787037}function Ca(ge){return ge>.008856?Math.pow(ge,1/3):7.787037*ge+4/29}function Hn(ge){return Math.round(255*(ge<=.00304?12.92*ge:1.055*Math.pow(ge,1/2.4)-.055))}h.rgb=pi;function pi(ge,Oe,rt){return this instanceof pi?(this.r=~~ge,this.g=~~Oe,void(this.b=~~rt)):arguments.length<2?ge instanceof pi?new pi(ge.r,ge.g,ge.b):jr(""+ge,pi,Va):new pi(ge,Oe,rt)}function Si(ge){return new pi(ge>>16,ge>>8&255,ge&255)}function Dt(ge){return Si(ge)+""}var xt=pi.prototype=new na;xt.brighter=function(ge){ge=Math.pow(.7,arguments.length?ge:1);var Oe=this.r,rt=this.g,wt=this.b,St=30;return!Oe&&!rt&&!wt?new pi(St,St,St):(Oe&&Oe>4,wt=wt>>4|wt,St=_r&240,St=St>>4|St,It=_r&15,It=It<<4|It):ge.length===7&&(wt=(_r&16711680)>>16,St=(_r&65280)>>8,It=_r&255)),Oe(wt,St,It))}function Vr(ge,Oe,rt){var wt=Math.min(ge/=255,Oe/=255,rt/=255),St=Math.max(ge,Oe,rt),It=St-wt,tr,er,_r=(St+wt)/2;return It?(er=_r<.5?It/(St+wt):It/(2-St-wt),ge==St?tr=(Oe-rt)/It+(Oe0&&_r<1?0:tr),new Un(tr,er,_r)}function Dr(ge,Oe,rt){ge=qr(ge),Oe=qr(Oe),rt=qr(rt);var wt=Ca((.4124564*ge+.3575761*Oe+.1804375*rt)/ln),St=Ca((.2126729*ge+.7151522*Oe+.072175*rt)/gn),It=Ca((.0193339*ge+.119192*Oe+.9503041*rt)/An);return ur(116*St-16,500*(wt-St),200*(St-It))}function qr(ge){return(ge/=255)<=.04045?ge/12.92:Math.pow((ge+.055)/1.055,2.4)}function un(ge){var Oe=parseFloat(ge);return ge.charAt(ge.length-1)==="%"?Math.round(Oe*2.55):Oe}var Jr=h.map({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});Jr.forEach(function(ge,Oe){Jr.set(ge,Si(Oe))});function At(ge){return typeof ge=="function"?ge:function(){return ge}}h.functor=At,h.xhr=lr(F);function lr(ge){return function(Oe,rt,wt){return arguments.length===2&&typeof rt=="function"&&(wt=rt,rt=null),zr(Oe,rt,ge,wt)}}function zr(ge,Oe,rt,wt){var St={},It=h.dispatch("beforesend","progress","load","error"),tr={},er=new XMLHttpRequest,_r=null;self.XDomainRequest&&!("withCredentials"in er)&&/^(http(s)?:)?\/\//.test(ge)&&(er=new XDomainRequest),"onload"in er?er.onload=er.onerror=Zr:er.onreadystatechange=function(){er.readyState>3&&Zr()};function Zr(){var Xr=er.status,dn;if(!Xr&&Rn(er)||Xr>=200&&Xr<300||Xr===304){try{dn=rt.call(St,er)}catch(Mn){It.error.call(St,Mn);return}It.load.call(St,dn)}else It.error.call(St,er)}return er.onprogress=function(Xr){var dn=h.event;h.event=Xr;try{It.progress.call(St,er)}finally{h.event=dn}},St.header=function(Xr,dn){return Xr=(Xr+"").toLowerCase(),arguments.length<2?tr[Xr]:(dn==null?delete tr[Xr]:tr[Xr]=dn+"",St)},St.mimeType=function(Xr){return arguments.length?(Oe=Xr==null?null:Xr+"",St):Oe},St.responseType=function(Xr){return arguments.length?(_r=Xr,St):_r},St.response=function(Xr){return rt=Xr,St},["get","post"].forEach(function(Xr){St[Xr]=function(){return St.send.apply(St,[Xr].concat(S(arguments)))}}),St.send=function(Xr,dn,Mn){if(arguments.length===2&&typeof dn=="function"&&(Mn=dn,dn=null),er.open(Xr,ge,!0),Oe!=null&&!("accept"in tr)&&(tr.accept=Oe+",*/*"),er.setRequestHeader)for(var Cn in tr)er.setRequestHeader(Cn,tr[Cn]);return Oe!=null&&er.overrideMimeType&&er.overrideMimeType(Oe),_r!=null&&(er.responseType=_r),Mn!=null&&St.on("error",Mn).on("load",function(La){Mn(null,La)}),It.beforesend.call(St,er),er.send(dn??null),St},St.abort=function(){return er.abort(),St},h.rebind(St,It,"on"),wt==null?St:St.get(cn(wt))}function cn(ge){return ge.length===1?function(Oe,rt){ge(Oe==null?rt:null)}:ge}function Rn(ge){var Oe=ge.responseType;return Oe&&Oe!=="text"?ge.response:ge.responseText}h.dsv=function(ge,Oe){var rt=new RegExp('["'+ge+` +]`),wt=ge.charCodeAt(0);function St(Zr,Xr,dn){arguments.length<3&&(dn=Xr,Xr=null);var Mn=zr(Zr,Oe,Xr==null?It:tr(Xr),dn);return Mn.row=function(Cn){return arguments.length?Mn.response((Xr=Cn)==null?It:tr(Cn)):Xr},Mn}function It(Zr){return St.parse(Zr.responseText)}function tr(Zr){return function(Xr){return St.parse(Xr.responseText,Zr)}}St.parse=function(Zr,Xr){var dn;return St.parseRows(Zr,function(Mn,Cn){if(dn)return dn(Mn,Cn-1);var La=function(zn){for(var ea={},sa=Mn.length,Sa=0;Sa=La)return Mn;if(Sa)return Sa=!1,dn;var ai=zn;if(Zr.charCodeAt(ai)===34){for(var Zi=ai;Zi++24?(isFinite(Oe)&&(clearTimeout(In),In=setTimeout(Ci,Oe)),fn=0):(fn=1,gi(Ci))}h.timer.flush=function(){Xi(),so()};function Xi(){for(var ge=Date.now(),Oe=qn;Oe;)ge>=Oe.t&&Oe.c(ge-Oe.t)&&(Oe.c=null),Oe=Oe.n;return ge}function so(){for(var ge,Oe=qn,rt=1/0;Oe;)Oe.c?(Oe.t=0;--er)zn.push(St[Zr[dn[er]][2]]);for(er=+Cn;er1&&Ct(ge[rt[wt-2]],ge[rt[wt-1]],ge[St])<=0;)--wt;rt[wt++]=St}return rt.slice(0,wt)}function ts(ge,Oe){return ge[0]-Oe[0]||ge[1]-Oe[1]}h.geom.polygon=function(ge){return V(ge,Ho),ge};var Ho=h.geom.polygon.prototype=[];Ho.area=function(){for(var ge=-1,Oe=this.length,rt,wt=this[Oe-1],St=0;++geJe)er=er.L;else if(tr=Oe-to(er,rt),tr>Je){if(!er.R){wt=er;break}er=er.R}else{It>-Je?(wt=er.P,St=er):tr>-Je?(wt=er,St=er.N):wt=St=er;break}var _r=ul(ge);if(Vs.insert(wt,_r),!(!wt&&!St)){if(wt===St){cl(wt),St=ul(wt.site),Vs.insert(_r,St),_r.edge=St.edge=Xl(wt.site,_r.site),Zs(wt),Zs(St);return}if(!St){_r.edge=Xl(wt.site,_r.site);return}cl(wt),cl(St);var Zr=wt.site,Xr=Zr.x,dn=Zr.y,Mn=ge.x-Xr,Cn=ge.y-dn,La=St.site,zn=La.x-Xr,ea=La.y-dn,sa=2*(Mn*ea-Cn*zn),Sa=Mn*Mn+Cn*Cn,Ra=zn*zn+ea*ea,oa={x:(ea*Sa-Cn*Ra)/sa+Xr,y:(Mn*Ra-zn*Sa)/sa+dn};Io(St.edge,Zr,La,oa),_r.edge=Xl(Zr,ge,null,oa),St.edge=Xl(ge,La,null,oa),Zs(wt),Zs(St)}}function fi(ge,Oe){var rt=ge.site,wt=rt.x,St=rt.y,It=St-Oe;if(!It)return wt;var tr=ge.P;if(!tr)return-1/0;rt=tr.site;var er=rt.x,_r=rt.y,Zr=_r-Oe;if(!Zr)return er;var Xr=er-wt,dn=1/It-1/Zr,Mn=Xr/Zr;return dn?(-Mn+Math.sqrt(Mn*Mn-2*dn*(Xr*Xr/(-2*Zr)-_r+Zr/2+St-It/2)))/dn+wt:(wt+er)/2}function to(ge,Oe){var rt=ge.N;if(rt)return fi(rt,Oe);var wt=ge.site;return wt.y===Oe?wt.x:1/0}function Cl(ge){this.site=ge,this.edges=[]}Cl.prototype.prepare=function(){for(var ge=this.edges,Oe=ge.length,rt;Oe--;)rt=ge[Oe].edge,(!rt.b||!rt.a)&&ge.splice(Oe,1);return ge.sort(Fo),ge.length};function Ps(ge){for(var Oe=ge[0][0],rt=ge[1][0],wt=ge[0][1],St=ge[1][1],It,tr,er,_r,Zr=Ys,Xr=Zr.length,dn,Mn,Cn,La,zn,ea;Xr--;)if(dn=Zr[Xr],!(!dn||!dn.prepare()))for(Cn=dn.edges,La=Cn.length,Mn=0;MnJe||l(_r-tr)>Je)&&(Cn.splice(Mn,0,new cu(Yl(dn.site,ea,l(er-Oe)Je?{x:Oe,y:l(It-Oe)Je?{x:l(tr-St)Je?{x:rt,y:l(It-rt)Je?{x:l(tr-wt)=-ke)){var Mn=_r*_r+Zr*Zr,Cn=Xr*Xr+ea*ea,La=(ea*Mn-Zr*Cn)/dn,zn=(_r*Cn-Xr*Mn)/dn,ea=zn+er,sa=po.pop()||new Il;sa.arc=ge,sa.site=St,sa.x=La+tr,sa.y=ea+Math.sqrt(La*La+zn*zn),sa.cy=ea,ge.circle=sa;for(var Sa=null,Ra=Zo._;Ra;)if(sa.y0)){if(zn/=Cn,Cn<0){if(zn0){if(zn>Mn)return;zn>dn&&(dn=zn)}if(zn=rt-er,!(!Cn&&zn<0)){if(zn/=Cn,Cn<0){if(zn>Mn)return;zn>dn&&(dn=zn)}else if(Cn>0){if(zn0)){if(zn/=La,La<0){if(zn0){if(zn>Mn)return;zn>dn&&(dn=zn)}if(zn=wt-_r,!(!La&&zn<0)){if(zn/=La,La<0){if(zn>Mn)return;zn>dn&&(dn=zn)}else if(La>0){if(zn0&&(St.a={x:er+dn*Cn,y:_r+dn*La}),Mn<1&&(St.b={x:er+Mn*Cn,y:_r+Mn*La}),St}}}}}}function Qi(ge){for(var Oe=Uo,rt=Au(ge[0][0],ge[0][1],ge[1][0],ge[1][1]),wt=Oe.length,St;wt--;)St=Oe[wt],(!gs(St,ge)||!rt(St)||l(St.a.x-St.b.x)=It)return;if(Xr>Mn){if(!wt)wt={x:La,y:tr};else if(wt.y>=er)return;rt={x:La,y:er}}else{if(!wt)wt={x:La,y:er};else if(wt.y1)if(Xr>Mn){if(!wt)wt={x:(tr-sa)/ea,y:tr};else if(wt.y>=er)return;rt={x:(er-sa)/ea,y:er}}else{if(!wt)wt={x:(er-sa)/ea,y:er};else if(wt.y=It)return;rt={x:It,y:ea*It+sa}}else{if(!wt)wt={x:It,y:ea*It+sa};else if(wt.x=Xr&&sa.x<=Mn&&sa.y>=dn&&sa.y<=Cn?[[Xr,Cn],[Mn,Cn],[Mn,dn],[Xr,dn]]:[];Sa.point=_r[zn]}),Zr}function er(_r){return _r.map(function(Zr,Xr){return{x:Math.round(wt(Zr,Xr)/Je)*Je,y:Math.round(St(Zr,Xr)/Je)*Je,i:Xr}})}return tr.links=function(_r){return Zu(er(_r)).edges.filter(function(Zr){return Zr.l&&Zr.r}).map(function(Zr){return{source:_r[Zr.l.i],target:_r[Zr.r.i]}})},tr.triangles=function(_r){var Zr=[];return Zu(er(_r)).cells.forEach(function(Xr,dn){for(var Mn=Xr.site,Cn=Xr.edges.sort(Fo),La=-1,zn=Cn.length,ea,sa=Cn[zn-1].edge,Sa=sa.l===Mn?sa.r:sa.l;++LaRa&&(Ra=Xr.x),Xr.y>oa&&(oa=Xr.y),Cn.push(Xr.x),La.push(Xr.y);else for(zn=0;znRa&&(Ra=ai),Zi>oa&&(oa=Zi),Cn.push(ai),La.push(Zi)}var Di=Ra-sa,Vi=oa-Sa;Di>Vi?oa=Sa+Di:Ra=sa+Vi;function _o(Po,os,nl,Iu,ru,lo,Ls,Qs){if(!(isNaN(nl)||isNaN(Iu)))if(Po.leaf){var $l=Po.x,Ol=Po.y;if($l!=null)if(l($l-nl)+l(Ol-Iu)<.01)ko(Po,os,nl,Iu,ru,lo,Ls,Qs);else{var Sc=Po.point;Po.x=Po.y=Po.point=null,ko(Po,Sc,$l,Ol,ru,lo,Ls,Qs),ko(Po,os,nl,Iu,ru,lo,Ls,Qs)}else Po.x=nl,Po.y=Iu,Po.point=os}else ko(Po,os,nl,Iu,ru,lo,Ls,Qs)}function ko(Po,os,nl,Iu,ru,lo,Ls,Qs){var $l=(ru+Ls)*.5,Ol=(lo+Qs)*.5,Sc=nl>=$l,El=Iu>=Ol,Kl=El<<1|Sc;Po.leaf=!1,Po=Po.nodes[Kl]||(Po.nodes[Kl]=Tl()),Sc?ru=$l:Ls=$l,El?lo=Ol:Qs=Ol,_o(Po,os,nl,Iu,ru,lo,Ls,Qs)}var Ws=Tl();if(Ws.add=function(Po){_o(Ws,Po,+dn(Po,++zn),+Mn(Po,zn),sa,Sa,Ra,oa)},Ws.visit=function(Po){Dc(Po,Ws,sa,Sa,Ra,oa)},Ws.find=function(Po){return zh(Ws,Po[0],Po[1],sa,Sa,Ra,oa)},zn=-1,Oe==null){for(;++znIt||Mn>tr||Cn=ai,Vi=rt>=Zi,_o=Vi<<1|Di,ko=_o+4;_ort&&(It=Oe.slice(rt,It),er[tr]?er[tr]+=It:er[++tr]=It),(wt=wt[0])===(St=St[0])?er[tr]?er[tr]+=St:er[++tr]=St:(er[++tr]=null,_r.push({i:tr,x:sc(wt,St)})),rt=$u.lastIndex;return rt=0&&!(wt=h.interpolators[rt](ge,Oe)););return wt}h.interpolators=[function(ge,Oe){var rt=typeof Oe;return(rt==="string"?Jr.has(Oe.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Oe)?oc:nf:Oe instanceof na?oc:Array.isArray(Oe)?Dl:rt==="object"&&isNaN(Oe)?Wu:sc)(ge,Oe)}],h.interpolateArray=Dl;function Dl(ge,Oe){var rt=[],wt=[],St=ge.length,It=Oe.length,tr=Math.min(ge.length,Oe.length),er;for(er=0;er=0?ge.slice(0,Oe):ge,wt=Oe>=0?ge.slice(Oe+1):"in";return rt=wc.get(rt)||Mf,wt=Ff.get(wt)||F,fu(wt(rt.apply(null,b.call(arguments,1))))};function fu(ge){return function(Oe){return Oe<=0?0:Oe>=1?1:ge(Oe)}}function Sd(ge){return function(Oe){return 1-ge(1-Oe)}}function Fs(ge){return function(Oe){return .5*(Oe<.5?ge(2*Oe):2-ge(2-2*Oe))}}function Vd(ge){return ge*ge}function pl(ge){return ge*ge*ge}function Oo(ge){if(ge<=0)return 0;if(ge>=1)return 1;var Oe=ge*ge,rt=Oe*ge;return 4*(ge<.5?rt:3*(ge-Oe)+rt-.75)}function th(ge){return function(Oe){return Math.pow(Oe,ge)}}function af(ge){return 1-Math.cos(ge*Xe)}function Ou(ge){return Math.pow(2,10*(ge-1))}function Oh(ge){return 1-Math.sqrt(1-ge*ge)}function Bf(ge,Oe){var rt;return arguments.length<2&&(Oe=.45),arguments.length?rt=Oe/ye*Math.asin(1/ge):(ge=1,rt=Oe/4),function(wt){return 1+ge*Math.pow(2,-10*wt)*Math.sin((wt-rt)*ye/Oe)}}function uh(ge){return ge||(ge=1.70158),function(Oe){return Oe*Oe*((ge+1)*Oe-ge)}}function Ku(ge){return ge<1/2.75?7.5625*ge*ge:ge<2/2.75?7.5625*(ge-=1.5/2.75)*ge+.75:ge<2.5/2.75?7.5625*(ge-=2.25/2.75)*ge+.9375:7.5625*(ge-=2.625/2.75)*ge+.984375}h.interpolateHcl=fd;function fd(ge,Oe){ge=h.hcl(ge),Oe=h.hcl(Oe);var rt=ge.h,wt=ge.c,St=ge.l,It=Oe.h-rt,tr=Oe.c-wt,er=Oe.l-St;return isNaN(tr)&&(tr=0,wt=isNaN(wt)?Oe.c:wt),isNaN(It)?(It=0,rt=isNaN(rt)?Oe.h:rt):It>180?It-=360:It<-180&&(It+=360),function(_r){return or(rt+It*_r,wt+tr*_r,St+er*_r)+""}}h.interpolateHsl=Hh;function Hh(ge,Oe){ge=h.hsl(ge),Oe=h.hsl(Oe);var rt=ge.h,wt=ge.s,St=ge.l,It=Oe.h-rt,tr=Oe.s-wt,er=Oe.l-St;return isNaN(tr)&&(tr=0,wt=isNaN(wt)?Oe.s:wt),isNaN(It)?(It=0,rt=isNaN(rt)?Oe.h:rt):It>180?It-=360:It<-180&&(It+=360),function(_r){return Va(rt+It*_r,wt+tr*_r,St+er*_r)+""}}h.interpolateLab=ch;function ch(ge,Oe){ge=h.lab(ge),Oe=h.lab(Oe);var rt=ge.l,wt=ge.a,St=ge.b,It=Oe.l-rt,tr=Oe.a-wt,er=Oe.b-St;return function(_r){return pa(rt+It*_r,wt+tr*_r,St+er*_r)+""}}h.interpolateRound=Nf;function Nf(ge,Oe){return Oe-=ge,function(rt){return Math.round(ge+Oe*rt)}}h.transform=function(ge){var Oe=E.createElementNS(h.ns.prefix.svg,"g");return(h.transform=function(rt){if(rt!=null){Oe.setAttribute("transform",rt);var wt=Oe.transform.baseVal.consolidate()}return new Fh(wt?wt.matrix:Ef)})(ge)};function Fh(ge){var Oe=[ge.a,ge.b],rt=[ge.c,ge.d],wt=of(Oe),St=Bh(Oe,rt),It=of(Gh(rt,Oe,-St))||0;Oe[0]*rt[1]180?Oe+=360:Oe-ge>180&&(ge+=360),wt.push({i:rt.push(vf(rt)+"rotate(",null,")")-2,x:sc(ge,Oe)})):Oe&&rt.push(vf(rt)+"rotate("+Oe+")")}function Nh(ge,Oe,rt,wt){ge!==Oe?wt.push({i:rt.push(vf(rt)+"skewX(",null,")")-2,x:sc(ge,Oe)}):Oe&&rt.push(vf(rt)+"skewX("+Oe+")")}function Ul(ge,Oe,rt,wt){if(ge[0]!==Oe[0]||ge[1]!==Oe[1]){var St=rt.push(vf(rt)+"scale(",null,",",null,")");wt.push({i:St-4,x:sc(ge[0],Oe[0])},{i:St-2,x:sc(ge[1],Oe[1])})}else(Oe[0]!==1||Oe[1]!==1)&&rt.push(vf(rt)+"scale("+Oe+")")}function Th(ge,Oe){var rt=[],wt=[];return ge=h.transform(ge),Oe=h.transform(Oe),Ju(ge.translate,Oe.translate,rt,wt),Wf(ge.rotate,Oe.rotate,rt,wt),Nh(ge.skew,Oe.skew,rt,wt),Ul(ge.scale,Oe.scale,rt,wt),ge=Oe=null,function(St){for(var It=-1,tr=wt.length,er;++It0?It=oa:(rt.c=null,rt.t=NaN,rt=null,Oe.end({type:"end",alpha:It=0})):oa>0&&(Oe.start({type:"start",alpha:It=oa}),rt=Ea(ge.tick)),ge):It},ge.start=function(){var oa,ai=Cn.length,Zi=La.length,Di=wt[0],Vi=wt[1],_o,ko;for(oa=0;oa=0;)It.push(Xr=Zr[_r]),Xr.parent=er,Xr.depth=er.depth+1;rt&&(er.value=0),er.children=Zr}else rt&&(er.value=+rt.call(wt,er,er.depth)||0),delete er.children;return pf(St,function(dn){var Mn,Cn;ge&&(Mn=dn.children)&&Mn.sort(ge),rt&&(Cn=dn.parent)&&(Cn.value+=dn.value)}),tr}return wt.sort=function(St){return arguments.length?(ge=St,wt):ge},wt.children=function(St){return arguments.length?(Oe=St,wt):Oe},wt.value=function(St){return arguments.length?(rt=St,wt):rt},wt.revalue=function(St){return rt&&(rh(St,function(It){It.children&&(It.value=0)}),pf(St,function(It){var tr;It.children||(It.value=+rt.call(wt,It,It.depth)||0),(tr=It.parent)&&(tr.value+=It.value)})),St},wt};function hu(ge,Oe){return h.rebind(ge,Oe,"sort","children","value"),ge.nodes=ge,ge.links=tv,ge}function rh(ge,Oe){for(var rt=[ge];(ge=rt.pop())!=null;)if(Oe(ge),(St=ge.children)&&(wt=St.length))for(var wt,St;--wt>=0;)rt.push(St[wt])}function pf(ge,Oe){for(var rt=[ge],wt=[];(ge=rt.pop())!=null;)if(wt.push(ge),(tr=ge.children)&&(It=tr.length))for(var St=-1,It,tr;++StSt&&(St=er),wt.push(er)}for(tr=0;trwt&&(rt=Oe,wt=St);return rt}function Bc(ge){return ge.reduce(sf,0)}function sf(ge,Oe){return ge+Oe[1]}h.layout.histogram=function(){var ge=!0,Oe=Number,rt=hh,wt=Uh;function St(It,Mn){for(var er=[],_r=It.map(Oe,this),Zr=rt.call(this,_r,Mn),Xr=wt.call(this,Zr,_r,Mn),dn,Mn=-1,Cn=_r.length,La=Xr.length-1,zn=ge?1:1/Cn,ea;++Mn0)for(Mn=-1;++Mn=Zr[0]&&ea<=Zr[1]&&(dn=er[h.bisect(Xr,ea,1,La)-1],dn.y+=zn,dn.push(It[Mn]));return er}return St.value=function(It){return arguments.length?(Oe=It,St):Oe},St.range=function(It){return arguments.length?(rt=At(It),St):rt},St.bins=function(It){return arguments.length?(wt=typeof It=="number"?function(tr){return lu(tr,It)}:At(It),St):wt},St.frequency=function(It){return arguments.length?(ge=!!It,St):ge},St};function Uh(ge,Oe){return lu(ge,Math.ceil(Math.log(Oe.length)/Math.LN2+1))}function lu(ge,Oe){for(var rt=-1,wt=+ge[0],St=(ge[1]-wt)/Oe,It=[];++rt<=Oe;)It[rt]=St*rt+wt;return It}function hh(ge){return[h.min(ge),h.max(ge)]}h.layout.pack=function(){var ge=h.layout.hierarchy().sort(qf),Oe=0,rt=[1,1],wt;function St(It,tr){var er=ge.call(this,It,tr),_r=er[0],Zr=rt[0],Xr=rt[1],dn=wt==null?Math.sqrt:typeof wt=="function"?wt:function(){return wt};if(_r.x=_r.y=0,pf(_r,function(Cn){Cn.r=+dn(Cn.value)}),pf(_r,vh),Oe){var Mn=Oe*(wt?1:Math.max(2*_r.r/Zr,2*_r.r/Xr))/2;pf(_r,function(Cn){Cn.r+=Mn}),pf(_r,vh),pf(_r,function(Cn){Cn.r-=Mn})}return $h(_r,Zr/2,Xr/2,wt?1:1/Math.max(2*_r.r/Zr,2*_r.r/Xr)),er}return St.size=function(It){return arguments.length?(rt=It,St):rt},St.radius=function(It){return arguments.length?(wt=It==null||typeof It=="function"?It:+It,St):wt},St.padding=function(It){return arguments.length?(Oe=+It,St):Oe},hu(St,ge)};function qf(ge,Oe){return ge.value-Oe.value}function Zc(ge,Oe){var rt=ge._pack_next;ge._pack_next=Oe,Oe._pack_prev=ge,Oe._pack_next=rt,rt._pack_prev=Oe}function dh(ge,Oe){ge._pack_next=Oe,Oe._pack_prev=ge}function mf(ge,Oe){var rt=Oe.x-ge.x,wt=Oe.y-ge.y,St=ge.r+Oe.r;return .999*St*St>rt*rt+wt*wt}function vh(ge){if(!(Oe=ge.children)||!(Mn=Oe.length))return;var Oe,rt=1/0,wt=-1/0,St=1/0,It=-1/0,tr,er,_r,Zr,Xr,dn,Mn;function Cn(oa){rt=Math.min(oa.x-oa.r,rt),wt=Math.max(oa.x+oa.r,wt),St=Math.min(oa.y-oa.r,St),It=Math.max(oa.y+oa.r,It)}if(Oe.forEach(kd),tr=Oe[0],tr.x=-tr.r,tr.y=0,Cn(tr),Mn>1&&(er=Oe[1],er.x=er.r,er.y=0,Cn(er),Mn>2))for(_r=Oe[2],Wc(tr,er,_r),Cn(_r),Zc(tr,_r),tr._pack_prev=_r,Zc(_r,er),er=tr._pack_next,Zr=3;Zrea.x&&(ea=ai),ai.depth>sa.depth&&(sa=ai)});var Sa=Oe(zn,ea)/2-zn.x,Ra=rt[0]/(ea.x+Oe(ea,zn)/2+Sa),oa=rt[1]/(sa.depth||1);rh(Cn,function(ai){ai.x=(ai.x+Sa)*Ra,ai.y=ai.depth*oa})}return Mn}function It(Xr){for(var dn={A:null,children:[Xr]},Mn=[dn],Cn;(Cn=Mn.pop())!=null;)for(var La=Cn.children,zn,ea=0,sa=La.length;ea0&&(Tc(Vf(zn,Xr,Mn),Xr,ai),sa+=ai,Sa+=ai),Ra+=zn.m,sa+=Cn.m,oa+=ea.m,Sa+=La.m;zn&&!Su(La)&&(La.t=zn,La.m+=Ra-Sa),Cn&&!gf(ea)&&(ea.t=Cn,ea.m+=sa-oa,Mn=Xr)}return Mn}function Zr(Xr){Xr.x*=rt[0],Xr.y=Xr.depth*rt[1]}return St.separation=function(Xr){return arguments.length?(Oe=Xr,St):Oe},St.size=function(Xr){return arguments.length?(wt=(rt=Xr)==null?Zr:null,St):wt?null:rt},St.nodeSize=function(Xr){return arguments.length?(wt=(rt=Xr)==null?null:Zr,St):wt?rt:null},hu(St,ge)};function Cf(ge,Oe){return ge.parent==Oe.parent?1:2}function gf(ge){var Oe=ge.children;return Oe.length?Oe[0]:ge.t}function Su(ge){var Oe=ge.children,rt;return(rt=Oe.length)?Oe[rt-1]:ge.t}function Tc(ge,Oe,rt){var wt=rt/(Oe.i-ge.i);Oe.c-=wt,Oe.s+=rt,ge.c+=wt,Oe.z+=rt,Oe.m+=rt}function pu(ge){for(var Oe=0,rt=0,wt=ge.children,St=wt.length,It;--St>=0;)It=wt[St],It.z+=Oe,It.m+=Oe,Oe+=It.s+(rt+=It.c)}function Vf(ge,Oe,rt){return ge.a.parent===Oe.parent?ge.a:rt}h.layout.cluster=function(){var ge=h.layout.hierarchy().sort(null).value(null),Oe=Cf,rt=[1,1],wt=!1;function St(It,tr){var er=ge.call(this,It,tr),_r=er[0],Zr,Xr=0;pf(_r,function(zn){var ea=zn.children;ea&&ea.length?(zn.x=jh(ea),zn.y=yf(ea)):(zn.x=Zr?Xr+=Oe(zn,Zr):0,zn.y=0,Zr=zn)});var dn=cr(_r),Mn=Rr(_r),Cn=dn.x-Oe(dn,Mn)/2,La=Mn.x+Oe(Mn,dn)/2;return pf(_r,wt?function(zn){zn.x=(zn.x-_r.x)*rt[0],zn.y=(_r.y-zn.y)*rt[1]}:function(zn){zn.x=(zn.x-Cn)/(La-Cn)*rt[0],zn.y=(1-(_r.y?zn.y/_r.y:1))*rt[1]}),er}return St.separation=function(It){return arguments.length?(Oe=It,St):Oe},St.size=function(It){return arguments.length?(wt=(rt=It)==null,St):wt?null:rt},St.nodeSize=function(It){return arguments.length?(wt=(rt=It)!=null,St):wt?rt:null},hu(St,ge)};function yf(ge){return 1+h.max(ge,function(Oe){return Oe.y})}function jh(ge){return ge.reduce(function(Oe,rt){return Oe+rt.x},0)/ge.length}function cr(ge){var Oe=ge.children;return Oe&&Oe.length?cr(Oe[0]):ge}function Rr(ge){var Oe=ge.children,rt;return Oe&&(rt=Oe.length)?Rr(Oe[rt-1]):ge}h.layout.treemap=function(){var ge=h.layout.hierarchy(),Oe=Math.round,rt=[1,1],wt=null,St=pn,It=!1,tr,er="squarify",_r=.5*(1+Math.sqrt(5));function Zr(zn,ea){for(var sa=-1,Sa=zn.length,Ra,oa;++sa0;)Sa.push(oa=Ra[Vi-1]),Sa.area+=oa.area,er!=="squarify"||(Zi=Mn(Sa,Di))<=ai?(Ra.pop(),ai=Zi):(Sa.area-=Sa.pop().area,Cn(Sa,Di,sa,!1),Di=Math.min(sa.dx,sa.dy),Sa.length=Sa.area=0,ai=1/0);Sa.length&&(Cn(Sa,Di,sa,!0),Sa.length=Sa.area=0),ea.forEach(Xr)}}function dn(zn){var ea=zn.children;if(ea&&ea.length){var sa=St(zn),Sa=ea.slice(),Ra,oa=[];for(Zr(Sa,sa.dx*sa.dy/zn.value),oa.area=0;Ra=Sa.pop();)oa.push(Ra),oa.area+=Ra.area,Ra.z!=null&&(Cn(oa,Ra.z?sa.dx:sa.dy,sa,!Sa.length),oa.length=oa.area=0);ea.forEach(dn)}}function Mn(zn,ea){for(var sa=zn.area,Sa,Ra=0,oa=1/0,ai=-1,Zi=zn.length;++aiRa&&(Ra=Sa));return sa*=sa,ea*=ea,sa?Math.max(ea*Ra*_r/sa,sa/(ea*oa*_r)):1/0}function Cn(zn,ea,sa,Sa){var Ra=-1,oa=zn.length,ai=sa.x,Zi=sa.y,Di=ea?Oe(zn.area/ea):0,Vi;if(ea==sa.dx){for((Sa||Di>sa.dy)&&(Di=sa.dy);++Rasa.dx)&&(Di=sa.dx);++Ra1);return ge+Oe*wt*Math.sqrt(-2*Math.log(It)/It)}},logNormal:function(){var ge=h.random.normal.apply(h,arguments);return function(){return Math.exp(ge())}},bates:function(ge){var Oe=h.random.irwinHall(ge);return function(){return Oe()/ge}},irwinHall:function(ge){return function(){for(var Oe=0,rt=0;rt2?Ha:xa,Zr=wt?Xh:Md;return St=_r(ge,Oe,Zr,rt),It=_r(Oe,ge,Zr,Hs),er}function er(_r){return St(_r)}return er.invert=function(_r){return It(_r)},er.domain=function(_r){return arguments.length?(ge=_r.map(Number),tr()):ge},er.range=function(_r){return arguments.length?(Oe=_r,tr()):Oe},er.rangeRound=function(_r){return er.range(_r).interpolate(Nf)},er.clamp=function(_r){return arguments.length?(wt=_r,tr()):wt},er.interpolate=function(_r){return arguments.length?(rt=_r,tr()):rt},er.ticks=function(_r){return No(ge,_r)},er.tickFormat=function(_r,Zr){return d3_scale_linearTickFormat(ge,_r,Zr)},er.nice=function(_r){return Na(ge,_r),tr()},er.copy=function(){return bi(ge,Oe,rt,wt)},tr()}function Qa(ge,Oe){return h.rebind(ge,Oe,"range","rangeRound","interpolate","clamp")}function Na(ge,Oe){return ti(ge,li(Yi(ge,Oe)[2])),ti(ge,li(Yi(ge,Oe)[2])),ge}function Yi(ge,Oe){Oe==null&&(Oe=10);var rt=On(ge),wt=rt[1]-rt[0],St=Math.pow(10,Math.floor(Math.log(wt/Oe)/Math.LN10)),It=Oe/wt*St;return It<=.15?St*=10:It<=.35?St*=5:It<=.75&&(St*=2),rt[0]=Math.ceil(rt[0]/St)*St,rt[1]=Math.floor(rt[1]/St)*St+St*.5,rt[2]=St,rt}function No(ge,Oe){return h.range.apply(h,Yi(ge,Oe))}h.scale.log=function(){return Do(h.scale.linear().domain([0,1]),10,!0,[1,10])};function Do(ge,Oe,rt,wt){function St(er){return(rt?Math.log(er<0?0:er):-Math.log(er>0?0:-er))/Math.log(Oe)}function It(er){return rt?Math.pow(Oe,er):-Math.pow(Oe,-er)}function tr(er){return ge(St(er))}return tr.invert=function(er){return It(ge.invert(er))},tr.domain=function(er){return arguments.length?(rt=er[0]>=0,ge.domain((wt=er.map(Number)).map(St)),tr):wt},tr.base=function(er){return arguments.length?(Oe=+er,ge.domain(wt.map(St)),tr):Oe},tr.nice=function(){var er=ti(wt.map(St),rt?Math:Go);return ge.domain(er),wt=er.map(It),tr},tr.ticks=function(){var er=On(wt),_r=[],Zr=er[0],Xr=er[1],dn=Math.floor(St(Zr)),Mn=Math.ceil(St(Xr)),Cn=Oe%1?2:Oe;if(isFinite(Mn-dn)){if(rt){for(;dn0;La--)_r.push(It(dn)*La);for(dn=0;_r[dn]Xr;Mn--);_r=_r.slice(dn,Mn)}return _r},tr.copy=function(){return Do(ge.copy(),Oe,rt,wt)},Qa(tr,ge)}var Go={floor:function(ge){return-Math.ceil(-ge)},ceil:function(ge){return-Math.floor(-ge)}};h.scale.pow=function(){return jo(h.scale.linear(),1,[0,1])};function jo(ge,Oe,rt){var wt=Wi(Oe),St=Wi(1/Oe);function It(tr){return ge(wt(tr))}return It.invert=function(tr){return St(ge.invert(tr))},It.domain=function(tr){return arguments.length?(ge.domain((rt=tr.map(Number)).map(wt)),It):rt},It.ticks=function(tr){return No(rt,tr)},It.tickFormat=function(tr,er){return d3_scale_linearTickFormat(rt,tr,er)},It.nice=function(tr){return It.domain(Na(rt,tr))},It.exponent=function(tr){return arguments.length?(wt=Wi(Oe=tr),St=Wi(1/Oe),ge.domain(rt.map(wt)),It):Oe},It.copy=function(){return jo(ge.copy(),Oe,rt)},Qa(It,ge)}function Wi(ge){return function(Oe){return Oe<0?-Math.pow(-Oe,ge):Math.pow(Oe,ge)}}h.scale.sqrt=function(){return h.scale.pow().exponent(.5)},h.scale.ordinal=function(){return Li([],{t:"range",a:[[]]})};function Li(ge,Oe){var rt,wt,St;function It(er){return wt[((rt.get(er)||(Oe.t==="range"?rt.set(er,ge.push(er)):NaN))-1)%wt.length]}function tr(er,_r){return h.range(ge.length).map(function(Zr){return er+_r*Zr})}return It.domain=function(er){if(!arguments.length)return ge;ge=[],rt=new A;for(var _r=-1,Zr=er.length,Xr;++_r0?rt[It-1]:ge[0],ItMn?0:1;if(Xr=Ee)return _r(Xr,La)+(Zr?_r(Zr,1-La):"")+"Z";var zn,ea,sa,Sa,Ra=0,oa=0,ai,Zi,Di,Vi,_o,ko,Ws,Po,os=[];if((Sa=(+tr.apply(this,arguments)||0)/2)&&(sa=wt===Hl?Math.sqrt(Zr*Zr+Xr*Xr):+wt.apply(this,arguments),La||(oa*=-1),Xr&&(oa=Ot(sa/Xr*Math.sin(Sa))),Zr&&(Ra=Ot(sa/Zr*Math.sin(Sa)))),Xr){ai=Xr*Math.cos(dn+oa),Zi=Xr*Math.sin(dn+oa),Di=Xr*Math.cos(Mn-oa),Vi=Xr*Math.sin(Mn-oa);var nl=Math.abs(Mn-dn-2*oa)<=xe?0:1;if(oa&&_c(ai,Zi,Di,Vi)===La^nl){var Iu=(dn+Mn)/2;ai=Xr*Math.cos(Iu),Zi=Xr*Math.sin(Iu),Di=Vi=null}}else ai=Zi=0;if(Zr){_o=Zr*Math.cos(Mn-Ra),ko=Zr*Math.sin(Mn-Ra),Ws=Zr*Math.cos(dn+Ra),Po=Zr*Math.sin(dn+Ra);var ru=Math.abs(dn-Mn+2*Ra)<=xe?0:1;if(Ra&&_c(_o,ko,Ws,Po)===1-La^ru){var lo=(dn+Mn)/2;_o=Zr*Math.cos(lo),ko=Zr*Math.sin(lo),Ws=Po=null}}else _o=ko=0;if(Cn>Je&&(zn=Math.min(Math.abs(Xr-Zr)/2,+rt.apply(this,arguments)))>.001){ea=Zr0?0:1}function Ac(ge,Oe,rt,wt,St){var It=ge[0]-Oe[0],tr=ge[1]-Oe[1],er=(St?wt:-wt)/Math.sqrt(It*It+tr*tr),_r=er*tr,Zr=-er*It,Xr=ge[0]+_r,dn=ge[1]+Zr,Mn=Oe[0]+_r,Cn=Oe[1]+Zr,La=(Xr+Mn)/2,zn=(dn+Cn)/2,ea=Mn-Xr,sa=Cn-dn,Sa=ea*ea+sa*sa,Ra=rt-wt,oa=Xr*Cn-Mn*dn,ai=(sa<0?-1:1)*Math.sqrt(Math.max(0,Ra*Ra*Sa-oa*oa)),Zi=(oa*sa-ea*ai)/Sa,Di=(-oa*ea-sa*ai)/Sa,Vi=(oa*sa+ea*ai)/Sa,_o=(-oa*ea+sa*ai)/Sa,ko=Zi-La,Ws=Di-zn,Po=Vi-La,os=_o-zn;return ko*ko+Ws*Ws>Po*Po+os*os&&(Zi=Vi,Di=_o),[[Zi-_r,Di-Zr],[Zi*rt/Ra,Di*rt/Ra]]}function $f(){return!0}function xc(ge){var Oe=io,rt=Mo,wt=$f,St=Lu,It=St.key,tr=.7;function er(_r){var Zr=[],Xr=[],dn=-1,Mn=_r.length,Cn,La=At(Oe),zn=At(rt);function ea(){Zr.push("M",St(ge(Xr),tr))}for(;++dn1?ge.join("L"):ge+"Z"}function Pf(ge){return ge.join("L")+"Z"}function Xo(ge){for(var Oe=0,rt=ge.length,wt=ge[0],St=[wt[0],",",wt[1]];++Oe1&&St.push("H",wt[0]),St.join("")}function as(ge){for(var Oe=0,rt=ge.length,wt=ge[0],St=[wt[0],",",wt[1]];++Oe1){er=Oe[1],It=ge[_r],_r++,wt+="C"+(St[0]+tr[0])+","+(St[1]+tr[1])+","+(It[0]-er[0])+","+(It[1]-er[1])+","+It[0]+","+It[1];for(var Zr=2;Zr9&&(It=rt*3/Math.sqrt(It),tr[er]=It*wt,tr[er+1]=It*St));for(er=-1;++er<=_r;)It=(ge[Math.min(_r,er+1)][0]-ge[Math.max(0,er-1)][0])/(6*(1+tr[er]*tr[er])),Oe.push([It||0,tr[er]*It||0]);return Oe}function tt(ge){return ge.length<3?Lu(ge):ge[0]+P(ge,Ze(ge))}h.svg.line.radial=function(){var ge=xc(vt);return ge.radius=ge.x,delete ge.x,ge.angle=ge.y,delete ge.y,ge};function vt(ge){for(var Oe,rt=-1,wt=ge.length,St,It;++rtxe)+",1 "+dn}function Zr(Xr,dn,Mn,Cn){return"Q 0,0 "+Cn}return It.radius=function(Xr){return arguments.length?(rt=At(Xr),It):rt},It.source=function(Xr){return arguments.length?(ge=At(Xr),It):ge},It.target=function(Xr){return arguments.length?(Oe=At(Xr),It):Oe},It.startAngle=function(Xr){return arguments.length?(wt=At(Xr),It):wt},It.endAngle=function(Xr){return arguments.length?(St=At(Xr),It):St},It};function Ut(ge){return ge.radius}h.svg.diagonal=function(){var ge=zt,Oe=Et,rt=gr;function wt(St,It){var tr=ge.call(this,St,It),er=Oe.call(this,St,It),_r=(tr.y+er.y)/2,Zr=[tr,{x:tr.x,y:_r},{x:er.x,y:_r},er];return Zr=Zr.map(rt),"M"+Zr[0]+"C"+Zr[1]+" "+Zr[2]+" "+Zr[3]}return wt.source=function(St){return arguments.length?(ge=At(St),wt):ge},wt.target=function(St){return arguments.length?(Oe=At(St),wt):Oe},wt.projection=function(St){return arguments.length?(rt=St,wt):rt},wt};function gr(ge){return[ge.x,ge.y]}h.svg.diagonal.radial=function(){var ge=h.svg.diagonal(),Oe=gr,rt=ge.projection;return ge.projection=function(wt){return arguments.length?rt(Tr(Oe=wt)):Oe},ge};function Tr(ge){return function(){var Oe=ge.apply(this,arguments),rt=Oe[0],wt=Oe[1]-Xe;return[rt*Math.cos(wt),rt*Math.sin(wt)]}}h.svg.symbol=function(){var ge=Yr,Oe=Pr;function rt(wt,St){return(En.get(ge.call(this,wt,St))||sn)(Oe.call(this,wt,St))}return rt.type=function(wt){return arguments.length?(ge=At(wt),rt):ge},rt.size=function(wt){return arguments.length?(Oe=At(wt),rt):Oe},rt};function Pr(){return 64}function Yr(){return"circle"}function sn(ge){var Oe=Math.sqrt(ge/xe);return"M0,"+Oe+"A"+Oe+","+Oe+" 0 1,1 0,"+-Oe+"A"+Oe+","+Oe+" 0 1,1 0,"+Oe+"Z"}var En=h.map({circle:sn,cross:function(ge){var Oe=Math.sqrt(ge/5)/2;return"M"+-3*Oe+","+-Oe+"H"+-Oe+"V"+-3*Oe+"H"+Oe+"V"+-Oe+"H"+3*Oe+"V"+Oe+"H"+Oe+"V"+3*Oe+"H"+-Oe+"V"+Oe+"H"+-3*Oe+"Z"},diamond:function(ge){var Oe=Math.sqrt(ge/(2*Xn)),rt=Oe*Xn;return"M0,"+-Oe+"L"+rt+",0 0,"+Oe+" "+-rt+",0Z"},square:function(ge){var Oe=Math.sqrt(ge)/2;return"M"+-Oe+","+-Oe+"L"+Oe+","+-Oe+" "+Oe+","+Oe+" "+-Oe+","+Oe+"Z"},"triangle-down":function(ge){var Oe=Math.sqrt(ge/Pn),rt=Oe*Pn/2;return"M0,"+rt+"L"+Oe+","+-rt+" "+-Oe+","+-rt+"Z"},"triangle-up":function(ge){var Oe=Math.sqrt(ge/Pn),rt=Oe*Pn/2;return"M0,"+-rt+"L"+Oe+","+rt+" "+-Oe+","+rt+"Z"}});h.svg.symbolTypes=En.keys();var Pn=Math.sqrt(3),Xn=Math.tan(30*Qe);te.transition=function(ge){for(var Oe=bo||++$i,rt=Js(ge),wt=[],St,It,tr=vo||{time:Date.now(),ease:Oo,delay:0,duration:250},er=-1,_r=this.length;++er<_r;){wt.push(St=[]);for(var Zr=this[er],Xr=-1,dn=Zr.length;++Xr0;)dn[--Sa].call(ge,sa);if(ea>=1)return tr.event&&tr.event.end.call(ge,ge.__data__,Oe),--It.count?delete It[wt]:delete ge[rt],1}tr||(er=St.time,_r=Ea(Mn,0,er),tr=It[wt]={tween:new A,time:er,timer:_r,delay:St.delay,duration:St.duration,ease:St.ease,index:Oe},St=null,++It.count)}h.svg.axis=function(){var ge=h.scale.linear(),Oe=il,rt=6,wt=6,St=3,It=[10],tr=null,er;function _r(Zr){Zr.each(function(){var Xr=h.select(this),dn=this.__chart__||ge,Mn=this.__chart__=ge.copy(),Cn=tr??(Mn.ticks?Mn.ticks.apply(Mn,It):Mn.domain()),La=er??(Mn.tickFormat?Mn.tickFormat.apply(Mn,It):F),zn=Xr.selectAll(".tick").data(Cn,Mn),ea=zn.enter().insert("g",".domain").attr("class","tick").style("opacity",Je),sa=h.transition(zn.exit()).style("opacity",Je).remove(),Sa=h.transition(zn.order()).style("opacity",1),Ra=Math.max(rt,0)+St,oa,ai=Aa(Mn),Zi=Xr.selectAll(".domain").data([0]),Di=(Zi.enter().append("path").attr("class","domain"),h.transition(Zi));ea.append("line"),ea.append("text");var Vi=ea.select("line"),_o=Sa.select("line"),ko=zn.select("text").text(La),Ws=ea.select("text"),Po=Sa.select("text"),os=Oe==="top"||Oe==="left"?-1:1,nl,Iu,ru,lo;if(Oe==="bottom"||Oe==="top"?(oa=ou,nl="x",ru="y",Iu="x2",lo="y2",ko.attr("dy",os<0?"0em":".71em").style("text-anchor","middle"),Di.attr("d","M"+ai[0]+","+os*wt+"V0H"+ai[1]+"V"+os*wt)):(oa=ks,nl="y",ru="x",Iu="y2",lo="x2",ko.attr("dy",".32em").style("text-anchor",os<0?"end":"start"),Di.attr("d","M"+os*wt+","+ai[0]+"H0V"+ai[1]+"H"+os*wt)),Vi.attr(lo,os*rt),Ws.attr(ru,os*Ra),_o.attr(Iu,0).attr(lo,os*rt),Po.attr(nl,0).attr(ru,os*Ra),Mn.rangeBand){var Ls=Mn,Qs=Ls.rangeBand()/2;dn=Mn=function($l){return Ls($l)+Qs}}else dn.rangeBand?dn=Mn:sa.call(oa,Mn,dn);ea.call(oa,dn,Mn),Sa.call(oa,Mn,Mn)})}return _r.scale=function(Zr){return arguments.length?(ge=Zr,_r):ge},_r.orient=function(Zr){return arguments.length?(Oe=Zr in mu?Zr+"":il,_r):Oe},_r.ticks=function(){return arguments.length?(It=S(arguments),_r):It},_r.tickValues=function(Zr){return arguments.length?(tr=Zr,_r):tr},_r.tickFormat=function(Zr){return arguments.length?(er=Zr,_r):er},_r.tickSize=function(Zr){var Xr=arguments.length;return Xr?(rt=+Zr,wt=+arguments[Xr-1],_r):rt},_r.innerTickSize=function(Zr){return arguments.length?(rt=+Zr,_r):rt},_r.outerTickSize=function(Zr){return arguments.length?(wt=+Zr,_r):wt},_r.tickPadding=function(Zr){return arguments.length?(St=+Zr,_r):St},_r.tickSubdivide=function(){return arguments.length&&_r},_r};var il="bottom",mu={top:1,right:1,bottom:1,left:1};function ou(ge,Oe,rt){ge.attr("transform",function(wt){var St=Oe(wt);return"translate("+(isFinite(St)?St:rt(wt))+",0)"})}function ks(ge,Oe,rt){ge.attr("transform",function(wt){var St=Oe(wt);return"translate(0,"+(isFinite(St)?St:rt(wt))+")"})}h.svg.brush=function(){var ge=le(Xr,"brushstart","brush","brushend"),Oe=null,rt=null,wt=[0,0],St=[0,0],It,tr,er=!0,_r=!0,Zr=Ru[0];function Xr(zn){zn.each(function(){var ea=h.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",La).on("touchstart.brush",La),sa=ea.selectAll(".background").data([0]);sa.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),ea.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Sa=ea.selectAll(".resize").data(Zr,F);Sa.exit().remove(),Sa.enter().append("g").attr("class",function(Zi){return"resize "+Zi}).style("cursor",function(Zi){return Cs[Zi]}).append("rect").attr("x",function(Zi){return/[ew]$/.test(Zi)?-3:null}).attr("y",function(Zi){return/^[ns]/.test(Zi)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Sa.style("display",Xr.empty()?"none":null);var Ra=h.transition(ea),oa=h.transition(sa),ai;Oe&&(ai=Aa(Oe),oa.attr("x",ai[0]).attr("width",ai[1]-ai[0]),Mn(Ra)),rt&&(ai=Aa(rt),oa.attr("y",ai[0]).attr("height",ai[1]-ai[0]),Cn(Ra)),dn(Ra)})}Xr.event=function(zn){zn.each(function(){var ea=ge.of(this,arguments),sa={x:wt,y:St,i:It,j:tr},Sa=this.__chart__||sa;this.__chart__=sa,bo?h.select(this).transition().each("start.brush",function(){It=Sa.i,tr=Sa.j,wt=Sa.x,St=Sa.y,ea({type:"brushstart"})}).tween("brush:brush",function(){var Ra=Dl(wt,sa.x),oa=Dl(St,sa.y);return It=tr=null,function(ai){wt=sa.x=Ra(ai),St=sa.y=oa(ai),ea({type:"brush",mode:"resize"})}}).each("end.brush",function(){It=sa.i,tr=sa.j,ea({type:"brush",mode:"resize"}),ea({type:"brushend"})}):(ea({type:"brushstart"}),ea({type:"brush",mode:"resize"}),ea({type:"brushend"}))})};function dn(zn){zn.selectAll(".resize").attr("transform",function(ea){return"translate("+wt[+/e$/.test(ea)]+","+St[+/^s/.test(ea)]+")"})}function Mn(zn){zn.select(".extent").attr("x",wt[0]),zn.selectAll(".extent,.n>rect,.s>rect").attr("width",wt[1]-wt[0])}function Cn(zn){zn.select(".extent").attr("y",St[0]),zn.selectAll(".extent,.e>rect,.w>rect").attr("height",St[1]-St[0])}function La(){var zn=this,ea=h.select(h.event.target),sa=ge.of(zn,arguments),Sa=h.select(zn),Ra=ea.datum(),oa=!/^(n|s)$/.test(Ra)&&Oe,ai=!/^(e|w)$/.test(Ra)&&rt,Zi=ea.classed("extent"),Di=Sr(zn),Vi,_o=h.mouse(zn),ko,Ws=h.select(t(zn)).on("keydown.brush",nl).on("keyup.brush",Iu);if(h.event.changedTouches?Ws.on("touchmove.brush",ru).on("touchend.brush",Ls):Ws.on("mousemove.brush",ru).on("mouseup.brush",Ls),Sa.interrupt().selectAll("*").interrupt(),Zi)_o[0]=wt[0]-_o[0],_o[1]=St[0]-_o[1];else if(Ra){var Po=+/w$/.test(Ra),os=+/^n/.test(Ra);ko=[wt[1-Po]-_o[0],St[1-os]-_o[1]],_o[0]=wt[Po],_o[1]=St[os]}else h.event.altKey&&(Vi=_o.slice());Sa.style("pointer-events","none").selectAll(".resize").style("display",null),h.select("body").style("cursor",ea.style("cursor")),sa({type:"brushstart"}),ru();function nl(){h.event.keyCode==32&&(Zi||(Vi=null,_o[0]-=wt[1],_o[1]-=St[1],Zi=2),re())}function Iu(){h.event.keyCode==32&&Zi==2&&(_o[0]+=wt[1],_o[1]+=St[1],Zi=0,re())}function ru(){var Qs=h.mouse(zn),$l=!1;ko&&(Qs[0]+=ko[0],Qs[1]+=ko[1]),Zi||(h.event.altKey?(Vi||(Vi=[(wt[0]+wt[1])/2,(St[0]+St[1])/2]),_o[0]=wt[+(Qs[0]0))return ar;do ar.push(kr=new Date(+Ft)),Ne(Ft,Qt),pe(Ft);while(kr=Nt)for(;pe(Nt),!Ft(Nt);)Nt.setTime(Nt-1)},function(Nt,Qt){if(Nt>=Nt)if(Qt<0)for(;++Qt<=0;)for(;Ne(Nt,-1),!Ft(Nt););else for(;--Qt>=0;)for(;Ne(Nt,1),!Ft(Nt););})},ut&&(nt.count=function(Ft,Nt){return b.setTime(+Ft),S.setTime(+Nt),pe(b),pe(S),Math.floor(ut(b,S))},nt.every=function(Ft){return Ft=Math.floor(Ft),!isFinite(Ft)||!(Ft>0)?null:Ft>1?nt.filter(dt?function(Nt){return dt(Nt)%Ft===0}:function(Nt){return nt.count(0,Nt)%Ft===0}):nt}),nt}var e=E(function(){},function(pe,Ne){pe.setTime(+pe+Ne)},function(pe,Ne){return Ne-pe});e.every=function(pe){return pe=Math.floor(pe),!isFinite(pe)||!(pe>0)?null:pe>1?E(function(Ne){Ne.setTime(Math.floor(Ne/pe)*pe)},function(Ne,ut){Ne.setTime(+Ne+ut*pe)},function(Ne,ut){return(ut-Ne)/pe}):e};var t=e.range,r=1e3,o=6e4,n=36e5,i=864e5,a=6048e5,s=E(function(pe){pe.setTime(pe-pe.getMilliseconds())},function(pe,Ne){pe.setTime(+pe+Ne*r)},function(pe,Ne){return(Ne-pe)/r},function(pe){return pe.getUTCSeconds()}),f=s.range,c=E(function(pe){pe.setTime(pe-pe.getMilliseconds()-pe.getSeconds()*r)},function(pe,Ne){pe.setTime(+pe+Ne*o)},function(pe,Ne){return(Ne-pe)/o},function(pe){return pe.getMinutes()}),p=c.range,v=E(function(pe){pe.setTime(pe-pe.getMilliseconds()-pe.getSeconds()*r-pe.getMinutes()*o)},function(pe,Ne){pe.setTime(+pe+Ne*n)},function(pe,Ne){return(Ne-pe)/n},function(pe){return pe.getHours()}),T=v.range,l=E(function(pe){pe.setHours(0,0,0,0)},function(pe,Ne){pe.setDate(pe.getDate()+Ne)},function(pe,Ne){return(Ne-pe-(Ne.getTimezoneOffset()-pe.getTimezoneOffset())*o)/i},function(pe){return pe.getDate()-1}),g=l.range;function x(pe){return E(function(Ne){Ne.setDate(Ne.getDate()-(Ne.getDay()+7-pe)%7),Ne.setHours(0,0,0,0)},function(Ne,ut){Ne.setDate(Ne.getDate()+ut*7)},function(Ne,ut){return(ut-Ne-(ut.getTimezoneOffset()-Ne.getTimezoneOffset())*o)/a})}var A=x(0),M=x(1),_=x(2),w=x(3),m=x(4),u=x(5),d=x(6),y=A.range,I=M.range,L=_.range,z=w.range,F=m.range,N=u.range,B=d.range,R=E(function(pe){pe.setDate(1),pe.setHours(0,0,0,0)},function(pe,Ne){pe.setMonth(pe.getMonth()+Ne)},function(pe,Ne){return Ne.getMonth()-pe.getMonth()+(Ne.getFullYear()-pe.getFullYear())*12},function(pe){return pe.getMonth()}),U=R.range,j=E(function(pe){pe.setMonth(0,1),pe.setHours(0,0,0,0)},function(pe,Ne){pe.setFullYear(pe.getFullYear()+Ne)},function(pe,Ne){return Ne.getFullYear()-pe.getFullYear()},function(pe){return pe.getFullYear()});j.every=function(pe){return!isFinite(pe=Math.floor(pe))||!(pe>0)?null:E(function(Ne){Ne.setFullYear(Math.floor(Ne.getFullYear()/pe)*pe),Ne.setMonth(0,1),Ne.setHours(0,0,0,0)},function(Ne,ut){Ne.setFullYear(Ne.getFullYear()+ut*pe)})};var Z=j.range,re=E(function(pe){pe.setUTCSeconds(0,0)},function(pe,Ne){pe.setTime(+pe+Ne*o)},function(pe,Ne){return(Ne-pe)/o},function(pe){return pe.getUTCMinutes()}),fe=re.range,le=E(function(pe){pe.setUTCMinutes(0,0,0)},function(pe,Ne){pe.setTime(+pe+Ne*n)},function(pe,Ne){return(Ne-pe)/n},function(pe){return pe.getUTCHours()}),ce=le.range,V=E(function(pe){pe.setUTCHours(0,0,0,0)},function(pe,Ne){pe.setUTCDate(pe.getUTCDate()+Ne)},function(pe,Ne){return(Ne-pe)/i},function(pe){return pe.getUTCDate()-1}),ee=V.range;function ne(pe){return E(function(Ne){Ne.setUTCDate(Ne.getUTCDate()-(Ne.getUTCDay()+7-pe)%7),Ne.setUTCHours(0,0,0,0)},function(Ne,ut){Ne.setUTCDate(Ne.getUTCDate()+ut*7)},function(Ne,ut){return(ut-Ne)/a})}var $=ne(0),ue=ne(1),te=ne(2),H=ne(3),ae=ne(4),ie=ne(5),de=ne(6),Se=$.range,Le=ue.range,Fe=te.range,ze=H.range,Ye=ae.range,st=ie.range,ct=de.range,at=E(function(pe){pe.setUTCDate(1),pe.setUTCHours(0,0,0,0)},function(pe,Ne){pe.setUTCMonth(pe.getUTCMonth()+Ne)},function(pe,Ne){return Ne.getUTCMonth()-pe.getUTCMonth()+(Ne.getUTCFullYear()-pe.getUTCFullYear())*12},function(pe){return pe.getUTCMonth()}),et=at.range,Pe=E(function(pe){pe.setUTCMonth(0,1),pe.setUTCHours(0,0,0,0)},function(pe,Ne){pe.setUTCFullYear(pe.getUTCFullYear()+Ne)},function(pe,Ne){return Ne.getUTCFullYear()-pe.getUTCFullYear()},function(pe){return pe.getUTCFullYear()});Pe.every=function(pe){return!isFinite(pe=Math.floor(pe))||!(pe>0)?null:E(function(Ne){Ne.setUTCFullYear(Math.floor(Ne.getUTCFullYear()/pe)*pe),Ne.setUTCMonth(0,1),Ne.setUTCHours(0,0,0,0)},function(Ne,ut){Ne.setUTCFullYear(Ne.getUTCFullYear()+ut*pe)})};var Ae=Pe.range;h.timeDay=l,h.timeDays=g,h.timeFriday=u,h.timeFridays=N,h.timeHour=v,h.timeHours=T,h.timeInterval=E,h.timeMillisecond=e,h.timeMilliseconds=t,h.timeMinute=c,h.timeMinutes=p,h.timeMonday=M,h.timeMondays=I,h.timeMonth=R,h.timeMonths=U,h.timeSaturday=d,h.timeSaturdays=B,h.timeSecond=s,h.timeSeconds=f,h.timeSunday=A,h.timeSundays=y,h.timeThursday=m,h.timeThursdays=F,h.timeTuesday=_,h.timeTuesdays=L,h.timeWednesday=w,h.timeWednesdays=z,h.timeWeek=A,h.timeWeeks=y,h.timeYear=j,h.timeYears=Z,h.utcDay=V,h.utcDays=ee,h.utcFriday=ie,h.utcFridays=st,h.utcHour=le,h.utcHours=ce,h.utcMillisecond=e,h.utcMilliseconds=t,h.utcMinute=re,h.utcMinutes=fe,h.utcMonday=ue,h.utcMondays=Le,h.utcMonth=at,h.utcMonths=et,h.utcSaturday=de,h.utcSaturdays=ct,h.utcSecond=s,h.utcSeconds=f,h.utcSunday=$,h.utcSundays=Se,h.utcThursday=ae,h.utcThursdays=Ye,h.utcTuesday=te,h.utcTuesdays=Fe,h.utcWednesday=H,h.utcWednesdays=ze,h.utcWeek=$,h.utcWeeks=Se,h.utcYear=Pe,h.utcYears=Ae,Object.defineProperty(h,"__esModule",{value:!0})})}}),Bi=Ge({"node_modules/d3-time-format/dist/d3-time-format.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,tl()):(h=h||self,b(h.d3=h.d3||{},h.d3))})(K,function(h,b){function S(je){if(0<=je.y&&je.y<100){var Je=new Date(-1,je.m,je.d,je.H,je.M,je.S,je.L);return Je.setFullYear(je.y),Je}return new Date(je.y,je.m,je.d,je.H,je.M,je.S,je.L)}function E(je){if(0<=je.y&&je.y<100){var Je=new Date(Date.UTC(-1,je.m,je.d,je.H,je.M,je.S,je.L));return Je.setUTCFullYear(je.y),Je}return new Date(Date.UTC(je.y,je.m,je.d,je.H,je.M,je.S,je.L))}function e(je,Je,ke){return{y:je,m:Je,d:ke,H:0,M:0,S:0,L:0}}function t(je){var Je=je.dateTime,ke=je.date,xe=je.time,ye=je.periods,Ee=je.days,Xe=je.shortDays,Qe=je.months,Lt=je.shortMonths,Ct=f(ye),Ot=c(ye),Kt=f(Ee),xr=c(Ee),mr=f(Xe),vr=c(Xe),Nr=f(Qe),kn=c(Qe),$n=f(Lt),Vn=c(Lt),ra={a:pa,A:ha,b:_a,B:Ca,c:null,d:R,e:R,f:fe,H:U,I:j,j:Z,L:re,m:le,M:ce,p:Hn,q:pi,Q:Nt,s:Qt,S:V,u:ee,U:ne,V:$,w:ue,W:te,x:null,X:null,y:H,Y:ae,Z:ie,"%":Ft},na={a:Si,A:Dt,b:xt,B:Cr,c:null,d:de,e:de,f:Ye,H:Se,I:Le,j:Fe,L:ze,m:st,M:ct,p:jr,q:Vr,Q:Nt,s:Qt,S:at,u:et,U:Pe,V:Ae,w:pe,W:Ne,x:null,X:null,y:ut,Y:dt,Z:nt,"%":Ft},Un={a:or,A:ur,b:Gr,B:ln,c:gn,d:m,e:m,f:z,H:d,I:d,j:u,L,m:w,M:y,p:Vt,q:_,Q:N,s:B,S:I,u:v,U:T,V:l,w:p,W:g,x:An,X:Qn,y:A,Y:x,Z:M,"%":F};ra.x=ka(ke,ra),ra.X=ka(xe,ra),ra.c=ka(Je,ra),na.x=ka(ke,na),na.X=ka(xe,na),na.c=ka(Je,na);function ka(Dr,qr){return function(un){var Jr=[],At=-1,lr=0,zr=Dr.length,cn,Rn,qn;for(un instanceof Date||(un=new Date(+un));++At53)return null;"w"in Jr||(Jr.w=1),"Z"in Jr?(lr=E(e(Jr.y,0,1)),zr=lr.getUTCDay(),lr=zr>4||zr===0?b.utcMonday.ceil(lr):b.utcMonday(lr),lr=b.utcDay.offset(lr,(Jr.V-1)*7),Jr.y=lr.getUTCFullYear(),Jr.m=lr.getUTCMonth(),Jr.d=lr.getUTCDate()+(Jr.w+6)%7):(lr=S(e(Jr.y,0,1)),zr=lr.getDay(),lr=zr>4||zr===0?b.timeMonday.ceil(lr):b.timeMonday(lr),lr=b.timeDay.offset(lr,(Jr.V-1)*7),Jr.y=lr.getFullYear(),Jr.m=lr.getMonth(),Jr.d=lr.getDate()+(Jr.w+6)%7)}else("W"in Jr||"U"in Jr)&&("w"in Jr||(Jr.w="u"in Jr?Jr.u%7:"W"in Jr?1:0),zr="Z"in Jr?E(e(Jr.y,0,1)).getUTCDay():S(e(Jr.y,0,1)).getDay(),Jr.m=0,Jr.d="W"in Jr?(Jr.w+6)%7+Jr.W*7-(zr+5)%7:Jr.w+Jr.U*7-(zr+6)%7);return"Z"in Jr?(Jr.H+=Jr.Z/100|0,Jr.M+=Jr.Z%100,E(Jr)):S(Jr)}}function sr(Dr,qr,un,Jr){for(var At=0,lr=qr.length,zr=un.length,cn,Rn;At=zr)return-1;if(cn=qr.charCodeAt(At++),cn===37){if(cn=qr.charAt(At++),Rn=Un[cn in r?qr.charAt(At++):cn],!Rn||(Jr=Rn(Dr,un,Jr))<0)return-1}else if(cn!=un.charCodeAt(Jr++))return-1}return Jr}function Vt(Dr,qr,un){var Jr=Ct.exec(qr.slice(un));return Jr?(Dr.p=Ot[Jr[0].toLowerCase()],un+Jr[0].length):-1}function or(Dr,qr,un){var Jr=mr.exec(qr.slice(un));return Jr?(Dr.w=vr[Jr[0].toLowerCase()],un+Jr[0].length):-1}function ur(Dr,qr,un){var Jr=Kt.exec(qr.slice(un));return Jr?(Dr.w=xr[Jr[0].toLowerCase()],un+Jr[0].length):-1}function Gr(Dr,qr,un){var Jr=$n.exec(qr.slice(un));return Jr?(Dr.m=Vn[Jr[0].toLowerCase()],un+Jr[0].length):-1}function ln(Dr,qr,un){var Jr=Nr.exec(qr.slice(un));return Jr?(Dr.m=kn[Jr[0].toLowerCase()],un+Jr[0].length):-1}function gn(Dr,qr,un){return sr(Dr,Je,qr,un)}function An(Dr,qr,un){return sr(Dr,ke,qr,un)}function Qn(Dr,qr,un){return sr(Dr,xe,qr,un)}function pa(Dr){return Xe[Dr.getDay()]}function ha(Dr){return Ee[Dr.getDay()]}function _a(Dr){return Lt[Dr.getMonth()]}function Ca(Dr){return Qe[Dr.getMonth()]}function Hn(Dr){return ye[+(Dr.getHours()>=12)]}function pi(Dr){return 1+~~(Dr.getMonth()/3)}function Si(Dr){return Xe[Dr.getUTCDay()]}function Dt(Dr){return Ee[Dr.getUTCDay()]}function xt(Dr){return Lt[Dr.getUTCMonth()]}function Cr(Dr){return Qe[Dr.getUTCMonth()]}function jr(Dr){return ye[+(Dr.getUTCHours()>=12)]}function Vr(Dr){return 1+~~(Dr.getUTCMonth()/3)}return{format:function(Dr){var qr=ka(Dr+="",ra);return qr.toString=function(){return Dr},qr},parse:function(Dr){var qr=Va(Dr+="",!1);return qr.toString=function(){return Dr},qr},utcFormat:function(Dr){var qr=ka(Dr+="",na);return qr.toString=function(){return Dr},qr},utcParse:function(Dr){var qr=Va(Dr+="",!0);return qr.toString=function(){return Dr},qr}}}var r={"-":"",_:" ",0:"0"},o=/^\s*\d+/,n=/^%/,i=/[\\^$*+?|[\]().{}]/g;function a(je,Je,ke){var xe=je<0?"-":"",ye=(xe?-je:je)+"",Ee=ye.length;return xe+(Ee68?1900:2e3),ke+xe[0].length):-1}function M(je,Je,ke){var xe=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(Je.slice(ke,ke+6));return xe?(je.Z=xe[1]?0:-(xe[2]+(xe[3]||"00")),ke+xe[0].length):-1}function _(je,Je,ke){var xe=o.exec(Je.slice(ke,ke+1));return xe?(je.q=xe[0]*3-3,ke+xe[0].length):-1}function w(je,Je,ke){var xe=o.exec(Je.slice(ke,ke+2));return xe?(je.m=xe[0]-1,ke+xe[0].length):-1}function m(je,Je,ke){var xe=o.exec(Je.slice(ke,ke+2));return xe?(je.d=+xe[0],ke+xe[0].length):-1}function u(je,Je,ke){var xe=o.exec(Je.slice(ke,ke+3));return xe?(je.m=0,je.d=+xe[0],ke+xe[0].length):-1}function d(je,Je,ke){var xe=o.exec(Je.slice(ke,ke+2));return xe?(je.H=+xe[0],ke+xe[0].length):-1}function y(je,Je,ke){var xe=o.exec(Je.slice(ke,ke+2));return xe?(je.M=+xe[0],ke+xe[0].length):-1}function I(je,Je,ke){var xe=o.exec(Je.slice(ke,ke+2));return xe?(je.S=+xe[0],ke+xe[0].length):-1}function L(je,Je,ke){var xe=o.exec(Je.slice(ke,ke+3));return xe?(je.L=+xe[0],ke+xe[0].length):-1}function z(je,Je,ke){var xe=o.exec(Je.slice(ke,ke+6));return xe?(je.L=Math.floor(xe[0]/1e3),ke+xe[0].length):-1}function F(je,Je,ke){var xe=n.exec(Je.slice(ke,ke+1));return xe?ke+xe[0].length:-1}function N(je,Je,ke){var xe=o.exec(Je.slice(ke));return xe?(je.Q=+xe[0],ke+xe[0].length):-1}function B(je,Je,ke){var xe=o.exec(Je.slice(ke));return xe?(je.s=+xe[0],ke+xe[0].length):-1}function R(je,Je){return a(je.getDate(),Je,2)}function U(je,Je){return a(je.getHours(),Je,2)}function j(je,Je){return a(je.getHours()%12||12,Je,2)}function Z(je,Je){return a(1+b.timeDay.count(b.timeYear(je),je),Je,3)}function re(je,Je){return a(je.getMilliseconds(),Je,3)}function fe(je,Je){return re(je,Je)+"000"}function le(je,Je){return a(je.getMonth()+1,Je,2)}function ce(je,Je){return a(je.getMinutes(),Je,2)}function V(je,Je){return a(je.getSeconds(),Je,2)}function ee(je){var Je=je.getDay();return Je===0?7:Je}function ne(je,Je){return a(b.timeSunday.count(b.timeYear(je)-1,je),Je,2)}function $(je,Je){var ke=je.getDay();return je=ke>=4||ke===0?b.timeThursday(je):b.timeThursday.ceil(je),a(b.timeThursday.count(b.timeYear(je),je)+(b.timeYear(je).getDay()===4),Je,2)}function ue(je){return je.getDay()}function te(je,Je){return a(b.timeMonday.count(b.timeYear(je)-1,je),Je,2)}function H(je,Je){return a(je.getFullYear()%100,Je,2)}function ae(je,Je){return a(je.getFullYear()%1e4,Je,4)}function ie(je){var Je=je.getTimezoneOffset();return(Je>0?"-":(Je*=-1,"+"))+a(Je/60|0,"0",2)+a(Je%60,"0",2)}function de(je,Je){return a(je.getUTCDate(),Je,2)}function Se(je,Je){return a(je.getUTCHours(),Je,2)}function Le(je,Je){return a(je.getUTCHours()%12||12,Je,2)}function Fe(je,Je){return a(1+b.utcDay.count(b.utcYear(je),je),Je,3)}function ze(je,Je){return a(je.getUTCMilliseconds(),Je,3)}function Ye(je,Je){return ze(je,Je)+"000"}function st(je,Je){return a(je.getUTCMonth()+1,Je,2)}function ct(je,Je){return a(je.getUTCMinutes(),Je,2)}function at(je,Je){return a(je.getUTCSeconds(),Je,2)}function et(je){var Je=je.getUTCDay();return Je===0?7:Je}function Pe(je,Je){return a(b.utcSunday.count(b.utcYear(je)-1,je),Je,2)}function Ae(je,Je){var ke=je.getUTCDay();return je=ke>=4||ke===0?b.utcThursday(je):b.utcThursday.ceil(je),a(b.utcThursday.count(b.utcYear(je),je)+(b.utcYear(je).getUTCDay()===4),Je,2)}function pe(je){return je.getUTCDay()}function Ne(je,Je){return a(b.utcMonday.count(b.utcYear(je)-1,je),Je,2)}function ut(je,Je){return a(je.getUTCFullYear()%100,Je,2)}function dt(je,Je){return a(je.getUTCFullYear()%1e4,Je,4)}function nt(){return"+0000"}function Ft(){return"%"}function Nt(je){return+je}function Qt(je){return Math.floor(+je/1e3)}var ar;kr({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 kr(je){return ar=t(je),h.timeFormat=ar.format,h.timeParse=ar.parse,h.utcFormat=ar.utcFormat,h.utcParse=ar.utcParse,ar}var Er="%Y-%m-%dT%H:%M:%S.%LZ";function $r(je){return je.toISOString()}var Sr=Date.prototype.toISOString?$r:h.utcFormat(Er);function Ur(je){var Je=new Date(je);return isNaN(Je)?null:Je}var Mt=+new Date("2000-01-01T00:00:00.000Z")?Ur:h.utcParse(Er);h.isoFormat=Sr,h.isoParse=Mt,h.timeFormatDefaultLocale=kr,h.timeFormatLocale=t,Object.defineProperty(h,"__esModule",{value:!0})})}}),zo=Ge({"node_modules/d3-format/dist/d3-format.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K):(h=typeof globalThis<"u"?globalThis:h||self,b(h.d3=h.d3||{}))})(K,function(h){function b(w){return Math.abs(w=Math.round(w))>=1e21?w.toLocaleString("en").replace(/,/g,""):w.toString(10)}function S(w,m){if((u=(w=m?w.toExponential(m-1):w.toExponential()).indexOf("e"))<0)return null;var u,d=w.slice(0,u);return[d.length>1?d[0]+d.slice(2):d,+w.slice(u+1)]}function E(w){return w=S(Math.abs(w)),w?w[1]:NaN}function e(w,m){return function(u,d){for(var y=u.length,I=[],L=0,z=w[0],F=0;y>0&&z>0&&(F+z+1>d&&(z=Math.max(1,d-F)),I.push(u.substring(y-=z,y+z)),!((F+=z+1)>d));)z=w[L=(L+1)%w.length];return I.reverse().join(m)}}function t(w){return function(m){return m.replace(/[0-9]/g,function(u){return w[+u]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(w){if(!(m=r.exec(w)))throw new Error("invalid format: "+w);var m;return new n({fill:m[1],align:m[2],sign:m[3],symbol:m[4],zero:m[5],width:m[6],comma:m[7],precision:m[8]&&m[8].slice(1),trim:m[9],type:m[10]})}o.prototype=n.prototype;function n(w){this.fill=w.fill===void 0?" ":w.fill+"",this.align=w.align===void 0?">":w.align+"",this.sign=w.sign===void 0?"-":w.sign+"",this.symbol=w.symbol===void 0?"":w.symbol+"",this.zero=!!w.zero,this.width=w.width===void 0?void 0:+w.width,this.comma=!!w.comma,this.precision=w.precision===void 0?void 0:+w.precision,this.trim=!!w.trim,this.type=w.type===void 0?"":w.type+""}n.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 i(w){e:for(var m=w.length,u=1,d=-1,y;u0&&(d=0);break}return d>0?w.slice(0,d)+w.slice(y+1):w}var a;function s(w,m){var u=S(w,m);if(!u)return w+"";var d=u[0],y=u[1],I=y-(a=Math.max(-8,Math.min(8,Math.floor(y/3)))*3)+1,L=d.length;return I===L?d:I>L?d+new Array(I-L+1).join("0"):I>0?d.slice(0,I)+"."+d.slice(I):"0."+new Array(1-I).join("0")+S(w,Math.max(0,m+I-1))[0]}function f(w,m){var u=S(w,m);if(!u)return w+"";var d=u[0],y=u[1];return y<0?"0."+new Array(-y).join("0")+d:d.length>y+1?d.slice(0,y+1)+"."+d.slice(y+1):d+new Array(y-d.length+2).join("0")}var c={"%":function(w,m){return(w*100).toFixed(m)},b:function(w){return Math.round(w).toString(2)},c:function(w){return w+""},d:b,e:function(w,m){return w.toExponential(m)},f:function(w,m){return w.toFixed(m)},g:function(w,m){return w.toPrecision(m)},o:function(w){return Math.round(w).toString(8)},p:function(w,m){return f(w*100,m)},r:f,s,X:function(w){return Math.round(w).toString(16).toUpperCase()},x:function(w){return Math.round(w).toString(16)}};function p(w){return w}var v=Array.prototype.map,T=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function l(w){var m=w.grouping===void 0||w.thousands===void 0?p:e(v.call(w.grouping,Number),w.thousands+""),u=w.currency===void 0?"":w.currency[0]+"",d=w.currency===void 0?"":w.currency[1]+"",y=w.decimal===void 0?".":w.decimal+"",I=w.numerals===void 0?p:t(v.call(w.numerals,String)),L=w.percent===void 0?"%":w.percent+"",z=w.minus===void 0?"-":w.minus+"",F=w.nan===void 0?"NaN":w.nan+"";function N(R){R=o(R);var U=R.fill,j=R.align,Z=R.sign,re=R.symbol,fe=R.zero,le=R.width,ce=R.comma,V=R.precision,ee=R.trim,ne=R.type;ne==="n"?(ce=!0,ne="g"):c[ne]||(V===void 0&&(V=12),ee=!0,ne="g"),(fe||U==="0"&&j==="=")&&(fe=!0,U="0",j="=");var $=re==="$"?u:re==="#"&&/[boxX]/.test(ne)?"0"+ne.toLowerCase():"",ue=re==="$"?d:/[%p]/.test(ne)?L:"",te=c[ne],H=/[defgprs%]/.test(ne);V=V===void 0?6:/[gprs]/.test(ne)?Math.max(1,Math.min(21,V)):Math.max(0,Math.min(20,V));function ae(ie){var de=$,Se=ue,Le,Fe,ze;if(ne==="c")Se=te(ie)+Se,ie="";else{ie=+ie;var Ye=ie<0||1/ie<0;if(ie=isNaN(ie)?F:te(Math.abs(ie),V),ee&&(ie=i(ie)),Ye&&+ie==0&&Z!=="+"&&(Ye=!1),de=(Ye?Z==="("?Z:z:Z==="-"||Z==="("?"":Z)+de,Se=(ne==="s"?T[8+a/3]:"")+Se+(Ye&&Z==="("?")":""),H){for(Le=-1,Fe=ie.length;++Leze||ze>57){Se=(ze===46?y+ie.slice(Le+1):ie.slice(Le))+Se,ie=ie.slice(0,Le);break}}}ce&&!fe&&(ie=m(ie,1/0));var st=de.length+ie.length+Se.length,ct=st>1)+de+ie+Se+ct.slice(st);break;default:ie=ct+de+ie+Se;break}return I(ie)}return ae.toString=function(){return R+""},ae}function B(R,U){var j=N((R=o(R),R.type="f",R)),Z=Math.max(-8,Math.min(8,Math.floor(E(U)/3)))*3,re=Math.pow(10,-Z),fe=T[8+Z/3];return function(le){return j(re*le)+fe}}return{format:N,formatPrefix:B}}var g;x({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function x(w){return g=l(w),h.format=g.format,h.formatPrefix=g.formatPrefix,g}function A(w){return Math.max(0,-E(Math.abs(w)))}function M(w,m){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(E(m)/3)))*3-E(Math.abs(w)))}function _(w,m){return w=Math.abs(w),m=Math.abs(m)-w,Math.max(0,E(m)-E(w))+1}h.FormatSpecifier=n,h.formatDefaultLocale=x,h.formatLocale=l,h.formatSpecifier=o,h.precisionFixed=A,h.precisionPrefix=M,h.precisionRound=_,Object.defineProperty(h,"__esModule",{value:!0})})}}),Ll=Ge({"node_modules/is-string-blank/index.js"(K,G){G.exports=function(h){for(var b=h.length,S,E=0;E13)&&S!==32&&S!==133&&S!==160&&S!==5760&&S!==6158&&(S<8192||S>8205)&&S!==8232&&S!==8233&&S!==8239&&S!==8287&&S!==8288&&S!==12288&&S!==65279)return!1;return!0}}}),Ei=Ge({"node_modules/fast-isnumeric/index.js"(K,G){var h=Ll();G.exports=function(b){var S=typeof b;if(S==="string"){var E=b;if(b=+b,b===0&&h(E))return!1}else if(S!=="number")return!1;return b-b<1}}}),Ii=Ge({"src/constants/numerical.js"(K,G){G.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}}),Ti=Ge({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K):(h=typeof globalThis<"u"?globalThis:h||self,b(h["base64-arraybuffer"]={}))})(K,function(h){for(var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S=typeof Uint8Array>"u"?[]:new Uint8Array(256),E=0;E>2],a+=b[(o[n]&3)<<4|o[n+1]>>4],a+=b[(o[n+1]&15)<<2|o[n+2]>>6],a+=b[o[n+2]&63];return i%3===2?a=a.substring(0,a.length-1)+"=":i%3===1&&(a=a.substring(0,a.length-2)+"=="),a},t=function(r){var o=r.length*.75,n=r.length,i,a=0,s,f,c,p;r[r.length-1]==="="&&(o--,r[r.length-2]==="="&&o--);var v=new ArrayBuffer(o),T=new Uint8Array(v);for(i=0;i>4,T[a++]=(f&15)<<4|c>>2,T[a++]=(c&3)<<6|p&63;return v};h.decode=t,h.encode=e,Object.defineProperty(h,"__esModule",{value:!0})})}}),So=Ge({"src/lib/is_plain_object.js"(K,G){G.exports=function(b){return window&&window.process&&window.process.versions?Object.prototype.toString.call(b)==="[object Object]":Object.prototype.toString.call(b)==="[object Object]"&&Object.getPrototypeOf(b).hasOwnProperty("hasOwnProperty")}}}),ws=Ge({"src/lib/array.js"(K){var G=Ti().decode,h=So(),b=Array.isArray,S=ArrayBuffer,E=DataView;function e(s){return S.isView(s)&&!(s instanceof E)}K.isTypedArray=e;function t(s){return b(s)||e(s)}K.isArrayOrTypedArray=t;function r(s){return!t(s[0])}K.isArray1D=r,K.ensureArray=function(s,f){return b(s)||(s=[]),s.length=f,s};var o={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};o.uint8c=o.u1c,o.uint8=o.u1,o.int8=o.i1,o.uint16=o.u2,o.int16=o.i2,o.uint32=o.u4,o.int32=o.i4,o.float32=o.f4,o.float64=o.f8;function n(s){return s.constructor===ArrayBuffer}K.isArrayBuffer=n,K.decodeTypedArraySpec=function(s){var f=[],c=i(s),p=c.dtype,v=o[p];if(!v)throw new Error('Error in dtype: "'+p+'"');var T=v.BYTES_PER_ELEMENT,l=c.bdata;n(l)||(l=G(l));var g=c.shape===void 0?[l.byteLength/T]:(""+c.shape).split(",");g.reverse();var x=g.length,A,M,_=+g[0],w=T*_,m=0;if(x===1)f=new v(l);else if(x===2)for(A=+g[1],M=0;M2)return v[A]=v[A]|e,g.set(x,null);if(l){for(f=A;f0)return Math.log(S)/Math.LN10;var e=Math.log(Math.min(E[0],E[1]))/Math.LN10;return h(e)||(e=Math.log(Math.max(E[0],E[1]))/Math.LN10-6),e}}}),Jn=Ge({"src/lib/relink_private.js"(K,G){var h=ws().isArrayOrTypedArray,b=So();G.exports=function S(E,e){for(var t in e){var r=e[t],o=E[t];if(o!==r)if(t.charAt(0)==="_"||typeof r=="function"){if(t in E)continue;E[t]=r}else if(h(r)&&h(o)&&b(r[0])){if(t==="customdata"||t==="ids")continue;for(var n=Math.min(r.length,o.length),i=0;iE/2?S-Math.round(S/E)*E:S}G.exports={mod:h,modHalf:b}}}),Rs=Ge({"node_modules/tinycolor2/tinycolor.js"(K,G){(function(h){var b=/^\s+/,S=/\s+$/,E=0,e=h.round,t=h.min,r=h.max,o=h.random;function n(H,ae){if(H=H||"",ae=ae||{},H instanceof n)return H;if(!(this instanceof n))return new n(H,ae);var ie=i(H);this._originalInput=H,this._r=ie.r,this._g=ie.g,this._b=ie.b,this._a=ie.a,this._roundA=e(100*this._a)/100,this._format=ae.format||ie.format,this._gradientType=ae.gradientType,this._r<1&&(this._r=e(this._r)),this._g<1&&(this._g=e(this._g)),this._b<1&&(this._b=e(this._b)),this._ok=ie.ok,this._tc_id=E++}n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var H=this.toRgb();return(H.r*299+H.g*587+H.b*114)/1e3},getLuminance:function(){var H=this.toRgb(),ae,ie,de,Se,Le,Fe;return ae=H.r/255,ie=H.g/255,de=H.b/255,ae<=.03928?Se=ae/12.92:Se=h.pow((ae+.055)/1.055,2.4),ie<=.03928?Le=ie/12.92:Le=h.pow((ie+.055)/1.055,2.4),de<=.03928?Fe=de/12.92:Fe=h.pow((de+.055)/1.055,2.4),.2126*Se+.7152*Le+.0722*Fe},setAlpha:function(H){return this._a=R(H),this._roundA=e(100*this._a)/100,this},toHsv:function(){var H=c(this._r,this._g,this._b);return{h:H.h*360,s:H.s,v:H.v,a:this._a}},toHsvString:function(){var H=c(this._r,this._g,this._b),ae=e(H.h*360),ie=e(H.s*100),de=e(H.v*100);return this._a==1?"hsv("+ae+", "+ie+"%, "+de+"%)":"hsva("+ae+", "+ie+"%, "+de+"%, "+this._roundA+")"},toHsl:function(){var H=s(this._r,this._g,this._b);return{h:H.h*360,s:H.s,l:H.l,a:this._a}},toHslString:function(){var H=s(this._r,this._g,this._b),ae=e(H.h*360),ie=e(H.s*100),de=e(H.l*100);return this._a==1?"hsl("+ae+", "+ie+"%, "+de+"%)":"hsla("+ae+", "+ie+"%, "+de+"%, "+this._roundA+")"},toHex:function(H){return v(this._r,this._g,this._b,H)},toHexString:function(H){return"#"+this.toHex(H)},toHex8:function(H){return T(this._r,this._g,this._b,this._a,H)},toHex8String:function(H){return"#"+this.toHex8(H)},toRgb:function(){return{r:e(this._r),g:e(this._g),b:e(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+e(this._r)+", "+e(this._g)+", "+e(this._b)+")":"rgba("+e(this._r)+", "+e(this._g)+", "+e(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:e(U(this._r,255)*100)+"%",g:e(U(this._g,255)*100)+"%",b:e(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+e(U(this._r,255)*100)+"%, "+e(U(this._g,255)*100)+"%, "+e(U(this._b,255)*100)+"%)":"rgba("+e(U(this._r,255)*100)+"%, "+e(U(this._g,255)*100)+"%, "+e(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:N[v(this._r,this._g,this._b,!0)]||!1},toFilter:function(H){var ae="#"+l(this._r,this._g,this._b,this._a),ie=ae,de=this._gradientType?"GradientType = 1, ":"";if(H){var Se=n(H);ie="#"+l(Se._r,Se._g,Se._b,Se._a)}return"progid:DXImageTransform.Microsoft.gradient("+de+"startColorstr="+ae+",endColorstr="+ie+")"},toString:function(H){var ae=!!H;H=H||this._format;var ie=!1,de=this._a<1&&this._a>=0,Se=!ae&&de&&(H==="hex"||H==="hex6"||H==="hex3"||H==="hex4"||H==="hex8"||H==="name");return Se?H==="name"&&this._a===0?this.toName():this.toRgbString():(H==="rgb"&&(ie=this.toRgbString()),H==="prgb"&&(ie=this.toPercentageRgbString()),(H==="hex"||H==="hex6")&&(ie=this.toHexString()),H==="hex3"&&(ie=this.toHexString(!0)),H==="hex4"&&(ie=this.toHex8String(!0)),H==="hex8"&&(ie=this.toHex8String()),H==="name"&&(ie=this.toName()),H==="hsl"&&(ie=this.toHslString()),H==="hsv"&&(ie=this.toHsvString()),ie||this.toHexString())},clone:function(){return n(this.toString())},_applyModification:function(H,ae){var ie=H.apply(null,[this].concat([].slice.call(ae)));return this._r=ie._r,this._g=ie._g,this._b=ie._b,this.setAlpha(ie._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(x,arguments)},greyscale:function(){return this._applyModification(A,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(H,ae){return H.apply(null,[this].concat([].slice.call(ae)))},analogous:function(){return this._applyCombination(L,arguments)},complement:function(){return this._applyCombination(u,arguments)},monochromatic:function(){return this._applyCombination(z,arguments)},splitcomplement:function(){return this._applyCombination(I,arguments)},triad:function(){return this._applyCombination(d,arguments)},tetrad:function(){return this._applyCombination(y,arguments)}},n.fromRatio=function(H,ae){if(typeof H=="object"){var ie={};for(var de in H)H.hasOwnProperty(de)&&(de==="a"?ie[de]=H[de]:ie[de]=ce(H[de]));H=ie}return n(H,ae)};function i(H){var ae={r:0,g:0,b:0},ie=1,de=null,Se=null,Le=null,Fe=!1,ze=!1;return typeof H=="string"&&(H=ue(H)),typeof H=="object"&&($(H.r)&&$(H.g)&&$(H.b)?(ae=a(H.r,H.g,H.b),Fe=!0,ze=String(H.r).substr(-1)==="%"?"prgb":"rgb"):$(H.h)&&$(H.s)&&$(H.v)?(de=ce(H.s),Se=ce(H.v),ae=p(H.h,de,Se),Fe=!0,ze="hsv"):$(H.h)&&$(H.s)&&$(H.l)&&(de=ce(H.s),Le=ce(H.l),ae=f(H.h,de,Le),Fe=!0,ze="hsl"),H.hasOwnProperty("a")&&(ie=H.a)),ie=R(ie),{ok:Fe,format:H.format||ze,r:t(255,r(ae.r,0)),g:t(255,r(ae.g,0)),b:t(255,r(ae.b,0)),a:ie}}function a(H,ae,ie){return{r:U(H,255)*255,g:U(ae,255)*255,b:U(ie,255)*255}}function s(H,ae,ie){H=U(H,255),ae=U(ae,255),ie=U(ie,255);var de=r(H,ae,ie),Se=t(H,ae,ie),Le,Fe,ze=(de+Se)/2;if(de==Se)Le=Fe=0;else{var Ye=de-Se;switch(Fe=ze>.5?Ye/(2-de-Se):Ye/(de+Se),de){case H:Le=(ae-ie)/Ye+(ae1&&(at-=1),at<1/6?st+(ct-st)*6*at:at<1/2?ct:at<2/3?st+(ct-st)*(2/3-at)*6:st}if(ae===0)de=Se=Le=ie;else{var ze=ie<.5?ie*(1+ae):ie+ae-ie*ae,Ye=2*ie-ze;de=Fe(Ye,ze,H+1/3),Se=Fe(Ye,ze,H),Le=Fe(Ye,ze,H-1/3)}return{r:de*255,g:Se*255,b:Le*255}}function c(H,ae,ie){H=U(H,255),ae=U(ae,255),ie=U(ie,255);var de=r(H,ae,ie),Se=t(H,ae,ie),Le,Fe,ze=de,Ye=de-Se;if(Fe=de===0?0:Ye/de,de==Se)Le=0;else{switch(de){case H:Le=(ae-ie)/Ye+(ae>1)+720)%360;--ae;)de.h=(de.h+Se)%360,Le.push(n(de));return Le}function z(H,ae){ae=ae||6;for(var ie=n(H).toHsv(),de=ie.h,Se=ie.s,Le=ie.v,Fe=[],ze=1/ae;ae--;)Fe.push(n({h:de,s:Se,v:Le})),Le=(Le+ze)%1;return Fe}n.mix=function(H,ae,ie){ie=ie===0?0:ie||50;var de=n(H).toRgb(),Se=n(ae).toRgb(),Le=ie/100,Fe={r:(Se.r-de.r)*Le+de.r,g:(Se.g-de.g)*Le+de.g,b:(Se.b-de.b)*Le+de.b,a:(Se.a-de.a)*Le+de.a};return n(Fe)},n.readability=function(H,ae){var ie=n(H),de=n(ae);return(h.max(ie.getLuminance(),de.getLuminance())+.05)/(h.min(ie.getLuminance(),de.getLuminance())+.05)},n.isReadable=function(H,ae,ie){var de=n.readability(H,ae),Se,Le;switch(Le=!1,Se=te(ie),Se.level+Se.size){case"AAsmall":case"AAAlarge":Le=de>=4.5;break;case"AAlarge":Le=de>=3;break;case"AAAsmall":Le=de>=7;break}return Le},n.mostReadable=function(H,ae,ie){var de=null,Se=0,Le,Fe,ze,Ye;ie=ie||{},Fe=ie.includeFallbackColors,ze=ie.level,Ye=ie.size;for(var st=0;stSe&&(Se=Le,de=n(ae[st]));return n.isReadable(H,de,{level:ze,size:Ye})||!Fe?de:(ie.includeFallbackColors=!1,n.mostReadable(H,["#fff","#000"],ie))};var F=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",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:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",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",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},N=n.hexNames=B(F);function B(H){var ae={};for(var ie in H)H.hasOwnProperty(ie)&&(ae[H[ie]]=ie);return ae}function R(H){return H=parseFloat(H),(isNaN(H)||H<0||H>1)&&(H=1),H}function U(H,ae){re(H)&&(H="100%");var ie=fe(H);return H=t(ae,r(0,parseFloat(H))),ie&&(H=parseInt(H*ae,10)/100),h.abs(H-ae)<1e-6?1:H%ae/parseFloat(ae)}function j(H){return t(1,r(0,H))}function Z(H){return parseInt(H,16)}function re(H){return typeof H=="string"&&H.indexOf(".")!=-1&&parseFloat(H)===1}function fe(H){return typeof H=="string"&&H.indexOf("%")!=-1}function le(H){return H.length==1?"0"+H:""+H}function ce(H){return H<=1&&(H=H*100+"%"),H}function V(H){return h.round(parseFloat(H)*255).toString(16)}function ee(H){return Z(H)/255}var ne=(function(){var H="[-\\+]?\\d+%?",ae="[-\\+]?\\d*\\.\\d+%?",ie="(?:"+ae+")|(?:"+H+")",de="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?",Se="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?";return{CSS_UNIT:new RegExp(ie),rgb:new RegExp("rgb"+de),rgba:new RegExp("rgba"+Se),hsl:new RegExp("hsl"+de),hsla:new RegExp("hsla"+Se),hsv:new RegExp("hsv"+de),hsva:new RegExp("hsva"+Se),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function $(H){return!!ne.CSS_UNIT.exec(H)}function ue(H){H=H.replace(b,"").replace(S,"").toLowerCase();var ae=!1;if(F[H])H=F[H],ae=!0;else if(H=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ie;return(ie=ne.rgb.exec(H))?{r:ie[1],g:ie[2],b:ie[3]}:(ie=ne.rgba.exec(H))?{r:ie[1],g:ie[2],b:ie[3],a:ie[4]}:(ie=ne.hsl.exec(H))?{h:ie[1],s:ie[2],l:ie[3]}:(ie=ne.hsla.exec(H))?{h:ie[1],s:ie[2],l:ie[3],a:ie[4]}:(ie=ne.hsv.exec(H))?{h:ie[1],s:ie[2],v:ie[3]}:(ie=ne.hsva.exec(H))?{h:ie[1],s:ie[2],v:ie[3],a:ie[4]}:(ie=ne.hex8.exec(H))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),a:ee(ie[4]),format:ae?"name":"hex8"}:(ie=ne.hex6.exec(H))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),format:ae?"name":"hex"}:(ie=ne.hex4.exec(H))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),a:ee(ie[4]+""+ie[4]),format:ae?"name":"hex8"}:(ie=ne.hex3.exec(H))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),format:ae?"name":"hex"}:!1}function te(H){var ae,ie;return H=H||{level:"AA",size:"small"},ae=(H.level||"AA").toUpperCase(),ie=(H.size||"small").toLowerCase(),ae!=="AA"&&ae!=="AAA"&&(ae="AA"),ie!=="small"&&ie!=="large"&&(ie="small"),{level:ae,size:ie}}typeof G<"u"&&G.exports?G.exports=n:window.tinycolor=n})(Math)}}),Ji=Ge({"src/lib/extend.js"(K){var G=So(),h=Array.isArray;function b(E,e){var t,r;for(t=0;t=0)))return n;if(c===3)s[c]>1&&(s[c]=1);else if(s[c]>=1)return n}var p=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return f?"rgba("+p+", "+s[3]+")":"rgb("+p+")"}}}),kv=Ge({"src/constants/interactions.js"(K,G){G.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),mp=Ge({"src/lib/regex.js"(K){K.counter=function(G,h,b,S){var E=(h||"")+(b?"":"$"),e=S===!1?"":"^";return G==="xy"?new RegExp(e+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+E):new RegExp(e+G+"([2-9]|[1-9][0-9]+)?"+E)}}}),$g=Ge({"src/lib/coerce.js"(K){var G=Ei(),h=Rs(),b=Ji().extendFlat,S=Jl(),E=pp(),e=go(),t=kv().DESELECTDIM,r=bu(),o=mp().counter,n=vs().modHalf,i=ws().isArrayOrTypedArray,a=ws().isTypedArraySpec,s=ws().decodeTypedArraySpec;K.valObjectMeta={data_array:{coerceFunction:function(c,p,v){p.set(i(c)?c:a(c)?s(c):v)}},enumerated:{coerceFunction:function(c,p,v,T){T.coerceNumber&&(c=+c),T.values.indexOf(c)===-1?p.set(v):p.set(c)},validateFunction:function(c,p){p.coerceNumber&&(c=+c);for(var v=p.values,T=0;Tg===!0||g===!1;l(c)||T.arrayOk&&Array.isArray(c)&&c.length>0&&c.every(l)?p.set(c):p.set(v)}},number:{coerceFunction:function(c,p,v,T){a(c)&&(c=s(c)),!G(c)||T.min!==void 0&&cT.max?p.set(v):p.set(+c)}},integer:{coerceFunction:function(c,p,v,T){if((T.extras||[]).indexOf(c)!==-1){p.set(c);return}a(c)&&(c=s(c)),c%1||!G(c)||T.min!==void 0&&cT.max?p.set(v):p.set(+c)}},string:{coerceFunction:function(c,p,v,T){if(typeof c!="string"){var l=typeof c=="number";T.strict===!0||!l?p.set(v):p.set(String(c))}else T.noBlank&&!c?p.set(v):p.set(c)}},color:{coerceFunction:function(c,p,v){a(c)&&(c=s(c)),h(c).isValid()?p.set(c):p.set(v)}},colorlist:{coerceFunction:function(c,p,v){function T(l){return h(l).isValid()}!Array.isArray(c)||!c.length?p.set(v):c.every(T)?p.set(c):p.set(v)}},colorscale:{coerceFunction:function(c,p,v){p.set(E.get(c,v))}},angle:{coerceFunction:function(c,p,v){a(c)&&(c=s(c)),c==="auto"?p.set("auto"):G(c)?p.set(n(+c,360)):p.set(v)}},subplotid:{coerceFunction:function(c,p,v,T){var l=T.regex||o(v);const g=x=>typeof x=="string"&&l.test(x);g(c)||T.arrayOk&&i(c)&&c.length>0&&c.every(g)?p.set(c):p.set(v)},validateFunction:function(c,p){var v=p.dflt;return c===v?!0:typeof c!="string"?!1:!!o(v).test(c)}},flaglist:{coerceFunction:function(c,p,v,T){if((T.extras||[]).indexOf(c)!==-1){p.set(c);return}if(typeof c!="string"){p.set(v);return}for(var l=c.split("+"),g=0;g/g),c=0;c1){var e=["LOG:"];for(E=0;E1){var t=[];for(E=0;E"),"long")}},S.warn=function(){var E;if(h.logging>0){var e=["WARN:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}},S.error=function(){var E;if(h.logging>0){var e=["ERROR:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}}}}),Vu=Ge({"src/lib/noop.js"(K,G){G.exports=function(){}}}),Wd=Ge({"src/lib/push_unique.js"(K,G){G.exports=function(b,S){if(S instanceof RegExp){for(var E=S.toString(),e=0;eHi({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),K.texttemplateAttrs=({editType:E="calc",arrayOk:e}={},t={})=>Hi({valType:"string",dflt:"",editType:E},e!==!1?{arrayOk:!0}:{}),K.shapeTexttemplateAttrs=({editType:E="arraydraw",newshape:e}={},t={})=>({valType:"string",dflt:"",editType:E}),K.templatefallbackAttrs=({editType:E="none"}={})=>({valType:"any",dflt:"-",editType:E})}}),lv=Ge({"src/components/shapes/label_texttemplate.js"(K,G){function h(g,x){return x?x.d2l(g):g}function b(g,x){return x?x.l2d(g):g}function S(g){return g.x0}function E(g){return g.x1}function e(g){return g.y0}function t(g){return g.y1}function r(g){return g.x0shift||0}function o(g){return g.x1shift||0}function n(g){return g.y0shift||0}function i(g){return g.y1shift||0}function a(g,x){return h(g.x1,x)+o(g)-h(g.x0,x)-r(g)}function s(g,x,A){return h(g.y1,A)+i(g)-h(g.y0,A)-n(g)}function f(g,x){return Math.abs(a(g,x))}function c(g,x,A){return Math.abs(s(g,x,A))}function p(g,x,A){return g.type!=="line"?void 0:Math.sqrt(Math.pow(a(g,x),2)+Math.pow(s(g,x,A),2))}function v(g,x){return b((h(g.x1,x)+o(g)+h(g.x0,x)+r(g))/2,x)}function T(g,x,A){return b((h(g.y1,A)+i(g)+h(g.y0,A)+n(g))/2,A)}function l(g,x,A){return g.type!=="line"?void 0:s(g,x,A)/a(g,x)}G.exports={x0:S,x1:E,y0:e,y1:t,slope:l,dx:a,dy:s,width:f,height:c,length:p,xcenter:v,ycenter:T}}}),Qg=Ge({"src/components/shapes/draw_newshape/attributes.js"(K,G){var h=Hc().overrideAll,b=Jl(),S=Us(),E=md().dash,e=Ji().extendFlat,{shapeTexttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=lv();G.exports=h({newshape:{visible:e({},b.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:e({},b.legend,{}),legendgroup:e({},b.legendgroup,{}),legendgrouptitle:{text:e({},b.legendgrouptitle.text,{}),font:S({})},legendrank:e({},b.legendrank,{}),legendwidth:e({},b.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:e({},E,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:e({},b.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:t({newshape:!0},{keys:Object.keys(o)}),texttemplatefallback:r({editType:"arraydraw"}),font:S({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),Vw=Ge({"src/components/selections/draw_newselection/attributes.js"(K,G){var h=md().dash,b=Ji().extendFlat;G.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:b({},h,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}}),Hw=Ge({"src/plots/pad_attributes.js"(K,G){G.exports=function(h){var b=h.editType;return{t:{valType:"number",dflt:0,editType:b},r:{valType:"number",dflt:0,editType:b},b:{valType:"number",dflt:0,editType:b},l:{valType:"number",dflt:0,editType:b},editType:b}}}}),w1=Ge({"src/plots/layout_attributes.js"(K,G){var h=Us(),b=Jg(),S=Xf(),E=Qg(),e=Vw(),t=Hw(),r=Ji().extendFlat,o=h({editType:"calc"});o.family.dflt='"Open Sans", verdana, arial, sans-serif',o.size.dflt=12,o.color.dflt=S.defaultLine,G.exports={font:o,title:{text:{valType:"string",editType:"layoutstyle"},font:h({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:h({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:r(t({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:S.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:S.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:S.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:E.newshape,activeshape:E.activeshape,newselection:e.newselection,activeselection:e.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:r({},b.transition,{editType:"none"})}}}),VT=Ge({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){(function(){if(!document.getElementById("696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97")){var K=document.createElement("style");K.id="696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97",K.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(K)}})()}}),Ro=Ge({"src/registry.js"(K){var G=Ql(),h=Vu(),b=Wd(),S=So(),E=Kg().addStyleRule,e=Ji(),t=Jl(),r=w1(),o=e.extendFlat,n=e.extendDeepAll;K.modules={},K.allCategories={},K.allTypes=[],K.subplotsRegistry={},K.componentsRegistry={},K.layoutArrayContainers=[],K.layoutArrayRegexes=[],K.traceLayoutAttributes={},K.localeRegistry={},K.apiMethodRegistry={},K.collectableSubplotTypes=null,K.register=function(x){if(K.collectableSubplotTypes=null,x)x&&!Array.isArray(x)&&(x=[x]);else throw new Error("No argument passed to Plotly.register.");for(var A=0;A=l&&F<=g?F:e}if(typeof F!="string"&&typeof F!="number")return e;F=String(F);var j=v(N),Z=F.charAt(0);j&&(Z==="G"||Z==="g")&&(F=F.slice(1),N="");var re=j&&N.slice(0,7)==="chinese",fe=F.match(re?c:f);if(!fe)return e;var le=fe[1],ce=fe[3]||"1",V=Number(fe[5]||1),ee=Number(fe[7]||0),ne=Number(fe[9]||0),$=Number(fe[11]||0);if(j){if(le.length===2)return e;le=Number(le);var ue;try{var te=a.getComponentMethod("calendars","getCal")(N);if(re){var H=ce.charAt(ce.length-1)==="i";ce=parseInt(ce,10),ue=te.newDate(le,te.toMonthIndex(le,ce,H),V)}else ue=te.newDate(le,Number(ce),V)}catch{return e}return ue?(ue.toJD()-i)*t+ee*r+ne*o+$*n:e}le.length===2?le=(Number(le)+2e3-p)%100+p:le=Number(le),ce-=1;var ae=new Date(Date.UTC(2e3,ce,V,ee,ne));return ae.setUTCFullYear(le),ae.getUTCMonth()!==ce||ae.getUTCDate()!==V?e:ae.getTime()+$*n},l=K.MIN_MS=K.dateTime2ms("-9999"),g=K.MAX_MS=K.dateTime2ms("9999-12-31 23:59:59.9999"),K.isDateTime=function(F,N){return K.dateTime2ms(F,N)!==e};function x(F,N){return String(F+Math.pow(10,N)).slice(1)}var A=90*t,M=3*r,_=5*o;K.ms2DateTime=function(F,N,B){if(typeof F!="number"||!(F>=l&&F<=g))return e;N||(N=0);var R=Math.floor(S(F+.05,1)*10),U=Math.round(F-R/10),j,Z,re,fe,le,ce;if(v(B)){var V=Math.floor(U/t)+i,ee=Math.floor(S(F,t));try{j=a.getComponentMethod("calendars","getCal")(B).fromJD(V).formatDate("yyyy-mm-dd")}catch{j=s("G%Y-%m-%d")(new Date(U))}if(j.charAt(0)==="-")for(;j.length<11;)j="-0"+j.slice(1);else for(;j.length<10;)j="0"+j;Z=N=l+t&&F<=g-t))return e;var N=Math.floor(S(F+.05,1)*10),B=new Date(Math.round(F-N/10)),R=G("%Y-%m-%d")(B),U=B.getHours(),j=B.getMinutes(),Z=B.getSeconds(),re=B.getUTCMilliseconds()*10+N;return w(R,U,j,Z,re)};function w(F,N,B,R,U){if((N||B||R||U)&&(F+=" "+x(N,2)+":"+x(B,2),(R||U)&&(F+=":"+x(R,2),U))){for(var j=4;U%10===0;)j-=1,U/=10;F+="."+x(U,j)}return F}K.cleanDate=function(F,N,B){if(F===e)return N;if(K.isJSDate(F)||typeof F=="number"&&isFinite(F)){if(v(B))return b.error("JS Dates and milliseconds are incompatible with world calendars",F),N;if(F=K.ms2DateTimeLocal(+F),!F&&N!==void 0)return N}else if(!K.isDateTime(F,B))return b.error("unrecognized date",F),N;return F};var m=/%\d?f/g,u=/%h/g,d={1:"1",2:"1",3:"2",4:"2"};function y(F,N,B,R){F=F.replace(m,function(j){var Z=Math.min(+j.charAt(1)||6,6),re=(N/1e3%1+2).toFixed(Z).slice(2).replace(/0+$/,"")||"0";return re});var U=new Date(Math.floor(N+.05));if(F=F.replace(u,function(){return d[B("%q")(U)]}),v(R))try{F=a.getComponentMethod("calendars","worldCalFmt")(F,N,R)}catch{return"Invalid"}return B(F)(U)}var I=[59,59.9,59.99,59.999,59.9999];function L(F,N){var B=S(F+.05,t),R=x(Math.floor(B/r),2)+":"+x(S(Math.floor(B/o),60),2);if(N!=="M"){h(N)||(N=0);var U=Math.min(S(F/n,60),I[N]),j=(100+U).toFixed(N).slice(1);N>0&&(j=j.replace(/0+$/,"").replace(/[\.]$/,"")),R+=":"+j}return R}K.formatDate=function(F,N,B,R,U,j){if(U=v(U)&&U,!N)if(B==="y")N=j.year;else if(B==="m")N=j.month;else if(B==="d")N=j.dayMonth+` `+j.year;else return L(F,B)+` -`+y(j.dayMonthYear,F,R,U);return y(N,F,R,U)};var z=3*t;$.incrementMonth=function(F,N,B){B=d(B)&&B;var R=S(F,t);if(F=Math.round(F-R),B)try{var U=Math.round(F/t)+i,j=a.getComponentMethod("calendars","getCal")(B),Z=j.fromJD(U);return N%12?j.add(Z,N,"m"):j.add(Z,N/12,"y"),(Z.toJD()-i)*t+R}catch{b.error("invalid ms "+F+" in calendar "+B)}var re=new Date(F+z);return re.setUTCMonth(re.getUTCMonth()+N)+R-z},$.findExactDates=function(F,N){for(var B=0,R=0,U=0,j=0,Z,re,fe=d(N)&&a.getComponentMethod("calendars","getCal")(N),le=0;le1?(i[f-1]-i[0])/(f-1):1,d,T;for(p>=0?T=a?e:t:T=a?o:r,n+=p*E*(a?-1:1)*(p>=0?1:-1);s90&&h.log("Long binary search..."),s-1};function e(n,i){return ni}function o(n,i){return n>=i}$.sorterAsc=function(n,i){return n-i},$.sorterDes=function(n,i){return i-n},$.distinctVals=function(n){var i=n.slice();i.sort($.sorterAsc);var a;for(a=i.length-1;a>-1&&i[a]===S;a--);for(var s=i[a]-i[0]||1,f=s/(a||1)/1e4,c=[],p,d=0;d<=a;d++){var T=i[d],l=T-p;p===void 0?(c.push(T),p=T):l>f&&(s=Math.min(s,l),c.push(T),p=T)}return{vals:c,minDiff:s}},$.roundUp=function(n,i,a){for(var s=0,f=i.length-1,c,p=0,d=a?0:1,T=a?1:0,l=a?Math.ceil:Math.floor;s0&&(s=1),a&&s)return n.sort(i)}return s?n:n.reverse()},$.findIndexOfMin=function(n,i){i=i||b;for(var a=1/0,s,f=0;fE.length)&&(e=E.length),G(S)||(S=!1),h(E[0])){for(r=new Array(e),t=0;tb.length-1)return b[b.length-1];var E=S%1;return E*b[Math.ceil(S)]+(1-E)*b[Math.floor(S)]}}}),Rv=Ge({"src/lib/angles.js"($,G){var h=os(),b=h.mod,S=h.modHalf,E=Math.PI,e=2*E;function t(T){return T/180*E}function r(T){return T/E*180}function o(T){return Math.abs(T[1]-T[0])>e-1e-14}function n(T,l){return S(l-T,e)}function i(T,l){return Math.abs(n(T,l))}function a(T,l){if(o(l))return!0;var g,x;l[0]x&&(x+=e);var A=b(T,e),M=A+e;return A>=g&&A<=x||M>=g&&M<=x}function s(T,l,g,x){if(!a(l,x))return!1;var A,M;return g[0]=A&&T<=M}function f(T,l,g,x,A,M,_){A=A||0,M=M||0;var w=o([g,x]),m,u,v,y,I;w?(m=0,u=E,v=e):g1/3&&h.x<2/3},$.isRightAnchor=function(h){return h.xanchor==="right"||h.xanchor==="auto"&&h.x>=2/3},$.isTopAnchor=function(h){return h.yanchor==="top"||h.yanchor==="auto"&&h.y>=2/3},$.isMiddleAnchor=function(h){return h.yanchor==="middle"||h.yanchor==="auto"&&h.y>1/3&&h.y<2/3},$.isBottomAnchor=function(h){return h.yanchor==="bottom"||h.yanchor==="auto"&&h.y<=1/3}}}),OT=Ge({"src/lib/geometry2d.js"($){var G=os().mod;$.segmentsIntersect=h;function h(t,r,o,n,i,a,s,f){var c=o-t,p=i-t,d=s-i,T=n-r,l=a-r,g=f-a,x=c*g-d*T;if(x===0)return null;var A=(p*g-d*l)/x,M=(p*T-c*l)/x;return M<0||M>1||A<0||A>1?null:{x:t+c*A,y:r+T*A}}$.segmentDistance=function(r,o,n,i,a,s,f,c){if(h(r,o,n,i,a,s,f,c))return 0;var p=n-r,d=i-o,T=f-a,l=c-s,g=p*p+d*d,x=T*T+l*l,A=Math.min(b(p,d,g,a-r,s-o),b(p,d,g,f-r,c-o),b(T,l,x,r-a,o-s),b(T,l,x,n-a,i-s));return Math.sqrt(A)};function b(t,r,o,n,i){var a=n*t+i*r;if(a<0)return n*n+i*i;if(a>o){var s=n-t,f=i-r;return s*s+f*f}else{var c=n*r-i*t;return c*c/o}}var S,E,e;$.getTextLocation=function(r,o,n,i){if((r!==E||i!==e)&&(S={},E=r,e=i),S[n])return S[n];var a=r.getPointAtLength(G(n-i/2,o)),s=r.getPointAtLength(G(n+i/2,o)),f=Math.atan((s.y-a.y)/(s.x-a.x)),c=r.getPointAtLength(G(n,o)),p=(c.x*4+a.x+s.x)/6,d=(c.y*4+a.y+s.y)/6,T={x:p,y:d,theta:f};return S[n]=T,T},$.clearLocationCache=function(){E=null},$.getVisibleSegment=function(r,o,n){var i=o.left,a=o.right,s=o.top,f=o.bottom,c=0,p=r.getTotalLength(),d=p,T,l;function g(A){var M=r.getPointAtLength(A);A===0?T=M:A===p&&(l=M);var _=M.xa?M.x-a:0,w=M.yf?M.y-f:0;return Math.sqrt(_*_+w*w)}for(var x=g(c);x;){if(c+=x+n,c>d)return;x=g(c)}for(x=g(d);x;){if(d-=x+n,c>d)return;x=g(d)}return{min:c,max:d,len:d-c,total:p,isClosed:c===0&&d===p&&Math.abs(T.x-l.x)<.1&&Math.abs(T.y-l.y)<.1}},$.findPointOnPath=function(r,o,n,i){i=i||{};for(var a=i.pathLength||r.getTotalLength(),s=i.tolerance||.001,f=i.iterationLimit||30,c=r.getPointAtLength(0)[n]>r.getPointAtLength(a)[n]?-1:1,p=0,d=0,T=a,l,g,x;p0?T=l:d=l,p++}return g}}}),k0=Ge({"src/lib/throttle.js"($){var G={};$.throttle=function(S,E,e){var t=G[S],r=Date.now();if(!t){for(var o in G)G[o].tst.ts+E){n();return}t.timer=setTimeout(function(){n(),t.timer=null},E)},$.done=function(b){var S=G[b];return!S||!S.timer?Promise.resolve():new Promise(function(E){var e=S.onDone;S.onDone=function(){e&&e(),E(),S.onDone=null}})},$.clear=function(b){if(b)h(G[b]),delete G[b];else for(var S in G)$.clear(S)};function h(b){b&&b.timer!==null&&(clearTimeout(b.timer),b.timer=null)}}}),$g=Ge({"src/lib/clear_responsive.js"($,G){G.exports=function(b){b._responsiveChartHandler&&(window.removeEventListener("resize",b._responsiveChartHandler),delete b._responsiveChartHandler)}}}),fM=Ge({"node_modules/is-mobile/index.js"($,G){G.exports=E,G.exports.isMobile=E,G.exports.default=E;var h=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,b=/CrOS/,S=/android|ipad|playbook|silk/i;function E(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string")return!1;let r=h.test(t)&&!b.test(t)||!!e.tablet&&S.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(r=!0),r}}}),FT=Ge({"src/lib/preserve_drawing_buffer.js"($,G){var h=Ga(),b=fM();G.exports=function(e){var t;if(e&&e.hasOwnProperty("userAgent")?t=e.userAgent:t=S(),typeof t!="string")return!0;var r=b({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var o=t.split(" "),n=1;n-1;a--){var s=o[a];if(s.slice(0,8)==="Version/"){var f=s.slice(8).split(".")[0];if(h(f)&&(f=+f),f>=13)return!0}}}return r};function S(){var E;return typeof navigator<"u"&&(E=navigator.userAgent),E&&E.headers&&typeof E.headers["user-agent"]=="string"&&(E=E.headers["user-agent"]),E}}}),BT=Ge({"src/lib/make_trace_groups.js"($,G){var h=Za();G.exports=function(S,E,e){var t=S.selectAll("g."+e.replace(/\s/g,".")).data(E,function(o){return o[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",e),t.order();var r=S.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(o){o[0][r]=h.select(this)}),t}}}),hM=Ge({"src/lib/localize.js"($,G){var h=Io();G.exports=function(S,E){for(var e=S._context.locale,t=0;t<2;t++){for(var r=S._context.locales,o=0;o<2;o++){var n=(r[e]||{}).dictionary;if(n){var i=n[E];if(i)return i}r=h.localeRegistry}var a=e.split("-")[0];if(a===e)break;e=a}return E}}}),_1=Ge({"src/lib/filter_unique.js"($,G){G.exports=function(b){for(var S={},E=[],e=0,t=0;t1?(E*b+E*S)/E:b+S,t=String(e).length;if(t>16){var r=String(S).length,o=String(b).length;if(t>=o+r){var n=parseFloat(e).toPrecision(12);n.indexOf("e+")===-1&&(e=+n)}}return e}}}),fp=Ge({"src/lib/clean_number.js"($,G){var h=Ga(),b=hi().BADNUM,S=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;G.exports=function(e){return typeof e=="string"&&(e=e.replace(S,"")),h(e)?Number(e):b}}}),yn=Ge({"src/lib/index.js"($,G){var h=Za(),b=Mi().utcFormat,S=po().format,E=Ga(),e=hi(),t=e.FP_SAFE,r=-t,o=e.BADNUM,n=G.exports={};n.adjustFormat=function(H){return!H||/^\d[.]\df/.test(H)||/[.]\d%/.test(H)?H:H==="0.f"?"~f":/^\d%/.test(H)?"~%":/^\ds/.test(H)?"~s":!/^[~,.0$]/.test(H)&&/[&fps]/.test(H)?"~"+H:H};var i={};n.warnBadFormat=function(te){var H=String(te);i[H]||(i[H]=1,n.warn('encountered bad format: "'+H+'"'))},n.noFormat=function(te){return String(te)},n.numberFormat=function(te){var H;try{H=S(n.adjustFormat(te))}catch{return n.warnBadFormat(te),n.noFormat}return H},n.nestedProperty=Ll(),n.keyedContainer=ma(),n.relativeAttr=Sa(),n.isPlainObject=yo(),n.toLogRange=Vi(),n.relinkPrivateKeys=Xn();var a=ro();n.isArrayBuffer=a.isArrayBuffer,n.isTypedArray=a.isTypedArray,n.isArrayOrTypedArray=a.isArrayOrTypedArray,n.isArray1D=a.isArray1D,n.ensureArray=a.ensureArray,n.concat=a.concat,n.maxRowLength=a.maxRowLength,n.minRowLength=a.minRowLength;var s=os();n.mod=s.mod,n.modHalf=s.modHalf;var f=J_();n.valObjectMeta=f.valObjectMeta,n.coerce=f.coerce,n.coerce2=f.coerce2,n.coerceFont=f.coerceFont,n.coercePattern=f.coercePattern,n.coerceHoverinfo=f.coerceHoverinfo,n.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,n.validate=f.validate;var c=Uw();n.dateTime2ms=c.dateTime2ms,n.isDateTime=c.isDateTime,n.ms2DateTime=c.ms2DateTime,n.ms2DateTimeLocal=c.ms2DateTimeLocal,n.cleanDate=c.cleanDate,n.isJSDate=c.isJSDate,n.formatDate=c.formatDate,n.incrementMonth=c.incrementMonth,n.dateTick0=c.dateTick0,n.dfltRange=c.dfltRange,n.findExactDates=c.findExactDates,n.MIN_MS=c.MIN_MS,n.MAX_MS=c.MAX_MS;var p=em();n.findBin=p.findBin,n.sorterAsc=p.sorterAsc,n.sorterDes=p.sorterDes,n.distinctVals=p.distinctVals,n.roundUp=p.roundUp,n.sort=p.sort,n.findIndexOfMin=p.findIndexOfMin,n.sortObjectKeys=Cp();var d=Kg();n.aggNums=d.aggNums,n.len=d.len,n.mean=d.mean,n.geometricMean=d.geometricMean,n.median=d.median,n.midRange=d.midRange,n.variance=d.variance,n.stdev=d.stdev,n.interp=d.interp;var T=ax();n.init2dArray=T.init2dArray,n.transposeRagged=T.transposeRagged,n.dot=T.dot,n.translationMatrix=T.translationMatrix,n.rotationMatrix=T.rotationMatrix,n.rotationXYMatrix=T.rotationXYMatrix,n.apply3DTransform=T.apply3DTransform,n.apply2DTransform=T.apply2DTransform,n.apply2DTransform2=T.apply2DTransform2,n.convertCssMatrix=T.convertCssMatrix,n.inverseTransformMatrix=T.inverseTransformMatrix;var l=Rv();n.deg2rad=l.deg2rad,n.rad2deg=l.rad2deg,n.angleDelta=l.angleDelta,n.angleDist=l.angleDist,n.isFullCircle=l.isFullCircle,n.isAngleInsideSector=l.isAngleInsideSector,n.isPtInsideSector=l.isPtInsideSector,n.pathArc=l.pathArc,n.pathSector=l.pathSector,n.pathAnnulus=l.pathAnnulus;var g=zT();n.isLeftAnchor=g.isLeftAnchor,n.isCenterAnchor=g.isCenterAnchor,n.isRightAnchor=g.isRightAnchor,n.isTopAnchor=g.isTopAnchor,n.isMiddleAnchor=g.isMiddleAnchor,n.isBottomAnchor=g.isBottomAnchor;var x=OT();n.segmentsIntersect=x.segmentsIntersect,n.segmentDistance=x.segmentDistance,n.getTextLocation=x.getTextLocation,n.clearLocationCache=x.clearLocationCache,n.getVisibleSegment=x.getVisibleSegment,n.findPointOnPath=x.findPointOnPath;var A=Qi();n.extendFlat=A.extendFlat,n.extendDeep=A.extendDeep,n.extendDeepAll=A.extendDeepAll,n.extendDeepNoArrays=A.extendDeepNoArrays;var M=cp();n.log=M.log,n.warn=M.warn,n.error=M.error;var _=n0();n.counterRegex=_.counter;var w=k0();n.throttle=w.throttle,n.throttleDone=w.done,n.clearThrottle=w.clear;var m=Yg();n.getGraphDiv=m.getGraphDiv,n.isPlotDiv=m.isPlotDiv,n.removeElement=m.removeElement,n.addStyleRule=m.addStyleRule,n.addRelatedStyleRule=m.addRelatedStyleRule,n.deleteRelatedStyleRule=m.deleteRelatedStyleRule,n.setStyleOnHover=m.setStyleOnHover,n.getFullTransformMatrix=m.getFullTransformMatrix,n.getElementTransformMatrix=m.getElementTransformMatrix,n.getElementAndAncestors=m.getElementAndAncestors,n.equalDomRects=m.equalDomRects,n.clearResponsive=$g(),n.preserveDrawingBuffer=FT(),n.makeTraceGroups=BT(),n._=hM(),n.notifier=Wm(),n.filterUnique=_1(),n.filterVisible=ix(),n.pushUnique=Q_(),n.increment=C0(),n.cleanNumber=fp(),n.ensureNumber=function(H){return E(H)?(H=Number(H),H>t||H=H?!1:E(te)&&te>=0&&te%1===0},n.noop=Km(),n.identity=E0(),n.repeat=function(te,H){for(var ae=new Array(H),ie=0;ieae?Math.max(ae,Math.min(H,te)):Math.max(H,Math.min(ae,te))},n.bBoxIntersect=function(te,H,ae){return ae=ae||0,te.left<=H.right+ae&&H.left<=te.right+ae&&te.top<=H.bottom+ae&&H.top<=te.bottom+ae},n.simpleMap=function(te,H,ae,ie,ve){for(var Ae=te.length,Ce=new Array(Ae),Fe=0;Fe=Math.pow(2,ae)?ve>10?(n.warn("randstr failed uniqueness"),Ce):te(H,ae,ie,(ve||0)+1):Ce},n.OptionControl=function(te,H){te||(te={}),H||(H="opt");var ae={};return ae.optionList=[],ae._newoption=function(ie){ie[H]=te,ae[ie.name]=ie,ae.optionList.push(ie)},ae["_"+H]=te,ae},n.smooth=function(te,H){if(H=Math.round(H)||0,H<2)return te;var ae=te.length,ie=2*ae,ve=2*H-1,Ae=new Array(ve),Ce=new Array(ae),Fe,ze,Ye,it;for(Fe=0;Fe=ie&&(Ye-=ie*Math.floor(Ye/ie)),Ye<0?Ye=-1-Ye:Ye>=ae&&(Ye=ie-1-Ye),it+=te[Ye]*Ae[ze];Ce[Fe]=it}return Ce},n.syncOrAsync=function(te,H,ae){var ie,ve;function Ae(){return n.syncOrAsync(te,H,ae)}for(;te.length;)if(ve=te.splice(0,1)[0],ie=ve(H),ie&&ie.then)return ie.then(Ae);return ae&&ae(H)},n.stripTrailingSlash=function(te){return te.slice(-1)==="/"?te.slice(0,-1):te},n.noneOrAll=function(te,H,ae){if(te){var ie=!1,ve=!0,Ae,Ce;for(Ae=0;Ae0?ve:0})},n.fillArray=function(te,H,ae,ie){if(ie=ie||n.identity,n.isArrayOrTypedArray(te))for(var ve=0;veL.test(window.navigator.userAgent);var z=/Firefox\/(\d+)\.\d+/;n.getFirefoxVersion=function(){var te=z.exec(window.navigator.userAgent);if(te&&te.length===2){var H=parseInt(te[1]);if(!isNaN(H))return H}return null},n.isD3Selection=function(te){return te instanceof h.selection},n.ensureSingle=function(te,H,ae,ie){var ve=te.select(H+(ae?"."+ae:""));if(ve.size())return ve;var Ae=te.append(H);return ae&&Ae.classed(ae,!0),ie&&Ae.call(ie),Ae},n.ensureSingleById=function(te,H,ae,ie){var ve=te.select(H+"#"+ae);if(ve.size())return ve;var Ae=te.append(H).attr("id",ae);return ie&&Ae.call(ie),Ae},n.objectFromPath=function(te,H){for(var ae=te.split("."),ie,ve=ie={},Ae=0;Ae1?ve+Ce[1]:"";if(Ae&&(Ce.length>1||Fe.length>4||ae))for(;ie.test(Fe);)Fe=Fe.replace(ie,"$1"+Ae+"$2");return Fe+ze},n.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var R=/^\w*$/;n.templateString=function(te,H){var ae={};return te.replace(n.TEMPLATE_STRING_REGEX,function(ie,ve){var Ae;return R.test(ve)?Ae=H[ve]:(ae[ve]=ae[ve]||n.nestedProperty(H,ve).get,Ae=ae[ve](!0)),Ae!==void 0?Ae:""})};var U={max:10,count:0,name:"hovertemplate"};n.hovertemplateString=te=>ce(qi(ao({},te),{opts:U}));var j={max:10,count:0,name:"texttemplate"};n.texttemplateString=te=>ce(qi(ao({},te),{opts:j}));var Z=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function re(te){var H=te.match(Z);return H?{key:H[1],op:H[2],number:Number(H[3])}:{key:te,op:null,number:null}}var fe={max:10,count:0,name:"texttemplate",parseMultDiv:!0};n.texttemplateStringForShapes=te=>ce(qi(ao({},te),{opts:fe}));var le=/^[:|\|]/;function ce({data:te=[],locale:H,fallback:ae,labels:ie={},opts:ve,template:Ae}){return Ae.replace(n.TEMPLATE_STRING_REGEX,(Ce,Fe,ze)=>{const Ye=["xother","yother"].includes(Fe),it=["_xother","_yother"].includes(Fe),st=["_xother_","_yother_"].includes(Fe),nt=["xother_","yother_"].includes(Fe),Qe=Ye||it||nt||st;(it||st)&&(Fe=Fe.substring(1)),(nt||st)&&(Fe=Fe.substring(0,Fe.length-1));let Le=null,Te=null;if(ve.parseMultDiv){var pe=re(Fe);Fe=pe.key,Le=pe.op,Te=pe.number}let Ne;if(Qe){if(ie[Fe]===void 0)return"";Ne=ie[Fe]}else for(const Ft of te)if(Ft){if(Ft.hasOwnProperty(Fe)){Ne=Ft[Fe];break}if(R.test(Fe)||(Ne=n.nestedProperty(Ft,Fe).get(!0)),Ne!==void 0)break}if(Ne===void 0){const{count:Ft,max:Nt,name:$t}=ve,rr=ae===!1?Ce:ae;return Ft=V&&Ce<=ee,Ye=Fe>=V&&Fe<=ee;if(ze&&(ie=10*ie+Ce-V),Ye&&(ve=10*ve+Fe-V),!ze||!Ye){if(ie!==ve)return ie-ve;if(Ce!==Fe)return Ce-Fe}}return ve-ie};var ne=2e9;n.seedPseudoRandom=function(){ne=2e9},n.pseudoRandom=function(){var te=ne;return ne=(69069*ne+1)%4294967296,Math.abs(ne-te)<429496729?n.pseudoRandom():ne/4294967296},n.fillText=function(te,H,ae){var ie=Array.isArray(ae)?function(Ce){ae.push(Ce)}:function(Ce){ae.text=Ce},ve=n.extractOption(te,H,"htx","hovertext");if(n.isValidTextValue(ve))return ie(ve);var Ae=n.extractOption(te,H,"tx","text");if(n.isValidTextValue(Ae))return ie(Ae)},n.isValidTextValue=function(te){return te||te===0},n.formatPercent=function(te,H){H=H||0;for(var ae=(Math.round(100*te*Math.pow(10,H))*Math.pow(.1,H)).toFixed(H)+"%",ie=0;ie1&&(Ye=1):Ye=0,n.strTranslate(ve-Ye*(ae+Ce),Ae-Ye*(ie+Fe))+n.strScale(Ye)+(ze?"rotate("+ze+(H?"":" "+ae+" "+ie)+")":"")},n.setTransormAndDisplay=function(te,H){te.attr("transform",n.getTextTransform(H)),te.style("display",H.scale?null:"none")},n.ensureUniformFontSize=function(te,H){var ae=n.extendFlat({},H);return ae.size=Math.max(H.size,te._fullLayout.uniformtext.minsize||0),ae},n.join2=function(te,H,ae){var ie=te.length;return ie>1?te.slice(0,-1).join(H)+ae+te[ie-1]:te.join(H)},n.bigFont=function(te){return Math.round(1.2*te)};var K=n.getFirefoxVersion(),ue=K!==null&&K<86;n.getPositionFromD3Event=function(){return ue?[h.event.layerX,h.event.layerY]:[h.event.offsetX,h.event.offsetY]}}}),vM=Ge({"build/plotcss.js"(){var $=yn(),G={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(b in G)h=b.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),$.addStyleRule(h,G[b]);var h,b}}),ox=Ge({"node_modules/is-browser/client.js"($,G){G.exports=!0}}),jw=Ge({"node_modules/has-hover/index.js"($,G){var h=ox(),b;typeof window.matchMedia=="function"?b=!window.matchMedia("(hover: none)").matches:b=h,G.exports=b}}),L0=Ge({"node_modules/events/events.js"($,G){var h=typeof Reflect=="object"?Reflect:null,b=h&&typeof h.apply=="function"?h.apply:function(M,_,w){return Function.prototype.apply.call(M,_,w)},S;h&&typeof h.ownKeys=="function"?S=h.ownKeys:Object.getOwnPropertySymbols?S=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:S=function(M){return Object.getOwnPropertyNames(M)};function E(A){console&&console.warn&&console.warn(A)}var e=Number.isNaN||function(M){return M!==M};function t(){t.init.call(this)}G.exports=t,G.exports.once=l,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function o(A){if(typeof A!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof A)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(A){if(typeof A!="number"||A<0||e(A))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");r=A}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(M){if(typeof M!="number"||M<0||e(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function n(A){return A._maxListeners===void 0?t.defaultMaxListeners:A._maxListeners}t.prototype.getMaxListeners=function(){return n(this)},t.prototype.emit=function(M){for(var _=[],w=1;w0&&(v=_[0]),v instanceof Error)throw v;var y=new Error("Unhandled error."+(v?" ("+v.message+")":""));throw y.context=v,y}var I=u[M];if(I===void 0)return!1;if(typeof I=="function")b(I,this,_);else for(var L=I.length,z=p(I,L),w=0;w0&&v.length>m&&!v.warned){v.warned=!0;var y=new Error("Possible EventEmitter memory leak detected. "+v.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");y.name="MaxListenersExceededWarning",y.emitter=A,y.type=M,y.count=v.length,E(y)}return A}t.prototype.addListener=function(M,_){return i(this,M,_,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(M,_){return i(this,M,_,!0)};function a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(A,M,_){var w={fired:!1,wrapFn:void 0,target:A,type:M,listener:_},m=a.bind(w);return m.listener=_,w.wrapFn=m,m}t.prototype.once=function(M,_){return o(_),this.on(M,s(this,M,_)),this},t.prototype.prependOnceListener=function(M,_){return o(_),this.prependListener(M,s(this,M,_)),this},t.prototype.removeListener=function(M,_){var w,m,u,v,y;if(o(_),m=this._events,m===void 0)return this;if(w=m[M],w===void 0)return this;if(w===_||w.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete m[M],m.removeListener&&this.emit("removeListener",M,w.listener||_));else if(typeof w!="function"){for(u=-1,v=w.length-1;v>=0;v--)if(w[v]===_||w[v].listener===_){y=w[v].listener,u=v;break}if(u<0)return this;u===0?w.shift():d(w,u),w.length===1&&(m[M]=w[0]),m.removeListener!==void 0&&this.emit("removeListener",M,y||_)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(M){var _,w,m;if(w=this._events,w===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete w[M]),this;if(arguments.length===0){var u=Object.keys(w),v;for(m=0;m=0;m--)this.removeListener(M,_[m]);return this};function f(A,M,_){var w=A._events;if(w===void 0)return[];var m=w[M];return m===void 0?[]:typeof m=="function"?_?[m.listener||m]:[m]:_?T(m):p(m,m.length)}t.prototype.listeners=function(M){return f(this,M,!0)},t.prototype.rawListeners=function(M){return f(this,M,!1)},t.listenerCount=function(A,M){return typeof A.listenerCount=="function"?A.listenerCount(M):c.call(A,M)},t.prototype.listenerCount=c;function c(A){var M=this._events;if(M!==void 0){var _=M[A];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?S(this._events):[]};function p(A,M){for(var _=new Array(M),w=0;w{},{passive:!0}),S},triggerHandler:function(S,E,e){var t,r=S._ev;if(!r)return;var o=r._events[E];if(!o)return;function n(a){if(a.listener){if(r.removeListener(E,a.listener),!a.fired)return a.fired=!0,a.listener.apply(r,[e])}else return a.apply(r,[e])}o=Array.isArray(o)?o:[o];var i;for(i=0;ib.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},E.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},E.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},E.undo=function(t){var r,o;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=R.length)return!1;if(L.dimensions===2){if(F++,z.length===F)return L;var U=z[F];if(!x(U))return!1;L=R[B][U]}else L=R[B]}else L=R}}return L}function x(L){return L===Math.round(L)&&L>=0}function A(L){var z,F;z=G.modules[L]._module,F=z.basePlotModule;var N={};N.type=null;var B=o({},b),R=o({},z.attributes);$.crawl(R,function(Z,re,fe,le,ce){a(B,ce).set(void 0),Z===void 0&&a(R,ce).set(void 0)}),o(N,B),G.traceIs(L,"noOpacity")&&delete N.opacity,G.traceIs(L,"showLegend")||(delete N.showlegend,delete N.legendgroup),G.traceIs(L,"noHover")&&(delete N.hoverinfo,delete N.hoverlabel),z.selectPoints||delete N.selectedpoints,o(N,R),F.attributes&&o(N,F.attributes),N.type=L;var U={meta:z.meta||{},categories:z.categories||{},animatable:!!z.animatable,type:L,attributes:w(N)};if(z.layoutAttributes){var j={};o(j,z.layoutAttributes),U.layoutAttributes=w(j)}return z.animatable||$.crawl(U,function(Z){$.isValObject(Z)&&"anim"in Z&&delete Z.anim}),U}function M(){var L={},z,F;o(L,S);for(z in G.subplotsRegistry)if(F=G.subplotsRegistry[z],!!F.layoutAttributes)if(Array.isArray(F.attr))for(var N=0;N=n&&(o._input||{})._templateitemname;a&&(i=n);var s=r+"["+i+"]",f;function c(){f={},a&&(f[s]={},f[s][b]=a)}c();function p(g,x){f[g]=x}function d(g,x){a?G.nestedProperty(f[s],g).set(x):f[s+"."+g]=x}function T(){var g=f;return c(),g}function l(g,x){g&&d(g,x);var A=T();for(var M in A)G.nestedProperty(t,M).set(A[M])}return{modifyBase:p,modifyItem:d,getUpdateObj:T,applyUpdate:l}}}}),nh=Ge({"src/plots/cartesian/constants.js"($,G){var h=n0().counter;G.exports={idRegex:{x:h("x","( domain)?"),y:h("y","( domain)?")},attrRegex:h("[xy]axis"),xAxisMatch:h("xaxis"),yAxisMatch:h("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),Lf=Ge({"src/plots/cartesian/axis_ids.js"($){var G=Io(),h=nh();$.id2name=function(E){if(!(typeof E!="string"||!E.match(h.AX_ID_PATTERN))){var e=E.split(" ")[0].slice(1);return e==="1"&&(e=""),E.charAt(0)+"axis"+e}},$.name2id=function(E){if(E.match(h.AX_NAME_PATTERN)){var e=E.slice(5);return e==="1"&&(e=""),E.charAt(0)+e}},$.cleanId=function(E,e,t){var r=/( domain)$/.test(E);if(!(typeof E!="string"||!E.match(h.AX_ID_PATTERN))&&!(e&&E.charAt(0)!==e)&&!(r&&!t)){var o=E.split(" ")[0].slice(1).replace(/^0+/,"");return o==="1"&&(o=""),E.charAt(0)+o+(r&&t?" domain":"")}},$.list=function(S,E,e){var t=S._fullLayout;if(!t)return[];var r=$.listIds(S,E),o=new Array(r.length),n;for(n=0;nt?1:-1:+(S.slice(1)||1)-+(E.slice(1)||1)},$.ref2id=function(S){return/^[xyz]/.test(S)?S.split(" ")[0]:!1};function b(S,E){if(E&&E.length){for(var e=0;e0?".":"")+a;h.isPlainObject(s)?t(s,o,f,i+1):o(f,a,s)}})}}}),$c=Ge({"src/plots/plots.js"($,G){var h=Za(),b=Mi().timeFormatLocale,S=po().formatLocale,E=Ga(),e=ai(),t=Io(),r=Jg(),o=mu(),n=yn(),i=So(),a=hi().BADNUM,s=Lf(),f=tm().clearOutline,c=rm(),p=Zg(),d=sx(),T=Iv().getModuleCalcData,l=n.relinkPrivateKeys,g=n._,x=G.exports={};n.extendFlat(x,t),x.attributes=nu(),x.attributes.type.values=x.allTypes,x.fontAttrs=Fs(),x.layoutAttributes=y1();var A=NT();x.executeAPICommand=A.executeAPICommand,x.computeAPICommandBindings=A.computeAPICommandBindings,x.manageCommandObserver=A.manageCommandObserver,x.hasSimpleAPICommandBindings=A.hasSimpleAPICommandBindings,x.redrawText=function(V){return V=n.getGraphDiv(V),new Promise(function(ee){setTimeout(function(){V._fullLayout&&(t.getComponentMethod("annotations","draw")(V),t.getComponentMethod("legend","draw")(V),t.getComponentMethod("colorbar","draw")(V),ee(x.previousPromises(V)))},300)})},x.resize=function(V){V=n.getGraphDiv(V);var ee,ne=new Promise(function(K,ue){(!V||n.isHidden(V))&&ue(new Error("Resize must be passed a displayed plot div element.")),V._redrawTimer&&clearTimeout(V._redrawTimer),V._resolveResize&&(ee=V._resolveResize),V._resolveResize=K,V._redrawTimer=setTimeout(function(){if(!V.layout||V.layout.width&&V.layout.height||n.isHidden(V)){K(V);return}delete V.layout.width,delete V.layout.height;var te=V.changed;V.autoplay=!0,t.call("relayout",V,{autosize:!0}).then(function(){V.changed=te,V._resolveResize===K&&(delete V._resolveResize,K(V))})},100)});return ee&&ee(ne),ne},x.previousPromises=function(V){if((V._promises||[]).length)return Promise.all(V._promises).then(function(){V._promises=[]})},x.addLinks=function(V){if(!(!V._context.showLink&&!V._context.showSources)){var ee=V._fullLayout,ne=n.ensureSingle(ee._paper,"text","js-plot-link-container",function(ie){ie.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:i.defaultLine,"pointer-events":"all"}).each(function(){var ve=h.select(this);ve.append("tspan").classed("js-link-to-tool",!0),ve.append("tspan").classed("js-link-spacer",!0),ve.append("tspan").classed("js-sourcelinks",!0)})}),K=ne.node(),ue={y:ee._paper.attr("height")-9};document.body.contains(K)&&K.getComputedTextLength()>=ee.width-20?(ue["text-anchor"]="start",ue.x=5):(ue["text-anchor"]="end",ue.x=ee._paper.attr("width")-7),ne.attr(ue);var te=ne.select(".js-link-to-tool"),H=ne.select(".js-link-spacer"),ae=ne.select(".js-sourcelinks");V._context.showSources&&V._context.showSources(V),V._context.showLink&&M(V,te),H.text(te.text()&&ae.text()?" - ":"")}};function M(V,ee){ee.text("");var ne=ee.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(V._context.linkText+" »");if(V._context.sendData)ne.on("click",function(){x.sendDataToCloud(V)});else{var K=window.location.pathname.split("/"),ue=window.location.search;ne.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+K[2].split(".")[0]+"/"+K[1]+ue})}}x.sendDataToCloud=function(V){var ee=(window.PLOTLYENV||{}).BASE_URL||V._context.plotlyServerURL;if(ee){V.emit("plotly_beforeexport");var ne=h.select(V).append("div").attr("id","hiddenform").style("display","none"),K=ne.append("form").attr({action:ee+"/external",method:"post",target:"_blank"}),ue=K.append("input").attr({type:"text",name:"data"});return ue.node().value=x.graphJson(V,!1,"keepdata"),K.node().submit(),ne.remove(),V.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];x.supplyDefaults=function(V,ee){var ne=ee&&ee.skipUpdateCalc,K=V._fullLayout||{};if(K._skipDefaults){delete K._skipDefaults;return}var ue=V._fullLayout={},te=V.layout||{},H=V._fullData||[],ae=V._fullData=[],ie=V.data||[],ve=V.calcdata||[],Ae=V._context||{},Ce;V._transitionData||x.createTransitionData(V),ue._dfltTitle={plot:g(V,"Click to enter Plot title"),subtitle:g(V,"Click to enter Plot subtitle"),x:g(V,"Click to enter X axis title"),y:g(V,"Click to enter Y axis title"),colorbar:g(V,"Click to enter Colorscale title"),annotation:g(V,"new text")},ue._traceWord=g(V,"trace");var Fe=v(V,_);if(ue._mapboxAccessToken=Ae.mapboxAccessToken,K._initialAutoSizeIsDone){var ze=K.width,Ye=K.height;x.supplyLayoutGlobalDefaults(te,ue,Fe),te.width||(ue.width=ze),te.height||(ue.height=Ye),x.sanitizeMargins(ue)}else{x.supplyLayoutGlobalDefaults(te,ue,Fe);var it=!te.width||!te.height,st=ue.autosize,nt=Ae.autosizable,Qe=it&&(st||nt);Qe?x.plotAutoSize(V,te,ue):it&&x.sanitizeMargins(ue),!st&&it&&(te.width=ue.width,te.height=ue.height)}ue._d3locale=y(Fe,ue.separators),ue._extraFormat=v(V,w),ue._initialAutoSizeIsDone=!0,ue._dataLength=ie.length,ue._modules=[],ue._visibleModules=[],ue._basePlotModules=[];var Le=ue._subplots=u(),Te=ue._splomAxes={x:{},y:{}},pe=ue._splomSubplots={};ue._splomGridDflt={},ue._scatterStackOpts={},ue._firstScatter={},ue._alignmentOpts={},ue._colorAxes={},ue._requestRangeslider={},ue._traceUids=m(H,ie),x.supplyDataDefaults(ie,ae,te,ue);var Ne=Object.keys(Te.x),ot=Object.keys(Te.y);if(Ne.length>1&&ot.length>1){for(t.getComponentMethod("grid","sizeDefaults")(te,ue),Ce=0;Ce15&&ot.length>15&&ue.shapes.length===0&&ue.images.length===0,x.linkSubplots(ae,ue,H,K),x.cleanPlot(ae,ue,H,K);var $t=!!(K._has&&K._has("cartesian")),rr=!!(ue._has&&ue._has("cartesian")),Er=$t,Mr=rr;Er&&!Mr?K._bgLayer.remove():Mr&&!Er&&(ue._shouldCreateBgLayer=!0),K._zoomlayer&&!V._dragging&&f({_fullLayout:K}),I(ae,ue),l(ue,K),t.getComponentMethod("colorscale","crossTraceDefaults")(ae,ue),ue._preGUI||(ue._preGUI={}),ue._tracePreGUI||(ue._tracePreGUI={});var Wr=ue._tracePreGUI,Sr={},Br;for(Br in Wr)Sr[Br]="old";for(Ce=0;Ce0){var Ae=1-2*te;H=Math.round(Ae*H),ae=Math.round(Ae*ae)}}var Ce=x.layoutAttributes.width.min,Fe=x.layoutAttributes.height.min;H1,Ye=!ne.height&&Math.abs(K.height-ae)>1;(Ye||ze)&&(ze&&(K.width=H),Ye&&(K.height=ae)),ee._initialAutoSize||(ee._initialAutoSize={width:H,height:ae}),x.sanitizeMargins(K)},x.supplyLayoutModuleDefaults=function(V,ee,ne,K){var ue=t.componentsRegistry,te=ee._basePlotModules,H,ae,ie,ve=t.subplotsRegistry.cartesian;for(H in ue)ie=ue[H],ie.includeBasePlot&&ie.includeBasePlot(V,ee);te.length||te.push(ve),ee._has("cartesian")&&(t.getComponentMethod("grid","contentDefaults")(V,ee),ve.finalizeSubplots(V,ee));for(var Ae in ee._subplots)ee._subplots[Ae].sort(n.subplotSort);for(ae=0;ae1&&(ne.l/=st,ne.r/=st)}if(Fe){var nt=(ne.t+ne.b)/Fe;nt>1&&(ne.t/=nt,ne.b/=nt)}var Qe=ne.xl!==void 0?ne.xl:ne.x,Le=ne.xr!==void 0?ne.xr:ne.x,Te=ne.yt!==void 0?ne.yt:ne.y,pe=ne.yb!==void 0?ne.yb:ne.y;ze[ee]={l:{val:Qe,size:ne.l+it},r:{val:Le,size:ne.r+it},b:{val:pe,size:ne.b+it},t:{val:Te,size:ne.t+it}},Ye[ee]=1}if(!K._replotting)return x.doAutoMargin(V)}};function R(V){if("_redrawFromAutoMarginCount"in V._fullLayout)return!1;var ee=s.list(V,"",!0);for(var ne in ee)if(ee[ne].autoshift||ee[ne].shift)return!0;return!1}x.doAutoMargin=function(V){var ee=V._fullLayout,ne=ee.width,K=ee.height;ee._size||(ee._size={}),F(ee);var ue=ee._size,te=ee.margin,H={t:0,b:0,l:0,r:0},ae=n.extendFlat({},ue),ie=te.l,ve=te.r,Ae=te.t,Ce=te.b,Fe=ee._pushmargin,ze=ee._pushmarginIds,Ye=ee.minreducedwidth,it=ee.minreducedheight;if(te.autoexpand!==!1){for(var st in Fe)ze[st]||delete Fe[st];var nt=V._fullLayout._reservedMargin;for(var Qe in nt)for(var Le in nt[Qe]){var Te=nt[Qe][Le];H[Le]=Math.max(H[Le],Te)}Fe.base={l:{val:0,size:ie},r:{val:1,size:ve},t:{val:1,size:Ae},b:{val:0,size:Ce}};for(var pe in H){var Ne=0;for(var ot in Fe)ot!=="base"&&E(Fe[ot][pe].size)&&(Ne=Fe[ot][pe].size>Ne?Fe[ot][pe].size:Ne);var ft=Math.max(0,te[pe]-Ne);H[pe]=Math.max(0,H[pe]-ft)}for(var rt in Fe){var Ft=Fe[rt].l||{},Nt=Fe[rt].b||{},$t=Ft.val,rr=Ft.size,Er=Nt.val,Mr=Nt.size,Wr=ne-H.r-H.l,Sr=K-H.t-H.b;for(var Br in Fe){if(E(rr)&&Fe[Br].r){var Mt=Fe[Br].r.val,je=Fe[Br].r.size;if(Mt>$t){var $e=(rr*Mt+(je-Wr)*$t)/(Mt-$t),Ee=(je*(1-$t)+(rr-Wr)*(1-Mt))/(Mt-$t);$e+Ee>ie+ve&&(ie=$e,ve=Ee)}}if(E(Mr)&&Fe[Br].t){var xe=Fe[Br].t.val,ye=Fe[Br].t.size;if(xe>Er){var Me=(Mr*xe+(ye-Sr)*Er)/(xe-Er),Xe=(ye*(1-Er)+(Mr-Sr)*(1-xe))/(xe-Er);Me+Xe>Ce+Ae&&(Ce=Me,Ae=Xe)}}}}}var Je=n.constrain(ne-te.l-te.r,N,Ye),Lt=n.constrain(K-te.t-te.b,B,it),Ct=Math.max(0,ne-Je),Ot=Math.max(0,K-Lt);if(Ct){var Wt=(ie+ve)/Ct;Wt>1&&(ie/=Wt,ve/=Wt)}if(Ot){var _r=(Ce+Ae)/Ot;_r>1&&(Ce/=_r,Ae/=_r)}if(ue.l=Math.round(ie)+H.l,ue.r=Math.round(ve)+H.r,ue.t=Math.round(Ae)+H.t,ue.b=Math.round(Ce)+H.b,ue.p=Math.round(te.pad),ue.w=Math.round(ne)-ue.l-ue.r,ue.h=Math.round(K)-ue.t-ue.b,!ee._replotting&&(x.didMarginChange(ae,ue)||R(V))){"_redrawFromAutoMarginCount"in ee?ee._redrawFromAutoMarginCount++:ee._redrawFromAutoMarginCount=1;var pr=3*(1+Object.keys(ze).length);if(ee._redrawFromAutoMarginCount1)return!0}return!1},x.graphJson=function(V,ee,ne,K,ue,te){(ue&&ee&&!V._fullData||ue&&!ee&&!V._fullLayout)&&x.supplyDefaults(V);var H=ue?V._fullData:V.data,ae=ue?V._fullLayout:V.layout,ie=(V._transitionData||{})._frames;function ve(Fe,ze){if(typeof Fe=="function")return ze?"_function_":null;if(n.isPlainObject(Fe)){var Ye={},it;return Object.keys(Fe).sort().forEach(function(Le){if(["_","["].indexOf(Le.charAt(0))===-1){if(typeof Fe[Le]=="function"){ze&&(Ye[Le]="_function");return}if(ne==="keepdata"){if(Le.slice(-3)==="src")return}else if(ne==="keepstream"){if(it=Fe[Le+"src"],typeof it=="string"&&it.indexOf(":")>0&&!n.isPlainObject(Fe.stream))return}else if(ne!=="keepall"&&(it=Fe[Le+"src"],typeof it=="string"&&it.indexOf(":")>0))return;Ye[Le]=ve(Fe[Le],ze)}}),Ye}var st=Array.isArray(Fe),nt=n.isTypedArray(Fe);if((st||nt)&&Fe.dtype&&Fe.shape){var Qe=Fe.bdata;return ve({dtype:Fe.dtype,shape:Fe.shape,bdata:n.isArrayBuffer(Qe)?e.encode(Qe):Qe},ze)}return st?Fe.map(function(Le){return ve(Le,ze)}):nt?n.simpleMap(Fe,n.identity):n.isJSDate(Fe)?n.ms2DateTimeLocal(+Fe):Fe}var Ae={data:(H||[]).map(function(Fe){var ze=ve(Fe);return ee&&delete ze.fit,ze})};if(!ee&&(Ae.layout=ve(ae),ue)){var Ce=ae._size;Ae.layout.computed={margin:{b:Ce.b,l:Ce.l,r:Ce.r,t:Ce.t}}}return ie&&(Ae.frames=ve(ie)),te&&(Ae.config=ve(V._context,!0)),K==="object"?Ae:JSON.stringify(Ae)},x.modifyFrames=function(V,ee){var ne,K,ue,te=V._transitionData._frames,H=V._transitionData._frameHash;for(ne=0;ne0&&(V._transitioningWithDuration=!0),V._transitionData._interruptCallbacks.push(function(){K=!0}),ne.redraw&&V._transitionData._interruptCallbacks.push(function(){return t.call("redraw",V)}),V._transitionData._interruptCallbacks.push(function(){V.emit("plotly_transitioninterrupted",[])});var Fe=0,ze=0;function Ye(){return Fe++,function(){ze++,!K&&ze===Fe&&ae(Ce)}}ne.runFn(Ye),setTimeout(Ye())})}function ae(Ce){if(V._transitionData)return te(V._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(ne.redraw)return t.call("redraw",V)}).then(function(){V._transitioning=!1,V._transitioningWithDuration=!1,V.emit("plotly_transitioned",[])}).then(Ce)}function ie(){if(V._transitionData)return V._transitioning=!1,ue(V._transitionData._interruptCallbacks)}var ve=[x.previousPromises,ie,ne.prepareFn,x.rehover,x.reselect,H],Ae=n.syncOrAsync(ve,V);return(!Ae||!Ae.then)&&(Ae=Promise.resolve()),Ae.then(function(){return V})}x.doCalcdata=function(V,ee){var ne=s.list(V),K=V._fullData,ue=V._fullLayout,te,H,ae,ie,ve=new Array(K.length),Ae=(V.calcdata||[]).slice();for(V.calcdata=ve,ue._numBoxes=0,ue._numViolins=0,ue._violinScaleGroupStats={},V._hmpixcount=0,V._hmlumcount=0,ue._piecolormap={},ue._sunburstcolormap={},ue._treemapcolormap={},ue._iciclecolormap={},ue._funnelareacolormap={},ae=0;ae=0;ie--)if(pe[ie].enabled){te._indexToPoints=pe[ie]._indexToPoints;break}H&&H.calc&&(Te=H.calc(V,te))}(!Array.isArray(Te)||!Te[0])&&(Te=[{x:a,y:a}]),Te[0].t||(Te[0].t={}),Te[0].trace=te,ve[Qe]=Te}}for(le(ne,K,ue),ae=0;aeae||ze>ie)&&(te.style("overflow","hidden"),Ce=te.node().getBoundingClientRect(),Fe=Ce.width,ze=Ce.height);var Ye=+B.attr("x"),it=+B.attr("y"),st=V||B.node().getBoundingClientRect().height,nt=-st/4;if(fe[0]==="y")H.attr({transform:"rotate("+[-90,Ye,it]+")"+b(-Fe/2,nt-ze/2)});else if(fe[0]==="l")it=nt-ze/2;else if(fe[0]==="a"&&fe.indexOf("atitle")!==0)Ye=0,it=nt;else{var Qe=B.attr("text-anchor");Ye=Ye-Fe*(Qe==="middle"?.5:Qe==="end"?1:0),it=it+nt-ze/2}te.attr({x:Ye,y:it}),U&&U.call(B,H),ce(H)})})):le(),B};var t=/(<|<|<)/g,r=/(>|>|>)/g;function o(B){return B.replace(t,"\\lt ").replace(r,"\\gt ")}var n=[["$","$"],["\\(","\\)"]];function i(B,R,U){var j=parseInt((MathJax.version||"").split(".")[0]);if(j!==2&&j!==3){h.warn("No MathJax version:",MathJax.version);return}var Z,re,fe,le,ce=function(){return re=h.extendDeepAll({},MathJax.Hub.config),fe=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:n},displayAlign:"left"})},V=function(){re=h.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=n},ee=function(){if(Z=MathJax.Hub.config.menuSettings.renderer,Z!=="SVG")return MathJax.Hub.setRenderer("SVG")},ne=function(){Z=MathJax.config.startup.output,Z!=="svg"&&(MathJax.config.startup.output="svg")},K=function(){var ve="math-output-"+h.randstr({},64);le=G.select("body").append("div").attr({id:ve}).style({visibility:"hidden",position:"absolute","font-size":R.fontSize+"px"}).text(o(B));var Ae=le.node();return j===2?MathJax.Hub.Typeset(Ae):MathJax.typeset([Ae])},ue=function(){var ve=le.select(j===2?".MathJax_SVG":".MathJax"),Ae=!ve.empty()&&le.select("svg").node();if(!Ae)h.log("There was an error in the tex syntax.",B),U();else{var Ce=Ae.getBoundingClientRect(),Fe;j===2?Fe=G.select("body").select("#MathJax_SVG_glyphs"):Fe=ve.select("defs"),U(ve,Fe,Ce)}le.remove()},te=function(){if(Z!=="SVG")return MathJax.Hub.setRenderer(Z)},H=function(){Z!=="svg"&&(MathJax.config.startup.output=Z)},ae=function(){return fe!==void 0&&(MathJax.Hub.processSectionDelay=fe),MathJax.Hub.Config(re)},ie=function(){MathJax.config=re};j===2?MathJax.Hub.Queue(ce,ee,K,ue,te,ae):j===3&&(V(),ne(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){K(),ue(),H(),ie()}))}var a={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},s={sub:"0.3em",sup:"-0.6em"},f={sub:"-0.21em",sup:"0.42em"},c="​",p=["http:","https:","mailto:","",void 0,":"],d=$.NEWLINES=/(\r\n?|\n)/g,T=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,g=//i;$.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,A=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,M=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,_=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function w(B,R){if(!B)return null;var U=B.match(R),j=U&&(U[3]||U[4]);return j&&y(j)}var m=/(^|;)\s*color:/;$.plainText=function(B,R){R=R||{};for(var U=R.len!==void 0&&R.len!==-1?R.len:1/0,j=R.allowedTags!==void 0?R.allowedTags:["br"],Z="...",re=Z.length,fe=B.split(T),le=[],ce="",V=0,ee=0;eere?le.push(ne.slice(0,Math.max(0,H-re))+Z):le.push(ne.slice(0,H));break}ce=""}}return le.join("")};var u={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},v=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function y(B){return B.replace(v,function(R,U){var j;return U.charAt(0)==="#"?j=I(U.charAt(1)==="x"?parseInt(U.slice(2),16):parseInt(U.slice(1),10)):j=u[U],j||R})}$.convertEntities=y;function I(B){if(!(B>1114111)){var R=String.fromCodePoint;if(R)return R(B);var U=String.fromCharCode;return B<=65535?U(B):U((B>>10)+55232,B%1024+56320)}}function L(B,R){R=R.replace(d," ");var U=!1,j=[],Z,re=-1;function fe(){re++;var ze=document.createElementNS(S.svg,"tspan");G.select(ze).attr({class:"line",dy:re*E+"em"}),B.appendChild(ze),Z=ze;var Ye=j;if(j=[{node:ze}],Ye.length>1)for(var it=1;it.",R);return}var Ye=j.pop();ze!==Ye.type&&h.log("Start tag <"+Ye.type+"> doesnt match end tag <"+ze+">. Pretending it did match.",R),Z=j[j.length-1].node}var ee=g.test(R);ee?fe():(Z=B,j=[{node:B}]);for(var ne=R.split(T),K=0;K=0;g--,x++){var A=d[g];l[x]=[1-A[0],A[1]]}return l}function f(d,T){T=T||{};for(var l=d.domain,g=d.range,x=g.length,A=new Array(x),M=0;Md-c?c=d-(p-d):p-d=0?g=o.colorscale.sequential:g=o.colorscale.sequentialminus,s._sync("colorscale",g)}}}}),Ac=Ge({"src/components/colorscale/index.js"($,G){var h=r0(),b=vv();G.exports={moduleType:"component",name:"colorscale",attributes:Ru(),layoutAttributes:Jm(),supplyLayoutDefaults:UT(),handleDefaults:dh(),crossTraceDefaults:cx(),calc:pv(),scales:h.scales,defaultScale:h.defaultScale,getScale:h.get,isValidScale:h.isValid,hasColorscale:b.hasColorscale,extractOpts:b.extractOpts,extractScale:b.extractScale,flipScale:b.flipScale,makeColorScaleFunc:b.makeColorScaleFunc,makeColorScaleFuncFromTrace:b.makeColorScaleFuncFromTrace}}}),ou=Ge({"src/traces/scatter/subtypes.js"($,G){var h=yn(),b=ro().isTypedArraySpec;G.exports={hasLines:function(S){return S.visible&&S.mode&&S.mode.indexOf("lines")!==-1},hasMarkers:function(S){return S.visible&&(S.mode&&S.mode.indexOf("markers")!==-1||S.type==="splom")},hasText:function(S){return S.visible&&S.mode&&S.mode.indexOf("text")!==-1},isBubble:function(S){var E=S.marker;return h.isPlainObject(E)&&(h.isArrayOrTypedArray(E.size)||b(E.size))}}}}),Pp=Ge({"src/traces/scatter/make_bubble_size_func.js"($,G){var h=Ga();G.exports=function(S,E){E||(E=2);var e=S.marker,t=e.sizeref||1,r=e.sizemin||0,o=e.sizemode==="area"?function(n){return Math.sqrt(n/t)}:function(n){return n/t};return function(n){var i=o(n/E);return h(i)&&i>0?Math.max(i,r):0}}}}),Hv=Ge({"src/components/fx/helpers.js"($){var G=yn();$.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},$.isTraceInSubplots=function(t,r){if(t.type==="splom"){for(var o=t.xaxes||[],n=t.yaxes||[],i=0;i=0&&o.index2&&(r.push([n].concat(i.splice(0,2))),a="l",n=n=="m"?"l":"L");;){if(i.length==h[a])return i.unshift(n),r.push(i);if(i.length0&&(Te=100,Le=Le.replace("-open","")),Le.indexOf("-dot")>0&&(Te+=200,Le=Le.replace("-dot","")),Le=l.symbolNames.indexOf(Le),Le>=0&&(Le+=Te)}return Le%100>=m||Le>=400?0:Math.floor(Math.max(Le,0))};function v(Le,Te,pe,Ne){var ot=Le%100;return l.symbolFuncs[ot](Te,pe,Ne)+(Le>=200?u:"")}var y=S("~f"),I={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};l.gradient=function(Le,Te,pe,Ne,ot,ft){var rt=I[Ne];return L(Le,Te,pe,rt.type,ot,ft,rt.start,rt.stop,!1,rt.reversed)};function L(Le,Te,pe,Ne,ot,ft,rt,Ft,Nt,$t){var rr=ot.length,Er;Ne==="linear"?Er={node:"linearGradient",attrs:{x1:rt.x,y1:rt.y,x2:Ft.x,y2:Ft.y,gradientUnits:Nt?"userSpaceOnUse":"objectBoundingBox"},reversed:$t}:Ne==="radial"&&(Er={node:"radialGradient",reversed:$t});for(var Mr=new Array(rr),Wr=0;Wr=0&&Le.i===void 0&&(Le.i=ft.i),Te.style("opacity",Ne.selectedOpacityFn?Ne.selectedOpacityFn(Le):Le.mo===void 0?rt.opacity:Le.mo),Ne.ms2mrc){var Nt;Le.ms==="various"||rt.size==="various"?Nt=3:Nt=Ne.ms2mrc(Le.ms),Le.mrc=Nt,Ne.selectedSizeFn&&(Nt=Le.mrc=Ne.selectedSizeFn(Le));var $t=l.symbolNumber(Le.mx||rt.symbol)||0;Le.om=$t%200>=100;var rr=Qe(Le,pe),Er=ae(Le,pe);Te.attr("d",v($t,Nt,rr,Er))}var Mr=!1,Wr,Sr,Br;if(Le.so)Br=Ft.outlierwidth,Sr=Ft.outliercolor,Wr=rt.outliercolor;else{var Mt=(Ft||{}).width;Br=(Le.mlw+1||Mt+1||(Le.trace?(Le.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Le?Sr=Le.mlcc=Ne.lineScale(Le.mlc):b.isArrayOrTypedArray(Ft.color)?Sr=r.defaultLine:Sr=Ft.color,b.isArrayOrTypedArray(rt.color)&&(Wr=r.defaultLine,Mr=!0),"mc"in Le?Wr=Le.mcc=Ne.markerScale(Le.mc):Wr=rt.color||rt.colors||"rgba(0,0,0,0)",Ne.selectedColorFn&&(Wr=Ne.selectedColorFn(Le))}if(Le.om)Te.call(r.stroke,Wr).style({"stroke-width":(Br||1)+"px",fill:"none"});else{Te.style("stroke-width",(Le.isBlank?0:Br)+"px");var je=rt.gradient,$e=Le.mgt;$e?Mr=!0:$e=je&&je.type,b.isArrayOrTypedArray($e)&&($e=$e[0],I[$e]||($e=0));var Ee=rt.pattern,xe=l.getPatternAttr,ye=Ee&&(xe(Ee.shape,Le.i,"")||xe(Ee.path,Le.i,""));if($e&&$e!=="none"){var Me=Le.mgc;Me?Mr=!0:Me=je.color;var Xe=pe.uid;Mr&&(Xe+="-"+Le.i),l.gradient(Te,ot,Xe,$e,[[0,Me],[1,Wr]],"fill")}else if(ye){var Je=!1,Lt=Ee.fgcolor;!Lt&&ft&&ft.color&&(Lt=ft.color,Je=!0);var Ct=xe(Lt,Le.i,ft&&ft.color||null),Ot=xe(Ee.bgcolor,Le.i,null),Wt=Ee.fgopacity,_r=xe(Ee.size,Le.i,8),pr=xe(Ee.solidity,Le.i,.3);Je=Je||Le.mcc||b.isArrayOrTypedArray(Ee.shape)||b.isArrayOrTypedArray(Ee.path)||b.isArrayOrTypedArray(Ee.bgcolor)||b.isArrayOrTypedArray(Ee.fgcolor)||b.isArrayOrTypedArray(Ee.size)||b.isArrayOrTypedArray(Ee.solidity);var hr=pe.uid;Je&&(hr+="-"+Le.i),l.pattern(Te,"point",ot,hr,ye,_r,pr,Le.mcc,Ee.fillmode,Ot,Ct,Wt)}else b.isArrayOrTypedArray(Wr)?r.fill(Te,Wr[Le.i]):r.fill(Te,Wr);Br&&r.stroke(Te,Sr)}},l.makePointStyleFns=function(Le){var Te={},pe=Le.marker;return Te.markerScale=l.tryColorscale(pe,""),Te.lineScale=l.tryColorscale(pe,"line"),t.traceIs(Le,"symbols")&&(Te.ms2mrc=p.isBubble(Le)?d(Le):function(){return(pe.size||6)/2}),Le.selectedpoints&&b.extendFlat(Te,l.makeSelectedPointStyleFns(Le)),Te},l.makeSelectedPointStyleFns=function(Le){var Te={},pe=Le.selected||{},Ne=Le.unselected||{},ot=Le.marker||{},ft=pe.marker||{},rt=Ne.marker||{},Ft=ot.opacity,Nt=ft.opacity,$t=rt.opacity,rr=Nt!==void 0,Er=$t!==void 0;(b.isArrayOrTypedArray(Ft)||rr||Er)&&(Te.selectedOpacityFn=function(xe){var ye=xe.mo===void 0?ot.opacity:xe.mo;return xe.selected?rr?Nt:ye:Er?$t:c*ye});var Mr=ot.color,Wr=ft.color,Sr=rt.color;(Wr||Sr)&&(Te.selectedColorFn=function(xe){var ye=xe.mcc||Mr;return xe.selected?Wr||ye:Sr||ye});var Br=ot.size,Mt=ft.size,je=rt.size,$e=Mt!==void 0,Ee=je!==void 0;return t.traceIs(Le,"symbols")&&($e||Ee)&&(Te.selectedSizeFn=function(xe){var ye=xe.mrc||Br/2;return xe.selected?$e?Mt/2:ye:Ee?je/2:ye}),Te},l.makeSelectedTextStyleFns=function(Le){var Te={},pe=Le.selected||{},Ne=Le.unselected||{},ot=Le.textfont||{},ft=pe.textfont||{},rt=Ne.textfont||{},Ft=ot.color,Nt=ft.color,$t=rt.color;return Te.selectedTextColorFn=function(rr){var Er=rr.tc||Ft;return rr.selected?Nt||Er:$t||(Nt?Er:r.addOpacity(Er,c))},Te},l.selectedPointStyle=function(Le,Te){if(!(!Le.size()||!Te.selectedpoints)){var pe=l.makeSelectedPointStyleFns(Te),Ne=Te.marker||{},ot=[];pe.selectedOpacityFn&&ot.push(function(ft,rt){ft.style("opacity",pe.selectedOpacityFn(rt))}),pe.selectedColorFn&&ot.push(function(ft,rt){r.fill(ft,pe.selectedColorFn(rt))}),pe.selectedSizeFn&&ot.push(function(ft,rt){var Ft=rt.mx||Ne.symbol||0,Nt=pe.selectedSizeFn(rt);ft.attr("d",v(l.symbolNumber(Ft),Nt,Qe(rt,Te),ae(rt,Te))),rt.mrc2=Nt}),ot.length&&Le.each(function(ft){for(var rt=h.select(this),Ft=0;Ft0?pe:0}l.textPointStyle=function(Le,Te,pe){if(Le.size()){var Ne;if(Te.selectedpoints){var ot=l.makeSelectedTextStyleFns(Te);Ne=ot.selectedTextColorFn}var ft=Te.texttemplate,rt=pe._fullLayout;Le.each(function(Ft){var Nt=h.select(this),$t=ft?b.extractOption(Ft,Te,"txt","texttemplate"):b.extractOption(Ft,Te,"tx","text");if(!$t&&$t!==0){Nt.remove();return}if(ft){var rr=Te._module.formatLabels,Er=rr?rr(Ft,Te,rt):{},Mr={};T(Mr,Te,Ft.i),$t=b.texttemplateString({data:[Mr,Ft,Te._meta],fallback:Te.texttemplatefallback,labels:Er,locale:rt._d3locale,template:$t})}var Wr=Ft.tp||Te.textposition,Sr=N(Ft,Te),Br=Ne?Ne(Ft):Ft.tc||Te.textfont.color;Nt.call(l.font,{family:Ft.tf||Te.textfont.family,weight:Ft.tw||Te.textfont.weight,style:Ft.ty||Te.textfont.style,variant:Ft.tv||Te.textfont.variant,textcase:Ft.tC||Te.textfont.textcase,lineposition:Ft.tE||Te.textfont.lineposition,shadow:Ft.tS||Te.textfont.shadow,size:Sr,color:Br}).text($t).call(i.convertToTspans,pe).call(F,Wr,Sr,Ft.mrc)})}},l.selectedTextStyle=function(Le,Te){if(!(!Le.size()||!Te.selectedpoints)){var pe=l.makeSelectedTextStyleFns(Te);Le.each(function(Ne){var ot=h.select(this),ft=pe.selectedTextColorFn(Ne),rt=Ne.tp||Te.textposition,Ft=N(Ne,Te);r.fill(ot,ft);var Nt=t.traceIs(Te,"bar-like");F(ot,rt,Ft,Ne.mrc2||Ne.mrc,Nt)})}};var B=.5;l.smoothopen=function(Le,Te){if(Le.length<3)return"M"+Le.join("L");var pe="M"+Le[0],Ne=[],ot;for(ot=1;ot=Nt||xe>=rr&&xe<=Nt)&&(ye<=Er&&ye>=$t||ye>=Er&&ye<=$t)&&(Le=[xe,ye])}return Le}l.applyBackoff=V,l.makeTester=function(){var Le=b.ensureSingleById(h.select("body"),"svg","js-plotly-tester",function(pe){pe.attr(a.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),Te=b.ensureSingle(Le,"path","js-reference-point",function(pe){pe.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=Le,l.testref=Te},l.savedBBoxes={};var ee=0,ne=1e4;l.bBox=function(Le,Te,pe){pe||(pe=K(Le));var Ne;if(pe){if(Ne=l.savedBBoxes[pe],Ne)return b.extendFlat({},Ne)}else if(Le.childNodes.length===1){var ot=Le.childNodes[0];if(pe=K(ot),pe){var ft=+ot.getAttribute("x")||0,rt=+ot.getAttribute("y")||0,Ft=ot.getAttribute("transform");if(!Ft){var Nt=l.bBox(ot,!1,pe);return ft&&(Nt.left+=ft,Nt.right+=ft),rt&&(Nt.top+=rt,Nt.bottom+=rt),Nt}if(pe+="~"+ft+"~"+rt+"~"+Ft,Ne=l.savedBBoxes[pe],Ne)return b.extendFlat({},Ne)}}var $t,rr;Te?$t=Le:(rr=l.tester.node(),$t=Le.cloneNode(!0),rr.appendChild($t)),h.select($t).attr("transform",null).call(i.positionText,0,0);var Er=$t.getBoundingClientRect(),Mr=l.testref.node().getBoundingClientRect();Te||rr.removeChild($t);var Wr={height:Er.height,width:Er.width,left:Er.left-Mr.left,top:Er.top-Mr.top,right:Er.right-Mr.left,bottom:Er.bottom-Mr.top};return ee>=ne&&(l.savedBBoxes={},ee=0),pe&&(l.savedBBoxes[pe]=Wr),ee++,b.extendFlat({},Wr)};function K(Le){var Te=Le.getAttribute("data-unformatted");if(Te!==null)return Te+Le.getAttribute("data-math")+Le.getAttribute("text-anchor")+Le.getAttribute("style")}l.setClipUrl=function(Le,Te,pe){Le.attr("clip-path",ue(Te,pe))};function ue(Le,Te){if(!Le)return null;var pe=Te._context,Ne=pe._exportedPlot?"":pe._baseUrl||"";return Ne?"url('"+Ne+"#"+Le+"')":"url(#"+Le+")"}l.getTranslate=function(Le){var Te=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,pe=Le.attr?"attr":"getAttribute",Ne=Le[pe]("transform")||"",ot=Ne.replace(Te,function(ft,rt,Ft){return[rt,Ft].join(" ")}).split(" ");return{x:+ot[0]||0,y:+ot[1]||0}},l.setTranslate=function(Le,Te,pe){var Ne=/(\btranslate\(.*?\);?)/,ot=Le.attr?"attr":"getAttribute",ft=Le.attr?"attr":"setAttribute",rt=Le[ot]("transform")||"";return Te=Te||0,pe=pe||0,rt=rt.replace(Ne,"").trim(),rt+=n(Te,pe),rt=rt.trim(),Le[ft]("transform",rt),rt},l.getScale=function(Le){var Te=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,pe=Le.attr?"attr":"getAttribute",Ne=Le[pe]("transform")||"",ot=Ne.replace(Te,function(ft,rt,Ft){return[rt,Ft].join(" ")}).split(" ");return{x:+ot[0]||1,y:+ot[1]||1}},l.setScale=function(Le,Te,pe){var Ne=/(\bscale\(.*?\);?)/,ot=Le.attr?"attr":"getAttribute",ft=Le.attr?"attr":"setAttribute",rt=Le[ot]("transform")||"";return Te=Te||1,pe=pe||1,rt=rt.replace(Ne,"").trim(),rt+="scale("+Te+","+pe+")",rt=rt.trim(),Le[ft]("transform",rt),rt};var te=/\s*sc.*/;l.setPointGroupScale=function(Le,Te,pe){if(Te=Te||1,pe=pe||1,!!Le){var Ne=Te===1&&pe===1?"":"scale("+Te+","+pe+")";Le.each(function(){var ot=(this.getAttribute("transform")||"").replace(te,"");ot+=Ne,ot=ot.trim(),this.setAttribute("transform",ot)})}};var H=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(Le,Te,pe){Le&&Le.each(function(){var Ne,ot=h.select(this),ft=ot.select("text");if(ft.node()){var rt=parseFloat(ft.attr("x")||0),Ft=parseFloat(ft.attr("y")||0),Nt=(ot.attr("transform")||"").match(H);Te===1&&pe===1?Ne=[]:Ne=[n(rt,Ft),"scale("+Te+","+pe+")",n(-rt,-Ft)],Nt&&Ne.push(Nt),ot.attr("transform",Ne.join(""))}})};function ae(Le,Te){var pe;return Le&&(pe=Le.mf),pe===void 0&&(pe=Te.marker&&Te.marker.standoff||0),!Te._geo&&!Te._xA?-pe:pe}l.getMarkerStandoff=ae;var ie=Math.atan2,ve=Math.cos,Ae=Math.sin;function Ce(Le,Te){var pe=Te[0],Ne=Te[1];return[pe*ve(Le)-Ne*Ae(Le),pe*Ae(Le)+Ne*ve(Le)]}var Fe,ze,Ye,it,st,nt;function Qe(Le,Te){var pe=Le.ma;pe===void 0&&(pe=Te.marker.angle,(!pe||b.isArrayOrTypedArray(pe))&&(pe=0));var Ne,ot,ft=Te.marker.angleref;if(ft==="previous"||ft==="north"){if(Te._geo){var rt=Te._geo.project(Le.lonlat);Ne=rt[0],ot=rt[1]}else{var Ft=Te._xA,Nt=Te._yA;if(Ft&&Nt)Ne=Ft.c2p(Le.x),ot=Nt.c2p(Le.y);else return 90}if(Te._geo){var $t=Le.lonlat[0],rr=Le.lonlat[1],Er=Te._geo.project([$t,rr+1e-5]),Mr=Te._geo.project([$t+1e-5,rr]),Wr=ie(Mr[1]-ot,Mr[0]-Ne),Sr=ie(Er[1]-ot,Er[0]-Ne),Br;if(ft==="north")Br=pe/180*Math.PI;else if(ft==="previous"){var Mt=$t/180*Math.PI,je=rr/180*Math.PI,$e=Fe/180*Math.PI,Ee=ze/180*Math.PI,xe=$e-Mt,ye=ve(Ee)*Ae(xe),Me=Ae(Ee)*ve(je)-ve(Ee)*Ae(je)*ve(xe);Br=-ie(ye,Me)-Math.PI,Fe=$t,ze=rr}var Xe=Ce(Wr,[ve(Br),0]),Je=Ce(Sr,[Ae(Br),0]);pe=ie(Xe[1]+Je[1],Xe[0]+Je[0])/Math.PI*180,ft==="previous"&&!(nt===Te.uid&&Le.i===st+1)&&(pe=null)}if(ft==="previous"&&!Te._geo)if(nt===Te.uid&&Le.i===st+1&&E(Ne)&&E(ot)){var Lt=Ne-Ye,Ct=ot-it,Ot=Te.line&&Te.line.shape||"",Wt=Ot.slice(Ot.length-1);Wt==="h"&&(Ct=0),Wt==="v"&&(Lt=0),pe+=ie(Ct,Lt)/Math.PI*180+90}else pe=null}return Ye=Ne,it=ot,st=Le.i,nt=Te.uid,pe}l.getMarkerAngle=Qe}}),am=Ge({"src/components/titles/index.js"($,G){var h=Za(),b=Ga(),S=$c(),E=Io(),e=yn(),t=e.strTranslate,r=Ms(),o=So(),n=ec(),i=up(),a=ev().OPPOSITE_SIDE,s=/ [XY][0-9]* /,f=1.6,c=1.6;function p(d,T,l){var g=d._fullLayout,x=l.propContainer,A=l.propName,M=l.placeholder,_=l.traceIndex,w=l.avoid||{},m=l.attributes,u=l.transform,v=l.containerGroup,y=1,I=x.title,L=(I&&I.text?I.text:"").trim(),z=!1,F=I&&I.font?I.font:{},N=F.family,B=F.size,R=F.color,U=F.weight,j=F.style,Z=F.variant,re=F.textcase,fe=F.lineposition,le=F.shadow,ce=l.subtitlePropName,V=!!ce,ee=l.subtitlePlaceholder,ne=(x.title||{}).subtitle||{text:"",font:{}},K=(ne.text||"").trim(),ue=!1,te=1,H=ne.font,ae=H.family,ie=H.size,ve=H.color,Ae=H.weight,Ce=H.style,Fe=H.variant,ze=H.textcase,Ye=H.lineposition,it=H.shadow,st;A==="title.text"?st="titleText":A.indexOf("axis")!==-1?st="axisTitleText":A.indexOf("colorbar")!==-1&&(st="colorbarTitleText");var nt=d._context.edits[st];function Qe(Mr,Wr){return Mr===void 0||Wr===void 0?!1:Mr.replace(s," % ")===Wr.replace(s," % ")}L===""?y=0:Qe(L,M)&&(nt||(L=""),y=.2,z=!0),V&&(K===""?te=0:Qe(K,ee)&&(nt||(K=""),te=.2,ue=!0)),l._meta?L=e.templateString(L,l._meta):g._meta&&(L=e.templateString(L,g._meta));var Le=L||K||nt,Te;v||(v=e.ensureSingle(g._infolayer,"g","g-"+T),Te=g._hColorbarMoveTitle);var pe=v.selectAll("text."+T).data(Le?[0]:[]);pe.enter().append("text"),pe.text(L).attr("class",T),pe.exit().remove();var Ne=null,ot=T+"-subtitle",ft=K||nt;if(V&&(Ne=v.selectAll("text."+ot).data(ft?[0]:[]),Ne.enter().append("text"),Ne.text(K).attr("class",ot),Ne.exit().remove()),!Le)return v;function rt(Mr,Wr){e.syncOrAsync([Ft,Nt],{title:Mr,subtitle:Wr})}function Ft(Mr){var Wr=Mr.title,Sr=Mr.subtitle,Br;!u&&Te&&(u={}),u?(Br="",u.rotate&&(Br+="rotate("+[u.rotate,m.x,m.y]+")"),(u.offset||Te)&&(Br+=t(0,(u.offset||0)-(Te||0)))):Br=null,Wr.attr("transform",Br);function Mt(Me){if(Me){var Xe=h.select(Me.node().parentNode).select("."+ot);if(!Xe.empty()){var Je=Me.node().getBBox();if(Je.height){var Lt=Je.y+Je.height+f*ie;Xe.attr("y",Lt)}}}}if(Wr.style("opacity",y*o.opacity(R)).call(r.font,{color:o.rgb(R),size:h.round(B,2),family:N,weight:U,style:j,variant:Z,textcase:re,shadow:le,lineposition:fe}).attr(m).call(n.convertToTspans,d,Mt),Sr&&!Sr.empty()){var je=v.select("."+T+"-math-group"),$e=Wr.node().getBBox(),Ee=je.node()?je.node().getBBox():void 0,xe=Ee?Ee.y+Ee.height+f*ie:$e.y+$e.height+c*ie,ye=e.extendFlat({},m,{y:xe});Sr.attr("transform",Br),Sr.style("opacity",te*o.opacity(ve)).call(r.font,{color:o.rgb(ve),size:h.round(ie,2),family:ae,weight:Ae,style:Ce,variant:Fe,textcase:ze,shadow:it,lineposition:Ye}).attr(ye).call(n.convertToTspans,d)}return S.previousPromises(d)}function Nt(Mr){var Wr=Mr.title,Sr=h.select(Wr.node().parentNode);if(w&&w.selection&&w.side&&L){Sr.attr("transform",null);var Br=a[w.side],Mt=w.side==="left"||w.side==="top"?-1:1,je=b(w.pad)?w.pad:2,$e=r.bBox(Sr.node()),Ee={t:0,b:0,l:0,r:0},xe=d._fullLayout._reservedMargin;for(var ye in xe)for(var Me in xe[ye]){var Xe=xe[ye][Me];Ee[Me]=Math.max(Ee[Me],Xe)}var Je={left:Ee.l,top:Ee.t,right:g.width-Ee.r,bottom:g.height-Ee.b},Lt=w.maxShift||Mt*(Je[w.side]-$e[w.side]),Ct=0;if(Lt<0)Ct=Lt;else{var Ot=w.offsetLeft||0,Wt=w.offsetTop||0;$e.left-=Ot,$e.right-=Ot,$e.top-=Wt,$e.bottom-=Wt,w.selection.each(function(){var pr=r.bBox(this);e.bBoxIntersect($e,pr,je)&&(Ct=Math.max(Ct,Mt*(pr[w.side]-$e[Br])+je))}),Ct=Math.min(Lt,Ct),x._titleScoot=Math.abs(Ct)}if(Ct>0||Lt<0){var _r={left:[-Ct,0],right:[Ct,0],top:[0,-Ct],bottom:[0,Ct]}[w.side];Sr.attr("transform",t(_r[0],_r[1]))}}}pe.call(rt,Ne);function $t(Mr,Wr){Mr.text(Wr).on("mouseover.opacity",function(){h.select(this).transition().duration(i.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){h.select(this).transition().duration(i.HIDE_PLACEHOLDER).style("opacity",0)})}if(nt&&(L?pe.on(".opacity",null):($t(pe,M),z=!0),pe.call(n.makeEditable,{gd:d}).on("edit",function(Mr){_!==void 0?E.call("_guiRestyle",d,A,Mr,_):E.call("_guiRelayout",d,A,Mr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(rt)}).on("input",function(Mr){this.text(Mr||" ").call(n.positionText,m.x,m.y)}),V)){if(V&&!L){var rr=pe.node().getBBox(),Er=rr.y+rr.height+c*ie;Ne.attr("y",Er)}K?Ne.on(".opacity",null):($t(Ne,ee),ue=!0),Ne.call(n.makeEditable,{gd:d}).on("edit",function(Mr){E.call("_guiRelayout",d,"title.subtitle.text",Mr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(rt)}).on("input",function(Mr){this.text(Mr||" ").call(n.positionText,Ne.attr("x"),Ne.attr("y"))})}return pe.classed("js-placeholder",z),Ne&&!Ne.empty()&&Ne.classed("js-placeholder",ue),v}G.exports={draw:p,SUBTITLE_PADDING_EM:c,SUBTITLE_PADDING_MATHJAX_EM:f}}}),Kd=Ge({"src/plots/cartesian/set_convert.js"($,G){var h=Za(),b=Mi().utcFormat,S=yn(),E=S.numberFormat,e=Ga(),t=S.cleanNumber,r=S.ms2DateTime,o=S.dateTime2ms,n=S.ensureNumber,i=S.isArrayOrTypedArray,a=hi(),s=a.FP_SAFE,f=a.BADNUM,c=a.LOG_CLIP,p=a.ONEWEEK,d=a.ONEDAY,T=a.ONEHOUR,l=a.ONEMIN,g=a.ONESEC,x=Lf(),A=nh(),M=A.HOUR_PATTERN,_=A.WEEKDAY_PATTERN;function w(u){return Math.pow(10,u)}function m(u){return u!=null}G.exports=function(v,y){y=y||{};var I=v._id||"x",L=I.charAt(0);function z(K,ue){if(K>0)return Math.log(K)/Math.LN10;if(K<=0&&ue&&v.range&&v.range.length===2){var te=v.range[0],H=v.range[1];return .5*(te+H-2*c*Math.abs(te-H))}else return f}function F(K,ue,te,H){if((H||{}).msUTC&&e(K))return+K;var ae=o(K,te||v.calendar);if(ae===f)if(e(K)){K=+K;var ie=Math.floor(S.mod(K+.05,1)*10),ve=Math.round(K-ie/10);ae=o(new Date(ve))+ie/10}else return f;return ae}function N(K,ue,te){return r(K,ue,te||v.calendar)}function B(K){return v._categories[Math.round(K)]}function R(K){if(m(K)){if(v._categoriesMap===void 0&&(v._categoriesMap={}),v._categoriesMap[K]!==void 0)return v._categoriesMap[K];v._categories.push(typeof K=="number"?String(K):K);var ue=v._categories.length-1;return v._categoriesMap[K]=ue,ue}return f}function U(K,ue){for(var te=new Array(ue),H=0;Hv.range[1]&&(te=!te);for(var H=te?-1:1,ae=H*K,ie=0,ve=0;veCe)ie=ve+1;else{ie=ae<(Ae+Ce)/2?ve:ve+1;break}}var Fe=v._B[ie]||0;return isFinite(Fe)?fe(K,v._m2,Fe):0},V=function(K){var ue=v._rangebreaks.length;if(!ue)return le(K,v._m,v._b);for(var te=0,H=0;Hv._rangebreaks[H].pmax&&(te=H+1);return le(K,v._m2,v._B[te])}}v.c2l=v.type==="log"?z:n,v.l2c=v.type==="log"?w:n,v.l2p=ce,v.p2l=V,v.c2p=v.type==="log"?function(K,ue){return ce(z(K,ue))}:ce,v.p2c=v.type==="log"?function(K){return w(V(K))}:V,["linear","-"].indexOf(v.type)!==-1?(v.d2r=v.r2d=v.d2c=v.r2c=v.d2l=v.r2l=t,v.c2d=v.c2r=v.l2d=v.l2r=n,v.d2p=v.r2p=function(K){return v.l2p(t(K))},v.p2d=v.p2r=V,v.cleanPos=n):v.type==="log"?(v.d2r=v.d2l=function(K,ue){return z(t(K),ue)},v.r2d=v.r2c=function(K){return w(t(K))},v.d2c=v.r2l=t,v.c2d=v.l2r=n,v.c2r=z,v.l2d=w,v.d2p=function(K,ue){return v.l2p(v.d2r(K,ue))},v.p2d=function(K){return w(V(K))},v.r2p=function(K){return v.l2p(t(K))},v.p2r=V,v.cleanPos=n):v.type==="date"?(v.d2r=v.r2d=S.identity,v.d2c=v.r2c=v.d2l=v.r2l=F,v.c2d=v.c2r=v.l2d=v.l2r=N,v.d2p=v.r2p=function(K,ue,te){return v.l2p(F(K,0,te))},v.p2d=v.p2r=function(K,ue,te){return N(V(K),ue,te)},v.cleanPos=function(K){return S.cleanDate(K,f,v.calendar)}):v.type==="category"?(v.d2c=v.d2l=R,v.r2d=v.c2d=v.l2d=B,v.d2r=v.d2l_noadd=Z,v.r2c=function(K){var ue=re(K);return ue!==void 0?ue:v.fraction2r(.5)},v.l2r=v.c2r=n,v.r2l=re,v.d2p=function(K){return v.l2p(v.r2c(K))},v.p2d=function(K){return B(V(K))},v.r2p=v.d2p,v.p2r=V,v.cleanPos=function(K){return typeof K=="string"&&K!==""?K:n(K)}):v.type==="multicategory"&&(v.r2d=v.c2d=v.l2d=B,v.d2r=v.d2l_noadd=Z,v.r2c=function(K){var ue=Z(K);return ue!==void 0?ue:v.fraction2r(.5)},v.r2c_just_indices=j,v.l2r=v.c2r=n,v.r2l=Z,v.d2p=function(K){return v.l2p(v.r2c(K))},v.p2d=function(K){return B(V(K))},v.r2p=v.d2p,v.p2r=V,v.cleanPos=function(K){return Array.isArray(K)||typeof K=="string"&&K!==""?K:n(K)},v.setupMultiCategory=function(K){var ue=v._traceIndices,te,H,ae=v._matchGroup;if(ae&&v._categories.length===0){for(var ie in ae)if(ie!==I){var ve=y[x.id2name(ie)];ue=ue.concat(ve._traceIndices)}}var Ae=[[0,{}],[0,{}]],Ce=[];for(te=0;teve[1]&&(H[ie?0:1]=te),H[0]===H[1]){var Ae=v.l2r(ue),Ce=v.l2r(te);if(ue!==void 0){var Fe=Ae+1;te!==void 0&&(Fe=Math.min(Fe,Ce)),H[ie?1:0]=Fe}if(te!==void 0){var ze=Ce+1;ue!==void 0&&(ze=Math.max(ze,Ae)),H[ie?0:1]=ze}}}},v.cleanRange=function(K,ue){v._cleanRange(K,ue),v.limitRange(K)},v._cleanRange=function(K,ue){ue||(ue={}),K||(K="range");var te=S.nestedProperty(v,K).get(),H,ae;if(v.type==="date"?ae=S.dfltRange(v.calendar):L==="y"?ae=A.DFLTRANGEY:v._name==="realaxis"?ae=[0,1]:ae=ue.dfltRange||A.DFLTRANGEX,ae=ae.slice(),(v.rangemode==="tozero"||v.rangemode==="nonnegative")&&(ae[0]=0),!te||te.length!==2){S.nestedProperty(v,K).set(ae);return}var ie=te[0]===null,ve=te[1]===null;for(v.type==="date"&&!v.autorange&&(te[0]=S.cleanDate(te[0],f,v.calendar),te[1]=S.cleanDate(te[1],f,v.calendar)),H=0;H<2;H++)if(v.type==="date"){if(!S.isDateTime(te[H],v.calendar)){v[K]=ae;break}if(v.r2l(te[0])===v.r2l(te[1])){var Ae=S.constrain(v.r2l(te[0]),S.MIN_MS+1e3,S.MAX_MS-1e3);te[0]=v.l2r(Ae-1e3),te[1]=v.l2r(Ae+1e3);break}}else{if(!e(te[H]))if(!(ie||ve)&&e(te[1-H]))te[H]=te[1-H]*(H?10:.1);else{v[K]=ae;break}if(te[H]<-s?te[H]=-s:te[H]>s&&(te[H]=s),te[0]===te[1]){var Ce=Math.max(1,Math.abs(te[0]*1e-6));te[0]-=Ce,te[1]+=Ce}}},v.setScale=function(K){var ue=y._size;if(v.overlaying){var te=x.getFromId({_fullLayout:y},v.overlaying);v.domain=te.domain}var H=K&&v._r?"_r":"range",ae=v.calendar;v.cleanRange(H);var ie=v.r2l(v[H][0],ae),ve=v.r2l(v[H][1],ae),Ae=L==="y";if(Ae?(v._offset=ue.t+(1-v.domain[1])*ue.h,v._length=ue.h*(v.domain[1]-v.domain[0]),v._m=v._length/(ie-ve),v._b=-v._m*ve):(v._offset=ue.l+v.domain[0]*ue.w,v._length=ue.w*(v.domain[1]-v.domain[0]),v._m=v._length/(ve-ie),v._b=-v._m*ie),v._rangebreaks=[],v._lBreaks=0,v._m2=0,v._B=[],v.rangebreaks){var Ce,Fe;if(v._rangebreaks=v.locateBreaks(Math.min(ie,ve),Math.max(ie,ve)),v._rangebreaks.length){for(Ce=0;Ceve&&(ze=!ze),ze&&v._rangebreaks.reverse();var Ye=ze?-1:1;for(v._m2=Ye*v._length/(Math.abs(ve-ie)-v._lBreaks),v._B.push(-v._m2*(Ae?ve:ie)),Ce=0;Ceae&&(ae+=7,ieae&&(ae+=24,ie=H&&ie=H&&K=rt.min&&(pert.max&&(rt.max=Ne),ot=!1)}ot&&ve.push({min:pe,max:Ne})}};for(te=0;teg*2}function a(c){return Math.max(1,(c-1)/1e3)}function s(c,p){for(var d=c.length,T=a(d),l=0,g=0,x={},A=0;Al*2}function f(c){return E(c[0])&&E(c[1])}}}),Rp=Ge({"src/plots/cartesian/autorange.js"($,G){var h=Za(),b=Ga(),S=yn(),E=hi().FP_SAFE,e=Io(),t=Ms(),r=Lf(),o=r.getFromId,n=r.isLinked;G.exports={applyAutorangeOptions:v,getAutoRange:i,makePadFn:s,doAutoRange:d,findExtremes:T,concatExtremes:p};function i(y,I){var L,z,F=[],N=y._fullLayout,B=s(N,I,0),R=s(N,I,1),U=p(y,I),j=U.min,Z=U.max;if(j.length===0||Z.length===0)return S.simpleMap(I.range,I.r2l);var re=j[0].val,fe=Z[0].val;for(L=1;L0&&(Ce=ue-B(ae)-R(ie),Ce>te?Fe/Ce>H&&(ve=ae,Ae=ie,H=Fe/Ce):Fe/ue>H&&(ve={val:ae.val,nopad:1},Ae={val:ie.val,nopad:1},H=Fe/ue));function ze(Qe,Le){return Math.max(Qe,R(Le))}if(re===fe){var Ye=re-1,it=re+1;if(ne)if(re===0)F=[0,1];else{var st=(re>0?Z:j).reduce(ze,0),nt=re/(1-Math.min(.5,st/ue));F=re>0?[0,nt]:[nt,0]}else K?F=[Math.max(0,Ye),Math.max(1,it)]:F=[Ye,it]}else ne?(ve.val>=0&&(ve={val:0,nopad:1}),Ae.val<=0&&(Ae={val:0,nopad:1})):K&&(ve.val-H*B(ve)<0&&(ve={val:0,nopad:1}),Ae.val<=0&&(Ae={val:1,nopad:1})),H=(Ae.val-ve.val-a(I,ae.val,ie.val))/(ue-B(ve)-R(Ae)),F=[ve.val-H*B(ve),Ae.val+H*R(Ae)];return F=v(F,I),I.limitRange&&I.limitRange(),ce&&F.reverse(),S.simpleMap(F,I.l2r||Number)}function a(y,I,L){var z=0;if(y.rangebreaks)for(var F=y.locateBreaks(I,L),N=0;N0?L.ppadplus:L.ppadminus)||L.ppad||0),ae=te((y._m>0?L.ppadminus:L.ppadplus)||L.ppad||0),ie=te(L.vpadplus||L.vpad),ve=te(L.vpadminus||L.vpad);if(!j){if(K=1/0,ue=-1/0,U)for(re=0;re0&&(K=fe),fe>ue&&fe-E&&(K=fe),fe>ue&&fe=Fe;re--)Ce(re);return{min:z,max:F,opts:L}}function l(y,I,L,z){x(y,I,L,z,M)}function g(y,I,L,z){x(y,I,L,z,_)}function x(y,I,L,z,F){for(var N=z.tozero,B=z.extrapad,R=!0,U=0;U=L&&(j.extrapad||!B)){R=!1;break}else F(I,j.val)&&j.pad<=L&&(B||!j.extrapad)&&(y.splice(U,1),U--)}if(R){var Z=N&&I===0;y.push({val:I,pad:Z?0:L,extrapad:Z?!1:B})}}function A(y){return b(y)&&Math.abs(y)=I}function w(y,I){var L=I.autorangeoptions;return L&&L.minallowed!==void 0&&u(I,L.minallowed,L.maxallowed)?L.minallowed:L&&L.clipmin!==void 0&&u(I,L.clipmin,L.clipmax)?Math.max(y,I.d2l(L.clipmin)):y}function m(y,I){var L=I.autorangeoptions;return L&&L.maxallowed!==void 0&&u(I,L.minallowed,L.maxallowed)?L.maxallowed:L&&L.clipmax!==void 0&&u(I,L.clipmin,L.clipmax)?Math.min(y,I.d2l(L.clipmax)):y}function u(y,I,L){return I!==void 0&&L!==void 0?(I=y.d2l(I),L=y.d2l(L),I=U&&(N=U,L=U),B<=U&&(B=U,z=U)}}return L=w(L,I),z=m(z,I),[L,z]}}}),Ss=Ge({"src/plots/cartesian/axes.js"($,G){var h=Za(),b=Ga(),S=$c(),E=Io(),e=yn(),t=e.strTranslate,r=ec(),o=am(),n=So(),i=Ms(),a=tv(),s=lx(),f=hi(),c=f.ONEMAXYEAR,p=f.ONEAVGYEAR,d=f.ONEMINYEAR,T=f.ONEMAXQUARTER,l=f.ONEAVGQUARTER,g=f.ONEMINQUARTER,x=f.ONEMAXMONTH,A=f.ONEAVGMONTH,M=f.ONEMINMONTH,_=f.ONEWEEK,w=f.ONEDAY,m=w/2,u=f.ONEHOUR,v=f.ONEMIN,y=f.ONESEC,I=f.ONEMILLI,L=f.ONEMICROSEC,z=f.MINUS_SIGN,F=f.BADNUM,N={K:"zeroline"},B={K:"gridline",L:"path"},R={K:"minor-gridline",L:"path"},U={K:"tick",L:"path"},j={K:"tick",L:"text"},Z={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},re=ev(),fe=re.MID_SHIFT,le=re.CAP_SHIFT,ce=re.LINE_SPACING,V=re.OPPOSITE_SIDE,ee=3,ne=G.exports={};ne.setConvert=Kd();var K=im(),ue=Lf(),te=ue.idSort,H=ue.isLinked;ne.id2name=ue.id2name,ne.name2id=ue.name2id,ne.cleanId=ue.cleanId,ne.list=ue.list,ne.listIds=ue.listIds,ne.getFromId=ue.getFromId,ne.getFromTrace=ue.getFromTrace;var ae=Rp();ne.getAutoRange=ae.getAutoRange,ne.findExtremes=ae.findExtremes;var ie=1e-4;function ve(Dt){var yt=(Dt[1]-Dt[0])*ie;return[Dt[0]-yt,Dt[1]+yt]}ne.coerceRef=function(Dt,yt,kr,Nr,jr,Ir){var Ur=Nr.charAt(Nr.length-1),ln=kr._fullLayout._subplots[Ur+"axis"],$r=Nr+"ref",At={};return jr||(jr=ln[0]||(typeof Ir=="string"?Ir:Ir[0])),Ir||(Ir=jr),ln=ln.concat(ln.map(function(or){return or+" domain"})),At[$r]={valType:"enumerated",values:ln.concat(Ir?typeof Ir=="string"?[Ir]:Ir:[]),dflt:jr},e.coerce(Dt,yt,At,$r)},ne.getRefType=function(Dt){return Dt===void 0?Dt:Dt==="paper"?"paper":Dt==="pixel"?"pixel":/( domain)$/.test(Dt)?"domain":"range"},ne.coercePosition=function(Dt,yt,kr,Nr,jr,Ir){var Ur,ln,$r=ne.getRefType(Nr);if($r!=="range")Ur=e.ensureNumber,ln=kr(jr,Ir);else{var At=ne.getFromId(yt,Nr);Ir=At.fraction2r(Ir),ln=kr(jr,Ir),Ur=At.cleanPos}Dt[jr]=Ur(ln)},ne.cleanPosition=function(Dt,yt,kr){var Nr=kr==="paper"||kr==="pixel"?e.ensureNumber:ne.getFromId(yt,kr).cleanPos;return Nr(Dt)},ne.redrawComponents=function(Dt,yt){yt=yt||ne.listIds(Dt);var kr=Dt._fullLayout;function Nr(jr,Ir,Ur,ln){for(var $r=E.getComponentMethod(jr,Ir),At={},or=0;or2e-6||((kr-Dt._forceTick0)/Dt._minDtick%1+1.000001)%1>2e-6)&&(Dt._minDtick=0))},ne.saveRangeInitial=function(Dt,yt){for(var kr=ne.list(Dt,"",!0),Nr=!1,jr=0;jrDr*.3||At(Nr)||At(jr))){var un=kr.dtick/2;Dt+=Dt+unUr){var ln=Number(kr.slice(1));Ir.exactYears>Ur&&ln%12===0?Dt=ne.tickIncrement(Dt,"M6","reverse")+w*1.5:Ir.exactMonths>Ur?Dt=ne.tickIncrement(Dt,"M1","reverse")+w*15.5:Dt-=m;var $r=ne.tickIncrement(Dt,kr);if($r<=Nr)return $r}return Dt}ne.prepMinorTicks=function(Dt,yt,kr){if(!yt.minor.dtick){delete Dt.dtick;var Nr=yt.dtick&&b(yt._tmin),jr;if(Nr){var Ir=ne.tickIncrement(yt._tmin,yt.dtick,!0);jr=[yt._tmin,Ir*.99+yt._tmin*.01]}else{var Ur=e.simpleMap(yt.range,yt.r2l);jr=[Ur[0],.8*Ur[0]+.2*Ur[1]]}if(Dt.range=e.simpleMap(jr,yt.l2r),Dt._isMinor=!0,ne.prepTicks(Dt,kr),Nr){var ln=b(yt.dtick),$r=b(Dt.dtick),At=ln?yt.dtick:+yt.dtick.substring(1),or=$r?Dt.dtick:+Dt.dtick.substring(1);ln&&$r?it(At,or)?At===2*_&&or===2*w&&(Dt.dtick=_):At===2*_&&or===3*w?Dt.dtick=_:At===_&&!(yt._input.minor||{}).nticks?Dt.dtick=w:st(At/or,2.5)?Dt.dtick=At/2:Dt.dtick=At:String(yt.dtick).charAt(0)==="M"?$r?Dt.dtick="M1":it(At,or)?At>=12&&or===2&&(Dt.dtick="M3"):Dt.dtick=yt.dtick:String(Dt.dtick).charAt(0)==="L"?String(yt.dtick).charAt(0)==="L"?it(At,or)||(Dt.dtick=st(At/or,2.5)?yt.dtick/2:yt.dtick):Dt.dtick="D1":Dt.dtick==="D2"&&+yt.dtick>1&&(Dt.dtick=1)}Dt.range=yt.range}yt.minor._tick0Init===void 0&&(Dt.tick0=yt.tick0)};function it(Dt,yt){return Math.abs((Dt/yt+.5)%1-.5)<.001}function st(Dt,yt){return Math.abs(Dt/yt-1)<.001}ne.prepTicks=function(Dt,yt){var kr=e.simpleMap(Dt.range,Dt.r2l,void 0,void 0,yt);if(Dt.tickmode==="auto"||!Dt.dtick){var Nr=Dt.nticks,jr;Nr||(Dt.type==="category"||Dt.type==="multicategory"?(jr=Dt.tickfont?e.bigFont(Dt.tickfont.size||12):15,Nr=Dt._length/jr):(jr=Dt._id.charAt(0)==="y"?40:80,Nr=e.constrain(Dt._length/jr,4,9)+1),Dt._name==="radialaxis"&&(Nr*=2)),Dt.minor&&Dt.minor.tickmode!=="array"||Dt.tickmode==="array"&&(Nr*=100),Dt._roughDTick=Math.abs(kr[1]-kr[0])/Nr,ne.autoTicks(Dt,Dt._roughDTick),Dt._minDtick>0&&Dt.dtick0?(Ir=Nr-1,Ur=Nr):(Ir=Nr,Ur=Nr);var ln=Dt[Ir].value,$r=Dt[Ur].value,At=Math.abs($r-ln),or=kr||At,Dr=0;or>=d?At>=d&&At<=c?Dr=At:Dr=p:kr===l&&or>=g?At>=g&&At<=T?Dr=At:Dr=l:or>=M?At>=M&&At<=x?Dr=At:Dr=A:kr===_&&or>=_?Dr=_:or>=w?Dr=w:kr===m&&or>=m?Dr=m:kr===u&&or>=u&&(Dr=u);var un;Dr>=At&&(Dr=At,un=!0);var Rn=jr+Dr;if(yt.rangebreaks&&Dr>0){for(var jn=84,Un=0,cn=0;cn_&&(Dr=At)}(Dr>0||Nr===0)&&(Dt[Nr].periodX=jr+Dr/2)}}ne.calcTicks=function(yt,kr){for(var Nr=yt.type,jr=yt.calendar,Ir=yt.ticklabelstep,Ur=yt.ticklabelmode==="period",ln=yt.range[0]>yt.range[1],$r=!yt.ticklabelindex||e.isArrayOrTypedArray(yt.ticklabelindex)?yt.ticklabelindex:[yt.ticklabelindex],At=e.simpleMap(yt.range,yt.r2l,void 0,void 0,kr),or=At[1]=(Ea?0:1);Pi--){var Xi=!Pi;Pi?(yt._dtickInit=yt.dtick,yt._tick0Init=yt.tick0):(yt.minor._dtickInit=yt.minor.dtick,yt.minor._tick0Init=yt.minor.tick0);var uo=Pi?yt:e.extendFlat({},yt,yt.minor);if(Xi?ne.prepMinorTicks(uo,yt,kr):ne.prepTicks(uo,kr),uo.tickmode==="array"){Pi?(cn=[],jn=Ne(yt,!Xi)):(In=[],Un=Ne(yt,!Xi));continue}if(uo.tickmode==="sync"){cn=[],jn=pe(yt);continue}var so=ve(At),Eo=so[0],vi=so[1],ns=b(uo.dtick),Xo=Nr==="log"&&!(ns||uo.dtick.charAt(0)==="L"),Ys=ne.tickFirst(uo,kr);if(Pi){if(yt._tmin=Ys,Ys=vi:es<=vi;es=ne.tickIncrement(es,Hs,or,jr)){if(Pi&&qo++,uo.rangebreaks&&!or){if(es=un)break}if(cn.length>Rn||es===vs)break;vs=es;var sl={value:es};Pi?(Xo&&es!==(es|0)&&(sl.simpleLabel=!0),Ir>1&&qo%Ir&&(sl.skipLabel=!0),cn.push(sl)):(sl.minor=!0,In.push(sl))}}if(!In||In.length<2)$r=!1;else{var ds=(In[1].value-In[0].value)*(ln?-1:1);Ci(ds,yt.tickformat)||($r=!1)}if(!$r)xi=cn;else{var Ko=cn.concat(In);Ur&&cn.length&&(Ko=Ko.slice(1)),Ko=Ko.sort(function(Do,su){return Do.value-su.value}).filter(function(Do,su,fu){return su===0||Do.value!==fu[su-1].value});var _o=Ko.map(function(Do,su){return Do.minor===void 0&&!Do.skipLabel?su:null}).filter(function(Do){return Do!==null});_o.forEach(function(Do){$r.map(function(su){var fu=Do+su;fu>=0&&fu-1;Ds--){if(cn[Ds].drop){cn.splice(Ds,1);continue}cn[Ds].value=ha(cn[Ds].value,yt);var ul=yt.c2p(cn[Ds].value);(No?Ws>ul-Il:Wsun||Bsun&&(fu.periodX=un),Bsjr&&unp)yt/=p,Nr=jr(10),Dt.dtick="M"+12*Er(yt,Nr,ot);else if(Ir>A)yt/=A,Dt.dtick="M"+Er(yt,1,ft);else if(Ir>w){if(Dt.dtick=Er(yt,w,Dt._hasDayOfWeekBreaks?[1,2,7,14]:Ft),!kr){var Ur=ne.getTickFormat(Dt),ln=Dt.ticklabelmode==="period";ln&&(Dt._rawTick0=Dt.tick0),/%[uVW]/.test(Ur)?Dt.tick0=e.dateTick0(Dt.calendar,2):Dt.tick0=e.dateTick0(Dt.calendar,1),ln&&(Dt._dowTick0=Dt.tick0)}}else Ir>u?Dt.dtick=Er(yt,u,ft):Ir>v?Dt.dtick=Er(yt,v,rt):Ir>y?Dt.dtick=Er(yt,y,rt):(Nr=jr(10),Dt.dtick=Er(yt,Nr,ot))}else if(Dt.type==="log"){Dt.tick0=0;var $r=e.simpleMap(Dt.range,Dt.r2l);if(Dt._isMinor&&(yt*=1.5),yt>.7)Dt.dtick=Math.ceil(yt);else if(Math.abs($r[1]-$r[0])<1){var At=1.5*Math.abs(($r[1]-$r[0])/yt);yt=Math.abs(Math.pow(10,$r[1])-Math.pow(10,$r[0]))/At,Nr=jr(10),Dt.dtick="L"+Er(yt,Nr,ot)}else Dt.dtick=yt>.3?"D2":"D1"}else Dt.type==="category"||Dt.type==="multicategory"?(Dt.tick0=0,Dt.dtick=Math.ceil(Math.max(yt,1))):pa(Dt)?(Dt.tick0=0,Nr=1,Dt.dtick=Er(yt,Nr,rr)):(Dt.tick0=0,Nr=jr(10),Dt.dtick=Er(yt,Nr,ot));if(Dt.dtick===0&&(Dt.dtick=1),!b(Dt.dtick)&&typeof Dt.dtick!="string"){var or=Dt.dtick;throw Dt.dtick=1,"ax.dtick error: "+String(or)}};function Mr(Dt){var yt=Dt.dtick;if(Dt._tickexponent=0,!b(yt)&&typeof yt!="string"&&(yt=1),(Dt.type==="category"||Dt.type==="multicategory")&&(Dt._tickround=null),Dt.type==="date"){var kr=Dt.r2l(Dt.tick0),Nr=Dt.l2r(kr).replace(/(^-|i)/g,""),jr=Nr.length;if(String(yt).charAt(0)==="M")jr>10||Nr.slice(5)!=="01-01"?Dt._tickround="d":Dt._tickround=+yt.slice(1)%12===0?"y":"m";else if(yt>=w&&jr<=10||yt>=w*15)Dt._tickround="d";else if(yt>=v&&jr<=16||yt>=u)Dt._tickround="M";else if(yt>=y&&jr<=19||yt>=v)Dt._tickround="S";else{var Ir=Dt.l2r(kr+yt).replace(/^-/,"").length;Dt._tickround=Math.max(jr,Ir)-20,Dt._tickround<0&&(Dt._tickround=4)}}else if(b(yt)||yt.charAt(0)==="L"){var Ur=Dt.range.map(Dt.r2d||Number);b(yt)||(yt=Number(yt.slice(1))),Dt._tickround=2-Math.floor(Math.log(yt)/Math.LN10+.01);var ln=Math.max(Math.abs(Ur[0]),Math.abs(Ur[1])),$r=Math.floor(Math.log(ln)/Math.LN10+.01),At=Dt.minexponent===void 0?3:Dt.minexponent;Math.abs($r)>At&&(Xe(Dt.exponentformat)&&Dt.exponentformat!=="SI extended"&&!Je($r)||Xe(Dt.exponentformat)&&Dt.exponentformat==="SI extended"&&!Lt($r)?Dt._tickexponent=3*Math.round(($r-1)/3):Dt._tickexponent=$r)}else Dt._tickround=null}ne.tickIncrement=function(Dt,yt,kr,Nr){var jr=kr?-1:1;if(b(yt))return e.increment(Dt,jr*yt);var Ir=yt.charAt(0),Ur=jr*Number(yt.slice(1));if(Ir==="M")return e.incrementMonth(Dt,Ur,Nr);if(Ir==="L")return Math.log(Math.pow(10,Dt)+Ur)/Math.LN10;if(Ir==="D"){var ln=yt==="D2"?$t:Nt,$r=Dt+jr*.01,At=e.roundUp(e.mod($r,1),ln,kr);return Math.floor($r)+Math.log(h.round(Math.pow(10,At),1))/Math.LN10}throw"unrecognized dtick "+String(yt)},ne.tickFirst=function(Dt,yt){var kr=Dt.r2l||Number,Nr=e.simpleMap(Dt.range,kr,void 0,void 0,yt),jr=Nr[1]=0&&In<=Dt._length?cn:null};if(Ir&&e.isArrayOrTypedArray(Dt.ticktext)){var Dr=e.simpleMap(Dt.range,Dt.r2l),un=(Math.abs(Dr[1]-Dr[0])-(Dt._lBreaks||0))/1e4;for(At=0;At"+ln;else{var At=_a(Dt),or=Dt._trueSide||Dt.side;(!At&&or==="top"||At&&or==="bottom")&&(Ur+="
")}yt.text=Ur}function Br(Dt,yt,kr,Nr,jr){var Ir=Dt.dtick,Ur=yt.x,ln=Dt.tickformat,$r=typeof Ir=="string"&&Ir.charAt(0);if(jr==="never"&&(jr=""),Nr&&$r!=="L"&&(Ir="L3",$r="L"),ln||$r==="L")yt.text=Ot(Math.pow(10,Ur),Dt,jr,Nr);else if(b(Ir)||$r==="D"&&(Dt.minorloglabels==="complete"||e.mod(Ur+.01,1)<.1)){Dt.minorloglabels==="complete"&&!(e.mod(Ur+.01,1)<.1)&&(yt.fontSize*=.75);var At=Math.pow(10,Ur).toExponential(0),or=At.split("e"),Dr=+or[1],un=Math.abs(Dr),Rn=Dt.exponentformat;Rn==="power"||Xe(Rn)&&Rn!=="SI extended"&&Je(Dr)||Xe(Rn)&&Rn==="SI extended"&&Lt(Dr)?(yt.text=or[0],un>0&&(yt.text+="x10"),yt.text==="1x10"&&(yt.text="10"),Dr!==0&&Dr!==1&&(yt.text+=""+(Dr>0?"":z)+un+""),yt.fontSize*=1.25):(Rn==="e"||Rn==="E")&&un>2?yt.text=or[0]+Rn+(Dr>0?"+":z)+un:(yt.text=Ot(Math.pow(10,Ur),Dt,"","fakehover"),Ir==="D1"&&Dt._id.charAt(0)==="y"&&(yt.dy-=yt.fontSize/6))}else if($r==="D")yt.text=Dt.minorloglabels==="none"?"":String(Math.round(Math.pow(10,e.mod(Ur,1)))),yt.fontSize*=.75;else throw"unrecognized dtick "+String(Ir);if(Dt.dtick==="D1"){var jn=String(yt.text).charAt(0);(jn==="0"||jn==="1")&&(Dt._id.charAt(0)==="y"?yt.dx-=yt.fontSize/4:(yt.dy+=yt.fontSize/2,yt.dx+=(Dt.range[1]>Dt.range[0]?1:-1)*yt.fontSize*(Ur<0?.5:.25)))}}function Mt(Dt,yt){var kr=Dt._categories[Math.round(yt.x)];kr===void 0&&(kr=""),yt.text=String(kr)}function je(Dt,yt,kr){var Nr=Math.round(yt.x),jr=Dt._categories[Nr]||[],Ir=jr[1]===void 0?"":String(jr[1]),Ur=jr[0]===void 0?"":String(jr[0]);kr?yt.text=Ur+" - "+Ir:(yt.text=Ir,yt.text2=Ur)}function $e(Dt,yt,kr,Nr,jr){jr==="never"?jr="":Dt.showexponent==="all"&&Math.abs(yt.x/Dt.dtick)<1e-6&&(jr="hide"),yt.text=Ot(yt.x,Dt,jr,Nr)}function Ee(Dt,yt,kr,Nr,jr){if(Dt.thetaunit==="radians"&&!kr){var Ir=yt.x/180;if(Ir===0)yt.text="0";else{var Ur=xe(Ir);if(Ur[1]>=100)yt.text=Ot(e.deg2rad(yt.x),Dt,jr,Nr);else{var ln=yt.x<0;Ur[1]===1?Ur[0]===1?yt.text="π":yt.text=Ur[0]+"π":yt.text=["",Ur[0],"","⁄","",Ur[1],"","π"].join(""),ln&&(yt.text=z+yt.text)}}}else yt.text=Ot(yt.x,Dt,jr,Nr)}function xe(Dt){function yt(ln,$r){return Math.abs(ln-$r)<=1e-6}function kr(ln,$r){return yt($r,0)?ln:kr($r,ln%$r)}function Nr(ln){for(var $r=1;!yt(Math.round(ln*$r)/$r,ln);)$r*=10;return $r}var jr=Nr(Dt),Ir=Dt*jr,Ur=Math.abs(kr(Ir,jr));return[Math.round(Ir/Ur),Math.round(jr/Ur)]}var ye=["f","p","n","μ","m","","k","M","G","T"],Me=["q","r","y","z","a",...ye,"P","E","Z","Y","R","Q"],Xe=Dt=>["SI","SI extended","B"].includes(Dt);function Je(Dt){return Dt>14||Dt<-15}function Lt(Dt){return Dt>32||Dt<-30}function Ct(Dt,yt){return Xe(yt)?!!(yt==="SI extended"&&Lt(Dt)||yt!=="SI extended"&&Je(Dt)):!1}function Ot(Dt,yt,kr,Nr){var jr=Dt<0,Ir=yt._tickround,Ur=kr||yt.exponentformat||"B",ln=yt._tickexponent,$r=ne.getTickFormat(yt),At=yt.separatethousands;if(Nr){var or={exponentformat:Ur,minexponent:yt.minexponent,dtick:yt.showexponent==="none"?yt.dtick:b(Dt)&&Math.abs(Dt)||1,range:yt.showexponent==="none"?yt.range.map(yt.r2d):[0,Dt||1]};Mr(or),Ir=(Number(or._tickround)||0)+4,ln=or._tickexponent,yt.hoverformat&&($r=yt.hoverformat)}if($r)return yt._numFormat($r)(Dt).replace(/-/g,z);var Dr=Math.pow(10,-Ir)/2;if(Ur==="none"&&(ln=0),Dt=Math.abs(Dt),Dt"+jn+"":Ur==="B"&&ln===9?Dt+="B":Xe(Ur)&&(Dt+=Ur==="SI extended"?Me[ln/3+10]:ye[ln/3+5])}return jr?z+Dt:Dt}ne.getTickFormat=function(Dt){var yt;function kr($r){return typeof $r!="string"?$r:Number($r.replace("M",""))*A}function Nr($r,At){var or=["L","D"];if(typeof $r==typeof At){if(typeof $r=="number")return $r-At;var Dr=or.indexOf($r.charAt(0)),un=or.indexOf(At.charAt(0));return Dr===un?Number($r.replace(/(L|D)/g,""))-Number(At.replace(/(L|D)/g,"")):Dr-un}else return typeof $r=="number"?1:-1}function jr($r,At,or){var Dr=or||function(jn){return jn},un=At[0],Rn=At[1];return(!un&&typeof un!="number"||Dr(un)<=Dr($r))&&(!Rn&&typeof Rn!="number"||Dr(Rn)>=Dr($r))}function Ir($r,At){var or=At[0]===null,Dr=At[1]===null,un=Nr($r,At[0])>=0,Rn=Nr($r,At[1])<=0;return(or||un)&&(Dr||Rn)}var Ur,ln;if(Dt.tickformatstops&&Dt.tickformatstops.length>0)switch(Dt.type){case"date":case"linear":{for(yt=0;yt=0&&jr.unshift(jr.splice(or,1).shift())}});var ln={false:{left:0,right:0}};return e.syncOrAsync(jr.map(function($r){return function(){if($r){var At=ne.getFromId(Dt,$r);kr||(kr={}),kr.axShifts=ln,kr.overlayingShiftedAx=Ur;var or=ne.drawOne(Dt,At,kr);return At._shiftPusher&&Vn(At,At._fullDepth||0,ln,!0),At._r=At.range.slice(),At._rl=e.simpleMap(At._r,At.r2l),or}}}))},ne.drawOne=function(Dt,yt,kr){kr=kr||{};var Nr=kr.axShifts||{},jr=kr.overlayingShiftedAx||[],Ir,Ur,ln;yt.setScale();var $r=Dt._fullLayout,At=yt._id,or=At.charAt(0),Dr=ne.counterLetter(At),un=$r._plots[yt._mainSubplot],Rn=yt.zerolinelayer==="above traces";if(!un)return;if(yt._shiftPusher=yt.autoshift||jr.indexOf(yt._id)!==-1||jr.indexOf(yt.overlaying)!==-1,yt._shiftPusher&yt.anchor==="free"){var jn=yt.linewidth/2||0;yt.ticks==="inside"&&(jn+=yt.ticklen),Vn(yt,jn,Nr,!0),Vn(yt,yt.shift||0,Nr,!1)}(kr.skipTitle!==!0||yt._shift===void 0)&&(yt._shift=yi(yt,Nr));var Un=un[or+"axislayer"],cn=yt._mainLinePosition,In=cn+=yt._shift,xi=yt._mainMirrorPosition,Ea=yt._vals=ne.calcTicks(yt),Pi=[yt.mirror,In,xi].join("_");for(Ir=0;Ir0?Bs.bottom-su:0,fu))));var Hu=0,uf=0;if(yt._shiftPusher&&(Hu=Math.max(fu,Bs.height>0?Gl==="l"?su-Bs.left:Bs.right-su:0),yt.title.text!==$r._dfltTitle[or]&&(uf=(yt._titleStandoff||0)+(yt._titleScoot||0),Gl==="l"&&(uf+=ra(yt))),yt._fullDepth=Math.max(Hu,uf)),yt.automargin){wl={x:0,y:0,r:0,l:0,t:0,b:0};var qc=[0,1],Qc=typeof yt._shift=="number"?yt._shift:0;if(or==="x"){if(Gl==="b"?wl[Gl]=yt._depth:(wl[Gl]=yt._depth=Math.max(Bs.width>0?su-Bs.top:0,fu),qc.reverse()),Bs.width>0){var Lh=Bs.right-(yt._offset+yt._length);Lh>0&&(wl.xr=1,wl.r=Lh);var yh=yt._offset-Bs.left;yh>0&&(wl.xl=0,wl.l=yh)}}else if(Gl==="l"?(yt._depth=Math.max(Bs.height>0?su-Bs.left:0,fu),wl[Gl]=yt._depth-Qc):(yt._depth=Math.max(Bs.height>0?Bs.right-su:0,fu),wl[Gl]=yt._depth+Qc,qc.reverse()),Bs.height>0){var Tl=Bs.bottom-(yt._offset+yt._length);Tl>0&&(wl.yb=0,wl.b=Tl);var Lc=yt._offset-Bs.top;Lc>0&&(wl.yt=1,wl.t=Lc)}wl[Dr]=yt.anchor==="free"?yt.position:yt._anchorAxis.domain[qc[0]],yt.title.text!==$r._dfltTitle[or]&&(wl[Gl]+=ra(yt)+(yt.title.standoff||0)),yt.mirror&&yt.anchor!=="free"&&(Bl={x:0,y:0,r:0,l:0,t:0,b:0},Bl[Do]=yt.linewidth,yt.mirror&&yt.mirror!==!0&&(Bl[Do]+=fu),yt.mirror===!0||yt.mirror==="ticks"?Bl[Dr]=yt._anchorAxis.domain[qc[1]]:(yt.mirror==="all"||yt.mirror==="allticks")&&(Bl[Dr]=[yt._counterDomainMin,yt._counterDomainMax][qc[1]]))}Hl&&(jl=E.getComponentMethod("rangeslider","autoMarginOpts")(Dt,yt)),typeof yt.automargin=="string"&&(Wt(wl,yt.automargin),Wt(Bl,yt.automargin)),S.autoMargin(Dt,ar(yt),wl),S.autoMargin(Dt,lr(yt),Bl),S.autoMargin(Dt,Vr(yt),jl)}),e.syncOrAsync(_s)}};function Wt(Dt,yt){if(Dt){var kr=Object.keys(Z).reduce(function(Nr,jr){return yt.indexOf(jr)!==-1&&Z[jr].forEach(function(Ir){Nr[Ir]=1}),Nr},{});Object.keys(Dt).forEach(function(Nr){kr[Nr]||(Nr.length===1?Dt[Nr]=0:delete Dt[Nr])})}}function _r(Dt,yt){var kr=[],Nr,jr=function(Ir,Ur){var ln=Ir.xbnd[Ur];ln!==null&&kr.push(e.extendFlat({},Ir,{x:ln}))};if(yt.length){for(Nr=0;NrDt.range[1],ln=Dt.ticklabelposition&&Dt.ticklabelposition.indexOf("inside")!==-1,$r=!ln;if(kr){var At=Ur?-1:1;kr=kr*At}if(Nr){var or=Dt.side,Dr=ln&&(or==="top"||or==="left")||$r&&(or==="bottom"||or==="right")?1:-1;Nr=Nr*Dr}return Dt._id.charAt(0)==="x"?function(un){return t(jr+Dt._offset+Dt.l2p(En(un))+kr,Ir+Nr)}:function(un){return t(Ir+Nr,jr+Dt._offset+Dt.l2p(En(un))+kr)}};function En(Dt){return Dt.periodX!==void 0?Dt.periodX:Dt.x}function Kn(Dt){var yt=Dt.ticklabelposition||"",kr=Dt.tickson||"",Nr=function(jn){return yt.indexOf(jn)!==-1},jr=Nr("top"),Ir=Nr("left"),Ur=Nr("right"),ln=Nr("bottom"),$r=Nr("inside"),At=kr!=="boundaries"&&(ln||Ir||jr||Ur);if(!At&&!$r)return[0,0];var or=Dt.side,Dr=At?(Dt.tickwidth||0)/2:0,un=ee,Rn=Dt.tickfont?Dt.tickfont.size:12;return(ln||jr)&&(Dr+=Rn*le,un+=(Dt.linewidth||0)/2),(Ir||Ur)&&(Dr+=(Dt.linewidth||0)/2,un+=ee),$r&&or==="top"&&(un-=Rn*(1-le)),(Ir||jr)&&(Dr=-Dr),(or==="bottom"||or==="right")&&(un=-un),[At?Dr:0,$r?un:0]}ne.makeTickPath=function(Dt,yt,kr,Nr){Nr||(Nr={});var jr=Nr.minor;if(jr&&!Dt.minor)return"";var Ir=Nr.len!==void 0?Nr.len:jr?Dt.minor.ticklen:Dt.ticklen,Ur=Dt._id.charAt(0),ln=(Dt.linewidth||1)/2;return Ur==="x"?"M0,"+(yt+ln*kr)+"v"+Ir*kr:"M"+(yt+ln*kr)+",0h"+Ir*kr},ne.makeLabelFns=function(Dt,yt,kr){var Nr=Dt.ticklabelposition||"",jr=Dt.tickson||"",Ir=function(vs){return Nr.indexOf(vs)!==-1},Ur=Ir("top"),ln=Ir("left"),$r=Ir("right"),At=Ir("bottom"),or=jr!=="boundaries"&&(At||ln||Ur||$r),Dr=Ir("inside"),un=Nr==="inside"&&Dt.ticks==="inside"||!Dr&&Dt.ticks==="outside"&&jr!=="boundaries",Rn=0,jn=0,Un=un?Dt.ticklen:0;if(Dr?Un*=-1:or&&(Un=0),un&&(Rn+=Un,kr)){var cn=e.deg2rad(kr);Rn=Un*Math.cos(cn)+1,jn=Un*Math.sin(cn)}Dt.showticklabels&&(un||Dt.showline)&&(Rn+=.2*Dt.tickfont.size),Rn+=(Dt.linewidth||1)/2*(Dr?-1:1);var In={labelStandoff:Rn,labelShift:jn},xi,Ea,Pi,Xi,uo=0,so=Dt.side,Eo=Dt._id.charAt(0),vi=Dt.tickangle,ns;if(Eo==="x")ns=!Dr&&so==="bottom"||Dr&&so==="top",Xi=ns?1:-1,Dr&&(Xi*=-1),xi=jn*Xi,Ea=yt+Rn*Xi,Pi=ns?1:-.2,Math.abs(vi)===90&&(Dr?Pi+=fe:vi===-90&&so==="bottom"?Pi=le:vi===90&&so==="top"?Pi=fe:Pi=.5,uo=fe/2*(vi/90)),In.xFn=function(vs){return vs.dx+xi+uo*vs.fontSize},In.yFn=function(vs){return vs.dy+Ea+vs.fontSize*Pi},In.anchorFn=function(vs,es){if(or){if(ln)return"end";if($r)return"start"}return!b(es)||es===0||es===180?"middle":es*Xi<0!==Dr?"end":"start"},In.heightFn=function(vs,es,qo){return es<-60||es>60?-.5*qo:Dt.side==="top"!==Dr?-qo:0};else if(Eo==="y"){if(ns=!Dr&&so==="left"||Dr&&so==="right",Xi=ns?1:-1,Dr&&(Xi*=-1),xi=Rn,Ea=jn*Xi,Pi=0,!Dr&&Math.abs(vi)===90&&(vi===-90&&so==="left"||vi===90&&so==="right"?Pi=le:Pi=.5),Dr){var Xo=b(vi)?+vi:0;if(Xo!==0){var Ys=e.deg2rad(Xo);uo=Math.abs(Math.sin(Ys))*le*Xi,Pi=0}}In.xFn=function(vs){return vs.dx+yt-(xi+vs.fontSize*Pi)*Xi+uo*vs.fontSize},In.yFn=function(vs){return vs.dy+Ea+vs.fontSize*fe},In.anchorFn=function(vs,es){return b(es)&&Math.abs(es)===90?"middle":ns?"end":"start"},In.heightFn=function(vs,es,qo){return Dt.side==="right"&&(es*=-1),es<-30?-qo:es<30?-.5*qo:0}}return In};function qn(Dt){return[Dt.text,Dt.x,Dt.axInfo,Dt.font,Dt.fontSize,Dt.fontColor].join("_")}ne.drawTicks=function(Dt,yt,kr){kr=kr||{};var Nr=yt._id+"tick",jr=[].concat(yt.minor&&yt.minor.ticks?kr.vals.filter(function(Ur){return Ur.minor&&!Ur.noTick}):[]).concat(yt.ticks?kr.vals.filter(function(Ur){return!Ur.minor&&!Ur.noTick}):[]),Ir=kr.layer.selectAll("path."+Nr).data(jr,qn);Ir.exit().remove(),Ir.enter().append("path").classed(Nr,1).classed("ticks",1).classed("crisp",kr.crisp!==!1).each(function(Ur){return n.stroke(h.select(this),Ur.minor?yt.minor.tickcolor:yt.tickcolor)}).style("stroke-width",function(Ur){return i.crispRound(Dt,Ur.minor?yt.minor.tickwidth:yt.tickwidth,1)+"px"}).attr("d",kr.path).style("display",null),Ca(yt,[U]),Ir.attr("transform",kr.transFn)},ne.drawGrid=function(Dt,yt,kr){if(kr=kr||{},yt.tickmode!=="sync"){var Nr=yt._id+"grid",jr=yt.minor&&yt.minor.showgrid,Ir=jr?kr.vals.filter(function(In){return In.minor}):[],Ur=yt.showgrid?kr.vals.filter(function(In){return!In.minor}):[],ln=kr.counterAxis;if(ln&&ne.shouldShowZeroLine(Dt,yt,ln))for(var $r=yt.tickmode==="array",At=0;At=0;jn--){var Un=jn?un:Rn;if(Un){var cn=Un.selectAll("path."+Nr).data(jn?Ur:Ir,qn);cn.exit().remove(),cn.enter().append("path").classed(Nr,1).classed("crisp",kr.crisp!==!1),cn.attr("transform",kr.transFn).attr("d",kr.path).each(function(In){return n.stroke(h.select(this),In.minor?yt.minor.gridcolor:yt.gridcolor||"#ddd")}).style("stroke-dasharray",function(In){return i.dashStyle(In.minor?yt.minor.griddash:yt.griddash,In.minor?yt.minor.gridwidth:yt.gridwidth)}).style("stroke-width",function(In){return(In.minor?Dr:yt._gw)+"px"}).style("display",null),typeof kr.path=="function"&&cn.attr("d",kr.path)}}Ca(yt,[B,R])}},ne.drawZeroLine=function(Dt,yt,kr){kr=kr||kr;var Nr=yt._id+"zl",jr=ne.shouldShowZeroLine(Dt,yt,kr.counterAxis),Ir=kr.layer.selectAll("path."+Nr).data(jr?[{x:0,id:yt._id}]:[]);Ir.exit().remove(),Ir.enter().append("path").classed(Nr,1).classed("zl",1).classed("crisp",kr.crisp!==!1).each(function(){kr.layer.selectAll("path").sort(function(Ur,ln){return te(Ur.id,ln.id)})}),Ir.attr("transform",kr.transFn).attr("d",kr.path).call(n.stroke,yt.zerolinecolor||n.defaultLine).style("stroke-width",i.crispRound(Dt,yt.zerolinewidth,yt._gw||1)+"px").style("display",null),Ca(yt,[N])},ne.drawLabels=function(Dt,yt,kr){kr=kr||{};var Nr=Dt._fullLayout,jr=yt._id,Ir=yt.zerolinelayer==="above traces",Ur=kr.cls||jr+"tick",ln=kr.vals.filter(function(ds){return ds.text}),$r=kr.labelFns,At=kr.secondary?0:yt.tickangle,or=(yt._prevTickAngles||{})[Ur],Dr=kr.layer.selectAll("g."+Ur).data(yt.showticklabels?ln:[],qn),un=[];Dr.enter().append("g").classed(Ur,1).append("text").attr("text-anchor","middle").each(function(ds){var Ko=h.select(this),_o=Dt._promises.length;Ko.call(r.positionText,$r.xFn(ds),$r.yFn(ds)).call(i.font,{family:ds.font,size:ds.fontSize,color:ds.fontColor,weight:ds.fontWeight,style:ds.fontStyle,variant:ds.fontVariant,textcase:ds.fontTextcase,lineposition:ds.fontLineposition,shadow:ds.fontShadow}).text(ds.text).call(r.convertToTspans,Dt),Dt._promises[_o]?un.push(Dt._promises.pop().then(function(){Rn(Ko,At)})):Rn(Ko,At)}),Ca(yt,[j]),Dr.exit().remove(),kr.repositionOnUpdate&&Dr.each(function(ds){h.select(this).select("text").call(r.positionText,$r.xFn(ds),$r.yFn(ds))});function Rn(ds,Ko){ds.each(function(_o){var ps=h.select(this),ll=ps.select(".text-math-group"),kl=$r.anchorFn(_o,Ko),Rl=kr.transFn.call(ps.node(),_o)+(b(Ko)&&+Ko!=0?" rotate("+Ko+","+$r.xFn(_o)+","+($r.yFn(_o)-_o.fontSize/2)+")":""),Cs=r.lineCount(ps),pi=ce*_o.fontSize,no=$r.heightFn(_o,b(Ko)?+Ko:0,(Cs-1)*pi);if(no&&(Rl+=t(0,no)),ll.empty()){var Cl=ps.select("text");Cl.attr({transform:Rl,"text-anchor":kl}),Cl.style("display",null),yt._adjustTickLabelsOverflow&&yt._adjustTickLabelsOverflow()}else{var Ds=i.bBox(ll.node()).width,No=Ds*{end:-.5,start:.5}[kl];ll.attr("transform",Rl+t(No,0))}})}yt._adjustTickLabelsOverflow=function(){var ds=yt.ticklabeloverflow;if(!(!ds||ds==="allow")){var Ko=ds.indexOf("hide")!==-1,_o=yt._id.charAt(0)==="x",ps=0,ll=_o?Dt._fullLayout.width:Dt._fullLayout.height;if(ds.indexOf("domain")!==-1){var kl=e.simpleMap(yt.range,yt.r2l);ps=yt.l2p(kl[0])+yt._offset,ll=yt.l2p(kl[1])+yt._offset}var Rl=Math.min(ps,ll),Cs=Math.max(ps,ll),pi=yt.side,no=1/0,Cl=-1/0;Dr.each(function(Ws){var ul=h.select(this),xu=ul.select(".text-math-group");if(xu.empty()){var eo=i.bBox(ul.node()),_s=0;_o?(eo.right>Cs||eo.leftCs||eo.top+(yt.tickangle?0:Ws.fontSize/4)yt["_visibleLabelMin_"+kl._id]?ul.style("display","none"):Cs.K==="tick"&&!Rl&&ul.node().style.display!=="none"&&ul.style("display",null)})})})})},Rn(Dr,or+1?or:At);function jn(){return un.length&&Promise.all(un)}var Un=null;function cn(){if(Rn(Dr,At),ln.length&&yt.autotickangles&&(yt.type!=="log"||String(yt.dtick).charAt(0)!=="D")){Un=yt.autotickangles[0];var ds=0,Ko=[],_o,ps=1;Dr.each(function(wl){ds=Math.max(ds,wl.fontSize);var Bl=yt.l2p(wl.x),jl=qt(this),Hu=i.bBox(jl.node());ps=Math.max(ps,r.lineCount(jl)),Ko.push({top:0,bottom:10,height:10,left:Bl-Hu.width/2,right:Bl+Hu.width/2+2,width:Hu.width+2})});var ll=(yt.tickson==="boundaries"||yt.showdividers)&&!kr.secondary,kl=ln.length,Rl=Math.abs((ln[kl-1].x-ln[0].x)*yt._m)/(kl-1),Cs=ll?Rl/2:Rl,pi=ll?yt.ticklen:ds*1.25*ps,no=Math.sqrt(Math.pow(Cs,2)+Math.pow(pi,2)),Cl=Cs/no,Ds=yt.autotickangles.map(function(wl){return wl*Math.PI/180}),No=Ds.find(function(wl){return Math.abs(Math.cos(wl))<=Cl});No===void 0&&(No=Ds.reduce(function(wl,Bl){return Math.abs(Math.cos(wl))Zs*qo&&(Ys=qo,vi[Eo]=ns[Eo]=vs[Eo])}var Hs=Math.abs(Ys-Xo);Hs-Xi>0?(Hs-=Xi,Xi*=1+Xi/Hs):Xi=0,yt._id.charAt(0)!=="y"&&(Xi=-Xi),vi[so]=Ea.p2r(Ea.r2p(ns[so])+uo*Xi),Ea.autorange==="min"||Ea.autorange==="max reversed"?(vi[0]=null,Ea._rangeInitial0=void 0,Ea._rangeInitial1=void 0):(Ea.autorange==="max"||Ea.autorange==="min reversed")&&(vi[1]=null,Ea._rangeInitial0=void 0,Ea._rangeInitial1=void 0),Nr._insideTickLabelsUpdaterange[Ea._name+".range"]=vi}var sl=e.syncOrAsync(In);return sl&&sl.then&&Dt._promises.push(sl),sl};function ta(Dt,yt,kr){var Nr=yt._id+"divider",jr=kr.vals,Ir=kr.layer.selectAll("path."+Nr).data(jr,qn);Ir.exit().remove(),Ir.enter().insert("path",":first-child").classed(Nr,1).classed("crisp",1).call(n.stroke,yt.dividercolor).style("stroke-width",i.crispRound(Dt,yt.dividerwidth,1)+"px"),Ir.attr("transform",kr.transFn).attr("d",kr.path)}ne.getPxPosition=function(Dt,yt){var kr=Dt._fullLayout._size,Nr=yt._id.charAt(0),jr=yt.side,Ir;if(yt.anchor!=="free"?Ir=yt._anchorAxis:Nr==="x"?Ir={_offset:kr.t+(1-(yt.position||0))*kr.h,_length:0}:Nr==="y"&&(Ir={_offset:kr.l+(yt.position||0)*kr.w+yt._shift,_length:0}),jr==="top"||jr==="left")return Ir._offset;if(jr==="bottom"||jr==="right")return Ir._offset+Ir._length};function ra(Dt){var yt=Dt.title.font.size,kr=(Dt.title.text.match(r.BR_TAG_ALL)||[]).length;return Dt.title.hasOwnProperty("standoff")?yt*(le+kr*ce):kr?yt*(kr+1)*ce:yt}function Nn(Dt,yt){var kr=Dt._fullLayout,Nr=yt._id,jr=Nr.charAt(0),Ir=yt.title.font.size,Ur,ln=(yt.title.text.match(r.BR_TAG_ALL)||[]).length;if(yt.title.hasOwnProperty("standoff"))yt.side==="bottom"||yt.side==="right"?Ur=yt._depth+yt.title.standoff+Ir*le:(yt.side==="top"||yt.side==="left")&&(Ur=yt._depth+yt.title.standoff+Ir*(fe+ln*ce));else{var $r=_a(yt);if(yt.type==="multicategory")Ur=yt._depth;else{var At=1.5*Ir;$r&&(At=.5*Ir,yt.ticks==="outside"&&(At+=yt.ticklen)),Ur=10+At+(yt.linewidth?yt.linewidth-1:0)}$r||(jr==="x"?Ur+=yt.side==="top"?Ir*(yt.showticklabels?1:0):Ir*(yt.showticklabels?1.5:.5):Ur+=yt.side==="right"?Ir*(yt.showticklabels?1:.5):Ir*(yt.showticklabels?.5:0))}var or=ne.getPxPosition(Dt,yt),Dr,un,Rn;jr==="x"?(un=yt._offset+yt._length/2,Rn=yt.side==="top"?or-Ur:or+Ur):(Rn=yt._offset+yt._length/2,un=yt.side==="right"?or+Ur:or-Ur,Dr={rotate:"-90",offset:0});var jn;if(yt.type!=="multicategory"){var Un=yt._selections[yt._id+"tick"];if(jn={selection:Un,side:yt.side},Un&&Un.node()&&Un.node().parentNode){var cn=i.getTranslate(Un.node().parentNode);jn.offsetLeft=cn.x,jn.offsetTop=cn.y}yt.title.hasOwnProperty("standoff")&&(jn.pad=0)}return yt._titleStandoff=Ur,o.draw(Dt,Nr+"title",{propContainer:yt,propName:yt._name+".title.text",placeholder:kr._dfltTitle[jr],avoid:jn,transform:Dr,attributes:{x:un,y:Rn,"text-anchor":"middle"}})}ne.shouldShowZeroLine=function(Dt,yt,kr){var Nr=e.simpleMap(yt.range,yt.r2l);return Nr[0]*Nr[1]<=0&&yt.zeroline&&(yt.type==="linear"||yt.type==="-")&&!(yt.rangebreaks&&yt.maskBreaks(0)===F)&&(ka(yt,0)||!qa(Dt,yt,kr,Nr)||ir(Dt,yt))},ne.clipEnds=function(Dt,yt){return yt.filter(function(kr){return ka(Dt,kr.x)})};function ka(Dt,yt){var kr=Dt.l2p(yt);return kr>1&&kr1)for(jr=1;jr=jr.min&&Dt=L:/%L/.test(yt)?Dt>=I:/%[SX]/.test(yt)?Dt>=y:/%M/.test(yt)?Dt>=v:/%[HI]/.test(yt)?Dt>=u:/%p/.test(yt)?Dt>=m:/%[Aadejuwx]/.test(yt)?Dt>=w:/%[UVW]/.test(yt)?Dt>=_:/%[Bbm]/.test(yt)?Dt>=M:/%[q]/.test(yt)?Dt>=g:/%[Yy]/.test(yt)?Dt>=d:!0}}}),jT=Ge({"src/plots/cartesian/autorange_options_defaults.js"($,G){G.exports=function(b,S,E){var e,t;if(E){var r=S==="reversed"||S==="min reversed"||S==="max reversed";e=E[r?1:0],t=E[r?0:1]}var o=b("autorangeoptions.minallowed",t===null?e:void 0),n=b("autorangeoptions.maxallowed",e===null?t:void 0);o===void 0&&b("autorangeoptions.clipmin"),n===void 0&&b("autorangeoptions.clipmax"),b("autorangeoptions.include")}}}),qT=Ge({"src/plots/cartesian/range_defaults.js"($,G){var h=jT();G.exports=function(S,E,e,t){var r=E._template||{},o=E.type||r.type||"-";e("minallowed"),e("maxallowed");var n=e("range");if(!n){var i;!t.noInsiderange&&o!=="log"&&(i=e("insiderange"),i&&(i[0]===null||i[1]===null)&&(E.insiderange=!1,i=void 0),i&&(n=e("range",i)))}var a=E.getAutorangeDflt(n,t),s=e("autorange",a),f;n&&(n[0]===null&&n[1]===null||(n[0]===null||n[1]===null)&&(s==="reversed"||s===!0)||n[0]!==null&&(s==="min"||s==="max reversed")||n[1]!==null&&(s==="max"||s==="min reversed"))&&(n=void 0,delete E.range,E.autorange=!0,f=!0),f||(a=E.getAutorangeDflt(n,t),s=e("autorange",a)),s&&(h(e,s,n),(o==="linear"||o==="-")&&e("rangemode")),E.cleanRange()}}}),Vw=Ge({"node_modules/mouse-event-offset/index.js"($,G){var h={left:0,top:0};G.exports=b;function b(E,e,t){e=e||E.currentTarget||E.srcElement,Array.isArray(t)||(t=[0,0]);var r=E.clientX||0,o=E.clientY||0,n=S(e);return t[0]=r-n.left,t[1]=o-n.top,t}function S(E){return E===window||E===document||E===document.body?h:E.getBoundingClientRect()}}}),Hw=Ge({"node_modules/has-passive-events/index.js"($,G){var h=ox();function b(){var S=!1;try{var E=Object.defineProperty({},"passive",{get:function(){S=!0}});window.addEventListener("test",null,E),window.removeEventListener("test",null,E)}catch{S=!1}return S}G.exports=h&&b()}}),pM=Ge({"src/components/dragelement/align.js"($,G){G.exports=function(b,S,E,e,t){var r=(b-E)/(e-E),o=r+S/(e-E),n=(r+o)/2;return t==="left"||t==="bottom"?r:t==="center"||t==="middle"?n:t==="right"||t==="top"?o:r<2/3-n?r:o>4/3-n?o:n}}}),mM=Ge({"src/components/dragelement/cursor.js"($,G){var h=yn(),b=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];G.exports=function(E,e,t,r){return t==="left"?E=0:t==="center"?E=1:t==="right"?E=2:E=h.constrain(Math.floor(E*3),0,2),r==="bottom"?e=0:r==="middle"?e=1:r==="top"?e=2:e=h.constrain(Math.floor(e*3),0,2),b[e][E]}}}),gM=Ge({"src/components/dragelement/unhover.js"($,G){var h=x1(),b=k0(),S=Yg().getGraphDiv,E=Wc(),e=G.exports={};e.wrapped=function(t,r,o){t=S(t),t._fullLayout&&b.clear(t._fullLayout._uid+E.HOVERID),e.raw(t,r,o)},e.raw=function(r,o){var n=r._fullLayout,i=r._hoverdata;o||(o={}),!(o.target&&!r._dragged&&h.triggerHandler(r,"plotly_beforehover",o)===!1)&&(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),r._hoverdata=void 0,o.target&&i&&r.emit("plotly_unhover",{event:o,points:i}))}}}),nd=Ge({"src/components/dragelement/index.js"($,G){var h=Vw(),b=jw(),S=Hw(),E=yn().removeElement,e=nh(),t=G.exports={};t.align=pM(),t.getCursor=mM();var r=gM();t.unhover=r.wrapped,t.unhoverRaw=r.raw,t.init=function(a){var s=a.gd,f=1,c=s._context.doubleClickDelay,p=a.element,d,T,l,g,x,A,M,_;s._mouseDownTime||(s._mouseDownTime=0),p.style.pointerEvents="all",p.onmousedown=u,S?(p._ontouchstart&&p.removeEventListener("touchstart",p._ontouchstart),p._ontouchstart=u,p.addEventListener("touchstart",u,{passive:!1})):p.ontouchstart=u;function w(I,L,z){return Math.abs(I)"u"&&typeof I.clientY>"u"&&(I.clientX=d,I.clientY=T),l=new Date().getTime(),l-s._mouseDownTimec&&(f=Math.max(f-1,1)),s._dragged)a.doneFn&&a.doneFn();else{var L;A.target===M?L=A:(L={target:M,srcElement:M,toElement:M},Object.keys(A).concat(Object.keys(A.__proto__)).forEach(z=>{var F=A[z];!L[z]&&typeof F!="function"&&(L[z]=F)})),a.clickFn&&a.clickFn(f,L),_||M.dispatchEvent(new MouseEvent("click",I))}s._dragging=!1,s._dragged=!1}};function o(){var i=document.createElement("div");i.className="dragcover";var a=i.style;return a.position="fixed",a.left=0,a.right=0,a.top=0,a.bottom=0,a.zIndex=999999999,a.background="none",document.body.appendChild(i),i}t.coverSlip=o;function n(i){return h(i.changedTouches?i.changedTouches[0]:i,document.body)}}}),Ip=Ge({"src/lib/setcursor.js"($,G){G.exports=function(b,S){(b.attr("class")||"").split(" ").forEach(function(E){E.indexOf("cursor-")===0&&b.classed(E,!1)}),S&&b.classed("cursor-"+S,!0)}}}),yM=Ge({"src/lib/override_cursor.js"($,G){var h=Ip(),b="data-savedcursor",S="!!";G.exports=function(e,t){var r=e.attr(b);if(t){if(!r){for(var o=(e.attr("class")||"").split(" "),n=0;nV.legend.length)for(var K=V.legend.length;K(n==="legend"?1:0));if(L===!1&&(a[n]=void 0),!(L===!1&&!f.uirevision)&&(p("uirevision",a.uirevision),L!==!1)){p("borderwidth");var z=p("orientation"),F=p("yref"),N=p("xref"),B=z==="h",R=F==="paper",U=N==="paper",j,Z,re,fe="left";B?(j=0,h.getComponentMethod("rangeslider","isVisible")(i.xaxis)?R?(Z=1.1,re="bottom"):(Z=1,re="top"):R?(Z=-.1,re="top"):(Z=0,re="bottom")):(Z=1,re="auto",U?j=1.02:(j=1,fe="right")),b.coerce(f,c,{x:{valType:"number",editType:"legend",min:U?-2:0,max:U?3:1,dflt:j}},"x"),b.coerce(f,c,{y:{valType:"number",editType:"legend",min:R?-2:0,max:R?3:1,dflt:Z}},"y"),p("traceorder",w),r.isGrouped(a[n])&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("indentation"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("xanchor",fe),p("yanchor",re),p("maxheight"),p("valign"),b.noneOrAll(f,c,["x","y"]);var le=p("title.text");if(le){p("title.side",B?"left":"top");var ce=b.extendFlat({},d,{size:b.bigFont(d.size)});b.coerceFont(p,"title.font",ce)}}}G.exports=function(i,a,s){var f,c=s.slice(),p=a.shapes;if(p)for(f=0;fz&&(L=z)}y[d][0]._groupMinRank=L,y[d][0]._preGroupSort=d}var F=function(Z,re){return Z[0]._groupMinRank-re[0]._groupMinRank||Z[0]._preGroupSort-re[0]._preGroupSort},N=function(Z,re){return Z.trace.legendrank-re.trace.legendrank||Z._preSort-re._preSort};for(y.forEach(function(Z,re){Z[0]._preGroupSort=re}),y.sort(F),d=0;d0)ue=ee.width;else return 0;return m?K:Math.min(ue,ne)};A.each(function(V){var ee=h.select(this),ne=S.ensureSingle(ee,"g","layers");ne.style("opacity",V[0].trace.opacity);var K=_.indentation,ue=_.valign,te=V[0].lineHeight,H=V[0].height;if(ue==="middle"&&K===0||!te||!H)ne.attr("transform",null);else{var ae={top:1,bottom:-1}[ue],ie=ae*(.5*(te-H+3))||0,ve=_.indentation;ne.attr("transform",E(ve,ie))}var Ae=ne.selectAll("g.legendfill").data([V]);Ae.enter().append("g").classed("legendfill",!0);var Ce=ne.selectAll("g.legendlines").data([V]);Ce.enter().append("g").classed("legendlines",!0);var Fe=ne.selectAll("g.legendsymbols").data([V]);Fe.enter().append("g").classed("legendsymbols",!0),Fe.selectAll("g.legendpoints").data([V]).enter().append("g").classed("legendpoints",!0)}).each(ce).each(F).each(B).each(N).each(U).each(fe).each(re).each(L).each(z).each(j).each(Z);function L(V){var ee=l(V),ne=ee.showFill,K=ee.showLine,ue=ee.showGradientLine,te=ee.showGradientFill,H=ee.anyFill,ae=ee.anyLine,ie=V[0],ve=ie.trace,Ae,Ce,Fe=r(ve),ze=Fe.colorscale,Ye=Fe.reversescale,it=function(Ne){if(Ne.size())if(ne)e.fillGroupStyle(Ne,M,!0);else{var ot="legendfill-"+ve.uid;e.gradient(Ne,M,ot,T(Ye),ze,"fill")}},st=function(Ne){if(Ne.size()){var ot="legendline-"+ve.uid;e.lineGroupStyle(Ne),e.gradient(Ne,M,ot,T(Ye),ze,"stroke")}},nt=o.hasMarkers(ve)||!H?"M5,0":ae?"M5,-2":"M5,-3",Qe=h.select(this),Le=Qe.select(".legendfill").selectAll("path").data(ne||te?[V]:[]);if(Le.enter().append("path").classed("js-fill",!0),Le.exit().remove(),Le.attr("d",nt+"h"+u+"v6h-"+u+"z").call(it),K||ue){var Te=I(void 0,ve.line,p,f);Ce=S.minExtend(ve,{line:{width:Te}}),Ae=[S.minExtend(ie,{trace:Ce})]}var pe=Qe.select(".legendlines").selectAll("path").data(K||ue?[Ae]:[]);pe.enter().append("path").classed("js-line",!0),pe.exit().remove(),pe.attr("d",nt+(ue?"l"+u+",0.0001":"h"+u)).call(K?e.lineGroupStyle:st)}function z(V){var ee=l(V),ne=ee.anyFill,K=ee.anyLine,ue=ee.showLine,te=ee.showMarker,H=V[0],ae=H.trace,ie=!te&&!K&&!ne&&o.hasText(ae),ve,Ae;function Ce(Le,Te,pe,Ne){var ot=S.nestedProperty(ae,Le).get(),ft=S.isArrayOrTypedArray(ot)&&Te?Te(ot):ot;if(m&&ft&&Ne!==void 0&&(ft=Ne),pe){if(ftpe[1])return pe[1]}return ft}function Fe(Le){return H._distinct&&H.index&&Le[H.index]?Le[H.index]:Le[0]}if(te||ie||ue){var ze={},Ye={};if(te){ze.mc=Ce("marker.color",Fe),ze.mx=Ce("marker.symbol",Fe),ze.mo=Ce("marker.opacity",S.mean,[.2,1]),ze.mlc=Ce("marker.line.color",Fe),ze.mlw=Ce("marker.line.width",S.mean,[0,5],c),Ye.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var it=Ce("marker.size",S.mean,[2,16],s);ze.ms=it,Ye.marker.size=it}ue&&(Ye.line={width:Ce("line.width",Fe,[0,10],f)}),ie&&(ze.tx="Aa",ze.tp=Ce("textposition",Fe),ze.ts=10,ze.tc=Ce("textfont.color",Fe),ze.tf=Ce("textfont.family",Fe),ze.tw=Ce("textfont.weight",Fe),ze.ty=Ce("textfont.style",Fe),ze.tv=Ce("textfont.variant",Fe),ze.tC=Ce("textfont.textcase",Fe),ze.tE=Ce("textfont.lineposition",Fe),ze.tS=Ce("textfont.shadow",Fe)),ve=[S.minExtend(H,ze)],Ae=S.minExtend(ae,Ye),Ae.selectedpoints=null,Ae.texttemplate=null}var st=h.select(this).select("g.legendpoints"),nt=st.selectAll("path.scatterpts").data(te?ve:[]);nt.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",y),nt.exit().remove(),nt.call(e.pointStyle,Ae,M),te&&(ve[0].mrc=3);var Qe=st.selectAll("g.pointtext").data(ie?ve:[]);Qe.enter().append("g").classed("pointtext",!0).append("text").attr("transform",y),Qe.exit().remove(),Qe.selectAll("text").call(e.textPointStyle,Ae,M)}function F(V){var ee=V[0].trace,ne=ee.type==="waterfall";if(V[0]._distinct&&ne){var K=V[0].trace[V[0].dir].marker;return V[0].mc=K.color,V[0].mlw=K.line.width,V[0].mlc=K.line.color,R(V,this,"waterfall")}var ue=[];ee.visible&&ne&&(ue=V[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var te=h.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(ue);te.enter().append("path").classed("legendwaterfall",!0).attr("transform",y).style("stroke-miterlimit",1),te.exit().remove(),te.each(function(H){var ae=h.select(this),ie=ee[H[0]].marker,ve=I(void 0,ie.line,d,c);ae.attr("d",H[1]).style("stroke-width",ve+"px").call(t.fill,ie.color),ve&&ae.call(t.stroke,ie.line.color)})}function N(V){R(V,this)}function B(V){R(V,this,"funnel")}function R(V,ee,ne){var K=V[0].trace,ue=K.marker||{},te=ue.line||{},H=ue.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",ae=ne?K.visible&&K.type===ne:b.traceIs(K,"bar"),ie=h.select(ee).select("g.legendpoints").selectAll("path.legend"+ne).data(ae?[V]:[]);ie.enter().append("path").classed("legend"+ne,!0).attr("d",H).attr("transform",y),ie.exit().remove(),ie.each(function(ve){var Ae=h.select(this),Ce=ve[0],Fe=I(Ce.mlw,ue.line,d,c);Ae.style("stroke-width",Fe+"px");var ze=Ce.mcc;if(!_._inHover&&"mc"in Ce){var Ye=r(ue),it=Ye.mid;it===void 0&&(it=(Ye.max+Ye.min)/2),ze=e.tryColorscale(ue,"")(it)}var st=ze||Ce.mc||ue.color,nt=ue.pattern,Qe=e.getPatternAttr,Le=nt&&(Qe(nt.shape,0,"")||Qe(nt.path,0,""));if(Le){var Te=Qe(nt.bgcolor,0,null),pe=Qe(nt.fgcolor,0,null),Ne=nt.fgopacity,ot=g(nt.size,8,10),ft=g(nt.solidity,.5,1),rt="legend-"+K.uid;Ae.call(e.pattern,"legend",M,rt,Le,ot,ft,ze,nt.fillmode,Te,pe,Ne)}else Ae.call(t.fill,st);Fe&&t.stroke(Ae,Ce.mlc||te.color)})}function U(V){var ee=V[0].trace,ne=h.select(this).select("g.legendpoints").selectAll("path.legendbox").data(ee.visible&&b.traceIs(ee,"box-violin")?[V]:[]);ne.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",y),ne.exit().remove(),ne.each(function(){var K=h.select(this);if((ee.boxpoints==="all"||ee.points==="all")&&t.opacity(ee.fillcolor)===0&&t.opacity((ee.line||{}).color)===0){var ue=S.minExtend(ee,{marker:{size:m?s:S.constrain(ee.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});ne.call(e.pointStyle,ue,M)}else{var te=I(void 0,ee.line,d,c);K.style("stroke-width",te+"px").call(t.fill,ee.fillcolor),te&&t.stroke(K,ee.line.color)}})}function j(V){var ee=V[0].trace,ne=h.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(ee.visible&&ee.type==="candlestick"?[V,V]:[]);ne.enter().append("path").classed("legendcandle",!0).attr("d",function(K,ue){return ue?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",y).style("stroke-miterlimit",1),ne.exit().remove(),ne.each(function(K,ue){var te=h.select(this),H=ee[ue?"increasing":"decreasing"],ae=I(void 0,H.line,d,c);te.style("stroke-width",ae+"px").call(t.fill,H.fillcolor),ae&&t.stroke(te,H.line.color)})}function Z(V){var ee=V[0].trace,ne=h.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(ee.visible&&ee.type==="ohlc"?[V,V]:[]);ne.enter().append("path").classed("legendohlc",!0).attr("d",function(K,ue){return ue?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",y).style("stroke-miterlimit",1),ne.exit().remove(),ne.each(function(K,ue){var te=h.select(this),H=ee[ue?"increasing":"decreasing"],ae=I(void 0,H.line,d,c);te.style("fill","none").call(e.dashLine,H.line.dash,ae),ae&&t.stroke(te,H.line.color)})}function re(V){le(V,this,"pie")}function fe(V){le(V,this,"funnelarea")}function le(V,ee,ne){var K=V[0],ue=K.trace,te=ne?ue.visible&&ue.type===ne:b.traceIs(ue,ne),H=h.select(ee).select("g.legendpoints").selectAll("path.legend"+ne).data(te?[V]:[]);if(H.enter().append("path").classed("legend"+ne,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",y),H.exit().remove(),H.size()){var ae=ue.marker||{},ie=I(i(ae.line.width,K.pts),ae.line,d,c),ve="pieLike",Ae=S.minExtend(ue,{marker:{line:{width:ie}}},ve),Ce=S.minExtend(K,{trace:Ae},ve);n(H,Ce,Ae,M)}}function ce(V){var ee=V[0].trace,ne,K=[];if(ee.visible)switch(ee.type){case"histogram2d":case"heatmap":K=[["M-15,-2V4H15V-2Z"]],ne=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":K=[["M-6,-6V6H6V-6Z"]],ne=!0;break;case"densitymapbox":case"densitymap":K=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],ne="radial";break;case"cone":K=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],ne=!1;break;case"streamtube":K=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],ne=!1;break;case"surface":K=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],ne=!0;break;case"mesh3d":K=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ne=!1;break;case"volume":K=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ne=!0;break;case"isosurface":K=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],ne=!1;break}var ue=h.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(K);ue.enter().append("path").classed("legend3dandfriends",!0).attr("transform",y).style("stroke-miterlimit",1),ue.exit().remove(),ue.each(function(te,H){var ae=h.select(this),ie=r(ee),ve=ie.colorscale,Ae=ie.reversescale,Ce=function(it){if(it.size()){var st="legendfill-"+ee.uid;e.gradient(it,M,st,T(Ae,ne==="radial"),ve,"fill")}},Fe;if(ve){if(!ne){var Ye=ve.length;Fe=H===0?ve[Ae?Ye-1:0][1]:H===1?ve[Ae?0:Ye-1][1]:ve[Math.floor((Ye-1)/2)][1]}}else{var ze=ee.vertexcolor||ee.facecolor||ee.color;Fe=S.isArrayOrTypedArray(ze)?ze[H]||ze[0]:ze}ae.attr("d",te[0]),Fe?ae.call(t.fill,Fe):ae.call(Ce)})}};function T(x,A){var M=A?"radial":"horizontal";return M+(x?"":"reversed")}function l(x){var A=x[0].trace,M=A.contours,_=o.hasLines(A),w=o.hasMarkers(A),m=A.visible&&A.fill&&A.fill!=="none",u=!1,v=!1;if(M){var y=M.coloring;y==="lines"?u=!0:_=y==="none"||y==="heatmap"||M.showlines,M.type==="constraint"?m=M._operation!=="=":(y==="fill"||y==="heatmap")&&(v=!0)}return{showMarker:w,showLine:_,showFill:m,showGradientLine:u,showGradientFill:v,anyLine:_||u,anyFill:m||v}}function g(x,A,M){return x&&S.isArrayOrTypedArray(x)?A:x>M?M:x}}}),ZT=Ge({"src/components/legend/draw.js"($,G){var h=Za(),b=yn(),S=$c(),E=Io(),e=x1(),t=nd(),r=Ms(),o=So(),n=ec(),i=Xw(),a=GT(),s=ev(),f=s.LINE_SPACING,c=s.FROM_TL,p=s.FROM_BR,d=_M(),T=YT(),l=Gw(),g=1,x=/^legend[0-9]*$/;G.exports=function(j,Z){if(Z)M(j,Z);else{var re=j._fullLayout,fe=re._legends,le=re._infolayer.selectAll('[class^="legend"]');le.each(function(){var ne=h.select(this),K=ne.attr("class"),ue=K.split(" ")[0];ue.match(x)&&fe.indexOf(ue)===-1&&ne.remove()});for(var ce=0;ce1)}var ae=re.hiddenlabels||[];if(!V&&(!re.showlegend||!ee.length))return ce.selectAll("."+fe).remove(),re._topdefs.select("#"+le).remove(),S.autoMargin(U,fe);var ie=b.ensureSingle(ce,"g",fe,function(nt){V||nt.attr("pointer-events","all")}),ve=b.ensureSingleById(re._topdefs,"clipPath",le,function(nt){nt.append("rect")}),Ae=b.ensureSingle(ie,"rect","bg",function(nt){nt.attr("shape-rendering","crispEdges")});Ae.call(o.stroke,Z.bordercolor).call(o.fill,Z.bgcolor).style("stroke-width",Z.borderwidth+"px");var Ce=b.ensureSingle(ie,"g","scrollbox"),Fe=Z.title;Z._titleWidth=0,Z._titleHeight=0;var ze;Fe.text?(ze=b.ensureSingle(Ce,"text",fe+"titletext"),ze.attr("text-anchor","start").call(r.font,Fe.font).text(Fe.text),y(ze,Ce,U,Z,g)):Ce.selectAll("."+fe+"titletext").remove();var Ye=b.ensureSingle(ie,"rect","scrollbar",function(nt){nt.attr(a.scrollBarEnterAttrs).call(o.fill,a.scrollBarColor)}),it=Ce.selectAll("g.groups").data(ee);it.enter().append("g").attr("class","groups"),it.exit().remove();var st=it.selectAll("g.traces").data(b.identity);st.enter().append("g").attr("class","traces"),st.exit().remove(),st.style("opacity",function(nt){var Qe=nt[0].trace;return E.traceIs(Qe,"pie-like")?ae.indexOf(nt[0].label)!==-1?.5:1:Qe.visible==="legendonly"?.5:1}).each(function(){h.select(this).call(m,U,Z)}).call(T,U,Z).each(function(){V||h.select(this).call(v,U,fe)}),b.syncOrAsync([S.previousPromises,function(){return z(U,it,st,Z)},function(){var nt=re._size,Qe=Z.borderwidth,Le=Z.xref==="paper",Te=Z.yref==="paper";if(Fe.text&&A(ze,Z,Qe),!V){var pe,Ne;Le?pe=nt.l+nt.w*Z.x-c[N(Z)]*Z._width:pe=re.width*Z.x-c[N(Z)]*Z._width,Te?Ne=nt.t+nt.h*(1-Z.y)-c[B(Z)]*Z._effHeight:Ne=re.height*(1-Z.y)-c[B(Z)]*Z._effHeight;var ot=F(U,fe,pe,Ne);if(ot)return;if(re.margin.autoexpand){var ft=pe,rt=Ne;pe=Le?b.constrain(pe,0,re.width-Z._width):ft,Ne=Te?b.constrain(Ne,0,re.height-Z._effHeight):rt,pe!==ft&&b.log("Constrain "+fe+".x to make legend fit inside graph"),Ne!==rt&&b.log("Constrain "+fe+".y to make legend fit inside graph")}r.setTranslate(ie,pe,Ne)}if(Ye.on(".drag",null),ie.on("wheel",null),V||Z._height<=Z._maxHeight||U._context.staticPlot){var Ft=Z._effHeight;V&&(Ft=Z._height),Ae.attr({width:Z._width-Qe,height:Ft-Qe,x:Qe/2,y:Qe/2}),r.setTranslate(Ce,0,0),ve.select("rect").attr({width:Z._width-2*Qe,height:Ft-2*Qe,x:Qe,y:Qe}),r.setClipUrl(Ce,le,U),r.setRect(Ye,0,0,0,0),delete Z._scrollY}else{var Nt=Math.max(a.scrollBarMinHeight,Z._effHeight*Z._effHeight/Z._height),$t=Z._effHeight-Nt-2*a.scrollBarMargin,rr=Z._height-Z._effHeight,Er=$t/rr,Mr=Math.min(Z._scrollY||0,rr);Ae.attr({width:Z._width-2*Qe+a.scrollBarWidth+a.scrollBarMargin,height:Z._effHeight-Qe,x:Qe/2,y:Qe/2}),ve.select("rect").attr({width:Z._width-2*Qe+a.scrollBarWidth+a.scrollBarMargin,height:Z._effHeight-2*Qe,x:Qe,y:Qe+Mr}),r.setClipUrl(Ce,le,U),xe(Mr,Nt,Er),ie.on("wheel",function(){Mr=b.constrain(Z._scrollY+h.event.deltaY/rr*$t,0,rr),xe(Mr,Nt,Er),Mr!==0&&Mr!==rr&&h.event.preventDefault()});var Wr,Sr,Br,Mt=function(Lt,Ct,Ot){var Wt=(Ot-Ct)/Er+Lt;return b.constrain(Wt,0,rr)},je=function(Lt,Ct,Ot){var Wt=(Ct-Ot)/Er+Lt;return b.constrain(Wt,0,rr)},$e=h.behavior.drag().on("dragstart",function(){var Lt=h.event.sourceEvent;Lt.type==="touchstart"?Wr=Lt.changedTouches[0].clientY:Wr=Lt.clientY,Br=Mr}).on("drag",function(){var Lt=h.event.sourceEvent;Lt.buttons===2||Lt.ctrlKey||(Lt.type==="touchmove"?Sr=Lt.changedTouches[0].clientY:Sr=Lt.clientY,Mr=Mt(Br,Wr,Sr),xe(Mr,Nt,Er))});Ye.call($e);var Ee=h.behavior.drag().on("dragstart",function(){var Lt=h.event.sourceEvent;Lt.type==="touchstart"&&(Wr=Lt.changedTouches[0].clientY,Br=Mr)}).on("drag",function(){var Lt=h.event.sourceEvent;Lt.type==="touchmove"&&(Sr=Lt.changedTouches[0].clientY,Mr=je(Br,Wr,Sr),xe(Mr,Nt,Er))});Ce.call(Ee)}function xe(Lt,Ct,Ot){Z._scrollY=U._fullLayout[fe]._scrollY=Lt,r.setTranslate(Ce,0,-Lt),r.setRect(Ye,Z._width,a.scrollBarMargin+Lt*Ot,a.scrollBarWidth,Ct),ve.select("rect").attr("y",Qe+Lt)}if(U._context.edits.legendPosition){var ye,Me,Xe,Je;ie.classed("cursor-move",!0),t.init({element:ie.node(),gd:U,prepFn:function(Lt){if(Lt.target!==Ye.node()){var Ct=r.getTranslate(ie);Xe=Ct.x,Je=Ct.y}},moveFn:function(Lt,Ct){if(Xe!==void 0&&Je!==void 0){var Ot=Xe+Lt,Wt=Je+Ct;r.setTranslate(ie,Ot,Wt),ye=t.align(Ot,Z._width,nt.l,nt.l+nt.w,Z.xanchor),Me=t.align(Wt+Z._height,-Z._height,nt.t+nt.h,nt.t,Z.yanchor)}},doneFn:function(){if(ye!==void 0&&Me!==void 0){var Lt={};Lt[fe+".x"]=ye,Lt[fe+".y"]=Me,E.call("_guiRelayout",U,Lt)}},clickFn:function(Lt,Ct){var Ot=ce.selectAll("g.traces").filter(function(){var Wt=this.getBoundingClientRect();return Ct.clientX>=Wt.left&&Ct.clientX<=Wt.right&&Ct.clientY>=Wt.top&&Ct.clientY<=Wt.bottom});Ot.size()>0&&w(U,ie,Ot,Lt,Ct)}})}}],U)}}function _(U,j,Z){var re=U[0],fe=re.width,le=j.entrywidthmode,ce=re.trace.legendwidth||j.entrywidth;return le==="fraction"?j._maxWidth*ce:Z+(ce||fe)}function w(U,j,Z,re,fe){var le=Z.data()[0][0].trace,ce={event:fe,node:Z.node(),curveNumber:le.index,expandedIndex:le.index,data:U.data,layout:U.layout,frames:U._transitionData._frames,config:U._context,fullData:U._fullData,fullLayout:U._fullLayout};le._group&&(ce.group=le._group),E.traceIs(le,"pie-like")&&(ce.label=Z.datum()[0].label);var V=e.triggerHandler(U,"plotly_legendclick",ce);if(re===1){if(V===!1)return;j._clickTimeout=setTimeout(function(){U._fullLayout&&i(Z,U,re)},U._context.doubleClickDelay)}else if(re===2){j._clickTimeout&&clearTimeout(j._clickTimeout),U._legendMouseDownTime=0;var ee=e.triggerHandler(U,"plotly_legenddoubleclick",ce);ee!==!1&&V!==!1&&i(Z,U,re)}}function m(U,j,Z){var re=R(Z),fe=U.data()[0][0],le=fe.trace,ce=E.traceIs(le,"pie-like"),V=!Z._inHover&&j._context.edits.legendText&&!ce,ee=Z._maxNameLength,ne,K;fe.groupTitle?(ne=fe.groupTitle.text,K=fe.groupTitle.font):(K=Z.font,Z.entries?ne=fe.text:(ne=ce?fe.label:le.name,le._meta&&(ne=b.templateString(ne,le._meta))));var ue=b.ensureSingle(U,"text",re+"text");ue.attr("text-anchor","start").call(r.font,K).text(V?u(ne,ee):ne);var te=Z.indentation+Z.itemwidth+a.itemGap*2;n.positionText(ue,te,0),V?ue.call(n.makeEditable,{gd:j,text:ne}).call(y,U,j,Z).on("edit",function(H){this.text(u(H,ee)).call(y,U,j,Z);var ae=fe.trace._fullInput||{},ie={};return ie.name=H,ae._isShape?E.call("_guiRelayout",j,"shapes["+le.index+"].name",ie.name):E.call("_guiRestyle",j,ie,le.index)}):y(ue,U,j,Z)}function u(U,j){var Z=Math.max(4,j);if(U&&U.trim().length>=Z/2)return U;U=U||"";for(var re=Z-U.length;re>0;re--)U+=" ";return U}function v(U,j,Z){var re=j._context.doubleClickDelay,fe,le=1,ce=b.ensureSingle(U,"rect",Z+"toggle",function(V){j._context.staticPlot||V.style("cursor","pointer").attr("pointer-events","all"),V.call(o.fill,"rgba(0,0,0,0)")});j._context.staticPlot||(ce.on("mousedown",function(){fe=new Date().getTime(),fe-j._legendMouseDownTimere&&(le=Math.max(le-1,1)),w(j,V,U,le,h.event)}}))}function y(U,j,Z,re,fe){re._inHover&&U.attr("data-notex",!0),n.convertToTspans(U,Z,function(){I(j,Z,re,fe)})}function I(U,j,Z,re){var fe=U.data()[0][0],le=fe&&fe.trace.showlegend;if(Array.isArray(le)&&(le=le[fe.i]!==!1),!Z._inHover&&fe&&!le){U.remove();return}var ce=U.select("g[class*=math-group]"),V=ce.node(),ee=R(Z);Z||(Z=j._fullLayout[ee]);var ne=Z.borderwidth,K;re===g?K=Z.title.font:fe.groupTitle?K=fe.groupTitle.font:K=Z.font;var ue=K.size*f,te,H;if(V){var ae=r.bBox(V);te=ae.height,H=ae.width,re===g?r.setTranslate(ce,ne,ne+te*.75):r.setTranslate(ce,0,te*.25)}else{var ie="."+ee+(re===g?"title":"")+"text",ve=U.select(ie),Ae=n.lineCount(ve),Ce=ve.node();if(te=ue*Ae,H=Ce?r.bBox(Ce).width:0,re===g)Z.title.side==="left"&&(H+=a.itemGap*2),n.positionText(ve,ne+a.titlePad,ne+ue);else{var Fe=a.itemGap*2+Z.indentation+Z.itemwidth;fe.groupTitle&&(Fe=a.itemGap,H-=Z.indentation+Z.itemwidth),n.positionText(ve,Fe,-ue*((Ae-1)/2-.3))}}re===g?(Z._titleWidth=H,Z._titleHeight=te):(fe.lineHeight=ue,fe.height=Math.max(te,16)+3,fe.width=H)}function L(U){var j=0,Z=0,re=U.title.side;return re&&(re.indexOf("left")!==-1&&(j=U._titleWidth),re.indexOf("top")!==-1&&(Z=U._titleHeight)),[j,Z]}function z(U,j,Z,re){var fe=U._fullLayout,le=R(re);re||(re=fe[le]);var ce=fe._size,V=l.isVertical(re),ee=l.isGrouped(re),ne=re.entrywidthmode==="fraction",K=re.borderwidth,ue=2*K,te=a.itemGap,H=re.indentation+re.itemwidth+te*2,ae=2*(K+te),ie=B(re),ve=re.y<0||re.y===0&&ie==="top",Ae=re.y>1||re.y===1&&ie==="bottom",Ce=re.tracegroupgap,Fe={};const{orientation:ze,yref:Ye}=re;let{maxheight:it}=re;const st=ve||Ae||ze!=="v"||Ye!=="paper";it||(it=st?.5:1);const nt=st?fe.height:ce.h;re._maxHeight=Math.max(it>1?it:it*nt,30);var Qe=0;re._width=0,re._height=0;var Le=L(re);if(V)Z.each(function(xe){var ye=xe[0].height;r.setTranslate(this,K+Le[0],K+Le[1]+re._height+ye/2+te),re._height+=ye,re._width=Math.max(re._width,xe[0].width)}),Qe=H+re._width,re._width+=te+H+ue,re._height+=ae,ee&&(j.each(function(xe,ye){r.setTranslate(this,0,ye*re.tracegroupgap)}),re._height+=(re._lgroupsLength-1)*re.tracegroupgap);else{var Te=N(re),pe=re.x<0||re.x===0&&Te==="right",Ne=re.x>1||re.x===1&&Te==="left",ot=Ae||ve,ft=fe.width/2;re._maxWidth=Math.max(pe?ot&&Te==="left"?ce.l+ce.w:ft:Ne?ot&&Te==="right"?ce.r+ce.w:ft:ce.w,2*H);var rt=0,Ft=0;Z.each(function(xe){var ye=_(xe,re,H);rt=Math.max(rt,ye),Ft+=ye}),Qe=null;var Nt=0;if(ee){var $t=0,rr=0,Er=0;j.each(function(){var xe=0,ye=0;h.select(this).selectAll("g.traces").each(function(Xe){var Je=_(Xe,re,H),Lt=Xe[0].height;r.setTranslate(this,Le[0],Le[1]+K+te+Lt/2+ye),ye+=Lt,xe=Math.max(xe,Je),Fe[Xe[0].trace.legendgroup]=xe});var Me=xe+te;rr>0&&Me+K+rr>re._maxWidth?(Nt=Math.max(Nt,rr),rr=0,Er+=$t+Ce,$t=ye):$t=Math.max($t,ye),r.setTranslate(this,rr,Er),rr+=Me}),re._width=Math.max(Nt,rr)+K,re._height=Er+$t+ae}else{var Mr=Z.size(),Wr=Ft+ue+(Mr-1)*te=re._maxWidth&&(Nt=Math.max(Nt,je),Br=0,Mt+=Sr,re._height+=Sr,Sr=0),r.setTranslate(this,Le[0]+K+Br,Le[1]+K+Mt+ye/2+te),je=Br+Me+te,Br+=Xe,Sr=Math.max(Sr,ye)}),Wr?(re._width=Br+ue,re._height=Sr+ae):(re._width=Math.max(Nt,je)+ue,re._height+=Sr+ae)}}re._width=Math.ceil(Math.max(re._width+Le[0],re._titleWidth+2*(K+a.titlePad))),re._height=Math.ceil(Math.max(re._height+Le[1],re._titleHeight+2*(K+a.itemGap))),re._effHeight=Math.min(re._height,re._maxHeight);var $e=U._context.edits,Ee=$e.legendText||$e.legendPosition;Z.each(function(xe){var ye=h.select(this).select("."+le+"toggle"),Me=xe[0].height,Xe=xe[0].trace.legendgroup,Je=_(xe,re,H);ee&&Xe!==""&&(Je=Fe[Xe]);var Lt=Ee?H:Qe||Je;!V&&!ne&&(Lt+=te/2),r.setRect(ye,0,-Me/2,Lt,Me)})}function F(U,j,Z,re){var fe=U._fullLayout,le=fe[j],ce=N(le),V=B(le),ee=le.xref==="paper",ne=le.yref==="paper";U._fullLayout._reservedMargin[j]={};var K=le.y<.5?"b":"t",ue=le.x<.5?"l":"r",te={r:fe.width-Z,l:Z+le._width,b:fe.height-re,t:re+le._effHeight};if(ee&&ne)return S.autoMargin(U,j,{x:le.x,y:le.y,l:le._width*c[ce],r:le._width*p[ce],b:le._effHeight*p[V],t:le._effHeight*c[V]});ee?U._fullLayout._reservedMargin[j][K]=te[K]:ne||le.orientation==="v"?U._fullLayout._reservedMargin[j][ue]=te[ue]:U._fullLayout._reservedMargin[j][K]=te[K]}function N(U){return b.isRightAnchor(U)?"right":b.isCenterAnchor(U)?"center":"left"}function B(U){return b.isBottomAnchor(U)?"bottom":b.isMiddleAnchor(U)?"middle":"top"}function R(U){return U._id||"legend"}}}),WT=Ge({"src/components/fx/hover.js"($){var G=Za(),h=Ga(),b=ks(),S=yn(),E=S.pushUnique,e=S.strTranslate,t=S.strRotate,r=x1(),o=ec(),n=yM(),i=Ms(),a=So(),s=nd(),f=Ss(),c=nh().zindexSeparator,p=Io(),d=Hv(),T=Wc(),l=HT(),g=ZT(),x=T.YANGLE,A=Math.PI*x/180,M=1/Math.sin(A),_=Math.cos(A),w=Math.sin(A),m=T.HOVERARROWSIZE,u=T.HOVERTEXTPAD,v={box:!0,ohlc:!0,violin:!0,candlestick:!0},y={scatter:!0,scattergl:!0,splom:!0};function I(H,ae){return H.distance-ae.distance}$.hover=function(ae,ie,ve,Ae){ae=S.getGraphDiv(ae);var Ce=ie.target;S.throttle(ae._fullLayout._uid+T.HOVERID,T.HOVERMINTIME,function(){L(ae,ie,ve,Ae,Ce)})},$.loneHover=function(ae,ie){var ve=!0;Array.isArray(ae)||(ve=!1,ae=[ae]);var Ae=ie.gd,Ce=K(Ae),Fe=ue(Ae),ze=ae.map(function(Ne){var ot=Ne._x0||Ne.x0||Ne.x||0,ft=Ne._x1||Ne.x1||Ne.x||0,rt=Ne._y0||Ne.y0||Ne.y||0,Ft=Ne._y1||Ne.y1||Ne.y||0,Nt=Ne.eventData;if(Nt){var $t=Math.min(ot,ft),rr=Math.max(ot,ft),Er=Math.min(rt,Ft),Mr=Math.max(rt,Ft),Wr=Ne.trace;if(p.traceIs(Wr,"gl3d")){var Sr=Ae._fullLayout[Wr.scene]._scene.container,Br=Sr.offsetLeft,Mt=Sr.offsetTop;$t+=Br,rr+=Br,Er+=Mt,Mr+=Mt}Nt.bbox={x0:$t+Fe,x1:rr+Fe,y0:Er+Ce,y1:Mr+Ce},ie.inOut_bbox&&ie.inOut_bbox.push(Nt.bbox)}else Nt=!1;return{color:Ne.color||a.defaultLine,x0:Ne.x0||Ne.x||0,x1:Ne.x1||Ne.x||0,y0:Ne.y0||Ne.y||0,y1:Ne.y1||Ne.y||0,xLabel:Ne.xLabel,yLabel:Ne.yLabel,zLabel:Ne.zLabel,text:Ne.text,name:Ne.name,idealAlign:Ne.idealAlign,borderColor:Ne.borderColor,fontFamily:Ne.fontFamily,fontSize:Ne.fontSize,fontColor:Ne.fontColor,fontWeight:Ne.fontWeight,fontStyle:Ne.fontStyle,fontVariant:Ne.fontVariant,nameLength:Ne.nameLength,textAlign:Ne.textAlign,trace:Ne.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Ne.hovertemplate||!1,hovertemplateLabels:Ne.hovertemplateLabels||!1,eventData:Nt}}),Ye=!1,it=N(ze,{gd:Ae,hovermode:"closest",rotateLabels:Ye,bgColor:ie.bgColor||a.background,container:G.select(ie.container),outerContainer:ie.outerContainer||ie.container}),st=it.hoverLabels,nt=5,Qe=0,Le=0;st.sort(function(Ne,ot){return Ne.y0-ot.y0}).each(function(Ne,ot){var ft=Ne.y0-Ne.by/2;ft-ntrr[0]._length||ra<0||ra>Er[0]._length)return s.unhoverRaw(H,ae)}if(ae.pointerX=ta+rr[0]._offset,ae.pointerY=ra+Er[0]._offset,"xval"in ae?Ee=d.flat(Ce,ae.xval):Ee=d.p2c(rr,ta),"yval"in ae?xe=d.flat(Ce,ae.yval):xe=d.p2c(Er,ra),!h(Ee[0])||!h(xe[0]))return S.warn("Fx.hover failed",ae,H),s.unhoverRaw(H,ae)}var qa=1/0;function ir(vi,ns){for(Me=0;Me<$e.length;Me++)if(Xe=$e[Me],!(!Xe||!Xe[0]||!Xe[0].trace)&&(Je=Xe[0].trace,!(Je.visible!==!0||Je._length===0)&&["carpet","contourcarpet"].indexOf(Je._module.name)===-1)){if(Ot=Qe,d.isUnifiedHover(Ot)&&(Ot=Ot.charAt(0)),Je.type==="splom"?(Ct=0,Lt=Ce[Ct]):(Lt=d.getSubplot(Je),Ct=Ce.indexOf(Lt)),pr={cd:Xe,trace:Je,xa:rr[Ct],ya:Er[Ct],maxHoverDistance:Br,maxSpikeDistance:Mt,index:!1,distance:Math.min(qa,Br),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:a.defaultLine,name:Je.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},ze[Lt]&&(pr.subplot=ze[Lt]._subplot),ze._splomScenes&&ze._splomScenes[Je.uid]&&(pr.scene=ze._splomScenes[Je.uid]),Ot==="array"){var Xo=ae[Me];"pointNumber"in Xo?(pr.index=Xo.pointNumber,Ot="closest"):(Ot="","xval"in Xo&&(Wt=Xo.xval,Ot="x"),"yval"in Xo&&(_r=Xo.yval,Ot=Ot?"closest":"y"))}else vi!==void 0&&ns!==void 0?(Wt=vi,_r=ns):(Wt=Ee[Ct],_r=xe[Ct]);if(hr=je.length,Br!==0)if(Je._module&&Je._module.hoverPoints){var Ys=Je._module.hoverPoints(pr,Wt,_r,Ot,{finiteRange:!0,hoverLayer:ze._hoverlayer,hoversubplots:Ye,gd:H});if(Ys)for(var vs,es=0;eshr&&(je.splice(0,hr),qa=je[0].distance),nt&&Mt!==0&&je.length===0){pr.distance=Mt,pr.index=!1;var qo=Je._module.hoverPoints(pr,Wt,_r,"closest",{hoverLayer:ze._hoverlayer});if(qo&&(qo=qo.filter(function(_o){return _o.spikeDistance<=Mt})),qo&&qo.length){var Zs,Hs=qo.filter(function(_o){return _o.xa.showspikes&&_o.xa.spikesnap!=="hovered data"});if(Hs.length){var sl=Hs[0];h(sl.x0)&&h(sl.y0)&&(Zs=ar(sl),(!Fr.vLinePoint||Fr.vLinePoint.spikeDistance>Zs.spikeDistance)&&(Fr.vLinePoint=Zs))}var ds=qo.filter(function(_o){return _o.ya.showspikes&&_o.ya.spikesnap!=="hovered data"});if(ds.length){var Ko=ds[0];h(Ko.x0)&&h(Ko.y0)&&(Zs=ar(Ko),(!Fr.hLinePoint||Fr.hLinePoint.spikeDistance>Zs.spikeDistance)&&(Fr.hLinePoint=Zs))}}}}}ir();function qt(vi,ns,Xo){for(var Ys=null,vs=1/0,es,qo=0;qovi.trace.index===Vn.trace.index):je=[Vn];var yi=je.length,Ci=ne("x",Vn,ze),Dt=ne("y",Vn,ze);ir(Ci,Dt);var yt=[],kr={},Nr=0,jr=function(vi){var ns=v[vi.trace.type]?z(vi):vi.trace.index;if(!kr[ns])Nr++,kr[ns]=Nr,yt.push(vi);else{var Xo=kr[ns]-1,Ys=yt[Xo];Xo>0&&Math.abs(vi.distance)yi-1;Ir--)jr(je[Ir]);je=yt,sn()}var Ur=H._hoverdata,ln=[],$r=K(H),At=ue(H);for(const vi of je){var or=d.makeEventData(vi,vi.trace,vi.cd);if(vi.hovertemplate!==!1){var Dr=!1;vi.cd[vi.index]&&vi.cd[vi.index].ht&&(Dr=vi.cd[vi.index].ht),vi.hovertemplate=Dr||vi.trace.hovertemplate||!1}if(vi.xa&&vi.ya){var un=vi.x0+vi.xa._offset,Rn=vi.x1+vi.xa._offset,jn=vi.y0+vi.ya._offset,Un=vi.y1+vi.ya._offset,cn=Math.min(un,Rn),In=Math.max(un,Rn),xi=Math.min(jn,Un),Ea=Math.max(jn,Un);or.bbox={x0:cn+At,x1:In+At,y0:xi+$r,y1:Ea+$r}}vi.eventData=[or],ln.push(or)}H._hoverdata=ln;var Pi=Qe==="y"&&($e.length>1||je.length>1)||Qe==="closest"&&En&&je.length>1,Xi=a.combine(ze.plot_bgcolor||a.background,ze.paper_bgcolor),uo=N(je,{gd:H,hovermode:Qe,rotateLabels:Pi,bgColor:Xi,container:ze._hoverlayer,outerContainer:ze._paper.node(),commonLabelOpts:ze.hoverlabel,hoverdistance:ze.hoverdistance}),so=uo.hoverLabels;if(d.isUnifiedHover(Qe)||(R(so,Pi,ze,uo.commonLabelBoundingBox),Z(so,Pi,ze._invScaleX,ze._invScaleY)),Ae&&Ae.tagName){var Eo=p.getComponentMethod("annotations","hasClickToShow")(H,ln);n(G.select(Ae),Eo?"pointer":"")}!Ae||ve||!le(H,ae,Ur)||(Ur&&H.emit("plotly_unhover",{event:ae,points:Ur}),H.emit("plotly_hover",{event:ae,points:H._hoverdata,xaxes:rr,yaxes:Er,xvals:Ee,yvals:xe}))}function z(H){return[H.trace.index,H.index,H.x0,H.y0,H.name,H.attr,H.xa?H.xa._id:"",H.ya?H.ya._id:""].join(",")}var F=/([\s\S]*)<\/extra>/;function N(H,ae){var ie=ae.gd,ve=ie._fullLayout,Ae=ae.hovermode,Ce=ae.rotateLabels,Fe=ae.bgColor,ze=ae.container,Ye=ae.outerContainer,it=ae.commonLabelOpts||{};if(H.length===0)return[[]];var st=ae.fontFamily||T.HOVERFONT,nt=ae.fontSize||T.HOVERFONTSIZE,Qe=ae.fontWeight||ve.font.weight,Le=ae.fontStyle||ve.font.style,Te=ae.fontVariant||ve.font.variant,pe=ae.fontTextcase||ve.font.textcase,Ne=ae.fontLineposition||ve.font.lineposition,ot=ae.fontShadow||ve.font.shadow,ft=H[0],rt=ft.xa,Ft=ft.ya,Nt=Ae.charAt(0),$t=Nt+"Label",rr=ft[$t];if(rr===void 0&&rt.type==="multicategory")for(var Er=0;Erve.width-At&&(or=ve.width-At),yi.attr("d","M"+(Ur-or)+",0L"+(Ur-or+m)+","+$r+m+"H"+At+"v"+$r+(u*2+Ir.height)+"H"+-At+"V"+$r+m+"H"+(Ur-or-m)+"Z"),Ur=or,Me.minX=Ur-At,Me.maxX=Ur+At,rt.side==="top"?(Me.minY=ln-(u*2+Ir.height),Me.maxY=ln-u):(Me.minY=ln+u,Me.maxY=ln+(u*2+Ir.height))}else{var Dr,un,Rn;Ft.side==="right"?(Dr="start",un=1,Rn="",Ur=rt._offset+rt._length):(Dr="end",un=-1,Rn="-",Ur=rt._offset),ln=Ft._offset+(ft.y0+ft.y1)/2,Ci.attr("text-anchor",Dr),yi.attr("d","M0,0L"+Rn+m+","+m+"V"+(u+Ir.height/2)+"h"+Rn+(u*2+Ir.width)+"V-"+(u+Ir.height/2)+"H"+Rn+m+"V-"+m+"Z"),Me.minY=ln-(u+Ir.height/2),Me.maxY=ln+(u+Ir.height/2),Ft.side==="right"?(Me.minX=Ur+m,Me.maxX=Ur+m+(u*2+Ir.width)):(Me.minX=Ur-m-(u*2+Ir.width),Me.maxX=Ur-m);var jn=Ir.height/2,Un=Wr-Ir.top-jn,cn="clip"+ve._uid+"commonlabel"+Ft._id,In;if(Uryi.hoverinfo!=="none");if(Vn.length===0)return[];var Xe=ve.hoverlabel,Je=Xe.font,Lt=Vn[0],Ct=((Ae==="x unified"?Lt.xa:Lt.ya).unifiedhovertitle||{}).text,Ot=Ct?S.hovertemplateString({data:Ae==="x unified"?[{xa:Lt.xa,x:Lt.xVal}]:[{ya:Lt.ya,y:Lt.yVal}],fallback:Lt.trace.hovertemplatefallback,locale:ve._d3locale,template:Ct}):rr,Wt={showlegend:!0,legend:{title:{text:Ot,font:Je},font:Je,bgcolor:Xe.bgcolor,bordercolor:Xe.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:ve.legend?ve.legend.traceorder:void 0,orientation:"v"}},_r={font:Je};l(Wt,_r,ie._fullData);var pr=_r.legend;pr.entries=[];for(var hr=0;hr=0?ha=mn:wn+ka=0?ha=wn:Jn+ka=0?_a=Vr:sn+qa=0?_a=sn:pa+qa=0,(Vn.idealAlign==="top"||!Pi)&&Xi?(Rn-=Un/2,Vn.anchor="end"):Pi?(Rn+=Un/2,Vn.anchor="start"):Vn.anchor="middle",Vn.crossPos=Rn;else{if(Vn.pos=Rn,Pi=un+jn/2+Ea<=Sr,Xi=un-jn/2-Ea>=0,(Vn.idealAlign==="left"||!Pi)&&Xi)un-=jn/2,Vn.anchor="end";else if(Pi)un+=jn/2,Vn.anchor="start";else{Vn.anchor="middle";var uo=Ea/2,so=un+uo-Sr,Eo=un-uo;so>0&&(un-=so),Eo<0&&(un+=-Eo)}Vn.crossPos=un}ln.attr("text-anchor",Vn.anchor),At&&$r.attr("text-anchor",Vn.anchor),yi.attr("transform",e(un,Rn)+(Ce?t(x):""))}),{hoverLabels:Ca,commonLabelBoundingBox:Me}}function B(H,ae,ie,ve,Ae,Ce){var Fe,ze,Ye="",it="";H.nameOverride!==void 0&&(H.name=H.nameOverride),H.name&&(H.trace._meta&&(H.name=S.templateString(H.name,H.trace._meta)),Ye=V(H.name,H.nameLength));var st=ie.charAt(0),nt=st==="x"?"y":"x";H.zLabel!==void 0?(H.xLabel!==void 0&&(it+="x: "+H.xLabel+"
"),H.yLabel!==void 0&&(it+="y: "+H.yLabel+"
"),H.trace.type!=="choropleth"&&H.trace.type!=="choroplethmapbox"&&H.trace.type!=="choroplethmap"&&(it+=(it?"z: ":"")+H.zLabel)):ae&&H[st+"Label"]===Ae?it=H[nt+"Label"]||"":H.xLabel===void 0?H.yLabel!==void 0&&H.trace.type!=="scattercarpet"&&(it=H.yLabel):H.yLabel===void 0?it=H.xLabel:it="("+H.xLabel+", "+H.yLabel+")",(H.text||H.text===0)&&!Array.isArray(H.text)&&(it+=(it?"
":"")+H.text),H.extraText!==void 0&&(it+=(it?"
":"")+H.extraText),Ce&&it===""&&!H.hovertemplate&&(Ye===""&&Ce.remove(),it=Ye),(ze=(Fe=H.trace)==null?void 0:Fe.hoverlabel)!=null&&ze.split&&(H.hovertemplate="");const{hovertemplate:Qe=!1}=H;if(Qe){const Le=H.hovertemplateLabels||H;H[st+"Label"]!==Ae&&(Le[st+"other"]=Le[st+"Val"],Le[st+"otherLabel"]=Le[st+"Label"]),it=S.hovertemplateString({data:[H.eventData[0]||{},H.trace._meta],fallback:H.trace.hovertemplatefallback,labels:Le,locale:ve._d3locale,template:Qe}),it=it.replace(F,(Te,pe)=>(Ye=V(pe,H.nameLength),""))}return[it,Ye]}function R(H,ae,ie,ve){var Ae=ae?"xa":"ya",Ce=ae?"ya":"xa",Fe=0,ze=1,Ye=H.size(),it=new Array(Ye),st=0,nt=ve.minX,Qe=ve.maxX,Le=ve.minY,Te=ve.maxY,pe=function(Ee){return Ee*ie._invScaleX},Ne=function(Ee){return Ee*ie._invScaleY};H.each(function(Ee){var xe=Ee[Ae],ye=Ee[Ce],Me=xe._id.charAt(0)==="x",Xe=xe.range;st===0&&Xe&&Xe[0]>Xe[1]!==Me&&(ze=-1);var Je=0,Lt=Me?ie.width:ie.height;if(ie.hovermode==="x"||ie.hovermode==="y"){var Ct=U(Ee,ae),Ot=Ee.anchor,Wt=Ot==="end"?-1:1,_r,pr;if(Ot==="middle")_r=Ee.crossPos+(Me?Ne(Ct.y-Ee.by/2):pe(Ee.bx/2+Ee.tx2width/2)),pr=_r+(Me?Ne(Ee.by):pe(Ee.bx));else if(Me)_r=Ee.crossPos+Ne(m+Ct.y)-Ne(Ee.by/2-m),pr=_r+Ne(Ee.by);else{var hr=pe(Wt*m+Ct.x),Fr=hr+pe(Wt*Ee.bx);_r=Ee.crossPos+Math.min(hr,Fr),pr=Ee.crossPos+Math.max(hr,Fr)}Me?Le!==void 0&&Te!==void 0&&Math.min(pr,Te)-Math.max(_r,Le)>1&&(ye.side==="left"?(Je=ye._mainLinePosition,Lt=ie.width):Lt=ye._mainLinePosition):nt!==void 0&&Qe!==void 0&&Math.min(pr,Qe)-Math.max(_r,nt)>1&&(ye.side==="top"?(Je=ye._mainLinePosition,Lt=ie.height):Lt=ye._mainLinePosition)}it[st++]=[{datum:Ee,traceIndex:Ee.trace.index,dp:0,pos:Ee.pos,posref:Ee.posref,size:Ee.by*(Me?M:1)/2,pmin:Je,pmax:Lt}]}),it.sort(function(Ee,xe){return Ee[0].posref-xe[0].posref||ze*(xe[0].traceIndex-Ee[0].traceIndex)});var ot,ft,rt,Ft,Nt,$t,rr;function Er(Ee){var xe=Ee[0],ye=Ee[Ee.length-1];if(ft=xe.pmin-xe.pos-xe.dp+xe.size,rt=ye.pos+ye.dp+ye.size-xe.pmax,ft>.01){for(Nt=Ee.length-1;Nt>=0;Nt--)Ee[Nt].dp+=ft;ot=!1}if(!(rt<.01)){if(ft<-.01){for(Nt=Ee.length-1;Nt>=0;Nt--)Ee[Nt].dp-=rt;ot=!1}if(ot){var Me=0;for(Ft=0;Ftxe.pmax&&Me++;for(Ft=Ee.length-1;Ft>=0&&!(Me<=0);Ft--)$t=Ee[Ft],$t.pos>xe.pmax-1&&($t.del=!0,Me--);for(Ft=0;Ft=0;Nt--)Ee[Nt].dp-=rt;for(Ft=Ee.length-1;Ft>=0&&!(Me<=0);Ft--)$t=Ee[Ft],$t.pos+$t.dp+$t.size>xe.pmax&&($t.del=!0,Me--)}}}for(;!ot&&Fe<=Ye;){for(Fe++,ot=!0,Ft=0;Ft.01){for(Nt=Wr.length-1;Nt>=0;Nt--)Wr[Nt].dp+=ft;for(Mr.push.apply(Mr,Wr),it.splice(Ft+1,1),rr=0,Nt=Mr.length-1;Nt>=0;Nt--)rr+=Mr[Nt].dp;for(rt=rr/Mr.length,Nt=Mr.length-1;Nt>=0;Nt--)Mr[Nt].dp-=rt;ot=!1}else Ft++}it.forEach(Er)}for(Ft=it.length-1;Ft>=0;Ft--){var Mt=it[Ft];for(Nt=Mt.length-1;Nt>=0;Nt--){var je=Mt[Nt],$e=je.datum;$e.offset=je.dp,$e.del=je.del}}}function U(H,ae){var ie=0,ve=H.offset;return ae&&(ve*=-w,ie=H.offset*_),{x:ie,y:ve}}function j(H){var ae={start:1,end:-1,middle:0}[H.anchor],ie=ae*(m+u),ve=ie+ae*(H.txwidth+u),Ae=H.anchor==="middle";return Ae&&(ie-=H.tx2width/2,ve+=H.txwidth/2+u),{alignShift:ae,textShiftX:ie,text2ShiftX:ve}}function Z(H,ae,ie,ve){var Ae=function(Fe){return Fe*ie},Ce=function(Fe){return Fe*ve};H.each(function(Fe){var ze=G.select(this);if(Fe.del)return ze.remove();var Ye=ze.select("text.nums"),it=Fe.anchor,st=it==="end"?-1:1,nt=j(Fe),Qe=U(Fe,ae),Le=Qe.x,Te=Qe.y,pe=it==="middle",Ne="hoverlabel"in Fe.trace?Fe.trace.hoverlabel.showarrow:!0,ot;pe?ot="M-"+Ae(Fe.bx/2+Fe.tx2width/2)+","+Ce(Te-Fe.by/2)+"h"+Ae(Fe.bx)+"v"+Ce(Fe.by)+"h-"+Ae(Fe.bx)+"Z":Ne?ot="M0,0L"+Ae(st*m+Le)+","+Ce(m+Te)+"v"+Ce(Fe.by/2-m)+"h"+Ae(st*Fe.bx)+"v-"+Ce(Fe.by)+"H"+Ae(st*m+Le)+"V"+Ce(Te-m)+"Z":ot="M"+Ae(st*m+Le)+","+Ce(Te-Fe.by/2)+"h"+Ae(st*Fe.bx)+"v"+Ce(Fe.by)+"h"+Ae(-st*Fe.bx)+"Z",ze.select("path").attr("d",ot);var ft=Le+nt.textShiftX,rt=Te+Fe.ty0-Fe.by/2+u,Ft=Fe.textAlign||"auto";Ft!=="auto"&&(Ft==="left"&&it!=="start"?(Ye.attr("text-anchor","start"),ft=pe?-Fe.bx/2-Fe.tx2width/2+u:-Fe.bx-u):Ft==="right"&&it!=="end"&&(Ye.attr("text-anchor","end"),ft=pe?Fe.bx/2-Fe.tx2width/2-u:Fe.bx+u)),Ye.call(o.positionText,Ae(ft),Ce(rt)),Fe.tx2width&&(ze.select("text.name").call(o.positionText,Ae(nt.text2ShiftX+nt.alignShift*u+Le),Ce(Te+Fe.ty0-Fe.by/2+u)),ze.select("rect").call(i.setRect,Ae(nt.text2ShiftX+(nt.alignShift-1)*Fe.tx2width/2+Le),Ce(Te-Fe.by/2-1),Ae(Fe.tx2width),Ce(Fe.by+2)))})}function re(H,ae){var ie=H.index,ve=H.trace||{},Ae=H.cd[0],Ce=H.cd[ie]||{};function Fe(Qe){return Qe||h(Qe)&&Qe===0}var ze=Array.isArray(ie)?function(Qe,Le){var Te=S.castOption(Ae,ie,Qe);return Fe(Te)?Te:S.extractOption({},ve,"",Le)}:function(Qe,Le){return S.extractOption(Ce,ve,Qe,Le)};function Ye(Qe,Le,Te){var pe=ze(Le,Te);Fe(pe)&&(H[Qe]=pe)}if(Ye("hoverinfo","hi","hoverinfo"),Ye("bgcolor","hbg","hoverlabel.bgcolor"),Ye("borderColor","hbc","hoverlabel.bordercolor"),Ye("fontFamily","htf","hoverlabel.font.family"),Ye("fontSize","hts","hoverlabel.font.size"),Ye("fontColor","htc","hoverlabel.font.color"),Ye("fontWeight","htw","hoverlabel.font.weight"),Ye("fontStyle","hty","hoverlabel.font.style"),Ye("fontVariant","htv","hoverlabel.font.variant"),Ye("nameLength","hnl","hoverlabel.namelength"),Ye("textAlign","hta","hoverlabel.align"),H.posref=ae==="y"||ae==="closest"&&ve.orientation==="h"?H.xa._offset+(H.x0+H.x1)/2:H.ya._offset+(H.y0+H.y1)/2,H.x0=S.constrain(H.x0,0,H.xa._length),H.x1=S.constrain(H.x1,0,H.xa._length),H.y0=S.constrain(H.y0,0,H.ya._length),H.y1=S.constrain(H.y1,0,H.ya._length),H.xLabelVal!==void 0&&(H.xLabel="xLabel"in H?H.xLabel:f.hoverLabelText(H.xa,H.xLabelVal,ve.xhoverformat),H.xVal=H.xa.c2d(H.xLabelVal)),H.yLabelVal!==void 0&&(H.yLabel="yLabel"in H?H.yLabel:f.hoverLabelText(H.ya,H.yLabelVal,ve.yhoverformat),H.yVal=H.ya.c2d(H.yLabelVal)),H.zLabelVal!==void 0&&H.zLabel===void 0&&(H.zLabel=String(H.zLabelVal)),!isNaN(H.xerr)&&!(H.xa.type==="log"&&H.xerr<=0)){var it=f.tickText(H.xa,H.xa.c2l(H.xerr),"hover").text;H.xerrneg!==void 0?H.xLabel+=" +"+it+" / -"+f.tickText(H.xa,H.xa.c2l(H.xerrneg),"hover").text:H.xLabel+=" ± "+it,ae==="x"&&(H.distance+=1)}if(!isNaN(H.yerr)&&!(H.ya.type==="log"&&H.yerr<=0)){var st=f.tickText(H.ya,H.ya.c2l(H.yerr),"hover").text;H.yerrneg!==void 0?H.yLabel+=" +"+st+" / -"+f.tickText(H.ya,H.ya.c2l(H.yerrneg),"hover").text:H.yLabel+=" ± "+st,ae==="y"&&(H.distance+=1)}var nt=H.hoverinfo||H.trace.hoverinfo;return nt&&nt!=="all"&&(nt=Array.isArray(nt)?nt:nt.split("+"),nt.indexOf("x")===-1&&(H.xLabel=void 0),nt.indexOf("y")===-1&&(H.yLabel=void 0),nt.indexOf("z")===-1&&(H.zLabel=void 0),nt.indexOf("text")===-1&&(H.text=void 0),nt.indexOf("name")===-1&&(H.name=void 0)),H}function fe(H,ae,ie){var ve=ie.container,Ae=ie.fullLayout,Ce=Ae._size,Fe=ie.event,ze=!!ae.hLinePoint,Ye=!!ae.vLinePoint,it,st;if(ve.selectAll(".spikeline").remove(),!!(Ye||ze)){var nt=a.combine(Ae.plot_bgcolor,Ae.paper_bgcolor);if(ze){var Qe=ae.hLinePoint,Le,Te;it=Qe&&Qe.xa,st=Qe&&Qe.ya;var pe=st.spikesnap;pe==="cursor"?(Le=Fe.pointerX,Te=Fe.pointerY):(Le=it._offset+Qe.x,Te=st._offset+Qe.y);var Ne=b.readability(Qe.color,nt)<1.5?a.contrast(nt):Qe.color,ot=st.spikemode,ft=st.spikethickness,rt=st.spikecolor||Ne,Ft=f.getPxPosition(H,st),Nt,$t;if(ot.indexOf("toaxis")!==-1||ot.indexOf("across")!==-1){if(ot.indexOf("toaxis")!==-1&&(Nt=Ft,$t=Le),ot.indexOf("across")!==-1){var rr=st._counterDomainMin,Er=st._counterDomainMax;st.anchor==="free"&&(rr=Math.min(rr,st.position),Er=Math.max(Er,st.position)),Nt=Ce.l+rr*Ce.w,$t=Ce.l+Er*Ce.w}ve.insert("line",":first-child").attr({x1:Nt,x2:$t,y1:Te,y2:Te,"stroke-width":ft,stroke:rt,"stroke-dasharray":i.dashStyle(st.spikedash,ft)}).classed("spikeline",!0).classed("crisp",!0),ve.insert("line",":first-child").attr({x1:Nt,x2:$t,y1:Te,y2:Te,"stroke-width":ft+2,stroke:nt}).classed("spikeline",!0).classed("crisp",!0)}ot.indexOf("marker")!==-1&&ve.insert("circle",":first-child").attr({cx:Ft+(st.side!=="right"?ft:-ft),cy:Te,r:ft,fill:rt}).classed("spikeline",!0)}if(Ye){var Mr=ae.vLinePoint,Wr,Sr;it=Mr&&Mr.xa,st=Mr&&Mr.ya;var Br=it.spikesnap;Br==="cursor"?(Wr=Fe.pointerX,Sr=Fe.pointerY):(Wr=it._offset+Mr.x,Sr=st._offset+Mr.y);var Mt=b.readability(Mr.color,nt)<1.5?a.contrast(nt):Mr.color,je=it.spikemode,$e=it.spikethickness,Ee=it.spikecolor||Mt,xe=f.getPxPosition(H,it),ye,Me;if(je.indexOf("toaxis")!==-1||je.indexOf("across")!==-1){if(je.indexOf("toaxis")!==-1&&(ye=xe,Me=Sr),je.indexOf("across")!==-1){var Xe=it._counterDomainMin,Je=it._counterDomainMax;it.anchor==="free"&&(Xe=Math.min(Xe,it.position),Je=Math.max(Je,it.position)),ye=Ce.t+(1-Je)*Ce.h,Me=Ce.t+(1-Xe)*Ce.h}ve.insert("line",":first-child").attr({x1:Wr,x2:Wr,y1:ye,y2:Me,"stroke-width":$e,stroke:Ee,"stroke-dasharray":i.dashStyle(it.spikedash,$e)}).classed("spikeline",!0).classed("crisp",!0),ve.insert("line",":first-child").attr({x1:Wr,x2:Wr,y1:ye,y2:Me,"stroke-width":$e+2,stroke:nt}).classed("spikeline",!0).classed("crisp",!0)}je.indexOf("marker")!==-1&&ve.insert("circle",":first-child").attr({cx:Wr,cy:xe-(it.side!=="top"?$e:-$e),r:$e,fill:Ee}).classed("spikeline",!0)}}}function le(H,ae,ie){if(!ie||ie.length!==H._hoverdata.length)return!0;for(var ve=ie.length-1;ve>=0;ve--){var Ae=ie[ve],Ce=H._hoverdata[ve];if(Ae.curveNumber!==Ce.curveNumber||String(Ae.pointNumber)!==String(Ce.pointNumber)||String(Ae.pointNumbers)!==String(Ce.pointNumbers)||Ae.binNumber!==Ce.binNumber)return!0}return!1}function ce(H,ae){return!0}function V(H,ae){return o.plainText(H||"",{len:ae,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function ee(H,ae){for(var ie=ae.charAt(0),ve=[],Ae=[],Ce=[],Fe=0;FeH.offsetTop+H.clientTop,ue=H=>H.offsetLeft+H.clientLeft;function te(H,ae){var ie=H._fullLayout,ve=ae.getBoundingClientRect(),Ae=ve.left,Ce=ve.top,Fe=Ae+ve.width,ze=Ce+ve.height,Ye=S.apply3DTransform(ie._invTransform)(Ae,Ce),it=S.apply3DTransform(ie._invTransform)(Fe,ze),st=Ye[0],nt=Ye[1],Qe=it[0],Le=it[1];return{x:st,y:nt,width:Qe-st,height:Le-nt,top:Math.min(nt,Le),left:Math.min(st,Qe),right:Math.max(st,Qe),bottom:Math.max(nt,Le)}}}}),fx=Ge({"src/components/fx/hoverlabel_defaults.js"($,G){var h=yn(),b=So(),S=Hv().isUnifiedHover;G.exports=function(e,t,r,o){o=o||{};var n=t.legend;function i(a){o.font[a]||(o.font[a]=n?t.legend.font[a]:t.font[a])}t&&S(t.hovermode)&&(o.font||(o.font={}),i("size"),i("family"),i("color"),i("weight"),i("style"),i("variant"),n?(o.bgcolor||(o.bgcolor=b.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),r("hoverlabel.showarrow",o.showarrow),h.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}}}),xM=Ge({"src/components/fx/layout_global_defaults.js"($,G){var h=yn(),b=fx(),S=Ju();G.exports=function(e,t){function r(o,n){return h.coerce(e,t,S,o,n)}b(e,t,r)}}}),bM=Ge({"src/components/fx/defaults.js"($,G){var h=yn(),b=td(),S=fx();G.exports=function(e,t,r,o){function n(a,s){return h.coerce(e,t,b,a,s)}var i=h.extendFlat({},o.hoverlabel);t.hovertemplate&&(i.namelength=-1),S(e,t,n,i)}}}),KT=Ge({"src/components/fx/hovermode_defaults.js"($,G){var h=yn(),b=Ju();G.exports=function(E,e){function t(r,o){return e[r]!==void 0?e[r]:h.coerce(E,e,b,r,o)}return t("clickmode"),t("hoversubplots"),t("hovermode")}}}),wM=Ge({"src/components/fx/layout_defaults.js"($,G){var h=yn(),b=Ju(),S=KT(),E=fx();G.exports=function(t,r){function o(p,d){return h.coerce(t,r,b,p,d)}var n=S(t,r);n&&(o("hoverdistance"),o("spikedistance"));var i=o("dragmode");i==="select"&&o("selectdirection");var a=r._has("mapbox"),s=r._has("map"),f=r._has("geo"),c=r._basePlotModules.length;r.dragmode==="zoom"&&((a||s||f)&&c===1||(a||s)&&f&&c===2)&&(r.dragmode="pan"),E(t,r,o),h.coerceFont(o,"hoverlabel.grouptitlefont",r.hoverlabel.font)}}}),Yw=Ge({"src/components/fx/calc.js"($,G){var h=yn(),b=Io();G.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(f){return function(c){return h.coerceHoverinfo({hoverinfo:c},{_module:f._module},r)}}for(var n=0;n"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),vx=Ge({"src/components/shapes/draw_newshape/constants.js"($,G){var h=32;G.exports={CIRCLE_SIDES:h,i000:0,i090:h/4,i180:h/2,i270:h/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),dx=Ge({"src/components/selections/helpers.js"($,G){var h=yn().strTranslate;function b(t,r){switch(t.type){case"log":return t.p2d(r);case"date":return t.p2r(r,0,t.calendar);default:return t.p2r(r)}}function S(t,r){switch(t.type){case"log":return t.d2p(r);case"date":return t.r2p(r,0,t.calendar);default:return t.r2p(r)}}function E(t){var r=t._id.charAt(0)==="y"?1:0;return function(o){return b(t,o[r])}}function e(t){return h(t.xaxis._offset,t.yaxis._offset)}G.exports={p2r:b,r2p:S,axValue:E,getTransform:e}}}),vp=Ge({"src/components/shapes/draw_newshape/helpers.js"($){var G=nm(),h=vx(),b=h.CIRCLE_SIDES,S=h.SQRT2,E=dx(),e=E.p2r,t=E.r2p,r=[0,3,4,5,6,1,2],o=[0,3,4,1,2];$.writePaths=function(a){var s=a.length;if(!s)return"M0,0Z";for(var f="",c=0;c0&&gl&&(x="X"),x});return c>l&&(g=g.replace(/[\s,]*X.*/,""),h.log("Ignoring extra params in segment "+f)),p+g})}function E(e,t){t=t||0;var r=0;return t&&e&&(e.type==="category"||e.type==="multicategory")&&(r=(e.r2p(1)-e.r2p(0))*t),r}}}),Ww=Ge({"src/components/shapes/display_labels.js"($,G){var h=yn(),b=Ss(),S=ec(),E=Ms(),e=vp().readPaths,t=om(),r=t.getPathString,o=rd(),n=ev().FROM_TL;G.exports=function(f,c,p,d){if(d.selectAll(".shape-label").remove(),!!(p.label.text||p.label.texttemplate)){var T;if(p.label.texttemplate){var l={};if(p.type!=="path"){var g=b.getFromId(f,p.xref),x=b.getFromId(f,p.yref);for(var A in o){var M=o[A](p,g,x);M!==void 0&&(l[A]=M)}}T=h.texttemplateStringForShapes({data:[l],fallback:p.label.texttemplatefallback,locale:f._fullLayout._d3locale,template:p.label.texttemplate})}else T=p.label.text;var _={"data-index":c},w=p.label.font,m={"data-notex":1},u=d.append("g").attr(_).classed("shape-label",!0),v=u.append("text").attr(m).classed("shape-label-text",!0).text(T),y,I,L,z;if(p.path){var F=r(f,p),N=e(F,f);y=1/0,L=1/0,I=-1/0,z=-1/0;for(var B=0;B=s?d=f-p:d=p-f,-180/Math.PI*Math.atan2(d,T)}function a(s,f,c,p,d,T,l){var g=d.label.textposition,x=d.label.textangle,A=d.label.padding,M=d.type,_=Math.PI/180*T,w=Math.sin(_),m=Math.cos(_),u=d.label.xanchor,v=d.label.yanchor,y,I,L,z;if(M==="line"){g==="start"?(y=s,I=f):g==="end"?(y=c,I=p):(y=(s+c)/2,I=(f+p)/2),u==="auto"&&(g==="start"?x==="auto"?c>s?u="left":cs?u="right":cs?u="right":cs?u="left":c1&&!(nt.length===2&&nt[1][0]==="Z")&&(V===0&&(nt[0][0]="M"),y[ce]=nt,N(),B())}}function ve(nt,Qe){if(nt===2){ce=+Qe.srcElement.getAttribute("data-i"),V=+Qe.srcElement.getAttribute("data-j");var Le=y[ce];!T(Le)&&!l(Le)&&ie()}}function Ae(nt){fe=[];for(var Qe=0;QeN&&Xe>B&&!xe.shiftKey?s.getCursor(Je/Me,1-Lt/Xe):"move";f(y,Ct),Nt=Ct.split("-")[0]}}function Mr(xe){l(v)||(R&&(ee=pe(I.xanchor)),U&&(ne=Ne(I.yanchor)),I.type==="path"?Ce=I.path:(fe=R?I.x0:pe(I.x0),le=U?I.y0:Ne(I.y0),ce=R?I.x1:pe(I.x1),V=U?I.y1:Ne(I.y1)),feV?(K=le,ae="y0",ue=V,ie="y1"):(K=V,ae="y1",ue=le,ie="y0"),Er(xe),je(z,I),Ee(y,I,v),Ft.moveFn=Nt==="move"?Br:Mt,Ft.altKey=xe.altKey)}function Wr(){l(v)||(f(y),$e(z),A(y,v,I),b.call("_guiRelayout",v,F.getUpdateObj()))}function Sr(){l(v)||$e(z)}function Br(xe,ye){if(I.type==="path"){var Me=function(Lt){return Lt},Xe=Me,Je=Me;R?re("xanchor",I.xanchor=ot(ee+xe)):(Xe=function(Ct){return ot(pe(Ct)+xe)},ze&&ze.type==="date"&&(Xe=p.encodeDate(Xe))),U?re("yanchor",I.yanchor=ft(ne+ye)):(Je=function(Ct){return ft(Ne(Ct)+ye)},it&&it.type==="date"&&(Je=p.encodeDate(Je))),re("path",I.path=_(Ce,Xe,Je))}else R?re("xanchor",I.xanchor=ot(ee+xe)):(re("x0",I.x0=ot(fe+xe)),re("x1",I.x1=ot(ce+xe))),U?re("yanchor",I.yanchor=ft(ne+ye)):(re("y0",I.y0=ft(le+ye)),re("y1",I.y1=ft(V+ye)));y.attr("d",d(v,I)),je(z,I),r(v,L,I,Fe)}function Mt(xe,ye){if(Z){var Me=function(Nn){return Nn},Xe=Me,Je=Me;R?re("xanchor",I.xanchor=ot(ee+xe)):(Xe=function(ka){return ot(pe(ka)+xe)},ze&&ze.type==="date"&&(Xe=p.encodeDate(Xe))),U?re("yanchor",I.yanchor=ft(ne+ye)):(Je=function(ka){return ft(Ne(ka)+ye)},it&&it.type==="date"&&(Je=p.encodeDate(Je))),re("path",I.path=_(Ce,Xe,Je))}else if(j){if(Nt==="resize-over-start-point"){var Lt=fe+xe,Ct=U?le-ye:le+ye;re("x0",I.x0=R?Lt:ot(Lt)),re("y0",I.y0=U?Ct:ft(Ct))}else if(Nt==="resize-over-end-point"){var Ot=ce+xe,Wt=U?V-ye:V+ye;re("x1",I.x1=R?Ot:ot(Ot)),re("y1",I.y1=U?Wt:ft(Wt))}}else{var _r=function(Nn){return Nt.indexOf(Nn)!==-1},pr=_r("n"),hr=_r("s"),Fr=_r("w"),En=_r("e"),Kn=pr?K+ye:K,qn=hr?ue+ye:ue,ta=Fr?te+xe:te,ra=En?H+xe:H;U&&(pr&&(Kn=K-ye),hr&&(qn=ue-ye)),(!U&&qn-Kn>B||U&&Kn-qn>B)&&(re(ae,I[ae]=U?Kn:ft(Kn)),re(ie,I[ie]=U?qn:ft(qn))),ra-ta>N&&(re(ve,I[ve]=R?ta:ot(ta)),re(Ae,I[Ae]=R?ra:ot(ra)))}y.attr("d",d(v,I)),je(z,I),r(v,L,I,Fe)}function je(xe,ye){(R||U)&&Me();function Me(){var Xe=ye.type!=="path",Je=xe.selectAll(".visual-cue").data([0]),Lt=1;Je.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":Lt}).classed("visual-cue",!0);var Ct=pe(R?ye.xanchor:S.midRange(Xe?[ye.x0,ye.x1]:p.extractPathCoords(ye.path,c.paramIsX))),Ot=Ne(U?ye.yanchor:S.midRange(Xe?[ye.y0,ye.y1]:p.extractPathCoords(ye.path,c.paramIsY)));if(Ct=p.roundPositionForSharpStrokeRendering(Ct,Lt),Ot=p.roundPositionForSharpStrokeRendering(Ot,Lt),R&&U){var Wt="M"+(Ct-1-Lt)+","+(Ot-1-Lt)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Je.attr("d",Wt)}else if(R){var _r="M"+(Ct-1-Lt)+","+(Ot-9-Lt)+"v18 h2 v-18 Z";Je.attr("d",_r)}else{var pr="M"+(Ct-9-Lt)+","+(Ot-1-Lt)+"h18 v2 h-18 Z";Je.attr("d",pr)}}}function $e(xe){xe.selectAll(".visual-cue").remove()}function Ee(xe,ye,Me){var Xe=ye.xref,Je=ye.yref,Lt=E.getFromId(Me,Xe),Ct=E.getFromId(Me,Je),Ot="";Xe!=="paper"&&!Lt.autorange&&(Ot+=Xe),Je!=="paper"&&!Ct.autorange&&(Ot+=Je),i.setClipUrl(xe,Ot?"clip"+Me._fullLayout._uid+Ot:null,Me)}}function _(v,y,I){return v.replace(c.segmentRE,function(L){var z=0,F=L.charAt(0),N=c.paramIsX[F],B=c.paramIsY[F],R=c.numParams[F],U=L.slice(1).replace(c.paramRE,function(j){return z>=R||(N[z]?j=y(j):B[z]&&(j=I(j)),z++),j});return F+U})}function w(v,y){if(g(v)){var I=y.node(),L=+I.getAttribute("data-index");if(L>=0){if(L===v._fullLayout._activeShapeIndex){m(v);return}v._fullLayout._activeShapeIndex=L,v._fullLayout._deactivateShape=m,T(v)}}}function m(v){if(g(v)){var y=v._fullLayout._activeShapeIndex;y>=0&&(o(v),delete v._fullLayout._activeShapeIndex,T(v))}}function u(v){if(g(v)){o(v);var y=v._fullLayout._activeShapeIndex,I=(v.layout||{}).shapes||[];if(y1?(le=["toggleHover"],ce=["resetViews"]):u?(fe=["zoomInGeo","zoomOutGeo"],le=["hoverClosestGeo"],ce=["resetGeo"]):m?(le=["hoverClosest3d"],ce=["resetCameraDefault3d","resetCameraLastSave3d"]):L?(fe=["zoomInMapbox","zoomOutMapbox"],le=["toggleHover"],ce=["resetViewMapbox"]):z?(fe=["zoomInMap","zoomOutMap"],le=["toggleHover"],ce=["resetViewMap"]):v?le=["hoverClosestPie"]:B?(le=["hoverClosestCartesian","hoverCompareCartesian"],ce=["resetViewSankey"]):le=["toggleHover"],w&&le.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||U)&&(le=[]),w&&!R&&(fe=["zoomIn2d","zoomOut2d","autoScale2d"],ce[0]!=="resetViews"&&(ce=["resetScale2d"])),m?V=["zoom3d","pan3d","orbitRotation","tableRotation"]:w&&!R||I?V=["zoom2d","pan2d"]:L||z||u?V=["pan2d"]:F&&(V=["zoom2d"]),a(T)&&V.push("select2d","lasso2d");var ee=[],ne=function(H){ee.indexOf(H)===-1&&le.indexOf(H)!==-1&&ee.push(H)};if(Array.isArray(M)){for(var K=[],ue=0;uex?T.slice(x):l.slice(g))+A}function f(p,d){for(var T=d._size,l=T.h/T.w,g={},x=Object.keys(p),A=0;At*I&&!N)){for(x=0;xV&&iele&&(le=ie);var Ae=(le-fe)/(2*ce);u/=Ae,fe=_.l2r(fe),le=_.l2r(le),_.range=_._input.range=j=B[1]||Z[1]<=B[0])&&re[0]R[0])return!0}return!1}function A(B){var R=B._fullLayout,U=R._size,j=U.p,Z=i.list(B,"",!0),re,fe,le,ce,V,ee;if(R._paperdiv.style({width:B._context.responsive&&R.autosize&&!B._context._hasZeroWidth&&!B.layout.width?"100%":R.width+"px",height:B._context.responsive&&R.autosize&&!B._context._hasZeroHeight&&!B.layout.height?"100%":R.height+"px"}).selectAll(".main-svg").call(r.setSize,R.width,R.height),B._context.setBackground(B,R.paper_bgcolor),$.drawMainTitle(B),n.manage(B),!R._has("cartesian"))return b.previousPromises(B);function ne(Ee,xe,ye){var Me=Ee._lw/2;if(Ee._id.charAt(0)==="x"){if(xe){if(ye==="top")return xe._offset-j-Me}else return U.t+U.h*(1-(Ee.position||0))+Me%1;return xe._offset+xe._length+j+Me}if(xe){if(ye==="right")return xe._offset+xe._length+j+Me}else return U.l+U.w*(Ee.position||0)+Me%1;return xe._offset-j-Me}for(re=0;re0){y(B,re,V,ce),le.attr({x:fe,y:re,"text-anchor":j,dy:z(R.yanchor)}).call(E.positionText,fe,re);var ee=(R.text.match(E.BR_TAG_ALL)||[]).length;if(ee){var ne=a.LINE_SPACING*ee+a.MID_SHIFT;R.y===0&&(ne=-ne),le.selectAll(".line").each(function(){var ae=+this.getAttribute("dy").slice(0,-2)-ne+"em";this.setAttribute("dy",ae)})}var K=G.select(B).selectAll(".gtitle-subtitle");if(K.node()){var ue=le.node().getBBox(),te=ue.y+ue.height,H=te+o.SUBTITLE_PADDING_EM*R.subtitle.font.size;K.attr({x:fe,y:H,"text-anchor":j,dy:z(R.yanchor)}).call(E.positionText,fe,H)}}}};function m(B,R,U,j,Z){var re=R.yref==="paper"?B._fullLayout._size.h:B._fullLayout.height,fe=S.isTopAnchor(R)?j:j-Z,le=U==="b"?re-fe:fe;return S.isTopAnchor(R)&&U==="t"||S.isBottomAnchor(R)&&U==="b"?!1:le.5?"t":"b",fe=B._fullLayout.margin[re],le=0;return R.yref==="paper"?le=U+R.pad.t+R.pad.b:R.yref==="container"&&(le=u(re,j,Z,B._fullLayout.height,U)+R.pad.t+R.pad.b),le>fe?le:0}function y(B,R,U,j){var Z="title.automargin",re=B._fullLayout.title,fe=re.y>.5?"t":"b",le={x:re.x,y:re.y,t:0,b:0},ce={};re.yref==="paper"&&m(B,re,fe,R,j)?le[fe]=U:re.yref==="container"&&(ce[fe]=U,B._fullLayout._reservedMargin[Z]=ce),b.allowAutoMargin(B,Z),b.autoMargin(B,Z,le)}function I(B,R){var U=B.title,j=B._size,Z=0;return R===d?Z=U.pad.l:R===l&&(Z=-U.pad.r),U.xref==="paper"?j.l+j.w*U.x+Z:B.width*U.x+Z}function L(B,R){var U=B.title,j=B._size,Z=0;return R==="0em"||!R?Z=-U.pad.b:R===a.CAP_SHIFT+"em"&&(Z=U.pad.t),U.y==="auto"?j.t/2:U.yref==="paper"?j.t+j.h-j.h*U.y+Z:B.height-B.height*U.y+Z}function z(B){return B==="top"?a.CAP_SHIFT+.3+"em":B==="bottom"?"-0.3em":a.MID_SHIFT+"em"}function F(B){var R=B.title,U=T;return S.isRightAnchor(R)?U=l:S.isLeftAnchor(R)&&(U=d),U}function N(B){var R=B.title,U="0em";return S.isTopAnchor(R)?U=a.CAP_SHIFT+"em":S.isMiddleAnchor(R)&&(U=a.MID_SHIFT+"em"),U}$.doTraceStyle=function(B){var R=B.calcdata,U=[],j;for(j=0;j=0;F--){var N=M.append("path").attr(w).style("opacity",F?.1:m).call(E.stroke,v).call(E.fill,u).call(e.dashLine,F?"solid":I,F?4+y:y);if(s(N,d,g),L){var B=t(d.layout,"selections",g);N.style({cursor:"move"});var R={element:N.node(),plotinfo:x,gd:d,editHelpers:B,isActiveSelection:!0},U=h(_,d);b(U,N,R)}else N.style("pointer-events",F?"all":"none");z[F]=N}var j=z[0],Z=z[1];Z.node().addEventListener("click",function(){return f(d,j)})}}function s(d,T,l){var g=l.xref+l.yref;e.setClipUrl(d,"clip"+T._fullLayout._uid+g,T)}function f(d,T){if(i(d)){var l=T.node(),g=+l.getAttribute("data-index");if(g>=0){if(g===d._fullLayout._activeSelectionIndex){p(d);return}d._fullLayout._activeSelectionIndex=g,d._fullLayout._deactivateSelection=p,n(d)}}}function c(d){if(i(d)){var T=d._fullLayout.selections.length-1;d._fullLayout._activeSelectionIndex=T,d._fullLayout._deactivateSelection=p,n(d)}}function p(d){if(i(d)){var T=d._fullLayout._activeSelectionIndex;T>=0&&(S(d),delete d._fullLayout._activeSelectionIndex,n(d))}}}}),TM=Ge({"node_modules/polybooljs/lib/build-log.js"($,G){function h(){var b,S=0,E=!1;function e(t,r){return b.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),b}return b={list:[],segmentId:function(){return S++},checkIntersection:function(t,r){return e("check",{seg1:t,seg2:r})},segmentChop:function(t,r){return e("div_seg",{seg:t,pt:r}),e("chop",{seg:t,pt:r})},statusRemove:function(t){return e("pop_seg",{seg:t})},segmentUpdate:function(t){return e("seg_update",{seg:t})},segmentNew:function(t,r){return e("new_seg",{seg:t,primary:r})},segmentRemove:function(t){return e("rem_seg",{seg:t})},tempStatus:function(t,r,o){return e("temp_status",{seg:t,above:r,below:o})},rewind:function(t){return e("rewind",{seg:t})},status:function(t,r,o){return e("status",{seg:t,above:r,below:o})},vert:function(t){return t===E?b:(E=t,e("vert",{x:t}))},log:function(t){return typeof t!="string"&&(t=JSON.stringify(t,!1," ")),e("log",{txt:t})},reset:function(){return e("reset")},selected:function(t){return e("selected",{segs:t})},chainStart:function(t){return e("chain_start",{seg:t})},chainRemoveHead:function(t,r){return e("chain_rem_head",{index:t,pt:r})},chainRemoveTail:function(t,r){return e("chain_rem_tail",{index:t,pt:r})},chainNew:function(t,r){return e("chain_new",{pt1:t,pt2:r})},chainMatch:function(t){return e("chain_match",{index:t})},chainClose:function(t){return e("chain_close",{index:t})},chainAddHead:function(t,r){return e("chain_add_head",{index:t,pt:r})},chainAddTail:function(t,r){return e("chain_add_tail",{index:t,pt:r})},chainConnect:function(t,r){return e("chain_con",{index1:t,index2:r})},chainReverse:function(t){return e("chain_rev",{index:t})},chainJoin:function(t,r){return e("chain_join",{index1:t,index2:r})},done:function(){return e("done")}},b}G.exports=h}}),AM=Ge({"node_modules/polybooljs/lib/epsilon.js"($,G){function h(b){typeof b!="number"&&(b=1e-10);var S={epsilon:function(E){return typeof E=="number"&&(b=E),b},pointAboveOrOnLine:function(E,e,t){var r=e[0],o=e[1],n=t[0],i=t[1],a=E[0],s=E[1];return(n-r)*(s-o)-(i-o)*(a-r)>=-b},pointBetween:function(E,e,t){var r=E[1]-e[1],o=t[0]-e[0],n=E[0]-e[0],i=t[1]-e[1],a=n*o+r*i;if(a-b)},pointsSameX:function(E,e){return Math.abs(E[0]-e[0])b!=n-r>b&&(o-s)*(r-f)/(n-f)+s-t>b&&(i=!i),o=s,n=f}return i}};return S}G.exports=h}}),SM=Ge({"node_modules/polybooljs/lib/linked-list.js"($,G){var h={create:function(){var b={root:{root:!0,next:null},exists:function(S){return!(S===null||S===b.root)},isEmpty:function(){return b.root.next===null},getHead:function(){return b.root.next},insertBefore:function(S,E){for(var e=b.root,t=b.root.next;t!==null;){if(E(t)){S.prev=t.prev,S.next=t,t.prev.next=S,t.prev=S;return}e=t,t=t.next}e.next=S,S.prev=e,S.next=null},findTransition:function(S){for(var E=b.root,e=b.root.next;e!==null&&!S(e);)E=e,e=e.next;return{before:E===b.root?null:E,after:e,insert:function(t){return t.prev=E,t.next=e,E.next=t,e!==null&&(e.prev=t),t}}}};return b},node:function(b){return b.prev=null,b.next=null,b.remove=function(){b.prev.next=b.next,b.next&&(b.next.prev=b.prev),b.prev=null,b.next=null},b}};G.exports=h}}),$d=Ge({"node_modules/polybooljs/lib/intersecter.js"($,G){var h=SM();function b(S,E,e){function t(T,l){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:null,below:null},otherFill:null}}function r(T,l,g){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:g.myFill.above,below:g.myFill.below},otherFill:null}}var o=h.create();function n(T,l,g,x,A,M){var _=E.pointsCompare(l,A);return _!==0?_:E.pointsSame(g,M)?0:T!==x?T?1:-1:E.pointAboveOrOnLine(g,x?A:M,x?M:A)?1:-1}function i(T,l){o.insertBefore(T,function(g){var x=n(T.isStart,T.pt,l,g.isStart,g.pt,g.other.pt);return x<0})}function a(T,l){var g=h.node({isStart:!0,pt:T.start,seg:T,primary:l,other:null,status:null});return i(g,T.end),g}function s(T,l,g){var x=h.node({isStart:!1,pt:l.end,seg:l,primary:g,other:T,status:null});T.other=x,i(x,T.pt)}function f(T,l){var g=a(T,l);return s(g,T,l),g}function c(T,l){e&&e.segmentChop(T.seg,l),T.other.remove(),T.seg.end=l,T.other.pt=l,i(T.other,T.pt)}function p(T,l){var g=r(l,T.seg.end,T.seg);return c(T,l),f(g,T.primary)}function d(T,l){var g=h.create();function x(N,B){var R=N.seg.start,U=N.seg.end,j=B.seg.start,Z=B.seg.end;return E.pointsCollinear(R,j,Z)?E.pointsCollinear(U,j,Z)||E.pointAboveOrOnLine(U,j,Z)?1:-1:E.pointAboveOrOnLine(R,j,Z)?1:-1}function A(N){return g.findTransition(function(B){var R=x(N,B.ev);return R>0})}function M(N,B){var R=N.seg,U=B.seg,j=R.start,Z=R.end,re=U.start,fe=U.end;e&&e.checkIntersection(R,U);var le=E.linesIntersect(j,Z,re,fe);if(le===!1){if(!E.pointsCollinear(j,Z,re)||E.pointsSame(j,fe)||E.pointsSame(Z,re))return!1;var ce=E.pointsSame(j,re),V=E.pointsSame(Z,fe);if(ce&&V)return B;var ee=!ce&&E.pointBetween(j,re,fe),ne=!V&&E.pointBetween(Z,re,fe);if(ce)return ne?p(B,Z):p(N,fe),B;ee&&(V||(ne?p(B,Z):p(N,fe)),p(B,j))}else le.alongA===0&&(le.alongB===-1?p(N,re):le.alongB===0?p(N,le.pt):le.alongB===1&&p(N,fe)),le.alongB===0&&(le.alongA===-1?p(B,j):le.alongA===0?p(B,le.pt):le.alongA===1&&p(B,Z));return!1}for(var _=[];!o.isEmpty();){var w=o.getHead();if(e&&e.vert(w.pt[0]),w.isStart){let N=function(){if(u){var B=M(w,u);if(B)return B}return v?M(w,v):!1};e&&e.segmentNew(w.seg,w.primary);var m=A(w),u=m.before?m.before.ev:null,v=m.after?m.after.ev:null;e&&e.tempStatus(w.seg,u?u.seg:!1,v?v.seg:!1);var y=N();if(y){if(S){var I;w.seg.myFill.below===null?I=!0:I=w.seg.myFill.above!==w.seg.myFill.below,I&&(y.seg.myFill.above=!y.seg.myFill.above)}else y.seg.otherFill=w.seg.myFill;e&&e.segmentUpdate(y.seg),w.other.remove(),w.remove()}if(o.getHead()!==w){e&&e.rewind(w.seg);continue}if(S){var I;w.seg.myFill.below===null?I=!0:I=w.seg.myFill.above!==w.seg.myFill.below,v?w.seg.myFill.below=v.seg.myFill.above:w.seg.myFill.below=T,I?w.seg.myFill.above=!w.seg.myFill.below:w.seg.myFill.above=w.seg.myFill.below}else if(w.seg.otherFill===null){var L;v?w.primary===v.primary?L=v.seg.otherFill.above:L=v.seg.myFill.above:L=w.primary?l:T,w.seg.otherFill={above:L,below:L}}e&&e.status(w.seg,u?u.seg:!1,v?v.seg:!1),w.other.status=m.insert(h.node({ev:w}))}else{var z=w.status;if(z===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(g.exists(z.prev)&&g.exists(z.next)&&M(z.prev.ev,z.next.ev),e&&e.statusRemove(z.ev.seg),z.remove(),!w.primary){var F=w.seg.myFill;w.seg.myFill=w.seg.otherFill,w.seg.otherFill=F}_.push(w.seg)}o.getHead().remove()}return e&&e.done(),_}return S?{addRegion:function(T){for(var l,g=T[T.length-1],x=0;xr!=p>r&&t<(c-s)*(r-f)/(p-f)+s;d&&(o=!o)}return o}}}),Qg=Ge({"src/lib/polygon.js"($,G){var h=ax().dot,b=hi().BADNUM,S=G.exports={};S.tester=function(e){var t=e.slice(),r=t[0][0],o=r,n=t[0][1],i=n,a;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),a=1;ao||A===b||Ai||g&&f(l))}function p(l,g){var x=l[0],A=l[1];if(x===b||xo||A===b||Ai)return!1;var M=t.length,_=t[0][0],w=t[0][1],m=0,u,v,y,I,L;for(u=1;uMath.max(v,_)||A>Math.max(y,w)))if(Aa||Math.abs(h(p,f))>o)return!0;return!1},S.filter=function(e,t){var r=[e[0]],o=0,n=0;function i(s){e.push(s);var f=r.length,c=o;r.splice(n+1);for(var p=c+1;p1){var a=e.pop();i(a)}return{addPt:i,raw:e,filtered:r}}}}),MM=Ge({"src/components/selections/constants.js"($,G){G.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),ey=Ge({"src/components/selections/select.js"($,G){var h=n5(),b=a5(),S=Io(),E=Ms().dashStyle,e=So(),t=qf(),r=Hv().makeEventData,o=Dp(),n=o.freeMode,i=o.rectMode,a=o.drawMode,s=o.openMode,f=o.selectMode,c=om(),p=px(),d=tg(),T=tm().clearOutline,l=vp(),g=l.handleEllipse,x=l.readPaths,A=Zw().newShapes,M=$T(),_=e5().activateLastSelection,w=yn(),m=w.sorterAsc,u=Qg(),v=k0(),y=Lf().getFromId,I=A1(),L=mx().redrawReglTraces,z=MM(),F=z.MINSELECT,N=u.filter,B=u.tester,R=dx(),U=R.p2r,j=R.axValue,Z=R.getTransform;function re(je){return je.subplot!==void 0}function fe(je,$e,Ee,xe,ye){var Me=!re(xe),Xe=n(ye),Je=i(ye),Lt=s(ye),Ct=a(ye),Ot=f(ye),Wt=ye==="drawline",_r=ye==="drawcircle",pr=Wt||_r,hr=xe.gd,Fr=hr._fullLayout,En=Ot&&Fr.newselection.mode==="immediate"&&Me,Kn=Fr._zoomlayer,qn=xe.element.getBoundingClientRect(),ta=xe.plotinfo,ra=Z(ta),Nn=$e-qn.left,ka=Ee-qn.top;Fr._calcInverseTransform(hr);var qa=w.apply3DTransform(Fr._invTransform)(Nn,ka);Nn=qa[0],ka=qa[1];var ir=Fr._invScaleX,qt=Fr._invScaleY,ar=Nn,lr=ka,Vr="M"+Nn+","+ka,sn=xe.xaxes[0],mn=xe.yaxes[0],wn=sn._length,Jn=mn._length,pa=je.altKey&&!(a(ye)&&Lt),ha,_a,Ca,Vn,yi,Ci,Dt;K(je,hr,xe),Xe&&(ha=N([[Nn,ka]],z.BENDPX));var yt=Kn.selectAll("path.select-outline-"+ta.id).data([1]),kr=Ct?Fr.newshape:Fr.newselection;Ct&&(xe.hasText=kr.label.text||kr.label.texttemplate);var Nr=Ct&&!Lt?kr.fillcolor:"rgba(0,0,0,0)",jr=kr.line.color||(Me?e.contrast(hr._fullLayout.plot_bgcolor):"#7f7f7f");yt.enter().append("path").attr("class","select-outline select-outline-"+ta.id).style({opacity:Ct?kr.opacity/2:1,"stroke-dasharray":E(kr.line.dash,kr.line.width),"stroke-width":kr.line.width+"px","shape-rendering":"crispEdges"}).call(e.stroke,jr).call(e.fill,Nr).attr("fill-rule","evenodd").classed("cursor-move",!!Ct).attr("transform",ra).attr("d",Vr+"Z");var Ir=Kn.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",ra).attr("d","M0,0Z");if(Ct&&xe.hasText){var Ur=Kn.select(".label-temp");Ur.empty()&&(Ur=Kn.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var ln=Fr._uid+z.SELECTID,$r=[],At=ie(hr,xe.xaxes,xe.yaxes,xe.subplot);En&&!je.shiftKey&&(xe._clearSubplotSelections=function(){if(Me){var Dr=sn._id,un=mn._id;ft(hr,Dr,un,At);for(var Rn=(hr.layout||{}).selections||[],jn=[],Un=!1,cn=0;cn=0){hr._fullLayout._deactivateShape(hr);return}if(!Ct){var Rn=Fr.clickmode;v.done(ln).then(function(){if(v.clear(ln),Dr===2){for(yt.remove(),yi=0;yi-1&&le(un,hr,xe.xaxes,xe.yaxes,xe.subplot,xe,yt),Rn==="event"&&Br(hr,void 0);t.click(hr,un,ta.id)}).catch(w.error)}},xe.doneFn=function(){Ir.remove(),v.done(ln).then(function(){v.clear(ln),!En&&Vn&&xe.selectionDefs&&(Vn.subtract=pa,xe.selectionDefs.push(Vn),xe.mergedPolygons.length=0,[].push.apply(xe.mergedPolygons,Ca)),(En||Ct)&&H(xe,En),xe.doneFnCompleted&&xe.doneFnCompleted($r),Ot&&Br(hr,Dt)}).catch(w.error)}}function le(je,$e,Ee,xe,ye,Me,Xe){var Je=$e._hoverdata,Lt=$e._fullLayout,Ct=Lt.clickmode,Ot=Ct.indexOf("event")>-1,Wt=[],_r,pr,hr,Fr,En,Kn,qn,ta,ra,Nn;if(Ae(Je)){K(je,$e,Me),_r=ie($e,Ee,xe,ye);var ka=Ce(Je,_r),qa=ka.pointNumbers.length>0;if(qa?ze(_r,ka):Ye(_r)&&(qn=Fe(ka))){for(Xe&&Xe.remove(),Nn=0;Nn<_r.length;Nn++)pr=_r[Nn],pr._module.selectPoints(pr,!1);it($e,_r),H(Me),Ot&&Mt($e)}else{ta=je.shiftKey&&(qn!==void 0?qn:Fe(ka)),hr=ce(ka.pointNumber,ka.searchInfo,ta);var ir=Me.selectionDefs.concat([hr]);for(Fr=ne(ir),Nn=0;Nn<_r.length;Nn++)if(En=_r[Nn]._module.selectPoints(_r[Nn],Fr),Kn=Qe(En,_r[Nn]),Wt.length)for(var qt=0;qt=0}function te(je){return je._fullLayout._activeSelectionIndex>=0}function H(je,$e){var Ee=je.dragmode,xe=je.plotinfo,ye=je.gd;ue(ye)&&ye._fullLayout._deactivateShape(ye),te(ye)&&ye._fullLayout._deactivateSelection(ye);var Me=ye._fullLayout,Xe=Me._zoomlayer,Je=a(Ee),Lt=f(Ee);if(Je||Lt){var Ct=Xe.selectAll(".select-outline-"+xe.id);if(Ct&&ye._fullLayout._outlining){var Ot;Je&&(Ot=A(Ct,je)),Ot&&S.call("_guiRelayout",ye,{shapes:Ot});var Wt;Lt&&!re(je)&&(Wt=M(Ct,je)),Wt&&(ye._fullLayout._noEmitSelectedAtStart=!0,S.call("_guiRelayout",ye,{selections:Wt}).then(function(){$e&&_(ye)})),ye._fullLayout._outlining=!1}}xe.selection={},xe.selection.selectionDefs=je.selectionDefs=[],xe.selection.mergedPolygons=je.mergedPolygons=[]}function ae(je){return je._id}function ie(je,$e,Ee,xe){if(!je.calcdata)return[];var ye=[],Me=$e.map(ae),Xe=Ee.map(ae),Je,Lt,Ct;for(Ct=0;Ct0,Me=ye?xe[0]:Ee;return $e.selectedpoints?$e.selectedpoints.indexOf(Me)>-1:!1}function ze(je,$e){var Ee=[],xe,ye,Me,Xe;for(Xe=0;Xe0&&Ee.push(xe);if(Ee.length===1&&(Me=Ee[0]===$e.searchInfo,Me&&(ye=$e.searchInfo.cd[0].trace,ye.selectedpoints.length===$e.pointNumbers.length))){for(Xe=0;Xe<$e.pointNumbers.length;Xe++)if(ye.selectedpoints.indexOf($e.pointNumbers[Xe])<0)return!1;return!0}return!1}function Ye(je){var $e=0,Ee,xe,ye;for(ye=0;ye1||($e+=xe.selectedpoints.length,$e>1)))return!1;return $e===1}function it(je,$e,Ee){var xe;for(xe=0;xe<$e.length;xe++){var ye=$e[xe].cd[0].trace._fullInput,Me=je._fullLayout._tracePreGUI[ye.uid]||{};Me.selectedpoints===void 0&&(Me.selectedpoints=ye._input.selectedpoints||null)}var Xe;if(Ee){var Je=Ee.points||[];for(xe=0;xe<$e.length;xe++)Xe=$e[xe].cd[0].trace,Xe._input.selectedpoints=Xe._fullInput.selectedpoints=[],Xe._fullInput!==Xe&&(Xe.selectedpoints=[]);for(var Lt=0;Lt-1&&$e;if(!Xe&&$e){var Dr=Ft(je,!0);if(Dr.length){var un=Dr[0].xref,Rn=Dr[0].yref;if(un&&Rn){var jn=rr(Dr),Un=Mr([y(je,un,"x"),y(je,Rn,"y")]);Un($r,jn)}}je._fullLayout._noEmitSelectedAtStart?je._fullLayout._noEmitSelectedAtStart=!1:or&&Br(je,$r),_r._reselect=!1}if(!Xe&&_r._deselect){var cn=_r._deselect;Je=cn.xref,Lt=cn.yref,ot(Je,Lt,Ot)||ft(je,Je,Lt,xe),or&&($r.points.length?Br(je,$r):Mt(je)),_r._deselect=!1}return{eventData:$r,selectionTesters:Ee}}function Ne(je){var $e=je.calcdata;if($e)for(var Ee=0;Ee<$e.length;Ee++){var xe=$e[Ee][0],ye=xe.trace,Me=je._fullLayout._splomScenes;if(Me){var Xe=Me[ye.uid];Xe&&(Xe.selectBatch=[])}}}function ot(je,$e,Ee){for(var xe=0;xe=0){Nr._fullLayout._deactivateShape(Nr);return}var jr=Nr._fullLayout.clickmode;if(ee(Nr),yt===2&&!Le&&_a(),Qe)jr.indexOf("select")>-1&&m(kr,Nr,ft,rt,Ae.id,Ot),jr.indexOf("event")>-1&&a.click(Nr,kr,Ae.id);else if(yt===1&&Le){var Ir=it?pe:Te,Ur=it==="s"||st==="w"?0:1,ln=Ir._name+".range["+Ur+"]",$r=R(Ir,Ur),At="left",or="middle";if(Ir.fixedrange)return;it?(or=it==="n"?"top":"bottom",Ir.side==="right"&&(At="right")):st==="e"&&(At="right"),Nr._context.showAxisRangeEntryBoxes&&h.select(Ct).call(o.makeEditable,{gd:Nr,immediate:!0,background:Nr._fullLayout.paper_bgcolor,text:String($r),fill:Ir.tickfont?Ir.tickfont.color:"#444",horizontalAlign:At,verticalAlign:or}).on("edit",function(Dr){var un=Ir.d2r(Dr);un!==void 0&&t.call("_guiRelayout",Nr,ln,un)})}}c.init(Ot);var pr,hr,Fr,En,Kn,qn,ta,ra,Nn,ka;function qa(yt,kr,Nr){var jr=Ct.getBoundingClientRect();pr=kr-jr.left,hr=Nr-jr.top,ve._fullLayout._calcInverseTransform(ve);var Ir=b.apply3DTransform(ve._fullLayout._invTransform)(pr,hr);pr=Ir[0],hr=Ir[1],Fr={l:pr,r:pr,w:0,t:hr,b:hr,h:0},En=ve._hmpixcount?ve._hmlumcount/ve._hmpixcount:E(ve._fullLayout.plot_bgcolor).getLuminance(),Kn="M0,0H"+$t+"V"+rr+"H0V0",qn=!1,ta="xy",ka=!1,ra=fe(nt,En,Ft,Nt,Kn),Nn=le(nt,Ft,Nt)}function ir(yt,kr){if(ve._transitioningWithDuration)return!1;var Nr=Math.max(0,Math.min($t,Me*yt+pr)),jr=Math.max(0,Math.min(rr,Xe*kr+hr)),Ir=Math.abs(Nr-pr),Ur=Math.abs(jr-hr);Fr.l=Math.min(pr,Nr),Fr.r=Math.max(pr,Nr),Fr.t=Math.min(hr,jr),Fr.b=Math.max(hr,jr);function ln(){ta="",Fr.r=Fr.l,Fr.t=Fr.b,Nn.attr("d","M0,0Z")}if(Er.isSubplotConstrained)Ir>I||Ur>I?(ta="xy",Ir/$t>Ur/rr?(Ur=Ir*rr/$t,hr>jr?Fr.t=hr-Ur:Fr.b=hr+Ur):(Ir=Ur*$t/rr,pr>Nr?Fr.l=pr-Ir:Fr.r=pr+Ir),Nn.attr("d",te(Fr))):ln();else if(Mr.isSubplotConstrained)if(Ir>I||Ur>I){ta="xy";var $r=Math.min(Fr.l/$t,(rr-Fr.b)/rr),At=Math.max(Fr.r/$t,(rr-Fr.t)/rr);Fr.l=$r*$t,Fr.r=At*$t,Fr.b=(1-$r)*rr,Fr.t=(1-At)*rr,Nn.attr("d",te(Fr))}else ln();else!Sr||Ur0){var Dr;if(Mr.isSubplotConstrained||!Wr&&Sr.length===1){for(Dr=0;Dr1&&(ln.maxallowed!==void 0&&Mt===(ln.range[0]1&&($r.maxallowed!==void 0&&je===($r.range[0]<$r.range[1]?"n":"s")||$r.minallowed!==void 0&&je===($r.range[0]<$r.range[1]?"s":"n"))&&(cn=1,xi=0),!(!Un&&!cn)){Un||(Un=1),cn||(cn=1);var Ea=ln._offset-In/Un,Pi=$r._offset-xi/cn;Ur.clipRect.call(i.setTranslate,In,xi).call(i.setScale,Un,cn),Ur.plot.call(i.setTranslate,Ea,Pi).call(i.setScale,1/Un,1/cn),(Un!==Ur.xScaleFactor||cn!==Ur.yScaleFactor)&&(i.setPointGroupScale(Ur.zoomScalePts,Un,cn),i.setTextPointsScale(Ur.zoomScaleTxt,Un,cn)),i.hideOutsideRangePoints(Ur.clipOnAxisFalseTraces,Ur),Ur.xScaleFactor=Un,Ur.yScaleFactor=cn}}}}function yi(yt,kr,Nr){return yt.fixedrange?0:Mt&&Er.xaHash[yt._id]?kr:je&&(Er.isSubplotConstrained?Er.xaHash:Er.yaHash)[yt._id]?Nr:0}function Ci(yt,kr){return kr?(yt.range=yt._r.slice(),u(yt,kr),Dt(yt,kr)):0}function Dt(yt,kr,Nr){return yt._length*(1-kr)*l[Nr||yt.constraintoward||"middle"]}return Ct}function F(ve,Ae,Ce,Fe){var ze=b.ensureSingle(ve.draglayer,Ae,Ce,function(Ye){Ye.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",ve.id)});return ze.call(f,Fe),ze.node()}function N(ve,Ae,Ce,Fe,ze,Ye,it){var st=F(ve,"rect",Ae,Ce);return h.select(st).call(i.setRect,Fe,ze,Ye,it),st}function B(ve,Ae){for(var Ce=0;Ce=0?Math.min(ve,.9):1/(1/Math.max(ve,-.3)+3.222))}function re(ve,Ae,Ce){return ve?ve==="nsew"?Ce?"":Ae==="pan"?"move":"crosshair":ve.toLowerCase()+"-resize":"pointer"}function fe(ve,Ae,Ce,Fe,ze){return ve.append("path").attr("class","zoombox").style({fill:Ae>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(Ce,Fe)).attr("d",ze+"Z")}function le(ve,Ae,Ce){return ve.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(Ae,Ce)).attr("d","M0,0Z")}function ce(ve,Ae,Ce,Fe,ze,Ye){ve.attr("d",Fe+"M"+Ce.l+","+Ce.t+"v"+Ce.h+"h"+Ce.w+"v-"+Ce.h+"h-"+Ce.w+"Z"),V(ve,Ae,ze,Ye)}function V(ve,Ae,Ce,Fe){Ce||(ve.transition().style("fill",Fe>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Ae.transition().style("opacity",1).duration(200))}function ee(ve){h.select(ve).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function ne(ve){L&&ve.data&&ve._context.showTips&&(b.notifier(b._(ve,"Double-click to zoom back out"),"long"),L=!1)}function K(ve,Ae){return"M"+(ve.l-.5)+","+(Ae-I-.5)+"h-3v"+(2*I+1)+"h3ZM"+(ve.r+.5)+","+(Ae-I-.5)+"h3v"+(2*I+1)+"h-3Z"}function ue(ve,Ae){return"M"+(Ae-I-.5)+","+(ve.t-.5)+"v-3h"+(2*I+1)+"v3ZM"+(Ae-I-.5)+","+(ve.b+.5)+"v3h"+(2*I+1)+"v-3Z"}function te(ve){var Ae=Math.floor(Math.min(ve.b-ve.t,ve.r-ve.l,I)/2);return"M"+(ve.l-3.5)+","+(ve.t-.5+Ae)+"h3v"+-Ae+"h"+Ae+"v-3h-"+(Ae+3)+"ZM"+(ve.r+3.5)+","+(ve.t-.5+Ae)+"h-3v"+-Ae+"h"+-Ae+"v-3h"+(Ae+3)+"ZM"+(ve.r+3.5)+","+(ve.b+.5-Ae)+"h-3v"+Ae+"h"+-Ae+"v3h"+(Ae+3)+"ZM"+(ve.l-3.5)+","+(ve.b+.5-Ae)+"h3v"+Ae+"h"+Ae+"v3h-"+(Ae+3)+"Z"}function H(ve,Ae,Ce,Fe,ze){for(var Ye=!1,it={},st={},nt,Qe,Le,Te,pe=(ze||{}).xaHash,Ne=(ze||{}).yaHash,ot=0;ot1&&b.warn("Full array edits are incompatible with other edits",f);var x=i[""][""];if(t(x))n.set(null);else if(Array.isArray(x))n.set(x);else return b.warn("Unrecognized full array edit value",f,x),!0;return T?!1:(c(l,g),p(o),!0)}var A=Object.keys(i).map(Number).sort(S),M=n.get(),_=M||[],w=s(g,f).get(),m=[],u=-1,v=_.length,y,I,L,z,F,N,B,R;for(y=0;y_.length-(B?0:1)){b.warn("index out of range",f,L);continue}if(N!==void 0)F.length>1&&b.warn("Insertion & removal are incompatible with edits to the same index.",f,L),t(N)?m.push(L):B?(N==="add"&&(N={}),_.splice(L,0,N),w&&w.splice(L,0,{})):b.warn("Unrecognized full object edit value",f,L,N),u===-1&&(u=L);else for(I=0;I=0;y--)_.splice(m[y],1),w&&w.splice(m[y],1);if(_.length?M||n.set(_):n.set(null),T)return!1;if(c(l,g),d!==h){var U;if(u===-1)U=A;else{for(v=Math.max(_.length,v),U=[],y=0;y=u));y++)U.push(L);for(y=u;y0&&b.log("Clearing previous rejected promises from queue."),l._promises=[]},$.cleanLayout=function(l){var g;l||(l={}),l.xaxis1&&(l.xaxis||(l.xaxis=l.xaxis1),delete l.xaxis1),l.yaxis1&&(l.yaxis||(l.yaxis=l.yaxis1),delete l.yaxis1),l.scene1&&(l.scene||(l.scene=l.scene1),delete l.scene1);var x=(S.subplotsRegistry.cartesian||{}).attrRegex;(S.subplotsRegistry.polar||{}).attrRegex,(S.subplotsRegistry.ternary||{}).attrRegex,(S.subplotsRegistry.gl3d||{}).attrRegex;var A=Object.keys(l);for(g=0;g3?(L.x=1.02,L.xanchor="left"):L.x<-2&&(L.x=-.02,L.xanchor="right"),L.y>3?(L.y=1.02,L.yanchor="bottom"):L.y<-2&&(L.y=-.02,L.yanchor="top")),l.dragmode==="rotate"&&(l.dragmode="orbit"),e.clean(l),l.template&&l.template.layout&&$.cleanLayout(l.template.layout),l};function i(l,g){var x=l[g],A=g.charAt(0);x&&x!=="paper"&&(l[g]=t(x,A,!0))}$.cleanData=function(l){for(var g=0;g0)return l.slice(0,g)}$.hasParent=function(l,g){for(var x=d(g);x;){if(x in l)return!0;x=d(x)}return!1},$.clearAxisTypes=function(l,g,x){for(var A=0;A{const x=(...A)=>A.every(M=>b.isPlainObject(M))||A.every(M=>Array.isArray(M));if([l,g].every(A=>Array.isArray(A))){if(l.length!==g.length)return!1;for(let A=0;Ab.isPlainObject(A))){if(Object.keys(l).length!==Object.keys(g).length)return!1;for(const A in l){if(A.startsWith("_"))continue;const M=l[A],_=g[A];if(M!==_&&!(x(M,_)?T(M,_):!1))return!1}return!0}return!1};$.collectionsAreEqual=T}}),_x=Ge({"src/plot_api/plot_api.js"($){var G=Za(),h=Ga(),b=jw(),S=yn(),E=S.nestedProperty,e=x1(),t=hp(),r=Io(),o=Jg(),n=$c(),i=Ss(),a=qT(),s=tv(),f=Ms(),c=So(),p=o5().initInteractions,d=Ad(),T=Zf().clearOutline,l=A0().dfltConfig,g=kM(),x=s5(),A=mx(),M=Uc(),_=nh().AX_NAME_PATTERN,w=0,m=5;function u(Ee,xe,ye,Me){var Xe;if(Ee=S.getGraphDiv(Ee),e.init(Ee),S.isPlainObject(xe)){var Je=xe;xe=Je.data,ye=Je.layout,Me=Je.config,Xe=Je.frames}var Lt=e.triggerHandler(Ee,"plotly_beforeplot",[xe,ye,Me]);if(Lt===!1)return Promise.reject();!xe&&!ye&&!S.isPlotDiv(Ee)&&S.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",Ee);function Ct(){if(Xe)return $.addFrames(Ee,Xe)}z(Ee,Me),ye||(ye={}),G.select(Ee).classed("js-plotly-plot",!0),f.makeTester(),Array.isArray(Ee._promises)||(Ee._promises=[]);var Ot=(Ee.data||[]).length===0&&Array.isArray(xe);Array.isArray(xe)&&(x.cleanData(xe),Ot?Ee.data=xe:Ee.data.push.apply(Ee.data,xe),Ee.empty=!1),(!Ee.layout||Ot)&&(Ee.layout=x.cleanLayout(ye)),n.supplyDefaults(Ee);var Wt=Ee._fullLayout,_r=Wt._has("cartesian");Wt._replotting=!0,(Ot||Wt._shouldCreateBgLayer)&&($e(Ee),Wt._shouldCreateBgLayer&&delete Wt._shouldCreateBgLayer),f.initGradients(Ee),f.initPatterns(Ee),Ot&&i.saveShowSpikeInitial(Ee);var pr=!Ee.calcdata||Ee.calcdata.length!==(Ee._fullData||[]).length;pr&&n.doCalcdata(Ee);for(var hr=0;hr=Ee.data.length||Xe<-Ee.data.length)throw new Error(ye+" must be valid indices for gd.data.");if(xe.indexOf(Xe,Me+1)>-1||Xe>=0&&xe.indexOf(-Ee.data.length+Xe)>-1||Xe<0&&xe.indexOf(Ee.data.length+Xe)>-1)throw new Error("each index in "+ye+" must be unique.")}}function U(Ee,xe,ye){if(!Array.isArray(Ee.data))throw new Error("gd.data must be an array.");if(typeof xe>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(xe)||(xe=[xe]),R(Ee,xe,"currentIndices"),typeof ye<"u"&&!Array.isArray(ye)&&(ye=[ye]),typeof ye<"u"&&R(Ee,ye,"newIndices"),typeof ye<"u"&&xe.length!==ye.length)throw new Error("current and new indices must be of equal length.")}function j(Ee,xe,ye){var Me,Xe;if(!Array.isArray(Ee.data))throw new Error("gd.data must be an array.");if(typeof xe>"u")throw new Error("traces must be defined.");for(Array.isArray(xe)||(xe=[xe]),Me=0;Me"u")throw new Error("indices must be an integer or array of integers");R(Ee,ye,"indices");for(var Je in xe){if(!Array.isArray(xe[Je])||xe[Je].length!==ye.length)throw new Error("attribute "+Je+" must be an array of length equal to indices array length");if(Xe&&(!(Je in Me)||!Array.isArray(Me[Je])||Me[Je].length!==xe[Je].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function re(Ee,xe,ye,Me){var Xe=S.isPlainObject(Me),Je=[],Lt,Ct,Ot,Wt,_r;Array.isArray(ye)||(ye=[ye]),ye=B(ye,Ee.data.length-1);for(var pr in xe)for(var hr=0;hr=0&&_r=0&&_r"u")return Wt=$.redraw(Ee),t.add(Ee,Xe,Lt,Je,Ct),Wt;Array.isArray(ye)||(ye=[ye]);try{U(Ee,Me,ye)}catch(_r){throw Ee.data.splice(Ee.data.length-xe.length,xe.length),_r}return t.startSequence(Ee),t.add(Ee,Xe,Lt,Je,Ct),Wt=$.moveTraces(Ee,Me,ye),t.stopSequence(Ee),Wt}function ne(Ee,xe){Ee=S.getGraphDiv(Ee);var ye=[],Me=$.addTraces,Xe=ne,Je=[Ee,ye,xe],Lt=[Ee,xe],Ct,Ot;if(typeof xe>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(xe)||(xe=[xe]),R(Ee,xe,"indices"),xe=B(xe,Ee.data.length-1),xe.sort(S.sorterDes),Ct=0;Ct"u")for(ye=[],Wt=0;Wt0&&typeof ar.parts[sn]!="string";)sn--;var mn=ar.parts[sn],wn=ar.parts[sn-1]+"."+mn,Jn=ar.parts.slice(0,sn).join("."),pa=E(Ee.layout,Jn).get(),ha=E(Me,Jn).get(),_a=ar.get();if(lr!==void 0){ta[qt]=lr,ra[qt]=mn==="reverse"?lr:te(_a);var Ca=o.getLayoutValObject(Me,ar.parts);if(Ca&&Ca.impliedEdits&&lr!==null)for(var Vn in Ca.impliedEdits)Nn(S.relativeAttr(qt,Vn),Ca.impliedEdits[Vn]);if(["width","height"].indexOf(qt)!==-1)if(lr){Nn("autosize",null);var yi=qt==="height"?"width":"height";Nn(yi,Me[yi])}else Me[qt]=Ee._initialAutoSize[qt];else if(qt==="autosize")Nn("width",lr?null:Me.width),Nn("height",lr?null:Me.height);else if(wn.match(ze))ir(wn),E(Me,Jn+"._inputRange").set(null);else if(wn.match(Ye)){ir(wn),E(Me,Jn+"._inputRange").set(null);var Ci=E(Me,Jn).get();Ci._inputDomain&&(Ci._input.domain=Ci._inputDomain.slice())}else wn.match(it)&&E(Me,Jn+"._inputDomain").set(null);if(mn==="type"){qa=pa;var Dt=ha.type==="linear"&&lr==="log",yt=ha.type==="log"&&lr==="linear";if(Dt||yt){if(!qa||!qa.range)Nn(Jn+".autorange",!0);else if(ha.autorange)Dt&&(qa.range=qa.range[1]>qa.range[0]?[1,2]:[2,1]);else{var kr=qa.range[0],Nr=qa.range[1];Dt?(kr<=0&&Nr<=0&&Nn(Jn+".autorange",!0),kr<=0?kr=Nr/1e6:Nr<=0&&(Nr=kr/1e6),Nn(Jn+".range[0]",Math.log(kr)/Math.LN10),Nn(Jn+".range[1]",Math.log(Nr)/Math.LN10)):(Nn(Jn+".range[0]",Math.pow(10,kr)),Nn(Jn+".range[1]",Math.pow(10,Nr)))}Array.isArray(Me._subplots.polar)&&Me._subplots.polar.length&&Me[ar.parts[0]]&&ar.parts[1]==="radialaxis"&&delete Me[ar.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(Ee,ha,lr,Nn),r.getComponentMethod("images","convertCoords")(Ee,ha,lr,Nn)}else Nn(Jn+".autorange",!0),Nn(Jn+".range",null);E(Me,Jn+"._inputRange").set(null)}else if(mn.match(_)){var jr=E(Me,qt).get(),Ir=(lr||{}).type;(!Ir||Ir==="-")&&(Ir="linear"),r.getComponentMethod("annotations","convertCoords")(Ee,jr,Ir,Nn),r.getComponentMethod("images","convertCoords")(Ee,jr,Ir,Nn)}var Ur=g.containerArrayMatch(qt);if(Ur){_r=Ur.array,pr=Ur.index;var ln=Ur.property,$r=Ca||{editType:"calc"};pr!==""&&ln===""&&(g.isAddVal(lr)?ra[qt]=null:g.isRemoveVal(lr)?ra[qt]=(E(ye,_r).get()||[])[pr]:S.warn("unrecognized full object value",xe)),M.update(qn,$r),Wt[_r]||(Wt[_r]={});var At=Wt[_r][pr];At||(At=Wt[_r][pr]={}),At[ln]=lr,delete xe[qt]}else mn==="reverse"?(pa.range?pa.range.reverse():(Nn(Jn+".autorange",!0),pa.range=[1,0]),ha.autorange?qn.calc=!0:qn.plot=!0):(qt==="dragmode"&&(lr===!1&&_a!==!1||lr!==!1&&_a===!1)||Me._has("scatter-like")&&Me._has("regl")&&qt==="dragmode"&&(lr==="lasso"||lr==="select")&&!(_a==="lasso"||_a==="select")?qn.plot=!0:Ca?M.update(qn,Ca):qn.calc=!0,ar.set(lr))}}for(_r in Wt){var or=g.applyContainerArrayChanges(Ee,Je(ye,_r),Wt[_r],qn,Je);or||(qn.plot=!0)}for(var Dr in ka){qa=i.getFromId(Ee,Dr);var un=qa&&qa._constraintGroup;if(un){qn.calc=!0;for(var Rn in un)ka[Rn]||(i.getFromId(Ee,Rn)._constraintShrinkable=!0)}}(nt(Ee)||xe.height||xe.width)&&(qn.plot=!0);var jn=Me.shapes;for(pr=0;pr1;)if(Me.pop(),ye=E(xe,Me.join(".")+".uirevision").get(),ye!==void 0)return ye;return xe.uirevision}function ft(Ee,xe){for(var ye=0;ye[Jn,Ee._ev.listeners(Jn)]);Je=$.newPlot(Ee,xe,ye,Me).then(()=>{for(const[Jn,pa]of wn)pa.forEach(ha=>Ee.on(Jn,ha));return $.react(Ee,xe,ye,Me)})}else{Ee.data=xe||[],x.cleanData(Ee.data),Ee.layout=ye||{},x.cleanLayout(Ee.layout),Nt(Ee.data,Ee.layout,Ct,Ot),n.supplyDefaults(Ee,{skipUpdateCalc:!0});var pr=Ee._fullData,hr=Ee._fullLayout,Fr=hr.datarevision===void 0,En=hr.transition,Kn=Er(Ee,Ot,hr,Fr,En),qn=Kn.newDataRevision,ta=rr(Ee,Ct,pr,Fr,En,qn);if(nt(Ee)&&(Kn.layoutReplot=!0),ta.calc||Kn.calc){Ee.calcdata=void 0;for(var ra=Object.getOwnPropertyNames(hr),Nn=0;Nn(_r||Ee.emit("plotly_react",{config:Me,data:xe,layout:ye}),Ee))}function rr(Ee,xe,ye,Me,Xe,Je){var Lt=xe.length===ye.length;if(!Xe&&!Lt)return{fullReplot:!0,calc:!0};var Ct=M.traceFlags();Ct.arrays={},Ct.nChanges=0,Ct.nChangesAnim=0;var Ot,Wt;function _r(Fr){var En=o.getTraceValObject(Wt,Fr);return!Wt._module.animatable&&En.anim&&(En.anim=!1),En}var pr={getValObject:_r,flags:Ct,immutable:Me,transition:Xe,newDataRevision:Je,gd:Ee},hr={};for(Ot=0;Ot=Xe.length?Xe[0]:Xe[Wt]:Xe}function Ct(Wt){return Array.isArray(Je)?Wt>=Je.length?Je[0]:Je[Wt]:Je}function Ot(Wt,_r){var pr=0;return function(){if(Wt&&++pr===_r)return Wt()}}return new Promise(function(Wt,_r){function pr(){if(Me._frameQueue.length!==0){for(;Me._frameQueue.length;){var mn=Me._frameQueue.pop();mn.onInterrupt&&mn.onInterrupt()}Ee.emit("plotly_animationinterrupted",[])}}function hr(mn){if(mn.length!==0){for(var wn=0;wnMe._timeToNext&&En()};mn()}var qn=0;function ta(mn){return Array.isArray(Xe)?qn>=Xe.length?mn.transitionOpts=Xe[qn]:mn.transitionOpts=Xe[0]:mn.transitionOpts=Xe,qn++,mn}var ra,Nn,ka=[],qa=xe==null,ir=Array.isArray(xe),qt=!qa&&!ir&&S.isPlainObject(xe);if(qt)ka.push({type:"object",data:ta(S.extendFlat({},xe))});else if(qa||["string","number"].indexOf(typeof xe)!==-1)for(ra=0;ra0&&VrVr)&&sn.push(Nn);ka=sn}}ka.length>0?hr(ka):(Ee.emit("plotly_animated"),Wt())})}function Sr(Ee,xe,ye){if(Ee=S.getGraphDiv(Ee),xe==null)return Promise.resolve();if(!S.isPlotDiv(Ee))throw new Error("This element is not a Plotly plot: "+Ee+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Me,Xe,Je,Lt,Ct=Ee._transitionData._frames,Ot=Ee._transitionData._frameHash;if(!Array.isArray(xe))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+xe);var Wt=Ct.length+xe.length*2,_r=[],pr={};for(Me=xe.length-1;Me>=0;Me--)if(S.isPlainObject(xe[Me])){var hr=xe[Me].name,Fr=(Ot[hr]||pr[hr]||{}).name,En=xe[Me].name,Kn=Ot[Fr]||pr[Fr];Fr&&En&&typeof En=="number"&&Kn&&war.index?-1:qt.index=0;Me--){if(Xe=_r[Me].frame,typeof Xe.name=="number"&&S.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!Xe.name)for(;Ot[Xe.name="frame "+Ee._transitionData._counter++];);if(Ot[Xe.name]){for(Je=0;Je=0;ye--)Me=xe[ye],Je.push({type:"delete",index:Me}),Lt.unshift({type:"insert",index:Me,value:Xe[Me]});var Ct=n.modifyFrames,Ot=n.modifyFrames,Wt=[Ee,Lt],_r=[Ee,Je];return t&&t.add(Ee,Ct,Wt,Ot,_r),n.modifyFrames(Ee,Je)}function Mt(Ee){Ee=S.getGraphDiv(Ee);var xe=Ee._fullLayout||{},ye=Ee._fullData||[];return n.cleanPlot([],{},ye,xe),n.purge(Ee),e.purge(Ee),xe._container&&xe._container.remove(),delete Ee._context,Ee}function je(Ee){var xe=Ee._fullLayout,ye=Ee.getBoundingClientRect();if(!S.equalDomRects(ye,xe._lastBBox)){var Me=xe._invTransform=S.inverseTransformMatrix(S.getFullTransformMatrix(Ee));xe._invScaleX=Math.sqrt(Me[0][0]*Me[0][0]+Me[0][1]*Me[0][1]+Me[0][2]*Me[0][2]),xe._invScaleY=Math.sqrt(Me[1][0]*Me[1][0]+Me[1][1]*Me[1][1]+Me[1][2]*Me[1][2]),xe._lastBBox=ye}}function $e(Ee){var xe=G.select(Ee),ye=Ee._fullLayout;if(ye._calcInverseTransform=je,ye._calcInverseTransform(Ee),ye._container=xe.selectAll(".plot-container").data([0]),ye._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),ye._paperdiv=ye._container.selectAll(".svg-container").data([0]),ye._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),ye._glcontainer=ye._paperdiv.selectAll(".gl-container").data([{}]),ye._glcontainer.enter().append("div").classed("gl-container",!0),ye._paperdiv.selectAll(".main-svg").remove(),ye._paperdiv.select(".modebar-container").remove(),ye._paper=ye._paperdiv.insert("svg",":first-child").classed("main-svg",!0),ye._toppaper=ye._paperdiv.append("svg").classed("main-svg",!0),ye._modebardiv=ye._paperdiv.append("div"),delete ye._modeBar,ye._hoverpaper=ye._paperdiv.append("svg").classed("main-svg",!0),!ye._uid){var Me={};G.selectAll("defs").each(function(){this.id&&(Me[this.id.split("-")[1]]=1)}),ye._uid=S.randstr(Me)}ye._paperdiv.selectAll(".main-svg").attr(d.svgAttrs),ye._defs=ye._paper.append("defs").attr("id","defs-"+ye._uid),ye._clips=ye._defs.append("g").classed("clips",!0),ye._topdefs=ye._toppaper.append("defs").attr("id","topdefs-"+ye._uid),ye._topclips=ye._topdefs.append("g").classed("clips",!0),ye._bgLayer=ye._paper.append("g").classed("bglayer",!0),ye._draggers=ye._paper.append("g").classed("draglayer",!0);var Xe=ye._paper.append("g").classed("layer-below",!0);ye._imageLowerLayer=Xe.append("g").classed("imagelayer",!0),ye._shapeLowerLayer=Xe.append("g").classed("shapelayer",!0),ye._cartesianlayer=ye._paper.append("g").classed("cartesianlayer",!0),ye._polarlayer=ye._paper.append("g").classed("polarlayer",!0),ye._smithlayer=ye._paper.append("g").classed("smithlayer",!0),ye._ternarylayer=ye._paper.append("g").classed("ternarylayer",!0),ye._geolayer=ye._paper.append("g").classed("geolayer",!0),ye._funnelarealayer=ye._paper.append("g").classed("funnelarealayer",!0),ye._pielayer=ye._paper.append("g").classed("pielayer",!0),ye._iciclelayer=ye._paper.append("g").classed("iciclelayer",!0),ye._treemaplayer=ye._paper.append("g").classed("treemaplayer",!0),ye._sunburstlayer=ye._paper.append("g").classed("sunburstlayer",!0),ye._indicatorlayer=ye._toppaper.append("g").classed("indicatorlayer",!0),ye._glimages=ye._paper.append("g").classed("glimages",!0);var Je=ye._toppaper.append("g").classed("layer-above",!0);ye._imageUpperLayer=Je.append("g").classed("imagelayer",!0),ye._shapeUpperLayer=Je.append("g").classed("shapelayer",!0),ye._selectionLayer=ye._toppaper.append("g").classed("selectionlayer",!0),ye._infolayer=ye._toppaper.append("g").classed("infolayer",!0),ye._menulayer=ye._toppaper.append("g").classed("menulayer",!0),ye._zoomlayer=ye._toppaper.append("g").classed("zoomlayer",!0),ye._hoverlayer=ye._hoverpaper.append("g").classed("hoverlayer",!0),ye._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),Ee.emit("plotly_framework")}$.animate=Wr,$.addFrames=Sr,$.deleteFrames=Br,$.addTraces=ee,$.deleteTraces=ne,$.extendTraces=ce,$.moveTraces=K,$.prependTraces=V,$.newPlot=N,$._doPlot=u,$.purge=Mt,$.react=$t,$.redraw=F,$.relayout=Ae,$.restyle=ue,$.setPlotConfig=y,$.update=Qe,$._guiRelayout=Le(Ae),$._guiRestyle=Le(ue),$._guiUpdate=Le(Qe),$._storeDirectGUIEdit=ie}}),o0=Ge({"src/snapshot/helpers.js"($){var G=Io();$.getDelay=function(S){return S._has&&(S._has("gl3d")||S._has("mapbox")||S._has("map"))?500:0},$.getRedrawFunc=function(S){return function(){G.getComponentMethod("colorbar","draw")(S)}},$.encodeSVG=function(S){return"data:image/svg+xml,"+encodeURIComponent(S)},$.encodeJSON=function(S){return"data:application/json,"+encodeURIComponent(S)};var h=window.URL||window.webkitURL;$.createObjectURL=function(S){return h.createObjectURL(S)},$.revokeObjectURL=function(S){return h.revokeObjectURL(S)},$.createBlob=function(S,E){if(E==="svg")return new window.Blob([S],{type:"image/svg+xml;charset=utf-8"});if(E==="full-json")return new window.Blob([S],{type:"application/json;charset=utf-8"});var e=b(window.atob(S));return new window.Blob([e],{type:"image/"+E})},$.octetStream=function(S){document.location.href="data:application/octet-stream"+S};function b(S){for(var E=S.length,e=new ArrayBuffer(E),t=new Uint8Array(e),r=0;r")!==-1?"":i.html(s).text()});return i.remove(),a}function o(n){return n.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}G.exports=function(i,a,s){var f=i._fullLayout,c=f._paper,p=f._toppaper,d=f.width,T=f.height,l;c.insert("rect",":first-child").call(b.setRect,0,0,d,T).call(S.fill,f.paper_bgcolor);var g=f._basePlotModules||[];for(l=0;l1&&M.push(s("object","layout"))),b.supplyDefaults(_);for(var u=_._fullData,v=w.length,y=0;yI.length&&A.push(s("unused",M,v.concat(I.length)));var R=I.length,U=Array.isArray(B);U&&(R=Math.min(R,B.length));var j,Z,re,fe,le;if(L.dimensions===2)for(Z=0;ZI[Z].length&&A.push(s("unused",M,v.concat(Z,I[Z].length)));var ce=I[Z].length;for(j=0;j<(U?Math.min(ce,B[Z].length):ce);j++)re=U?B[Z][j]:B,fe=y[Z][j],le=I[Z][j],h.validate(fe,re)?le!==fe&&le!==+fe&&A.push(s("dynamic",M,v.concat(Z,j),fe,le)):A.push(s("value",M,v.concat(Z,j),fe))}else A.push(s("array",M,v.concat(Z),y[Z]));else for(Z=0;ZF?A.push({code:"unused",traceType:y,templateCount:z,dataCount:F}):F>z&&A.push({code:"reused",traceType:y,templateCount:z,dataCount:F})}}function N(B,R){for(var U in B)if(U.charAt(0)!=="_"){var j=B[U],Z=s(B,U,R);h(j)?(Array.isArray(B)&&j._template===!1&&j.templateitemname&&A.push({code:"missing",path:Z,templateitemname:j.templateitemname}),N(j,Z)):Array.isArray(j)&&f(j)&&N(j,Z)}}if(N({data:_,layout:M},""),A.length)return A.map(c)};function f(p){for(var d=0;d=0;c--){var p=e[c];if(p.type==="scatter"&&p.xaxis===s.xaxis&&p.yaxis===s.yaxis){p.opacity=void 0;break}}}}}}}),a2=Ge({"src/traces/scatter/layout_defaults.js"($,G){var h=yn(),b=rm();G.exports=function(S,E){function e(r,o){return h.coerce(S,E,b,r,o)}var t=E.barmode==="group";E.scattermode==="group"&&e("scattergap",t?E.bargap:.2)}}}),Bp=Ge({"src/plots/cartesian/align_period.js"($,G){var h=Ga(),b=yn(),S=b.dateTime2ms,E=b.incrementMonth,e=hi(),t=e.ONEAVGMONTH;G.exports=function(o,n,i,a){if(n.type!=="date")return{vals:a};var s=o[i+"periodalignment"];if(!s)return{vals:a};var f=o[i+"period"],c;if(h(f)){if(f=+f,f<=0)return{vals:a}}else if(typeof f=="string"&&f.charAt(0)==="M"){var p=+f.substring(1);if(p>0&&Math.round(p)===p)c=p;else return{vals:a}}for(var d=n.calendar,T=s==="start",l=s==="end",g=o[i+"period0"],x=S(g,d)||0,A=[],M=[],_=[],w=a.length,m=0;mu;)I=E(I,-c,d);for(;I<=u;)I=E(I,c,d);y=E(I,-c,d)}else{for(v=Math.round((u-x)/f),I=x+v*f;I>u;)I-=f;for(;I<=u;)I+=f;y=I-f}A[m]=T?y:l?I:(y+I)/2,M[m]=y,_[m]=I}return{vals:A,starts:M,ends:_}}}}),tp=Ge({"src/traces/scatter/colorscale_calc.js"($,G){var h=vv().hasColorscale,b=pv(),S=ou();G.exports=function(e,t){S.hasLines(t)&&h(t,"line")&&b(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),S.hasMarkers(t)&&(h(t,"marker")&&b(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),h(t,"marker.line")&&b(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),s0=Ge({"src/traces/scatter/arrays_to_calcdata.js"($,G){var h=yn();G.exports=function(S,E){for(var e=0;eN&&y[R].gap;)R--;for(j=y[R].s,B=y.length-1;B>R;B--)y[B].s=j;for(;NU+B||!h(R))}for(var Z=0;Zz[d]&&d0?e:t)/(d._m*g*(d._m>0?e:t)))),Wt*=1e3}if(_r===S){if(l&&(_r=d.c2p(Ot.y,!0)),_r===S)return!1;_r*=1e3}return[Wt,_r]}function ae(Ct,Ot,Wt,_r){var pr=Wt-Ct,hr=_r-Ot,Fr=.5-Ct,En=.5-Ot,Kn=pr*pr+hr*hr,qn=pr*Fr+hr*En;if(qn>0&&qn1||Math.abs(Fr.y-Wt[0][1])>1)&&(Fr=[Fr.x,Fr.y],_r&&Ce(Fr,Ct)Ye||Ct[1]st)return[n(Ct[0],ze,Ye),n(Ct[1],it,st)]}function Ft(Ct,Ot){if(Ct[0]===Ot[0]&&(Ct[0]===ze||Ct[0]===Ye)||Ct[1]===Ot[1]&&(Ct[1]===it||Ct[1]===st))return!0}function Nt(Ct,Ot){var Wt=[],_r=rt(Ct),pr=rt(Ot);return _r&&pr&&Ft(_r,pr)||(_r&&Wt.push(_r),pr&&Wt.push(pr)),Wt}function $t(Ct,Ot,Wt){return function(_r,pr){var hr=rt(_r),Fr=rt(pr),En=[];if(hr&&Fr&&Ft(hr,Fr))return En;hr&&En.push(hr),Fr&&En.push(Fr);var Kn=2*r.constrain((_r[Ct]+pr[Ct])/2,Ot,Wt)-((hr||_r)[Ct]+(Fr||pr)[Ct]);if(Kn){var qn;hr&&Fr?qn=Kn>0==hr[Ct]>Fr[Ct]?hr:Fr:qn=hr||Fr,qn[Ct]+=Kn}return En}}var rr;m==="linear"||m==="spline"?rr=ft:m==="hv"||m==="vh"?rr=Nt:m==="hvh"?rr=$t(0,ze,Ye):m==="vhv"&&(rr=$t(1,it,st));function Er(Ct,Ot){var Wt=Ot[0]-Ct[0],_r=(Ot[1]-Ct[1])/Wt,pr=(Ct[1]*Ot[0]-Ot[1]*Ct[0])/Wt;return pr>0?[_r>0?ze:Ye,st]:[_r>0?Ye:ze,it]}function Mr(Ct){var Ot=Ct[0],Wt=Ct[1],_r=Ot===z[F-1][0],pr=Wt===z[F-1][1];if(!(_r&&pr))if(F>1){var hr=Ot===z[F-2][0],Fr=Wt===z[F-2][1];_r&&(Ot===ze||Ot===Ye)&&hr?Fr?F--:z[F-1]=Ct:pr&&(Wt===it||Wt===st)&&Fr?hr?F--:z[F-1]=Ct:z[F++]=Ct}else z[F++]=Ct}function Wr(Ct){z[F-1][0]!==Ct[0]&&z[F-1][1]!==Ct[1]&&Mr([Te,pe]),Mr(Ct),Ne=null,Te=pe=0}var Sr=r.isArrayOrTypedArray(M);function Br(Ct){if(Ct&&A&&(Ct.i=N,Ct.d=s,Ct.trace=c,Ct.marker=Sr?M[Ct.i]:M,Ct.backoff=A),ie=Ct[0]/g,ve=Ct[1]/x,Qe=Ct[0]Ye?Ye:0,Le=Ct[1]st?st:0,Qe||Le){if(!F)z[F++]=[Qe||Ct[0],Le||Ct[1]];else if(Ne){var Ot=rr(Ne,Ct);Ot.length>1&&(Wr(Ot[0]),z[F++]=Ot[1])}else ot=rr(z[F-1],Ct)[0],z[F++]=ot;var Wt=z[F-1];Qe&&Le&&(Wt[0]!==Qe||Wt[1]!==Le)?(Ne&&(Te!==Qe&&pe!==Le?Mr(Te&&pe?Er(Ne,Ct):[Te||Qe,pe||Le]):Te&&pe&&Mr([Te,pe])),Mr([Qe,Le])):Te-Qe&&pe-Le&&Mr([Qe||Te,Le||pe]),Ne=Ct,Te=Qe,pe=Le}else Ne&&Wr(rr(Ne,Ct)[0]),z[F++]=Ct}for(N=0;NAe(Z,Mt))break;R=Z,ne=le[0]*fe[0]+le[1]*fe[1],ne>V?(V=ne,U=Z,re=!1):ne=s.length||!Z)break;Br(Z),B=Z}}Ne&&Mr([Te||Ne[0],pe||Ne[1]]),y.push(z.slice(0,F))}var je=m.slice(m.length-1);if(A&&je!=="h"&&je!=="v"){for(var $e=!1,Ee=-1,xe=[],ye=0;ye=0?i=p:(i=p=c,c++),i0,m=n(p,d,T);if(A=l.selectAll("g.trace").data(m,function(v){return v[0].trace.uid}),A.enter().append("g").attr("class",function(v){return"trace scatter trace"+v[0].trace.uid}).style("stroke-miterlimit",2),A.order(),a(p,A,d),w){x&&(M=x());var u=h.transition().duration(g.duration).ease(g.easing).each("end",function(){M&&M()}).each("interrupt",function(){M&&M()});u.each(function(){l.selectAll("g.trace").each(function(v,y){s(p,y,d,v,m,this,g)})})}else A.each(function(v,y){s(p,y,d,v,m,this,g)});_&&A.exit().remove(),l.selectAll("path:not([d])").remove()};function a(c,p,d){p.each(function(T){var l=E(h.select(this),"g","fills");t.setClipUrl(l,d.layerClipId,c);var g=T[0].trace,x=[];g._ownfill&&x.push("_ownFill"),g._nexttrace&&x.push("_nextFill");var A=l.selectAll("g").data(x,e);A.enter().append("g"),A.exit().each(function(M){g[M]=null}).remove(),A.order().each(function(M){g[M]=E(h.select(this),"path","js-fill")})})}function s(c,p,d,T,l,g,x){var A=c._context.staticPlot,M;f(c,p,d,T,l);var _=!!x&&x.duration>0;function w(Mr){return _?Mr.transition():Mr}var m=d.xaxis,u=d.yaxis,v=T[0].trace,y=v.line,I=h.select(g),L=E(I,"g","errorbars"),z=E(I,"g","lines"),F=E(I,"g","points"),N=E(I,"g","text");if(b.getComponentMethod("errorbars","plot")(c,L,d,x),v.visible!==!0)return;w(I).style("opacity",v.opacity);var B,R,U=v.fill.charAt(v.fill.length-1);U!=="x"&&U!=="y"&&(U="");var j,Z;U==="y"?(j=1,Z=u.c2p(0,!0)):U==="x"&&(j=0,Z=m.c2p(0,!0)),T[0][d.isRangePlot?"nodeRangePlot3":"node3"]=I;var re="",fe=[],le=v._prevtrace,ce=null,V=null;le&&(re=le._prevRevpath||"",R=le._nextFill,fe=le._ownPolygons,ce=le._fillsegments,V=le._fillElement);var ee,ne,K="",ue="",te,H,ae,ie,ve,Ae,Ce=[];v._polygons=[];var Fe=[],ze=[],Ye=S.noop;if(B=v._ownFill,r.hasLines(v)||v.fill!=="none"){R&&R.datum(T),["hv","vh","hvh","vhv"].indexOf(y.shape)!==-1?(te=t.steps(y.shape),H=t.steps(y.shape.split("").reverse().join(""))):y.shape==="spline"?te=H=function(Mr){var Wr=Mr[Mr.length-1];return Mr.length>1&&Mr[0][0]===Wr[0]&&Mr[0][1]===Wr[1]?t.smoothclosed(Mr.slice(1),y.smoothing):t.smoothopen(Mr,y.smoothing)}:te=H=function(Mr){return"M"+Mr.join("L")},ae=function(Mr){return H(Mr.reverse())},ze=o(T,{xaxis:m,yaxis:u,trace:v,connectGaps:v.connectgaps,baseTolerance:Math.max(y.width||1,3)/4,shape:y.shape,backoff:y.backoff,simplify:y.simplify,fill:v.fill}),Fe=new Array(ze.length);var it=0;for(M=0;M=A[0]&&I.x<=A[1]&&I.y>=M[0]&&I.y<=M[1]}),u=Math.ceil(m.length/w),v=0;l.forEach(function(I,L){var z=I[0].trace;r.hasMarkers(z)&&z.marker.maxdisplayed>0&&L=Math.min(le,ce)&&d<=Math.max(le,ce)?0:1/0}var V=Math.max(3,fe.mrc||0),ee=1-1/V,ne=Math.abs(c.c2p(fe.x)-d);return ne=Math.min(le,ce)&&T<=Math.max(le,ce)?0:1/0}var V=Math.max(3,fe.mrc||0),ee=1-1/V,ne=Math.abs(p.c2p(fe.y)-T);return neue!=Fe>=ue&&(ve=ae[H-1][0],Ae=ae[H][0],Fe-Ce&&(ie=ve+(Ae-ve)*(ue-Ce)/(Fe-Ce),V=Math.min(V,ie),ee=Math.max(ee,ie)));return V=Math.max(V,0),ee=Math.min(ee,c._length),{x0:V,x1:ee,y0:ue,y1:ue}}if(g.indexOf("fills")!==-1&&f._fillElement){var j=R(f._fillElement)&&!R(f._fillExclusionElement);if(j){var Z=U(f._polygons);Z===null&&(Z={x0:l[0],x1:l[0],y0:l[1],y1:l[1]});var re=e.defaultLine;return e.opacity(f.fillcolor)?re=f.fillcolor:e.opacity((f.line||{}).color)&&(re=f.line.color),h.extendFlat(o,{distance:o.maxHoverDistance,x0:Z.x0,x1:Z.x1,y0:Z.y0,y1:Z.y1,color:re,hovertemplate:!1}),delete o.index,f.text&&!h.isArrayOrTypedArray(f.text)?o.text=String(f.text):o.text=f.name,[o]}}}}}),og=Ge({"src/traces/scatter/select.js"($,G){var h=ou();G.exports=function(S,E){var e=S.cd,t=S.xaxis,r=S.yaxis,o=[],n=e[0].trace,i,a,s,f,c=!h.hasMarkers(n)&&!h.hasText(n);if(c)return[];if(E===!1)for(i=0;i0&&(a["_"+n+"axes"]||{})[o])return a;if((a[n+"axis"]||n)===o){if(t(a,n))return a;if((a[n]||[]).length||a[n+"0"])return a}}}function e(r){return{v:"x",h:"y"}[r.orientation||"v"]}function t(r,o){var n=e(r),i=h(r,"box-violin"),a=h(r._fullInput||{},"candlestick");return i&&!a&&o===n&&r[n]===void 0&&r[n+"0"]===void 0}}}),Pf=Ge({"src/plots/cartesian/category_order_defaults.js"($,G){var h=ro().isTypedArraySpec;function b(S,E){var e=E.dataAttr||S._id.charAt(0),t={},r,o,n;if(E.axData)r=E.axData;else for(r=[],o=0;o0||h(o),i;n&&(i="array");var a=t("categoryorder",i),s;a==="array"&&(s=t("categoryarray")),!n&&a==="array"&&(a=e.categoryorder="trace"),a==="trace"?e._initialCategories=[]:a==="array"?e._initialCategories=s.slice():(s=b(e,r).sort(),a==="category ascending"?e._initialCategories=s:a==="category descending"&&(e._initialCategories=s.reverse()))}}}}),Uu=Ge({"src/plots/cartesian/line_grid_defaults.js"($,G){var h=ks().mix,b=rh(),S=yn();G.exports=function(e,t,r,o){o=o||{};var n=o.dfltColor;function i(v,y){return S.coerce2(e,t,o.attributes,v,y)}var a=i("linecolor",n),s=i("linewidth"),f=r("showline",o.showLine||!!a||!!s);f||(delete t.linecolor,delete t.linewidth);var c=h(n,o.bgColor,o.blend||b.lightFraction).toRgbString(),p=i("gridcolor",c),d=i("gridwidth"),T=i("griddash"),l=r("showgrid",o.showGrid||!!p||!!d||!!T);if(l||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var g=h(t.gridcolor,o.bgColor,67).toRgbString(),x=i("minor.gridcolor",g),A=i("minor.gridwidth",t.gridwidth||1),M=i("minor.griddash",t.griddash||"solid"),_=r("minor.showgrid",!!x||!!A||!!M);_||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){i("zerolinelayer");var w=i("zerolinecolor",n),m=i("zerolinewidth"),u=r("zeroline",o.showGrid||!!w||!!m);u||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}}),Np=Ge({"src/plots/cartesian/axis_defaults.js"($,G){var h=Ga(),b=Io(),S=yn(),E=mu(),e=dv(),t=tv(),r=Qm(),o=P0(),n=Lp(),i=Sd(),a=Pf(),s=Uu(),f=qT(),c=Kd(),p=nh().WEEKDAY_PATTERN,d=nh().HOUR_PATTERN;G.exports=function(A,M,_,w,m){var u=w.letter,v=w.font||{},y=w.splomStash||{},I=_("visible",!w.visibleDflt),L=M._template||{},z=M.type||L.type||"-",F;if(z==="date"){var N=b.getComponentMethod("calendars","handleDefaults");N(A,M,"calendar",w.calendar),w.noTicklabelmode||(F=_("ticklabelmode"))}!w.noTicklabelindex&&(z==="date"||z==="linear")&&_("ticklabelindex");var B="";(!w.noTicklabelposition||z==="multicategory")&&(B=S.coerce(A,M,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:F==="period"?["outside","inside"]:u==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),w.noTicklabeloverflow||_("ticklabeloverflow",B.indexOf("inside")!==-1?"hide past domain":z==="category"||z==="multicategory"?"allow":"hide past div"),c(M,m),f(A,M,_,w),a(A,M,_,w),w.noHover||(z!=="category"&&_("hoverformat"),w.noUnifiedhovertitle||_("unifiedhovertitle.text"));var R=_("color"),U=R!==t.color.dflt?R:v.color,j=y.label||m._dfltTitle[u];if(i(A,M,_,z,w),!I)return M;_("title.text",j),S.coerceFont(_,"title.font",v,{overrideDflt:{size:S.bigFont(v.size),color:U}}),r(A,M,_,z);var Z=w.hasMinor;if(Z&&(E.newContainer(M,"minor"),r(A,M,_,z,{isMinor:!0})),n(A,M,_,z,w),o(A,M,_,w),Z){var re=w.isMinor;w.isMinor=!0,o(A,M,_,w),w.isMinor=re}s(A,M,_,{dfltColor:R,bgColor:w.bgColor,showGrid:w.showGrid,hasMinor:Z,attributes:t}),Z&&!M.minor.ticks&&!M.minor.showgrid&&delete M.minor,(M.showline||M.ticks)&&_("mirror");var fe=z==="multicategory";if(!w.noTickson&&(z==="category"||fe)&&(M.ticks||M.showgrid)&&(fe?(_("tickson","boundaries"),delete M.ticklabelposition):_("tickson")),fe){var le=_("showdividers");le&&(_("dividercolor"),_("dividerwidth"))}if(z==="date")if(e(A,M,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:T}),!M.rangebreaks.length)delete M.rangebreaks;else{for(var ce=0;ce=2){var u="",v,y;if(m.length===2){for(v=0;v<2;v++)if(y=g(m[v]),y){u=p;break}}var I=_("pattern",u);if(I===p)for(v=0;v<2;v++)y=g(m[v]),y&&(A.bounds[v]=m[v]=y-1);if(I)for(v=0;v<2;v++)switch(y=m[v],I){case p:if(!h(y)){A.enabled=!1;return}if(y=+y,y!==Math.floor(y)||y<0||y>=7){A.enabled=!1;return}A.bounds[v]=m[v]=y;break;case d:if(!h(y)){A.enabled=!1;return}if(y=+y,y<0||y>24){A.enabled=!1;return}A.bounds[v]=m[v]=y;break}if(M.autorange===!1){var L=M.range;if(L[0]L[1]){A.enabled=!1;return}}else if(m[0]>L[0]&&m[1]_[1]-1/4096&&(e.domain=c),b.noneOrAll(E.domain,e.domain,c),e.tickmode==="sync"&&(e.tickmode="auto")}return t("layer"),e}}}),i2=Ge({"src/plots/cartesian/layout_defaults.js"($,G){var h=yn(),b=So(),S=Hv().isUnifiedHover,E=KT(),e=mu(),t=y1(),r=tv(),o=zv(),n=Np(),i=ng(),a=Md(),s=Lf(),f=s.id2name,c=s.name2id,p=nh().AX_ID_PATTERN,d=Io(),T=d.traceIs,l=d.getComponentMethod;function g(x,A,M){Array.isArray(x[A])?x[A].push(M):x[A]=[M]}G.exports=function(A,M,_){var w=M.autotypenumbers,m={},u={},v={},y={},I={},L={},z={},F={},N={},B={},R,U;for(R=0;R<_.length;R++){var j=_[R];if(T(j,"cartesian")){var Z;if(j.xaxis)Z=f(j.xaxis),g(m,Z,j);else if(j.xaxes)for(U=0;U rect").call(E.setTranslate,0,0).call(E.setScale,1,1),M.plot.call(E.setTranslate,_._offset,w._offset).call(E.setScale,1,1);var m=M.plot.selectAll(".scatterlayer .trace");m.selectAll(".point").call(E.setPointGroupScale,1,1),m.selectAll(".textpoint").call(E.setTextPointsScale,1,1),m.call(E.hideOutsideRangePoints,M)}function f(M,_){var w=M.plotinfo,m=w.xaxis,u=w.yaxis,v=m._length,y=u._length,I=!!M.xr1,L=!!M.yr1,z=[];if(I){var F=S.simpleMap(M.xr0,m.r2l),N=S.simpleMap(M.xr1,m.r2l),B=F[1]-F[0],R=N[1]-N[0];z[0]=(F[0]*(1-_)+_*N[0]-F[0])/(F[1]-F[0])*v,z[2]=v*(1-_+_*R/B),m.range[0]=m.l2r(F[0]*(1-_)+_*N[0]),m.range[1]=m.l2r(F[1]*(1-_)+_*N[1])}else z[0]=0,z[2]=v;if(L){var U=S.simpleMap(M.yr0,u.r2l),j=S.simpleMap(M.yr1,u.r2l),Z=U[1]-U[0],re=j[1]-j[0];z[1]=(U[1]*(1-_)+_*j[1]-U[1])/(U[0]-U[1])*y,z[3]=y*(1-_+_*re/Z),u.range[0]=m.l2r(U[0]*(1-_)+_*j[0]),u.range[1]=u.l2r(U[1]*(1-_)+_*j[1])}else z[1]=0,z[3]=y;e.drawOne(r,m,{skipTitle:!0}),e.drawOne(r,u,{skipTitle:!0}),e.redrawComponents(r,[m._id,u._id]);var fe=I?v/z[2]:1,le=L?y/z[3]:1,ce=I?z[0]:0,V=L?z[1]:0,ee=I?z[0]/z[2]*v:0,ne=L?z[1]/z[3]*y:0,K=m._offset-ee,ue=u._offset-ne;w.clipRect.call(E.setTranslate,ce,V).call(E.setScale,1/fe,1/le),w.plot.call(E.setTranslate,K,ue).call(E.setScale,fe,le),E.setPointGroupScale(w.zoomScalePts,1/fe,1/le),E.setTextPointsScale(w.zoomScaleTxt,1/fe,1/le)}var c;i&&(c=i());function p(){for(var M={},_=0;_n.duration?(p(),g=window.cancelAnimationFrame(A)):g=window.requestAnimationFrame(A)}return T=Date.now(),g=window.requestAnimationFrame(A),Promise.resolve()}}}),ph=Ge({"src/plots/cartesian/index.js"($){var G=Za(),h=Io(),b=yn(),S=$c(),E=Ms(),e=Iv().getModuleCalcData,t=Lf(),r=nh(),o=Ad(),n=b.ensureSingle;function i(T,l,g){return b.ensureSingle(T,l,g,function(x){x.datum(g)})}var a=r.zindexSeparator;$.name="cartesian",$.attr=["xaxis","yaxis"],$.idRoot=["x","y"],$.idRegex=r.idRegex,$.attrRegex=r.attrRegex,$.attributes=u5(),$.layoutAttributes=tv(),$.supplyLayoutDefaults=i2(),$.transitionAxes=cm(),$.finalizeSubplots=function(T,l){var g=l._subplots,x=g.xaxis,A=g.yaxis,M=g.cartesian,_=M,w={},m={},u,v,y;for(u=0;u<_.length;u++){var I=_[u].split("y");w[I[0]]=1,m["y"+I[1]]=1}for(u=0;u0){var L=I.id;if(L.indexOf(a)!==-1)continue;L+=a+(u+1),I=b.extendFlat({},I,{id:L,plot:A._cartesianlayer.selectAll(".subplot").select("."+L)})}for(var z=[],F,N=0;N<_.length;N++){var B=_[N],R=B[0].trace;v===(R.zorder||0)&&R.xaxis+R.yaxis===y&&((l.indexOf(R.index)!==-1||R.carpet)&&(F&&F[0].trace.xaxis+F[0].trace.yaxis===y&&["tonextx","tonexty","tonext"].indexOf(R.fill)!==-1&&z.indexOf(F)===-1&&z.push(F),z.push(B)),F=B)}s(T,I,z,g,x)}}};function s(T,l,g,x,A){for(var M=r.traceLayerClasses,_=T._fullLayout,w=_._zindices,m=_._modules,u,v,y,I=[],L=[],z=0;z1&&(Z+=a+j),U.push(w+Z),_=0;_1,y=l.mainplotinfo;if(!l.mainplot||v)if(u)l.xlines=n(x,"path","xlines-above"),l.ylines=n(x,"path","ylines-above"),l.xaxislayer=n(x,"g","xaxislayer-above"),l.yaxislayer=n(x,"g","yaxislayer-above");else{if(!_){var I=n(x,"g","layer-subplot");l.shapelayer=n(I,"g","shapelayer"),l.imagelayer=n(I,"g","imagelayer"),y&&v?(l.minorGridlayer=y.minorGridlayer,l.gridlayer=y.gridlayer,l.zerolinelayer=y.zerolinelayer):(l.minorGridlayer=n(x,"g","minor-gridlayer"),l.gridlayer=n(x,"g","gridlayer"),l.zerolinelayer=n(x,"g","zerolinelayer"));var L=n(x,"g","layer-between");l.shapelayerBetween=n(L,"g","shapelayer"),l.imagelayerBetween=n(L,"g","imagelayer"),n(x,"path","xlines-below"),n(x,"path","ylines-below"),l.overlinesBelow=n(x,"g","overlines-below"),n(x,"g","xaxislayer-below"),n(x,"g","yaxislayer-below"),l.overaxesBelow=n(x,"g","overaxes-below")}l.overplot=n(x,"g","overplot"),l.plot=n(l.overplot,"g",A),y&&v?l.zerolinelayerAbove=y.zerolinelayerAbove:l.zerolinelayerAbove=n(x,"g","zerolinelayer-above"),_||(l.xlines=n(x,"path","xlines-above"),l.ylines=n(x,"path","ylines-above"),l.overlinesAbove=n(x,"g","overlines-above"),n(x,"g","xaxislayer-above"),n(x,"g","yaxislayer-above"),l.overaxesAbove=n(x,"g","overaxes-above"),l.xlines=x.select(".xlines-"+w),l.ylines=x.select(".ylines-"+m),l.xaxislayer=x.select(".xaxislayer-"+w),l.yaxislayer=x.select(".yaxislayer-"+m))}else{var z=y.plotgroup,F=A+"-x",N=A+"-y";l.minorGridlayer=y.minorGridlayer,l.gridlayer=y.gridlayer,l.zerolinelayer=y.zerolinelayer,l.zerolinelayerAbove=y.zerolinelayerAbove,n(y.overlinesBelow,"path",F),n(y.overlinesBelow,"path",N),n(y.overaxesBelow,"g",F),n(y.overaxesBelow,"g",N),l.plot=n(y.overplot,"g",A),n(y.overlinesAbove,"path",F),n(y.overlinesAbove,"path",N),n(y.overaxesAbove,"g",F),n(y.overaxesAbove,"g",N),l.xlines=z.select(".overlines-"+w).select("."+F),l.ylines=z.select(".overlines-"+m).select("."+N),l.xaxislayer=z.select(".overaxes-"+w).select("."+F),l.yaxislayer=z.select(".overaxes-"+m).select("."+N)}_||(u||(i(l.minorGridlayer,"g",l.xaxis._id),i(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(B){return B[0]}).sort(t.idSort),i(l.gridlayer,"g",l.xaxis._id),i(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(B){return B[0]}).sort(t.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function p(T,l){if(T){var g={};T.each(function(m){var u=m[0],v=G.select(this);v.remove(),d(u,l),g[u]=!0});for(var x in l._plots)for(var A=l._plots[x],M=A.overlays||[],_=0;_=0,l=i.indexOf("end")>=0,g=f.backoff*p+a.standoff,x=c.backoff*d+a.startstandoff,A,M,_,w;if(s.nodeName==="line"){A={x:+n.attr("x1"),y:+n.attr("y1")},M={x:+n.attr("x2"),y:+n.attr("y2")};var m=A.x-M.x,u=A.y-M.y;if(_=Math.atan2(u,m),w=_+Math.PI,g&&x&&g+x>Math.sqrt(m*m+u*u)){Z();return}if(g){if(g*g>m*m+u*u){Z();return}var v=g*Math.cos(_),y=g*Math.sin(_);M.x+=v,M.y+=y,n.attr({x2:M.x,y2:M.y})}if(x){if(x*x>m*m+u*u){Z();return}var I=x*Math.cos(_),L=x*Math.sin(_);A.x-=I,A.y-=L,n.attr({x1:A.x,y1:A.y})}}else if(s.nodeName==="path"){var z=s.getTotalLength(),F="";if(z2/3?Nn="right":Nn="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[Nn]}for(var ot=!1,ft=["x","y"],rt=0;rt1)&&($t===Nt?(Je=rr.r2fraction(x["a"+Ft]),(Je<0||Je>1)&&(ot=!0)):ot=!0),$e=rr._offset+rr.r2p(x[Ft]),ye=.5}else{var Lt=Xe==="domain";Ft==="x"?(xe=x[Ft],$e=Lt?rr._offset+rr._length*xe:$e=u.l+u.w*xe):(xe=1-x[Ft],$e=Lt?rr._offset+rr._length*xe:$e=u.t+u.h*xe),ye=x.showarrow?.5:xe}if(x.showarrow){je.head=$e;var Ct=x["a"+Ft];if(Me=Mr*Ne(.5,x.xanchor)-Wr*Ne(.5,x.yanchor),$t===Nt){var Ot=t.getRefType($t);Ot==="domain"?(Ft==="y"&&(Ct=1-Ct),je.tail=rr._offset+rr._length*Ct):Ot==="paper"?Ft==="y"?(Ct=1-Ct,je.tail=u.t+u.h*Ct):je.tail=u.l+u.w*Ct:je.tail=rr._offset+rr.r2p(Ct),Ee=Me}else je.tail=$e+Ct,Ee=Me+Ct;je.text=je.tail+Me;var Wt=m[Ft==="x"?"width":"height"];if(Nt==="paper"&&(je.head=E.constrain(je.head,1,Wt-1)),$t==="pixel"){var _r=-Math.max(je.tail-3,je.text),pr=Math.min(je.tail+3,je.text)-Wt;_r>0?(je.tail+=_r,je.text+=_r):pr>0&&(je.tail-=pr,je.text-=pr)}je.tail+=Mt,je.head+=Mt}else Me=Sr*Ne(ye,Br),Ee=Me,je.text=$e+Me;je.text+=Mt,Me+=Mt,Ee+=Mt,x["_"+Ft+"padplus"]=Sr/2+Ee,x["_"+Ft+"padminus"]=Sr/2-Ee,x["_"+Ft+"size"]=Sr,x["_"+Ft+"shift"]=Me}if(ot){ce.remove();return}var hr=0,Fr=0;if(x.align!=="left"&&(hr=(Qe-st)*(x.align==="center"?.5:1)),x.valign!=="top"&&(Fr=(Le-nt)*(x.valign==="middle"?.5:1)),Ye)ze.select("svg").attr({x:ne+hr-1,y:ne+Fr}).call(o.setClipUrl,ue?B:null,g);else{var En=ne+Fr-it.top,Kn=ne+hr-it.left;ie.call(i.positionText,Kn,En).call(o.setClipUrl,ue?B:null,g)}te.select("rect").call(o.setRect,ne,ne,Qe,Le),K.call(o.setRect,V/2,V/2,Te-V,pe-V),ce.call(o.setTranslate,Math.round(R.x.text-Te/2),Math.round(R.y.text-pe/2)),Z.attr({transform:"rotate("+U+","+R.x.text+","+R.y.text+")"});var qn=function(ra,Nn){j.selectAll(".annotation-arrow-g").remove();var ka=R.x.head,qa=R.y.head,ir=R.x.tail+ra,qt=R.y.tail+Nn,ar=R.x.text+ra,lr=R.y.text+Nn,Vr=E.rotationXYMatrix(U,ar,lr),sn=E.apply2DTransform(Vr),mn=E.apply2DTransform2(Vr),wn=+K.attr("width"),Jn=+K.attr("height"),pa=ar-.5*wn,ha=pa+wn,_a=lr-.5*Jn,Ca=_a+Jn,Vn=[[pa,_a,pa,Ca],[pa,Ca,ha,Ca],[ha,Ca,ha,_a],[ha,_a,pa,_a]].map(mn);if(!Vn.reduce(function(At,or){return At^!!E.segmentsIntersect(ka,qa,ka+1e6,qa+1e6,or[0],or[1],or[2],or[3])},!1)){Vn.forEach(function(At){var or=E.segmentsIntersect(ir,qt,ka,qa,At[0],At[1],At[2],At[3]);or&&(ir=or.x,qt=or.y)});var yi=x.arrowwidth,Ci=x.arrowcolor,Dt=x.arrowside,yt=j.append("g").style({opacity:r.opacity(Ci)}).classed("annotation-arrow-g",!0),kr=yt.append("path").attr("d","M"+ir+","+qt+"L"+ka+","+qa).style("stroke-width",yi+"px").call(r.stroke,r.rgb(Ci));if(c(kr,Dt,x),v.annotationPosition&&kr.node().parentNode&&!M){var Nr=ka,jr=qa;if(x.standoff){var Ir=Math.sqrt(Math.pow(ka-ir,2)+Math.pow(qa-qt,2));Nr+=x.standoff*(ir-ka)/Ir,jr+=x.standoff*(qt-qa)/Ir}var Ur=yt.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(ir-Nr)+","+(qt-jr),transform:e(Nr,jr)}).style("stroke-width",yi+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),ln,$r;s.init({element:Ur.node(),gd:g,prepFn:function(){var At=o.getTranslate(ce);ln=At.x,$r=At.y,_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0)},moveFn:function(At,or){var Dr=sn(ln,$r),un=Dr[0]+At,Rn=Dr[1]+or;ce.call(o.setTranslate,un,Rn),F("x",T(_,At,"x",u,x)),F("y",T(w,or,"y",u,x)),x.axref===x.xref&&F("ax",T(_,At,"ax",u,x)),x.ayref===x.yref&&F("ay",T(w,or,"ay",u,x)),yt.attr("transform",e(At,or)),Z.attr({transform:"rotate("+U+","+un+","+Rn+")"})},doneFn:function(){b.call("_guiRelayout",g,N());var At=document.querySelector(".js-notes-box-panel");At&&At.redraw(At.selectedObj)}})}}};if(x.showarrow&&qn(0,0),re){var ta;s.init({element:ce.node(),gd:g,prepFn:function(){ta=Z.attr("transform")},moveFn:function(ra,Nn){var ka="pointer";if(x.showarrow)x.axref===x.xref?F("ax",T(_,ra,"ax",u,x)):F("ax",x.ax+ra),x.ayref===x.yref?F("ay",T(w,Nn,"ay",u.w,x)):F("ay",x.ay+Nn),qn(ra,Nn);else{if(M)return;var qa,ir;if(_)qa=T(_,ra,"x",u,x);else{var qt=x._xsize/u.w,ar=x.x+(x._xshift-x.xshift)/u.w-qt/2;qa=s.align(ar+ra/u.w,qt,0,1,x.xanchor)}if(w)ir=T(w,Nn,"y",u,x);else{var lr=x._ysize/u.h,Vr=x.y-(x._yshift+x.yshift)/u.h-lr/2;ir=s.align(Vr-Nn/u.h,lr,0,1,x.yanchor)}F("x",qa),F("y",ir),(!_||!w)&&(ka=s.getCursor(_?.5:qa,w?.5:ir,x.xanchor,x.yanchor))}Z.attr({transform:e(ra,Nn)+ta}),a(ce,ka)},clickFn:function(ra,Nn){x.captureevents&&g.emit("plotly_clickannotation",le(Nn))},doneFn:function(){a(ce),b.call("_guiRelayout",g,N());var ra=document.querySelector(".js-notes-box-panel");ra&&ra.redraw(ra.selectedObj)}})}}v.annotationText?ie.call(i.makeEditable,{delegate:ce,gd:g}).call(ve).on("edit",function(Ce){x.text=Ce,this.call(ve),F("text",Ce),_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0),b.call("_guiRelayout",g,N())}):ie.call(ve)}}}),o2=Ge({"src/components/annotations/click.js"($,G){var h=yn(),b=Io(),S=mu().arrayEditor;G.exports={hasClickToShow:E,onClick:e};function E(o,n){var i=t(o,n);return i.on.length>0||i.explicitOff.length>0}function e(o,n){var i=t(o,n),a=i.on,s=i.off.concat(i.explicitOff),f={},c=o._fullLayout.annotations,p,d;if(a.length||s.length){for(p=0;p1){a=!0;break}}a?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+n+'"]').remove():(i._pdata=b(e.glplot.cameraParams,[t.xaxis.r2l(i.x)*r[0],t.yaxis.r2l(i.y)*r[1],t.zaxis.r2l(i.z)*r[2]]),h(e.graphDiv,i,n,e.id,i._xa,i._ya))}}}}),ug=Ge({"src/components/annotations3d/index.js"($,G){var h=Io(),b=yn();G.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Up()}}},layoutAttributes:Up(),handleDefaults:l2(),includeBasePlot:S,convert:u2(),draw:wx()};function S(E,e){var t=h.subplotsRegistry.gl3d;if(t)for(var r=t.attrRegex,o=Object.keys(E),n=0;n0?l+p:p;return{ppad:p,ppadplus:d?x:A,ppadminus:d?A:x}}else return{ppad:p}}function o(n,i,a){var s=n._id.charAt(0)==="x"?"x":"y",f=n.type==="category"||n.type==="multicategory",c,p,d=0,T=0,l=f?n.r2c:n.d2c,g=i[s+"sizemode"]==="scaled";if(g?(c=i[s+"0"],p=i[s+"1"],f&&(d=i[s+"0shift"],T=i[s+"1shift"])):(c=i[s+"anchor"],p=i[s+"anchor"]),c!==void 0)return[l(c)+d,l(p)+T];if(i.path){var x=1/0,A=-1/0,M=i.path.match(S.segmentRE),_,w,m,u,v;for(n.type==="date"&&(l=E.decodeDate(l)),_=0;_A&&(A=v)));if(A>=x)return[x,A]}}}}),LM=Ge({"src/components/shapes/index.js"($,G){var h=rg();G.exports={moduleType:"component",name:"shapes",layoutAttributes:Ov(),supplyLayoutDefaults:Tx(),supplyDrawNewShapeDefaults:f5(),includeBasePlot:E1()("shapes"),calcAutorange:CM(),draw:h.draw,drawOne:h.drawOne}}}),h5=Ge({"src/components/images/attributes.js"($,G){var h=nh(),b=mu().templatedArray;sm(),G.exports=b("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",h.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",h.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),rv=Ge({"src/components/images/defaults.js"($,G){var h=yn(),b=Ss(),S=dv(),E=h5(),e="images";G.exports=function(o,n){var i={name:e,handleItemDefaults:t};S(o,n,i)};function t(r,o,n){function i(g,x){return h.coerce(r,o,E,g,x)}var a=i("source"),s=i("visible",!!a);if(!s)return o;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var f={_fullLayout:n},c=["x","y"],p=0;p<2;p++){var d=c[p],T=b.coerceRef(r,o,f,d,"paper",void 0);if(T!=="paper"){var l=b.getFromId(f,T);l._imgIndices.push(o._index)}b.coercePosition(o,f,i,T,d,0)}return o}}}),c2=Ge({"src/components/images/draw.js"($,G){var h=Za(),b=Ms(),S=Ss(),E=Lf(),e=Ad();G.exports=function(r){var o=r._fullLayout,n=[],i={},a=[],s,f;for(f=0;f0);c&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),h.noneOrAll(n,i,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),h.coerceFont(s,"font",a.font),s("bgcolor",a.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function o(n,i){function a(f,c){return h.coerce(n,i,t,f,c)}var s=a("visible",n.method==="skip"||Array.isArray(n.args));s&&(a("method"),a("args"),a("args2"),a("label"),a("execute"))}}}),PM=Ge({"src/components/updatemenus/scrollbox.js"($,G){G.exports=e;var h=Za(),b=So(),S=Ms(),E=yn();function e(t,r,o){this.gd=t,this.container=r,this.id=o,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.barWidth=2,e.barLength=20,e.barRadius=2,e.barPad=1,e.barColor="#808BA4",e.prototype.enable=function(r,o,n){var i=this.gd._fullLayout,a=i.width,s=i.height;this.position=r;var f=this.position.l,c=this.position.w,p=this.position.t,d=this.position.h,T=this.position.direction,l=T==="down",g=T==="left",x=T==="right",A=T==="up",M=c,_=d,w,m,u,v;!l&&!g&&!x&&!A&&(this.position.direction="down",l=!0);var y=l||A;y?(w=f,m=w+M,l?(u=p,v=Math.min(u+_,s),_=v-u):(v=p+_,u=Math.max(v-_,0),_=v-u)):(u=p,v=u+_,g?(m=f+M,w=Math.max(m-M,0),M=m-w):(w=f,m=Math.min(w+M,a),M=m-w)),this._box={l:w,t:u,w:M,h:_};var I=c>M,L=e.barLength+2*e.barPad,z=e.barWidth+2*e.barPad,F=f,N=p+d;N+z>s&&(N=s-z);var B=this.container.selectAll("rect.scrollbar-horizontal").data(I?[0]:[]);B.exit().on(".drag",null).remove(),B.enter().append("rect").classed("scrollbar-horizontal",!0).call(b.fill,e.barColor),I?(this.hbar=B.attr({rx:e.barRadius,ry:e.barRadius,x:F,y:N,width:L,height:z}),this._hbarXMin=F+L/2,this._hbarTranslateMax=M-L):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var R=d>_,U=e.barWidth+2*e.barPad,j=e.barLength+2*e.barPad,Z=f+c,re=p;Z+U>a&&(Z=a-U);var fe=this.container.selectAll("rect.scrollbar-vertical").data(R?[0]:[]);fe.exit().on(".drag",null).remove(),fe.enter().append("rect").classed("scrollbar-vertical",!0).call(b.fill,e.barColor),R?(this.vbar=fe.attr({rx:e.barRadius,ry:e.barRadius,x:Z,y:re,width:U,height:j}),this._vbarYMin=re+j/2,this._vbarTranslateMax=_-j):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var le=this.id,ce=w-.5,V=R?m+U+.5:m+.5,ee=u-.5,ne=I?v+z+.5:v+.5,K=i._topdefs.selectAll("#"+le).data(I||R?[0]:[]);if(K.exit().remove(),K.enter().append("clipPath").attr("id",le).append("rect"),I||R?(this._clipRect=K.select("rect").attr({x:Math.floor(ce),y:Math.floor(ee),width:Math.ceil(V)-Math.floor(ce),height:Math.ceil(ne)-Math.floor(ee)}),this.container.call(S.setClipUrl,le,this.gd),this.bg.attr({x:f,y:p,width:c,height:d})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(S.setClipUrl,null),delete this._clipRect),I||R){var ue=h.behavior.drag().on("dragstart",function(){h.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(ue);var te=h.behavior.drag().on("dragstart",function(){h.event.sourceEvent.preventDefault(),h.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));I&&this.hbar.on(".drag",null).call(te),R&&this.vbar.on(".drag",null).call(te)}this.setTranslate(o,n)},e.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(S.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},e.prototype._onBoxDrag=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r-=h.event.dx),this.vbar&&(o-=h.event.dy),this.setTranslate(r,o)},e.prototype._onBoxWheel=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r+=h.event.deltaY),this.vbar&&(o+=h.event.deltaY),this.setTranslate(r,o)},e.prototype._onBarDrag=function(){var r=this.translateX,o=this.translateY;if(this.hbar){var n=r+this._hbarXMin,i=n+this._hbarTranslateMax,a=E.constrain(h.event.x,n,i),s=(a-n)/(i-n),f=this.position.w-this._box.w;r=s*f}if(this.vbar){var c=o+this._vbarYMin,p=c+this._vbarTranslateMax,d=E.constrain(h.event.y,c,p),T=(d-c)/(p-c),l=this.position.h-this._box.h;o=T*l}this.setTranslate(r,o)},e.prototype.setTranslate=function(r,o){var n=this.position.w-this._box.w,i=this.position.h-this._box.h;if(r=E.constrain(r||0,0,n),o=E.constrain(o||0,0,i),this.translateX=r,this.translateY=o,this.container.call(S.setTranslate,this._box.l-this.position.l-r,this._box.t-this.position.t-o),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+r-.5),y:Math.floor(this.position.t+o-.5)}),this.hbar){var a=r/n;this.hbar.call(S.setTranslate,r+a*this._hbarTranslateMax,o)}if(this.vbar){var s=o/i;this.vbar.call(S.setTranslate,r,o+s*this._vbarTranslateMax)}}}}),v5=Ge({"src/components/updatemenus/draw.js"($,G){var h=Za(),b=$c(),S=So(),E=Ms(),e=yn(),t=ec(),r=mu().arrayEditor,o=ev().LINE_SPACING,n=R1(),i=PM();G.exports=function(L){var z=L._fullLayout,F=e.filterVisible(z[n.name]);function N(le){b.autoMargin(L,u(le))}var B=z._menulayer.selectAll("g."+n.containerClassName).data(F.length>0?[0]:[]);if(B.enter().append("g").classed(n.containerClassName,!0).style("cursor","pointer"),B.exit().each(function(){h.select(this).selectAll("g."+n.headerGroupClassName).each(N)}).remove(),F.length!==0){var R=B.selectAll("g."+n.headerGroupClassName).data(F,a);R.enter().append("g").classed(n.headerGroupClassName,!0);for(var U=e.ensureSingle(B,"g",n.dropdownButtonGroupClassName,function(le){le.style("pointer-events","all")}),j=0;j0?[0]:[]);Z.enter().append("g").classed(n.containerClassName,!0).style("cursor",R?null:"ew-resize");function re(V){V._commandObserver&&(V._commandObserver.remove(),delete V._commandObserver),b.autoMargin(B,c(V))}if(Z.exit().each(function(){h.select(this).selectAll("g."+n.groupClassName).each(re)}).remove(),j.length!==0){var fe=Z.selectAll("g."+n.groupClassName).data(j,d);fe.enter().append("g").classed(n.groupClassName,!0),fe.exit().each(re).remove();for(var le=0;le0&&(fe=fe.transition().duration(B.transition.duration).ease(B.transition.easing)),fe.attr("transform",t(re-n.gripWidth*.5,B._dims.currentValueTotalHeight))}}function I(N,B){var R=N._dims;return R.inputAreaStart+n.stepInset+(R.inputAreaLength-2*n.stepInset)*Math.min(1,Math.max(0,B))}function L(N,B){var R=N._dims;return Math.min(1,Math.max(0,(B-n.stepInset-R.inputAreaStart)/(R.inputAreaLength-2*n.stepInset-2*R.inputAreaStart)))}function z(N,B,R){var U=R._dims,j=e.ensureSingle(N,"rect",n.railTouchRectClass,function(Z){Z.call(m,B,N,R).style("pointer-events","all")});j.attr({width:U.inputAreaLength,height:Math.max(U.inputAreaWidth,n.tickOffset+R.ticklen+U.labelHeight)}).call(S.fill,R.bgcolor).attr("opacity",0),E.setTranslate(j,0,U.currentValueTotalHeight)}function F(N,B){var R=B._dims,U=R.inputAreaLength-n.railInset*2,j=e.ensureSingle(N,"rect",n.railRectClass);j.attr({width:U,height:n.railWidth,rx:n.railRadius,ry:n.railRadius,"shape-rendering":"crispEdges"}).call(S.stroke,B.bordercolor).call(S.fill,B.bgcolor).style("stroke-width",B.borderwidth+"px"),E.setTranslate(j,n.railInset,(R.inputAreaWidth-n.railWidth)*.5+R.currentValueTotalHeight)}}}),d5=Ge({"src/components/sliders/index.js"($,G){var h=I1();G.exports={moduleType:"component",name:h.name,layoutAttributes:hm(),supplyLayoutDefaults:f2(),draw:Ax()}}}),vm=Ge({"src/components/rangeslider/attributes.js"($,G){var h=rh();G.exports={bgcolor:{valType:"color",dflt:h.background,editType:"plot"},bordercolor:{valType:"color",dflt:h.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),Sx=Ge({"src/components/rangeslider/oppaxis_attributes.js"($,G){G.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),ly=Ge({"src/components/rangeslider/constants.js"($,G){G.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),Mx=Ge({"src/components/rangeslider/helpers.js"($){var G=Lf(),h=ec(),b=ly(),S=ev().LINE_SPACING,E=b.name;function e(t){var r=t&&t[E];return r&&r.visible}$.isVisible=e,$.makeData=function(t){for(var r=G.list({_fullLayout:t},"x",!0),o=t.margin,n=[],i=0;i=st.max)Ye=ve[it+1];else if(ze=st.pmax)Ye=ve[it+1];else if(ze0?m.touches[0].clientX:0}function p(m,u,v,y){if(u._context.staticPlot)return;var I=m.select("rect."+f.slideBoxClassName).node(),L=m.select("rect."+f.grabAreaMinClassName).node(),z=m.select("rect."+f.grabAreaMaxClassName).node();function F(){var N=h.event,B=N.target,R=c(N),U=R-m.node().getBoundingClientRect().left,j=y.d2p(v._rl[0]),Z=y.d2p(v._rl[1]),re=a.coverSlip();this.addEventListener("touchmove",fe),this.addEventListener("touchend",le),re.addEventListener("mousemove",fe),re.addEventListener("mouseup",le);function fe(ce){var V=c(ce),ee=+V-R,ne,K,ue;switch(B){case I:if(ue="ew-resize",j+ee>v._length||Z+ee<0)return;ne=j+ee,K=Z+ee;break;case L:if(ue="col-resize",j+ee>v._length)return;ne=j+ee,K=Z;break;case z:if(ue="col-resize",Z+ee<0)return;ne=j,K=Z+ee;break;default:ue="ew-resize",ne=U,K=U+ee;break}if(K0);if(g){var x=o(a,s,f);T("x",x[0]),T("y",x[1]),h.noneOrAll(i,a,["x","y"]),T("xanchor"),T("yanchor"),h.coerceFont(T,"font",s.font);var A=T("bgcolor");T("activecolor",b.contrast(A,t.lightAmount,t.darkAmount)),T("bordercolor"),T("borderwidth")}};function r(n,i,a,s){var f=s.calendar;function c(T,l){return h.coerce(n,i,e.buttons,T,l)}var p=c("visible");if(p){var d=c("step");d!=="all"&&(f&&f!=="gregorian"&&(d==="month"||d==="year")?i.stepmode="backward":c("stepmode"),c("count")),c("label")}}function o(n,i,a){for(var s=a.filter(function(d){return i[d].anchor===n._id}),f=0,c=0;c1)){delete f.grid;return}if(!T&&!l&&!g){var v=w("pattern")==="independent";v&&(T=!0)}_._hasSubplotGrid=T;var y=w("roworder"),I=y==="top to bottom",L=T?.2:.1,z=T?.3:.1,F,N;x&&f._splomGridDflt&&(F=f._splomGridDflt.xside,N=f._splomGridDflt.yside),_._domains={x:n("x",w,L,F,u),y:n("y",w,z,N,m,I)}}function n(s,f,c,p,d,T){var l=f(s+"gap",c),g=f("domain."+s);f(s+"side",p);for(var x=new Array(d),A=g[0],M=(g[1]-A)/(d-l),_=M*(1-l),w=0;w0,p=r._context.staticPlot;o.each(function(d){var T=d[0].trace,l=T.error_x||{},g=T.error_y||{},x;T.ids&&(x=function(w){return w.id});var A=E.hasMarkers(T)&&T.marker.maxdisplayed>0;!g.visible&&!l.visible&&(d=[]);var M=h.select(this).selectAll("g.errorbar").data(d,x);if(M.exit().remove(),!!d.length){l.visible||M.selectAll("path.xerror").remove(),g.visible||M.selectAll("path.yerror").remove(),M.style("opacity",1);var _=M.enter().append("g").classed("errorbar",!0);c&&_.style("opacity",0).transition().duration(i.duration).style("opacity",1),S.setClipUrl(M,n.layerClipId,r),M.each(function(w){var m=h.select(this),u=e(w,s,f);if(!(A&&!w.vis)){var v,y=m.select("path.yerror");if(g.visible&&b(u.x)&&b(u.yh)&&b(u.ys)){var I=g.width;v="M"+(u.x-I)+","+u.yh+"h"+2*I+"m-"+I+",0V"+u.ys,u.noYS||(v+="m-"+I+",0h"+2*I),a=!y.size(),a?y=m.append("path").style("vector-effect",p?"none":"non-scaling-stroke").classed("yerror",!0):c&&(y=y.transition().duration(i.duration).ease(i.easing)),y.attr("d",v)}else y.remove();var L=m.select("path.xerror");if(l.visible&&b(u.y)&&b(u.xh)&&b(u.xs)){var z=(l.copy_ystyle?g:l).width;v="M"+u.xh+","+(u.y-z)+"v"+2*z+"m0,-"+z+"H"+u.xs,u.noXS||(v+="m0,-"+z+"v"+2*z),a=!L.size(),a?L=m.append("path").style("vector-effect",p?"none":"non-scaling-stroke").classed("xerror",!0):c&&(L=L.transition().duration(i.duration).ease(i.easing)),L.attr("d",v)}else L.remove()}})}})};function e(t,r,o){var n={x:r.c2p(t.x),y:o.c2p(t.y)};return t.yh!==void 0&&(n.yh=o.c2p(t.yh),n.ys=o.c2p(t.ys),b(n.ys)||(n.noYS=!0,n.ys=o.c2p(t.ys,!0))),t.xh!==void 0&&(n.xh=r.c2p(t.xh),n.xs=r.c2p(t.xs),b(n.xs)||(n.noXS=!0,n.xs=r.c2p(t.xs,!0))),n}}}),pm=Ge({"src/components/errorbars/style.js"($,G){var h=Za(),b=So();G.exports=function(E){E.each(function(e){var t=e[0].trace,r=t.error_y||{},o=t.error_x||{},n=h.select(this);n.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(b.stroke,r.color),o.copy_ystyle&&(o=r),n.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(b.stroke,o.color)})}}}),mm=Ge({"src/components/errorbars/index.js"($,G){var h=yn(),b=Uc().overrideAll,S=dm(),E={error_x:h.extendFlat({},S),error_y:h.extendFlat({},S)};delete E.error_x.copy_zstyle,delete E.error_y.copy_zstyle,delete E.error_y.copy_ystyle;var e={error_x:h.extendFlat({},S),error_y:h.extendFlat({},S),error_z:h.extendFlat({},S)};delete e.error_x.copy_ystyle,delete e.error_y.copy_ystyle,delete e.error_z.copy_ystyle,delete e.error_z.copy_zstyle,G.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:E,bar:E,histogram:E,scatter3d:b(e,"calc","nested"),scattergl:b(E,"calc","nested")}},supplyDefaults:g5(),calc:d2(),makeComputeError:O0(),plot:p2(),style:pm(),hoverInfo:t};function t(r,o,n){(o.error_y||{}).visible&&(n.yerr=r.yh-r.y,o.error_y.symmetric||(n.yerrneg=r.y-r.ys)),(o.error_x||{}).visible&&(n.xerr=r.xh-r.x,o.error_x.symmetric||(n.xerrneg=r.x-r.xs))}}}),O1=Ge({"src/components/colorbar/constants.js"($,G){G.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),m2=Ge({"src/components/colorbar/draw.js"($,G){var h=Za(),b=ks(),S=$c(),E=Io(),e=Ss(),t=nd(),r=yn(),o=r.strTranslate,n=Qi().extendFlat,i=Ip(),a=Ms(),s=So(),f=am(),c=ec(),p=vv().flipScale,d=Np(),T=Md(),l=tv(),g=ev(),x=g.LINE_SPACING,A=g.FROM_TL,M=g.FROM_BR,_=O1().cn;function w(L){var z=L._fullLayout,F=z._infolayer.selectAll("g."+_.colorbar).data(m(L),function(N){return N._id});F.enter().append("g").attr("class",function(N){return N._id}).classed(_.colorbar,!0),F.each(function(N){var B=h.select(this);r.ensureSingle(B,"rect",_.cbbg),r.ensureSingle(B,"g",_.cbfills),r.ensureSingle(B,"g",_.cblines),r.ensureSingle(B,"g",_.cbaxis,function(U){U.classed(_.crisp,!0)}),r.ensureSingle(B,"g",_.cbtitleunshift,function(U){U.append("g").classed(_.cbtitle,!0)}),r.ensureSingle(B,"rect",_.cboutline);var R=u(B,N,L);R&&R.then&&(L._promises||[]).push(R),L._context.edits.colorbarPosition&&v(B,N,L)}),F.exit().each(function(N){S.autoMargin(L,N._id)}).remove(),F.order()}function m(L){var z=L._fullLayout,F=L.calcdata,N=[],B,R,U,j;function Z(H){return n(H,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function re(){typeof j.calc=="function"?j.calc(L,U,B):(B._fillgradient=R.reversescale?p(R.colorscale):R.colorscale,B._zrange=[R[j.min],R[j.max]])}for(var fe=0;fe1){var je=Math.pow(10,Math.floor(Math.log(Mt)/Math.LN10));Sr*=je*r.roundUp(Mt/je,[2,5,10]),(Math.abs(it.start)/it.size+1e-6)%1<2e-6&&(Mr.tick0=0)}Mr.dtick=Sr}Mr.domain=N?[rr+ee/ae.h,rr+Ne-ee/ae.h]:[rr+V/ae.w,rr+Ne-V/ae.w],Mr.setScale(),L.attr("transform",o(Math.round(ae.l),Math.round(ae.t)));var $e=L.select("."+_.cbtitleunshift).attr("transform",o(-Math.round(ae.l),-Math.round(ae.t))),Ee=Mr.ticklabelposition,xe=Mr.title.font.size,ye=L.select("."+_.cbaxis),Me,Xe=0,Je=0;function Lt(pr,hr){var Fr={propContainer:Mr,propName:z._propPrefix+"title.text",traceIndex:z._traceIndex,_meta:z._meta,placeholder:H._dfltTitle.colorbar,containerGroup:L.select("."+_.cbtitle)},En=pr.charAt(0)==="h"?pr.slice(1):"h"+pr;L.selectAll("."+En+",."+En+"-math-group").remove(),f.draw(F,pr,n(Fr,hr||{}))}function Ct(){if(N&&Wr||!N&&!Wr){var pr,hr;Ce==="top"&&(pr=V+ae.l+ot*ne,hr=ee+ae.t+ft*(1-rr-Ne)+3+xe*.75),Ce==="bottom"&&(pr=V+ae.l+ot*ne,hr=ee+ae.t+ft*(1-rr)-3-xe*.25),Ce==="right"&&(hr=ee+ae.t+ft*K+3+xe*.75,pr=V+ae.l+ot*rr),Lt(Mr._id+"title",{attributes:{x:pr,y:hr,"text-anchor":N?"start":"middle"}})}}function Ot(){if(N&&!Wr||!N&&Wr){var pr=Mr.position||0,hr=Mr._offset+Mr._length/2,Fr,En;if(Ce==="right")En=hr,Fr=ae.l+ot*pr+10+xe*(Mr.showticklabels?1:.5);else if(Fr=hr,Ce==="bottom"&&(En=ae.t+ft*pr+10+(Ee.indexOf("inside")===-1?Mr.tickfont.size:0)+(Mr.ticks!=="inside"&&z.ticklen||0)),Ce==="top"){var Kn=Ae.text.split("
").length;En=ae.t+ft*pr+10-Le-x*xe*Kn}Lt((N?"h":"v")+Mr._id+"title",{avoid:{selection:h.select(F).selectAll("g."+Mr._id+"tick"),side:Ce,offsetTop:N?0:ae.t,offsetLeft:N?ae.l:0,maxShift:N?H.width:H.height},attributes:{x:Fr,y:En,"text-anchor":"middle"},transform:{rotate:N?-90:0,offset:0}})}}function Wt(){if(!N&&!Wr||N&&Wr){var pr=L.select("."+_.cbtitle),hr=pr.select("text"),Fr=[-Z/2,Z/2],En=pr.select(".h"+Mr._id+"title-math-group").node(),Kn=15.6;hr.node()&&(Kn=parseInt(hr.node().style.fontSize,10)*x);var qn;if(En?(qn=a.bBox(En),Je=qn.width,Xe=qn.height,Xe>Kn&&(Fr[1]-=(Xe-Kn)/2)):hr.node()&&!hr.classed(_.jsPlaceholder)&&(qn=a.bBox(hr.node()),Je=qn.width,Xe=qn.height),N){if(Xe){if(Xe+=5,Ce==="top")Mr.domain[1]-=Xe/ae.h,Fr[1]*=-1;else{Mr.domain[0]+=Xe/ae.h;var ta=c.lineCount(hr);Fr[1]+=(1-ta)*Kn}pr.attr("transform",o(Fr[0],Fr[1])),Mr.setScale()}}else Je&&(Ce==="right"&&(Mr.domain[0]+=(Je+xe/2)/ae.w),pr.attr("transform",o(Fr[0],Fr[1])),Mr.setScale())}L.selectAll("."+_.cbfills+",."+_.cblines).attr("transform",N?o(0,Math.round(ae.h*(1-Mr.domain[1]))):o(Math.round(ae.w*Mr.domain[0]),0)),ye.attr("transform",N?o(0,Math.round(-ae.t)):o(Math.round(-ae.l),0));var ra=L.select("."+_.cbfills).selectAll("rect."+_.cbfill).attr("style","").data(nt);ra.enter().append("rect").classed(_.cbfill,!0).attr("style",""),ra.exit().remove();var Nn=Fe.map(Mr.c2p).map(Math.round).sort(function(ar,lr){return ar-lr});ra.each(function(ar,lr){var Vr=[lr===0?Fe[0]:(nt[lr]+nt[lr-1])/2,lr===nt.length-1?Fe[1]:(nt[lr]+nt[lr+1])/2].map(Mr.c2p).map(Math.round);N&&(Vr[1]=r.constrain(Vr[1]+(Vr[1]>Vr[0])?1:-1,Nn[0],Nn[1]));var sn=h.select(this).attr(N?"x":"y",rt).attr(N?"y":"x",h.min(Vr)).attr(N?"width":"height",Math.max(Le,2)).attr(N?"height":"width",Math.max(h.max(Vr)-h.min(Vr),2));if(z._fillgradient)a.gradient(sn,F,z._id,N?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var mn=Ye(ar).replace("e-","");sn.attr("fill",b(mn).toHexString())}});var ka=L.select("."+_.cblines).selectAll("path."+_.cbline).data(ve.color&&ve.width?Qe:[]);ka.enter().append("path").classed(_.cbline,!0),ka.exit().remove(),ka.each(function(ar){var lr=rt,Vr=Math.round(Mr.c2p(ar))+ve.width/2%1;h.select(this).attr("d","M"+(N?lr+","+Vr:Vr+","+lr)+(N?"h":"v")+Le).call(a.lineGroupStyle,ve.width,ze(ar),ve.dash)}),ye.selectAll("g."+Mr._id+"tick,path").remove();var qa=rt+Le+(Z||0)/2-(z.ticks==="outside"?1:0),ir=e.calcTicks(Mr),qt=e.getTickSigns(Mr)[2];return e.drawTicks(F,Mr,{vals:Mr.ticks==="inside"?e.clipEnds(Mr,ir):ir,layer:ye,path:e.makeTickPath(Mr,qa,qt),transFn:e.makeTransTickFn(Mr)}),e.drawLabels(F,Mr,{vals:ir,layer:ye,transFn:e.makeTransTickLabelFn(Mr),labelFns:e.makeLabelFns(Mr,qa)})}function _r(){var pr,hr=Le+Z/2;Ee.indexOf("inside")===-1&&(pr=a.bBox(ye.node()),hr+=N?pr.width:pr.height),Me=$e.select("text");var Fr=0,En=N&&Ce==="top",Kn=!N&&Ce==="right",qn=0;if(Me.node()&&!Me.classed(_.jsPlaceholder)){var ta,ra=$e.select(".h"+Mr._id+"title-math-group").node();ra&&(N&&Wr||!N&&!Wr)?(pr=a.bBox(ra),Fr=pr.width,ta=pr.height):(pr=a.bBox($e.node()),Fr=pr.right-ae.l-(N?rt:Er),ta=pr.bottom-ae.t-(N?Er:rt),!N&&Ce==="top"&&(hr+=pr.height,qn=pr.height)),Kn&&(Me.attr("transform",o(Fr/2+xe/2,0)),Fr*=2),hr=Math.max(hr,N?Fr:ta)}var Nn=(N?V:ee)*2+hr+re+Z/2,ka=0;!N&&Ae.text&&ce==="bottom"&&K<=0&&(ka=Nn/2,Nn+=ka,qn+=ka),H._hColorbarMoveTitle=ka,H._hColorbarMoveCBTitle=qn;var qa=re+Z,ir=(N?rt:Er)-qa/2-(N?V:0),qt=(N?Er:rt)-(N?pe:ee+qn-ka);L.select("."+_.cbbg).attr("x",ir).attr("y",qt).attr(N?"width":"height",Math.max(Nn-ka,2)).attr(N?"height":"width",Math.max(pe+qa,2)).call(s.fill,fe).call(s.stroke,z.bordercolor).style("stroke-width",re);var ar=Kn?Math.max(Fr-10,0):0;L.selectAll("."+_.cboutline).attr("x",(N?rt:Er+V)+ar).attr("y",(N?Er+ee-pe:rt)+(En?Xe:0)).attr(N?"width":"height",Math.max(Le,2)).attr(N?"height":"width",Math.max(pe-(N?2*ee+Xe:2*V+ar),2)).call(s.stroke,z.outlinecolor).style({fill:"none","stroke-width":Z});var lr=N?Ft*Nn:0,Vr=N?0:(1-Nt)*Nn-qn;if(lr=te?ae.l-lr:-lr,Vr=ue?ae.t-Vr:-Vr,L.attr("transform",o(lr,Vr)),!N&&(re||b(fe).getAlpha()&&!b.equals(H.paper_bgcolor,fe))){var sn=ye.selectAll("text"),mn=sn[0].length,wn=L.select("."+_.cbbg).node(),Jn=a.bBox(wn),pa=a.getTranslate(L),ha=2;sn.each(function(jr,Ir){var Ur=0,ln=mn-1;if(Ir===Ur||Ir===ln){var $r=a.bBox(this),At=a.getTranslate(this),or;if(Ir===ln){var Dr=$r.right+At.x,un=Jn.right+pa.x+Er-re-ha+ne;or=un-Dr,or>0&&(or=0)}else if(Ir===Ur){var Rn=$r.left+At.x,jn=Jn.left+pa.x+Er+re+ha;or=jn-Rn,or<0&&(or=0)}or&&(mn<3?this.setAttribute("transform","translate("+or+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var _a={},Ca=A[le],Vn=M[le],yi=A[ce],Ci=M[ce],Dt=Nn-Le;N?(R==="pixels"?(_a.y=K,_a.t=pe*yi,_a.b=pe*Ci):(_a.t=_a.b=0,_a.yt=K+B*yi,_a.yb=K-B*Ci),j==="pixels"?(_a.x=ne,_a.l=Nn*Ca,_a.r=Nn*Vn):(_a.l=Dt*Ca,_a.r=Dt*Vn,_a.xl=ne-U*Ca,_a.xr=ne+U*Vn)):(R==="pixels"?(_a.x=ne,_a.l=pe*Ca,_a.r=pe*Vn):(_a.l=_a.r=0,_a.xl=ne+B*Ca,_a.xr=ne-B*Vn),j==="pixels"?(_a.y=1-K,_a.t=Nn*yi,_a.b=Nn*Ci):(_a.t=Dt*yi,_a.b=Dt*Ci,_a.yt=K-U*yi,_a.yb=K+U*Ci));var yt=z.y<.5?"b":"t",kr=z.x<.5?"l":"r";F._fullLayout._reservedMargin[z._id]={};var Nr={r:H.width-ir-lr,l:ir+_a.r,b:H.height-qt-Vr,t:qt+_a.b};te&&ue?S.autoMargin(F,z._id,_a):te?F._fullLayout._reservedMargin[z._id][yt]=Nr[yt]:ue||N?F._fullLayout._reservedMargin[z._id][kr]=Nr[kr]:F._fullLayout._reservedMargin[z._id][yt]=Nr[yt]}return r.syncOrAsync([S.previousPromises,Ct,Wt,Ot,S.previousPromises,_r],F)}function v(L,z,F){var N=z.orientation==="v",B=F._fullLayout,R=B._size,U,j,Z;t.init({element:L.node(),gd:F,prepFn:function(){U=L.attr("transform"),i(L)},moveFn:function(re,fe){L.attr("transform",U+o(re,fe)),j=t.align((N?z._uFrac:z._vFrac)+re/R.w,N?z._thickFrac:z._lenFrac,0,1,z.xanchor),Z=t.align((N?z._vFrac:1-z._uFrac)-fe/R.h,N?z._lenFrac:z._thickFrac,0,1,z.yanchor);var le=t.getCursor(j,Z,z.xanchor,z.yanchor);i(L,le)},doneFn:function(){if(i(L),j!==void 0&&Z!==void 0){var re={};re[z._propPrefix+"x"]=j,re[z._propPrefix+"y"]=Z,z._traceIndex!==void 0?E.call("_guiRestyle",F,re,z._traceIndex):E.call("_guiRelayout",F,re)}}})}function y(L,z,F){var N=z._levels,B=[],R=[],U,j,Z=N.end+N.size/100,re=N.size,fe=1.001*F[0]-.001*F[1],le=1.001*F[1]-.001*F[0];for(j=0;j<1e5&&(U=N.start+j*re,!(re>0?U>=Z:U<=Z));j++)U>fe&&U0?U>=Z:U<=Z));j++)U>F[0]&&U-1}G.exports=function(o,n){var i,a=o.data,s=o.layout,f=E([],a),c=E({},s,e(n.tileClass)),p=o._context||{};if(n.width&&(c.width=n.width),n.height&&(c.height=n.height),n.tileClass==="thumbnail"||n.tileClass==="themes__thumb"){c.annotations=[];var d=Object.keys(c);for(i=0;i=0)return p}else if(typeof p=="string"&&(p=p.trim(),p.slice(-1)==="%"&&h(p.slice(0,-1))&&(p=+p.slice(0,-1),p>=0)))return p+"%"}function c(p,d,T,l,g,x){x=x||{};var A=x.moduleHasSelected!==!1,M=x.moduleHasUnselected!==!1,_=x.moduleHasConstrain!==!1,w=x.moduleHasCliponaxis!==!1,m=x.moduleHasTextangle!==!1,u=x.moduleHasInsideanchor!==!1,v=!!x.hasPathbar,y=Array.isArray(g)||g==="auto",I=y||g==="inside",L=y||g==="outside";if(I||L){var z=i(l,"textfont",T.font),F=b.extendFlat({},z),N=p.textfont&&p.textfont.color,B=!N;if(B&&delete F.color,i(l,"insidetextfont",F),v){var R=b.extendFlat({},z);B&&delete R.color,i(l,"pathbar.textfont",R)}L&&i(l,"outsidetextfont",z),A&&l("selected.textfont.color"),M&&l("unselected.textfont.color"),_&&l("constraintext"),w&&l("cliponaxis"),m&&l("textangle"),l("texttemplate"),l("texttemplatefallback")}I&&u&&l("insidetextanchor")}G.exports={supplyDefaults:a,crossTraceDefaults:s,handleText:c,validateCornerradius:f}}}),x2=Ge({"src/traces/bar/layout_defaults.js"($,G){var h=Io(),b=Ss(),S=yn(),E=Ed(),e=kd().validateCornerradius;G.exports=function(t,r,o){function n(A,M){return S.coerce(t,r,E,A,M)}for(var i=!1,a=!1,s=!1,f={},c=n("barmode"),p=c==="group",d=0;d0&&!f[l]&&(s=!0),f[l]=!0),T.visible&&T.type==="histogram"){var g=b.getFromId({_fullLayout:r},T[T.orientation==="v"?"xaxis":"yaxis"]);g.type!=="category"&&(a=!0)}}if(!i){delete r.barmode;return}c!=="overlay"&&n("barnorm"),n("bargap",a&&!s?0:.2),n("bargroupgap");var x=n("barcornerradius");r.barcornerradius=e(x)}}}),jp=Ge({"src/traces/bar/arrays_to_calcdata.js"($,G){var h=yn();G.exports=function(S,E){for(var e=0;er;if(!o)return E}return e!==void 0?e:S.dflt},$.coerceColor=function(S,E,e){return h(E).isValid()?E:e!==void 0?e:S.dflt},$.coerceEnumerated=function(S,E,e){return S.coerceNumber&&(E=+E),S.values.indexOf(E)!==-1?E:e!==void 0?e:S.dflt},$.getValue=function(S,E){var e;return b(S)?E1||v.bargap===0&&v.bargroupgap===0&&!y[0].trace.marker.line.width)&&h.select(this).attr("shape-rendering","crispEdges")}),m.selectAll("g.points").each(function(y){var I=h.select(this),L=y[0].trace;f(I,L,w)}),e.getComponentMethod("errorbars","style")(m)}function f(w,m,u){S.pointStyle(w.selectAll("path"),m,u),c(w,m,u)}function c(w,m,u){w.selectAll("text").each(function(v){var y=h.select(this),I=E.ensureUniformFontSize(u,l(y,v,m,u));S.font(y,I)})}function p(w,m,u){var v=m[0].trace;v.selectedpoints?d(u,v,w):(f(u,v,w),e.getComponentMethod("errorbars","style")(u))}function d(w,m,u){S.selectedPointStyle(w.selectAll("path"),m),T(w.selectAll("text"),m,u)}function T(w,m,u){w.each(function(v){var y=h.select(this),I;if(v.selected){I=E.ensureUniformFontSize(u,l(y,v,m,u));var L=m.selected.textfont&&m.selected.textfont.color;L&&(I.color=L),S.font(y,I)}else S.selectedTextStyle(y,m)})}function l(w,m,u,v){var y=v._fullLayout.font,I=u.textfont;if(w.classed("bartext-inside")){var L=_(m,u);I=x(u,m.i,y,L)}else w.classed("bartext-outside")&&(I=A(u,m.i,y));return I}function g(w,m,u){return M(o,w.textfont,m,u)}function x(w,m,u,v){var y=g(w,m,u),I=w._input.textfont===void 0||w._input.textfont.color===void 0||Array.isArray(w.textfont.color)&&w.textfont.color[m]===void 0;return I&&(y={color:b.contrast(v),family:y.family,size:y.size,weight:y.weight,style:y.style,variant:y.variant,textcase:y.textcase,lineposition:y.lineposition,shadow:y.shadow}),M(n,w.insidetextfont,m,y)}function A(w,m,u){var v=g(w,m,u);return M(i,w.outsidetextfont,m,v)}function M(w,m,u,v){m=m||{};var y=a.getValue(m.family,u),I=a.getValue(m.size,u),L=a.getValue(m.color,u),z=a.getValue(m.weight,u),F=a.getValue(m.style,u),N=a.getValue(m.variant,u),B=a.getValue(m.textcase,u),R=a.getValue(m.lineposition,u),U=a.getValue(m.shadow,u);return{family:a.coerceString(w.family,y,v.family),size:a.coerceNumber(w.size,I,v.size),color:a.coerceColor(w.color,L,v.color),weight:a.coerceString(w.weight,z,v.weight),style:a.coerceString(w.style,F,v.style),variant:a.coerceString(w.variant,N,v.variant),textcase:a.coerceString(w.variant,B,v.textcase),lineposition:a.coerceString(w.variant,R,v.lineposition),shadow:a.coerceString(w.variant,U,v.shadow)}}function _(w,m){return m.type==="waterfall"?m[w.dir].marker.color:w.mcc||w.mc||m.marker.color}G.exports={style:s,styleTextPoints:c,styleOnSelect:p,getInsideTextFont:x,getOutsideTextFont:A,getBarColor:_,resizeText:t}}}),au=Ge({"src/traces/bar/plot.js"($,G){var h=Za(),b=Ga(),S=yn(),E=ec(),e=So(),t=Ms(),r=Io(),o=Ss().tickText,n=sc(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=mv(),f=fy(),c=gm(),p=Bh(),d=p.text,T=p.textposition,l=Hv().appendArrayPointValue,g=c.TEXTPAD;function x(re){return re.id}function A(re){if(re.ids)return x}function M(re){return(re>0)-(re<0)}function _(re,fe){return re0}function v(re,fe,le,ce,V,ee){var ne=fe.xaxis,K=fe.yaxis,ue=re._fullLayout,te=re._context.staticPlot;V||(V={mode:ue.barmode,norm:ue.barmode,gap:ue.bargap,groupgap:ue.bargroupgap},a("bar",ue));var H=S.makeTraceGroups(ce,le,"trace bars").each(function(ae){var ie=h.select(this),ve=ae[0].trace,Ae=ae[0].t,Ce=ve.type==="waterfall",Fe=ve.type==="funnel",ze=ve.type==="histogram",Ye=ve.type==="bar",it=Ye||Fe,st=0;Ce&&ve.connector.visible&&ve.connector.mode==="between"&&(st=ve.connector.line.width/2);var nt=ve.orientation==="h",Qe=u(V),Le=S.ensureSingle(ie,"g","points"),Te=A(ve),pe=Le.selectAll("g.point").data(S.identity,Te);pe.enter().append("g").classed("point",!0),pe.exit().remove(),pe.each(function(ot,ft){var rt=h.select(this),Ft=w(ot,ne,K,nt),Nt=Ft[0][0],$t=Ft[0][1],rr=Ft[1][0],Er=Ft[1][1],Mr=(nt?$t-Nt:Er-rr)===0;Mr&&it&&f.getLineWidth(ve,ot)&&(Mr=!1),Mr||(Mr=!b(Nt)||!b($t)||!b(rr)||!b(Er)),ot.isBlank=Mr,Mr&&(nt?$t=Nt:Er=rr),st&&!Mr&&(nt?(Nt-=_(Nt,$t)*st,$t+=_(Nt,$t)*st):(rr-=_(rr,Er)*st,Er+=_(rr,Er)*st));var Wr,Sr;if(ve.type==="waterfall"){if(!Mr){var Br=ve[ot.dir].marker;Wr=Br.line.width,Sr=Br.color}}else Wr=f.getLineWidth(ve,ot),Sr=ot.mc||ve.marker.color;function Mt(qa){var ir=h.round(Wr/2%1,2);return V.gap===0&&V.groupgap===0?h.round(Math.round(qa)-ir,2):qa}function je(qa,ir,qt){return qt&&qa===ir?qa:Math.abs(qa-ir)>=2?Mt(qa):qa>ir?Math.ceil(qa):Math.floor(qa)}var $e=e.opacity(Sr),Ee=$e<1||Wr>.01?Mt:je;re._context.staticPlot||(Nt=Ee(Nt,$t,nt),$t=Ee($t,Nt,nt),rr=Ee(rr,Er,!nt),Er=Ee(Er,rr,!nt));var xe=nt?ne.c2p:K.c2p,ye;ot.s0>0?ye=ot._sMax:ot.s0<0?ye=ot._sMin:ye=ot.s1>0?ot._sMax:ot._sMin;function Me(qa,ir){if(!qa)return 0;var qt=Math.abs(nt?Er-rr:$t-Nt),ar=Math.abs(nt?$t-Nt:Er-rr),lr=Ee(Math.abs(xe(ye,!0)-xe(0,!0))),Vr=ot.hasB?Math.min(qt/2,ar/2):Math.min(qt/2,lr),sn;if(ir==="%"){var mn=Math.min(50,qa);sn=qt*(mn/100)}else sn=qa;return Ee(Math.max(Math.min(sn,Vr),0))}var Xe=Ye||ze?Me(Ae.cornerradiusvalue,Ae.cornerradiusform):0,Je,Lt,Ct="M"+Nt+","+rr+"V"+Er+"H"+$t+"V"+rr+"Z",Ot=0;if(Xe&&ot.s){var Wt=M(ot.s0)===0||M(ot.s)===M(ot.s0)?ot.s1:ot.s0;if(Ot=Ee(ot.hasB?0:Math.abs(xe(ye,!0)-xe(Wt,!0))),Ot0?Math.sqrt(Ot*(2*Xe-Ot)):0,Kn=_r>0?Math.max:Math.min;Je="M"+Nt+","+rr+"V"+(Er-Fr*pr)+"H"+Kn($t-(Xe-Ot)*_r,Nt)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+$t+","+(Er-Xe*pr-En)+"V"+(rr+Xe*pr+En)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+Kn($t-(Xe-Ot)*_r,Nt)+","+(rr+Fr*pr)+"Z"}else if(ot.hasB)Je="M"+(Nt+Xe*_r)+","+rr+"A "+Xe+","+Xe+" 0 0 "+hr+" "+Nt+","+(rr+Xe*pr)+"V"+(Er-Xe*pr)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+(Nt+Xe*_r)+","+Er+"H"+($t-Xe*_r)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+$t+","+(Er-Xe*pr)+"V"+(rr+Xe*pr)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+($t-Xe*_r)+","+rr+"Z";else{Lt=Math.abs(Er-rr)+Ot;var qn=Lt0?Math.sqrt(Ot*(2*Xe-Ot)):0,ra=pr>0?Math.max:Math.min;Je="M"+(Nt+qn*_r)+","+rr+"V"+ra(Er-(Xe-Ot)*pr,rr)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+(Nt+Xe*_r-ta)+","+Er+"H"+($t-Xe*_r+ta)+"A "+Xe+","+Xe+" 0 0 "+hr+" "+($t-qn*_r)+","+ra(Er-(Xe-Ot)*pr,rr)+"V"+rr+"Z"}}else Je=Ct}else Je=Ct;var Nn=m(S.ensureSingle(rt,"path"),ue,V,ee);if(Nn.style("vector-effect",te?"none":"non-scaling-stroke").attr("d",isNaN(($t-Nt)*(Er-rr))||Mr&&re._context.staticPlot?"M0,0Z":Je).call(t.setClipUrl,fe.layerClipId,re),!ue.uniformtext.mode&&Qe){var ka=t.makePointStyleFns(ve);t.singlePointStyle(ot,Nn,ve,ka,re)}y(re,fe,rt,ae,ft,Nt,$t,rr,Er,Xe,Ot,V,ee),fe.layerClipId&&t.hideOutsideRangePoint(ot,rt.select("text"),ne,K,ve.xcalendar,ve.ycalendar)});var Ne=ve.cliponaxis===!1;t.setClipUrl(ie,Ne?null:fe.layerClipId,re)});r.getComponentMethod("errorbars","plot")(re,H,fe,V)}function y(re,fe,le,ce,V,ee,ne,K,ue,te,H,ae,ie){var ve=fe.xaxis,Ae=fe.yaxis,Ce=re._fullLayout,Fe;function ze(Lt,Ct,Ot){var Wt=S.ensureSingle(Lt,"text").text(Ct).attr({class:"bartext bartext-"+Fe,"text-anchor":"middle","data-notex":1}).call(t.font,Ot).call(E.convertToTspans,re);return Wt}var Ye=ce[0].trace,it=Ye.orientation==="h",st=R(Ce,ce,V,ve,Ae);Fe=U(Ye,V);var nt=ae.mode==="stack"||ae.mode==="relative",Qe=ce[V],Le=!nt||Qe._outmost,Te=Qe.hasB,pe=te&&te-H>g;if(!st||Fe==="none"||(Qe.isBlank||ee===ne||K===ue)&&(Fe==="auto"||Fe==="inside")){le.select("text").remove();return}var Ne=Ce.font,ot=s.getBarColor(ce[V],Ye),ft=s.getInsideTextFont(Ye,V,Ne,ot),rt=s.getOutsideTextFont(Ye,V,Ne),Ft=Ye.insidetextanchor||"end",Nt=le.datum();it?ve.type==="log"&&Nt.s0<=0&&(ve.range[0]0&&Mt>0,Ee;pe?Te?Ee=I(Er-2*te,Mr,Br,Mt,it)||I(Er,Mr-2*te,Br,Mt,it):it?Ee=I(Er-(te-H),Mr,Br,Mt,it)||I(Er,Mr-2*(te-H),Br,Mt,it):Ee=I(Er,Mr-(te-H),Br,Mt,it)||I(Er-2*(te-H),Mr,Br,Mt,it):Ee=I(Er,Mr,Br,Mt,it),$e&&Ee?Fe="inside":(Fe="outside",Wr.remove(),Wr=null)}else Fe="inside";if(!Wr){je=S.ensureUniformFontSize(re,Fe==="outside"?rt:ft),Wr=ze(le,st,je);var xe=Wr.attr("transform");if(Wr.attr("transform",""),Sr=t.bBox(Wr.node()),Br=Sr.width,Mt=Sr.height,Wr.attr("transform",xe),Br<=0||Mt<=0){Wr.remove();return}}var ye=Ye.textangle,Me,Xe;Fe==="outside"?(Xe=Ye.constraintext==="both"||Ye.constraintext==="outside",Me=B(ee,ne,K,ue,Sr,{isHorizontal:it,constrained:Xe,angle:ye})):(Xe=Ye.constraintext==="both"||Ye.constraintext==="inside",Me=F(ee,ne,K,ue,Sr,{isHorizontal:it,constrained:Xe,angle:ye,anchor:Ft,hasB:Te,r:te,overhead:H})),Me.fontSize=je.size,i(Ye.type==="histogram"?"bar":Ye.type,Me,Ce),Qe.transform=Me;var Je=m(Wr,Ce,ae,ie);S.setTransormAndDisplay(Je,Me)}function I(re,fe,le,ce,V){if(re<0||fe<0)return!1;var ee=le<=re&&ce<=fe,ne=le<=fe&&ce<=re,K=V?re>=le*(fe/ce):fe>=ce*(re/le);return ee||ne||K}function L(re){return re==="auto"?0:re}function z(re,fe){var le=Math.PI/180*fe,ce=Math.abs(Math.sin(le)),V=Math.abs(Math.cos(le));return{x:re.width*V+re.height*ce,y:re.width*ce+re.height*V}}function F(re,fe,le,ce,V,ee){var ne=!!ee.isHorizontal,K=!!ee.constrained,ue=ee.angle||0,te=ee.anchor,H=te==="end",ae=te==="start",ie=ee.leftToRight||0,ve=(ie+1)/2,Ae=1-ve,Ce=ee.hasB,Fe=ee.r,ze=ee.overhead,Ye=V.width,it=V.height,st=Math.abs(fe-re),nt=Math.abs(ce-le),Qe=st>2*g&&nt>2*g?g:0;st-=2*Qe,nt-=2*Qe;var Le=L(ue);ue==="auto"&&!(Ye<=st&&it<=nt)&&(Ye>st||it>nt)&&(!(Ye>nt||it>st)||Yeg){var ot=N(re,fe,le,ce,Te,Fe,ze,ne,Ce);pe=ot.scale,Ne=ot.pad}else pe=1,K&&(pe=Math.min(1,st/Te.x,nt/Te.y)),Ne=0;var ft=V.left*Ae+V.right*ve,rt=(V.top+V.bottom)/2,Ft=(re+g)*Ae+(fe-g)*ve,Nt=(le+ce)/2,$t=0,rr=0;if(ae||H){var Er=(ne?Te.x:Te.y)/2;Fe&&(H||Ce)&&(Qe+=Ne);var Mr=ne?_(re,fe):_(le,ce);ne?ae?(Ft=re+Mr*Qe,$t=-Mr*Er):(Ft=fe-Mr*Qe,$t=Mr*Er):ae?(Nt=le+Mr*Qe,rr=-Mr*Er):(Nt=ce-Mr*Qe,rr=Mr*Er)}return{textX:ft,textY:rt,targetX:Ft,targetY:Nt,anchorX:$t,anchorY:rr,scale:pe,rotate:Le}}function N(re,fe,le,ce,V,ee,ne,K,ue){var te=Math.max(0,Math.abs(fe-re)-2*g),H=Math.max(0,Math.abs(ce-le)-2*g),ae=ee-g,ie=ne?ae-Math.sqrt(ae*ae-(ae-ne)*(ae-ne)):ae,ve=ue?ae*2:K?ae-ne:2*ie,Ae=ue?ae*2:K?2*ie:ae-ne,Ce,Fe,ze,Ye,it;return V.y/V.x>=H/(te-ve)?Ye=H/V.y:V.y/V.x<=(H-Ae)/te?Ye=te/V.x:!ue&&K?(Ce=V.x*V.x+V.y*V.y/4,Fe=-2*V.x*(te-ae)-V.y*(H/2-ae),ze=(te-ae)*(te-ae)+(H/2-ae)*(H/2-ae)-ae*ae,Ye=(-Fe+Math.sqrt(Fe*Fe-4*Ce*ze))/(2*Ce)):ue?(Ce=(V.x*V.x+V.y*V.y)/4,Fe=-V.x*(te/2-ae)-V.y*(H/2-ae),ze=(te/2-ae)*(te/2-ae)+(H/2-ae)*(H/2-ae)-ae*ae,Ye=(-Fe+Math.sqrt(Fe*Fe-4*Ce*ze))/(2*Ce)):(Ce=V.x*V.x/4+V.y*V.y,Fe=-V.x*(te/2-ae)-2*V.y*(H-ae),ze=(te/2-ae)*(te/2-ae)+(H-ae)*(H-ae)-ae*ae,Ye=(-Fe+Math.sqrt(Fe*Fe-4*Ce*ze))/(2*Ce)),Ye=Math.min(1,Ye),K?it=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(H-V.y*Ye)/2)*(ae-(H-V.y*Ye)/2)))-ne):it=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(te-V.x*Ye)/2)*(ae-(te-V.x*Ye)/2)))-ne),{scale:Ye,pad:it}}function B(re,fe,le,ce,V,ee){var ne=!!ee.isHorizontal,K=!!ee.constrained,ue=ee.angle||0,te=V.width,H=V.height,ae=Math.abs(fe-re),ie=Math.abs(ce-le),ve;ne?ve=ie>2*g?g:0:ve=ae>2*g?g:0;var Ae=1;K&&(Ae=ne?Math.min(1,ie/H):Math.min(1,ae/te));var Ce=L(ue),Fe=z(V,Ce),ze=(ne?Fe.x:Fe.y)/2,Ye=(V.left+V.right)/2,it=(V.top+V.bottom)/2,st=(re+fe)/2,nt=(le+ce)/2,Qe=0,Le=0,Te=ne?_(fe,re):_(le,ce);return ne?(st=fe-Te*ve,Qe=Te*ze):(nt=ce+Te*ve,Le=-Te*ze),{textX:Ye,textY:it,targetX:st,targetY:nt,anchorX:Qe,anchorY:Le,scale:Ae,rotate:Ce}}function R(re,fe,le,ce,V){var ee=fe[0].trace,ne=ee.texttemplate,K;return ne?K=j(re,fe,le,ce,V):ee.textinfo?K=Z(fe,le,ce,V):K=f.getValue(ee.text,le),f.coerceString(d,K)}function U(re,fe){var le=f.getValue(re.textposition,fe);return f.coerceEnumerated(T,le)}function j(re,fe,le,ce,V){var ee=fe[0].trace,ne=S.castOption(ee,le,"texttemplate");if(!ne)return"";var K=ee.type==="histogram",ue=ee.type==="waterfall",te=ee.type==="funnel",H=ee.orientation==="h",ae,ie,ve,Ae;H?(ae="y",ie=V,ve="x",Ae=ce):(ae="x",ie=ce,ve="y",Ae=V);function Ce(Qe){return o(ie,ie.c2l(Qe),!0).text}function Fe(Qe){return o(Ae,Ae.c2l(Qe),!0).text}var ze=fe[le],Ye={};Ye.label=ze.p,Ye.labelLabel=Ye[ae+"Label"]=Ce(ze.p);var it=S.castOption(ee,ze.i,"text");(it===0||it)&&(Ye.text=it),Ye.value=ze.s,Ye.valueLabel=Ye[ve+"Label"]=Fe(ze.s);var st={};l(st,ee,ze.i),(K||st.x===void 0)&&(st.x=H?Ye.value:Ye.label),(K||st.y===void 0)&&(st.y=H?Ye.label:Ye.value),(K||st.xLabel===void 0)&&(st.xLabel=H?Ye.valueLabel:Ye.labelLabel),(K||st.yLabel===void 0)&&(st.yLabel=H?Ye.labelLabel:Ye.valueLabel),ue&&(Ye.delta=+ze.rawS||ze.s,Ye.deltaLabel=Fe(Ye.delta),Ye.final=ze.v,Ye.finalLabel=Fe(Ye.final),Ye.initial=Ye.final-Ye.delta,Ye.initialLabel=Fe(Ye.initial)),te&&(Ye.value=ze.s,Ye.valueLabel=Fe(Ye.value),Ye.percentInitial=ze.begR,Ye.percentInitialLabel=S.formatPercent(ze.begR),Ye.percentPrevious=ze.difR,Ye.percentPreviousLabel=S.formatPercent(ze.difR),Ye.percentTotal=ze.sumR,Ye.percenTotalLabel=S.formatPercent(ze.sumR));var nt=S.castOption(ee,ze.i,"customdata");return nt&&(Ye.customdata=nt),S.texttemplateString({data:[st,Ye,ee._meta],fallback:ee.texttemplatefallback,labels:Ye,locale:re._d3locale,template:ne})}function Z(re,fe,le,ce){var V=re[0].trace,ee=V.orientation==="h",ne=V.type==="waterfall",K=V.type==="funnel";function ue(nt){var Qe=ee?ce:le;return o(Qe,nt,!0).text}function te(nt){var Qe=ee?le:ce;return o(Qe,+nt,!0).text}var H=V.textinfo,ae=re[fe],ie=H.split("+"),ve=[],Ae,Ce=function(nt){return ie.indexOf(nt)!==-1};if(Ce("label")&&ve.push(ue(re[fe].p)),Ce("text")&&(Ae=S.castOption(V,ae.i,"text"),(Ae===0||Ae)&&ve.push(Ae)),ne){var Fe=+ae.rawS||ae.s,ze=ae.v,Ye=ze-Fe;Ce("initial")&&ve.push(te(Ye)),Ce("delta")&&ve.push(te(Fe)),Ce("final")&&ve.push(te(ze))}if(K){Ce("value")&&ve.push(te(ae.s));var it=0;Ce("percent initial")&&it++,Ce("percent previous")&&it++,Ce("percent total")&&it++;var st=it>1;Ce("percent initial")&&(Ae=S.formatPercent(ae.begR),st&&(Ae+=" of initial"),ve.push(Ae)),Ce("percent previous")&&(Ae=S.formatPercent(ae.difR),st&&(Ae+=" of previous"),ve.push(Ae)),Ce("percent total")&&(Ae=S.formatPercent(ae.sumR),st&&(Ae+=" of total"),ve.push(Ae))}return ve.join("
")}G.exports={plot:v,toMoveInsideBar:F}}}),Mc=Ge({"src/traces/bar/hover.js"($,G){var h=qf(),b=Io(),S=So(),E=yn().fillText,e=fy().getLineWidth,t=Ss().hoverLabelText,r=hi().BADNUM;function o(a,s,f,c,p){var d=n(a,s,f,c,p);if(d){var T=d.cd,l=T[0].trace,g=T[d.index];return d.color=i(l,g),b.getComponentMethod("errorbars","hoverInfo")(g,l,d),[d]}}function n(a,s,f,c,p){var d=a.cd,T=d[0].trace,l=d[0].t,g=c==="closest",x=T.type==="waterfall",A=a.maxHoverDistance,M=a.maxSpikeDistance,_,w,m,u,v,y,I;T.orientation==="h"?(_=f,w=s,m="y",u="x",v=ce,y=re):(_=s,w=f,m="x",u="y",y=ce,v=re);var L=T[m+"period"],z=g||L;function F(Ae){return B(Ae,-1)}function N(Ae){return B(Ae,1)}function B(Ae,Ce){var Fe=Ae.w;return Ae[m]+Ce*Fe/2}function R(Ae){return Ae[m+"End"]-Ae[m+"Start"]}var U=g?F:L?function(Ae){return Ae.p-R(Ae)/2}:function(Ae){return Math.min(F(Ae),Ae.p-l.bardelta/2)},j=g?N:L?function(Ae){return Ae.p+R(Ae)/2}:function(Ae){return Math.max(N(Ae),Ae.p+l.bardelta/2)};function Z(Ae,Ce,Fe){return p.finiteRange&&(Fe=0),h.inbox(Ae-_,Ce-_,Fe+Math.min(1,Math.abs(Ce-Ae)/I)-1)}function re(Ae){return Z(U(Ae),j(Ae),A)}function fe(Ae){return Z(F(Ae),N(Ae),M)}function le(Ae){var Ce=Ae[u];if(x){var Fe=Math.abs(Ae.rawS)||0;w>0?Ce+=Fe:w<0&&(Ce-=Fe)}return Ce}function ce(Ae){var Ce=w,Fe=Ae.b,ze=le(Ae);return h.inbox(Fe-Ce,ze-Ce,A+(ze-Ce)/(ze-Fe)-1)}function V(Ae){var Ce=w,Fe=Ae.b,ze=le(Ae);return h.inbox(Fe-Ce,ze-Ce,M+(ze-Ce)/(ze-Fe)-1)}var ee=a[m+"a"],ne=a[u+"a"];I=Math.abs(ee.r2c(ee.range[1])-ee.r2c(ee.range[0]));function K(Ae){return(v(Ae)+y(Ae))/2}var ue=h.getDistanceFunction(c,v,y,K);if(h.getClosest(d,ue,a),a.index!==!1&&d[a.index].p!==r){z||(U=function(Ae){return Math.min(F(Ae),Ae.p-l.bargroupwidth/2)},j=function(Ae){return Math.max(N(Ae),Ae.p+l.bargroupwidth/2)});var te=a.index,H=d[te],ae=T.base?H.b+H.s:H.s;a[u+"0"]=a[u+"1"]=ne.c2p(H[u],!0),a[u+"LabelVal"]=ae;var ie=l.extents[l.extents.round(H.p)];a[m+"0"]=ee.c2p(g?U(H):ie[0],!0),a[m+"1"]=ee.c2p(g?j(H):ie[1],!0);var ve=H.orig_p!==void 0;return a[m+"LabelVal"]=ve?H.orig_p:H.p,a.labelLabel=t(ee,a[m+"LabelVal"],T[m+"hoverformat"]),a.valueLabel=t(ne,a[u+"LabelVal"],T[u+"hoverformat"]),a.baseLabel=t(ne,H.b,T[u+"hoverformat"]),a.spikeDistance=(V(H)+fe(H))/2,a[m+"Spike"]=ee.c2p(H.p,!0),E(H,T,a),a.hovertemplate=T.hovertemplate,a}}function i(a,s){var f=s.mcc||a.marker.color,c=s.mlcc||a.marker.line.color,p=e(a,s);if(S.opacity(f))return f;if(S.opacity(c)&&p)return c}G.exports={hoverPoints:o,hoverOnBars:n,getTraceColor:i}}}),nv=Ge({"src/traces/bar/event_data.js"($,G){G.exports=function(b,S,E){return b.x="xVal"in S?S.xVal:S.x,b.y="yVal"in S?S.yVal:S.y,S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),E.orientation==="h"?(b.label=b.y,b.value=b.x):(b.label=b.x,b.value=b.y),b}}}),ym=Ge({"src/traces/bar/select.js"($,G){G.exports=function(S,E){var e=S.cd,t=S.xaxis,r=S.yaxis,o=e[0].trace,n=o.type==="funnel",i=o.orientation==="h",a=[],s;if(E===!1)for(s=0;s0?(L="v",m>0?z=Math.min(v,u):z=Math.min(u)):m>0?(L="h",z=Math.min(v)):z=0;if(!z){f.visible=!1;return}f._length=z;var U=c("orientation",L);f._hasPreCompStats?U==="v"&&m===0?(c("x0",0),c("dx",1)):U==="h"&&w===0&&(c("y0",0),c("dy",1)):U==="v"&&m===0?c("x0"):U==="h"&&w===0&&c("y0");var j=b.getComponentMethod("calendars","handleTraceDefaults");j(s,f,["x","y"],p)}function i(s,f,c,p){var d=p.prefix,T=h.coerce2(s,f,r,"marker.outliercolor"),l=c("marker.line.outliercolor"),g="outliers";f._hasPreCompStats?g="all":(T||l)&&(g="suspectedoutliers");var x=c(d+"points",g);x?(c("jitter",x==="all"?.3:0),c("pointpos",x==="all"?-1.5:0),c("marker.symbol"),c("marker.opacity"),c("marker.size"),c("marker.angle"),c("marker.color",f.line.color),c("marker.line.color"),c("marker.line.width"),x==="suspectedoutliers"&&(c("marker.line.outliercolor",f.marker.color),c("marker.line.outlierwidth")),c("selected.marker.color"),c("unselected.marker.color"),c("selected.marker.size"),c("unselected.marker.size"),c("text"),c("hovertext")):delete f.marker;var A=c("hoveron");(A==="all"||A.indexOf("points")!==-1)&&(c("hovertemplate"),c("hovertemplatefallback")),h.coerceSelectionMarkerOpacity(f,c)}function a(s,f){var c,p;function d(x){return h.coerce(p._input,p,r,x)}for(var T=0;Tle.uf};if(M._hasPreCompStats){var te=M[z],H=function(Mr){return L.d2c((M[Mr]||[])[y])},ae=1/0,ie=-1/0;for(y=0;y=le.q1&&le.q3>=le.med){var Ae=H("lowerfence");le.lf=Ae!==e&&Ae<=le.q1?Ae:p(le,V,ee);var Ce=H("upperfence");le.uf=Ce!==e&&Ce>=le.q3?Ce:d(le,V,ee);var Fe=H("mean");le.mean=Fe!==e?Fe:ee?E.mean(V,ee):(le.q1+le.q3)/2;var ze=H("sd");le.sd=Fe!==e&&ze>=0?ze:ee?E.stdev(V,ee,le.mean):le.q3-le.q1,le.lo=T(le),le.uo=l(le);var Ye=H("notchspan");Ye=Ye!==e&&Ye>0?Ye:g(le,ee),le.ln=le.med-Ye,le.un=le.med+Ye;var it=le.lf,st=le.uf;M.boxpoints&&V.length&&(it=Math.min(it,V[0]),st=Math.max(st,V[ee-1])),M.notched&&(it=Math.min(it,le.ln),st=Math.max(st,le.un)),le.min=it,le.max=st}else{E.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+le.q1,"median = "+le.med,"q3 = "+le.q3].join(` -`));var nt;le.med!==e?nt=le.med:le.q1!==e?le.q3!==e?nt=(le.q1+le.q3)/2:nt=le.q1:le.q3!==e?nt=le.q3:nt=0,le.med=nt,le.q1=le.q3=nt,le.lf=le.uf=nt,le.mean=le.sd=nt,le.ln=le.un=nt,le.min=le.max=nt}ae=Math.min(ae,le.min),ie=Math.max(ie,le.max),le.pts2=ce.filter(ue),u.push(le)}}M._extremes[L._id]=b.findExtremes(L,[ae,ie],{padded:!0})}else{var Qe=L.makeCalcdata(M,z),Le=o(re,fe),Te=re.length,pe=n(Te);for(y=0;y=0&&Ne0){if(le={},le.pos=le[N]=re[y],ce=le.pts=pe[y].sort(f),V=le[z]=ce.map(c),ee=V.length,le.min=V[0],le.max=V[ee-1],le.mean=E.mean(V,ee),le.sd=E.stdev(V,ee,le.mean)*M.sdmultiple,le.med=E.interp(V,.5),ee%2&&(Ft||Nt)){var $t,rr;Ft?($t=V.slice(0,ee/2),rr=V.slice(ee/2+1)):Nt&&($t=V.slice(0,ee/2+1),rr=V.slice(ee/2)),le.q1=E.interp($t,.5),le.q3=E.interp(rr,.5)}else le.q1=E.interp(V,.25),le.q3=E.interp(V,.75);le.lf=p(le,V,ee),le.uf=d(le,V,ee),le.lo=T(le),le.uo=l(le);var Er=g(le,ee);le.ln=le.med-Er,le.un=le.med+Er,ot=Math.min(ot,le.ln),ft=Math.max(ft,le.un),le.pts2=ce.filter(ue),u.push(le)}M.notched&&E.isTypedArray(Qe)&&(Qe=Array.from(Qe)),M._extremes[L._id]=b.findExtremes(L,M.notched?Qe.concat([ot,ft]):Qe,{padded:!0})}return s(u,M),u.length>0?(u[0].t={num:_[v],dPos:fe,posLetter:N,valLetter:z,labels:{med:t(A,"median:"),min:t(A,"min:"),q1:t(A,"q1:"),q3:t(A,"q3:"),max:t(A,"max:"),mean:M.boxmean==="sd"||M.sizemode==="sd"?t(A,"mean ± σ:").replace("σ",M.sdmultiple===1?"σ":M.sdmultiple+"σ"):t(A,"mean:"),lf:t(A,"lower fence:"),uf:t(A,"upper fence:")}},_[v]++,u):[{t:{empty:!0}}]};function r(x,A,M,_){var w=A in x,m=A+"0"in x,u="d"+A in x;if(w||m&&u){var v=M.makeCalcdata(x,A),y=S(x,M,A,v).vals;return[y,v]}var I;m?I=x[A+"0"]:"name"in x&&(M.type==="category"||h(x.name)&&["linear","log"].indexOf(M.type)!==-1||E.isDateTime(x.name)&&M.type==="date")?I=x.name:I=_;for(var L=M.type==="multicategory"?M.r2c_just_indices(I):M.d2c(I,0,x[A+"calendar"]),z=x._length,F=new Array(z),N=0;N1,m=1-s[r+"gap"],u=1-s[r+"groupgap"];for(p=0;p0;if(L==="positive"?(le=z*(I?1:.5),ee=V,ce=ee=N):L==="negative"?(le=ee=N,ce=z*(I?1:.5),ne=V):(le=ce=z,ee=ne=V),ie){var ve=v.pointpos,Ae=v.jitter,Ce=v.marker.size/2,Fe=0;ve+Ae>=0&&(Fe=V*(ve+Ae),Fe>le?(ae=!0,te=Ce,K=Fe):Fe>ee&&(te=Ce,K=le)),Fe<=le&&(K=le);var ze=0;ve-Ae<=0&&(ze=-V*(ve-Ae),ze>ce?(ae=!0,H=Ce,ue=ze):ze>ne&&(H=Ce,ue=ce)),ze<=ce&&(ue=ce)}else K=le,ue=ce;var Ye=new Array(T.length);for(d=0;dM.lo&&(U.so=!0)}return w});A.enter().append("path").classed("point",!0),A.exit().remove(),A.call(S.translatePoints,c,p)}function n(i,a,s,f){var c=a.val,p=a.pos,d=!!p.rangebreaks,T=f.bPos,l=f.bPosPxOffset||0,g=s.boxmean||(s.meanline||{}).visible,x,A;Array.isArray(f.bdPos)?(x=f.bdPos[0],A=f.bdPos[1]):(x=f.bdPos,A=f.bdPos);var M=i.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?b.identity:[]);M.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),M.exit().remove(),M.each(function(_){var w=p.c2l(_.pos+T,!0),m=p.l2p(w-x)+l,u=p.l2p(w+A)+l,v=d?(m+u)/2:p.l2p(w)+l,y=c.c2p(_.mean,!0),I=c.c2p(_.mean-_.sd,!0),L=c.c2p(_.mean+_.sd,!0);s.orientation==="h"?h.select(this).attr("d","M"+y+","+m+"V"+u+(g==="sd"?"m0,0L"+I+","+v+"L"+y+","+m+"L"+L+","+v+"Z":"")):h.select(this).attr("d","M"+m+","+y+"H"+u+(g==="sd"?"m0,0L"+v+","+I+"L"+m+","+y+"L"+v+","+L+"Z":""))})}G.exports={plot:t,plotBoxAndWhiskers:r,plotPoints:o,plotBoxMean:n}}}),Lx=Ge({"src/traces/box/style.js"($,G){var h=Za(),b=So(),S=Ms();function E(t,r,o){var n=o||h.select(t).selectAll("g.trace.boxes");n.style("opacity",function(i){return i[0].trace.opacity}),n.each(function(i){var a=h.select(this),s=i[0].trace,f=s.line.width;function c(T,l,g,x){T.style("stroke-width",l+"px").call(b.stroke,g).call(b.fill,x)}var p=a.selectAll("path.box");if(s.type==="candlestick")p.each(function(T){if(!T.empty){var l=h.select(this),g=s[T.dir];c(l,g.line.width,g.line.color,g.fillcolor),l.style("opacity",s.selectedpoints&&!T.selected?.3:1)}});else{c(p,f,s.line.color,s.fillcolor),a.selectAll("path.mean").style({"stroke-width":f,"stroke-dasharray":2*f+"px,"+f+"px"}).call(b.stroke,s.line.color);var d=a.selectAll("path.point");S.pointStyle(d,s,t)}})}function e(t,r,o){var n=r[0].trace,i=o.selectAll("path.point");n.selectedpoints?S.selectedPointStyle(i,n):S.pointStyle(i,n,t)}G.exports={style:E,styleOnSelect:e}}}),w2=Ge({"src/traces/box/hover.js"($,G){var h=Ss(),b=yn(),S=qf(),E=So(),e=b.fillText;function t(n,i,a,s){var f=n.cd,c=f[0].trace,p=c.hoveron,d=[],T;return p.indexOf("boxes")!==-1&&(d=d.concat(r(n,i,a,s))),p.indexOf("points")!==-1&&(T=o(n,i,a)),s==="closest"?T?[T]:d:(T&&d.push(T),d)}function r(n,i,a,s){var f=n.cd,c=n.xa,p=n.ya,d=f[0].trace,T=f[0].t,l=d.type==="violin",g,x,A,M,_,w,m,u,v,y,I,L=T.bdPos,z,F,N=T.wHover,B=function(ze){return A.c2l(ze.pos)+T.bPos-A.c2l(w)};l&&d.side!=="both"?(d.side==="positive"&&(v=function(ze){var Ye=B(ze);return S.inbox(Ye,Ye+N,y)},z=L,F=0),d.side==="negative"&&(v=function(ze){var Ye=B(ze);return S.inbox(Ye-N,Ye,y)},z=0,F=L)):(v=function(ze){var Ye=B(ze);return S.inbox(Ye-N,Ye+N,y)},z=F=L);var R;l?R=function(ze){return S.inbox(ze.span[0]-_,ze.span[1]-_,y)}:R=function(ze){return S.inbox(ze.min-_,ze.max-_,y)},d.orientation==="h"?(_=i,w=a,m=R,u=v,g="y",A=p,x="x",M=c):(_=a,w=i,m=v,u=R,g="x",A=c,x="y",M=p);var U=Math.min(1,L/Math.abs(A.r2c(A.range[1])-A.r2c(A.range[0])));y=n.maxHoverDistance-U,I=n.maxSpikeDistance-U;function j(ze){return(m(ze)+u(ze))/2}var Z=S.getDistanceFunction(s,m,u,j);if(S.getClosest(f,Z,n),n.index===!1)return[];var re=f[n.index],fe=d.line.color,le=(d.marker||{}).color;E.opacity(fe)&&d.line.width?n.color=fe:E.opacity(le)&&d.boxpoints?n.color=le:n.color=d.fillcolor,n[g+"0"]=A.c2p(re.pos+T.bPos-F,!0),n[g+"1"]=A.c2p(re.pos+T.bPos+z,!0),n[g+"LabelVal"]=re.orig_p!==void 0?re.orig_p:re.pos;var ce=g+"Spike";n.spikeDistance=j(re)*I/y,n[ce]=A.c2p(re.pos,!0);var V=d.boxmean||d.sizemode==="sd"||(d.meanline||{}).visible,ee=d.boxpoints||d.points,ne=ee&&V?["max","uf","q3","med","mean","q1","lf","min"]:ee&&!V?["max","uf","q3","med","q1","lf","min"]:!ee&&V?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],K=M.range[1]0&&(o=!0);for(var s=0;st){var r=t-E[b];return E[b]=t,r}}else return E[b]=t,t;return 0},max:function(b,S,E,e){var t=e[S];if(h(t))if(t=Number(t),h(E[b])){if(E[b]m&&mE){var y=u===b?1:6,I=u===b?"M12":"M1";return function(L,z){var F=T.c2d(L,b,l),N=F.indexOf("-",y);N>0&&(F=F.slice(0,N));var B=T.d2c(F,0,l);if(Br?f>E?f>b*1.1?b:f>S*1.1?S:E:f>e?e:f>t?t:r:Math.pow(10,Math.floor(Math.log(f)/Math.LN10))}function a(f,c,p,d,T,l){if(d&&f>E){var g=s(c,T,l),x=s(p,T,l),A=f===b?0:1;return g[A]!==x[A]}return Math.floor(p/f)-Math.floor(c/f)>.1}function s(f,c,p){var d=c.c2d(f,b,p).split("-");return d[0]===""&&(d.unshift(),d[0]="-"+d[0]),d}}}),zx=Ge({"src/traces/histogram/calc.js"($,G){var h=Ga(),b=yn(),S=Io(),E=Ss(),{hasColorscale:e}=vv(),t=pv(),r=jp(),o=Ix(),n=u0(),i=j1(),a=Dx();function s(T,l){var g=[],x=[],A=l.orientation==="h",M=E.getFromId(T,A?l.yaxis:l.xaxis),_=A?"y":"x",w={x:"y",y:"x"}[_],m=l[_+"calendar"],u=l.cumulative,v,y=f(T,l,M,_),I=y[0],L=y[1],z=typeof I.size=="string",F=[],N=z?F:I,B=[],R=[],U=[],j=0,Z=l.histnorm,re=l.histfunc,fe=Z.indexOf("density")!==-1,le,ce,V;u.enabled&&fe&&(Z=Z.replace(/ ?density$/,""),fe=!1);var ee=re==="max"||re==="min",ne=ee?null:0,K=o.count,ue=n[Z],te=!1,H=function(Ne){return M.r2c(Ne,0,m)},ae;for(b.isArrayOrTypedArray(l[w])&&re!=="count"&&(ae=l[w],te=re==="avg",K=o[re]),v=H(I.start),ce=H(I.end)+(v-E.tickIncrement(v,I.size,!1,m))/1e6;v=0&&V=Le;v--)if(x[v]){Te=v;break}for(v=Le;v<=Te;v++)if(h(g[v])&&h(x[v])){var pe={p:g[v],s:x[v],b:0};u.enabled||(pe.pts=U[v],Ce?pe.ph0=pe.ph1=U[v].length?L[U[v][0]]:g[v]:(l._computePh=!0,pe.ph0=st(F[v]),pe.ph1=st(F[v+1],!0))),Qe.push(pe)}return Qe.length===1&&(Qe[0].width1=E.tickIncrement(Qe[0].p,I.size,!1,m)-Qe[0].p),e(l,"marker")&&t(T,l,{vals:l.marker.color,containerStr:"marker",cLetter:"c"}),e(l,"marker.line")&&t(T,l,{vals:l.marker.line.color,containerStr:"marker.line",cLetter:"c"}),r(Qe,l),b.isArrayOrTypedArray(l.selectedpoints)&&b.tagSelected(Qe,l,Ye),Qe}function f(T,l,g,x,A){var M=x+"bins",_=T._fullLayout,w=l["_"+x+"bingroup"],m=_._histogramBinOpts[w],u=_.barmode==="overlay",v,y,I,L,z,F,N,B=function(it){return g.r2c(it,0,L)},R=function(it){return g.c2r(it,0,L)},U=g.type==="date"?function(it){return it||it===0?b.cleanDate(it,null,L):null}:function(it){return h(it)?Number(it):null};function j(it,st,nt){st[it+"Found"]?(st[it]=U(st[it]),st[it]===null&&(st[it]=nt[it])):(F[it]=st[it]=nt[it],b.nestedProperty(y[0],M+"."+it).set(nt[it]))}if(l["_"+x+"autoBinFinished"])delete l["_"+x+"autoBinFinished"];else{y=m.traces;var Z=[],re=!0,fe=!1,le=!1;for(v=0;v"u"){if(A)return[V,z,!0];V=c(T,l,g,x,M)}N=I.cumulative||{},N.enabled&&N.currentbin!=="include"&&(N.direction==="decreasing"?V.start=R(E.tickIncrement(B(V.start),V.size,!0,L)):V.end=R(E.tickIncrement(B(V.end),V.size,!1,L))),m.size=V.size,m.sizeFound||(F.size=V.size,b.nestedProperty(y[0],M+".size").set(V.size)),j("start",m,V),j("end",m,V)}z=l["_"+x+"pos0"],delete l["_"+x+"pos0"];var ne=l._input[M]||{},K=b.extendFlat({},m),ue=m.start,te=g.r2l(ne.start),H=te!==void 0;if((m.startFound||H)&&te!==g.r2l(ue)){var ae=H?te:b.aggNums(Math.min,null,z),ie={type:g.type==="category"||g.type==="multicategory"?"linear":g.type,r2l:g.r2l,dtick:m.size,tick0:ue,calendar:L,range:[ae,E.tickIncrement(ae,m.size,!1,L)].map(g.l2r)},ve=E.tickFirst(ie);ve>g.r2l(ae)&&(ve=E.tickIncrement(ve,m.size,!0,L)),K.start=g.l2r(ve),H||b.nestedProperty(l,M+".start").set(K.start)}var Ae=m.end,Ce=g.r2l(ne.end),Fe=Ce!==void 0;if((m.endFound||Fe)&&Ce!==g.r2l(Ae)){var ze=Fe?Ce:b.aggNums(Math.max,null,z);K.end=g.l2r(ze),Fe||b.nestedProperty(l,M+".start").set(K.end)}var Ye="autobin"+x;return l._input[Ye]===!1&&(l._input[M]=b.extendFlat({},l[M]||{}),delete l._input[Ye],delete l[Ye]),[K,z]}function c(T,l,g,x,A){var M=T._fullLayout,_=p(T,l),w=!1,m=1/0,u=[l],v,y,I;for(v=0;v<_.length;v++)if(y=_[v],y===l)w=!0;else if(!w)I=M._histogramBinOpts[y["_"+x+"bingroup"]],m=Math.min(m,I.size||y[A].size);else{var L=f(T,y,g,x,!0),z=L[0],F=L[2];y["_"+x+"autoBinFinished"]=1,y["_"+x+"pos0"]=L[1],F?u.push(y):m=Math.min(m,z.size)}var N=new Array(u.length);for(v=0;v=0;x--)w(x);else if(l==="increasing"){for(x=1;x=0;x--)T[x]+=T[x+1];g==="exclude"&&(T.push(0),T.shift())}}G.exports={calc:s,calcAllAutoBins:f}}}),x5=Ge({"src/traces/histogram2d/calc.js"($,G){var h=yn(),b=Ss(),S=Ix(),E=u0(),e=j1(),t=Dx(),r=zx().calcAllAutoBins;G.exports=function(s,f){var c=b.getFromId(s,f.xaxis),p=b.getFromId(s,f.yaxis),d=f.xcalendar,T=f.ycalendar,l=function(je){return c.r2c(je,0,d)},g=function(je){return p.r2c(je,0,T)},x=function(je){return c.c2r(je,0,d)},A=function(je){return p.c2r(je,0,T)},M,_,w,m,u=r(s,f,c,"x"),v=u[0],y=u[1],I=r(s,f,p,"y"),L=I[0],z=I[1],F=f._length;y.length>F&&y.splice(F,y.length-F),z.length>F&&z.splice(F,z.length-F);var N=[],B=[],R=[],U=typeof v.size=="string",j=typeof L.size=="string",Z=[],re=[],fe=U?Z:v,le=j?re:L,ce=0,V=[],ee=[],ne=f.histnorm,K=f.histfunc,ue=ne.indexOf("density")!==-1,te=K==="max"||K==="min",H=te?null:0,ae=S.count,ie=E[ne],ve=!1,Ae=[],Ce=[],Fe="z"in f?f.z:"marker"in f&&Array.isArray(f.marker.color)?f.marker.color:"";Fe&&K!=="count"&&(ve=K==="avg",ae=S[K]);var ze=v.size,Ye=l(v.start),it=l(v.end)+(Ye-b.tickIncrement(Ye,ze,!1,d))/1e6;for(M=Ye;M=0&&w=0&&mb;i++)n=e(r,o,E(n));return n>b&&h.log("interp2d didn't converge quickly",n),r};function e(t,r,o){var n=0,i,a,s,f,c,p,d,T,l,g,x,A,M;for(f=0;fA&&(n=Math.max(n,Math.abs(t[a][s]-x)/(M-A))))}return n}}}),Nx=Ge({"src/traces/heatmap/find_empties.js"($,G){var h=yn().maxRowLength;G.exports=function(S){var E=[],e={},t=[],r=S[0],o=[],n=[0,0,0],i=h(S),a,s,f,c,p,d,T,l;for(s=0;s=0;p--)c=t[p],s=c[0],f=c[1],d=((e[[s-1,f]]||n)[2]+(e[[s+1,f]]||n)[2]+(e[[s,f-1]]||n)[2]+(e[[s,f+1]]||n)[2])/20,d&&(T[c]=[s,f,d],t.splice(p,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(c in T)e[c]=T[c],E.push(T[c])}return E.sort(function(g,x){return x[2]-g[2]})}}}),S2=Ge({"src/traces/heatmap/make_bound_array.js"($,G){var h=Io(),b=yn().isArrayOrTypedArray;G.exports=function(E,e,t,r,o,n){var i=[],a=h.traceIs(E,"contour"),s=h.traceIs(E,"histogram"),f,c,p,d=b(e)&&e.length>1;if(d&&!s&&n.type!=="category"){var T=e.length;if(T<=o){if(a)i=Array.from(e).slice(0,o);else if(o===1)n.type==="log"?i=[.5*e[0],2*e[0]]:i=[e[0]-.5,e[0]+.5];else if(n.type==="log"){for(i=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],p=1;p1){var ne=(ee[ee.length-1]-ee[0])/(ee.length-1),K=Math.abs(ne/100);for(F=0;FK)return!1}return!0}T._islinear=!1,l.type==="log"||g.type==="log"?M==="fast"&&R("log axis found"):U(_)?U(v)?T._islinear=!0:M==="fast"&&R("y scale is not linear"):M==="fast"&&R("x scale is not linear");var j=b.maxRowLength(z),Z=T.xtype==="scaled"?"":_,re=a(T,Z,w,m,j,l),fe=T.ytype==="scaled"?"":v,le=a(T,fe,y,I,z.length,g);T._extremes[l._id]=S.findExtremes(l,re),T._extremes[g._id]=S.findExtremes(g,le);var ce={x:re,y:le,z,text:T._text||T.text,hovertext:T._hovertext||T.hovertext};if(T.xperiodalignment&&u&&(ce.orig_x=u),T.yperiodalignment&&L&&(ce.orig_y=L),Z&&Z.length===re.length-1&&(ce.xCenter=Z),fe&&fe.length===le.length-1&&(ce.yCenter=fe),A&&(ce.xRanges=N.xRanges,ce.yRanges=N.yRanges,ce.pts=N.pts),x||t(d,T,{vals:z,cLetter:"z"}),x&&T.contours&&T.contours.coloring==="heatmap"){var V={type:T.type==="contour"?"heatmap":"histogram2d",xcalendar:T.xcalendar,ycalendar:T.ycalendar};ce.xfill=a(V,Z,w,m,j,l),ce.yfill=a(V,fe,y,I,z.length,g)}return[ce]};function f(p){for(var d=[],T=p.length,l=0;l0;)ue=v.c2p(U[ie]),ie--;for(ue0;)ae=y.c2p(j[ie]),ie--;ae=v._length||ue<=0||H>=y._length||ae<=0;if(it){var st=L.selectAll("image").data([]);st.exit().remove(),g(L);return}var nt,Qe;Ce==="fast"?(nt=V,Qe=ce):(nt=ze,Qe=Ye);var Le=document.createElement("canvas");Le.width=nt,Le.height=Qe;var Te=Le.getContext("2d",{willReadFrequently:!0}),pe=a(F,{noNumericCheck:!0,returnArray:!0}),Ne,ot;Ce==="fast"?(Ne=ee?function(In){return V-1-In}:t.identity,ot=ne?function(In){return ce-1-In}:t.identity):(Ne=function(In){return t.constrain(Math.round(v.c2p(U[In])-K),0,ze)},ot=function(In){return t.constrain(Math.round(y.c2p(j[In])-H),0,Ye)});var ft=ot(0),rt=[ft,ft],Ft=ee?0:1,Nt=ne?0:1,$t=0,rr=0,Er=0,Mr=0,Wr,Sr,Br,Mt,je;function $e(In,xi){if(In!==void 0){var Ea=pe(In);return Ea[0]=Math.round(Ea[0]),Ea[1]=Math.round(Ea[1]),Ea[2]=Math.round(Ea[2]),$t+=xi,rr+=Ea[0]*xi,Er+=Ea[1]*xi,Mr+=Ea[2]*xi,Ea}return[0,0,0,0]}function Ee(In,xi,Ea,Pi){var Xi=In[Ea.bin0];if(Xi===void 0)return $e(void 0,1);var uo=In[Ea.bin1],so=xi[Ea.bin0],Eo=xi[Ea.bin1],vi=uo-Xi||0,ns=so-Xi||0,Xo;return uo===void 0?Eo===void 0?Xo=0:so===void 0?Xo=2*(Eo-Xi):Xo=(2*Eo-so-Xi)*2/3:Eo===void 0?so===void 0?Xo=0:Xo=(2*Xi-uo-so)*2/3:so===void 0?Xo=(2*Eo-uo-Xi)*2/3:Xo=Eo+Xi-uo-so,$e(Xi+Ea.frac*vi+Pi.frac*(ns+Ea.frac*Xo))}if(Ce!=="default"){var xe=0,ye;try{ye=new Uint8Array(nt*Qe*4)}catch{ye=new Array(nt*Qe*4)}if(Ce==="smooth"){var Me=Z||U,Xe=re||j,Je=new Array(Me.length),Lt=new Array(Xe.length),Ct=new Array(ze),Ot=Z?A:x,Wt=re?A:x,_r,pr,hr;for(ie=0;iepa||pa>y._length))for(ve=sn;ve_a||_a>v._length)){var Ca=o({x:ha,y:Jn},F,_._fullLayout);Ca.x=ha,Ca.y=Jn;var Vn=z.z[ie][ve];Vn===void 0?(Ca.z="",Ca.zLabel=""):(Ca.z=Vn,Ca.zLabel=e.tickText(ir,Vn,"hover").text);var yi=z.text&&z.text[ie]&&z.text[ie][ve];(yi===void 0||yi===!1)&&(yi=""),Ca.text=yi;var Ci=t.texttemplateString({data:[Ca,F._meta],fallback:F.texttemplatefallback,labels:Ca,locale:_._fullLayout._d3locale,template:ka});if(Ci){var Dt=Ci.split("
"),yt=Dt.length,kr=0;for(Ae=0;Ae=g[0].length||I<0||I>g.length)return}else{if(h.inbox(o-T[0],o-T[T.length-1],0)>0||h.inbox(n-l[0],n-l[l.length-1],0)>0)return;if(s){var L;for(w=[2*T[0]-T[1]],L=1;L=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),H1=Ge({"src/traces/contour/attributes.js"($,G){var h=gv(),b=jc(),S=hc(),E=S.axisHoverFormat,e=S.descriptionOnlyNumbers,t=Ru(),r=hv().dash,o=Fs(),n=Qi().extendFlat,i=Wx(),a=i.COMPARISON_OPS2,s=i.INTERVAL_OPS,f=b.line;G.exports=n({z:h.z,x:h.x,x0:h.x0,dx:h.dx,y:h.y,y0:h.y0,dy:h.dy,xperiod:h.xperiod,yperiod:h.yperiod,xperiod0:b.xperiod0,yperiod0:b.yperiod0,xperiodalignment:h.xperiodalignment,yperiodalignment:h.yperiodalignment,text:h.text,hovertext:h.hovertext,transpose:h.transpose,xtype:h.xtype,ytype:h.ytype,xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:h.hovertemplate,hovertemplatefallback:h.hovertemplatefallback,texttemplate:n({},h.texttemplate,{}),texttemplatefallback:h.texttemplatefallback,textfont:n({},h.textfont,{}),hoverongaps:h.hoverongaps,connectgaps:n({},h.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:o({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:e("contour label")},operation:{valType:"enumerated",values:[].concat(a).concat(s),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n({},f.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:n({},f.smoothing,{}),editType:"plot"},zorder:b.zorder},t("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),Kx=Ge({"src/traces/histogram2dcontour/attributes.js"($,G){var h=Yx(),b=H1(),S=Ru(),E=hc().axisHoverFormat,e=Qi().extendFlat;G.exports=e({x:h.x,y:h.y,z:h.z,marker:h.marker,histnorm:h.histnorm,histfunc:h.histfunc,nbinsx:h.nbinsx,xbins:h.xbins,nbinsy:h.nbinsy,ybins:h.ybins,autobinx:h.autobinx,autobiny:h.autobiny,bingroup:h.bingroup,xbingroup:h.xbingroup,ybingroup:h.ybingroup,autocontour:b.autocontour,ncontours:b.ncontours,contours:b.contours,line:{color:b.line.color,width:e({},b.line.width,{dflt:.5}),dash:b.line.dash,smoothing:b.line.smoothing,editType:"plot"},xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:h.hovertemplate,hovertemplatefallback:h.hovertemplatefallback,texttemplate:b.texttemplate,texttemplatefallback:b.texttemplatefallback,textfont:b.textfont},S("",{cLetter:"z",editTypeOverride:"calc"}))}}),$x=Ge({"src/traces/contour/contours_defaults.js"($,G){G.exports=function(b,S,E,e){var t=e("contours.start"),r=e("contours.end"),o=t===!1||r===!1,n=E("contours.size"),i;o?i=S.autocontour=!0:i=E("autocontour",!1),(i||!n)&&E("ncontours")}}}),k2=Ge({"src/traces/contour/label_defaults.js"($,G){var h=yn();G.exports=function(S,E,e,t){t||(t={});var r=S("contours.showlabels");if(r){var o=E.font;h.coerceFont(S,"contours.labelfont",o,{overrideDflt:{color:e}}),S("contours.labelformat")}t.hasHover!==!1&&S("zhoverformat")}}}),G1=Ge({"src/traces/contour/style_defaults.js"($,G){var h=dh(),b=k2();G.exports=function(E,e,t,r,o){var n=t("contours.coloring"),i,a="";n==="fill"&&(i=t("contours.showlines")),i!==!1&&(n!=="lines"&&(a=t("line.color","#000")),t("line.width",.5),t("line.dash")),n!=="none"&&(E.showlegend!==!0&&(e.showlegend=!1),e._dfltShowLegend=!1,h(E,e,r,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),b(t,r,a,o)}}}),k5=Ge({"src/traces/histogram2dcontour/defaults.js"($,G){var h=yn(),b=Zx(),S=$x(),E=G1(),e=pg(),t=Kx();G.exports=function(o,n,i,a){function s(c,p){return h.coerce(o,n,t,c,p)}function f(c){return h.coerce2(o,n,t,c)}b(o,n,s,a),n.visible!==!1&&(S(o,n,s,f),E(o,n,s,a),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),s("hovertemplatefallback"),n.contours&&n.contours.coloring==="heatmap"&&e(s,a))}}}),C2=Ge({"src/traces/contour/set_contours.js"($,G){var h=Ss(),b=yn();G.exports=function(e,t){var r=e.contours;if(e.autocontour){var o=e.zmin,n=e.zmax;(e.zauto||o===void 0)&&(o=b.aggNums(Math.min,null,t)),(e.zauto||n===void 0)&&(n=b.aggNums(Math.max,null,t));var i=S(o,n,e.ncontours);r.size=i.dtick,r.start=h.tickFirst(i),i.range.reverse(),r.end=h.tickFirst(i),r.start===o&&(r.start+=r.size),r.end===n&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),b.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if(r.type!=="constraint"){var a=r.start,s=r.end,f=e._input.contours;if(a>s&&(r.start=f.start=s,s=r.end=f.end=a,a=r.start),!(r.size>0)){var c;a===s?c=1:c=S(a,s,e.ncontours).dtick,f.size=r.size=c}}};function S(E,e,t){var r={type:"linear",range:[E,e]};return h.autoTicks(r,(e-E)/(t||15)),r}}}),Jx=Ge({"src/traces/contour/end_plus.js"($,G){G.exports=function(b){return b.end+b.size/1e6}}}),Qx=Ge({"src/traces/contour/calc.js"($,G){var h=Ac(),b=q1(),S=C2(),E=Jx();G.exports=function(t,r){var o=b(t,r),n=o[0].z;S(r,n);var i=r.contours,a=h.extractOpts(r),s;if(i.coloring==="heatmap"&&a.auto&&r.autocontour===!1){var f=i.start,c=E(i),p=i.size||1,d=Math.floor((c-f)/p)+1;isFinite(p)||(p=1,d=1);var T=f-p/2,l=T+d*p;s=[T,l]}else s=n;return h.calc(t,r,{vals:s,cLetter:"z"}),o}}}),X1=Ge({"src/traces/contour/constants.js"($,G){G.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),L2=Ge({"src/traces/contour/make_crossings.js"($,G){var h=X1();G.exports=function(E){var e=E[0].z,t=e.length,r=e[0].length,o=t===2||r===2,n,i,a,s,f,c,p,d,T;for(i=0;iS?0:1)+(E[0][1]>S?0:2)+(E[1][1]>S?0:4)+(E[1][0]>S?0:8);if(e===5||e===10){var t=(E[0][0]+E[0][1]+E[1][0]+E[1][1])/4;return S>t?e===5?713:1114:e===5?104:208}return e===15?0:e}}}),eb=Ge({"src/traces/contour/find_all_paths.js"($,G){var h=yn(),b=X1();G.exports=function(n,i,a){var s,f,c,p,d;for(i=i||.01,a=a||.01,c=0;c20?(c=b.CHOOSESADDLE[c][(p[0]||p[1])<0?0:1],o.crossings[f]=b.SADDLEREMAINDER[c]):delete o.crossings[f],p=b.NEWDELTA[c],!p){h.log("Found bad marching index:",c,n,o.level);break}d.push(r(o,n,p)),n[0]+=p[0],n[1]+=p[1],f=n.join(","),S(d[d.length-1],d[d.length-2],a,s)&&d.pop();var M=p[0]&&(n[0]<0||n[0]>l-2)||p[1]&&(n[1]<0||n[1]>T-2),_=n[0]===g[0]&&n[1]===g[1]&&p[0]===x[0]&&p[1]===x[1];if(_||i&&M)break;c=o.crossings[f]}A===1e4&&h.log("Infinite loop in contour?");var w=S(d[0],d[d.length-1],a,s),m=0,u=.2*o.smoothing,v=[],y=0,I,L,z,F,N,B,R,U,j,Z,re;for(A=1;A=y;A--)if(I=v[A],I=y&&I+v[L]U&&j--,o.edgepaths[j]=re.concat(d,Z));break}V||(o.edgepaths[U]=d.concat(Z))}for(U=0;U20&&n?o===208||o===1114?a=i[0]===0?1:-1:s=i[1]===0?1:-1:b.BOTTOMSTART.indexOf(o)!==-1?s=1:b.LEFTSTART.indexOf(o)!==-1?a=1:b.TOPSTART.indexOf(o)!==-1?s=-1:a=-1,[a,s]}function r(o,n,i){var a=n[0]+Math.max(i[0],0),s=n[1]+Math.max(i[1],0),f=o.z[s][a],c=o.xaxis,p=o.yaxis;if(i[1]){var d=(o.level-f)/(o.z[s][a+1]-f),T=(d!==1?(1-d)*c.c2l(o.x[a]):0)+(d!==0?d*c.c2l(o.x[a+1]):0);return[c.c2p(c.l2c(T),!0),p.c2p(o.y[s],!0),a+d,s]}else{var l=(o.level-f)/(o.z[s+1][a]-f),g=(l!==1?(1-l)*p.c2l(o.y[s]):0)+(l!==0?l*p.c2l(o.y[s+1]):0);return[c.c2p(o.x[a],!0),p.c2p(p.l2c(g),!0),a,s+l]}}}}),C5=Ge({"src/traces/contour/constraint_mapping.js"($,G){var h=Wx(),b=Ga();G.exports={"[]":E("[]"),"][":E("]["),">":e(">"),"<":e("<"),"=":e("=")};function S(t,r){var o=Array.isArray(r),n;function i(a){return b(a)?+a:null}return h.COMPARISON_OPS2.indexOf(t)!==-1?n=i(o?r[0]:r):h.INTERVAL_OPS.indexOf(t)!==-1?n=o?[i(r[0]),i(r[1])]:[i(r),i(r)]:h.SET_OPS.indexOf(t)!==-1&&(n=o?r.map(i):[i(r)]),n}function E(t){return function(r){r=S(t,r);var o=Math.min(r[0],r[1]),n=Math.max(r[0],r[1]);return{start:o,end:n,size:n-o}}}function e(t){return function(r){return r=S(t,r),{start:r,end:1/0,size:1/0}}}}}),P2=Ge({"src/traces/contour/empty_pathinfo.js"($,G){var h=yn(),b=C5(),S=Jx();G.exports=function(e,t,r){for(var o=e.type==="constraint"?b[e._operation](e.value):e,n=o.size,i=[],a=S(o),s=r.trace._carpetTrace,f=s?{xaxis:s.aaxis,yaxis:s.baxis,x:r.a,y:r.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:r.x,y:r.y},c=o.start;c1e3){h.warn("Too many contours, clipping at 1000",e);break}return i}}}),L5=Ge({"src/traces/contour/convert_to_constraints.js"($,G){var h=yn();G.exports=function(S,E){var e,t,r,o=function(a){return a.reverse()},n=function(a){return a};switch(E){case"=":case"<":return S;case">":for(S.length!==1&&h.warn("Contour data invalid for the specified inequality operation."),t=S[0],e=0;er.level||r.starts.length&&t===r.level)}break;case"constraint":if(S.prefixBoundary=!1,S.edgepaths.length)return;var o=S.x.length,n=S.y.length,i=-1/0,a=1/0;for(e=0;e":s>i&&(S.prefixBoundary=!0);break;case"<":(si||S.starts.length&&c===a)&&(S.prefixBoundary=!0);break;case"][":f=Math.min(s[0],s[1]),c=Math.max(s[0],s[1]),fi&&(S.prefixBoundary=!0);break}break}}}}),tb=Ge({"src/traces/contour/plot.js"($){var G=Za(),h=yn(),b=Ms(),S=Ac(),E=ec(),e=Ss(),t=Kd(),r=jx(),o=L2(),n=eb(),i=P2(),a=L5(),s=P5(),f=X1(),c=f.LABELOPTIMIZER;$.plot=function(_,w,m,u){var v=w.xaxis,y=w.yaxis;h.makeTraceGroups(u,m,"contour").each(function(I){var L=G.select(this),z=I[0],F=z.trace,N=z.x,B=z.y,R=F.contours,U=i(R,w,z),j=h.ensureSingle(L,"g","heatmapcoloring"),Z=[];R.coloring==="heatmap"&&(Z=[I]),r(_,w,Z,j),o(U),n(U);var re=v.c2p(N[0],!0),fe=v.c2p(N[N.length-1],!0),le=y.c2p(B[0],!0),ce=y.c2p(B[B.length-1],!0),V=[[re,ce],[fe,ce],[fe,le],[re,le]],ee=U;R.type==="constraint"&&(ee=a(U,R._operation)),p(L,V,R),d(L,ee,V,R),l(L,U,_,z,R),x(L,w,_,z,V)})};function p(M,_,w){var m=h.ensureSingle(M,"g","contourbg"),u=m.selectAll("path").data(w.coloring==="fill"?[0]:[]);u.enter().append("path"),u.exit().remove(),u.attr("d","M"+_.join("L")+"Z").style("stroke","none")}function d(M,_,w,m){var u=m.coloring==="fill"||m.type==="constraint"&&m._operation!=="=",v="M"+w.join("L")+"Z";u&&s(_,m);var y=h.ensureSingle(M,"g","contourfill"),I=y.selectAll("path").data(u?_:[]);I.enter().append("path"),I.exit().remove(),I.each(function(L){var z=(L.prefixBoundary?v:"")+T(L,w);z?G.select(this).attr("d",z).style("stroke","none"):G.select(this).remove()})}function T(M,_){var w="",m=0,u=M.edgepaths.map(function(re,fe){return fe}),v=!0,y,I,L,z,F,N;function B(re){return Math.abs(re[1]-_[0][1])<.01}function R(re){return Math.abs(re[1]-_[2][1])<.01}function U(re){return Math.abs(re[0]-_[0][0])<.01}function j(re){return Math.abs(re[0]-_[2][0])<.01}for(;u.length;){for(N=b.smoothopen(M.edgepaths[m],M.smoothing),w+=v?N:N.replace(/^M/,"L"),u.splice(u.indexOf(m),1),y=M.edgepaths[m][M.edgepaths[m].length-1],z=-1,L=0;L<4;L++){if(!y){h.log("Missing end?",m,M);break}for(B(y)&&!j(y)?I=_[1]:U(y)?I=_[0]:R(y)?I=_[3]:j(y)&&(I=_[2]),F=0;F=0&&(I=Z,z=F):Math.abs(y[1]-I[1])<.01?Math.abs(y[1]-Z[1])<.01&&(Z[0]-y[0])*(I[0]-Z[0])>=0&&(I=Z,z=F):h.log("endpt to newendpt is not vert. or horz.",y,I,Z)}if(y=I,z>=0)break;w+="L"+I}if(z===M.edgepaths.length){h.log("unclosed perimeter path");break}m=z,v=u.indexOf(m)===-1,v&&(m=u[0],w+="Z")}for(m=0;mc.MAXCOST*2)break;B&&(I/=2),y=z-I/2,L=y+I*1.5}if(N<=c.MAXCOST)return F};function g(M,_,w,m){var u=_.width/2,v=_.height/2,y=M.x,I=M.y,L=M.theta,z=Math.cos(L)*u,F=Math.sin(L)*u,N=(y>m.center?m.right-y:y-m.left)/(z+Math.abs(Math.sin(L)*v)),B=(I>m.middle?m.bottom-I:I-m.top)/(Math.abs(F)+Math.cos(L)*v);if(N<1||B<1)return 1/0;var R=c.EDGECOST*(1/(N-1)+1/(B-1));R+=c.ANGLECOST*L*L;for(var U=y-z,j=I-F,Z=y+z,re=I+F,fe=0;fe=x)&&(r<=g&&(r=g),o>=x&&(o=x),i=Math.floor((o-r)/n)+1,a=0),l=0;lg&&(p.unshift(g),d.unshift(d[0])),p[p.length-1]2?s.value=s.value.slice(2):s.length===0?s.value=[0,1]:s.length<2?(f=parseFloat(s.value[0]),s.value=[f,f+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:h(s.value)&&(f=parseFloat(s.value),s.value=[f,f+1])):(a("contours.value",0),h(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}}),D2=Ge({"src/traces/contour/defaults.js"($,G){var h=yn(),b=gh(),S=Op(),E=I2(),e=$x(),t=G1(),r=pg(),o=H1();G.exports=function(i,a,s,f){function c(l,g){return h.coerce(i,a,o,l,g)}function p(l){return h.coerce2(i,a,o,l)}var d=b(i,a,c,f);if(!d){a.visible=!1;return}S(i,a,f,c),c("xhoverformat"),c("yhoverformat"),c("text"),c("hovertext"),c("hoverongaps"),c("hovertemplate"),c("hovertemplatefallback");var T=c("contours.type")==="constraint";c("connectgaps",h.isArray1D(a.z)),T?E(i,a,c,f,s):(e(i,a,c,p),t(i,a,c,f)),a.contours&&a.contours.coloring==="heatmap"&&r(c,f),c("zorder")}}}),I5=Ge({"src/traces/contour/index.js"($,G){G.exports={attributes:H1(),supplyDefaults:D2(),calc:Qx(),plot:tb().plot,style:Y1(),colorbar:my(),hoverPoints:R2(),moduleType:"trace",name:"contour",basePlotModule:ph(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),z2=Ge({"lib/contour.js"($,G){G.exports=I5()}}),rb=Ge({"src/traces/scatterternary/attributes.js"($,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=ad(),e=jc(),t=nu(),r=Ru(),o=hv().dash,n=Qi().extendFlat,i=e.marker,a=e.line,s=i.line;G.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:n({},e.mode,{dflt:"markers"}),text:n({},e.text,{}),texttemplate:b({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:n({},e.hovertext,{}),line:{color:a.color,width:a.width,dash:o,backoff:a.backoff,shape:n({},a.shape,{values:["linear","spline"]}),smoothing:a.smoothing,editType:"calc"},connectgaps:e.connectgaps,cliponaxis:e.cliponaxis,fill:n({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:E(),marker:n({symbol:i.symbol,opacity:i.opacity,angle:i.angle,angleref:i.angleref,standoff:i.standoff,maxdisplayed:i.maxdisplayed,size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,line:n({width:s.width,editType:"calc"},r("marker.line")),gradient:i.gradient,editType:"calc"},r("marker")),textfont:e.textfont,textposition:e.textposition,selected:e.selected,unselected:e.unselected,hoverinfo:n({},t.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:e.hoveron,hovertemplate:h(),hovertemplatefallback:S()}}}),D5=Ge({"src/traces/scatterternary/defaults.js"($,G){var h=yn(),b=i0(),S=ou(),E=Gv(),e=Fp(),t=Xv(),r=ep(),o=Dv(),n=rb();G.exports=function(a,s,f,c){function p(M,_){return h.coerce(a,s,n,M,_)}var d=p("a"),T=p("b"),l=p("c"),g;if(d?(g=d.length,T?(g=Math.min(g,T.length),l&&(g=Math.min(g,l.length))):l?g=Math.min(g,l.length):g=0):T&&l&&(g=Math.min(T.length,l.length)),!g){s.visible=!1;return}s._length=g,p("sum"),p("text"),p("hovertext"),s.hoveron!=="fills"&&(p("hovertemplate"),p("hovertemplatefallback"));var x=g"),o.hovertemplate=c.hovertemplate,r}}}),B5=Ge({"src/traces/scatterternary/event_data.js"($,G){G.exports=function(b,S,E,e,t){if(S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),e[t]){var r=e[t];b.a=r.a,b.b=r.b,b.c=r.c}else b.a=S.a,b.b=S.b,b.c=S.c;return b}}}),nb=Ge({"src/plots/ternary/ternary.js"($,G){var h=Za(),b=ks(),S=Io(),E=yn(),e=E.strTranslate,t=E._,r=So(),o=Ms(),n=Kd(),i=Qi().extendFlat,a=$c(),s=Ss(),f=nd(),c=qf(),p=Dp(),d=p.freeMode,T=p.rectMode,l=am(),g=Zf().prepSelect,x=Zf().selectOnClick,A=Zf().clearOutline,M=Zf().clearSelectionsCache,_=nh();function w(R,U){this.id=R.id,this.graphDiv=R.graphDiv,this.init(U),this.makeFramework(U),this.updateFx(U),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}G.exports=w;var m=w.prototype;m.init=function(R){this.container=R._ternarylayer,this.defs=R._defs,this.layoutId=R._uid,this.traceHash={},this.layers={}},m.plot=function(R,U){var j=this,Z=U[j.id],re=U._size;j._hasClipOnAxisFalse=!1;for(var fe=0;feu*ee?(ve=ee,ie=ve*u):(ie=V,ve=ie/u),Ae=le*ie/V,Ce=ce*ve/ee,H=U.l+U.w*re-ie/2,ae=U.t+U.h*(1-fe)-ve/2,j.x0=H,j.y0=ae,j.w=ie,j.h=ve,j.sum=ne,j.xaxis={type:"linear",range:[K+2*te-ne,ne-K-2*ue],domain:[re-Ae/2,re+Ae/2],_id:"x"},n(j.xaxis,j.graphDiv._fullLayout),j.xaxis.setScale(),j.xaxis.isPtWithinRange=function(Ne){return Ne.a>=j.aaxis.range[0]&&Ne.a<=j.aaxis.range[1]&&Ne.b>=j.baxis.range[1]&&Ne.b<=j.baxis.range[0]&&Ne.c>=j.caxis.range[1]&&Ne.c<=j.caxis.range[0]},j.yaxis={type:"linear",range:[K,ne-ue-te],domain:[fe-Ce/2,fe+Ce/2],_id:"y"},n(j.yaxis,j.graphDiv._fullLayout),j.yaxis.setScale(),j.yaxis.isPtWithinRange=function(){return!0};var Fe=j.yaxis.domain[0],ze=j.aaxis=i({},R.aaxis,{range:[K,ne-ue-te],side:"left",tickangle:(+R.aaxis.tickangle||0)-30,domain:[Fe,Fe+Ce*u],anchor:"free",position:0,_id:"y",_length:ie});n(ze,j.graphDiv._fullLayout),ze.setScale();var Ye=j.baxis=i({},R.baxis,{range:[ne-K-te,ue],side:"bottom",domain:j.xaxis.domain,anchor:"free",position:0,_id:"x",_length:ie});n(Ye,j.graphDiv._fullLayout),Ye.setScale();var it=j.caxis=i({},R.caxis,{range:[ne-K-ue,te],side:"right",tickangle:(+R.caxis.tickangle||0)+30,domain:[Fe,Fe+Ce*u],anchor:"free",position:0,_id:"y",_length:ie});n(it,j.graphDiv._fullLayout),it.setScale();var st="M"+H+","+(ae+ve)+"h"+ie+"l-"+ie/2+",-"+ve+"Z";j.clipDef.select("path").attr("d",st),j.layers.plotbg.select("path").attr("d",st);var nt="M0,"+ve+"h"+ie+"l-"+ie/2+",-"+ve+"Z";j.clipDefRelative.select("path").attr("d",nt);var Qe=e(H,ae);j.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Qe),j.clipDefRelative.select("path").attr("transform",null);var Le=e(H-Ye._offset,ae+ve);j.layers.baxis.attr("transform",Le),j.layers.bgrid.attr("transform",Le);var Te=e(H+ie/2,ae)+"rotate(30)"+e(0,-ze._offset);j.layers.aaxis.attr("transform",Te),j.layers.agrid.attr("transform",Te);var pe=e(H+ie/2,ae)+"rotate(-30)"+e(0,-it._offset);j.layers.caxis.attr("transform",pe),j.layers.cgrid.attr("transform",pe),j.drawAxes(!0),j.layers.aline.select("path").attr("d",ze.showline?"M"+H+","+(ae+ve)+"l"+ie/2+",-"+ve:"M0,0").call(r.stroke,ze.linecolor||"#000").style("stroke-width",(ze.linewidth||0)+"px"),j.layers.bline.select("path").attr("d",Ye.showline?"M"+H+","+(ae+ve)+"h"+ie:"M0,0").call(r.stroke,Ye.linecolor||"#000").style("stroke-width",(Ye.linewidth||0)+"px"),j.layers.cline.select("path").attr("d",it.showline?"M"+(H+ie/2)+","+ae+"l"+ie/2+","+ve:"M0,0").call(r.stroke,it.linecolor||"#000").style("stroke-width",(it.linewidth||0)+"px"),j.graphDiv._context.staticPlot||j.initInteractions(),o.setClipUrl(j.layers.frontplot,j._hasClipOnAxisFalse?null:j.clipId,j.graphDiv)},m.drawAxes=function(R){var U=this,j=U.graphDiv,Z=U.id.slice(7)+"title",re=U.layers,fe=U.aaxis,le=U.baxis,ce=U.caxis;if(U.drawAx(fe),U.drawAx(le),U.drawAx(ce),R){var V=Math.max(fe.showticklabels?fe.tickfont.size/2:0,(ce.showticklabels?ce.tickfont.size*.75:0)+(ce.ticks==="outside"?ce.ticklen*.87:0)),ee=(le.showticklabels?le.tickfont.size:0)+(le.ticks==="outside"?le.ticklen:0)+3;re["a-title"]=l.draw(j,"a"+Z,{propContainer:fe,propName:U.id+".aaxis.title.text",placeholder:t(j,"Click to enter Component A title"),attributes:{x:U.x0+U.w/2,y:U.y0-fe.title.font.size/3-V,"text-anchor":"middle"}}),re["b-title"]=l.draw(j,"b"+Z,{propContainer:le,propName:U.id+".baxis.title.text",placeholder:t(j,"Click to enter Component B title"),attributes:{x:U.x0-ee,y:U.y0+U.h+le.title.font.size*.83+ee,"text-anchor":"middle"}}),re["c-title"]=l.draw(j,"c"+Z,{propContainer:ce,propName:U.id+".caxis.title.text",placeholder:t(j,"Click to enter Component C title"),attributes:{x:U.x0+U.w+ee,y:U.y0+U.h+ce.title.font.size*.83+ee,"text-anchor":"middle"}})}},m.drawAx=function(R){var U=this,j=U.graphDiv,Z=R._name,re=Z.charAt(0),fe=R._id,le=U.layers[Z],ce=30,V=re+"tickLayout",ee=v(R);U[V]!==ee&&(le.selectAll("."+fe+"tick").remove(),U[V]=ee),R.setScale();var ne=s.calcTicks(R),K=s.clipEnds(R,ne),ue=s.makeTransTickFn(R),te=s.getTickSigns(R)[2],H=E.deg2rad(ce),ae=te*(R.linewidth||1)/2,ie=te*R.ticklen,ve=U.w,Ae=U.h,Ce=re==="b"?"M0,"+ae+"l"+Math.sin(H)*ie+","+Math.cos(H)*ie:"M"+ae+",0l"+Math.cos(H)*ie+","+-Math.sin(H)*ie,Fe={a:"M0,0l"+Ae+",-"+ve/2,b:"M0,0l-"+ve/2+",-"+Ae,c:"M0,0l-"+Ae+","+ve/2}[re];s.drawTicks(j,R,{vals:R.ticks==="inside"?K:ne,layer:le,path:Ce,transFn:ue,crisp:!1}),s.drawGrid(j,R,{vals:K,layer:U.layers[re+"grid"],path:Fe,transFn:ue,crisp:!1}),s.drawLabels(j,R,{vals:ne,layer:le,transFn:ue,labelFns:s.makeLabelFns(R,0,ce)})};function v(R){return R.ticks+String(R.ticklen)+String(R.showticklabels)}var y=_.MINZOOM/2+.87,I="m-0.87,.5h"+y+"v3h-"+(y+5.2)+"l"+(y/2+2.6)+",-"+(y*.87+4.5)+"l2.6,1.5l-"+y/2+","+y*.87+"Z",L="m0.87,.5h-"+y+"v3h"+(y+5.2)+"l-"+(y/2+2.6)+",-"+(y*.87+4.5)+"l-2.6,1.5l"+y/2+","+y*.87+"Z",z="m0,1l"+y/2+","+y*.87+"l2.6,-1.5l-"+(y/2+2.6)+",-"+(y*.87+4.5)+"l-"+(y/2+2.6)+","+(y*.87+4.5)+"l2.6,1.5l"+y/2+",-"+y*.87+"Z",F="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",N=!0;m.clearOutline=function(){M(this.dragOptions),A(this.dragOptions.gd)},m.initInteractions=function(){var R=this,U=R.layers.plotbg.select("path").node(),j=R.graphDiv,Z=j._fullLayout._zoomlayer,re,fe;this.dragOptions={element:U,gd:j,plotinfo:{id:R.id,domain:j._fullLayout[R.id].domain,xaxis:R.xaxis,yaxis:R.yaxis},subplot:R.id,prepFn:function(Le,Te,pe){R.dragOptions.xaxes=[R.xaxis],R.dragOptions.yaxes=[R.yaxis],re=j._fullLayout._invScaleX,fe=j._fullLayout._invScaleY;var Ne=R.dragOptions.dragmode=j._fullLayout.dragmode;d(Ne)?R.dragOptions.minDrag=1:R.dragOptions.minDrag=void 0,Ne==="zoom"?(R.dragOptions.moveFn=Ye,R.dragOptions.clickFn=ve,R.dragOptions.doneFn=it,Ae(Le,Te,pe)):Ne==="pan"?(R.dragOptions.moveFn=nt,R.dragOptions.clickFn=ve,R.dragOptions.doneFn=Qe,st(),R.clearOutline(j)):(T(Ne)||d(Ne))&&g(Le,Te,pe,R.dragOptions,Ne)}};var le,ce,V,ee,ne,K,ue,te,H,ae;function ie(Le){var Te={};return Te[R.id+".aaxis.min"]=Le.a,Te[R.id+".baxis.min"]=Le.b,Te[R.id+".caxis.min"]=Le.c,Te}function ve(Le,Te){var pe=j._fullLayout.clickmode;B(j),Le===2&&(j.emit("plotly_doubleclick",null),S.call("_guiRelayout",j,ie({a:0,b:0,c:0}))),pe.indexOf("select")>-1&&Le===1&&x(Te,j,[R.xaxis],[R.yaxis],R.id,R.dragOptions),pe.indexOf("event")>-1&&c.click(j,Te,R.id)}function Ae(Le,Te,pe){var Ne=U.getBoundingClientRect();le=Te-Ne.left,ce=pe-Ne.top,j._fullLayout._calcInverseTransform(j);var ot=j._fullLayout._invTransform,ft=E.apply3DTransform(ot)(le,ce);le=ft[0],ce=ft[1],V={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},ne=V,ee=R.aaxis.range[1]-V.a,K=b(R.graphDiv._fullLayout[R.id].bgcolor).getLuminance(),ue="M0,"+R.h+"L"+R.w/2+", 0L"+R.w+","+R.h+"Z",te=!1,H=Z.append("path").attr("class","zoombox").attr("transform",e(R.x0,R.y0)).style({fill:K>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",ue),ae=Z.append("path").attr("class","zoombox-corners").attr("transform",e(R.x0,R.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),R.clearOutline(j)}function Ce(Le,Te){return 1-Te/R.h}function Fe(Le,Te){return 1-(Le+(R.h-Te)/Math.sqrt(3))/R.w}function ze(Le,Te){return(Le-(R.h-Te)/Math.sqrt(3))/R.w}function Ye(Le,Te){var pe=le+Le*re,Ne=ce+Te*fe,ot=Math.max(0,Math.min(1,Ce(le,ce),Ce(pe,Ne))),ft=Math.max(0,Math.min(1,Fe(le,ce),Fe(pe,Ne))),rt=Math.max(0,Math.min(1,ze(le,ce),ze(pe,Ne))),Ft=(ot/2+rt)*R.w,Nt=(1-ot/2-ft)*R.w,$t=(Ft+Nt)/2,rr=Nt-Ft,Er=(1-ot)*R.h,Mr=Er-rr/u;rr<_.MINZOOM?(ne=V,H.attr("d",ue),ae.attr("d","M0,0Z")):(ne={a:V.a+ot*ee,b:V.b+ft*ee,c:V.c+rt*ee},H.attr("d",ue+"M"+Ft+","+Er+"H"+Nt+"L"+$t+","+Mr+"L"+Ft+","+Er+"Z"),ae.attr("d","M"+le+","+ce+F+"M"+Ft+","+Er+I+"M"+Nt+","+Er+L+"M"+$t+","+Mr+z)),te||(H.transition().style("fill",K>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ae.transition().style("opacity",1).duration(200),te=!0),j.emit("plotly_relayouting",ie(ne))}function it(){B(j),ne!==V&&(S.call("_guiRelayout",j,ie(ne)),N&&j.data&&j._context.showTips&&(E.notifier(t(j,"Double-click to zoom back out"),"long"),N=!1))}function st(){V={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},ne=V}function nt(Le,Te){var pe=Le/R.xaxis._m,Ne=Te/R.yaxis._m;ne={a:V.a-Ne,b:V.b+(pe+Ne)/2,c:V.c-(pe-Ne)/2};var ot=[ne.a,ne.b,ne.c].sort(E.sorterAsc),ft={a:ot.indexOf(ne.a),b:ot.indexOf(ne.b),c:ot.indexOf(ne.c)};ot[0]<0&&(ot[1]+ot[0]/2<0?(ot[2]+=ot[0]+ot[1],ot[0]=ot[1]=0):(ot[2]+=ot[0]/2,ot[1]+=ot[0]/2,ot[0]=0),ne={a:ot[ft.a],b:ot[ft.b],c:ot[ft.c]},Te=(V.a-ne.a)*R.yaxis._m,Le=(V.c-ne.c-V.b+ne.b)*R.xaxis._m);var rt=e(R.x0+Le,R.y0+Te);R.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",rt);var Ft=e(-Le,-Te);R.clipDefRelative.select("path").attr("transform",Ft),R.aaxis.range=[ne.a,R.sum-ne.b-ne.c],R.baxis.range=[R.sum-ne.a-ne.c,ne.b],R.caxis.range=[R.sum-ne.a-ne.b,ne.c],R.drawAxes(!1),R._hasClipOnAxisFalse&&R.plotContainer.select(".scatterlayer").selectAll(".trace").call(o.hideOutsideRangePoints,R),j.emit("plotly_relayouting",ie(ne))}function Qe(){S.call("_guiRelayout",j,ie(ne))}U.onmousemove=function(Le){c.hover(j,Le,R.id),j._fullLayout._lasthover=U,j._fullLayout._hoversubplot=R.id},U.onmouseout=function(Le){j._dragging||f.unhover(j,Le)},f.init(this.dragOptions)};function B(R){h.select(R).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),O2=Ge({"src/plots/ternary/layout_attributes.js"($,G){var h=rh(),b=Sc().attributes,S=tv(),E=Uc().overrideAll,e=Qi().extendFlat,t={title:{text:S.title.text,font:S.title.font},color:S.color,tickmode:S.minor.tickmode,nticks:e({},S.nticks,{dflt:6,min:1}),tick0:S.tick0,dtick:S.dtick,tickvals:S.tickvals,ticktext:S.ticktext,ticks:S.ticks,ticklen:S.ticklen,tickwidth:S.tickwidth,tickcolor:S.tickcolor,ticklabelstep:S.ticklabelstep,showticklabels:S.showticklabels,labelalias:S.labelalias,showtickprefix:S.showtickprefix,tickprefix:S.tickprefix,showticksuffix:S.showticksuffix,ticksuffix:S.ticksuffix,showexponent:S.showexponent,exponentformat:S.exponentformat,minexponent:S.minexponent,separatethousands:S.separatethousands,tickfont:S.tickfont,tickangle:S.tickangle,tickformat:S.tickformat,tickformatstops:S.tickformatstops,hoverformat:S.hoverformat,showline:e({},S.showline,{dflt:!0}),linecolor:S.linecolor,linewidth:S.linewidth,showgrid:e({},S.showgrid,{dflt:!0}),gridcolor:S.gridcolor,gridwidth:S.gridwidth,griddash:S.griddash,layer:S.layer,min:{valType:"number",dflt:0,min:0}},r=G.exports=E({domain:b({name:"ternary"}),bgcolor:{valType:"color",dflt:h.background},sum:{valType:"number",dflt:1,min:0},aaxis:t,baxis:t,caxis:t},"plot","from-root");r.uirevision={valType:"any",editType:"none"},r.aaxis.uirevision=r.baxis.uirevision=r.caxis.uirevision={valType:"any",editType:"none"}}}),B0=Ge({"src/plots/subplot_defaults.js"($,G){var h=yn(),b=mu(),S=Sc().defaults;G.exports=function(e,t,r,o){var n=o.type,i=o.attributes,a=o.handleDefaults,s=o.partition||"x",f=t._subplots[n],c=f.length,p=c&&f[0].replace(/\d+$/,""),d,T;function l(M,_){return h.coerce(d,T,i,M,_)}for(var g=0;g=g&&(w.min=0,m.min=0,u.min=0,c.aaxis&&delete c.aaxis.min,c.baxis&&delete c.baxis.min,c.caxis&&delete c.caxis.min)}function f(c,p,d,T){var l=i[p._name];function g(v,y){return S.coerce(c,p,l,v,y)}g("uirevision",T.uirevision),p.type="linear";var x=g("color"),A=x!==l.color.dflt?x:d.font.color,M=p._name,_=M.charAt(0).toUpperCase(),w="Component "+_,m=g("title.text",w);p._hovertitle=m===w?m:_,S.coerceFont(g,"title.font",d.font,{overrideDflt:{size:S.bigFont(d.font.size),color:A}}),g("min"),o(c,p,g,"linear"),t(c,p,g,"linear"),e(c,p,g,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(c,p,g,{outerTicks:!0});var u=g("showticklabels");u&&(S.coerceFont(g,"tickfont",d.font,{overrideDflt:{color:A}}),g("tickangle"),g("tickformat")),n(c,p,g,{dfltColor:x,bgColor:d.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),g("hoverformat"),g("layer")}}}),U5=Ge({"src/plots/ternary/index.js"($){var G=nb(),h=Iv().getSubplotCalcData,b=yn().counterRegex,S="ternary";$.name=S;var E=$.attr="subplot";$.idRoot=S,$.idRegex=$.attrRegex=b(S);var e=$.attributes={};e[E]={valType:"subplotid",dflt:"ternary",editType:"calc"},$.layoutAttributes=O2(),$.supplyLayoutDefaults=N5(),$.plot=function(r){for(var o=r._fullLayout,n=r.calcdata,i=o._subplots[S],a=0;a0){var M=r.xa,_=r.ya,w,m,u,v,y;c.orientation==="h"?(y=o,w="y",u=_,m="x",v=M):(y=n,w="x",u=M,m="y",v=_);var I=f[r.index];if(y>=I.span[0]&&y<=I.span[1]){var L=b.extendFlat({},r),z=v.c2p(y,!0),F=e.getKdeValue(I,c,y),N=e.getPositionOnKdePath(I,c,z),B=u._offset,R=u._length;L[w+"0"]=N[0],L[w+"1"]=N[1],L[m+"0"]=L[m+"1"]=z,L[m+"Label"]=m+": "+S.hoverLabelText(v,y,c[m+"hoverformat"])+", "+f[0].t.labels.kde+" "+F.toFixed(3);for(var U=0,j=0;j path").each(function(d){if(!d.isBlank){var T=p.marker;h.select(this).call(S.fill,d.mc||T.color).call(S.stroke,d.mlc||T.line.color).call(b.dashLine,T.line.dash,d.mlw||T.line.width).style("opacity",p.selectedpoints&&!d.selected?E:1)}}),r(c,p,n),c.selectAll(".regions").each(function(){h.select(this).selectAll("path").style("stroke-width",0).call(S.fill,p.connector.fillcolor)}),c.selectAll(".lines").each(function(){var d=p.connector.line;b.lineGroupStyle(h.select(this).selectAll("path"),d.width,d.color,d.dash)})})}G.exports={style:o}}}),X2=Ge({"src/traces/funnel/hover.js"($,G){var h=So().opacity,b=Mc().hoverOnBars,S=yn().formatPercent;G.exports=function(t,r,o,n,i){var a=b(t,r,o,n,i);if(a){var s=a.cd,f=s[0].trace,c=f.orientation==="h",p=a.index,d=s[p],T=c?"x":"y";a[T+"LabelVal"]=d.s,a.percentInitial=d.begR,a.percentInitialLabel=S(d.begR,1),a.percentPrevious=d.difR,a.percentPreviousLabel=S(d.difR,1),a.percentTotal=d.sumR,a.percentTotalLabel=S(d.sumR,1);var l=d.hi||f.hoverinfo,g=[];if(l&&l!=="none"&&l!=="skip"){var x=l==="all",A=l.split("+"),M=function(_){return x||A.indexOf(_)!==-1};M("percent initial")&&g.push(a.percentInitialLabel+" of initial"),M("percent previous")&&g.push(a.percentPreviousLabel+" of previous"),M("percent total")&&g.push(a.percentTotalLabel+" of total")}return a.extraText=g.join("
"),a.color=E(f,d),[a]}};function E(e,t){var r=e.marker,o=t.mc||r.color,n=t.mlc||r.line.color,i=t.mlw||r.line.width;if(h(o))return o;if(h(n)&&i)return n}}}),Y5=Ge({"src/traces/funnel/event_data.js"($,G){G.exports=function(b,S){return b.x="xVal"in S?S.xVal:S.x,b.y="yVal"in S?S.yVal:S.y,"percentInitial"in S&&(b.percentInitial=S.percentInitial),"percentPrevious"in S&&(b.percentPrevious=S.percentPrevious),"percentTotal"in S&&(b.percentTotal=S.percentTotal),S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),b}}}),Y2=Ge({"src/traces/funnel/index.js"($,G){G.exports={attributes:N2(),layoutAttributes:U2(),supplyDefaults:j2().supplyDefaults,crossTraceDefaults:j2().crossTraceDefaults,supplyLayoutDefaults:q2(),calc:H2(),crossTraceCalc:X5(),plot:G2(),style:sb().style,hoverPoints:X2(),eventData:Y5(),selectPoints:ym(),moduleType:"trace",name:"funnel",basePlotModule:ph(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),Z5=Ge({"lib/funnel.js"($,G){G.exports=Y2()}}),N0=Ge({"src/traces/waterfall/constants.js"($,G){G.exports={eventDataKeys:["initial","delta","final"]}}}),lb=Ge({"src/traces/waterfall/attributes.js"($,G){var h=Bh(),b=jc().line,S=nu(),E=hc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=N0(),n=Qi().extendFlat,i=So();function a(s){return{marker:{color:n({},h.marker.color,{arrayOk:!1,editType:"style"}),line:{color:n({},h.marker.line.color,{arrayOk:!1,editType:"style"}),width:n({},h.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}G.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:h.x,x0:h.x0,dx:h.dx,y:h.y,y0:h.y0,dy:h.dy,xperiod:h.xperiod,yperiod:h.yperiod,xperiod0:h.xperiod0,yperiod0:h.yperiod0,xperiodalignment:h.xperiodalignment,yperiodalignment:h.yperiodalignment,xhoverformat:E("x"),yhoverformat:E("y"),hovertext:h.hovertext,hovertemplate:e({},{keys:o.eventDataKeys}),hovertemplatefallback:r(),hoverinfo:n({},S.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:t({editType:"plot"},{keys:o.eventDataKeys.concat(["label"])}),texttemplatefallback:r({editType:"plot"}),text:h.text,textposition:h.textposition,insidetextanchor:h.insidetextanchor,textangle:h.textangle,textfont:h.textfont,insidetextfont:h.insidetextfont,outsidetextfont:h.outsidetextfont,constraintext:h.constraintext,cliponaxis:h.cliponaxis,orientation:h.orientation,offset:h.offset,width:h.width,increasing:a(),decreasing:a(),totals:a(),connector:{line:{color:n({},b.color,{dflt:i.defaultLine}),width:n({},b.width,{editType:"plot"}),dash:b.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:h.offsetgroup,alignmentgroup:h.alignmentgroup,zorder:h.zorder}}}),W5=Ge({"src/traces/waterfall/layout_attributes.js"($,G){G.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),gy=Ge({"src/constants/delta.js"($,G){G.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),c0=Ge({"src/traces/waterfall/defaults.js"($,G){var h=yn(),b=R0(),S=kd().handleText,E=zp(),e=Op(),t=lb(),r=So(),o=gy(),n=o.INCREASING.COLOR,i=o.DECREASING.COLOR,a="#4499FF";function s(p,d,T){p(d+".marker.color",T),p(d+".marker.line.color",r.defaultLine),p(d+".marker.line.width")}function f(p,d,T,l){function g(w,m){return h.coerce(p,d,t,w,m)}var x=E(p,d,l,g);if(!x){d.visible=!1;return}e(p,d,l,g),g("xhoverformat"),g("yhoverformat"),g("measure"),g("orientation",d.x&&!d.y?"h":"v"),g("base"),g("offset"),g("width"),g("text"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var A=g("textposition");S(p,d,l,g,A,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),d.textposition!=="none"&&(g("texttemplate"),g("texttemplatefallback"),d.texttemplate||g("textinfo")),s(g,"increasing",n),s(g,"decreasing",i),s(g,"totals",a);var M=g("connector.visible");if(M){g("connector.mode");var _=g("connector.line.width");_&&(g("connector.line.color"),g("connector.line.dash"))}g("zorder")}function c(p,d){var T,l;function g(A){return h.coerce(l._input,l,t,A)}if(d.waterfallmode==="group")for(var x=0;x0&&(g?y+="M"+u[0]+","+v[1]+"V"+v[0]:y+="M"+u[1]+","+v[0]+"H"+u[0]),x!=="between"&&(_.isSum||w path").each(function(d){if(!d.isBlank){var T=p[d.dir].marker;h.select(this).call(S.fill,T.color).call(S.stroke,T.line.color).call(b.dashLine,T.line.dash,T.line.width).style("opacity",p.selectedpoints&&!d.selected?E:1)}}),r(c,p,n),c.selectAll(".lines").each(function(){var d=p.connector.line;b.lineGroupStyle(h.select(this).selectAll("path"),d.width,d.color,d.dash)})})}G.exports={style:o}}}),BM=Ge({"src/traces/waterfall/hover.js"($,G){var h=Ss().hoverLabelText,b=So().opacity,S=Mc().hoverOnBars,E=gy(),e={increasing:E.INCREASING.SYMBOL,decreasing:E.DECREASING.SYMBOL};G.exports=function(o,n,i,a,s){var f=S(o,n,i,a,s);if(!f)return;var c=f.cd,p=c[0].trace,d=p.orientation==="h",T=d?"x":"y",l=d?o.xa:o.ya;function g(I){return h(l,I,p[T+"hoverformat"])}var x=f.index,A=c[x],M=A.isSum?A.b+A.s:A.rawS;f.initial=A.b+A.s-M,f.delta=M,f.final=f.initial+f.delta;var _=g(Math.abs(f.delta));f.deltaLabel=M<0?"("+_+")":_,f.finalLabel=g(f.final),f.initialLabel=g(f.initial);var w=A.hi||p.hoverinfo,m=[];if(w&&w!=="none"&&w!=="skip"){var u=w==="all",v=w.split("+"),y=function(I){return u||v.indexOf(I)!==-1};A.isSum||(y("final")&&(d?!y("x"):!y("y"))&&m.push(f.finalLabel),y("delta")&&(M<0?m.push(f.deltaLabel+" "+e.decreasing):m.push(f.deltaLabel+" "+e.increasing)),y("initial")&&m.push("Initial: "+f.initialLabel))}return m.length&&(f.extraText=m.join("
")),f.color=t(p,A),[f]};function t(r,o){var n=r[o.dir].marker,i=n.color,a=n.line.color,s=n.line.width;if(b(i))return i;if(b(a)&&s)return a}}}),NM=Ge({"src/traces/waterfall/event_data.js"($,G){G.exports=function(b,S){return b.x="xVal"in S?S.xVal:S.x,b.y="yVal"in S?S.yVal:S.y,"initial"in S&&(b.initial=S.initial),"delta"in S&&(b.delta=S.delta),"final"in S&&(b.final=S.final),S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),b}}}),$5=Ge({"src/traces/waterfall/index.js"($,G){G.exports={attributes:lb(),layoutAttributes:W5(),supplyDefaults:c0().supplyDefaults,crossTraceDefaults:c0().crossTraceDefaults,supplyLayoutDefaults:Z2(),calc:K5(),crossTraceCalc:ub(),plot:K1(),style:Wf().style,hoverPoints:BM(),eventData:NM(),selectPoints:ym(),moduleType:"trace",name:"waterfall",basePlotModule:ph(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),$1=Ge({"lib/waterfall.js"($,G){G.exports=$5()}}),mp=Ge({"src/traces/image/constants.js"($,G){G.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(h){return h.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(h){return h.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(h){return h.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(h){var b=h.slice(0,3);return b[1]=b[1]+"%",b[2]=b[2]+"%",b},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(h){var b=h.slice(0,4);return b[1]=b[1]+"%",b[2]=b[2]+"%",b},suffix:["°","%","%",""]}}}}}),W2=Ge({"src/traces/image/attributes.js"($,G){var h=nu(),b=jc().zorder,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=Qi().extendFlat,t=mp().colormodel,r=["rgb","rgba","rgba256","hsl","hsla"],o=[],n=[];for(a=0;a0)throw new Error("Invalid string. Length must be a multiple of 4");var p=f.indexOf("=");p===-1&&(p=c);var d=p===c?0:4-p%4;return[p,d]}function r(f){var c=t(f),p=c[0],d=c[1];return(p+d)*3/4-d}function o(f,c,p){return(c+p)*3/4-p}function n(f){var c,p=t(f),d=p[0],T=p[1],l=new b(o(f,d,T)),g=0,x=T>0?d-4:d,A;for(A=0;A>16&255,l[g++]=c>>8&255,l[g++]=c&255;return T===2&&(c=h[f.charCodeAt(A)]<<2|h[f.charCodeAt(A+1)]>>4,l[g++]=c&255),T===1&&(c=h[f.charCodeAt(A)]<<10|h[f.charCodeAt(A+1)]<<4|h[f.charCodeAt(A+2)]>>2,l[g++]=c>>8&255,l[g++]=c&255),l}function i(f){return G[f>>18&63]+G[f>>12&63]+G[f>>6&63]+G[f&63]}function a(f,c,p){for(var d,T=[],l=c;lx?x:g+l));return d===1?(c=f[p-1],T.push(G[c>>2]+G[c<<4&63]+"==")):d===2&&(c=(f[p-2]<<8)+f[p-1],T.push(G[c>>10]+G[c>>4&63]+G[c<<2&63]+"=")),T.join("")}}}),K2=Ge({"node_modules/ieee754/index.js"($){$.read=function(G,h,b,S,E){var e,t,r=E*8-S-1,o=(1<>1,i=-7,a=b?E-1:0,s=b?-1:1,f=G[h+a];for(a+=s,e=f&(1<<-i)-1,f>>=-i,i+=r;i>0;e=e*256+G[h+a],a+=s,i-=8);for(t=e&(1<<-i)-1,e>>=-i,i+=S;i>0;t=t*256+G[h+a],a+=s,i-=8);if(e===0)e=1-n;else{if(e===o)return t?NaN:(f?-1:1)*(1/0);t=t+Math.pow(2,S),e=e-n}return(f?-1:1)*t*Math.pow(2,e-S)},$.write=function(G,h,b,S,E,e){var t,r,o,n=e*8-E-1,i=(1<>1,s=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=S?0:e-1,c=S?1:-1,p=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(r=isNaN(h)?1:0,t=i):(t=Math.floor(Math.log(h)/Math.LN2),h*(o=Math.pow(2,-t))<1&&(t--,o*=2),t+a>=1?h+=s/o:h+=s*Math.pow(2,1-a),h*o>=2&&(t++,o/=2),t+a>=i?(r=0,t=i):t+a>=1?(r=(h*o-1)*Math.pow(2,E),t=t+a):(r=h*Math.pow(2,a-1)*Math.pow(2,E),t=0));E>=8;G[b+f]=r&255,f+=c,r/=256,E-=8);for(t=t<0;G[b+f]=t&255,f+=c,t/=256,n-=8);G[b+f-c]|=p*128}}}),gg=Ge({"node_modules/buffer/index.js"($){var G=Q5(),h=K2(),b=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;$.Buffer=t,$.SlowBuffer=T,$.INSPECT_MAX_BYTES=50;var S=2147483647;$.kMaxLength=S,t.TYPED_ARRAY_SUPPORT=E(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function E(){try{const Le=new Uint8Array(1),Te={foo:function(){return 42}};return Object.setPrototypeOf(Te,Uint8Array.prototype),Object.setPrototypeOf(Le,Te),Le.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function e(Le){if(Le>S)throw new RangeError('The value "'+Le+'" is invalid for option "size"');const Te=new Uint8Array(Le);return Object.setPrototypeOf(Te,t.prototype),Te}function t(Le,Te,pe){if(typeof Le=="number"){if(typeof Te=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(Le)}return r(Le,Te,pe)}t.poolSize=8192;function r(Le,Te,pe){if(typeof Le=="string")return a(Le,Te);if(ArrayBuffer.isView(Le))return f(Le);if(Le==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Le);if(Ye(Le,ArrayBuffer)||Le&&Ye(Le.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ye(Le,SharedArrayBuffer)||Le&&Ye(Le.buffer,SharedArrayBuffer)))return c(Le,Te,pe);if(typeof Le=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Ne=Le.valueOf&&Le.valueOf();if(Ne!=null&&Ne!==Le)return t.from(Ne,Te,pe);const ot=p(Le);if(ot)return ot;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Le[Symbol.toPrimitive]=="function")return t.from(Le[Symbol.toPrimitive]("string"),Te,pe);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Le)}t.from=function(Le,Te,pe){return r(Le,Te,pe)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function o(Le){if(typeof Le!="number")throw new TypeError('"size" argument must be of type number');if(Le<0)throw new RangeError('The value "'+Le+'" is invalid for option "size"')}function n(Le,Te,pe){return o(Le),Le<=0?e(Le):Te!==void 0?typeof pe=="string"?e(Le).fill(Te,pe):e(Le).fill(Te):e(Le)}t.alloc=function(Le,Te,pe){return n(Le,Te,pe)};function i(Le){return o(Le),e(Le<0?0:d(Le)|0)}t.allocUnsafe=function(Le){return i(Le)},t.allocUnsafeSlow=function(Le){return i(Le)};function a(Le,Te){if((typeof Te!="string"||Te==="")&&(Te="utf8"),!t.isEncoding(Te))throw new TypeError("Unknown encoding: "+Te);const pe=l(Le,Te)|0;let Ne=e(pe);const ot=Ne.write(Le,Te);return ot!==pe&&(Ne=Ne.slice(0,ot)),Ne}function s(Le){const Te=Le.length<0?0:d(Le.length)|0,pe=e(Te);for(let Ne=0;Ne=S)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S.toString(16)+" bytes");return Le|0}function T(Le){return+Le!=Le&&(Le=0),t.alloc(+Le)}t.isBuffer=function(Te){return Te!=null&&Te._isBuffer===!0&&Te!==t.prototype},t.compare=function(Te,pe){if(Ye(Te,Uint8Array)&&(Te=t.from(Te,Te.offset,Te.byteLength)),Ye(pe,Uint8Array)&&(pe=t.from(pe,pe.offset,pe.byteLength)),!t.isBuffer(Te)||!t.isBuffer(pe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Te===pe)return 0;let Ne=Te.length,ot=pe.length;for(let ft=0,rt=Math.min(Ne,ot);ftot.length?(t.isBuffer(rt)||(rt=t.from(rt)),rt.copy(ot,ft)):Uint8Array.prototype.set.call(ot,rt,ft);else if(t.isBuffer(rt))rt.copy(ot,ft);else throw new TypeError('"list" argument must be an Array of Buffers');ft+=rt.length}return ot};function l(Le,Te){if(t.isBuffer(Le))return Le.length;if(ArrayBuffer.isView(Le)||Ye(Le,ArrayBuffer))return Le.byteLength;if(typeof Le!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Le);const pe=Le.length,Ne=arguments.length>2&&arguments[2]===!0;if(!Ne&&pe===0)return 0;let ot=!1;for(;;)switch(Te){case"ascii":case"latin1":case"binary":return pe;case"utf8":case"utf-8":return ve(Le).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe*2;case"hex":return pe>>>1;case"base64":return Fe(Le).length;default:if(ot)return Ne?-1:ve(Le).length;Te=(""+Te).toLowerCase(),ot=!0}}t.byteLength=l;function g(Le,Te,pe){let Ne=!1;if((Te===void 0||Te<0)&&(Te=0),Te>this.length||((pe===void 0||pe>this.length)&&(pe=this.length),pe<=0)||(pe>>>=0,Te>>>=0,pe<=Te))return"";for(Le||(Le="utf8");;)switch(Le){case"hex":return B(this,Te,pe);case"utf8":case"utf-8":return I(this,Te,pe);case"ascii":return F(this,Te,pe);case"latin1":case"binary":return N(this,Te,pe);case"base64":return y(this,Te,pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,Te,pe);default:if(Ne)throw new TypeError("Unknown encoding: "+Le);Le=(Le+"").toLowerCase(),Ne=!0}}t.prototype._isBuffer=!0;function x(Le,Te,pe){const Ne=Le[Te];Le[Te]=Le[pe],Le[pe]=Ne}t.prototype.swap16=function(){const Te=this.length;if(Te%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let pe=0;pepe&&(Te+=" ... "),""},b&&(t.prototype[b]=t.prototype.inspect),t.prototype.compare=function(Te,pe,Ne,ot,ft){if(Ye(Te,Uint8Array)&&(Te=t.from(Te,Te.offset,Te.byteLength)),!t.isBuffer(Te))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Te);if(pe===void 0&&(pe=0),Ne===void 0&&(Ne=Te?Te.length:0),ot===void 0&&(ot=0),ft===void 0&&(ft=this.length),pe<0||Ne>Te.length||ot<0||ft>this.length)throw new RangeError("out of range index");if(ot>=ft&&pe>=Ne)return 0;if(ot>=ft)return-1;if(pe>=Ne)return 1;if(pe>>>=0,Ne>>>=0,ot>>>=0,ft>>>=0,this===Te)return 0;let rt=ft-ot,Ft=Ne-pe;const Nt=Math.min(rt,Ft),$t=this.slice(ot,ft),rr=Te.slice(pe,Ne);for(let Er=0;Er2147483647?pe=2147483647:pe<-2147483648&&(pe=-2147483648),pe=+pe,it(pe)&&(pe=ot?0:Le.length-1),pe<0&&(pe=Le.length+pe),pe>=Le.length){if(ot)return-1;pe=Le.length-1}else if(pe<0)if(ot)pe=0;else return-1;if(typeof Te=="string"&&(Te=t.from(Te,Ne)),t.isBuffer(Te))return Te.length===0?-1:M(Le,Te,pe,Ne,ot);if(typeof Te=="number")return Te=Te&255,typeof Uint8Array.prototype.indexOf=="function"?ot?Uint8Array.prototype.indexOf.call(Le,Te,pe):Uint8Array.prototype.lastIndexOf.call(Le,Te,pe):M(Le,[Te],pe,Ne,ot);throw new TypeError("val must be string, number or Buffer")}function M(Le,Te,pe,Ne,ot){let ft=1,rt=Le.length,Ft=Te.length;if(Ne!==void 0&&(Ne=String(Ne).toLowerCase(),Ne==="ucs2"||Ne==="ucs-2"||Ne==="utf16le"||Ne==="utf-16le")){if(Le.length<2||Te.length<2)return-1;ft=2,rt/=2,Ft/=2,pe/=2}function Nt(rr,Er){return ft===1?rr[Er]:rr.readUInt16BE(Er*ft)}let $t;if(ot){let rr=-1;for($t=pe;$trt&&(pe=rt-Ft),$t=pe;$t>=0;$t--){let rr=!0;for(let Er=0;Erot&&(Ne=ot)):Ne=ot;const ft=Te.length;Ne>ft/2&&(Ne=ft/2);let rt;for(rt=0;rt>>0,isFinite(Ne)?(Ne=Ne>>>0,ot===void 0&&(ot="utf8")):(ot=Ne,Ne=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ft=this.length-pe;if((Ne===void 0||Ne>ft)&&(Ne=ft),Te.length>0&&(Ne<0||pe<0)||pe>this.length)throw new RangeError("Attempt to write outside buffer bounds");ot||(ot="utf8");let rt=!1;for(;;)switch(ot){case"hex":return _(this,Te,pe,Ne);case"utf8":case"utf-8":return w(this,Te,pe,Ne);case"ascii":case"latin1":case"binary":return m(this,Te,pe,Ne);case"base64":return u(this,Te,pe,Ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,Te,pe,Ne);default:if(rt)throw new TypeError("Unknown encoding: "+ot);ot=(""+ot).toLowerCase(),rt=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function y(Le,Te,pe){return Te===0&&pe===Le.length?G.fromByteArray(Le):G.fromByteArray(Le.slice(Te,pe))}function I(Le,Te,pe){pe=Math.min(Le.length,pe);const Ne=[];let ot=Te;for(;ot239?4:ft>223?3:ft>191?2:1;if(ot+Ft<=pe){let Nt,$t,rr,Er;switch(Ft){case 1:ft<128&&(rt=ft);break;case 2:Nt=Le[ot+1],(Nt&192)===128&&(Er=(ft&31)<<6|Nt&63,Er>127&&(rt=Er));break;case 3:Nt=Le[ot+1],$t=Le[ot+2],(Nt&192)===128&&($t&192)===128&&(Er=(ft&15)<<12|(Nt&63)<<6|$t&63,Er>2047&&(Er<55296||Er>57343)&&(rt=Er));break;case 4:Nt=Le[ot+1],$t=Le[ot+2],rr=Le[ot+3],(Nt&192)===128&&($t&192)===128&&(rr&192)===128&&(Er=(ft&15)<<18|(Nt&63)<<12|($t&63)<<6|rr&63,Er>65535&&Er<1114112&&(rt=Er))}}rt===null?(rt=65533,Ft=1):rt>65535&&(rt-=65536,Ne.push(rt>>>10&1023|55296),rt=56320|rt&1023),Ne.push(rt),ot+=Ft}return z(Ne)}var L=4096;function z(Le){const Te=Le.length;if(Te<=L)return String.fromCharCode.apply(String,Le);let pe="",Ne=0;for(;NeNe)&&(pe=Ne);let ot="";for(let ft=Te;ftNe&&(Te=Ne),pe<0?(pe+=Ne,pe<0&&(pe=0)):pe>Ne&&(pe=Ne),pepe)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(Te,pe,Ne){Te=Te>>>0,pe=pe>>>0,Ne||U(Te,pe,this.length);let ot=this[Te],ft=1,rt=0;for(;++rt>>0,pe=pe>>>0,Ne||U(Te,pe,this.length);let ot=this[Te+--pe],ft=1;for(;pe>0&&(ft*=256);)ot+=this[Te+--pe]*ft;return ot},t.prototype.readUint8=t.prototype.readUInt8=function(Te,pe){return Te=Te>>>0,pe||U(Te,1,this.length),this[Te]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(Te,pe){return Te=Te>>>0,pe||U(Te,2,this.length),this[Te]|this[Te+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(Te,pe){return Te=Te>>>0,pe||U(Te,2,this.length),this[Te]<<8|this[Te+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(Te,pe){return Te=Te>>>0,pe||U(Te,4,this.length),(this[Te]|this[Te+1]<<8|this[Te+2]<<16)+this[Te+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(Te,pe){return Te=Te>>>0,pe||U(Te,4,this.length),this[Te]*16777216+(this[Te+1]<<16|this[Te+2]<<8|this[Te+3])},t.prototype.readBigUInt64LE=nt(function(Te){Te=Te>>>0,te(Te,"offset");const pe=this[Te],Ne=this[Te+7];(pe===void 0||Ne===void 0)&&H(Te,this.length-8);const ot=pe+this[++Te]*2**8+this[++Te]*2**16+this[++Te]*2**24,ft=this[++Te]+this[++Te]*2**8+this[++Te]*2**16+Ne*2**24;return BigInt(ot)+(BigInt(ft)<>>0,te(Te,"offset");const pe=this[Te],Ne=this[Te+7];(pe===void 0||Ne===void 0)&&H(Te,this.length-8);const ot=pe*2**24+this[++Te]*2**16+this[++Te]*2**8+this[++Te],ft=this[++Te]*2**24+this[++Te]*2**16+this[++Te]*2**8+Ne;return(BigInt(ot)<>>0,pe=pe>>>0,Ne||U(Te,pe,this.length);let ot=this[Te],ft=1,rt=0;for(;++rt=ft&&(ot-=Math.pow(2,8*pe)),ot},t.prototype.readIntBE=function(Te,pe,Ne){Te=Te>>>0,pe=pe>>>0,Ne||U(Te,pe,this.length);let ot=pe,ft=1,rt=this[Te+--ot];for(;ot>0&&(ft*=256);)rt+=this[Te+--ot]*ft;return ft*=128,rt>=ft&&(rt-=Math.pow(2,8*pe)),rt},t.prototype.readInt8=function(Te,pe){return Te=Te>>>0,pe||U(Te,1,this.length),this[Te]&128?(255-this[Te]+1)*-1:this[Te]},t.prototype.readInt16LE=function(Te,pe){Te=Te>>>0,pe||U(Te,2,this.length);const Ne=this[Te]|this[Te+1]<<8;return Ne&32768?Ne|4294901760:Ne},t.prototype.readInt16BE=function(Te,pe){Te=Te>>>0,pe||U(Te,2,this.length);const Ne=this[Te+1]|this[Te]<<8;return Ne&32768?Ne|4294901760:Ne},t.prototype.readInt32LE=function(Te,pe){return Te=Te>>>0,pe||U(Te,4,this.length),this[Te]|this[Te+1]<<8|this[Te+2]<<16|this[Te+3]<<24},t.prototype.readInt32BE=function(Te,pe){return Te=Te>>>0,pe||U(Te,4,this.length),this[Te]<<24|this[Te+1]<<16|this[Te+2]<<8|this[Te+3]},t.prototype.readBigInt64LE=nt(function(Te){Te=Te>>>0,te(Te,"offset");const pe=this[Te],Ne=this[Te+7];(pe===void 0||Ne===void 0)&&H(Te,this.length-8);const ot=this[Te+4]+this[Te+5]*2**8+this[Te+6]*2**16+(Ne<<24);return(BigInt(ot)<>>0,te(Te,"offset");const pe=this[Te],Ne=this[Te+7];(pe===void 0||Ne===void 0)&&H(Te,this.length-8);const ot=(pe<<24)+this[++Te]*2**16+this[++Te]*2**8+this[++Te];return(BigInt(ot)<>>0,pe||U(Te,4,this.length),h.read(this,Te,!0,23,4)},t.prototype.readFloatBE=function(Te,pe){return Te=Te>>>0,pe||U(Te,4,this.length),h.read(this,Te,!1,23,4)},t.prototype.readDoubleLE=function(Te,pe){return Te=Te>>>0,pe||U(Te,8,this.length),h.read(this,Te,!0,52,8)},t.prototype.readDoubleBE=function(Te,pe){return Te=Te>>>0,pe||U(Te,8,this.length),h.read(this,Te,!1,52,8)};function j(Le,Te,pe,Ne,ot,ft){if(!t.isBuffer(Le))throw new TypeError('"buffer" argument must be a Buffer instance');if(Te>ot||TeLe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(Te,pe,Ne,ot){if(Te=+Te,pe=pe>>>0,Ne=Ne>>>0,!ot){const Ft=Math.pow(2,8*Ne)-1;j(this,Te,pe,Ne,Ft,0)}let ft=1,rt=0;for(this[pe]=Te&255;++rt>>0,Ne=Ne>>>0,!ot){const Ft=Math.pow(2,8*Ne)-1;j(this,Te,pe,Ne,Ft,0)}let ft=Ne-1,rt=1;for(this[pe+ft]=Te&255;--ft>=0&&(rt*=256);)this[pe+ft]=Te/rt&255;return pe+Ne},t.prototype.writeUint8=t.prototype.writeUInt8=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,1,255,0),this[pe]=Te&255,pe+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,2,65535,0),this[pe]=Te&255,this[pe+1]=Te>>>8,pe+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,2,65535,0),this[pe]=Te>>>8,this[pe+1]=Te&255,pe+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,4,4294967295,0),this[pe+3]=Te>>>24,this[pe+2]=Te>>>16,this[pe+1]=Te>>>8,this[pe]=Te&255,pe+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,4,4294967295,0),this[pe]=Te>>>24,this[pe+1]=Te>>>16,this[pe+2]=Te>>>8,this[pe+3]=Te&255,pe+4};function Z(Le,Te,pe,Ne,ot){ue(Te,Ne,ot,Le,pe,7);let ft=Number(Te&BigInt(4294967295));Le[pe++]=ft,ft=ft>>8,Le[pe++]=ft,ft=ft>>8,Le[pe++]=ft,ft=ft>>8,Le[pe++]=ft;let rt=Number(Te>>BigInt(32)&BigInt(4294967295));return Le[pe++]=rt,rt=rt>>8,Le[pe++]=rt,rt=rt>>8,Le[pe++]=rt,rt=rt>>8,Le[pe++]=rt,pe}function re(Le,Te,pe,Ne,ot){ue(Te,Ne,ot,Le,pe,7);let ft=Number(Te&BigInt(4294967295));Le[pe+7]=ft,ft=ft>>8,Le[pe+6]=ft,ft=ft>>8,Le[pe+5]=ft,ft=ft>>8,Le[pe+4]=ft;let rt=Number(Te>>BigInt(32)&BigInt(4294967295));return Le[pe+3]=rt,rt=rt>>8,Le[pe+2]=rt,rt=rt>>8,Le[pe+1]=rt,rt=rt>>8,Le[pe]=rt,pe+8}t.prototype.writeBigUInt64LE=nt(function(Te,pe=0){return Z(this,Te,pe,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=nt(function(Te,pe=0){return re(this,Te,pe,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(Te,pe,Ne,ot){if(Te=+Te,pe=pe>>>0,!ot){const Nt=Math.pow(2,8*Ne-1);j(this,Te,pe,Ne,Nt-1,-Nt)}let ft=0,rt=1,Ft=0;for(this[pe]=Te&255;++ft>0)-Ft&255;return pe+Ne},t.prototype.writeIntBE=function(Te,pe,Ne,ot){if(Te=+Te,pe=pe>>>0,!ot){const Nt=Math.pow(2,8*Ne-1);j(this,Te,pe,Ne,Nt-1,-Nt)}let ft=Ne-1,rt=1,Ft=0;for(this[pe+ft]=Te&255;--ft>=0&&(rt*=256);)Te<0&&Ft===0&&this[pe+ft+1]!==0&&(Ft=1),this[pe+ft]=(Te/rt>>0)-Ft&255;return pe+Ne},t.prototype.writeInt8=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,1,127,-128),Te<0&&(Te=255+Te+1),this[pe]=Te&255,pe+1},t.prototype.writeInt16LE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,2,32767,-32768),this[pe]=Te&255,this[pe+1]=Te>>>8,pe+2},t.prototype.writeInt16BE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,2,32767,-32768),this[pe]=Te>>>8,this[pe+1]=Te&255,pe+2},t.prototype.writeInt32LE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,4,2147483647,-2147483648),this[pe]=Te&255,this[pe+1]=Te>>>8,this[pe+2]=Te>>>16,this[pe+3]=Te>>>24,pe+4},t.prototype.writeInt32BE=function(Te,pe,Ne){return Te=+Te,pe=pe>>>0,Ne||j(this,Te,pe,4,2147483647,-2147483648),Te<0&&(Te=4294967295+Te+1),this[pe]=Te>>>24,this[pe+1]=Te>>>16,this[pe+2]=Te>>>8,this[pe+3]=Te&255,pe+4},t.prototype.writeBigInt64LE=nt(function(Te,pe=0){return Z(this,Te,pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=nt(function(Te,pe=0){return re(this,Te,pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function fe(Le,Te,pe,Ne,ot,ft){if(pe+Ne>Le.length)throw new RangeError("Index out of range");if(pe<0)throw new RangeError("Index out of range")}function le(Le,Te,pe,Ne,ot){return Te=+Te,pe=pe>>>0,ot||fe(Le,Te,pe,4),h.write(Le,Te,pe,Ne,23,4),pe+4}t.prototype.writeFloatLE=function(Te,pe,Ne){return le(this,Te,pe,!0,Ne)},t.prototype.writeFloatBE=function(Te,pe,Ne){return le(this,Te,pe,!1,Ne)};function ce(Le,Te,pe,Ne,ot){return Te=+Te,pe=pe>>>0,ot||fe(Le,Te,pe,8),h.write(Le,Te,pe,Ne,52,8),pe+8}t.prototype.writeDoubleLE=function(Te,pe,Ne){return ce(this,Te,pe,!0,Ne)},t.prototype.writeDoubleBE=function(Te,pe,Ne){return ce(this,Te,pe,!1,Ne)},t.prototype.copy=function(Te,pe,Ne,ot){if(!t.isBuffer(Te))throw new TypeError("argument should be a Buffer");if(Ne||(Ne=0),!ot&&ot!==0&&(ot=this.length),pe>=Te.length&&(pe=Te.length),pe||(pe=0),ot>0&&ot=this.length)throw new RangeError("Index out of range");if(ot<0)throw new RangeError("sourceEnd out of bounds");ot>this.length&&(ot=this.length),Te.length-pe>>0,Ne=Ne===void 0?this.length:Ne>>>0,Te||(Te=0);let ft;if(typeof Te=="number")for(ft=pe;ft2**32?ot=ne(String(pe)):typeof pe=="bigint"&&(ot=String(pe),(pe>BigInt(2)**BigInt(32)||pe<-(BigInt(2)**BigInt(32)))&&(ot=ne(ot)),ot+="n"),Ne+=` It must be ${Te}. Received ${ot}`,Ne},RangeError);function ne(Le){let Te="",pe=Le.length;const Ne=Le[0]==="-"?1:0;for(;pe>=Ne+4;pe-=3)Te=`_${Le.slice(pe-3,pe)}${Te}`;return`${Le.slice(0,pe)}${Te}`}function K(Le,Te,pe){te(Te,"offset"),(Le[Te]===void 0||Le[Te+pe]===void 0)&&H(Te,Le.length-(pe+1))}function ue(Le,Te,pe,Ne,ot,ft){if(Le>pe||Le= 0${rt} and < 2${rt} ** ${(ft+1)*8}${rt}`:Ft=`>= -(2${rt} ** ${(ft+1)*8-1}${rt}) and < 2 ** ${(ft+1)*8-1}${rt}`,new V.ERR_OUT_OF_RANGE("value",Ft,Le)}K(Ne,ot,ft)}function te(Le,Te){if(typeof Le!="number")throw new V.ERR_INVALID_ARG_TYPE(Te,"number",Le)}function H(Le,Te,pe){throw Math.floor(Le)!==Le?(te(Le,pe),new V.ERR_OUT_OF_RANGE("offset","an integer",Le)):Te<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Te}`,Le)}var ae=/[^+/0-9A-Za-z-_]/g;function ie(Le){if(Le=Le.split("=")[0],Le=Le.trim().replace(ae,""),Le.length<2)return"";for(;Le.length%4!==0;)Le=Le+"=";return Le}function ve(Le,Te){Te=Te||1/0;let pe;const Ne=Le.length;let ot=null;const ft=[];for(let rt=0;rt55295&&pe<57344){if(!ot){if(pe>56319){(Te-=3)>-1&&ft.push(239,191,189);continue}else if(rt+1===Ne){(Te-=3)>-1&&ft.push(239,191,189);continue}ot=pe;continue}if(pe<56320){(Te-=3)>-1&&ft.push(239,191,189),ot=pe;continue}pe=(ot-55296<<10|pe-56320)+65536}else ot&&(Te-=3)>-1&&ft.push(239,191,189);if(ot=null,pe<128){if((Te-=1)<0)break;ft.push(pe)}else if(pe<2048){if((Te-=2)<0)break;ft.push(pe>>6|192,pe&63|128)}else if(pe<65536){if((Te-=3)<0)break;ft.push(pe>>12|224,pe>>6&63|128,pe&63|128)}else if(pe<1114112){if((Te-=4)<0)break;ft.push(pe>>18|240,pe>>12&63|128,pe>>6&63|128,pe&63|128)}else throw new Error("Invalid code point")}return ft}function Ae(Le){const Te=[];for(let pe=0;pe>8,ot=pe%256,ft.push(ot),ft.push(Ne);return ft}function Fe(Le){return G.toByteArray(ie(Le))}function ze(Le,Te,pe,Ne){let ot;for(ot=0;ot=Te.length||ot>=Le.length);++ot)Te[ot+pe]=Le[ot];return ot}function Ye(Le,Te){return Le instanceof Te||Le!=null&&Le.constructor!=null&&Le.constructor.name!=null&&Le.constructor.name===Te.name}function it(Le){return Le!==Le}var st=(function(){const Le="0123456789abcdef",Te=new Array(256);for(let pe=0;pe<16;++pe){const Ne=pe*16;for(let ot=0;ot<16;++ot)Te[Ne+ot]=Le[pe]+Le[ot]}return Te})();function nt(Le){return typeof BigInt>"u"?Qe:Le}function Qe(){throw new Error("BigInt not supported")}}}),J1=Ge({"node_modules/has-symbols/shams.js"($,G){G.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var b={},S=Symbol("test"),E=Object(S);if(typeof S=="string"||Object.prototype.toString.call(S)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var e=42;b[S]=e;for(var t in b)return!1;if(typeof Object.keys=="function"&&Object.keys(b).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(b).length!==0)return!1;var r=Object.getOwnPropertySymbols(b);if(r.length!==1||r[0]!==S||!Object.prototype.propertyIsEnumerable.call(b,S))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(b,S);if(o.value!==e||o.enumerable!==!0)return!1}return!0}}}),yy=Ge({"node_modules/has-tostringtag/shams.js"($,G){var h=J1();G.exports=function(){return h()&&!!Symbol.toStringTag}}}),Q1=Ge({"node_modules/es-object-atoms/index.js"($,G){G.exports=Object}}),eA=Ge({"node_modules/es-errors/index.js"($,G){G.exports=Error}}),U0=Ge({"node_modules/es-errors/eval.js"($,G){G.exports=EvalError}}),av=Ge({"node_modules/es-errors/range.js"($,G){G.exports=RangeError}}),$2=Ge({"node_modules/es-errors/ref.js"($,G){G.exports=ReferenceError}}),J2=Ge({"node_modules/es-errors/syntax.js"($,G){G.exports=SyntaxError}}),kh=Ge({"node_modules/es-errors/type.js"($,G){G.exports=TypeError}}),UM=Ge({"node_modules/es-errors/uri.js"($,G){G.exports=URIError}}),tA=Ge({"node_modules/math-intrinsics/abs.js"($,G){G.exports=Math.abs}}),rA=Ge({"node_modules/math-intrinsics/floor.js"($,G){G.exports=Math.floor}}),ah=Ge({"node_modules/math-intrinsics/max.js"($,G){G.exports=Math.max}}),Cd=Ge({"node_modules/math-intrinsics/min.js"($,G){G.exports=Math.min}}),j0=Ge({"node_modules/math-intrinsics/pow.js"($,G){G.exports=Math.pow}}),nA=Ge({"node_modules/math-intrinsics/round.js"($,G){G.exports=Math.round}}),aA=Ge({"node_modules/math-intrinsics/isNaN.js"($,G){G.exports=Number.isNaN||function(b){return b!==b}}}),iA=Ge({"node_modules/math-intrinsics/sign.js"($,G){var h=aA();G.exports=function(S){return h(S)||S===0?S:S<0?-1:1}}}),jM=Ge({"node_modules/gopd/gOPD.js"($,G){G.exports=Object.getOwnPropertyDescriptor}}),q0=Ge({"node_modules/gopd/index.js"($,G){var h=jM();if(h)try{h([],"length")}catch{h=null}G.exports=h}}),Yv=Ge({"node_modules/es-define-property/index.js"($,G){var h=Object.defineProperty||!1;if(h)try{h({},"a",{value:1})}catch{h=!1}G.exports=h}}),Vp=Ge({"node_modules/has-symbols/index.js"($,G){var h=typeof Symbol<"u"&&Symbol,b=J1();G.exports=function(){return typeof h!="function"||typeof Symbol!="function"||typeof h("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:b()}}}),Q2=Ge({"node_modules/get-proto/Reflect.getPrototypeOf.js"($,G){G.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),yd=Ge({"node_modules/get-proto/Object.getPrototypeOf.js"($,G){var h=Q1();G.exports=h.getPrototypeOf||null}}),oA=Ge({"node_modules/function-bind/implementation.js"($,G){var h="Function.prototype.bind called on incompatible ",b=Object.prototype.toString,S=Math.max,E="[object Function]",e=function(n,i){for(var a=[],s=0;s"u"||!w?h:w(Uint8Array),z={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?h:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?h:ArrayBuffer,"%ArrayIteratorPrototype%":_&&w?w([][Symbol.iterator]()):h,"%AsyncFromSyncIteratorPrototype%":h,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":typeof Atomics>"u"?h:Atomics,"%BigInt%":typeof BigInt>"u"?h:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?h:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?h:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?h:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":S,"%eval%":eval,"%EvalError%":E,"%Float16Array%":typeof Float16Array>"u"?h:Float16Array,"%Float32Array%":typeof Float32Array>"u"?h:Float32Array,"%Float64Array%":typeof Float64Array>"u"?h:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?h:FinalizationRegistry,"%Function%":T,"%GeneratorFunction%":I,"%Int8Array%":typeof Int8Array>"u"?h:Int8Array,"%Int16Array%":typeof Int16Array>"u"?h:Int16Array,"%Int32Array%":typeof Int32Array>"u"?h:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_&&w?w(w([][Symbol.iterator]())):h,"%JSON%":typeof JSON=="object"?JSON:h,"%Map%":typeof Map>"u"?h:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_||!w?h:w(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":b,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?h:Promise,"%Proxy%":typeof Proxy>"u"?h:Proxy,"%RangeError%":e,"%ReferenceError%":t,"%Reflect%":typeof Reflect>"u"?h:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?h:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_||!w?h:w(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?h:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_&&w?w(""[Symbol.iterator]()):h,"%Symbol%":_?Symbol:h,"%SyntaxError%":r,"%ThrowTypeError%":M,"%TypedArray%":L,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?h:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?h:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?h:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?h:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?h:WeakMap,"%WeakRef%":typeof WeakRef>"u"?h:WeakRef,"%WeakSet%":typeof WeakSet>"u"?h:WeakSet,"%Function.prototype.call%":y,"%Function.prototype.apply%":v,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":m,"%Math.abs%":i,"%Math.floor%":a,"%Math.max%":s,"%Math.min%":f,"%Math.pow%":c,"%Math.round%":p,"%Math.sign%":d,"%Reflect.getPrototypeOf%":u};if(w)try{null.error}catch(K){F=w(w(K)),z["%Error.prototype%"]=F}var F,N=function K(ue){var te;if(ue==="%AsyncFunction%")te=l("async function () {}");else if(ue==="%GeneratorFunction%")te=l("function* () {}");else if(ue==="%AsyncGeneratorFunction%")te=l("async function* () {}");else if(ue==="%AsyncGenerator%"){var H=K("%AsyncGeneratorFunction%");H&&(te=H.prototype)}else if(ue==="%AsyncIteratorPrototype%"){var ae=K("%AsyncGenerator%");ae&&w&&(te=w(ae.prototype))}return z[ue]=te,te},B={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=ip(),U=e_(),j=R.call(y,Array.prototype.concat),Z=R.call(v,Array.prototype.splice),re=R.call(y,String.prototype.replace),fe=R.call(y,String.prototype.slice),le=R.call(y,RegExp.prototype.exec),ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,ee=function(ue){var te=fe(ue,0,1),H=fe(ue,-1);if(te==="%"&&H!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(H==="%"&&te!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var ae=[];return re(ue,ce,function(ie,ve,Ae,Ce){ae[ae.length]=Ae?re(Ce,V,"$1"):ve||ie}),ae},ne=function(ue,te){var H=ue,ae;if(U(B,H)&&(ae=B[H],H="%"+ae[0]+"%"),U(z,H)){var ie=z[H];if(ie===I&&(ie=N(H)),typeof ie>"u"&&!te)throw new o("intrinsic "+ue+" exists, but is not available. Please file an issue!");return{alias:ae,name:H,value:ie}}throw new r("intrinsic "+ue+" does not exist!")};G.exports=function(ue,te){if(typeof ue!="string"||ue.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof te!="boolean")throw new o('"allowMissing" argument must be a boolean');if(le(/^%?[^%]*%?$/,ue)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var H=ee(ue),ae=H.length>0?H[0]:"",ie=ne("%"+ae+"%",te),ve=ie.name,Ae=ie.value,Ce=!1,Fe=ie.alias;Fe&&(ae=Fe[0],Z(H,j([0,1],Fe)));for(var ze=1,Ye=!0;ze=H.length){var Qe=g(Ae,it);Ye=!!Qe,Ye&&"get"in Qe&&!("originalValue"in Qe.get)?Ae=Qe.get:Ae=Ae[it]}else Ye=U(Ae,it),Ae=Ae[it];Ye&&!Ce&&(z[ve]=Ae)}}return Ae}}}),xy=Ge({"node_modules/define-data-property/index.js"($,G){var h=Yv(),b=J2(),S=kh(),E=q0();G.exports=function(t,r,o){if(!t||typeof t!="object"&&typeof t!="function")throw new S("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new S("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new S("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new S("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new S("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new S("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,f=!!E&&E(t,r);if(h)h(t,r,{configurable:a===null&&f?f.configurable:!a,enumerable:n===null&&f?f.enumerable:!n,value:o,writable:i===null&&f?f.writable:!i});else if(s||!n&&!i&&!a)t[r]=o;else throw new b("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),r3=Ge({"node_modules/has-property-descriptors/index.js"($,G){var h=Yv(),b=function(){return!!h};b.hasArrayLengthDefineBug=function(){if(!h)return null;try{return h([],"length",{value:1}).length!==1}catch{return!0}},G.exports=b}}),lA=Ge({"node_modules/set-function-length/index.js"($,G){var h=yg(),b=xy(),S=r3()(),E=q0(),e=kh(),t=h("%Math.floor%");G.exports=function(o,n){if(typeof o!="function")throw new e("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||t(n)!==n)throw new e("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],a=!0,s=!0;if("length"in o&&E){var f=E(o,"length");f&&!f.configurable&&(a=!1),f&&!f.writable&&(s=!1)}return(a||s||!i)&&(S?b(o,"length",n,!0,!0):b(o,"length",n)),o}}}),bm=Ge({"node_modules/call-bind/index.js"($,G){var h=ip(),b=yg(),S=lA(),E=kh(),e=b("%Function.prototype.apply%"),t=b("%Function.prototype.call%"),r=b("%Reflect.apply%",!0)||h.call(t,e),o=Yv(),n=b("%Math.max%");G.exports=function(s){if(typeof s!="function")throw new E("a function is required");var f=r(h,t,arguments);return S(f,1+n(0,s.length-(arguments.length-1)),!0)};var i=function(){return r(h,e,arguments)};o?o(G.exports,"apply",{value:i}):G.exports.apply=i}}),by=Ge({"node_modules/call-bind/callBound.js"($,G){var h=yg(),b=bm(),S=b(h("String.prototype.indexOf"));G.exports=function(e,t){var r=h(e,!!t);return typeof r=="function"&&S(e,".prototype.")>-1?b(r):r}}}),cb=Ge({"node_modules/is-arguments/index.js"($,G){var h=yy()(),b=by(),S=b("Object.prototype.toString"),E=function(o){return h&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:S(o)==="[object Arguments]"},e=function(o){return E(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&S(o)!=="[object Array]"&&S(o.callee)==="[object Function]"},t=(function(){return E(arguments)})();E.isLegacyArguments=e,G.exports=t?E:e}}),uA=Ge({"node_modules/is-generator-function/index.js"($,G){var h=Object.prototype.toString,b=Function.prototype.toString,S=/^\s*(?:function)?\*/,E=yy()(),e=Object.getPrototypeOf,t=function(){if(!E)return!1;try{return Function("return function*() {}")()}catch{}},r;G.exports=function(n){if(typeof n!="function")return!1;if(S.test(b.call(n)))return!0;if(!E){var i=h.call(n);return i==="[object GeneratorFunction]"}if(!e)return!1;if(typeof r>"u"){var a=t();r=a?e(a):!1}return e(n)===r}}}),qM=Ge({"node_modules/is-callable/index.js"($,G){var h=Function.prototype.toString,b=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,S,E;if(typeof b=="function"&&typeof Object.defineProperty=="function")try{S=Object.defineProperty({},"length",{get:function(){throw E}}),E={},b(function(){throw 42},null,S)}catch(g){g!==E&&(b=null)}else b=null;var e=/^\s*class\b/,t=function(x){try{var A=h.call(x);return e.test(A)}catch{return!1}},r=function(x){try{return t(x)?!1:(h.call(x),!0)}catch{return!1}},o=Object.prototype.toString,n="[object Object]",i="[object Function]",a="[object GeneratorFunction]",s="[object HTMLAllCollection]",f="[object HTML document.all class]",c="[object HTMLCollection]",p=typeof Symbol=="function"&&!!Symbol.toStringTag,d=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(l=document.all,o.call(l)===o.call(document.all)&&(T=function(x){if((d||!x)&&(typeof x>"u"||typeof x=="object"))try{var A=o.call(x);return(A===s||A===f||A===c||A===n)&&x("")==null}catch{}return!1}));var l;G.exports=b?function(x){if(T(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;try{b(x,null,S)}catch(A){if(A!==E)return!1}return!t(x)&&r(x)}:function(x){if(T(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;if(p)return r(x);if(t(x))return!1;var A=o.call(x);return A!==i&&A!==a&&!/^\[object HTML/.test(A)?!1:r(x)}}}),cA=Ge({"node_modules/for-each/index.js"($,G){var h=qM(),b=Object.prototype.toString,S=Object.prototype.hasOwnProperty,E=function(n,i,a){for(var s=0,f=n.length;s=3&&(s=a),b.call(n)==="[object Array]"?E(n,i,s):typeof n=="string"?e(n,i,s):t(n,i,s)};G.exports=r}}),Ec=Ge({"node_modules/available-typed-arrays/index.js"($,G){var h=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],b=typeof globalThis>"u"?window:globalThis;G.exports=function(){for(var E=[],e=0;e"u"?window:globalThis,n=b(),i=E("String.prototype.slice"),a=Object.getPrototypeOf,s=E("Array.prototype.indexOf",!0)||function(T,l){for(var g=0;g-1?l:l!=="Object"?!1:p(T)}return e?c(T):null}}}),tc=Ge({"node_modules/is-typed-array/index.js"($,G){var h=cA(),b=Ec(),S=by(),E=S("Object.prototype.toString"),e=yy()(),t=q0(),r=typeof globalThis>"u"?window:globalThis,o=b(),n=S("Array.prototype.indexOf",!0)||function(p,d){for(var T=0;T-1}return t?f(p):!1}}}),rc=Ge({"node_modules/util/support/types.js"($){var G=cb(),h=uA(),b=Rf(),S=tc();function E(Ce){return Ce.call.bind(Ce)}var e=typeof BigInt<"u",t=typeof Symbol<"u",r=E(Object.prototype.toString),o=E(Number.prototype.valueOf),n=E(String.prototype.valueOf),i=E(Boolean.prototype.valueOf);e&&(a=E(BigInt.prototype.valueOf));var a;t&&(s=E(Symbol.prototype.valueOf));var s;function f(Ce,Fe){if(typeof Ce!="object")return!1;try{return Fe(Ce),!0}catch{return!1}}$.isArgumentsObject=G,$.isGeneratorFunction=h,$.isTypedArray=S;function c(Ce){return typeof Promise<"u"&&Ce instanceof Promise||Ce!==null&&typeof Ce=="object"&&typeof Ce.then=="function"&&typeof Ce.catch=="function"}$.isPromise=c;function p(Ce){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Ce):S(Ce)||Z(Ce)}$.isArrayBufferView=p;function d(Ce){return b(Ce)==="Uint8Array"}$.isUint8Array=d;function T(Ce){return b(Ce)==="Uint8ClampedArray"}$.isUint8ClampedArray=T;function l(Ce){return b(Ce)==="Uint16Array"}$.isUint16Array=l;function g(Ce){return b(Ce)==="Uint32Array"}$.isUint32Array=g;function x(Ce){return b(Ce)==="Int8Array"}$.isInt8Array=x;function A(Ce){return b(Ce)==="Int16Array"}$.isInt16Array=A;function M(Ce){return b(Ce)==="Int32Array"}$.isInt32Array=M;function _(Ce){return b(Ce)==="Float32Array"}$.isFloat32Array=_;function w(Ce){return b(Ce)==="Float64Array"}$.isFloat64Array=w;function m(Ce){return b(Ce)==="BigInt64Array"}$.isBigInt64Array=m;function u(Ce){return b(Ce)==="BigUint64Array"}$.isBigUint64Array=u;function v(Ce){return r(Ce)==="[object Map]"}v.working=typeof Map<"u"&&v(new Map);function y(Ce){return typeof Map>"u"?!1:v.working?v(Ce):Ce instanceof Map}$.isMap=y;function I(Ce){return r(Ce)==="[object Set]"}I.working=typeof Set<"u"&&I(new Set);function L(Ce){return typeof Set>"u"?!1:I.working?I(Ce):Ce instanceof Set}$.isSet=L;function z(Ce){return r(Ce)==="[object WeakMap]"}z.working=typeof WeakMap<"u"&&z(new WeakMap);function F(Ce){return typeof WeakMap>"u"?!1:z.working?z(Ce):Ce instanceof WeakMap}$.isWeakMap=F;function N(Ce){return r(Ce)==="[object WeakSet]"}N.working=typeof WeakSet<"u"&&N(new WeakSet);function B(Ce){return N(Ce)}$.isWeakSet=B;function R(Ce){return r(Ce)==="[object ArrayBuffer]"}R.working=typeof ArrayBuffer<"u"&&R(new ArrayBuffer);function U(Ce){return typeof ArrayBuffer>"u"?!1:R.working?R(Ce):Ce instanceof ArrayBuffer}$.isArrayBuffer=U;function j(Ce){return r(Ce)==="[object DataView]"}j.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&j(new DataView(new ArrayBuffer(1),0,1));function Z(Ce){return typeof DataView>"u"?!1:j.working?j(Ce):Ce instanceof DataView}$.isDataView=Z;var re=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function fe(Ce){return r(Ce)==="[object SharedArrayBuffer]"}function le(Ce){return typeof re>"u"?!1:(typeof fe.working>"u"&&(fe.working=fe(new re)),fe.working?fe(Ce):Ce instanceof re)}$.isSharedArrayBuffer=le;function ce(Ce){return r(Ce)==="[object AsyncFunction]"}$.isAsyncFunction=ce;function V(Ce){return r(Ce)==="[object Map Iterator]"}$.isMapIterator=V;function ee(Ce){return r(Ce)==="[object Set Iterator]"}$.isSetIterator=ee;function ne(Ce){return r(Ce)==="[object Generator]"}$.isGeneratorObject=ne;function K(Ce){return r(Ce)==="[object WebAssembly.Module]"}$.isWebAssemblyCompiledModule=K;function ue(Ce){return f(Ce,o)}$.isNumberObject=ue;function te(Ce){return f(Ce,n)}$.isStringObject=te;function H(Ce){return f(Ce,i)}$.isBooleanObject=H;function ae(Ce){return e&&f(Ce,a)}$.isBigIntObject=ae;function ie(Ce){return t&&f(Ce,s)}$.isSymbolObject=ie;function ve(Ce){return ue(Ce)||te(Ce)||H(Ce)||ae(Ce)||ie(Ce)}$.isBoxedPrimitive=ve;function Ae(Ce){return typeof Uint8Array<"u"&&(U(Ce)||le(Ce))}$.isAnyArrayBuffer=Ae,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Ce){Object.defineProperty($,Ce,{enumerable:!1,value:function(){throw new Error(Ce+" is not supported in userland")}})})}}),Jc=Ge({"node_modules/util/support/isBufferBrowser.js"($,G){G.exports=function(b){return b&&typeof b=="object"&&typeof b.copy=="function"&&typeof b.fill=="function"&&typeof b.readUInt8=="function"}}}),Ld=Ge({"(disabled):node_modules/util/util.js"($){var G=Object.getOwnPropertyDescriptors||function(Z){for(var re=Object.keys(Z),fe={},le=0;le=le)return ee;switch(ee){case"%s":return String(fe[re++]);case"%d":return Number(fe[re++]);case"%j":try{return JSON.stringify(fe[re++])}catch{return"[Circular]"}default:return ee}}),V=fe[re];re"u")return function(){return $.deprecate(j,Z).apply(this,arguments)};var re=!1;function fe(){if(!re){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),re=!0}return j.apply(this,arguments)}return fe};var b={},S=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),S=new RegExp("^"+E+"$","i");var E;$.debuglog=function(j){if(j=j.toUpperCase(),!b[j])if(S.test(j)){var Z=process.pid;b[j]=function(){var re=$.format.apply($,arguments);console.error("%s %d: %s",j,Z,re)}}else b[j]=function(){};return b[j]};function e(j,Z){var re={seen:[],stylize:r};return arguments.length>=3&&(re.depth=arguments[2]),arguments.length>=4&&(re.colors=arguments[3]),d(Z)?re.showHidden=Z:Z&&$._extend(re,Z),M(re.showHidden)&&(re.showHidden=!1),M(re.depth)&&(re.depth=2),M(re.colors)&&(re.colors=!1),M(re.customInspect)&&(re.customInspect=!0),re.colors&&(re.stylize=t),n(re,j,re.depth)}$.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(j,Z){var re=e.styles[Z];return re?"\x1B["+e.colors[re][0]+"m"+j+"\x1B["+e.colors[re][1]+"m":j}function r(j,Z){return j}function o(j){var Z={};return j.forEach(function(re,fe){Z[re]=!0}),Z}function n(j,Z,re){if(j.customInspect&&Z&&v(Z.inspect)&&Z.inspect!==$.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var fe=Z.inspect(re,j);return x(fe)||(fe=n(j,fe,re)),fe}var le=i(j,Z);if(le)return le;var ce=Object.keys(Z),V=o(ce);if(j.showHidden&&(ce=Object.getOwnPropertyNames(Z)),u(Z)&&(ce.indexOf("message")>=0||ce.indexOf("description")>=0))return a(Z);if(ce.length===0){if(v(Z)){var ee=Z.name?": "+Z.name:"";return j.stylize("[Function"+ee+"]","special")}if(_(Z))return j.stylize(RegExp.prototype.toString.call(Z),"regexp");if(m(Z))return j.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return a(Z)}var ne="",K=!1,ue=["{","}"];if(p(Z)&&(K=!0,ue=["[","]"]),v(Z)){var te=Z.name?": "+Z.name:"";ne=" [Function"+te+"]"}if(_(Z)&&(ne=" "+RegExp.prototype.toString.call(Z)),m(Z)&&(ne=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&(ne=" "+a(Z)),ce.length===0&&(!K||Z.length==0))return ue[0]+ne+ue[1];if(re<0)return _(Z)?j.stylize(RegExp.prototype.toString.call(Z),"regexp"):j.stylize("[Object]","special");j.seen.push(Z);var H;return K?H=s(j,Z,re,V,ce):H=ce.map(function(ae){return f(j,Z,re,V,ae,K)}),j.seen.pop(),c(H,ne,ue)}function i(j,Z){if(M(Z))return j.stylize("undefined","undefined");if(x(Z)){var re="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return j.stylize(re,"string")}if(g(Z))return j.stylize(""+Z,"number");if(d(Z))return j.stylize(""+Z,"boolean");if(T(Z))return j.stylize("null","null")}function a(j){return"["+Error.prototype.toString.call(j)+"]"}function s(j,Z,re,fe,le){for(var ce=[],V=0,ee=Z.length;V1?(i[f-1]-i[0])/(f-1):1,v,T;for(p>=0?T=a?e:t:T=a?o:r,n+=p*E*(a?-1:1)*(p>=0?1:-1);s90&&h.log("Long binary search..."),s-1};function e(n,i){return ni}function o(n,i){return n>=i}K.sorterAsc=function(n,i){return n-i},K.sorterDes=function(n,i){return i-n},K.distinctVals=function(n){var i=n.slice();i.sort(K.sorterAsc);var a;for(a=i.length-1;a>-1&&i[a]===S;a--);for(var s=i[a]-i[0]||1,f=s/(a||1)/1e4,c=[],p,v=0;v<=a;v++){var T=i[v],l=T-p;p===void 0?(c.push(T),p=T):l>f&&(s=Math.min(s,l),c.push(T),p=T)}return{vals:c,minDiff:s}},K.roundUp=function(n,i,a){for(var s=0,f=i.length-1,c,p=0,v=a?0:1,T=a?1:0,l=a?Math.ceil:Math.floor;s0&&(s=1),a&&s)return n.sort(i)}return s?n:n.reverse()},K.findIndexOfMin=function(n,i){i=i||b;for(var a=1/0,s,f=0;fE.length)&&(e=E.length),G(S)||(S=!1),h(E[0])){for(r=new Array(e),t=0;tb.length-1)return b[b.length-1];var E=S%1;return E*b[Math.ceil(S)]+(1-E)*b[Math.floor(S)]}}}),Fd=Ge({"src/lib/angles.js"(K,G){var h=vs(),b=h.mod,S=h.modHalf,E=Math.PI,e=2*E;function t(T){return T/180*E}function r(T){return T/E*180}function o(T){return Math.abs(T[1]-T[0])>e-1e-14}function n(T,l){return S(l-T,e)}function i(T,l){return Math.abs(n(T,l))}function a(T,l){if(o(l))return!0;var g,x;l[0]x&&(x+=e);var A=b(T,e),M=A+e;return A>=g&&A<=x||M>=g&&M<=x}function s(T,l,g,x){if(!a(l,x))return!1;var A,M;return g[0]=A&&T<=M}function f(T,l,g,x,A,M,_){A=A||0,M=M||0;var w=o([g,x]),m,u,d,y,I;w?(m=0,u=E,d=e):g1/3&&h.x<2/3},K.isRightAnchor=function(h){return h.xanchor==="right"||h.xanchor==="auto"&&h.x>=2/3},K.isTopAnchor=function(h){return h.yanchor==="top"||h.yanchor==="auto"&&h.y>=2/3},K.isMiddleAnchor=function(h){return h.yanchor==="middle"||h.yanchor==="auto"&&h.y>1/3&&h.y<2/3},K.isBottomAnchor=function(h){return h.yanchor==="bottom"||h.yanchor==="auto"&&h.y<=1/3}}}),GT=Ge({"src/lib/geometry2d.js"(K){var G=vs().mod;K.segmentsIntersect=h;function h(t,r,o,n,i,a,s,f){var c=o-t,p=i-t,v=s-i,T=n-r,l=a-r,g=f-a,x=c*g-v*T;if(x===0)return null;var A=(p*g-v*l)/x,M=(p*T-c*l)/x;return M<0||M>1||A<0||A>1?null:{x:t+c*A,y:r+T*A}}K.segmentDistance=function(r,o,n,i,a,s,f,c){if(h(r,o,n,i,a,s,f,c))return 0;var p=n-r,v=i-o,T=f-a,l=c-s,g=p*p+v*v,x=T*T+l*l,A=Math.min(b(p,v,g,a-r,s-o),b(p,v,g,f-r,c-o),b(T,l,x,r-a,o-s),b(T,l,x,n-a,i-s));return Math.sqrt(A)};function b(t,r,o,n,i){var a=n*t+i*r;if(a<0)return n*n+i*i;if(a>o){var s=n-t,f=i-r;return s*s+f*f}else{var c=n*r-i*t;return c*c/o}}var S,E,e;K.getTextLocation=function(r,o,n,i){if((r!==E||i!==e)&&(S={},E=r,e=i),S[n])return S[n];var a=r.getPointAtLength(G(n-i/2,o)),s=r.getPointAtLength(G(n+i/2,o)),f=Math.atan((s.y-a.y)/(s.x-a.x)),c=r.getPointAtLength(G(n,o)),p=(c.x*4+a.x+s.x)/6,v=(c.y*4+a.y+s.y)/6,T={x:p,y:v,theta:f};return S[n]=T,T},K.clearLocationCache=function(){E=null},K.getVisibleSegment=function(r,o,n){var i=o.left,a=o.right,s=o.top,f=o.bottom,c=0,p=r.getTotalLength(),v=p,T,l;function g(A){var M=r.getPointAtLength(A);A===0?T=M:A===p&&(l=M);var _=M.xa?M.x-a:0,w=M.yf?M.y-f:0;return Math.sqrt(_*_+w*w)}for(var x=g(c);x;){if(c+=x+n,c>v)return;x=g(c)}for(x=g(v);x;){if(v-=x+n,c>v)return;x=g(v)}return{min:c,max:v,len:v-c,total:p,isClosed:c===0&&v===p&&Math.abs(T.x-l.x)<.1&&Math.abs(T.y-l.y)<.1}},K.findPointOnPath=function(r,o,n,i){i=i||{};for(var a=i.pathLength||r.getTotalLength(),s=i.tolerance||.001,f=i.iterationLimit||30,c=r.getPointAtLength(0)[n]>r.getPointAtLength(a)[n]?-1:1,p=0,v=0,T=a,l,g,x;p0?T=l:v=l,p++}return g}}}),R0=Ge({"src/lib/throttle.js"(K){var G={};K.throttle=function(S,E,e){var t=G[S],r=Date.now();if(!t){for(var o in G)G[o].tst.ts+E){n();return}t.timer=setTimeout(function(){n(),t.timer=null},E)},K.done=function(b){var S=G[b];return!S||!S.timer?Promise.resolve():new Promise(function(E){var e=S.onDone;S.onDone=function(){e&&e(),E(),S.onDone=null}})},K.clear=function(b){if(b)h(G[b]),delete G[b];else for(var S in G)K.clear(S)};function h(b){b&&b.timer!==null&&(clearTimeout(b.timer),b.timer=null)}}}),ty=Ge({"src/lib/clear_responsive.js"(K,G){G.exports=function(b){b._responsiveChartHandler&&(window.removeEventListener("resize",b._responsiveChartHandler),delete b._responsiveChartHandler)}}}),CM=Ge({"node_modules/is-mobile/index.js"(K,G){G.exports=E,G.exports.isMobile=E,G.exports.default=E;var h=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,b=/CrOS/,S=/android|ipad|playbook|silk/i;function E(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string")return!1;let r=h.test(t)&&!b.test(t)||!!e.tablet&&S.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(r=!0),r}}}),XT=Ge({"src/lib/preserve_drawing_buffer.js"(K,G){var h=Ei(),b=CM();G.exports=function(e){var t;if(e&&e.hasOwnProperty("userAgent")?t=e.userAgent:t=S(),typeof t!="string")return!0;var r=b({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var o=t.split(" "),n=1;n-1;a--){var s=o[a];if(s.slice(0,8)==="Version/"){var f=s.slice(8).split(".")[0];if(h(f)&&(f=+f),f>=13)return!0}}}return r};function S(){var E;return typeof navigator<"u"&&(E=navigator.userAgent),E&&E.headers&&typeof E.headers["user-agent"]=="string"&&(E=E.headers["user-agent"]),E}}}),YT=Ge({"src/lib/make_trace_groups.js"(K,G){var h=ki();G.exports=function(S,E,e){var t=S.selectAll("g."+e.replace(/\s/g,".")).data(E,function(o){return o[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",e),t.order();var r=S.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(o){o[0][r]=h.select(this)}),t}}}),LM=Ge({"src/lib/localize.js"(K,G){var h=Ro();G.exports=function(S,E){for(var e=S._context.locale,t=0;t<2;t++){for(var r=S._context.locales,o=0;o<2;o++){var n=(r[e]||{}).dictionary;if(n){var i=n[E];if(i)return i}r=h.localeRegistry}var a=e.split("-")[0];if(a===e)break;e=a}return E}}}),T1=Ge({"src/lib/filter_unique.js"(K,G){G.exports=function(b){for(var S={},E=[],e=0,t=0;t1?(E*b+E*S)/E:b+S,t=String(e).length;if(t>16){var r=String(S).length,o=String(b).length;if(t>=o+r){var n=parseFloat(e).toPrecision(12);n.indexOf("e+")===-1&&(e=+n)}}return e}}}),gp=Ge({"src/lib/clean_number.js"(K,G){var h=Ei(),b=Ii().BADNUM,S=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;G.exports=function(e){return typeof e=="string"&&(e=e.replace(S,"")),h(e)?Number(e):b}}}),_n=Ge({"src/lib/index.js"(K,G){var h=ki(),b=Bi().utcFormat,S=zo().format,E=Ei(),e=Ii(),t=e.FP_SAFE,r=-t,o=e.BADNUM,n=G.exports={};n.adjustFormat=function(H){return!H||/^\d[.]\df/.test(H)||/[.]\d%/.test(H)?H:H==="0.f"?"~f":/^\d%/.test(H)?"~%":/^\ds/.test(H)?"~s":!/^[~,.0$]/.test(H)&&/[&fps]/.test(H)?"~"+H:H};var i={};n.warnBadFormat=function(te){var H=String(te);i[H]||(i[H]=1,n.warn('encountered bad format: "'+H+'"'))},n.noFormat=function(te){return String(te)},n.numberFormat=function(te){var H;try{H=S(n.adjustFormat(te))}catch{return n.warnBadFormat(te),n.noFormat}return H},n.nestedProperty=bu(),n.keyedContainer=ba(),n.relativeAttr=qa(),n.isPlainObject=So(),n.toLogRange=ro(),n.relinkPrivateKeys=Jn();var a=ws();n.isArrayBuffer=a.isArrayBuffer,n.isTypedArray=a.isTypedArray,n.isArrayOrTypedArray=a.isArrayOrTypedArray,n.isArray1D=a.isArray1D,n.ensureArray=a.ensureArray,n.concat=a.concat,n.maxRowLength=a.maxRowLength,n.minRowLength=a.minRowLength;var s=vs();n.mod=s.mod,n.modHalf=s.modHalf;var f=$g();n.valObjectMeta=f.valObjectMeta,n.coerce=f.coerce,n.coerce2=f.coerce2,n.coerceFont=f.coerceFont,n.coercePattern=f.coercePattern,n.coerceHoverinfo=f.coerceHoverinfo,n.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,n.validate=f.validate;var c=Gw();n.dateTime2ms=c.dateTime2ms,n.isDateTime=c.isDateTime,n.ms2DateTime=c.ms2DateTime,n.ms2DateTimeLocal=c.ms2DateTimeLocal,n.cleanDate=c.cleanDate,n.isJSDate=c.isJSDate,n.formatDate=c.formatDate,n.incrementMonth=c.incrementMonth,n.dateTick0=c.dateTick0,n.dfltRange=c.dfltRange,n.findExactDates=c.findExactDates,n.MIN_MS=c.MIN_MS,n.MAX_MS=c.MAX_MS;var p=im();n.findBin=p.findBin,n.sorterAsc=p.sorterAsc,n.sorterDes=p.sorterDes,n.distinctVals=p.distinctVals,n.roundUp=p.roundUp,n.sort=p.sort,n.findIndexOfMin=p.findIndexOfMin,n.sortObjectKeys=Op();var v=ey();n.aggNums=v.aggNums,n.len=v.len,n.mean=v.mean,n.geometricMean=v.geometricMean,n.median=v.median,n.midRange=v.midRange,n.variance=v.variance,n.stdev=v.stdev,n.interp=v.interp;var T=sx();n.init2dArray=T.init2dArray,n.transposeRagged=T.transposeRagged,n.dot=T.dot,n.translationMatrix=T.translationMatrix,n.rotationMatrix=T.rotationMatrix,n.rotationXYMatrix=T.rotationXYMatrix,n.apply3DTransform=T.apply3DTransform,n.apply2DTransform=T.apply2DTransform,n.apply2DTransform2=T.apply2DTransform2,n.convertCssMatrix=T.convertCssMatrix,n.inverseTransformMatrix=T.inverseTransformMatrix;var l=Fd();n.deg2rad=l.deg2rad,n.rad2deg=l.rad2deg,n.angleDelta=l.angleDelta,n.angleDist=l.angleDist,n.isFullCircle=l.isFullCircle,n.isAngleInsideSector=l.isAngleInsideSector,n.isPtInsideSector=l.isPtInsideSector,n.pathArc=l.pathArc,n.pathSector=l.pathSector,n.pathAnnulus=l.pathAnnulus;var g=HT();n.isLeftAnchor=g.isLeftAnchor,n.isCenterAnchor=g.isCenterAnchor,n.isRightAnchor=g.isRightAnchor,n.isTopAnchor=g.isTopAnchor,n.isMiddleAnchor=g.isMiddleAnchor,n.isBottomAnchor=g.isBottomAnchor;var x=GT();n.segmentsIntersect=x.segmentsIntersect,n.segmentDistance=x.segmentDistance,n.getTextLocation=x.getTextLocation,n.clearLocationCache=x.clearLocationCache,n.getVisibleSegment=x.getVisibleSegment,n.findPointOnPath=x.findPointOnPath;var A=Ji();n.extendFlat=A.extendFlat,n.extendDeep=A.extendDeep,n.extendDeepAll=A.extendDeepAll,n.extendDeepNoArrays=A.extendDeepNoArrays;var M=Ql();n.log=M.log,n.warn=M.warn,n.error=M.error;var _=mp();n.counterRegex=_.counter;var w=R0();n.throttle=w.throttle,n.throttleDone=w.done,n.clearThrottle=w.clear;var m=Kg();n.getGraphDiv=m.getGraphDiv,n.isPlotDiv=m.isPlotDiv,n.removeElement=m.removeElement,n.addStyleRule=m.addStyleRule,n.addRelatedStyleRule=m.addRelatedStyleRule,n.deleteRelatedStyleRule=m.deleteRelatedStyleRule,n.setStyleOnHover=m.setStyleOnHover,n.getFullTransformMatrix=m.getFullTransformMatrix,n.getElementTransformMatrix=m.getElementTransformMatrix,n.getElementAndAncestors=m.getElementAndAncestors,n.equalDomRects=m.equalDomRects,n.clearResponsive=ty(),n.preserveDrawingBuffer=XT(),n.makeTraceGroups=YT(),n._=LM(),n.notifier=jl(),n.filterUnique=T1(),n.filterVisible=lx(),n.pushUnique=Wd(),n.increment=I0(),n.cleanNumber=gp(),n.ensureNumber=function(H){return E(H)?(H=Number(H),H>t||H=H?!1:E(te)&&te>=0&&te%1===0},n.noop=Vu(),n.identity=P0(),n.repeat=function(te,H){for(var ae=new Array(H),ie=0;ieae?Math.max(ae,Math.min(H,te)):Math.max(H,Math.min(ae,te))},n.bBoxIntersect=function(te,H,ae){return ae=ae||0,te.left<=H.right+ae&&H.left<=te.right+ae&&te.top<=H.bottom+ae&&H.top<=te.bottom+ae},n.simpleMap=function(te,H,ae,ie,de){for(var Se=te.length,Le=new Array(Se),Fe=0;Fe=Math.pow(2,ae)?de>10?(n.warn("randstr failed uniqueness"),Le):te(H,ae,ie,(de||0)+1):Le},n.OptionControl=function(te,H){te||(te={}),H||(H="opt");var ae={};return ae.optionList=[],ae._newoption=function(ie){ie[H]=te,ae[ie.name]=ie,ae.optionList.push(ie)},ae["_"+H]=te,ae},n.smooth=function(te,H){if(H=Math.round(H)||0,H<2)return te;var ae=te.length,ie=2*ae,de=2*H-1,Se=new Array(de),Le=new Array(ae),Fe,ze,Ye,st;for(Fe=0;Fe=ie&&(Ye-=ie*Math.floor(Ye/ie)),Ye<0?Ye=-1-Ye:Ye>=ae&&(Ye=ie-1-Ye),st+=te[Ye]*Se[ze];Le[Fe]=st}return Le},n.syncOrAsync=function(te,H,ae){var ie,de;function Se(){return n.syncOrAsync(te,H,ae)}for(;te.length;)if(de=te.splice(0,1)[0],ie=de(H),ie&&ie.then)return ie.then(Se);return ae&&ae(H)},n.stripTrailingSlash=function(te){return te.slice(-1)==="/"?te.slice(0,-1):te},n.noneOrAll=function(te,H,ae){if(te){var ie=!1,de=!0,Se,Le;for(Se=0;Se0?de:0})},n.fillArray=function(te,H,ae,ie){if(ie=ie||n.identity,n.isArrayOrTypedArray(te))for(var de=0;deL.test(window.navigator.userAgent);var z=/Firefox\/(\d+)\.\d+/;n.getFirefoxVersion=function(){var te=z.exec(window.navigator.userAgent);if(te&&te.length===2){var H=parseInt(te[1]);if(!isNaN(H))return H}return null},n.isD3Selection=function(te){return te instanceof h.selection},n.ensureSingle=function(te,H,ae,ie){var de=te.select(H+(ae?"."+ae:""));if(de.size())return de;var Se=te.append(H);return ae&&Se.classed(ae,!0),ie&&Se.call(ie),Se},n.ensureSingleById=function(te,H,ae,ie){var de=te.select(H+"#"+ae);if(de.size())return de;var Se=te.append(H).attr("id",ae);return ie&&Se.call(ie),Se},n.objectFromPath=function(te,H){for(var ae=te.split("."),ie,de=ie={},Se=0;Se1?de+Le[1]:"";if(Se&&(Le.length>1||Fe.length>4||ae))for(;ie.test(Fe);)Fe=Fe.replace(ie,"$1"+Se+"$2");return Fe+ze},n.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var R=/^\w*$/;n.templateString=function(te,H){var ae={};return te.replace(n.TEMPLATE_STRING_REGEX,function(ie,de){var Se;return R.test(de)?Se=H[de]:(ae[de]=ae[de]||n.nestedProperty(H,de).get,Se=ae[de](!0)),Se!==void 0?Se:""})};var U={max:10,count:0,name:"hovertemplate"};n.hovertemplateString=te=>ce(wo(Hi({},te),{opts:U}));var j={max:10,count:0,name:"texttemplate"};n.texttemplateString=te=>ce(wo(Hi({},te),{opts:j}));var Z=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function re(te){var H=te.match(Z);return H?{key:H[1],op:H[2],number:Number(H[3])}:{key:te,op:null,number:null}}var fe={max:10,count:0,name:"texttemplate",parseMultDiv:!0};n.texttemplateStringForShapes=te=>ce(wo(Hi({},te),{opts:fe}));var le=/^[:|\|]/;function ce({data:te=[],locale:H,fallback:ae,labels:ie={},opts:de,template:Se}){return Se.replace(n.TEMPLATE_STRING_REGEX,(Le,Fe,ze)=>{const Ye=["xother","yother"].includes(Fe),st=["_xother","_yother"].includes(Fe),ct=["_xother_","_yother_"].includes(Fe),at=["xother_","yother_"].includes(Fe),et=Ye||st||at||ct;(st||ct)&&(Fe=Fe.substring(1)),(at||ct)&&(Fe=Fe.substring(0,Fe.length-1));let Pe=null,Ae=null;if(de.parseMultDiv){var pe=re(Fe);Fe=pe.key,Pe=pe.op,Ae=pe.number}let Ne;if(et){if(ie[Fe]===void 0)return"";Ne=ie[Fe]}else for(const Ft of te)if(Ft){if(Ft.hasOwnProperty(Fe)){Ne=Ft[Fe];break}if(R.test(Fe)||(Ne=n.nestedProperty(Ft,Fe).get(!0)),Ne!==void 0)break}if(Ne===void 0){const{count:Ft,max:Nt,name:Qt}=de,ar=ae===!1?Le:ae;return Ft=V&&Le<=ee,Ye=Fe>=V&&Fe<=ee;if(ze&&(ie=10*ie+Le-V),Ye&&(de=10*de+Fe-V),!ze||!Ye){if(ie!==de)return ie-de;if(Le!==Fe)return Le-Fe}}return de-ie};var ne=2e9;n.seedPseudoRandom=function(){ne=2e9},n.pseudoRandom=function(){var te=ne;return ne=(69069*ne+1)%4294967296,Math.abs(ne-te)<429496729?n.pseudoRandom():ne/4294967296},n.fillText=function(te,H,ae){var ie=Array.isArray(ae)?function(Le){ae.push(Le)}:function(Le){ae.text=Le},de=n.extractOption(te,H,"htx","hovertext");if(n.isValidTextValue(de))return ie(de);var Se=n.extractOption(te,H,"tx","text");if(n.isValidTextValue(Se))return ie(Se)},n.isValidTextValue=function(te){return te||te===0},n.formatPercent=function(te,H){H=H||0;for(var ae=(Math.round(100*te*Math.pow(10,H))*Math.pow(.1,H)).toFixed(H)+"%",ie=0;ie1&&(Ye=1):Ye=0,n.strTranslate(de-Ye*(ae+Le),Se-Ye*(ie+Fe))+n.strScale(Ye)+(ze?"rotate("+ze+(H?"":" "+ae+" "+ie)+")":"")},n.setTransormAndDisplay=function(te,H){te.attr("transform",n.getTextTransform(H)),te.style("display",H.scale?null:"none")},n.ensureUniformFontSize=function(te,H){var ae=n.extendFlat({},H);return ae.size=Math.max(H.size,te._fullLayout.uniformtext.minsize||0),ae},n.join2=function(te,H,ae){var ie=te.length;return ie>1?te.slice(0,-1).join(H)+ae+te[ie-1]:te.join(H)},n.bigFont=function(te){return Math.round(1.2*te)};var $=n.getFirefoxVersion(),ue=$!==null&&$<86;n.getPositionFromD3Event=function(){return ue?[h.event.layerX,h.event.layerY]:[h.event.offsetX,h.event.offsetY]}}}),PM=Ge({"build/plotcss.js"(){var K=_n(),G={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(b in G)h=b.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),K.addStyleRule(h,G[b]);var h,b}}),ux=Ge({"node_modules/is-browser/client.js"(K,G){G.exports=!0}}),Xw=Ge({"node_modules/has-hover/index.js"(K,G){var h=ux(),b;typeof window.matchMedia=="function"?b=!window.matchMedia("(hover: none)").matches:b=h,G.exports=b}}),D0=Ge({"node_modules/events/events.js"(K,G){var h=typeof Reflect=="object"?Reflect:null,b=h&&typeof h.apply=="function"?h.apply:function(M,_,w){return Function.prototype.apply.call(M,_,w)},S;h&&typeof h.ownKeys=="function"?S=h.ownKeys:Object.getOwnPropertySymbols?S=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:S=function(M){return Object.getOwnPropertyNames(M)};function E(A){console&&console.warn&&console.warn(A)}var e=Number.isNaN||function(M){return M!==M};function t(){t.init.call(this)}G.exports=t,G.exports.once=l,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function o(A){if(typeof A!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof A)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(A){if(typeof A!="number"||A<0||e(A))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");r=A}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(M){if(typeof M!="number"||M<0||e(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function n(A){return A._maxListeners===void 0?t.defaultMaxListeners:A._maxListeners}t.prototype.getMaxListeners=function(){return n(this)},t.prototype.emit=function(M){for(var _=[],w=1;w0&&(d=_[0]),d instanceof Error)throw d;var y=new Error("Unhandled error."+(d?" ("+d.message+")":""));throw y.context=d,y}var I=u[M];if(I===void 0)return!1;if(typeof I=="function")b(I,this,_);else for(var L=I.length,z=p(I,L),w=0;w0&&d.length>m&&!d.warned){d.warned=!0;var y=new Error("Possible EventEmitter memory leak detected. "+d.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");y.name="MaxListenersExceededWarning",y.emitter=A,y.type=M,y.count=d.length,E(y)}return A}t.prototype.addListener=function(M,_){return i(this,M,_,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(M,_){return i(this,M,_,!0)};function a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(A,M,_){var w={fired:!1,wrapFn:void 0,target:A,type:M,listener:_},m=a.bind(w);return m.listener=_,w.wrapFn=m,m}t.prototype.once=function(M,_){return o(_),this.on(M,s(this,M,_)),this},t.prototype.prependOnceListener=function(M,_){return o(_),this.prependListener(M,s(this,M,_)),this},t.prototype.removeListener=function(M,_){var w,m,u,d,y;if(o(_),m=this._events,m===void 0)return this;if(w=m[M],w===void 0)return this;if(w===_||w.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete m[M],m.removeListener&&this.emit("removeListener",M,w.listener||_));else if(typeof w!="function"){for(u=-1,d=w.length-1;d>=0;d--)if(w[d]===_||w[d].listener===_){y=w[d].listener,u=d;break}if(u<0)return this;u===0?w.shift():v(w,u),w.length===1&&(m[M]=w[0]),m.removeListener!==void 0&&this.emit("removeListener",M,y||_)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(M){var _,w,m;if(w=this._events,w===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete w[M]),this;if(arguments.length===0){var u=Object.keys(w),d;for(m=0;m=0;m--)this.removeListener(M,_[m]);return this};function f(A,M,_){var w=A._events;if(w===void 0)return[];var m=w[M];return m===void 0?[]:typeof m=="function"?_?[m.listener||m]:[m]:_?T(m):p(m,m.length)}t.prototype.listeners=function(M){return f(this,M,!0)},t.prototype.rawListeners=function(M){return f(this,M,!1)},t.listenerCount=function(A,M){return typeof A.listenerCount=="function"?A.listenerCount(M):c.call(A,M)},t.prototype.listenerCount=c;function c(A){var M=this._events;if(M!==void 0){var _=M[A];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?S(this._events):[]};function p(A,M){for(var _=new Array(M),w=0;w{},{passive:!0}),S},triggerHandler:function(S,E,e){var t,r=S._ev;if(!r)return;var o=r._events[E];if(!o)return;function n(a){if(a.listener){if(r.removeListener(E,a.listener),!a.fired)return a.fired=!0,a.listener.apply(r,[e])}else return a.apply(r,[e])}o=Array.isArray(o)?o:[o];var i;for(i=0;ib.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},E.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},E.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},E.undo=function(t){var r,o;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=R.length)return!1;if(L.dimensions===2){if(F++,z.length===F)return L;var U=z[F];if(!x(U))return!1;L=R[B][U]}else L=R[B]}else L=R}}return L}function x(L){return L===Math.round(L)&&L>=0}function A(L){var z,F;z=G.modules[L]._module,F=z.basePlotModule;var N={};N.type=null;var B=o({},b),R=o({},z.attributes);K.crawl(R,function(Z,re,fe,le,ce){a(B,ce).set(void 0),Z===void 0&&a(R,ce).set(void 0)}),o(N,B),G.traceIs(L,"noOpacity")&&delete N.opacity,G.traceIs(L,"showLegend")||(delete N.showlegend,delete N.legendgroup),G.traceIs(L,"noHover")&&(delete N.hoverinfo,delete N.hoverlabel),z.selectPoints||delete N.selectedpoints,o(N,R),F.attributes&&o(N,F.attributes),N.type=L;var U={meta:z.meta||{},categories:z.categories||{},animatable:!!z.animatable,type:L,attributes:w(N)};if(z.layoutAttributes){var j={};o(j,z.layoutAttributes),U.layoutAttributes=w(j)}return z.animatable||K.crawl(U,function(Z){K.isValObject(Z)&&"anim"in Z&&delete Z.anim}),U}function M(){var L={},z,F;o(L,S);for(z in G.subplotsRegistry)if(F=G.subplotsRegistry[z],!!F.layoutAttributes)if(Array.isArray(F.attr))for(var N=0;N=n&&(o._input||{})._templateitemname;a&&(i=n);var s=r+"["+i+"]",f;function c(){f={},a&&(f[s]={},f[s][b]=a)}c();function p(g,x){f[g]=x}function v(g,x){a?G.nestedProperty(f[s],g).set(x):f[s+"."+g]=x}function T(){var g=f;return c(),g}function l(g,x){g&&v(g,x);var A=T();for(var M in A)G.nestedProperty(t,M).set(A[M])}return{modifyBase:p,modifyItem:v,getUpdateObj:T,applyUpdate:l}}}}),sh=Ge({"src/plots/cartesian/constants.js"(K,G){var h=mp().counter;G.exports={idRegex:{x:h("x","( domain)?"),y:h("y","( domain)?")},attrRegex:h("[xy]axis"),xAxisMatch:h("xaxis"),yAxisMatch:h("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),Df=Ge({"src/plots/cartesian/axis_ids.js"(K){var G=Ro(),h=sh();K.id2name=function(E){if(!(typeof E!="string"||!E.match(h.AX_ID_PATTERN))){var e=E.split(" ")[0].slice(1);return e==="1"&&(e=""),E.charAt(0)+"axis"+e}},K.name2id=function(E){if(E.match(h.AX_NAME_PATTERN)){var e=E.slice(5);return e==="1"&&(e=""),E.charAt(0)+e}},K.cleanId=function(E,e,t){var r=/( domain)$/.test(E);if(!(typeof E!="string"||!E.match(h.AX_ID_PATTERN))&&!(e&&E.charAt(0)!==e)&&!(r&&!t)){var o=E.split(" ")[0].slice(1).replace(/^0+/,"");return o==="1"&&(o=""),E.charAt(0)+o+(r&&t?" domain":"")}},K.list=function(S,E,e){var t=S._fullLayout;if(!t)return[];var r=K.listIds(S,E),o=new Array(r.length),n;for(n=0;nt?1:-1:+(S.slice(1)||1)-+(E.slice(1)||1)},K.ref2id=function(S){return/^[xyz]/.test(S)?S.split(" ")[0]:!1};function b(S,E){if(E&&E.length){for(var e=0;e0?".":"")+a;h.isPlainObject(s)?t(s,o,f,i+1):o(f,a,s)}})}}}),ef=Ge({"src/plots/plots.js"(K,G){var h=ki(),b=Bi().timeFormatLocale,S=zo().formatLocale,E=Ei(),e=Ti(),t=Ro(),r=ry(),o=_u(),n=_n(),i=go(),a=Ii().BADNUM,s=Df(),f=om().clearOutline,c=sm(),p=Jg(),v=cx(),T=Bd().getModuleCalcData,l=n.relinkPrivateKeys,g=n._,x=G.exports={};n.extendFlat(x,t),x.attributes=Jl(),x.attributes.type.values=x.allTypes,x.fontAttrs=Us(),x.layoutAttributes=w1();var A=ZT();x.executeAPICommand=A.executeAPICommand,x.computeAPICommandBindings=A.computeAPICommandBindings,x.manageCommandObserver=A.manageCommandObserver,x.hasSimpleAPICommandBindings=A.hasSimpleAPICommandBindings,x.redrawText=function(V){return V=n.getGraphDiv(V),new Promise(function(ee){setTimeout(function(){V._fullLayout&&(t.getComponentMethod("annotations","draw")(V),t.getComponentMethod("legend","draw")(V),t.getComponentMethod("colorbar","draw")(V),ee(x.previousPromises(V)))},300)})},x.resize=function(V){V=n.getGraphDiv(V);var ee,ne=new Promise(function($,ue){(!V||n.isHidden(V))&&ue(new Error("Resize must be passed a displayed plot div element.")),V._redrawTimer&&clearTimeout(V._redrawTimer),V._resolveResize&&(ee=V._resolveResize),V._resolveResize=$,V._redrawTimer=setTimeout(function(){if(!V.layout||V.layout.width&&V.layout.height||n.isHidden(V)){$(V);return}delete V.layout.width,delete V.layout.height;var te=V.changed;V.autoplay=!0,t.call("relayout",V,{autosize:!0}).then(function(){V.changed=te,V._resolveResize===$&&(delete V._resolveResize,$(V))})},100)});return ee&&ee(ne),ne},x.previousPromises=function(V){if((V._promises||[]).length)return Promise.all(V._promises).then(function(){V._promises=[]})},x.addLinks=function(V){if(!(!V._context.showLink&&!V._context.showSources)){var ee=V._fullLayout,ne=n.ensureSingle(ee._paper,"text","js-plot-link-container",function(ie){ie.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:i.defaultLine,"pointer-events":"all"}).each(function(){var de=h.select(this);de.append("tspan").classed("js-link-to-tool",!0),de.append("tspan").classed("js-link-spacer",!0),de.append("tspan").classed("js-sourcelinks",!0)})}),$=ne.node(),ue={y:ee._paper.attr("height")-9};document.body.contains($)&&$.getComputedTextLength()>=ee.width-20?(ue["text-anchor"]="start",ue.x=5):(ue["text-anchor"]="end",ue.x=ee._paper.attr("width")-7),ne.attr(ue);var te=ne.select(".js-link-to-tool"),H=ne.select(".js-link-spacer"),ae=ne.select(".js-sourcelinks");V._context.showSources&&V._context.showSources(V),V._context.showLink&&M(V,te),H.text(te.text()&&ae.text()?" - ":"")}};function M(V,ee){ee.text("");var ne=ee.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(V._context.linkText+" »");if(V._context.sendData)ne.on("click",function(){x.sendDataToCloud(V)});else{var $=window.location.pathname.split("/"),ue=window.location.search;ne.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+$[2].split(".")[0]+"/"+$[1]+ue})}}x.sendDataToCloud=function(V){var ee=(window.PLOTLYENV||{}).BASE_URL||V._context.plotlyServerURL;if(ee){V.emit("plotly_beforeexport");var ne=h.select(V).append("div").attr("id","hiddenform").style("display","none"),$=ne.append("form").attr({action:ee+"/external",method:"post",target:"_blank"}),ue=$.append("input").attr({type:"text",name:"data"});return ue.node().value=x.graphJson(V,!1,"keepdata"),$.node().submit(),ne.remove(),V.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];x.supplyDefaults=function(V,ee){var ne=ee&&ee.skipUpdateCalc,$=V._fullLayout||{};if($._skipDefaults){delete $._skipDefaults;return}var ue=V._fullLayout={},te=V.layout||{},H=V._fullData||[],ae=V._fullData=[],ie=V.data||[],de=V.calcdata||[],Se=V._context||{},Le;V._transitionData||x.createTransitionData(V),ue._dfltTitle={plot:g(V,"Click to enter Plot title"),subtitle:g(V,"Click to enter Plot subtitle"),x:g(V,"Click to enter X axis title"),y:g(V,"Click to enter Y axis title"),colorbar:g(V,"Click to enter Colorscale title"),annotation:g(V,"new text")},ue._traceWord=g(V,"trace");var Fe=d(V,_);if(ue._mapboxAccessToken=Se.mapboxAccessToken,$._initialAutoSizeIsDone){var ze=$.width,Ye=$.height;x.supplyLayoutGlobalDefaults(te,ue,Fe),te.width||(ue.width=ze),te.height||(ue.height=Ye),x.sanitizeMargins(ue)}else{x.supplyLayoutGlobalDefaults(te,ue,Fe);var st=!te.width||!te.height,ct=ue.autosize,at=Se.autosizable,et=st&&(ct||at);et?x.plotAutoSize(V,te,ue):st&&x.sanitizeMargins(ue),!ct&&st&&(te.width=ue.width,te.height=ue.height)}ue._d3locale=y(Fe,ue.separators),ue._extraFormat=d(V,w),ue._initialAutoSizeIsDone=!0,ue._dataLength=ie.length,ue._modules=[],ue._visibleModules=[],ue._basePlotModules=[];var Pe=ue._subplots=u(),Ae=ue._splomAxes={x:{},y:{}},pe=ue._splomSubplots={};ue._splomGridDflt={},ue._scatterStackOpts={},ue._firstScatter={},ue._alignmentOpts={},ue._colorAxes={},ue._requestRangeslider={},ue._traceUids=m(H,ie),x.supplyDataDefaults(ie,ae,te,ue);var Ne=Object.keys(Ae.x),ut=Object.keys(Ae.y);if(Ne.length>1&&ut.length>1){for(t.getComponentMethod("grid","sizeDefaults")(te,ue),Le=0;Le15&&ut.length>15&&ue.shapes.length===0&&ue.images.length===0,x.linkSubplots(ae,ue,H,$),x.cleanPlot(ae,ue,H,$);var Qt=!!($._has&&$._has("cartesian")),ar=!!(ue._has&&ue._has("cartesian")),kr=Qt,Er=ar;kr&&!Er?$._bgLayer.remove():Er&&!kr&&(ue._shouldCreateBgLayer=!0),$._zoomlayer&&!V._dragging&&f({_fullLayout:$}),I(ae,ue),l(ue,$),t.getComponentMethod("colorscale","crossTraceDefaults")(ae,ue),ue._preGUI||(ue._preGUI={}),ue._tracePreGUI||(ue._tracePreGUI={});var $r=ue._tracePreGUI,Sr={},Ur;for(Ur in $r)Sr[Ur]="old";for(Le=0;Le0){var Se=1-2*te;H=Math.round(Se*H),ae=Math.round(Se*ae)}}var Le=x.layoutAttributes.width.min,Fe=x.layoutAttributes.height.min;H1,Ye=!ne.height&&Math.abs($.height-ae)>1;(Ye||ze)&&(ze&&($.width=H),Ye&&($.height=ae)),ee._initialAutoSize||(ee._initialAutoSize={width:H,height:ae}),x.sanitizeMargins($)},x.supplyLayoutModuleDefaults=function(V,ee,ne,$){var ue=t.componentsRegistry,te=ee._basePlotModules,H,ae,ie,de=t.subplotsRegistry.cartesian;for(H in ue)ie=ue[H],ie.includeBasePlot&&ie.includeBasePlot(V,ee);te.length||te.push(de),ee._has("cartesian")&&(t.getComponentMethod("grid","contentDefaults")(V,ee),de.finalizeSubplots(V,ee));for(var Se in ee._subplots)ee._subplots[Se].sort(n.subplotSort);for(ae=0;ae1&&(ne.l/=ct,ne.r/=ct)}if(Fe){var at=(ne.t+ne.b)/Fe;at>1&&(ne.t/=at,ne.b/=at)}var et=ne.xl!==void 0?ne.xl:ne.x,Pe=ne.xr!==void 0?ne.xr:ne.x,Ae=ne.yt!==void 0?ne.yt:ne.y,pe=ne.yb!==void 0?ne.yb:ne.y;ze[ee]={l:{val:et,size:ne.l+st},r:{val:Pe,size:ne.r+st},b:{val:pe,size:ne.b+st},t:{val:Ae,size:ne.t+st}},Ye[ee]=1}if(!$._replotting)return x.doAutoMargin(V)}};function R(V){if("_redrawFromAutoMarginCount"in V._fullLayout)return!1;var ee=s.list(V,"",!0);for(var ne in ee)if(ee[ne].autoshift||ee[ne].shift)return!0;return!1}x.doAutoMargin=function(V){var ee=V._fullLayout,ne=ee.width,$=ee.height;ee._size||(ee._size={}),F(ee);var ue=ee._size,te=ee.margin,H={t:0,b:0,l:0,r:0},ae=n.extendFlat({},ue),ie=te.l,de=te.r,Se=te.t,Le=te.b,Fe=ee._pushmargin,ze=ee._pushmarginIds,Ye=ee.minreducedwidth,st=ee.minreducedheight;if(te.autoexpand!==!1){for(var ct in Fe)ze[ct]||delete Fe[ct];var at=V._fullLayout._reservedMargin;for(var et in at)for(var Pe in at[et]){var Ae=at[et][Pe];H[Pe]=Math.max(H[Pe],Ae)}Fe.base={l:{val:0,size:ie},r:{val:1,size:de},t:{val:1,size:Se},b:{val:0,size:Le}};for(var pe in H){var Ne=0;for(var ut in Fe)ut!=="base"&&E(Fe[ut][pe].size)&&(Ne=Fe[ut][pe].size>Ne?Fe[ut][pe].size:Ne);var dt=Math.max(0,te[pe]-Ne);H[pe]=Math.max(0,H[pe]-dt)}for(var nt in Fe){var Ft=Fe[nt].l||{},Nt=Fe[nt].b||{},Qt=Ft.val,ar=Ft.size,kr=Nt.val,Er=Nt.size,$r=ne-H.r-H.l,Sr=$-H.t-H.b;for(var Ur in Fe){if(E(ar)&&Fe[Ur].r){var Mt=Fe[Ur].r.val,je=Fe[Ur].r.size;if(Mt>Qt){var Je=(ar*Mt+(je-$r)*Qt)/(Mt-Qt),ke=(je*(1-Qt)+(ar-$r)*(1-Mt))/(Mt-Qt);Je+ke>ie+de&&(ie=Je,de=ke)}}if(E(Er)&&Fe[Ur].t){var xe=Fe[Ur].t.val,ye=Fe[Ur].t.size;if(xe>kr){var Ee=(Er*xe+(ye-Sr)*kr)/(xe-kr),Xe=(ye*(1-kr)+(Er-Sr)*(1-xe))/(xe-kr);Ee+Xe>Le+Se&&(Le=Ee,Se=Xe)}}}}}var Qe=n.constrain(ne-te.l-te.r,N,Ye),Lt=n.constrain($-te.t-te.b,B,st),Ct=Math.max(0,ne-Qe),Ot=Math.max(0,$-Lt);if(Ct){var Kt=(ie+de)/Ct;Kt>1&&(ie/=Kt,de/=Kt)}if(Ot){var xr=(Le+Se)/Ot;xr>1&&(Le/=xr,Se/=xr)}if(ue.l=Math.round(ie)+H.l,ue.r=Math.round(de)+H.r,ue.t=Math.round(Se)+H.t,ue.b=Math.round(Le)+H.b,ue.p=Math.round(te.pad),ue.w=Math.round(ne)-ue.l-ue.r,ue.h=Math.round($)-ue.t-ue.b,!ee._replotting&&(x.didMarginChange(ae,ue)||R(V))){"_redrawFromAutoMarginCount"in ee?ee._redrawFromAutoMarginCount++:ee._redrawFromAutoMarginCount=1;var mr=3*(1+Object.keys(ze).length);if(ee._redrawFromAutoMarginCount1)return!0}return!1},x.graphJson=function(V,ee,ne,$,ue,te){(ue&&ee&&!V._fullData||ue&&!ee&&!V._fullLayout)&&x.supplyDefaults(V);var H=ue?V._fullData:V.data,ae=ue?V._fullLayout:V.layout,ie=(V._transitionData||{})._frames;function de(Fe,ze){if(typeof Fe=="function")return ze?"_function_":null;if(n.isPlainObject(Fe)){var Ye={},st;return Object.keys(Fe).sort().forEach(function(Pe){if(["_","["].indexOf(Pe.charAt(0))===-1){if(typeof Fe[Pe]=="function"){ze&&(Ye[Pe]="_function");return}if(ne==="keepdata"){if(Pe.slice(-3)==="src")return}else if(ne==="keepstream"){if(st=Fe[Pe+"src"],typeof st=="string"&&st.indexOf(":")>0&&!n.isPlainObject(Fe.stream))return}else if(ne!=="keepall"&&(st=Fe[Pe+"src"],typeof st=="string"&&st.indexOf(":")>0))return;Ye[Pe]=de(Fe[Pe],ze)}}),Ye}var ct=Array.isArray(Fe),at=n.isTypedArray(Fe);if((ct||at)&&Fe.dtype&&Fe.shape){var et=Fe.bdata;return de({dtype:Fe.dtype,shape:Fe.shape,bdata:n.isArrayBuffer(et)?e.encode(et):et},ze)}return ct?Fe.map(function(Pe){return de(Pe,ze)}):at?n.simpleMap(Fe,n.identity):n.isJSDate(Fe)?n.ms2DateTimeLocal(+Fe):Fe}var Se={data:(H||[]).map(function(Fe){var ze=de(Fe);return ee&&delete ze.fit,ze})};if(!ee&&(Se.layout=de(ae),ue)){var Le=ae._size;Se.layout.computed={margin:{b:Le.b,l:Le.l,r:Le.r,t:Le.t}}}return ie&&(Se.frames=de(ie)),te&&(Se.config=de(V._context,!0)),$==="object"?Se:JSON.stringify(Se)},x.modifyFrames=function(V,ee){var ne,$,ue,te=V._transitionData._frames,H=V._transitionData._frameHash;for(ne=0;ne0&&(V._transitioningWithDuration=!0),V._transitionData._interruptCallbacks.push(function(){$=!0}),ne.redraw&&V._transitionData._interruptCallbacks.push(function(){return t.call("redraw",V)}),V._transitionData._interruptCallbacks.push(function(){V.emit("plotly_transitioninterrupted",[])});var Fe=0,ze=0;function Ye(){return Fe++,function(){ze++,!$&&ze===Fe&&ae(Le)}}ne.runFn(Ye),setTimeout(Ye())})}function ae(Le){if(V._transitionData)return te(V._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(ne.redraw)return t.call("redraw",V)}).then(function(){V._transitioning=!1,V._transitioningWithDuration=!1,V.emit("plotly_transitioned",[])}).then(Le)}function ie(){if(V._transitionData)return V._transitioning=!1,ue(V._transitionData._interruptCallbacks)}var de=[x.previousPromises,ie,ne.prepareFn,x.rehover,x.reselect,H],Se=n.syncOrAsync(de,V);return(!Se||!Se.then)&&(Se=Promise.resolve()),Se.then(function(){return V})}x.doCalcdata=function(V,ee){var ne=s.list(V),$=V._fullData,ue=V._fullLayout,te,H,ae,ie,de=new Array($.length),Se=(V.calcdata||[]).slice();for(V.calcdata=de,ue._numBoxes=0,ue._numViolins=0,ue._violinScaleGroupStats={},V._hmpixcount=0,V._hmlumcount=0,ue._piecolormap={},ue._sunburstcolormap={},ue._treemapcolormap={},ue._iciclecolormap={},ue._funnelareacolormap={},ae=0;ae<$.length;ae++)if(Array.isArray(ee)&&ee.indexOf(ae)===-1){de[ae]=Se[ae];continue}for(ae=0;ae<$.length;ae++)te=$[ae],te._arrayAttrs=r.findArrayAttributes(te),te._extremes={};var Le=ue._subplots.polar||[];for(ae=0;ae=0;ie--)if(pe[ie].enabled){te._indexToPoints=pe[ie]._indexToPoints;break}H&&H.calc&&(Ae=H.calc(V,te))}(!Array.isArray(Ae)||!Ae[0])&&(Ae=[{x:a,y:a}]),Ae[0].t||(Ae[0].t={}),Ae[0].trace=te,de[et]=Ae}}for(le(ne,$,ue),ae=0;ae<$.length;ae++)ct(ae,!0);for(ae=0;ae<$.length;ae++)st(ae);for(Ye&&le(ne,$,ue),ae=0;ae<$.length;ae++)ct(ae,!0);for(ae=0;ae<$.length;ae++)ct(ae,!1);ce(V);var at=fe(ne,V);if(at.length){for(ue._numBoxes=0,ue._numViolins=0,ae=0;aeae||ze>ie)&&(te.style("overflow","hidden"),Le=te.node().getBoundingClientRect(),Fe=Le.width,ze=Le.height);var Ye=+B.attr("x"),st=+B.attr("y"),ct=V||B.node().getBoundingClientRect().height,at=-ct/4;if(fe[0]==="y")H.attr({transform:"rotate("+[-90,Ye,st]+")"+b(-Fe/2,at-ze/2)});else if(fe[0]==="l")st=at-ze/2;else if(fe[0]==="a"&&fe.indexOf("atitle")!==0)Ye=0,st=at;else{var et=B.attr("text-anchor");Ye=Ye-Fe*(et==="middle"?.5:et==="end"?1:0),st=st+at-ze/2}te.attr({x:Ye,y:st}),U&&U.call(B,H),ce(H)})})):le(),B};var t=/(<|<|<)/g,r=/(>|>|>)/g;function o(B){return B.replace(t,"\\lt ").replace(r,"\\gt ")}var n=[["$","$"],["\\(","\\)"]];function i(B,R,U){var j=parseInt((MathJax.version||"").split(".")[0]);if(j!==2&&j!==3){h.warn("No MathJax version:",MathJax.version);return}var Z,re,fe,le,ce=function(){return re=h.extendDeepAll({},MathJax.Hub.config),fe=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:n},displayAlign:"left"})},V=function(){re=h.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=n},ee=function(){if(Z=MathJax.Hub.config.menuSettings.renderer,Z!=="SVG")return MathJax.Hub.setRenderer("SVG")},ne=function(){Z=MathJax.config.startup.output,Z!=="svg"&&(MathJax.config.startup.output="svg")},$=function(){var de="math-output-"+h.randstr({},64);le=G.select("body").append("div").attr({id:de}).style({visibility:"hidden",position:"absolute","font-size":R.fontSize+"px"}).text(o(B));var Se=le.node();return j===2?MathJax.Hub.Typeset(Se):MathJax.typeset([Se])},ue=function(){var de=le.select(j===2?".MathJax_SVG":".MathJax"),Se=!de.empty()&&le.select("svg").node();if(!Se)h.log("There was an error in the tex syntax.",B),U();else{var Le=Se.getBoundingClientRect(),Fe;j===2?Fe=G.select("body").select("#MathJax_SVG_glyphs"):Fe=de.select("defs"),U(de,Fe,Le)}le.remove()},te=function(){if(Z!=="SVG")return MathJax.Hub.setRenderer(Z)},H=function(){Z!=="svg"&&(MathJax.config.startup.output=Z)},ae=function(){return fe!==void 0&&(MathJax.Hub.processSectionDelay=fe),MathJax.Hub.Config(re)},ie=function(){MathJax.config=re};j===2?MathJax.Hub.Queue(ce,ee,$,ue,te,ae):j===3&&(V(),ne(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){$(),ue(),H(),ie()}))}var a={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},s={sub:"0.3em",sup:"-0.6em"},f={sub:"-0.21em",sup:"0.42em"},c="​",p=["http:","https:","mailto:","",void 0,":"],v=K.NEWLINES=/(\r\n?|\n)/g,T=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,g=//i;K.BR_TAG_ALL=//gi;var x=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,A=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,M=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,_=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function w(B,R){if(!B)return null;var U=B.match(R),j=U&&(U[3]||U[4]);return j&&y(j)}var m=/(^|;)\s*color:/;K.plainText=function(B,R){R=R||{};for(var U=R.len!==void 0&&R.len!==-1?R.len:1/0,j=R.allowedTags!==void 0?R.allowedTags:["br"],Z="...",re=Z.length,fe=B.split(T),le=[],ce="",V=0,ee=0;eere?le.push(ne.slice(0,Math.max(0,H-re))+Z):le.push(ne.slice(0,H));break}ce=""}}return le.join("")};var u={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},d=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function y(B){return B.replace(d,function(R,U){var j;return U.charAt(0)==="#"?j=I(U.charAt(1)==="x"?parseInt(U.slice(2),16):parseInt(U.slice(1),10)):j=u[U],j||R})}K.convertEntities=y;function I(B){if(!(B>1114111)){var R=String.fromCodePoint;if(R)return R(B);var U=String.fromCharCode;return B<=65535?U(B):U((B>>10)+55232,B%1024+56320)}}function L(B,R){R=R.replace(v," ");var U=!1,j=[],Z,re=-1;function fe(){re++;var ze=document.createElementNS(S.svg,"tspan");G.select(ze).attr({class:"line",dy:re*E+"em"}),B.appendChild(ze),Z=ze;var Ye=j;if(j=[{node:ze}],Ye.length>1)for(var st=1;st.",R);return}var Ye=j.pop();ze!==Ye.type&&h.log("Start tag <"+Ye.type+"> doesnt match end tag <"+ze+">. Pretending it did match.",R),Z=j[j.length-1].node}var ee=g.test(R);ee?fe():(Z=B,j=[{node:B}]);for(var ne=R.split(T),$=0;$=0;g--,x++){var A=v[g];l[x]=[1-A[0],A[1]]}return l}function f(v,T){T=T||{};for(var l=v.domain,g=v.range,x=g.length,A=new Array(x),M=0;Mv-c?c=v-(p-v):p-v=0?g=o.colorscale.sequential:g=o.colorscale.sequentialminus,s._sync("colorscale",g)}}}}),kc=Ge({"src/components/colorscale/index.js"(K,G){var h=pp(),b=gd();G.exports={moduleType:"component",name:"colorscale",attributes:zu(),layoutAttributes:tg(),supplyLayoutDefaults:WT(),handleDefaults:yh(),crossTraceDefaults:dx(),calc:_d(),scales:h.scales,defaultScale:h.defaultScale,getScale:h.get,isValidScale:h.isValid,hasColorscale:b.hasColorscale,extractOpts:b.extractOpts,extractScale:b.extractScale,flipScale:b.flipScale,makeColorScaleFunc:b.makeColorScaleFunc,makeColorScaleFuncFromTrace:b.makeColorScaleFuncFromTrace}}}),uu=Ge({"src/traces/scatter/subtypes.js"(K,G){var h=_n(),b=ws().isTypedArraySpec;G.exports={hasLines:function(S){return S.visible&&S.mode&&S.mode.indexOf("lines")!==-1},hasMarkers:function(S){return S.visible&&(S.mode&&S.mode.indexOf("markers")!==-1||S.type==="splom")},hasText:function(S){return S.visible&&S.mode&&S.mode.indexOf("text")!==-1},isBubble:function(S){var E=S.marker;return h.isPlainObject(E)&&(h.isArrayOrTypedArray(E.size)||b(E.size))}}}}),Bp=Ge({"src/traces/scatter/make_bubble_size_func.js"(K,G){var h=Ei();G.exports=function(S,E){E||(E=2);var e=S.marker,t=e.sizeref||1,r=e.sizemin||0,o=e.sizemode==="area"?function(n){return Math.sqrt(n/t)}:function(n){return n/t};return function(n){var i=o(n/E);return h(i)&&i>0?Math.max(i,r):0}}}}),Kd=Ge({"src/components/fx/helpers.js"(K){var G=_n();K.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},K.isTraceInSubplots=function(t,r){if(t.type==="splom"){for(var o=t.xaxes||[],n=t.yaxes||[],i=0;i=0&&o.index2&&(r.push([n].concat(i.splice(0,2))),a="l",n=n=="m"?"l":"L");;){if(i.length==h[a])return i.unshift(n),r.push(i);if(i.length0&&(Ae=100,Pe=Pe.replace("-open","")),Pe.indexOf("-dot")>0&&(Ae+=200,Pe=Pe.replace("-dot","")),Pe=l.symbolNames.indexOf(Pe),Pe>=0&&(Pe+=Ae)}return Pe%100>=m||Pe>=400?0:Math.floor(Math.max(Pe,0))};function d(Pe,Ae,pe,Ne){var ut=Pe%100;return l.symbolFuncs[ut](Ae,pe,Ne)+(Pe>=200?u:"")}var y=S("~f"),I={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};l.gradient=function(Pe,Ae,pe,Ne,ut,dt){var nt=I[Ne];return L(Pe,Ae,pe,nt.type,ut,dt,nt.start,nt.stop,!1,nt.reversed)};function L(Pe,Ae,pe,Ne,ut,dt,nt,Ft,Nt,Qt){var ar=ut.length,kr;Ne==="linear"?kr={node:"linearGradient",attrs:{x1:nt.x,y1:nt.y,x2:Ft.x,y2:Ft.y,gradientUnits:Nt?"userSpaceOnUse":"objectBoundingBox"},reversed:Qt}:Ne==="radial"&&(kr={node:"radialGradient",reversed:Qt});for(var Er=new Array(ar),$r=0;$r=0&&Pe.i===void 0&&(Pe.i=dt.i),Ae.style("opacity",Ne.selectedOpacityFn?Ne.selectedOpacityFn(Pe):Pe.mo===void 0?nt.opacity:Pe.mo),Ne.ms2mrc){var Nt;Pe.ms==="various"||nt.size==="various"?Nt=3:Nt=Ne.ms2mrc(Pe.ms),Pe.mrc=Nt,Ne.selectedSizeFn&&(Nt=Pe.mrc=Ne.selectedSizeFn(Pe));var Qt=l.symbolNumber(Pe.mx||nt.symbol)||0;Pe.om=Qt%200>=100;var ar=et(Pe,pe),kr=ae(Pe,pe);Ae.attr("d",d(Qt,Nt,ar,kr))}var Er=!1,$r,Sr,Ur;if(Pe.so)Ur=Ft.outlierwidth,Sr=Ft.outliercolor,$r=nt.outliercolor;else{var Mt=(Ft||{}).width;Ur=(Pe.mlw+1||Mt+1||(Pe.trace?(Pe.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Pe?Sr=Pe.mlcc=Ne.lineScale(Pe.mlc):b.isArrayOrTypedArray(Ft.color)?Sr=r.defaultLine:Sr=Ft.color,b.isArrayOrTypedArray(nt.color)&&($r=r.defaultLine,Er=!0),"mc"in Pe?$r=Pe.mcc=Ne.markerScale(Pe.mc):$r=nt.color||nt.colors||"rgba(0,0,0,0)",Ne.selectedColorFn&&($r=Ne.selectedColorFn(Pe))}if(Pe.om)Ae.call(r.stroke,$r).style({"stroke-width":(Ur||1)+"px",fill:"none"});else{Ae.style("stroke-width",(Pe.isBlank?0:Ur)+"px");var je=nt.gradient,Je=Pe.mgt;Je?Er=!0:Je=je&&je.type,b.isArrayOrTypedArray(Je)&&(Je=Je[0],I[Je]||(Je=0));var ke=nt.pattern,xe=l.getPatternAttr,ye=ke&&(xe(ke.shape,Pe.i,"")||xe(ke.path,Pe.i,""));if(Je&&Je!=="none"){var Ee=Pe.mgc;Ee?Er=!0:Ee=je.color;var Xe=pe.uid;Er&&(Xe+="-"+Pe.i),l.gradient(Ae,ut,Xe,Je,[[0,Ee],[1,$r]],"fill")}else if(ye){var Qe=!1,Lt=ke.fgcolor;!Lt&&dt&&dt.color&&(Lt=dt.color,Qe=!0);var Ct=xe(Lt,Pe.i,dt&&dt.color||null),Ot=xe(ke.bgcolor,Pe.i,null),Kt=ke.fgopacity,xr=xe(ke.size,Pe.i,8),mr=xe(ke.solidity,Pe.i,.3);Qe=Qe||Pe.mcc||b.isArrayOrTypedArray(ke.shape)||b.isArrayOrTypedArray(ke.path)||b.isArrayOrTypedArray(ke.bgcolor)||b.isArrayOrTypedArray(ke.fgcolor)||b.isArrayOrTypedArray(ke.size)||b.isArrayOrTypedArray(ke.solidity);var vr=pe.uid;Qe&&(vr+="-"+Pe.i),l.pattern(Ae,"point",ut,vr,ye,xr,mr,Pe.mcc,ke.fillmode,Ot,Ct,Kt)}else b.isArrayOrTypedArray($r)?r.fill(Ae,$r[Pe.i]):r.fill(Ae,$r);Ur&&r.stroke(Ae,Sr)}},l.makePointStyleFns=function(Pe){var Ae={},pe=Pe.marker;return Ae.markerScale=l.tryColorscale(pe,""),Ae.lineScale=l.tryColorscale(pe,"line"),t.traceIs(Pe,"symbols")&&(Ae.ms2mrc=p.isBubble(Pe)?v(Pe):function(){return(pe.size||6)/2}),Pe.selectedpoints&&b.extendFlat(Ae,l.makeSelectedPointStyleFns(Pe)),Ae},l.makeSelectedPointStyleFns=function(Pe){var Ae={},pe=Pe.selected||{},Ne=Pe.unselected||{},ut=Pe.marker||{},dt=pe.marker||{},nt=Ne.marker||{},Ft=ut.opacity,Nt=dt.opacity,Qt=nt.opacity,ar=Nt!==void 0,kr=Qt!==void 0;(b.isArrayOrTypedArray(Ft)||ar||kr)&&(Ae.selectedOpacityFn=function(xe){var ye=xe.mo===void 0?ut.opacity:xe.mo;return xe.selected?ar?Nt:ye:kr?Qt:c*ye});var Er=ut.color,$r=dt.color,Sr=nt.color;($r||Sr)&&(Ae.selectedColorFn=function(xe){var ye=xe.mcc||Er;return xe.selected?$r||ye:Sr||ye});var Ur=ut.size,Mt=dt.size,je=nt.size,Je=Mt!==void 0,ke=je!==void 0;return t.traceIs(Pe,"symbols")&&(Je||ke)&&(Ae.selectedSizeFn=function(xe){var ye=xe.mrc||Ur/2;return xe.selected?Je?Mt/2:ye:ke?je/2:ye}),Ae},l.makeSelectedTextStyleFns=function(Pe){var Ae={},pe=Pe.selected||{},Ne=Pe.unselected||{},ut=Pe.textfont||{},dt=pe.textfont||{},nt=Ne.textfont||{},Ft=ut.color,Nt=dt.color,Qt=nt.color;return Ae.selectedTextColorFn=function(ar){var kr=ar.tc||Ft;return ar.selected?Nt||kr:Qt||(Nt?kr:r.addOpacity(kr,c))},Ae},l.selectedPointStyle=function(Pe,Ae){if(!(!Pe.size()||!Ae.selectedpoints)){var pe=l.makeSelectedPointStyleFns(Ae),Ne=Ae.marker||{},ut=[];pe.selectedOpacityFn&&ut.push(function(dt,nt){dt.style("opacity",pe.selectedOpacityFn(nt))}),pe.selectedColorFn&&ut.push(function(dt,nt){r.fill(dt,pe.selectedColorFn(nt))}),pe.selectedSizeFn&&ut.push(function(dt,nt){var Ft=nt.mx||Ne.symbol||0,Nt=pe.selectedSizeFn(nt);dt.attr("d",d(l.symbolNumber(Ft),Nt,et(nt,Ae),ae(nt,Ae))),nt.mrc2=Nt}),ut.length&&Pe.each(function(dt){for(var nt=h.select(this),Ft=0;Ft0?pe:0}l.textPointStyle=function(Pe,Ae,pe){if(Pe.size()){var Ne;if(Ae.selectedpoints){var ut=l.makeSelectedTextStyleFns(Ae);Ne=ut.selectedTextColorFn}var dt=Ae.texttemplate,nt=pe._fullLayout;Pe.each(function(Ft){var Nt=h.select(this),Qt=dt?b.extractOption(Ft,Ae,"txt","texttemplate"):b.extractOption(Ft,Ae,"tx","text");if(!Qt&&Qt!==0){Nt.remove();return}if(dt){var ar=Ae._module.formatLabels,kr=ar?ar(Ft,Ae,nt):{},Er={};T(Er,Ae,Ft.i),Qt=b.texttemplateString({data:[Er,Ft,Ae._meta],fallback:Ae.texttemplatefallback,labels:kr,locale:nt._d3locale,template:Qt})}var $r=Ft.tp||Ae.textposition,Sr=N(Ft,Ae),Ur=Ne?Ne(Ft):Ft.tc||Ae.textfont.color;Nt.call(l.font,{family:Ft.tf||Ae.textfont.family,weight:Ft.tw||Ae.textfont.weight,style:Ft.ty||Ae.textfont.style,variant:Ft.tv||Ae.textfont.variant,textcase:Ft.tC||Ae.textfont.textcase,lineposition:Ft.tE||Ae.textfont.lineposition,shadow:Ft.tS||Ae.textfont.shadow,size:Sr,color:Ur}).text(Qt).call(i.convertToTspans,pe).call(F,$r,Sr,Ft.mrc)})}},l.selectedTextStyle=function(Pe,Ae){if(!(!Pe.size()||!Ae.selectedpoints)){var pe=l.makeSelectedTextStyleFns(Ae);Pe.each(function(Ne){var ut=h.select(this),dt=pe.selectedTextColorFn(Ne),nt=Ne.tp||Ae.textposition,Ft=N(Ne,Ae);r.fill(ut,dt);var Nt=t.traceIs(Ae,"bar-like");F(ut,nt,Ft,Ne.mrc2||Ne.mrc,Nt)})}};var B=.5;l.smoothopen=function(Pe,Ae){if(Pe.length<3)return"M"+Pe.join("L");var pe="M"+Pe[0],Ne=[],ut;for(ut=1;ut=Nt||xe>=ar&&xe<=Nt)&&(ye<=kr&&ye>=Qt||ye>=kr&&ye<=Qt)&&(Pe=[xe,ye])}return Pe}l.applyBackoff=V,l.makeTester=function(){var Pe=b.ensureSingleById(h.select("body"),"svg","js-plotly-tester",function(pe){pe.attr(a.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),Ae=b.ensureSingle(Pe,"path","js-reference-point",function(pe){pe.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=Pe,l.testref=Ae},l.savedBBoxes={};var ee=0,ne=1e4;l.bBox=function(Pe,Ae,pe){pe||(pe=$(Pe));var Ne;if(pe){if(Ne=l.savedBBoxes[pe],Ne)return b.extendFlat({},Ne)}else if(Pe.childNodes.length===1){var ut=Pe.childNodes[0];if(pe=$(ut),pe){var dt=+ut.getAttribute("x")||0,nt=+ut.getAttribute("y")||0,Ft=ut.getAttribute("transform");if(!Ft){var Nt=l.bBox(ut,!1,pe);return dt&&(Nt.left+=dt,Nt.right+=dt),nt&&(Nt.top+=nt,Nt.bottom+=nt),Nt}if(pe+="~"+dt+"~"+nt+"~"+Ft,Ne=l.savedBBoxes[pe],Ne)return b.extendFlat({},Ne)}}var Qt,ar;Ae?Qt=Pe:(ar=l.tester.node(),Qt=Pe.cloneNode(!0),ar.appendChild(Qt)),h.select(Qt).attr("transform",null).call(i.positionText,0,0);var kr=Qt.getBoundingClientRect(),Er=l.testref.node().getBoundingClientRect();Ae||ar.removeChild(Qt);var $r={height:kr.height,width:kr.width,left:kr.left-Er.left,top:kr.top-Er.top,right:kr.right-Er.left,bottom:kr.bottom-Er.top};return ee>=ne&&(l.savedBBoxes={},ee=0),pe&&(l.savedBBoxes[pe]=$r),ee++,b.extendFlat({},$r)};function $(Pe){var Ae=Pe.getAttribute("data-unformatted");if(Ae!==null)return Ae+Pe.getAttribute("data-math")+Pe.getAttribute("text-anchor")+Pe.getAttribute("style")}l.setClipUrl=function(Pe,Ae,pe){Pe.attr("clip-path",ue(Ae,pe))};function ue(Pe,Ae){if(!Pe)return null;var pe=Ae._context,Ne=pe._exportedPlot?"":pe._baseUrl||"";return Ne?"url('"+Ne+"#"+Pe+"')":"url(#"+Pe+")"}l.getTranslate=function(Pe){var Ae=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,pe=Pe.attr?"attr":"getAttribute",Ne=Pe[pe]("transform")||"",ut=Ne.replace(Ae,function(dt,nt,Ft){return[nt,Ft].join(" ")}).split(" ");return{x:+ut[0]||0,y:+ut[1]||0}},l.setTranslate=function(Pe,Ae,pe){var Ne=/(\btranslate\(.*?\);?)/,ut=Pe.attr?"attr":"getAttribute",dt=Pe.attr?"attr":"setAttribute",nt=Pe[ut]("transform")||"";return Ae=Ae||0,pe=pe||0,nt=nt.replace(Ne,"").trim(),nt+=n(Ae,pe),nt=nt.trim(),Pe[dt]("transform",nt),nt},l.getScale=function(Pe){var Ae=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,pe=Pe.attr?"attr":"getAttribute",Ne=Pe[pe]("transform")||"",ut=Ne.replace(Ae,function(dt,nt,Ft){return[nt,Ft].join(" ")}).split(" ");return{x:+ut[0]||1,y:+ut[1]||1}},l.setScale=function(Pe,Ae,pe){var Ne=/(\bscale\(.*?\);?)/,ut=Pe.attr?"attr":"getAttribute",dt=Pe.attr?"attr":"setAttribute",nt=Pe[ut]("transform")||"";return Ae=Ae||1,pe=pe||1,nt=nt.replace(Ne,"").trim(),nt+="scale("+Ae+","+pe+")",nt=nt.trim(),Pe[dt]("transform",nt),nt};var te=/\s*sc.*/;l.setPointGroupScale=function(Pe,Ae,pe){if(Ae=Ae||1,pe=pe||1,!!Pe){var Ne=Ae===1&&pe===1?"":"scale("+Ae+","+pe+")";Pe.each(function(){var ut=(this.getAttribute("transform")||"").replace(te,"");ut+=Ne,ut=ut.trim(),this.setAttribute("transform",ut)})}};var H=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(Pe,Ae,pe){Pe&&Pe.each(function(){var Ne,ut=h.select(this),dt=ut.select("text");if(dt.node()){var nt=parseFloat(dt.attr("x")||0),Ft=parseFloat(dt.attr("y")||0),Nt=(ut.attr("transform")||"").match(H);Ae===1&&pe===1?Ne=[]:Ne=[n(nt,Ft),"scale("+Ae+","+pe+")",n(-nt,-Ft)],Nt&&Ne.push(Nt),ut.attr("transform",Ne.join(""))}})};function ae(Pe,Ae){var pe;return Pe&&(pe=Pe.mf),pe===void 0&&(pe=Ae.marker&&Ae.marker.standoff||0),!Ae._geo&&!Ae._xA?-pe:pe}l.getMarkerStandoff=ae;var ie=Math.atan2,de=Math.cos,Se=Math.sin;function Le(Pe,Ae){var pe=Ae[0],Ne=Ae[1];return[pe*de(Pe)-Ne*Se(Pe),pe*Se(Pe)+Ne*de(Pe)]}var Fe,ze,Ye,st,ct,at;function et(Pe,Ae){var pe=Pe.ma;pe===void 0&&(pe=Ae.marker.angle,(!pe||b.isArrayOrTypedArray(pe))&&(pe=0));var Ne,ut,dt=Ae.marker.angleref;if(dt==="previous"||dt==="north"){if(Ae._geo){var nt=Ae._geo.project(Pe.lonlat);Ne=nt[0],ut=nt[1]}else{var Ft=Ae._xA,Nt=Ae._yA;if(Ft&&Nt)Ne=Ft.c2p(Pe.x),ut=Nt.c2p(Pe.y);else return 90}if(Ae._geo){var Qt=Pe.lonlat[0],ar=Pe.lonlat[1],kr=Ae._geo.project([Qt,ar+1e-5]),Er=Ae._geo.project([Qt+1e-5,ar]),$r=ie(Er[1]-ut,Er[0]-Ne),Sr=ie(kr[1]-ut,kr[0]-Ne),Ur;if(dt==="north")Ur=pe/180*Math.PI;else if(dt==="previous"){var Mt=Qt/180*Math.PI,je=ar/180*Math.PI,Je=Fe/180*Math.PI,ke=ze/180*Math.PI,xe=Je-Mt,ye=de(ke)*Se(xe),Ee=Se(ke)*de(je)-de(ke)*Se(je)*de(xe);Ur=-ie(ye,Ee)-Math.PI,Fe=Qt,ze=ar}var Xe=Le($r,[de(Ur),0]),Qe=Le(Sr,[Se(Ur),0]);pe=ie(Xe[1]+Qe[1],Xe[0]+Qe[0])/Math.PI*180,dt==="previous"&&!(at===Ae.uid&&Pe.i===ct+1)&&(pe=null)}if(dt==="previous"&&!Ae._geo)if(at===Ae.uid&&Pe.i===ct+1&&E(Ne)&&E(ut)){var Lt=Ne-Ye,Ct=ut-st,Ot=Ae.line&&Ae.line.shape||"",Kt=Ot.slice(Ot.length-1);Kt==="h"&&(Ct=0),Kt==="v"&&(Lt=0),pe+=ie(Ct,Lt)/Math.PI*180+90}else pe=null}return Ye=Ne,st=ut,ct=Pe.i,at=Ae.uid,pe}l.getMarkerAngle=et}}),um=Ge({"src/components/titles/index.js"(K,G){var h=ki(),b=Ei(),S=ef(),E=Ro(),e=_n(),t=e.strTranslate,r=As(),o=go(),n=nc(),i=kv(),a=ad().OPPOSITE_SIDE,s=/ [XY][0-9]* /,f=1.6,c=1.6;function p(v,T,l){var g=v._fullLayout,x=l.propContainer,A=l.propName,M=l.placeholder,_=l.traceIndex,w=l.avoid||{},m=l.attributes,u=l.transform,d=l.containerGroup,y=1,I=x.title,L=(I&&I.text?I.text:"").trim(),z=!1,F=I&&I.font?I.font:{},N=F.family,B=F.size,R=F.color,U=F.weight,j=F.style,Z=F.variant,re=F.textcase,fe=F.lineposition,le=F.shadow,ce=l.subtitlePropName,V=!!ce,ee=l.subtitlePlaceholder,ne=(x.title||{}).subtitle||{text:"",font:{}},$=(ne.text||"").trim(),ue=!1,te=1,H=ne.font,ae=H.family,ie=H.size,de=H.color,Se=H.weight,Le=H.style,Fe=H.variant,ze=H.textcase,Ye=H.lineposition,st=H.shadow,ct;A==="title.text"?ct="titleText":A.indexOf("axis")!==-1?ct="axisTitleText":A.indexOf("colorbar")!==-1&&(ct="colorbarTitleText");var at=v._context.edits[ct];function et(Er,$r){return Er===void 0||$r===void 0?!1:Er.replace(s," % ")===$r.replace(s," % ")}L===""?y=0:et(L,M)&&(at||(L=""),y=.2,z=!0),V&&($===""?te=0:et($,ee)&&(at||($=""),te=.2,ue=!0)),l._meta?L=e.templateString(L,l._meta):g._meta&&(L=e.templateString(L,g._meta));var Pe=L||$||at,Ae;d||(d=e.ensureSingle(g._infolayer,"g","g-"+T),Ae=g._hColorbarMoveTitle);var pe=d.selectAll("text."+T).data(Pe?[0]:[]);pe.enter().append("text"),pe.text(L).attr("class",T),pe.exit().remove();var Ne=null,ut=T+"-subtitle",dt=$||at;if(V&&(Ne=d.selectAll("text."+ut).data(dt?[0]:[]),Ne.enter().append("text"),Ne.text($).attr("class",ut),Ne.exit().remove()),!Pe)return d;function nt(Er,$r){e.syncOrAsync([Ft,Nt],{title:Er,subtitle:$r})}function Ft(Er){var $r=Er.title,Sr=Er.subtitle,Ur;!u&&Ae&&(u={}),u?(Ur="",u.rotate&&(Ur+="rotate("+[u.rotate,m.x,m.y]+")"),(u.offset||Ae)&&(Ur+=t(0,(u.offset||0)-(Ae||0)))):Ur=null,$r.attr("transform",Ur);function Mt(Ee){if(Ee){var Xe=h.select(Ee.node().parentNode).select("."+ut);if(!Xe.empty()){var Qe=Ee.node().getBBox();if(Qe.height){var Lt=Qe.y+Qe.height+f*ie;Xe.attr("y",Lt)}}}}if($r.style("opacity",y*o.opacity(R)).call(r.font,{color:o.rgb(R),size:h.round(B,2),family:N,weight:U,style:j,variant:Z,textcase:re,shadow:le,lineposition:fe}).attr(m).call(n.convertToTspans,v,Mt),Sr&&!Sr.empty()){var je=d.select("."+T+"-math-group"),Je=$r.node().getBBox(),ke=je.node()?je.node().getBBox():void 0,xe=ke?ke.y+ke.height+f*ie:Je.y+Je.height+c*ie,ye=e.extendFlat({},m,{y:xe});Sr.attr("transform",Ur),Sr.style("opacity",te*o.opacity(de)).call(r.font,{color:o.rgb(de),size:h.round(ie,2),family:ae,weight:Se,style:Le,variant:Fe,textcase:ze,shadow:st,lineposition:Ye}).attr(ye).call(n.convertToTspans,v)}return S.previousPromises(v)}function Nt(Er){var $r=Er.title,Sr=h.select($r.node().parentNode);if(w&&w.selection&&w.side&&L){Sr.attr("transform",null);var Ur=a[w.side],Mt=w.side==="left"||w.side==="top"?-1:1,je=b(w.pad)?w.pad:2,Je=r.bBox(Sr.node()),ke={t:0,b:0,l:0,r:0},xe=v._fullLayout._reservedMargin;for(var ye in xe)for(var Ee in xe[ye]){var Xe=xe[ye][Ee];ke[Ee]=Math.max(ke[Ee],Xe)}var Qe={left:ke.l,top:ke.t,right:g.width-ke.r,bottom:g.height-ke.b},Lt=w.maxShift||Mt*(Qe[w.side]-Je[w.side]),Ct=0;if(Lt<0)Ct=Lt;else{var Ot=w.offsetLeft||0,Kt=w.offsetTop||0;Je.left-=Ot,Je.right-=Ot,Je.top-=Kt,Je.bottom-=Kt,w.selection.each(function(){var mr=r.bBox(this);e.bBoxIntersect(Je,mr,je)&&(Ct=Math.max(Ct,Mt*(mr[w.side]-Je[Ur])+je))}),Ct=Math.min(Lt,Ct),x._titleScoot=Math.abs(Ct)}if(Ct>0||Lt<0){var xr={left:[-Ct,0],right:[Ct,0],top:[0,-Ct],bottom:[0,Ct]}[w.side];Sr.attr("transform",t(xr[0],xr[1]))}}}pe.call(nt,Ne);function Qt(Er,$r){Er.text($r).on("mouseover.opacity",function(){h.select(this).transition().duration(i.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){h.select(this).transition().duration(i.HIDE_PLACEHOLDER).style("opacity",0)})}if(at&&(L?pe.on(".opacity",null):(Qt(pe,M),z=!0),pe.call(n.makeEditable,{gd:v}).on("edit",function(Er){_!==void 0?E.call("_guiRestyle",v,A,Er,_):E.call("_guiRelayout",v,A,Er)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(nt)}).on("input",function(Er){this.text(Er||" ").call(n.positionText,m.x,m.y)}),V)){if(V&&!L){var ar=pe.node().getBBox(),kr=ar.y+ar.height+c*ie;Ne.attr("y",kr)}$?Ne.on(".opacity",null):(Qt(Ne,ee),ue=!0),Ne.call(n.makeEditable,{gd:v}).on("edit",function(Er){E.call("_guiRelayout",v,"title.subtitle.text",Er)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(nt)}).on("input",function(Er){this.text(Er||" ").call(n.positionText,Ne.attr("x"),Ne.attr("y"))})}return pe.classed("js-placeholder",z),Ne&&!Ne.empty()&&Ne.classed("js-placeholder",ue),d}G.exports={draw:p,SUBTITLE_PADDING_EM:c,SUBTITLE_PADDING_MATHJAX_EM:f}}}),rp=Ge({"src/plots/cartesian/set_convert.js"(K,G){var h=ki(),b=Bi().utcFormat,S=_n(),E=S.numberFormat,e=Ei(),t=S.cleanNumber,r=S.ms2DateTime,o=S.dateTime2ms,n=S.ensureNumber,i=S.isArrayOrTypedArray,a=Ii(),s=a.FP_SAFE,f=a.BADNUM,c=a.LOG_CLIP,p=a.ONEWEEK,v=a.ONEDAY,T=a.ONEHOUR,l=a.ONEMIN,g=a.ONESEC,x=Df(),A=sh(),M=A.HOUR_PATTERN,_=A.WEEKDAY_PATTERN;function w(u){return Math.pow(10,u)}function m(u){return u!=null}G.exports=function(d,y){y=y||{};var I=d._id||"x",L=I.charAt(0);function z($,ue){if($>0)return Math.log($)/Math.LN10;if($<=0&&ue&&d.range&&d.range.length===2){var te=d.range[0],H=d.range[1];return .5*(te+H-2*c*Math.abs(te-H))}else return f}function F($,ue,te,H){if((H||{}).msUTC&&e($))return+$;var ae=o($,te||d.calendar);if(ae===f)if(e($)){$=+$;var ie=Math.floor(S.mod($+.05,1)*10),de=Math.round($-ie/10);ae=o(new Date(de))+ie/10}else return f;return ae}function N($,ue,te){return r($,ue,te||d.calendar)}function B($){return d._categories[Math.round($)]}function R($){if(m($)){if(d._categoriesMap===void 0&&(d._categoriesMap={}),d._categoriesMap[$]!==void 0)return d._categoriesMap[$];d._categories.push(typeof $=="number"?String($):$);var ue=d._categories.length-1;return d._categoriesMap[$]=ue,ue}return f}function U($,ue){for(var te=new Array(ue),H=0;Hd.range[1]&&(te=!te);for(var H=te?-1:1,ae=H*$,ie=0,de=0;deLe)ie=de+1;else{ie=ae<(Se+Le)/2?de:de+1;break}}var Fe=d._B[ie]||0;return isFinite(Fe)?fe($,d._m2,Fe):0},V=function($){var ue=d._rangebreaks.length;if(!ue)return le($,d._m,d._b);for(var te=0,H=0;Hd._rangebreaks[H].pmax&&(te=H+1);return le($,d._m2,d._B[te])}}d.c2l=d.type==="log"?z:n,d.l2c=d.type==="log"?w:n,d.l2p=ce,d.p2l=V,d.c2p=d.type==="log"?function($,ue){return ce(z($,ue))}:ce,d.p2c=d.type==="log"?function($){return w(V($))}:V,["linear","-"].indexOf(d.type)!==-1?(d.d2r=d.r2d=d.d2c=d.r2c=d.d2l=d.r2l=t,d.c2d=d.c2r=d.l2d=d.l2r=n,d.d2p=d.r2p=function($){return d.l2p(t($))},d.p2d=d.p2r=V,d.cleanPos=n):d.type==="log"?(d.d2r=d.d2l=function($,ue){return z(t($),ue)},d.r2d=d.r2c=function($){return w(t($))},d.d2c=d.r2l=t,d.c2d=d.l2r=n,d.c2r=z,d.l2d=w,d.d2p=function($,ue){return d.l2p(d.d2r($,ue))},d.p2d=function($){return w(V($))},d.r2p=function($){return d.l2p(t($))},d.p2r=V,d.cleanPos=n):d.type==="date"?(d.d2r=d.r2d=S.identity,d.d2c=d.r2c=d.d2l=d.r2l=F,d.c2d=d.c2r=d.l2d=d.l2r=N,d.d2p=d.r2p=function($,ue,te){return d.l2p(F($,0,te))},d.p2d=d.p2r=function($,ue,te){return N(V($),ue,te)},d.cleanPos=function($){return S.cleanDate($,f,d.calendar)}):d.type==="category"?(d.d2c=d.d2l=R,d.r2d=d.c2d=d.l2d=B,d.d2r=d.d2l_noadd=Z,d.r2c=function($){var ue=re($);return ue!==void 0?ue:d.fraction2r(.5)},d.l2r=d.c2r=n,d.r2l=re,d.d2p=function($){return d.l2p(d.r2c($))},d.p2d=function($){return B(V($))},d.r2p=d.d2p,d.p2r=V,d.cleanPos=function($){return typeof $=="string"&&$!==""?$:n($)}):d.type==="multicategory"&&(d.r2d=d.c2d=d.l2d=B,d.d2r=d.d2l_noadd=Z,d.r2c=function($){var ue=Z($);return ue!==void 0?ue:d.fraction2r(.5)},d.r2c_just_indices=j,d.l2r=d.c2r=n,d.r2l=Z,d.d2p=function($){return d.l2p(d.r2c($))},d.p2d=function($){return B(V($))},d.r2p=d.d2p,d.p2r=V,d.cleanPos=function($){return Array.isArray($)||typeof $=="string"&&$!==""?$:n($)},d.setupMultiCategory=function($){var ue=d._traceIndices,te,H,ae=d._matchGroup;if(ae&&d._categories.length===0){for(var ie in ae)if(ie!==I){var de=y[x.id2name(ie)];ue=ue.concat(de._traceIndices)}}var Se=[[0,{}],[0,{}]],Le=[];for(te=0;tede[1]&&(H[ie?0:1]=te),H[0]===H[1]){var Se=d.l2r(ue),Le=d.l2r(te);if(ue!==void 0){var Fe=Se+1;te!==void 0&&(Fe=Math.min(Fe,Le)),H[ie?1:0]=Fe}if(te!==void 0){var ze=Le+1;ue!==void 0&&(ze=Math.max(ze,Se)),H[ie?0:1]=ze}}}},d.cleanRange=function($,ue){d._cleanRange($,ue),d.limitRange($)},d._cleanRange=function($,ue){ue||(ue={}),$||($="range");var te=S.nestedProperty(d,$).get(),H,ae;if(d.type==="date"?ae=S.dfltRange(d.calendar):L==="y"?ae=A.DFLTRANGEY:d._name==="realaxis"?ae=[0,1]:ae=ue.dfltRange||A.DFLTRANGEX,ae=ae.slice(),(d.rangemode==="tozero"||d.rangemode==="nonnegative")&&(ae[0]=0),!te||te.length!==2){S.nestedProperty(d,$).set(ae);return}var ie=te[0]===null,de=te[1]===null;for(d.type==="date"&&!d.autorange&&(te[0]=S.cleanDate(te[0],f,d.calendar),te[1]=S.cleanDate(te[1],f,d.calendar)),H=0;H<2;H++)if(d.type==="date"){if(!S.isDateTime(te[H],d.calendar)){d[$]=ae;break}if(d.r2l(te[0])===d.r2l(te[1])){var Se=S.constrain(d.r2l(te[0]),S.MIN_MS+1e3,S.MAX_MS-1e3);te[0]=d.l2r(Se-1e3),te[1]=d.l2r(Se+1e3);break}}else{if(!e(te[H]))if(!(ie||de)&&e(te[1-H]))te[H]=te[1-H]*(H?10:.1);else{d[$]=ae;break}if(te[H]<-s?te[H]=-s:te[H]>s&&(te[H]=s),te[0]===te[1]){var Le=Math.max(1,Math.abs(te[0]*1e-6));te[0]-=Le,te[1]+=Le}}},d.setScale=function($){var ue=y._size;if(d.overlaying){var te=x.getFromId({_fullLayout:y},d.overlaying);d.domain=te.domain}var H=$&&d._r?"_r":"range",ae=d.calendar;d.cleanRange(H);var ie=d.r2l(d[H][0],ae),de=d.r2l(d[H][1],ae),Se=L==="y";if(Se?(d._offset=ue.t+(1-d.domain[1])*ue.h,d._length=ue.h*(d.domain[1]-d.domain[0]),d._m=d._length/(ie-de),d._b=-d._m*de):(d._offset=ue.l+d.domain[0]*ue.w,d._length=ue.w*(d.domain[1]-d.domain[0]),d._m=d._length/(de-ie),d._b=-d._m*ie),d._rangebreaks=[],d._lBreaks=0,d._m2=0,d._B=[],d.rangebreaks){var Le,Fe;if(d._rangebreaks=d.locateBreaks(Math.min(ie,de),Math.max(ie,de)),d._rangebreaks.length){for(Le=0;Lede&&(ze=!ze),ze&&d._rangebreaks.reverse();var Ye=ze?-1:1;for(d._m2=Ye*d._length/(Math.abs(de-ie)-d._lBreaks),d._B.push(-d._m2*(Se?de:ie)),Le=0;Leae&&(ae+=7,ieae&&(ae+=24,ie=H&&ie=H&&$=nt.min&&(pent.max&&(nt.max=Ne),ut=!1)}ut&&de.push({min:pe,max:Ne})}};for(te=0;teg*2}function a(c){return Math.max(1,(c-1)/1e3)}function s(c,p){for(var v=c.length,T=a(v),l=0,g=0,x={},A=0;Al*2}function f(c){return E(c[0])&&E(c[1])}}}),Np=Ge({"src/plots/cartesian/autorange.js"(K,G){var h=ki(),b=Ei(),S=_n(),E=Ii().FP_SAFE,e=Ro(),t=As(),r=Df(),o=r.getFromId,n=r.isLinked;G.exports={applyAutorangeOptions:d,getAutoRange:i,makePadFn:s,doAutoRange:v,findExtremes:T,concatExtremes:p};function i(y,I){var L,z,F=[],N=y._fullLayout,B=s(N,I,0),R=s(N,I,1),U=p(y,I),j=U.min,Z=U.max;if(j.length===0||Z.length===0)return S.simpleMap(I.range,I.r2l);var re=j[0].val,fe=Z[0].val;for(L=1;L0&&(Le=ue-B(ae)-R(ie),Le>te?Fe/Le>H&&(de=ae,Se=ie,H=Fe/Le):Fe/ue>H&&(de={val:ae.val,nopad:1},Se={val:ie.val,nopad:1},H=Fe/ue));function ze(et,Pe){return Math.max(et,R(Pe))}if(re===fe){var Ye=re-1,st=re+1;if(ne)if(re===0)F=[0,1];else{var ct=(re>0?Z:j).reduce(ze,0),at=re/(1-Math.min(.5,ct/ue));F=re>0?[0,at]:[at,0]}else $?F=[Math.max(0,Ye),Math.max(1,st)]:F=[Ye,st]}else ne?(de.val>=0&&(de={val:0,nopad:1}),Se.val<=0&&(Se={val:0,nopad:1})):$&&(de.val-H*B(de)<0&&(de={val:0,nopad:1}),Se.val<=0&&(Se={val:1,nopad:1})),H=(Se.val-de.val-a(I,ae.val,ie.val))/(ue-B(de)-R(Se)),F=[de.val-H*B(de),Se.val+H*R(Se)];return F=d(F,I),I.limitRange&&I.limitRange(),ce&&F.reverse(),S.simpleMap(F,I.l2r||Number)}function a(y,I,L){var z=0;if(y.rangebreaks)for(var F=y.locateBreaks(I,L),N=0;N0?L.ppadplus:L.ppadminus)||L.ppad||0),ae=te((y._m>0?L.ppadminus:L.ppadplus)||L.ppad||0),ie=te(L.vpadplus||L.vpad),de=te(L.vpadminus||L.vpad);if(!j){if($=1/0,ue=-1/0,U)for(re=0;re0&&($=fe),fe>ue&&fe-E&&($=fe),fe>ue&&fe=Fe;re--)Le(re);return{min:z,max:F,opts:L}}function l(y,I,L,z){x(y,I,L,z,M)}function g(y,I,L,z){x(y,I,L,z,_)}function x(y,I,L,z,F){for(var N=z.tozero,B=z.extrapad,R=!0,U=0;U=L&&(j.extrapad||!B)){R=!1;break}else F(I,j.val)&&j.pad<=L&&(B||!j.extrapad)&&(y.splice(U,1),U--)}if(R){var Z=N&&I===0;y.push({val:I,pad:Z?0:L,extrapad:Z?!1:B})}}function A(y){return b(y)&&Math.abs(y)=I}function w(y,I){var L=I.autorangeoptions;return L&&L.minallowed!==void 0&&u(I,L.minallowed,L.maxallowed)?L.minallowed:L&&L.clipmin!==void 0&&u(I,L.clipmin,L.clipmax)?Math.max(y,I.d2l(L.clipmin)):y}function m(y,I){var L=I.autorangeoptions;return L&&L.maxallowed!==void 0&&u(I,L.minallowed,L.maxallowed)?L.maxallowed:L&&L.clipmax!==void 0&&u(I,L.clipmin,L.clipmax)?Math.min(y,I.d2l(L.clipmax)):y}function u(y,I,L){return I!==void 0&&L!==void 0?(I=y.d2l(I),L=y.d2l(L),I=U&&(N=U,L=U),B<=U&&(B=U,z=U)}}return L=w(L,I),z=m(z,I),[L,z]}}}),Ts=Ge({"src/plots/cartesian/axes.js"(K,G){var h=ki(),b=Ei(),S=ef(),E=Ro(),e=_n(),t=e.strTranslate,r=nc(),o=um(),n=go(),i=As(),a=id(),s=fx(),f=Ii(),c=f.ONEMAXYEAR,p=f.ONEAVGYEAR,v=f.ONEMINYEAR,T=f.ONEMAXQUARTER,l=f.ONEAVGQUARTER,g=f.ONEMINQUARTER,x=f.ONEMAXMONTH,A=f.ONEAVGMONTH,M=f.ONEMINMONTH,_=f.ONEWEEK,w=f.ONEDAY,m=w/2,u=f.ONEHOUR,d=f.ONEMIN,y=f.ONESEC,I=f.ONEMILLI,L=f.ONEMICROSEC,z=f.MINUS_SIGN,F=f.BADNUM,N={K:"zeroline"},B={K:"gridline",L:"path"},R={K:"minor-gridline",L:"path"},U={K:"tick",L:"path"},j={K:"tick",L:"text"},Z={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},re=ad(),fe=re.MID_SHIFT,le=re.CAP_SHIFT,ce=re.LINE_SPACING,V=re.OPPOSITE_SIDE,ee=3,ne=G.exports={};ne.setConvert=rp();var $=cm(),ue=Df(),te=ue.idSort,H=ue.isLinked;ne.id2name=ue.id2name,ne.name2id=ue.name2id,ne.cleanId=ue.cleanId,ne.list=ue.list,ne.listIds=ue.listIds,ne.getFromId=ue.getFromId,ne.getFromTrace=ue.getFromTrace;var ae=Np();ne.getAutoRange=ae.getAutoRange,ne.findExtremes=ae.findExtremes;var ie=1e-4;function de(Dt){var xt=(Dt[1]-Dt[0])*ie;return[Dt[0]-xt,Dt[1]+xt]}ne.coerceRef=function(Dt,xt,Cr,jr,Vr,Dr){var qr=jr.charAt(jr.length-1),un=Cr._fullLayout._subplots[qr+"axis"],Jr=jr+"ref",At={};return Vr||(Vr=un[0]||(typeof Dr=="string"?Dr:Dr[0])),Dr||(Dr=Vr),un=un.concat(un.map(function(lr){return lr+" domain"})),At[Jr]={valType:"enumerated",values:un.concat(Dr?typeof Dr=="string"?[Dr]:Dr:[]),dflt:Vr},e.coerce(Dt,xt,At,Jr)},ne.getRefType=function(Dt){return Dt===void 0?Dt:Dt==="paper"?"paper":Dt==="pixel"?"pixel":/( domain)$/.test(Dt)?"domain":"range"},ne.coercePosition=function(Dt,xt,Cr,jr,Vr,Dr){var qr,un,Jr=ne.getRefType(jr);if(Jr!=="range")qr=e.ensureNumber,un=Cr(Vr,Dr);else{var At=ne.getFromId(xt,jr);Dr=At.fraction2r(Dr),un=Cr(Vr,Dr),qr=At.cleanPos}Dt[Vr]=qr(un)},ne.cleanPosition=function(Dt,xt,Cr){var jr=Cr==="paper"||Cr==="pixel"?e.ensureNumber:ne.getFromId(xt,Cr).cleanPos;return jr(Dt)},ne.redrawComponents=function(Dt,xt){xt=xt||ne.listIds(Dt);var Cr=Dt._fullLayout;function jr(Vr,Dr,qr,un){for(var Jr=E.getComponentMethod(Vr,Dr),At={},lr=0;lr2e-6||((Cr-Dt._forceTick0)/Dt._minDtick%1+1.000001)%1>2e-6)&&(Dt._minDtick=0))},ne.saveRangeInitial=function(Dt,xt){for(var Cr=ne.list(Dt,"",!0),jr=!1,Vr=0;Vrzr*.3||At(jr)||At(Vr))){var cn=Cr.dtick/2;Dt+=Dt+cnqr){var un=Number(Cr.slice(1));Dr.exactYears>qr&&un%12===0?Dt=ne.tickIncrement(Dt,"M6","reverse")+w*1.5:Dr.exactMonths>qr?Dt=ne.tickIncrement(Dt,"M1","reverse")+w*15.5:Dt-=m;var Jr=ne.tickIncrement(Dt,Cr);if(Jr<=jr)return Jr}return Dt}ne.prepMinorTicks=function(Dt,xt,Cr){if(!xt.minor.dtick){delete Dt.dtick;var jr=xt.dtick&&b(xt._tmin),Vr;if(jr){var Dr=ne.tickIncrement(xt._tmin,xt.dtick,!0);Vr=[xt._tmin,Dr*.99+xt._tmin*.01]}else{var qr=e.simpleMap(xt.range,xt.r2l);Vr=[qr[0],.8*qr[0]+.2*qr[1]]}if(Dt.range=e.simpleMap(Vr,xt.l2r),Dt._isMinor=!0,ne.prepTicks(Dt,Cr),jr){var un=b(xt.dtick),Jr=b(Dt.dtick),At=un?xt.dtick:+xt.dtick.substring(1),lr=Jr?Dt.dtick:+Dt.dtick.substring(1);un&&Jr?st(At,lr)?At===2*_&&lr===2*w&&(Dt.dtick=_):At===2*_&&lr===3*w?Dt.dtick=_:At===_&&!(xt._input.minor||{}).nticks?Dt.dtick=w:ct(At/lr,2.5)?Dt.dtick=At/2:Dt.dtick=At:String(xt.dtick).charAt(0)==="M"?Jr?Dt.dtick="M1":st(At,lr)?At>=12&&lr===2&&(Dt.dtick="M3"):Dt.dtick=xt.dtick:String(Dt.dtick).charAt(0)==="L"?String(xt.dtick).charAt(0)==="L"?st(At,lr)||(Dt.dtick=ct(At/lr,2.5)?xt.dtick/2:xt.dtick):Dt.dtick="D1":Dt.dtick==="D2"&&+xt.dtick>1&&(Dt.dtick=1)}Dt.range=xt.range}xt.minor._tick0Init===void 0&&(Dt.tick0=xt.tick0)};function st(Dt,xt){return Math.abs((Dt/xt+.5)%1-.5)<.001}function ct(Dt,xt){return Math.abs(Dt/xt-1)<.001}ne.prepTicks=function(Dt,xt){var Cr=e.simpleMap(Dt.range,Dt.r2l,void 0,void 0,xt);if(Dt.tickmode==="auto"||!Dt.dtick){var jr=Dt.nticks,Vr;jr||(Dt.type==="category"||Dt.type==="multicategory"?(Vr=Dt.tickfont?e.bigFont(Dt.tickfont.size||12):15,jr=Dt._length/Vr):(Vr=Dt._id.charAt(0)==="y"?40:80,jr=e.constrain(Dt._length/Vr,4,9)+1),Dt._name==="radialaxis"&&(jr*=2)),Dt.minor&&Dt.minor.tickmode!=="array"||Dt.tickmode==="array"&&(jr*=100),Dt._roughDTick=Math.abs(Cr[1]-Cr[0])/jr,ne.autoTicks(Dt,Dt._roughDTick),Dt._minDtick>0&&Dt.dtick0?(Dr=jr-1,qr=jr):(Dr=jr,qr=jr);var un=Dt[Dr].value,Jr=Dt[qr].value,At=Math.abs(Jr-un),lr=Cr||At,zr=0;lr>=v?At>=v&&At<=c?zr=At:zr=p:Cr===l&&lr>=g?At>=g&&At<=T?zr=At:zr=l:lr>=M?At>=M&&At<=x?zr=At:zr=A:Cr===_&&lr>=_?zr=_:lr>=w?zr=w:Cr===m&&lr>=m?zr=m:Cr===u&&lr>=u&&(zr=u);var cn;zr>=At&&(zr=At,cn=!0);var Rn=Vr+zr;if(xt.rangebreaks&&zr>0){for(var qn=84,jn=0,fn=0;fn_&&(zr=At)}(zr>0||jr===0)&&(Dt[jr].periodX=Vr+zr/2)}}ne.calcTicks=function(xt,Cr){for(var jr=xt.type,Vr=xt.calendar,Dr=xt.ticklabelstep,qr=xt.ticklabelmode==="period",un=xt.range[0]>xt.range[1],Jr=!xt.ticklabelindex||e.isArrayOrTypedArray(xt.ticklabelindex)?xt.ticklabelindex:[xt.ticklabelindex],At=e.simpleMap(xt.range,xt.r2l,void 0,void 0,Cr),lr=At[1]=(Ea?0:1);Ci--){var Xi=!Ci;Ci?(xt._dtickInit=xt.dtick,xt._tick0Init=xt.tick0):(xt.minor._dtickInit=xt.minor.dtick,xt.minor._tick0Init=xt.minor.tick0);var so=Ci?xt:e.extendFlat({},xt,xt.minor);if(Xi?ne.prepMinorTicks(so,xt,Cr):ne.prepTicks(so,Cr),so.tickmode==="array"){Ci?(fn=[],qn=Ne(xt,!Xi)):(In=[],jn=Ne(xt,!Xi));continue}if(so.tickmode==="sync"){fn=[],qn=pe(xt);continue}var io=de(At),Mo=io[0],ui=io[1],ts=b(so.dtick),Ho=jr==="log"&&!(ts||so.dtick.charAt(0)==="L"),Xs=ne.tickFirst(so,Cr);if(Ci){if(xt._tmin=Xs,Xs=ui:Jo<=ui;Jo=ne.tickIncrement(Jo,Vs,lr,Vr)){if(Ci&&Uo++,so.rangebreaks&&!lr){if(Jo=cn)break}if(fn.length>Rn||Jo===cs)break;cs=Jo;var ll={value:Jo};Ci?(Ho&&Jo!==(Jo|0)&&(ll.simpleLabel=!0),Dr>1&&Uo%Dr&&(ll.skipLabel=!0),fn.push(ll)):(ll.minor=!0,In.push(ll))}}if(!In||In.length<2)Jr=!1;else{var fs=(In[1].value-In[0].value)*(un?-1:1);Si(fs,xt.tickformat)||(Jr=!1)}if(!Jr)gi=fn;else{var Zo=fn.concat(In);qr&&fn.length&&(Zo=Zo.slice(1)),Zo=Zo.sort(function(Io,cu){return Io.value-cu.value}).filter(function(Io,cu,vu){return cu===0||Io.value!==vu[cu-1].value});var po=Zo.map(function(Io,cu){return Io.minor===void 0&&!Io.skipLabel?cu:null}).filter(function(Io){return Io!==null});po.forEach(function(Io){Jr.map(function(cu){var vu=Io+cu;vu>=0&&vu-1;Ps--){if(fn[Ps].drop){fn.splice(Ps,1);continue}fn[Ps].value=ha(fn[Ps].value,xt);var cl=xt.c2p(fn[Ps].value);(Fo?Zs>cl-Il:Zscn||Oscn&&(vu.periodX=cn),OsVr&&cnp)xt/=p,jr=Vr(10),Dt.dtick="M"+12*kr(xt,jr,ut);else if(Dr>A)xt/=A,Dt.dtick="M"+kr(xt,1,dt);else if(Dr>w){if(Dt.dtick=kr(xt,w,Dt._hasDayOfWeekBreaks?[1,2,7,14]:Ft),!Cr){var qr=ne.getTickFormat(Dt),un=Dt.ticklabelmode==="period";un&&(Dt._rawTick0=Dt.tick0),/%[uVW]/.test(qr)?Dt.tick0=e.dateTick0(Dt.calendar,2):Dt.tick0=e.dateTick0(Dt.calendar,1),un&&(Dt._dowTick0=Dt.tick0)}}else Dr>u?Dt.dtick=kr(xt,u,dt):Dr>d?Dt.dtick=kr(xt,d,nt):Dr>y?Dt.dtick=kr(xt,y,nt):(jr=Vr(10),Dt.dtick=kr(xt,jr,ut))}else if(Dt.type==="log"){Dt.tick0=0;var Jr=e.simpleMap(Dt.range,Dt.r2l);if(Dt._isMinor&&(xt*=1.5),xt>.7)Dt.dtick=Math.ceil(xt);else if(Math.abs(Jr[1]-Jr[0])<1){var At=1.5*Math.abs((Jr[1]-Jr[0])/xt);xt=Math.abs(Math.pow(10,Jr[1])-Math.pow(10,Jr[0]))/At,jr=Vr(10),Dt.dtick="L"+kr(xt,jr,ut)}else Dt.dtick=xt>.3?"D2":"D1"}else Dt.type==="category"||Dt.type==="multicategory"?(Dt.tick0=0,Dt.dtick=Math.ceil(Math.max(xt,1))):pa(Dt)?(Dt.tick0=0,jr=1,Dt.dtick=kr(xt,jr,ar)):(Dt.tick0=0,jr=Vr(10),Dt.dtick=kr(xt,jr,ut));if(Dt.dtick===0&&(Dt.dtick=1),!b(Dt.dtick)&&typeof Dt.dtick!="string"){var lr=Dt.dtick;throw Dt.dtick=1,"ax.dtick error: "+String(lr)}};function Er(Dt){var xt=Dt.dtick;if(Dt._tickexponent=0,!b(xt)&&typeof xt!="string"&&(xt=1),(Dt.type==="category"||Dt.type==="multicategory")&&(Dt._tickround=null),Dt.type==="date"){var Cr=Dt.r2l(Dt.tick0),jr=Dt.l2r(Cr).replace(/(^-|i)/g,""),Vr=jr.length;if(String(xt).charAt(0)==="M")Vr>10||jr.slice(5)!=="01-01"?Dt._tickround="d":Dt._tickround=+xt.slice(1)%12===0?"y":"m";else if(xt>=w&&Vr<=10||xt>=w*15)Dt._tickround="d";else if(xt>=d&&Vr<=16||xt>=u)Dt._tickround="M";else if(xt>=y&&Vr<=19||xt>=d)Dt._tickround="S";else{var Dr=Dt.l2r(Cr+xt).replace(/^-/,"").length;Dt._tickround=Math.max(Vr,Dr)-20,Dt._tickround<0&&(Dt._tickround=4)}}else if(b(xt)||xt.charAt(0)==="L"){var qr=Dt.range.map(Dt.r2d||Number);b(xt)||(xt=Number(xt.slice(1))),Dt._tickround=2-Math.floor(Math.log(xt)/Math.LN10+.01);var un=Math.max(Math.abs(qr[0]),Math.abs(qr[1])),Jr=Math.floor(Math.log(un)/Math.LN10+.01),At=Dt.minexponent===void 0?3:Dt.minexponent;Math.abs(Jr)>At&&(Xe(Dt.exponentformat)&&Dt.exponentformat!=="SI extended"&&!Qe(Jr)||Xe(Dt.exponentformat)&&Dt.exponentformat==="SI extended"&&!Lt(Jr)?Dt._tickexponent=3*Math.round((Jr-1)/3):Dt._tickexponent=Jr)}else Dt._tickround=null}ne.tickIncrement=function(Dt,xt,Cr,jr){var Vr=Cr?-1:1;if(b(xt))return e.increment(Dt,Vr*xt);var Dr=xt.charAt(0),qr=Vr*Number(xt.slice(1));if(Dr==="M")return e.incrementMonth(Dt,qr,jr);if(Dr==="L")return Math.log(Math.pow(10,Dt)+qr)/Math.LN10;if(Dr==="D"){var un=xt==="D2"?Qt:Nt,Jr=Dt+Vr*.01,At=e.roundUp(e.mod(Jr,1),un,Cr);return Math.floor(Jr)+Math.log(h.round(Math.pow(10,At),1))/Math.LN10}throw"unrecognized dtick "+String(xt)},ne.tickFirst=function(Dt,xt){var Cr=Dt.r2l||Number,jr=e.simpleMap(Dt.range,Cr,void 0,void 0,xt),Vr=jr[1]=0&&In<=Dt._length?fn:null};if(Dr&&e.isArrayOrTypedArray(Dt.ticktext)){var zr=e.simpleMap(Dt.range,Dt.r2l),cn=(Math.abs(zr[1]-zr[0])-(Dt._lBreaks||0))/1e4;for(At=0;At"+un;else{var At=_a(Dt),lr=Dt._trueSide||Dt.side;(!At&&lr==="top"||At&&lr==="bottom")&&(qr+="
")}xt.text=qr}function Ur(Dt,xt,Cr,jr,Vr){var Dr=Dt.dtick,qr=xt.x,un=Dt.tickformat,Jr=typeof Dr=="string"&&Dr.charAt(0);if(Vr==="never"&&(Vr=""),jr&&Jr!=="L"&&(Dr="L3",Jr="L"),un||Jr==="L")xt.text=Ot(Math.pow(10,qr),Dt,Vr,jr);else if(b(Dr)||Jr==="D"&&(Dt.minorloglabels==="complete"||e.mod(qr+.01,1)<.1)){Dt.minorloglabels==="complete"&&!(e.mod(qr+.01,1)<.1)&&(xt.fontSize*=.75);var At=Math.pow(10,qr).toExponential(0),lr=At.split("e"),zr=+lr[1],cn=Math.abs(zr),Rn=Dt.exponentformat;Rn==="power"||Xe(Rn)&&Rn!=="SI extended"&&Qe(zr)||Xe(Rn)&&Rn==="SI extended"&&Lt(zr)?(xt.text=lr[0],cn>0&&(xt.text+="x10"),xt.text==="1x10"&&(xt.text="10"),zr!==0&&zr!==1&&(xt.text+=""+(zr>0?"":z)+cn+""),xt.fontSize*=1.25):(Rn==="e"||Rn==="E")&&cn>2?xt.text=lr[0]+Rn+(zr>0?"+":z)+cn:(xt.text=Ot(Math.pow(10,qr),Dt,"","fakehover"),Dr==="D1"&&Dt._id.charAt(0)==="y"&&(xt.dy-=xt.fontSize/6))}else if(Jr==="D")xt.text=Dt.minorloglabels==="none"?"":String(Math.round(Math.pow(10,e.mod(qr,1)))),xt.fontSize*=.75;else throw"unrecognized dtick "+String(Dr);if(Dt.dtick==="D1"){var qn=String(xt.text).charAt(0);(qn==="0"||qn==="1")&&(Dt._id.charAt(0)==="y"?xt.dx-=xt.fontSize/4:(xt.dy+=xt.fontSize/2,xt.dx+=(Dt.range[1]>Dt.range[0]?1:-1)*xt.fontSize*(qr<0?.5:.25)))}}function Mt(Dt,xt){var Cr=Dt._categories[Math.round(xt.x)];Cr===void 0&&(Cr=""),xt.text=String(Cr)}function je(Dt,xt,Cr){var jr=Math.round(xt.x),Vr=Dt._categories[jr]||[],Dr=Vr[1]===void 0?"":String(Vr[1]),qr=Vr[0]===void 0?"":String(Vr[0]);Cr?xt.text=qr+" - "+Dr:(xt.text=Dr,xt.text2=qr)}function Je(Dt,xt,Cr,jr,Vr){Vr==="never"?Vr="":Dt.showexponent==="all"&&Math.abs(xt.x/Dt.dtick)<1e-6&&(Vr="hide"),xt.text=Ot(xt.x,Dt,Vr,jr)}function ke(Dt,xt,Cr,jr,Vr){if(Dt.thetaunit==="radians"&&!Cr){var Dr=xt.x/180;if(Dr===0)xt.text="0";else{var qr=xe(Dr);if(qr[1]>=100)xt.text=Ot(e.deg2rad(xt.x),Dt,Vr,jr);else{var un=xt.x<0;qr[1]===1?qr[0]===1?xt.text="π":xt.text=qr[0]+"π":xt.text=["",qr[0],"","⁄","",qr[1],"","π"].join(""),un&&(xt.text=z+xt.text)}}}else xt.text=Ot(xt.x,Dt,Vr,jr)}function xe(Dt){function xt(un,Jr){return Math.abs(un-Jr)<=1e-6}function Cr(un,Jr){return xt(Jr,0)?un:Cr(Jr,un%Jr)}function jr(un){for(var Jr=1;!xt(Math.round(un*Jr)/Jr,un);)Jr*=10;return Jr}var Vr=jr(Dt),Dr=Dt*Vr,qr=Math.abs(Cr(Dr,Vr));return[Math.round(Dr/qr),Math.round(Vr/qr)]}var ye=["f","p","n","μ","m","","k","M","G","T"],Ee=["q","r","y","z","a",...ye,"P","E","Z","Y","R","Q"],Xe=Dt=>["SI","SI extended","B"].includes(Dt);function Qe(Dt){return Dt>14||Dt<-15}function Lt(Dt){return Dt>32||Dt<-30}function Ct(Dt,xt){return Xe(xt)?!!(xt==="SI extended"&&Lt(Dt)||xt!=="SI extended"&&Qe(Dt)):!1}function Ot(Dt,xt,Cr,jr){var Vr=Dt<0,Dr=xt._tickround,qr=Cr||xt.exponentformat||"B",un=xt._tickexponent,Jr=ne.getTickFormat(xt),At=xt.separatethousands;if(jr){var lr={exponentformat:qr,minexponent:xt.minexponent,dtick:xt.showexponent==="none"?xt.dtick:b(Dt)&&Math.abs(Dt)||1,range:xt.showexponent==="none"?xt.range.map(xt.r2d):[0,Dt||1]};Er(lr),Dr=(Number(lr._tickround)||0)+4,un=lr._tickexponent,xt.hoverformat&&(Jr=xt.hoverformat)}if(Jr)return xt._numFormat(Jr)(Dt).replace(/-/g,z);var zr=Math.pow(10,-Dr)/2;if(qr==="none"&&(un=0),Dt=Math.abs(Dt),Dt"+qn+"":qr==="B"&&un===9?Dt+="B":Xe(qr)&&(Dt+=qr==="SI extended"?Ee[un/3+10]:ye[un/3+5])}return Vr?z+Dt:Dt}ne.getTickFormat=function(Dt){var xt;function Cr(Jr){return typeof Jr!="string"?Jr:Number(Jr.replace("M",""))*A}function jr(Jr,At){var lr=["L","D"];if(typeof Jr==typeof At){if(typeof Jr=="number")return Jr-At;var zr=lr.indexOf(Jr.charAt(0)),cn=lr.indexOf(At.charAt(0));return zr===cn?Number(Jr.replace(/(L|D)/g,""))-Number(At.replace(/(L|D)/g,"")):zr-cn}else return typeof Jr=="number"?1:-1}function Vr(Jr,At,lr){var zr=lr||function(qn){return qn},cn=At[0],Rn=At[1];return(!cn&&typeof cn!="number"||zr(cn)<=zr(Jr))&&(!Rn&&typeof Rn!="number"||zr(Rn)>=zr(Jr))}function Dr(Jr,At){var lr=At[0]===null,zr=At[1]===null,cn=jr(Jr,At[0])>=0,Rn=jr(Jr,At[1])<=0;return(lr||cn)&&(zr||Rn)}var qr,un;if(Dt.tickformatstops&&Dt.tickformatstops.length>0)switch(Dt.type){case"date":case"linear":{for(xt=0;xt=0&&Vr.unshift(Vr.splice(lr,1).shift())}});var un={false:{left:0,right:0}};return e.syncOrAsync(Vr.map(function(Jr){return function(){if(Jr){var At=ne.getFromId(Dt,Jr);Cr||(Cr={}),Cr.axShifts=un,Cr.overlayingShiftedAx=qr;var lr=ne.drawOne(Dt,At,Cr);return At._shiftPusher&&Hn(At,At._fullDepth||0,un,!0),At._r=At.range.slice(),At._rl=e.simpleMap(At._r,At.r2l),lr}}}))},ne.drawOne=function(Dt,xt,Cr){Cr=Cr||{};var jr=Cr.axShifts||{},Vr=Cr.overlayingShiftedAx||[],Dr,qr,un;xt.setScale();var Jr=Dt._fullLayout,At=xt._id,lr=At.charAt(0),zr=ne.counterLetter(At),cn=Jr._plots[xt._mainSubplot],Rn=xt.zerolinelayer==="above traces";if(!cn)return;if(xt._shiftPusher=xt.autoshift||Vr.indexOf(xt._id)!==-1||Vr.indexOf(xt.overlaying)!==-1,xt._shiftPusher&xt.anchor==="free"){var qn=xt.linewidth/2||0;xt.ticks==="inside"&&(qn+=xt.ticklen),Hn(xt,qn,jr,!0),Hn(xt,xt.shift||0,jr,!1)}(Cr.skipTitle!==!0||xt._shift===void 0)&&(xt._shift=pi(xt,jr));var jn=cn[lr+"axislayer"],fn=xt._mainLinePosition,In=fn+=xt._shift,gi=xt._mainMirrorPosition,Ea=xt._vals=ne.calcTicks(xt),Ci=[xt.mirror,In,gi].join("_");for(Dr=0;Dr0?Os.bottom-cu:0,vu))));var Zu=0,df=0;if(xt._shiftPusher&&(Zu=Math.max(vu,Os.height>0?Yl==="l"?cu-Os.left:Os.right-cu:0),xt.title.text!==Jr._dfltTitle[lr]&&(df=(xt._titleStandoff||0)+(xt._titleScoot||0),Yl==="l"&&(df+=na(xt))),xt._fullDepth=Math.max(Zu,df)),xt.automargin){wl={x:0,y:0,r:0,l:0,t:0,b:0};var Xc=[0,1],rf=typeof xt._shift=="number"?xt._shift:0;if(lr==="x"){if(Yl==="b"?wl[Yl]=xt._depth:(wl[Yl]=xt._depth=Math.max(Os.width>0?cu-Os.top:0,vu),Xc.reverse()),Os.width>0){var Dh=Os.right-(xt._offset+xt._length);Dh>0&&(wl.xr=1,wl.r=Dh);var wh=xt._offset-Os.left;wh>0&&(wl.xl=0,wl.l=wh)}}else if(Yl==="l"?(xt._depth=Math.max(Os.height>0?cu-Os.left:0,vu),wl[Yl]=xt._depth-rf):(xt._depth=Math.max(Os.height>0?Os.right-cu:0,vu),wl[Yl]=xt._depth+rf,Xc.reverse()),Os.height>0){var Tl=Os.bottom-(xt._offset+xt._length);Tl>0&&(wl.yb=0,wl.b=Tl);var Dc=xt._offset-Os.top;Dc>0&&(wl.yt=1,wl.t=Dc)}wl[zr]=xt.anchor==="free"?xt.position:xt._anchorAxis.domain[Xc[0]],xt.title.text!==Jr._dfltTitle[lr]&&(wl[Yl]+=na(xt)+(xt.title.standoff||0)),xt.mirror&&xt.anchor!=="free"&&(Nl={x:0,y:0,r:0,l:0,t:0,b:0},Nl[Io]=xt.linewidth,xt.mirror&&xt.mirror!==!0&&(Nl[Io]+=vu),xt.mirror===!0||xt.mirror==="ticks"?Nl[zr]=xt._anchorAxis.domain[Xc[1]]:(xt.mirror==="all"||xt.mirror==="allticks")&&(Nl[zr]=[xt._counterDomainMin,xt._counterDomainMax][Xc[1]]))}Xl&&(Vl=E.getComponentMethod("rangeslider","autoMarginOpts")(Dt,xt)),typeof xt.automargin=="string"&&(Kt(wl,xt.automargin),Kt(Nl,xt.automargin)),S.autoMargin(Dt,or(xt),wl),S.autoMargin(Dt,ur(xt),Nl),S.autoMargin(Dt,Gr(xt),Vl)}),e.syncOrAsync(gs)}};function Kt(Dt,xt){if(Dt){var Cr=Object.keys(Z).reduce(function(jr,Vr){return xt.indexOf(Vr)!==-1&&Z[Vr].forEach(function(Dr){jr[Dr]=1}),jr},{});Object.keys(Dt).forEach(function(jr){Cr[jr]||(jr.length===1?Dt[jr]=0:delete Dt[jr])})}}function xr(Dt,xt){var Cr=[],jr,Vr=function(Dr,qr){var un=Dr.xbnd[qr];un!==null&&Cr.push(e.extendFlat({},Dr,{x:un}))};if(xt.length){for(jr=0;jrDt.range[1],un=Dt.ticklabelposition&&Dt.ticklabelposition.indexOf("inside")!==-1,Jr=!un;if(Cr){var At=qr?-1:1;Cr=Cr*At}if(jr){var lr=Dt.side,zr=un&&(lr==="top"||lr==="left")||Jr&&(lr==="bottom"||lr==="right")?1:-1;jr=jr*zr}return Dt._id.charAt(0)==="x"?function(cn){return t(Vr+Dt._offset+Dt.l2p(kn(cn))+Cr,Dr+jr)}:function(cn){return t(Dr+jr,Vr+Dt._offset+Dt.l2p(kn(cn))+Cr)}};function kn(Dt){return Dt.periodX!==void 0?Dt.periodX:Dt.x}function $n(Dt){var xt=Dt.ticklabelposition||"",Cr=Dt.tickson||"",jr=function(qn){return xt.indexOf(qn)!==-1},Vr=jr("top"),Dr=jr("left"),qr=jr("right"),un=jr("bottom"),Jr=jr("inside"),At=Cr!=="boundaries"&&(un||Dr||Vr||qr);if(!At&&!Jr)return[0,0];var lr=Dt.side,zr=At?(Dt.tickwidth||0)/2:0,cn=ee,Rn=Dt.tickfont?Dt.tickfont.size:12;return(un||Vr)&&(zr+=Rn*le,cn+=(Dt.linewidth||0)/2),(Dr||qr)&&(zr+=(Dt.linewidth||0)/2,cn+=ee),Jr&&lr==="top"&&(cn-=Rn*(1-le)),(Dr||Vr)&&(zr=-zr),(lr==="bottom"||lr==="right")&&(cn=-cn),[At?zr:0,Jr?cn:0]}ne.makeTickPath=function(Dt,xt,Cr,jr){jr||(jr={});var Vr=jr.minor;if(Vr&&!Dt.minor)return"";var Dr=jr.len!==void 0?jr.len:Vr?Dt.minor.ticklen:Dt.ticklen,qr=Dt._id.charAt(0),un=(Dt.linewidth||1)/2;return qr==="x"?"M0,"+(xt+un*Cr)+"v"+Dr*Cr:"M"+(xt+un*Cr)+",0h"+Dr*Cr},ne.makeLabelFns=function(Dt,xt,Cr){var jr=Dt.ticklabelposition||"",Vr=Dt.tickson||"",Dr=function(cs){return jr.indexOf(cs)!==-1},qr=Dr("top"),un=Dr("left"),Jr=Dr("right"),At=Dr("bottom"),lr=Vr!=="boundaries"&&(At||un||qr||Jr),zr=Dr("inside"),cn=jr==="inside"&&Dt.ticks==="inside"||!zr&&Dt.ticks==="outside"&&Vr!=="boundaries",Rn=0,qn=0,jn=cn?Dt.ticklen:0;if(zr?jn*=-1:lr&&(jn=0),cn&&(Rn+=jn,Cr)){var fn=e.deg2rad(Cr);Rn=jn*Math.cos(fn)+1,qn=jn*Math.sin(fn)}Dt.showticklabels&&(cn||Dt.showline)&&(Rn+=.2*Dt.tickfont.size),Rn+=(Dt.linewidth||1)/2*(zr?-1:1);var In={labelStandoff:Rn,labelShift:qn},gi,Ea,Ci,Xi,so=0,io=Dt.side,Mo=Dt._id.charAt(0),ui=Dt.tickangle,ts;if(Mo==="x")ts=!zr&&io==="bottom"||zr&&io==="top",Xi=ts?1:-1,zr&&(Xi*=-1),gi=qn*Xi,Ea=xt+Rn*Xi,Ci=ts?1:-.2,Math.abs(ui)===90&&(zr?Ci+=fe:ui===-90&&io==="bottom"?Ci=le:ui===90&&io==="top"?Ci=fe:Ci=.5,so=fe/2*(ui/90)),In.xFn=function(cs){return cs.dx+gi+so*cs.fontSize},In.yFn=function(cs){return cs.dy+Ea+cs.fontSize*Ci},In.anchorFn=function(cs,Jo){if(lr){if(un)return"end";if(Jr)return"start"}return!b(Jo)||Jo===0||Jo===180?"middle":Jo*Xi<0!==zr?"end":"start"},In.heightFn=function(cs,Jo,Uo){return Jo<-60||Jo>60?-.5*Uo:Dt.side==="top"!==zr?-Uo:0};else if(Mo==="y"){if(ts=!zr&&io==="left"||zr&&io==="right",Xi=ts?1:-1,zr&&(Xi*=-1),gi=Rn,Ea=qn*Xi,Ci=0,!zr&&Math.abs(ui)===90&&(ui===-90&&io==="left"||ui===90&&io==="right"?Ci=le:Ci=.5),zr){var Ho=b(ui)?+ui:0;if(Ho!==0){var Xs=e.deg2rad(Ho);so=Math.abs(Math.sin(Xs))*le*Xi,Ci=0}}In.xFn=function(cs){return cs.dx+xt-(gi+cs.fontSize*Ci)*Xi+so*cs.fontSize},In.yFn=function(cs){return cs.dy+Ea+cs.fontSize*fe},In.anchorFn=function(cs,Jo){return b(Jo)&&Math.abs(Jo)===90?"middle":ts?"end":"start"},In.heightFn=function(cs,Jo,Uo){return Dt.side==="right"&&(Jo*=-1),Jo<-30?-Uo:Jo<30?-.5*Uo:0}}return In};function Vn(Dt){return[Dt.text,Dt.x,Dt.axInfo,Dt.font,Dt.fontSize,Dt.fontColor].join("_")}ne.drawTicks=function(Dt,xt,Cr){Cr=Cr||{};var jr=xt._id+"tick",Vr=[].concat(xt.minor&&xt.minor.ticks?Cr.vals.filter(function(qr){return qr.minor&&!qr.noTick}):[]).concat(xt.ticks?Cr.vals.filter(function(qr){return!qr.minor&&!qr.noTick}):[]),Dr=Cr.layer.selectAll("path."+jr).data(Vr,Vn);Dr.exit().remove(),Dr.enter().append("path").classed(jr,1).classed("ticks",1).classed("crisp",Cr.crisp!==!1).each(function(qr){return n.stroke(h.select(this),qr.minor?xt.minor.tickcolor:xt.tickcolor)}).style("stroke-width",function(qr){return i.crispRound(Dt,qr.minor?xt.minor.tickwidth:xt.tickwidth,1)+"px"}).attr("d",Cr.path).style("display",null),Ca(xt,[U]),Dr.attr("transform",Cr.transFn)},ne.drawGrid=function(Dt,xt,Cr){if(Cr=Cr||{},xt.tickmode!=="sync"){var jr=xt._id+"grid",Vr=xt.minor&&xt.minor.showgrid,Dr=Vr?Cr.vals.filter(function(In){return In.minor}):[],qr=xt.showgrid?Cr.vals.filter(function(In){return!In.minor}):[],un=Cr.counterAxis;if(un&&ne.shouldShowZeroLine(Dt,xt,un))for(var Jr=xt.tickmode==="array",At=0;At=0;qn--){var jn=qn?cn:Rn;if(jn){var fn=jn.selectAll("path."+jr).data(qn?qr:Dr,Vn);fn.exit().remove(),fn.enter().append("path").classed(jr,1).classed("crisp",Cr.crisp!==!1),fn.attr("transform",Cr.transFn).attr("d",Cr.path).each(function(In){return n.stroke(h.select(this),In.minor?xt.minor.gridcolor:xt.gridcolor||"#ddd")}).style("stroke-dasharray",function(In){return i.dashStyle(In.minor?xt.minor.griddash:xt.griddash,In.minor?xt.minor.gridwidth:xt.gridwidth)}).style("stroke-width",function(In){return(In.minor?zr:xt._gw)+"px"}).style("display",null),typeof Cr.path=="function"&&fn.attr("d",Cr.path)}}Ca(xt,[B,R])}},ne.drawZeroLine=function(Dt,xt,Cr){Cr=Cr||Cr;var jr=xt._id+"zl",Vr=ne.shouldShowZeroLine(Dt,xt,Cr.counterAxis),Dr=Cr.layer.selectAll("path."+jr).data(Vr?[{x:0,id:xt._id}]:[]);Dr.exit().remove(),Dr.enter().append("path").classed(jr,1).classed("zl",1).classed("crisp",Cr.crisp!==!1).each(function(){Cr.layer.selectAll("path").sort(function(qr,un){return te(qr.id,un.id)})}),Dr.attr("transform",Cr.transFn).attr("d",Cr.path).call(n.stroke,xt.zerolinecolor||n.defaultLine).style("stroke-width",i.crispRound(Dt,xt.zerolinewidth,xt._gw||1)+"px").style("display",null),Ca(xt,[N])},ne.drawLabels=function(Dt,xt,Cr){Cr=Cr||{};var jr=Dt._fullLayout,Vr=xt._id,Dr=xt.zerolinelayer==="above traces",qr=Cr.cls||Vr+"tick",un=Cr.vals.filter(function(fs){return fs.text}),Jr=Cr.labelFns,At=Cr.secondary?0:xt.tickangle,lr=(xt._prevTickAngles||{})[qr],zr=Cr.layer.selectAll("g."+qr).data(xt.showticklabels?un:[],Vn),cn=[];zr.enter().append("g").classed(qr,1).append("text").attr("text-anchor","middle").each(function(fs){var Zo=h.select(this),po=Dt._promises.length;Zo.call(r.positionText,Jr.xFn(fs),Jr.yFn(fs)).call(i.font,{family:fs.font,size:fs.fontSize,color:fs.fontColor,weight:fs.fontWeight,style:fs.fontStyle,variant:fs.fontVariant,textcase:fs.fontTextcase,lineposition:fs.fontLineposition,shadow:fs.fontShadow}).text(fs.text).call(r.convertToTspans,Dt),Dt._promises[po]?cn.push(Dt._promises.pop().then(function(){Rn(Zo,At)})):Rn(Zo,At)}),Ca(xt,[j]),zr.exit().remove(),Cr.repositionOnUpdate&&zr.each(function(fs){h.select(this).select("text").call(r.positionText,Jr.xFn(fs),Jr.yFn(fs))});function Rn(fs,Zo){fs.each(function(po){var hs=h.select(this),ul=hs.select(".text-math-group"),kl=Jr.anchorFn(po,Zo),Rl=Cr.transFn.call(hs.node(),po)+(b(Zo)&&+Zo!=0?" rotate("+Zo+","+Jr.xFn(po)+","+(Jr.yFn(po)-po.fontSize/2)+")":""),Ms=r.lineCount(hs),fi=ce*po.fontSize,to=Jr.heightFn(po,b(Zo)?+Zo:0,(Ms-1)*fi);if(to&&(Rl+=t(0,to)),ul.empty()){var Cl=hs.select("text");Cl.attr({transform:Rl,"text-anchor":kl}),Cl.style("display",null),xt._adjustTickLabelsOverflow&&xt._adjustTickLabelsOverflow()}else{var Ps=i.bBox(ul.node()).width,Fo=Ps*{end:-.5,start:.5}[kl];ul.attr("transform",Rl+t(Fo,0))}})}xt._adjustTickLabelsOverflow=function(){var fs=xt.ticklabeloverflow;if(!(!fs||fs==="allow")){var Zo=fs.indexOf("hide")!==-1,po=xt._id.charAt(0)==="x",hs=0,ul=po?Dt._fullLayout.width:Dt._fullLayout.height;if(fs.indexOf("domain")!==-1){var kl=e.simpleMap(xt.range,xt.r2l);hs=xt.l2p(kl[0])+xt._offset,ul=xt.l2p(kl[1])+xt._offset}var Rl=Math.min(hs,ul),Ms=Math.max(hs,ul),fi=xt.side,to=1/0,Cl=-1/0;zr.each(function(Zs){var cl=h.select(this),Au=cl.select(".text-math-group");if(Au.empty()){var Qi=i.bBox(cl.node()),gs=0;po?(Qi.right>Ms||Qi.leftMs||Qi.top+(xt.tickangle?0:Zs.fontSize/4)xt["_visibleLabelMin_"+kl._id]?cl.style("display","none"):Ms.K==="tick"&&!Rl&&cl.node().style.display!=="none"&&cl.style("display",null)})})})})},Rn(zr,lr+1?lr:At);function qn(){return cn.length&&Promise.all(cn)}var jn=null;function fn(){if(Rn(zr,At),un.length&&xt.autotickangles&&(xt.type!=="log"||String(xt.dtick).charAt(0)!=="D")){jn=xt.autotickangles[0];var fs=0,Zo=[],po,hs=1;zr.each(function(wl){fs=Math.max(fs,wl.fontSize);var Nl=xt.l2p(wl.x),Vl=Vt(this),Zu=i.bBox(Vl.node());hs=Math.max(hs,r.lineCount(Vl)),Zo.push({top:0,bottom:10,height:10,left:Nl-Zu.width/2,right:Nl+Zu.width/2+2,width:Zu.width+2})});var ul=(xt.tickson==="boundaries"||xt.showdividers)&&!Cr.secondary,kl=un.length,Rl=Math.abs((un[kl-1].x-un[0].x)*xt._m)/(kl-1),Ms=ul?Rl/2:Rl,fi=ul?xt.ticklen:fs*1.25*hs,to=Math.sqrt(Math.pow(Ms,2)+Math.pow(fi,2)),Cl=Ms/to,Ps=xt.autotickangles.map(function(wl){return wl*Math.PI/180}),Fo=Ps.find(function(wl){return Math.abs(Math.cos(wl))<=Cl});Fo===void 0&&(Fo=Ps.reduce(function(wl,Nl){return Math.abs(Math.cos(wl))Ys*Uo&&(Xs=Uo,ui[Mo]=ts[Mo]=cs[Mo])}var Vs=Math.abs(Xs-Ho);Vs-Xi>0?(Vs-=Xi,Xi*=1+Xi/Vs):Xi=0,xt._id.charAt(0)!=="y"&&(Xi=-Xi),ui[io]=Ea.p2r(Ea.r2p(ts[io])+so*Xi),Ea.autorange==="min"||Ea.autorange==="max reversed"?(ui[0]=null,Ea._rangeInitial0=void 0,Ea._rangeInitial1=void 0):(Ea.autorange==="max"||Ea.autorange==="min reversed")&&(ui[1]=null,Ea._rangeInitial0=void 0,Ea._rangeInitial1=void 0),jr._insideTickLabelsUpdaterange[Ea._name+".range"]=ui}var ll=e.syncOrAsync(In);return ll&&ll.then&&Dt._promises.push(ll),ll};function ra(Dt,xt,Cr){var jr=xt._id+"divider",Vr=Cr.vals,Dr=Cr.layer.selectAll("path."+jr).data(Vr,Vn);Dr.exit().remove(),Dr.enter().insert("path",":first-child").classed(jr,1).classed("crisp",1).call(n.stroke,xt.dividercolor).style("stroke-width",i.crispRound(Dt,xt.dividerwidth,1)+"px"),Dr.attr("transform",Cr.transFn).attr("d",Cr.path)}ne.getPxPosition=function(Dt,xt){var Cr=Dt._fullLayout._size,jr=xt._id.charAt(0),Vr=xt.side,Dr;if(xt.anchor!=="free"?Dr=xt._anchorAxis:jr==="x"?Dr={_offset:Cr.t+(1-(xt.position||0))*Cr.h,_length:0}:jr==="y"&&(Dr={_offset:Cr.l+(xt.position||0)*Cr.w+xt._shift,_length:0}),Vr==="top"||Vr==="left")return Dr._offset;if(Vr==="bottom"||Vr==="right")return Dr._offset+Dr._length};function na(Dt){var xt=Dt.title.font.size,Cr=(Dt.title.text.match(r.BR_TAG_ALL)||[]).length;return Dt.title.hasOwnProperty("standoff")?xt*(le+Cr*ce):Cr?xt*(Cr+1)*ce:xt}function Un(Dt,xt){var Cr=Dt._fullLayout,jr=xt._id,Vr=jr.charAt(0),Dr=xt.title.font.size,qr,un=(xt.title.text.match(r.BR_TAG_ALL)||[]).length;if(xt.title.hasOwnProperty("standoff"))xt.side==="bottom"||xt.side==="right"?qr=xt._depth+xt.title.standoff+Dr*le:(xt.side==="top"||xt.side==="left")&&(qr=xt._depth+xt.title.standoff+Dr*(fe+un*ce));else{var Jr=_a(xt);if(xt.type==="multicategory")qr=xt._depth;else{var At=1.5*Dr;Jr&&(At=.5*Dr,xt.ticks==="outside"&&(At+=xt.ticklen)),qr=10+At+(xt.linewidth?xt.linewidth-1:0)}Jr||(Vr==="x"?qr+=xt.side==="top"?Dr*(xt.showticklabels?1:0):Dr*(xt.showticklabels?1.5:.5):qr+=xt.side==="right"?Dr*(xt.showticklabels?1:.5):Dr*(xt.showticklabels?.5:0))}var lr=ne.getPxPosition(Dt,xt),zr,cn,Rn;Vr==="x"?(cn=xt._offset+xt._length/2,Rn=xt.side==="top"?lr-qr:lr+qr):(Rn=xt._offset+xt._length/2,cn=xt.side==="right"?lr+qr:lr-qr,zr={rotate:"-90",offset:0});var qn;if(xt.type!=="multicategory"){var jn=xt._selections[xt._id+"tick"];if(qn={selection:jn,side:xt.side},jn&&jn.node()&&jn.node().parentNode){var fn=i.getTranslate(jn.node().parentNode);qn.offsetLeft=fn.x,qn.offsetTop=fn.y}xt.title.hasOwnProperty("standoff")&&(qn.pad=0)}return xt._titleStandoff=qr,o.draw(Dt,jr+"title",{propContainer:xt,propName:xt._name+".title.text",placeholder:Cr._dfltTitle[Vr],avoid:qn,transform:zr,attributes:{x:cn,y:Rn,"text-anchor":"middle"}})}ne.shouldShowZeroLine=function(Dt,xt,Cr){var jr=e.simpleMap(xt.range,xt.r2l);return jr[0]*jr[1]<=0&&xt.zeroline&&(xt.type==="linear"||xt.type==="-")&&!(xt.rangebreaks&&xt.maskBreaks(0)===F)&&(ka(xt,0)||!Va(Dt,xt,Cr,jr)||sr(Dt,xt))},ne.clipEnds=function(Dt,xt){return xt.filter(function(Cr){return ka(Dt,Cr.x)})};function ka(Dt,xt){var Cr=Dt.l2p(xt);return Cr>1&&Cr1)for(Vr=1;Vr=Vr.min&&Dt=L:/%L/.test(xt)?Dt>=I:/%[SX]/.test(xt)?Dt>=y:/%M/.test(xt)?Dt>=d:/%[HI]/.test(xt)?Dt>=u:/%p/.test(xt)?Dt>=m:/%[Aadejuwx]/.test(xt)?Dt>=w:/%[UVW]/.test(xt)?Dt>=_:/%[Bbm]/.test(xt)?Dt>=M:/%[q]/.test(xt)?Dt>=g:/%[Yy]/.test(xt)?Dt>=v:!0}}}),$T=Ge({"src/plots/cartesian/autorange_options_defaults.js"(K,G){G.exports=function(b,S,E){var e,t;if(E){var r=S==="reversed"||S==="min reversed"||S==="max reversed";e=E[r?1:0],t=E[r?0:1]}var o=b("autorangeoptions.minallowed",t===null?e:void 0),n=b("autorangeoptions.maxallowed",e===null?t:void 0);o===void 0&&b("autorangeoptions.clipmin"),n===void 0&&b("autorangeoptions.clipmax"),b("autorangeoptions.include")}}}),KT=Ge({"src/plots/cartesian/range_defaults.js"(K,G){var h=$T();G.exports=function(S,E,e,t){var r=E._template||{},o=E.type||r.type||"-";e("minallowed"),e("maxallowed");var n=e("range");if(!n){var i;!t.noInsiderange&&o!=="log"&&(i=e("insiderange"),i&&(i[0]===null||i[1]===null)&&(E.insiderange=!1,i=void 0),i&&(n=e("range",i)))}var a=E.getAutorangeDflt(n,t),s=e("autorange",a),f;n&&(n[0]===null&&n[1]===null||(n[0]===null||n[1]===null)&&(s==="reversed"||s===!0)||n[0]!==null&&(s==="min"||s==="max reversed")||n[1]!==null&&(s==="max"||s==="min reversed"))&&(n=void 0,delete E.range,E.autorange=!0,f=!0),f||(a=E.getAutorangeDflt(n,t),s=e("autorange",a)),s&&(h(e,s,n),(o==="linear"||o==="-")&&e("rangemode")),E.cleanRange()}}}),Zw=Ge({"node_modules/mouse-event-offset/index.js"(K,G){var h={left:0,top:0};G.exports=b;function b(E,e,t){e=e||E.currentTarget||E.srcElement,Array.isArray(t)||(t=[0,0]);var r=E.clientX||0,o=E.clientY||0,n=S(e);return t[0]=r-n.left,t[1]=o-n.top,t}function S(E){return E===window||E===document||E===document.body?h:E.getBoundingClientRect()}}}),Ww=Ge({"node_modules/has-passive-events/index.js"(K,G){var h=ux();function b(){var S=!1;try{var E=Object.defineProperty({},"passive",{get:function(){S=!0}});window.addEventListener("test",null,E),window.removeEventListener("test",null,E)}catch{S=!1}return S}G.exports=h&&b()}}),IM=Ge({"src/components/dragelement/align.js"(K,G){G.exports=function(b,S,E,e,t){var r=(b-E)/(e-E),o=r+S/(e-E),n=(r+o)/2;return t==="left"||t==="bottom"?r:t==="center"||t==="middle"?n:t==="right"||t==="top"?o:r<2/3-n?r:o>4/3-n?o:n}}}),DM=Ge({"src/components/dragelement/cursor.js"(K,G){var h=_n(),b=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];G.exports=function(E,e,t,r){return t==="left"?E=0:t==="center"?E=1:t==="right"?E=2:E=h.constrain(Math.floor(E*3),0,2),r==="bottom"?e=0:r==="middle"?e=1:r==="top"?e=2:e=h.constrain(Math.floor(e*3),0,2),b[e][E]}}}),zM=Ge({"src/components/dragelement/unhover.js"(K,G){var h=A1(),b=R0(),S=Kg().getGraphDiv,E=ff(),e=G.exports={};e.wrapped=function(t,r,o){t=S(t),t._fullLayout&&b.clear(t._fullLayout._uid+E.HOVERID),e.raw(t,r,o)},e.raw=function(r,o){var n=r._fullLayout,i=r._hoverdata;o||(o={}),!(o.target&&!r._dragged&&h.triggerHandler(r,"plotly_beforehover",o)===!1)&&(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),r._hoverdata=void 0,o.target&&i&&r.emit("plotly_unhover",{event:o,points:i}))}}}),uv=Ge({"src/components/dragelement/index.js"(K,G){var h=Zw(),b=Xw(),S=Ww(),E=_n().removeElement,e=sh(),t=G.exports={};t.align=IM(),t.getCursor=DM();var r=zM();t.unhover=r.wrapped,t.unhoverRaw=r.raw,t.init=function(a){var s=a.gd,f=1,c=s._context.doubleClickDelay,p=a.element,v,T,l,g,x,A,M,_;s._mouseDownTime||(s._mouseDownTime=0),p.style.pointerEvents="all",p.onmousedown=u,S?(p._ontouchstart&&p.removeEventListener("touchstart",p._ontouchstart),p._ontouchstart=u,p.addEventListener("touchstart",u,{passive:!1})):p.ontouchstart=u;function w(I,L,z){return Math.abs(I)"u"&&typeof I.clientY>"u"&&(I.clientX=v,I.clientY=T),l=new Date().getTime(),l-s._mouseDownTimec&&(f=Math.max(f-1,1)),s._dragged)a.doneFn&&a.doneFn();else{var L;A.target===M?L=A:(L={target:M,srcElement:M,toElement:M},Object.keys(A).concat(Object.keys(A.__proto__)).forEach(z=>{var F=A[z];!L[z]&&typeof F!="function"&&(L[z]=F)})),a.clickFn&&a.clickFn(f,L),_||M.dispatchEvent(new MouseEvent("click",I))}s._dragging=!1,s._dragged=!1}};function o(){var i=document.createElement("div");i.className="dragcover";var a=i.style;return a.position="fixed",a.left=0,a.right=0,a.top=0,a.bottom=0,a.zIndex=999999999,a.background="none",document.body.appendChild(i),i}t.coverSlip=o;function n(i){return h(i.changedTouches?i.changedTouches[0]:i,document.body)}}}),Up=Ge({"src/lib/setcursor.js"(K,G){G.exports=function(b,S){(b.attr("class")||"").split(" ").forEach(function(E){E.indexOf("cursor-")===0&&b.classed(E,!1)}),S&&b.classed("cursor-"+S,!0)}}}),OM=Ge({"src/lib/override_cursor.js"(K,G){var h=Up(),b="data-savedcursor",S="!!";G.exports=function(e,t){var r=e.attr(b);if(t){if(!r){for(var o=(e.attr("class")||"").split(" "),n=0;nV.legend.length)for(var $=V.legend.length;$(n==="legend"?1:0));if(L===!1&&(a[n]=void 0),!(L===!1&&!f.uirevision)&&(p("uirevision",a.uirevision),L!==!1)){p("borderwidth");var z=p("orientation"),F=p("yref"),N=p("xref"),B=z==="h",R=F==="paper",U=N==="paper",j,Z,re,fe="left";B?(j=0,h.getComponentMethod("rangeslider","isVisible")(i.xaxis)?R?(Z=1.1,re="bottom"):(Z=1,re="top"):R?(Z=-.1,re="top"):(Z=0,re="bottom")):(Z=1,re="auto",U?j=1.02:(j=1,fe="right")),b.coerce(f,c,{x:{valType:"number",editType:"legend",min:U?-2:0,max:U?3:1,dflt:j}},"x"),b.coerce(f,c,{y:{valType:"number",editType:"legend",min:R?-2:0,max:R?3:1,dflt:Z}},"y"),p("traceorder",w),r.isGrouped(a[n])&&p("tracegroupgap"),p("entrywidth"),p("entrywidthmode"),p("indentation"),p("itemsizing"),p("itemwidth"),p("itemclick"),p("itemdoubleclick"),p("groupclick"),p("xanchor",fe),p("yanchor",re),p("maxheight"),p("valign"),b.noneOrAll(f,c,["x","y"]);var le=p("title.text");if(le){p("title.side",B?"left":"top");var ce=b.extendFlat({},v,{size:b.bigFont(v.size)});b.coerceFont(p,"title.font",ce)}}}G.exports=function(i,a,s){var f,c=s.slice(),p=a.shapes;if(p)for(f=0;fz&&(L=z)}y[v][0]._groupMinRank=L,y[v][0]._preGroupSort=v}var F=function(Z,re){return Z[0]._groupMinRank-re[0]._groupMinRank||Z[0]._preGroupSort-re[0]._preGroupSort},N=function(Z,re){return Z.trace.legendrank-re.trace.legendrank||Z._preSort-re._preSort};for(y.forEach(function(Z,re){Z[0]._preGroupSort=re}),y.sort(F),v=0;v0)ue=ee.width;else return 0;return m?$:Math.min(ue,ne)};A.each(function(V){var ee=h.select(this),ne=S.ensureSingle(ee,"g","layers");ne.style("opacity",V[0].trace.opacity);var $=_.indentation,ue=_.valign,te=V[0].lineHeight,H=V[0].height;if(ue==="middle"&&$===0||!te||!H)ne.attr("transform",null);else{var ae={top:1,bottom:-1}[ue],ie=ae*(.5*(te-H+3))||0,de=_.indentation;ne.attr("transform",E(de,ie))}var Se=ne.selectAll("g.legendfill").data([V]);Se.enter().append("g").classed("legendfill",!0);var Le=ne.selectAll("g.legendlines").data([V]);Le.enter().append("g").classed("legendlines",!0);var Fe=ne.selectAll("g.legendsymbols").data([V]);Fe.enter().append("g").classed("legendsymbols",!0),Fe.selectAll("g.legendpoints").data([V]).enter().append("g").classed("legendpoints",!0)}).each(ce).each(F).each(B).each(N).each(U).each(fe).each(re).each(L).each(z).each(j).each(Z);function L(V){var ee=l(V),ne=ee.showFill,$=ee.showLine,ue=ee.showGradientLine,te=ee.showGradientFill,H=ee.anyFill,ae=ee.anyLine,ie=V[0],de=ie.trace,Se,Le,Fe=r(de),ze=Fe.colorscale,Ye=Fe.reversescale,st=function(Ne){if(Ne.size())if(ne)e.fillGroupStyle(Ne,M,!0);else{var ut="legendfill-"+de.uid;e.gradient(Ne,M,ut,T(Ye),ze,"fill")}},ct=function(Ne){if(Ne.size()){var ut="legendline-"+de.uid;e.lineGroupStyle(Ne),e.gradient(Ne,M,ut,T(Ye),ze,"stroke")}},at=o.hasMarkers(de)||!H?"M5,0":ae?"M5,-2":"M5,-3",et=h.select(this),Pe=et.select(".legendfill").selectAll("path").data(ne||te?[V]:[]);if(Pe.enter().append("path").classed("js-fill",!0),Pe.exit().remove(),Pe.attr("d",at+"h"+u+"v6h-"+u+"z").call(st),$||ue){var Ae=I(void 0,de.line,p,f);Le=S.minExtend(de,{line:{width:Ae}}),Se=[S.minExtend(ie,{trace:Le})]}var pe=et.select(".legendlines").selectAll("path").data($||ue?[Se]:[]);pe.enter().append("path").classed("js-line",!0),pe.exit().remove(),pe.attr("d",at+(ue?"l"+u+",0.0001":"h"+u)).call($?e.lineGroupStyle:ct)}function z(V){var ee=l(V),ne=ee.anyFill,$=ee.anyLine,ue=ee.showLine,te=ee.showMarker,H=V[0],ae=H.trace,ie=!te&&!$&&!ne&&o.hasText(ae),de,Se;function Le(Pe,Ae,pe,Ne){var ut=S.nestedProperty(ae,Pe).get(),dt=S.isArrayOrTypedArray(ut)&&Ae?Ae(ut):ut;if(m&&dt&&Ne!==void 0&&(dt=Ne),pe){if(dtpe[1])return pe[1]}return dt}function Fe(Pe){return H._distinct&&H.index&&Pe[H.index]?Pe[H.index]:Pe[0]}if(te||ie||ue){var ze={},Ye={};if(te){ze.mc=Le("marker.color",Fe),ze.mx=Le("marker.symbol",Fe),ze.mo=Le("marker.opacity",S.mean,[.2,1]),ze.mlc=Le("marker.line.color",Fe),ze.mlw=Le("marker.line.width",S.mean,[0,5],c),Ye.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var st=Le("marker.size",S.mean,[2,16],s);ze.ms=st,Ye.marker.size=st}ue&&(Ye.line={width:Le("line.width",Fe,[0,10],f)}),ie&&(ze.tx="Aa",ze.tp=Le("textposition",Fe),ze.ts=10,ze.tc=Le("textfont.color",Fe),ze.tf=Le("textfont.family",Fe),ze.tw=Le("textfont.weight",Fe),ze.ty=Le("textfont.style",Fe),ze.tv=Le("textfont.variant",Fe),ze.tC=Le("textfont.textcase",Fe),ze.tE=Le("textfont.lineposition",Fe),ze.tS=Le("textfont.shadow",Fe)),de=[S.minExtend(H,ze)],Se=S.minExtend(ae,Ye),Se.selectedpoints=null,Se.texttemplate=null}var ct=h.select(this).select("g.legendpoints"),at=ct.selectAll("path.scatterpts").data(te?de:[]);at.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",y),at.exit().remove(),at.call(e.pointStyle,Se,M),te&&(de[0].mrc=3);var et=ct.selectAll("g.pointtext").data(ie?de:[]);et.enter().append("g").classed("pointtext",!0).append("text").attr("transform",y),et.exit().remove(),et.selectAll("text").call(e.textPointStyle,Se,M)}function F(V){var ee=V[0].trace,ne=ee.type==="waterfall";if(V[0]._distinct&&ne){var $=V[0].trace[V[0].dir].marker;return V[0].mc=$.color,V[0].mlw=$.line.width,V[0].mlc=$.line.color,R(V,this,"waterfall")}var ue=[];ee.visible&&ne&&(ue=V[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var te=h.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(ue);te.enter().append("path").classed("legendwaterfall",!0).attr("transform",y).style("stroke-miterlimit",1),te.exit().remove(),te.each(function(H){var ae=h.select(this),ie=ee[H[0]].marker,de=I(void 0,ie.line,v,c);ae.attr("d",H[1]).style("stroke-width",de+"px").call(t.fill,ie.color),de&&ae.call(t.stroke,ie.line.color)})}function N(V){R(V,this)}function B(V){R(V,this,"funnel")}function R(V,ee,ne){var $=V[0].trace,ue=$.marker||{},te=ue.line||{},H=ue.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",ae=ne?$.visible&&$.type===ne:b.traceIs($,"bar"),ie=h.select(ee).select("g.legendpoints").selectAll("path.legend"+ne).data(ae?[V]:[]);ie.enter().append("path").classed("legend"+ne,!0).attr("d",H).attr("transform",y),ie.exit().remove(),ie.each(function(de){var Se=h.select(this),Le=de[0],Fe=I(Le.mlw,ue.line,v,c);Se.style("stroke-width",Fe+"px");var ze=Le.mcc;if(!_._inHover&&"mc"in Le){var Ye=r(ue),st=Ye.mid;st===void 0&&(st=(Ye.max+Ye.min)/2),ze=e.tryColorscale(ue,"")(st)}var ct=ze||Le.mc||ue.color,at=ue.pattern,et=e.getPatternAttr,Pe=at&&(et(at.shape,0,"")||et(at.path,0,""));if(Pe){var Ae=et(at.bgcolor,0,null),pe=et(at.fgcolor,0,null),Ne=at.fgopacity,ut=g(at.size,8,10),dt=g(at.solidity,.5,1),nt="legend-"+$.uid;Se.call(e.pattern,"legend",M,nt,Pe,ut,dt,ze,at.fillmode,Ae,pe,Ne)}else Se.call(t.fill,ct);Fe&&t.stroke(Se,Le.mlc||te.color)})}function U(V){var ee=V[0].trace,ne=h.select(this).select("g.legendpoints").selectAll("path.legendbox").data(ee.visible&&b.traceIs(ee,"box-violin")?[V]:[]);ne.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",y),ne.exit().remove(),ne.each(function(){var $=h.select(this);if((ee.boxpoints==="all"||ee.points==="all")&&t.opacity(ee.fillcolor)===0&&t.opacity((ee.line||{}).color)===0){var ue=S.minExtend(ee,{marker:{size:m?s:S.constrain(ee.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});ne.call(e.pointStyle,ue,M)}else{var te=I(void 0,ee.line,v,c);$.style("stroke-width",te+"px").call(t.fill,ee.fillcolor),te&&t.stroke($,ee.line.color)}})}function j(V){var ee=V[0].trace,ne=h.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(ee.visible&&ee.type==="candlestick"?[V,V]:[]);ne.enter().append("path").classed("legendcandle",!0).attr("d",function($,ue){return ue?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",y).style("stroke-miterlimit",1),ne.exit().remove(),ne.each(function($,ue){var te=h.select(this),H=ee[ue?"increasing":"decreasing"],ae=I(void 0,H.line,v,c);te.style("stroke-width",ae+"px").call(t.fill,H.fillcolor),ae&&t.stroke(te,H.line.color)})}function Z(V){var ee=V[0].trace,ne=h.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(ee.visible&&ee.type==="ohlc"?[V,V]:[]);ne.enter().append("path").classed("legendohlc",!0).attr("d",function($,ue){return ue?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",y).style("stroke-miterlimit",1),ne.exit().remove(),ne.each(function($,ue){var te=h.select(this),H=ee[ue?"increasing":"decreasing"],ae=I(void 0,H.line,v,c);te.style("fill","none").call(e.dashLine,H.line.dash,ae),ae&&t.stroke(te,H.line.color)})}function re(V){le(V,this,"pie")}function fe(V){le(V,this,"funnelarea")}function le(V,ee,ne){var $=V[0],ue=$.trace,te=ne?ue.visible&&ue.type===ne:b.traceIs(ue,ne),H=h.select(ee).select("g.legendpoints").selectAll("path.legend"+ne).data(te?[V]:[]);if(H.enter().append("path").classed("legend"+ne,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",y),H.exit().remove(),H.size()){var ae=ue.marker||{},ie=I(i(ae.line.width,$.pts),ae.line,v,c),de="pieLike",Se=S.minExtend(ue,{marker:{line:{width:ie}}},de),Le=S.minExtend($,{trace:Se},de);n(H,Le,Se,M)}}function ce(V){var ee=V[0].trace,ne,$=[];if(ee.visible)switch(ee.type){case"histogram2d":case"heatmap":$=[["M-15,-2V4H15V-2Z"]],ne=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":$=[["M-6,-6V6H6V-6Z"]],ne=!0;break;case"densitymapbox":case"densitymap":$=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],ne="radial";break;case"cone":$=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],ne=!1;break;case"streamtube":$=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],ne=!1;break;case"surface":$=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],ne=!0;break;case"mesh3d":$=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ne=!1;break;case"volume":$=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ne=!0;break;case"isosurface":$=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],ne=!1;break}var ue=h.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data($);ue.enter().append("path").classed("legend3dandfriends",!0).attr("transform",y).style("stroke-miterlimit",1),ue.exit().remove(),ue.each(function(te,H){var ae=h.select(this),ie=r(ee),de=ie.colorscale,Se=ie.reversescale,Le=function(st){if(st.size()){var ct="legendfill-"+ee.uid;e.gradient(st,M,ct,T(Se,ne==="radial"),de,"fill")}},Fe;if(de){if(!ne){var Ye=de.length;Fe=H===0?de[Se?Ye-1:0][1]:H===1?de[Se?0:Ye-1][1]:de[Math.floor((Ye-1)/2)][1]}}else{var ze=ee.vertexcolor||ee.facecolor||ee.color;Fe=S.isArrayOrTypedArray(ze)?ze[H]||ze[0]:ze}ae.attr("d",te[0]),Fe?ae.call(t.fill,Fe):ae.call(Le)})}};function T(x,A){var M=A?"radial":"horizontal";return M+(x?"":"reversed")}function l(x){var A=x[0].trace,M=A.contours,_=o.hasLines(A),w=o.hasMarkers(A),m=A.visible&&A.fill&&A.fill!=="none",u=!1,d=!1;if(M){var y=M.coloring;y==="lines"?u=!0:_=y==="none"||y==="heatmap"||M.showlines,M.type==="constraint"?m=M._operation!=="=":(y==="fill"||y==="heatmap")&&(d=!0)}return{showMarker:w,showLine:_,showFill:m,showGradientLine:u,showGradientFill:d,anyLine:_||u,anyFill:m||d}}function g(x,A,M){return x&&S.isArrayOrTypedArray(x)?A:x>M?M:x}}}),n5=Ge({"src/components/legend/draw.js"(K,G){var h=ki(),b=_n(),S=ef(),E=Ro(),e=A1(),t=uv(),r=As(),o=go(),n=nc(),i=Kw(),a=e5(),s=ad(),f=s.LINE_SPACING,c=s.FROM_TL,p=s.FROM_BR,v=FM(),T=r5(),l=$w(),g=1,x=/^legend[0-9]*$/;G.exports=function(j,Z){if(Z)M(j,Z);else{var re=j._fullLayout,fe=re._legends,le=re._infolayer.selectAll('[class^="legend"]');le.each(function(){var ne=h.select(this),$=ne.attr("class"),ue=$.split(" ")[0];ue.match(x)&&fe.indexOf(ue)===-1&&ne.remove()});for(var ce=0;ce1)}var ae=re.hiddenlabels||[];if(!V&&(!re.showlegend||!ee.length))return ce.selectAll("."+fe).remove(),re._topdefs.select("#"+le).remove(),S.autoMargin(U,fe);var ie=b.ensureSingle(ce,"g",fe,function(at){V||at.attr("pointer-events","all")}),de=b.ensureSingleById(re._topdefs,"clipPath",le,function(at){at.append("rect")}),Se=b.ensureSingle(ie,"rect","bg",function(at){at.attr("shape-rendering","crispEdges")});Se.call(o.stroke,Z.bordercolor).call(o.fill,Z.bgcolor).style("stroke-width",Z.borderwidth+"px");var Le=b.ensureSingle(ie,"g","scrollbox"),Fe=Z.title;Z._titleWidth=0,Z._titleHeight=0;var ze;Fe.text?(ze=b.ensureSingle(Le,"text",fe+"titletext"),ze.attr("text-anchor","start").call(r.font,Fe.font).text(Fe.text),y(ze,Le,U,Z,g)):Le.selectAll("."+fe+"titletext").remove();var Ye=b.ensureSingle(ie,"rect","scrollbar",function(at){at.attr(a.scrollBarEnterAttrs).call(o.fill,a.scrollBarColor)}),st=Le.selectAll("g.groups").data(ee);st.enter().append("g").attr("class","groups"),st.exit().remove();var ct=st.selectAll("g.traces").data(b.identity);ct.enter().append("g").attr("class","traces"),ct.exit().remove(),ct.style("opacity",function(at){var et=at[0].trace;return E.traceIs(et,"pie-like")?ae.indexOf(at[0].label)!==-1?.5:1:et.visible==="legendonly"?.5:1}).each(function(){h.select(this).call(m,U,Z)}).call(T,U,Z).each(function(){V||h.select(this).call(d,U,fe)}),b.syncOrAsync([S.previousPromises,function(){return z(U,st,ct,Z)},function(){var at=re._size,et=Z.borderwidth,Pe=Z.xref==="paper",Ae=Z.yref==="paper";if(Fe.text&&A(ze,Z,et),!V){var pe,Ne;Pe?pe=at.l+at.w*Z.x-c[N(Z)]*Z._width:pe=re.width*Z.x-c[N(Z)]*Z._width,Ae?Ne=at.t+at.h*(1-Z.y)-c[B(Z)]*Z._effHeight:Ne=re.height*(1-Z.y)-c[B(Z)]*Z._effHeight;var ut=F(U,fe,pe,Ne);if(ut)return;if(re.margin.autoexpand){var dt=pe,nt=Ne;pe=Pe?b.constrain(pe,0,re.width-Z._width):dt,Ne=Ae?b.constrain(Ne,0,re.height-Z._effHeight):nt,pe!==dt&&b.log("Constrain "+fe+".x to make legend fit inside graph"),Ne!==nt&&b.log("Constrain "+fe+".y to make legend fit inside graph")}r.setTranslate(ie,pe,Ne)}if(Ye.on(".drag",null),ie.on("wheel",null),V||Z._height<=Z._maxHeight||U._context.staticPlot){var Ft=Z._effHeight;V&&(Ft=Z._height),Se.attr({width:Z._width-et,height:Ft-et,x:et/2,y:et/2}),r.setTranslate(Le,0,0),de.select("rect").attr({width:Z._width-2*et,height:Ft-2*et,x:et,y:et}),r.setClipUrl(Le,le,U),r.setRect(Ye,0,0,0,0),delete Z._scrollY}else{var Nt=Math.max(a.scrollBarMinHeight,Z._effHeight*Z._effHeight/Z._height),Qt=Z._effHeight-Nt-2*a.scrollBarMargin,ar=Z._height-Z._effHeight,kr=Qt/ar,Er=Math.min(Z._scrollY||0,ar);Se.attr({width:Z._width-2*et+a.scrollBarWidth+a.scrollBarMargin,height:Z._effHeight-et,x:et/2,y:et/2}),de.select("rect").attr({width:Z._width-2*et+a.scrollBarWidth+a.scrollBarMargin,height:Z._effHeight-2*et,x:et,y:et+Er}),r.setClipUrl(Le,le,U),xe(Er,Nt,kr),ie.on("wheel",function(){Er=b.constrain(Z._scrollY+h.event.deltaY/ar*Qt,0,ar),xe(Er,Nt,kr),Er!==0&&Er!==ar&&h.event.preventDefault()});var $r,Sr,Ur,Mt=function(Lt,Ct,Ot){var Kt=(Ot-Ct)/kr+Lt;return b.constrain(Kt,0,ar)},je=function(Lt,Ct,Ot){var Kt=(Ct-Ot)/kr+Lt;return b.constrain(Kt,0,ar)},Je=h.behavior.drag().on("dragstart",function(){var Lt=h.event.sourceEvent;Lt.type==="touchstart"?$r=Lt.changedTouches[0].clientY:$r=Lt.clientY,Ur=Er}).on("drag",function(){var Lt=h.event.sourceEvent;Lt.buttons===2||Lt.ctrlKey||(Lt.type==="touchmove"?Sr=Lt.changedTouches[0].clientY:Sr=Lt.clientY,Er=Mt(Ur,$r,Sr),xe(Er,Nt,kr))});Ye.call(Je);var ke=h.behavior.drag().on("dragstart",function(){var Lt=h.event.sourceEvent;Lt.type==="touchstart"&&($r=Lt.changedTouches[0].clientY,Ur=Er)}).on("drag",function(){var Lt=h.event.sourceEvent;Lt.type==="touchmove"&&(Sr=Lt.changedTouches[0].clientY,Er=je(Ur,$r,Sr),xe(Er,Nt,kr))});Le.call(ke)}function xe(Lt,Ct,Ot){Z._scrollY=U._fullLayout[fe]._scrollY=Lt,r.setTranslate(Le,0,-Lt),r.setRect(Ye,Z._width,a.scrollBarMargin+Lt*Ot,a.scrollBarWidth,Ct),de.select("rect").attr("y",et+Lt)}if(U._context.edits.legendPosition){var ye,Ee,Xe,Qe;ie.classed("cursor-move",!0),t.init({element:ie.node(),gd:U,prepFn:function(Lt){if(Lt.target!==Ye.node()){var Ct=r.getTranslate(ie);Xe=Ct.x,Qe=Ct.y}},moveFn:function(Lt,Ct){if(Xe!==void 0&&Qe!==void 0){var Ot=Xe+Lt,Kt=Qe+Ct;r.setTranslate(ie,Ot,Kt),ye=t.align(Ot,Z._width,at.l,at.l+at.w,Z.xanchor),Ee=t.align(Kt+Z._height,-Z._height,at.t+at.h,at.t,Z.yanchor)}},doneFn:function(){if(ye!==void 0&&Ee!==void 0){var Lt={};Lt[fe+".x"]=ye,Lt[fe+".y"]=Ee,E.call("_guiRelayout",U,Lt)}},clickFn:function(Lt,Ct){var Ot=ce.selectAll("g.traces").filter(function(){var Kt=this.getBoundingClientRect();return Ct.clientX>=Kt.left&&Ct.clientX<=Kt.right&&Ct.clientY>=Kt.top&&Ct.clientY<=Kt.bottom});Ot.size()>0&&w(U,ie,Ot,Lt,Ct)}})}}],U)}}function _(U,j,Z){var re=U[0],fe=re.width,le=j.entrywidthmode,ce=re.trace.legendwidth||j.entrywidth;return le==="fraction"?j._maxWidth*ce:Z+(ce||fe)}function w(U,j,Z,re,fe){var le=Z.data()[0][0].trace,ce={event:fe,node:Z.node(),curveNumber:le.index,expandedIndex:le.index,data:U.data,layout:U.layout,frames:U._transitionData._frames,config:U._context,fullData:U._fullData,fullLayout:U._fullLayout};le._group&&(ce.group=le._group),E.traceIs(le,"pie-like")&&(ce.label=Z.datum()[0].label);var V=e.triggerHandler(U,"plotly_legendclick",ce);if(re===1){if(V===!1)return;j._clickTimeout=setTimeout(function(){U._fullLayout&&i(Z,U,re)},U._context.doubleClickDelay)}else if(re===2){j._clickTimeout&&clearTimeout(j._clickTimeout),U._legendMouseDownTime=0;var ee=e.triggerHandler(U,"plotly_legenddoubleclick",ce);ee!==!1&&V!==!1&&i(Z,U,re)}}function m(U,j,Z){var re=R(Z),fe=U.data()[0][0],le=fe.trace,ce=E.traceIs(le,"pie-like"),V=!Z._inHover&&j._context.edits.legendText&&!ce,ee=Z._maxNameLength,ne,$;fe.groupTitle?(ne=fe.groupTitle.text,$=fe.groupTitle.font):($=Z.font,Z.entries?ne=fe.text:(ne=ce?fe.label:le.name,le._meta&&(ne=b.templateString(ne,le._meta))));var ue=b.ensureSingle(U,"text",re+"text");ue.attr("text-anchor","start").call(r.font,$).text(V?u(ne,ee):ne);var te=Z.indentation+Z.itemwidth+a.itemGap*2;n.positionText(ue,te,0),V?ue.call(n.makeEditable,{gd:j,text:ne}).call(y,U,j,Z).on("edit",function(H){this.text(u(H,ee)).call(y,U,j,Z);var ae=fe.trace._fullInput||{},ie={};return ie.name=H,ae._isShape?E.call("_guiRelayout",j,"shapes["+le.index+"].name",ie.name):E.call("_guiRestyle",j,ie,le.index)}):y(ue,U,j,Z)}function u(U,j){var Z=Math.max(4,j);if(U&&U.trim().length>=Z/2)return U;U=U||"";for(var re=Z-U.length;re>0;re--)U+=" ";return U}function d(U,j,Z){var re=j._context.doubleClickDelay,fe,le=1,ce=b.ensureSingle(U,"rect",Z+"toggle",function(V){j._context.staticPlot||V.style("cursor","pointer").attr("pointer-events","all"),V.call(o.fill,"rgba(0,0,0,0)")});j._context.staticPlot||(ce.on("mousedown",function(){fe=new Date().getTime(),fe-j._legendMouseDownTimere&&(le=Math.max(le-1,1)),w(j,V,U,le,h.event)}}))}function y(U,j,Z,re,fe){re._inHover&&U.attr("data-notex",!0),n.convertToTspans(U,Z,function(){I(j,Z,re,fe)})}function I(U,j,Z,re){var fe=U.data()[0][0],le=fe&&fe.trace.showlegend;if(Array.isArray(le)&&(le=le[fe.i]!==!1),!Z._inHover&&fe&&!le){U.remove();return}var ce=U.select("g[class*=math-group]"),V=ce.node(),ee=R(Z);Z||(Z=j._fullLayout[ee]);var ne=Z.borderwidth,$;re===g?$=Z.title.font:fe.groupTitle?$=fe.groupTitle.font:$=Z.font;var ue=$.size*f,te,H;if(V){var ae=r.bBox(V);te=ae.height,H=ae.width,re===g?r.setTranslate(ce,ne,ne+te*.75):r.setTranslate(ce,0,te*.25)}else{var ie="."+ee+(re===g?"title":"")+"text",de=U.select(ie),Se=n.lineCount(de),Le=de.node();if(te=ue*Se,H=Le?r.bBox(Le).width:0,re===g)Z.title.side==="left"&&(H+=a.itemGap*2),n.positionText(de,ne+a.titlePad,ne+ue);else{var Fe=a.itemGap*2+Z.indentation+Z.itemwidth;fe.groupTitle&&(Fe=a.itemGap,H-=Z.indentation+Z.itemwidth),n.positionText(de,Fe,-ue*((Se-1)/2-.3))}}re===g?(Z._titleWidth=H,Z._titleHeight=te):(fe.lineHeight=ue,fe.height=Math.max(te,16)+3,fe.width=H)}function L(U){var j=0,Z=0,re=U.title.side;return re&&(re.indexOf("left")!==-1&&(j=U._titleWidth),re.indexOf("top")!==-1&&(Z=U._titleHeight)),[j,Z]}function z(U,j,Z,re){var fe=U._fullLayout,le=R(re);re||(re=fe[le]);var ce=fe._size,V=l.isVertical(re),ee=l.isGrouped(re),ne=re.entrywidthmode==="fraction",$=re.borderwidth,ue=2*$,te=a.itemGap,H=re.indentation+re.itemwidth+te*2,ae=2*($+te),ie=B(re),de=re.y<0||re.y===0&&ie==="top",Se=re.y>1||re.y===1&&ie==="bottom",Le=re.tracegroupgap,Fe={};const{orientation:ze,yref:Ye}=re;let{maxheight:st}=re;const ct=de||Se||ze!=="v"||Ye!=="paper";st||(st=ct?.5:1);const at=ct?fe.height:ce.h;re._maxHeight=Math.max(st>1?st:st*at,30);var et=0;re._width=0,re._height=0;var Pe=L(re);if(V)Z.each(function(xe){var ye=xe[0].height;r.setTranslate(this,$+Pe[0],$+Pe[1]+re._height+ye/2+te),re._height+=ye,re._width=Math.max(re._width,xe[0].width)}),et=H+re._width,re._width+=te+H+ue,re._height+=ae,ee&&(j.each(function(xe,ye){r.setTranslate(this,0,ye*re.tracegroupgap)}),re._height+=(re._lgroupsLength-1)*re.tracegroupgap);else{var Ae=N(re),pe=re.x<0||re.x===0&&Ae==="right",Ne=re.x>1||re.x===1&&Ae==="left",ut=Se||de,dt=fe.width/2;re._maxWidth=Math.max(pe?ut&&Ae==="left"?ce.l+ce.w:dt:Ne?ut&&Ae==="right"?ce.r+ce.w:dt:ce.w,2*H);var nt=0,Ft=0;Z.each(function(xe){var ye=_(xe,re,H);nt=Math.max(nt,ye),Ft+=ye}),et=null;var Nt=0;if(ee){var Qt=0,ar=0,kr=0;j.each(function(){var xe=0,ye=0;h.select(this).selectAll("g.traces").each(function(Xe){var Qe=_(Xe,re,H),Lt=Xe[0].height;r.setTranslate(this,Pe[0],Pe[1]+$+te+Lt/2+ye),ye+=Lt,xe=Math.max(xe,Qe),Fe[Xe[0].trace.legendgroup]=xe});var Ee=xe+te;ar>0&&Ee+$+ar>re._maxWidth?(Nt=Math.max(Nt,ar),ar=0,kr+=Qt+Le,Qt=ye):Qt=Math.max(Qt,ye),r.setTranslate(this,ar,kr),ar+=Ee}),re._width=Math.max(Nt,ar)+$,re._height=kr+Qt+ae}else{var Er=Z.size(),$r=Ft+ue+(Er-1)*te=re._maxWidth&&(Nt=Math.max(Nt,je),Ur=0,Mt+=Sr,re._height+=Sr,Sr=0),r.setTranslate(this,Pe[0]+$+Ur,Pe[1]+$+Mt+ye/2+te),je=Ur+Ee+te,Ur+=Xe,Sr=Math.max(Sr,ye)}),$r?(re._width=Ur+ue,re._height=Sr+ae):(re._width=Math.max(Nt,je)+ue,re._height+=Sr+ae)}}re._width=Math.ceil(Math.max(re._width+Pe[0],re._titleWidth+2*($+a.titlePad))),re._height=Math.ceil(Math.max(re._height+Pe[1],re._titleHeight+2*($+a.itemGap))),re._effHeight=Math.min(re._height,re._maxHeight);var Je=U._context.edits,ke=Je.legendText||Je.legendPosition;Z.each(function(xe){var ye=h.select(this).select("."+le+"toggle"),Ee=xe[0].height,Xe=xe[0].trace.legendgroup,Qe=_(xe,re,H);ee&&Xe!==""&&(Qe=Fe[Xe]);var Lt=ke?H:et||Qe;!V&&!ne&&(Lt+=te/2),r.setRect(ye,0,-Ee/2,Lt,Ee)})}function F(U,j,Z,re){var fe=U._fullLayout,le=fe[j],ce=N(le),V=B(le),ee=le.xref==="paper",ne=le.yref==="paper";U._fullLayout._reservedMargin[j]={};var $=le.y<.5?"b":"t",ue=le.x<.5?"l":"r",te={r:fe.width-Z,l:Z+le._width,b:fe.height-re,t:re+le._effHeight};if(ee&&ne)return S.autoMargin(U,j,{x:le.x,y:le.y,l:le._width*c[ce],r:le._width*p[ce],b:le._effHeight*p[V],t:le._effHeight*c[V]});ee?U._fullLayout._reservedMargin[j][$]=te[$]:ne||le.orientation==="v"?U._fullLayout._reservedMargin[j][ue]=te[ue]:U._fullLayout._reservedMargin[j][$]=te[$]}function N(U){return b.isRightAnchor(U)?"right":b.isCenterAnchor(U)?"center":"left"}function B(U){return b.isBottomAnchor(U)?"bottom":b.isMiddleAnchor(U)?"middle":"top"}function R(U){return U._id||"legend"}}}),a5=Ge({"src/components/fx/hover.js"(K){var G=ki(),h=Ei(),b=Rs(),S=_n(),E=S.pushUnique,e=S.strTranslate,t=S.strRotate,r=A1(),o=nc(),n=OM(),i=As(),a=go(),s=uv(),f=Ts(),c=sh().zindexSeparator,p=Ro(),v=Kd(),T=ff(),l=QT(),g=n5(),x=T.YANGLE,A=Math.PI*x/180,M=1/Math.sin(A),_=Math.cos(A),w=Math.sin(A),m=T.HOVERARROWSIZE,u=T.HOVERTEXTPAD,d={box:!0,ohlc:!0,violin:!0,candlestick:!0},y={scatter:!0,scattergl:!0,splom:!0};function I(H,ae){return H.distance-ae.distance}K.hover=function(ae,ie,de,Se){ae=S.getGraphDiv(ae);var Le=ie.target;S.throttle(ae._fullLayout._uid+T.HOVERID,T.HOVERMINTIME,function(){L(ae,ie,de,Se,Le)})},K.loneHover=function(ae,ie){var de=!0;Array.isArray(ae)||(de=!1,ae=[ae]);var Se=ie.gd,Le=$(Se),Fe=ue(Se),ze=ae.map(function(Ne){var ut=Ne._x0||Ne.x0||Ne.x||0,dt=Ne._x1||Ne.x1||Ne.x||0,nt=Ne._y0||Ne.y0||Ne.y||0,Ft=Ne._y1||Ne.y1||Ne.y||0,Nt=Ne.eventData;if(Nt){var Qt=Math.min(ut,dt),ar=Math.max(ut,dt),kr=Math.min(nt,Ft),Er=Math.max(nt,Ft),$r=Ne.trace;if(p.traceIs($r,"gl3d")){var Sr=Se._fullLayout[$r.scene]._scene.container,Ur=Sr.offsetLeft,Mt=Sr.offsetTop;Qt+=Ur,ar+=Ur,kr+=Mt,Er+=Mt}Nt.bbox={x0:Qt+Fe,x1:ar+Fe,y0:kr+Le,y1:Er+Le},ie.inOut_bbox&&ie.inOut_bbox.push(Nt.bbox)}else Nt=!1;return{color:Ne.color||a.defaultLine,x0:Ne.x0||Ne.x||0,x1:Ne.x1||Ne.x||0,y0:Ne.y0||Ne.y||0,y1:Ne.y1||Ne.y||0,xLabel:Ne.xLabel,yLabel:Ne.yLabel,zLabel:Ne.zLabel,text:Ne.text,name:Ne.name,idealAlign:Ne.idealAlign,borderColor:Ne.borderColor,fontFamily:Ne.fontFamily,fontSize:Ne.fontSize,fontColor:Ne.fontColor,fontWeight:Ne.fontWeight,fontStyle:Ne.fontStyle,fontVariant:Ne.fontVariant,nameLength:Ne.nameLength,textAlign:Ne.textAlign,trace:Ne.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Ne.hovertemplate||!1,hovertemplateLabels:Ne.hovertemplateLabels||!1,eventData:Nt}}),Ye=!1,st=N(ze,{gd:Se,hovermode:"closest",rotateLabels:Ye,bgColor:ie.bgColor||a.background,container:G.select(ie.container),outerContainer:ie.outerContainer||ie.container}),ct=st.hoverLabels,at=5,et=0,Pe=0;ct.sort(function(Ne,ut){return Ne.y0-ut.y0}).each(function(Ne,ut){var dt=Ne.y0-Ne.by/2;dt-atar[0]._length||na<0||na>kr[0]._length)return s.unhoverRaw(H,ae)}if(ae.pointerX=ra+ar[0]._offset,ae.pointerY=na+kr[0]._offset,"xval"in ae?ke=v.flat(Le,ae.xval):ke=v.p2c(ar,ra),"yval"in ae?xe=v.flat(Le,ae.yval):xe=v.p2c(kr,na),!h(ke[0])||!h(xe[0]))return S.warn("Fx.hover failed",ae,H),s.unhoverRaw(H,ae)}var Va=1/0;function sr(ui,ts){for(Ee=0;Eevr&&(je.splice(0,vr),Va=je[0].distance),at&&Mt!==0&&je.length===0){mr.distance=Mt,mr.index=!1;var Uo=Qe._module.hoverPoints(mr,Kt,xr,"closest",{hoverLayer:ze._hoverlayer});if(Uo&&(Uo=Uo.filter(function(po){return po.spikeDistance<=Mt})),Uo&&Uo.length){var Ys,Vs=Uo.filter(function(po){return po.xa.showspikes&&po.xa.spikesnap!=="hovered data"});if(Vs.length){var ll=Vs[0];h(ll.x0)&&h(ll.y0)&&(Ys=or(ll),(!Nr.vLinePoint||Nr.vLinePoint.spikeDistance>Ys.spikeDistance)&&(Nr.vLinePoint=Ys))}var fs=Uo.filter(function(po){return po.ya.showspikes&&po.ya.spikesnap!=="hovered data"});if(fs.length){var Zo=fs[0];h(Zo.x0)&&h(Zo.y0)&&(Ys=or(Zo),(!Nr.hLinePoint||Nr.hLinePoint.spikeDistance>Ys.spikeDistance)&&(Nr.hLinePoint=Ys))}}}}}sr();function Vt(ui,ts,Ho){for(var Xs=null,cs=1/0,Jo,Uo=0;Uoui.trace.index===Hn.trace.index):je=[Hn];var pi=je.length,Si=ne("x",Hn,ze),Dt=ne("y",Hn,ze);sr(Si,Dt);var xt=[],Cr={},jr=0,Vr=function(ui){var ts=d[ui.trace.type]?z(ui):ui.trace.index;if(!Cr[ts])jr++,Cr[ts]=jr,xt.push(ui);else{var Ho=Cr[ts]-1,Xs=xt[Ho];Ho>0&&Math.abs(ui.distance)pi-1;Dr--)Vr(je[Dr]);je=xt,ln()}var qr=H._hoverdata,un=[],Jr=$(H),At=ue(H);for(const ui of je){var lr=v.makeEventData(ui,ui.trace,ui.cd);if(ui.hovertemplate!==!1){var zr=!1;ui.cd[ui.index]&&ui.cd[ui.index].ht&&(zr=ui.cd[ui.index].ht),ui.hovertemplate=zr||ui.trace.hovertemplate||!1}if(ui.xa&&ui.ya){var cn=ui.x0+ui.xa._offset,Rn=ui.x1+ui.xa._offset,qn=ui.y0+ui.ya._offset,jn=ui.y1+ui.ya._offset,fn=Math.min(cn,Rn),In=Math.max(cn,Rn),gi=Math.min(qn,jn),Ea=Math.max(qn,jn);lr.bbox={x0:fn+At,x1:In+At,y0:gi+Jr,y1:Ea+Jr}}ui.eventData=[lr],un.push(lr)}H._hoverdata=un;var Ci=et==="y"&&(Je.length>1||je.length>1)||et==="closest"&&kn&&je.length>1,Xi=a.combine(ze.plot_bgcolor||a.background,ze.paper_bgcolor),so=N(je,{gd:H,hovermode:et,rotateLabels:Ci,bgColor:Xi,container:ze._hoverlayer,outerContainer:ze._paper.node(),commonLabelOpts:ze.hoverlabel,hoverdistance:ze.hoverdistance}),io=so.hoverLabels;if(v.isUnifiedHover(et)||(R(io,Ci,ze,so.commonLabelBoundingBox),Z(io,Ci,ze._invScaleX,ze._invScaleY)),Se&&Se.tagName){var Mo=p.getComponentMethod("annotations","hasClickToShow")(H,un);n(G.select(Se),Mo?"pointer":"")}!Se||de||!le(H,ae,qr)||(qr&&H.emit("plotly_unhover",{event:ae,points:qr}),H.emit("plotly_hover",{event:ae,points:H._hoverdata,xaxes:ar,yaxes:kr,xvals:ke,yvals:xe}))}function z(H){return[H.trace.index,H.index,H.x0,H.y0,H.name,H.attr,H.xa?H.xa._id:"",H.ya?H.ya._id:""].join(",")}var F=/([\s\S]*)<\/extra>/;function N(H,ae){var ie=ae.gd,de=ie._fullLayout,Se=ae.hovermode,Le=ae.rotateLabels,Fe=ae.bgColor,ze=ae.container,Ye=ae.outerContainer,st=ae.commonLabelOpts||{};if(H.length===0)return[[]];var ct=ae.fontFamily||T.HOVERFONT,at=ae.fontSize||T.HOVERFONTSIZE,et=ae.fontWeight||de.font.weight,Pe=ae.fontStyle||de.font.style,Ae=ae.fontVariant||de.font.variant,pe=ae.fontTextcase||de.font.textcase,Ne=ae.fontLineposition||de.font.lineposition,ut=ae.fontShadow||de.font.shadow,dt=H[0],nt=dt.xa,Ft=dt.ya,Nt=Se.charAt(0),Qt=Nt+"Label",ar=dt[Qt];if(ar===void 0&&nt.type==="multicategory")for(var kr=0;krde.width-At&&(lr=de.width-At),pi.attr("d","M"+(qr-lr)+",0L"+(qr-lr+m)+","+Jr+m+"H"+At+"v"+Jr+(u*2+Dr.height)+"H"+-At+"V"+Jr+m+"H"+(qr-lr-m)+"Z"),qr=lr,Ee.minX=qr-At,Ee.maxX=qr+At,nt.side==="top"?(Ee.minY=un-(u*2+Dr.height),Ee.maxY=un-u):(Ee.minY=un+u,Ee.maxY=un+(u*2+Dr.height))}else{var zr,cn,Rn;Ft.side==="right"?(zr="start",cn=1,Rn="",qr=nt._offset+nt._length):(zr="end",cn=-1,Rn="-",qr=nt._offset),un=Ft._offset+(dt.y0+dt.y1)/2,Si.attr("text-anchor",zr),pi.attr("d","M0,0L"+Rn+m+","+m+"V"+(u+Dr.height/2)+"h"+Rn+(u*2+Dr.width)+"V-"+(u+Dr.height/2)+"H"+Rn+m+"V-"+m+"Z"),Ee.minY=un-(u+Dr.height/2),Ee.maxY=un+(u+Dr.height/2),Ft.side==="right"?(Ee.minX=qr+m,Ee.maxX=qr+m+(u*2+Dr.width)):(Ee.minX=qr-m-(u*2+Dr.width),Ee.maxX=qr-m);var qn=Dr.height/2,jn=$r-Dr.top-qn,fn="clip"+de._uid+"commonlabel"+Ft._id,In;if(qrpi.hoverinfo!=="none");if(Hn.length===0)return[];var Xe=de.hoverlabel,Qe=Xe.font,Lt=Hn[0],Ct=((Se==="x unified"?Lt.xa:Lt.ya).unifiedhovertitle||{}).text,Ot=Ct?S.hovertemplateString({data:Se==="x unified"?[{xa:Lt.xa,x:Lt.xVal}]:[{ya:Lt.ya,y:Lt.yVal}],fallback:Lt.trace.hovertemplatefallback,locale:de._d3locale,template:Ct}):ar,Kt={showlegend:!0,legend:{title:{text:Ot,font:Qe},font:Qe,bgcolor:Xe.bgcolor,bordercolor:Xe.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:de.legend?de.legend.traceorder:void 0,orientation:"v"}},xr={font:Qe};l(Kt,xr,ie._fullData);var mr=xr.legend;mr.entries=[];for(var vr=0;vr=0?ha=gn:An+ka=0?ha=An:Qn+ka=0?_a=Gr:ln+Va=0?_a=ln:pa+Va=0,(Hn.idealAlign==="top"||!Ci)&&Xi?(Rn-=jn/2,Hn.anchor="end"):Ci?(Rn+=jn/2,Hn.anchor="start"):Hn.anchor="middle",Hn.crossPos=Rn;else{if(Hn.pos=Rn,Ci=cn+qn/2+Ea<=Sr,Xi=cn-qn/2-Ea>=0,(Hn.idealAlign==="left"||!Ci)&&Xi)cn-=qn/2,Hn.anchor="end";else if(Ci)cn+=qn/2,Hn.anchor="start";else{Hn.anchor="middle";var so=Ea/2,io=cn+so-Sr,Mo=cn-so;io>0&&(cn-=io),Mo<0&&(cn+=-Mo)}Hn.crossPos=cn}un.attr("text-anchor",Hn.anchor),At&&Jr.attr("text-anchor",Hn.anchor),pi.attr("transform",e(cn,Rn)+(Le?t(x):""))}),{hoverLabels:Ca,commonLabelBoundingBox:Ee}}function B(H,ae,ie,de,Se,Le){var Fe,ze,Ye="",st="";H.nameOverride!==void 0&&(H.name=H.nameOverride),H.name&&(H.trace._meta&&(H.name=S.templateString(H.name,H.trace._meta)),Ye=V(H.name,H.nameLength));var ct=ie.charAt(0),at=ct==="x"?"y":"x";H.zLabel!==void 0?(H.xLabel!==void 0&&(st+="x: "+H.xLabel+"
"),H.yLabel!==void 0&&(st+="y: "+H.yLabel+"
"),H.trace.type!=="choropleth"&&H.trace.type!=="choroplethmapbox"&&H.trace.type!=="choroplethmap"&&(st+=(st?"z: ":"")+H.zLabel)):ae&&H[ct+"Label"]===Se?st=H[at+"Label"]||"":H.xLabel===void 0?H.yLabel!==void 0&&H.trace.type!=="scattercarpet"&&(st=H.yLabel):H.yLabel===void 0?st=H.xLabel:st="("+H.xLabel+", "+H.yLabel+")",(H.text||H.text===0)&&!Array.isArray(H.text)&&(st+=(st?"
":"")+H.text),H.extraText!==void 0&&(st+=(st?"
":"")+H.extraText),Le&&st===""&&!H.hovertemplate&&(Ye===""&&Le.remove(),st=Ye),(ze=(Fe=H.trace)==null?void 0:Fe.hoverlabel)!=null&&ze.split&&(H.hovertemplate="");const{hovertemplate:et=!1}=H;if(et){const Pe=H.hovertemplateLabels||H;H[ct+"Label"]!==Se&&(Pe[ct+"other"]=Pe[ct+"Val"],Pe[ct+"otherLabel"]=Pe[ct+"Label"]),st=S.hovertemplateString({data:[H.eventData[0]||{},H.trace._meta],fallback:H.trace.hovertemplatefallback,labels:Pe,locale:de._d3locale,template:et}),st=st.replace(F,(Ae,pe)=>(Ye=V(pe,H.nameLength),""))}return[st,Ye]}function R(H,ae,ie,de){var Se=ae?"xa":"ya",Le=ae?"ya":"xa",Fe=0,ze=1,Ye=H.size(),st=new Array(Ye),ct=0,at=de.minX,et=de.maxX,Pe=de.minY,Ae=de.maxY,pe=function(ke){return ke*ie._invScaleX},Ne=function(ke){return ke*ie._invScaleY};H.each(function(ke){var xe=ke[Se],ye=ke[Le],Ee=xe._id.charAt(0)==="x",Xe=xe.range;ct===0&&Xe&&Xe[0]>Xe[1]!==Ee&&(ze=-1);var Qe=0,Lt=Ee?ie.width:ie.height;if(ie.hovermode==="x"||ie.hovermode==="y"){var Ct=U(ke,ae),Ot=ke.anchor,Kt=Ot==="end"?-1:1,xr,mr;if(Ot==="middle")xr=ke.crossPos+(Ee?Ne(Ct.y-ke.by/2):pe(ke.bx/2+ke.tx2width/2)),mr=xr+(Ee?Ne(ke.by):pe(ke.bx));else if(Ee)xr=ke.crossPos+Ne(m+Ct.y)-Ne(ke.by/2-m),mr=xr+Ne(ke.by);else{var vr=pe(Kt*m+Ct.x),Nr=vr+pe(Kt*ke.bx);xr=ke.crossPos+Math.min(vr,Nr),mr=ke.crossPos+Math.max(vr,Nr)}Ee?Pe!==void 0&&Ae!==void 0&&Math.min(mr,Ae)-Math.max(xr,Pe)>1&&(ye.side==="left"?(Qe=ye._mainLinePosition,Lt=ie.width):Lt=ye._mainLinePosition):at!==void 0&&et!==void 0&&Math.min(mr,et)-Math.max(xr,at)>1&&(ye.side==="top"?(Qe=ye._mainLinePosition,Lt=ie.height):Lt=ye._mainLinePosition)}st[ct++]=[{datum:ke,traceIndex:ke.trace.index,dp:0,pos:ke.pos,posref:ke.posref,size:ke.by*(Ee?M:1)/2,pmin:Qe,pmax:Lt}]}),st.sort(function(ke,xe){return ke[0].posref-xe[0].posref||ze*(xe[0].traceIndex-ke[0].traceIndex)});var ut,dt,nt,Ft,Nt,Qt,ar;function kr(ke){var xe=ke[0],ye=ke[ke.length-1];if(dt=xe.pmin-xe.pos-xe.dp+xe.size,nt=ye.pos+ye.dp+ye.size-xe.pmax,dt>.01){for(Nt=ke.length-1;Nt>=0;Nt--)ke[Nt].dp+=dt;ut=!1}if(!(nt<.01)){if(dt<-.01){for(Nt=ke.length-1;Nt>=0;Nt--)ke[Nt].dp-=nt;ut=!1}if(ut){var Ee=0;for(Ft=0;Ftxe.pmax&&Ee++;for(Ft=ke.length-1;Ft>=0&&!(Ee<=0);Ft--)Qt=ke[Ft],Qt.pos>xe.pmax-1&&(Qt.del=!0,Ee--);for(Ft=0;Ft=0;Nt--)ke[Nt].dp-=nt;for(Ft=ke.length-1;Ft>=0&&!(Ee<=0);Ft--)Qt=ke[Ft],Qt.pos+Qt.dp+Qt.size>xe.pmax&&(Qt.del=!0,Ee--)}}}for(;!ut&&Fe<=Ye;){for(Fe++,ut=!0,Ft=0;Ft.01){for(Nt=$r.length-1;Nt>=0;Nt--)$r[Nt].dp+=dt;for(Er.push.apply(Er,$r),st.splice(Ft+1,1),ar=0,Nt=Er.length-1;Nt>=0;Nt--)ar+=Er[Nt].dp;for(nt=ar/Er.length,Nt=Er.length-1;Nt>=0;Nt--)Er[Nt].dp-=nt;ut=!1}else Ft++}st.forEach(kr)}for(Ft=st.length-1;Ft>=0;Ft--){var Mt=st[Ft];for(Nt=Mt.length-1;Nt>=0;Nt--){var je=Mt[Nt],Je=je.datum;Je.offset=je.dp,Je.del=je.del}}}function U(H,ae){var ie=0,de=H.offset;return ae&&(de*=-w,ie=H.offset*_),{x:ie,y:de}}function j(H){var ae={start:1,end:-1,middle:0}[H.anchor],ie=ae*(m+u),de=ie+ae*(H.txwidth+u),Se=H.anchor==="middle";return Se&&(ie-=H.tx2width/2,de+=H.txwidth/2+u),{alignShift:ae,textShiftX:ie,text2ShiftX:de}}function Z(H,ae,ie,de){var Se=function(Fe){return Fe*ie},Le=function(Fe){return Fe*de};H.each(function(Fe){var ze=G.select(this);if(Fe.del)return ze.remove();var Ye=ze.select("text.nums"),st=Fe.anchor,ct=st==="end"?-1:1,at=j(Fe),et=U(Fe,ae),Pe=et.x,Ae=et.y,pe=st==="middle",Ne="hoverlabel"in Fe.trace?Fe.trace.hoverlabel.showarrow:!0,ut;pe?ut="M-"+Se(Fe.bx/2+Fe.tx2width/2)+","+Le(Ae-Fe.by/2)+"h"+Se(Fe.bx)+"v"+Le(Fe.by)+"h-"+Se(Fe.bx)+"Z":Ne?ut="M0,0L"+Se(ct*m+Pe)+","+Le(m+Ae)+"v"+Le(Fe.by/2-m)+"h"+Se(ct*Fe.bx)+"v-"+Le(Fe.by)+"H"+Se(ct*m+Pe)+"V"+Le(Ae-m)+"Z":ut="M"+Se(ct*m+Pe)+","+Le(Ae-Fe.by/2)+"h"+Se(ct*Fe.bx)+"v"+Le(Fe.by)+"h"+Se(-ct*Fe.bx)+"Z",ze.select("path").attr("d",ut);var dt=Pe+at.textShiftX,nt=Ae+Fe.ty0-Fe.by/2+u,Ft=Fe.textAlign||"auto";Ft!=="auto"&&(Ft==="left"&&st!=="start"?(Ye.attr("text-anchor","start"),dt=pe?-Fe.bx/2-Fe.tx2width/2+u:-Fe.bx-u):Ft==="right"&&st!=="end"&&(Ye.attr("text-anchor","end"),dt=pe?Fe.bx/2-Fe.tx2width/2-u:Fe.bx+u)),Ye.call(o.positionText,Se(dt),Le(nt)),Fe.tx2width&&(ze.select("text.name").call(o.positionText,Se(at.text2ShiftX+at.alignShift*u+Pe),Le(Ae+Fe.ty0-Fe.by/2+u)),ze.select("rect").call(i.setRect,Se(at.text2ShiftX+(at.alignShift-1)*Fe.tx2width/2+Pe),Le(Ae-Fe.by/2-1),Se(Fe.tx2width),Le(Fe.by+2)))})}function re(H,ae){var ie=H.index,de=H.trace||{},Se=H.cd[0],Le=H.cd[ie]||{};function Fe(et){return et||h(et)&&et===0}var ze=Array.isArray(ie)?function(et,Pe){var Ae=S.castOption(Se,ie,et);return Fe(Ae)?Ae:S.extractOption({},de,"",Pe)}:function(et,Pe){return S.extractOption(Le,de,et,Pe)};function Ye(et,Pe,Ae){var pe=ze(Pe,Ae);Fe(pe)&&(H[et]=pe)}if(Ye("hoverinfo","hi","hoverinfo"),Ye("bgcolor","hbg","hoverlabel.bgcolor"),Ye("borderColor","hbc","hoverlabel.bordercolor"),Ye("fontFamily","htf","hoverlabel.font.family"),Ye("fontSize","hts","hoverlabel.font.size"),Ye("fontColor","htc","hoverlabel.font.color"),Ye("fontWeight","htw","hoverlabel.font.weight"),Ye("fontStyle","hty","hoverlabel.font.style"),Ye("fontVariant","htv","hoverlabel.font.variant"),Ye("nameLength","hnl","hoverlabel.namelength"),Ye("textAlign","hta","hoverlabel.align"),H.posref=ae==="y"||ae==="closest"&&de.orientation==="h"?H.xa._offset+(H.x0+H.x1)/2:H.ya._offset+(H.y0+H.y1)/2,H.x0=S.constrain(H.x0,0,H.xa._length),H.x1=S.constrain(H.x1,0,H.xa._length),H.y0=S.constrain(H.y0,0,H.ya._length),H.y1=S.constrain(H.y1,0,H.ya._length),H.xLabelVal!==void 0&&(H.xLabel="xLabel"in H?H.xLabel:f.hoverLabelText(H.xa,H.xLabelVal,de.xhoverformat),H.xVal=H.xa.c2d(H.xLabelVal)),H.yLabelVal!==void 0&&(H.yLabel="yLabel"in H?H.yLabel:f.hoverLabelText(H.ya,H.yLabelVal,de.yhoverformat),H.yVal=H.ya.c2d(H.yLabelVal)),H.zLabelVal!==void 0&&H.zLabel===void 0&&(H.zLabel=String(H.zLabelVal)),!isNaN(H.xerr)&&!(H.xa.type==="log"&&H.xerr<=0)){var st=f.tickText(H.xa,H.xa.c2l(H.xerr),"hover").text;H.xerrneg!==void 0?H.xLabel+=" +"+st+" / -"+f.tickText(H.xa,H.xa.c2l(H.xerrneg),"hover").text:H.xLabel+=" ± "+st,ae==="x"&&(H.distance+=1)}if(!isNaN(H.yerr)&&!(H.ya.type==="log"&&H.yerr<=0)){var ct=f.tickText(H.ya,H.ya.c2l(H.yerr),"hover").text;H.yerrneg!==void 0?H.yLabel+=" +"+ct+" / -"+f.tickText(H.ya,H.ya.c2l(H.yerrneg),"hover").text:H.yLabel+=" ± "+ct,ae==="y"&&(H.distance+=1)}var at=H.hoverinfo||H.trace.hoverinfo;return at&&at!=="all"&&(at=Array.isArray(at)?at:at.split("+"),at.indexOf("x")===-1&&(H.xLabel=void 0),at.indexOf("y")===-1&&(H.yLabel=void 0),at.indexOf("z")===-1&&(H.zLabel=void 0),at.indexOf("text")===-1&&(H.text=void 0),at.indexOf("name")===-1&&(H.name=void 0)),H}function fe(H,ae,ie){var de=ie.container,Se=ie.fullLayout,Le=Se._size,Fe=ie.event,ze=!!ae.hLinePoint,Ye=!!ae.vLinePoint,st,ct;if(de.selectAll(".spikeline").remove(),!!(Ye||ze)){var at=a.combine(Se.plot_bgcolor,Se.paper_bgcolor);if(ze){var et=ae.hLinePoint,Pe,Ae;st=et&&et.xa,ct=et&&et.ya;var pe=ct.spikesnap;pe==="cursor"?(Pe=Fe.pointerX,Ae=Fe.pointerY):(Pe=st._offset+et.x,Ae=ct._offset+et.y);var Ne=b.readability(et.color,at)<1.5?a.contrast(at):et.color,ut=ct.spikemode,dt=ct.spikethickness,nt=ct.spikecolor||Ne,Ft=f.getPxPosition(H,ct),Nt,Qt;if(ut.indexOf("toaxis")!==-1||ut.indexOf("across")!==-1){if(ut.indexOf("toaxis")!==-1&&(Nt=Ft,Qt=Pe),ut.indexOf("across")!==-1){var ar=ct._counterDomainMin,kr=ct._counterDomainMax;ct.anchor==="free"&&(ar=Math.min(ar,ct.position),kr=Math.max(kr,ct.position)),Nt=Le.l+ar*Le.w,Qt=Le.l+kr*Le.w}de.insert("line",":first-child").attr({x1:Nt,x2:Qt,y1:Ae,y2:Ae,"stroke-width":dt,stroke:nt,"stroke-dasharray":i.dashStyle(ct.spikedash,dt)}).classed("spikeline",!0).classed("crisp",!0),de.insert("line",":first-child").attr({x1:Nt,x2:Qt,y1:Ae,y2:Ae,"stroke-width":dt+2,stroke:at}).classed("spikeline",!0).classed("crisp",!0)}ut.indexOf("marker")!==-1&&de.insert("circle",":first-child").attr({cx:Ft+(ct.side!=="right"?dt:-dt),cy:Ae,r:dt,fill:nt}).classed("spikeline",!0)}if(Ye){var Er=ae.vLinePoint,$r,Sr;st=Er&&Er.xa,ct=Er&&Er.ya;var Ur=st.spikesnap;Ur==="cursor"?($r=Fe.pointerX,Sr=Fe.pointerY):($r=st._offset+Er.x,Sr=ct._offset+Er.y);var Mt=b.readability(Er.color,at)<1.5?a.contrast(at):Er.color,je=st.spikemode,Je=st.spikethickness,ke=st.spikecolor||Mt,xe=f.getPxPosition(H,st),ye,Ee;if(je.indexOf("toaxis")!==-1||je.indexOf("across")!==-1){if(je.indexOf("toaxis")!==-1&&(ye=xe,Ee=Sr),je.indexOf("across")!==-1){var Xe=st._counterDomainMin,Qe=st._counterDomainMax;st.anchor==="free"&&(Xe=Math.min(Xe,st.position),Qe=Math.max(Qe,st.position)),ye=Le.t+(1-Qe)*Le.h,Ee=Le.t+(1-Xe)*Le.h}de.insert("line",":first-child").attr({x1:$r,x2:$r,y1:ye,y2:Ee,"stroke-width":Je,stroke:ke,"stroke-dasharray":i.dashStyle(st.spikedash,Je)}).classed("spikeline",!0).classed("crisp",!0),de.insert("line",":first-child").attr({x1:$r,x2:$r,y1:ye,y2:Ee,"stroke-width":Je+2,stroke:at}).classed("spikeline",!0).classed("crisp",!0)}je.indexOf("marker")!==-1&&de.insert("circle",":first-child").attr({cx:$r,cy:xe-(st.side!=="top"?Je:-Je),r:Je,fill:ke}).classed("spikeline",!0)}}}function le(H,ae,ie){if(!ie||ie.length!==H._hoverdata.length)return!0;for(var de=ie.length-1;de>=0;de--){var Se=ie[de],Le=H._hoverdata[de];if(Se.curveNumber!==Le.curveNumber||String(Se.pointNumber)!==String(Le.pointNumber)||String(Se.pointNumbers)!==String(Le.pointNumbers)||Se.binNumber!==Le.binNumber)return!0}return!1}function ce(H,ae){return!0}function V(H,ae){return o.plainText(H||"",{len:ae,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function ee(H,ae){for(var ie=ae.charAt(0),de=[],Se=[],Le=[],Fe=0;FeH.offsetTop+H.clientTop,ue=H=>H.offsetLeft+H.clientLeft;function te(H,ae){var ie=H._fullLayout,de=ae.getBoundingClientRect(),Se=de.left,Le=de.top,Fe=Se+de.width,ze=Le+de.height,Ye=S.apply3DTransform(ie._invTransform)(Se,Le),st=S.apply3DTransform(ie._invTransform)(Fe,ze),ct=Ye[0],at=Ye[1],et=st[0],Pe=st[1];return{x:ct,y:at,width:et-ct,height:Pe-at,top:Math.min(at,Pe),left:Math.min(ct,et),right:Math.max(ct,et),bottom:Math.max(at,Pe)}}}}),vx=Ge({"src/components/fx/hoverlabel_defaults.js"(K,G){var h=_n(),b=go(),S=Kd().isUnifiedHover;G.exports=function(e,t,r,o){o=o||{};var n=t.legend;function i(a){o.font[a]||(o.font[a]=n?t.legend.font[a]:t.font[a])}t&&S(t.hovermode)&&(o.font||(o.font={}),i("size"),i("family"),i("color"),i("weight"),i("style"),i("variant"),n?(o.bgcolor||(o.bgcolor=b.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),r("hoverlabel.bgcolor",o.bgcolor),r("hoverlabel.bordercolor",o.bordercolor),r("hoverlabel.namelength",o.namelength),r("hoverlabel.showarrow",o.showarrow),h.coerceFont(r,"hoverlabel.font",o.font),r("hoverlabel.align",o.align)}}}),BM=Ge({"src/components/fx/layout_global_defaults.js"(K,G){var h=_n(),b=vx(),S=cc();G.exports=function(e,t){function r(o,n){return h.coerce(e,t,S,o,n)}b(e,t,r)}}}),NM=Ge({"src/components/fx/defaults.js"(K,G){var h=_n(),b=Od(),S=vx();G.exports=function(e,t,r,o){function n(a,s){return h.coerce(e,t,b,a,s)}var i=h.extendFlat({},o.hoverlabel);t.hovertemplate&&(i.namelength=-1),S(e,t,n,i)}}}),i5=Ge({"src/components/fx/hovermode_defaults.js"(K,G){var h=_n(),b=cc();G.exports=function(E,e){function t(r,o){return e[r]!==void 0?e[r]:h.coerce(E,e,b,r,o)}return t("clickmode"),t("hoversubplots"),t("hovermode")}}}),UM=Ge({"src/components/fx/layout_defaults.js"(K,G){var h=_n(),b=cc(),S=i5(),E=vx();G.exports=function(t,r){function o(p,v){return h.coerce(t,r,b,p,v)}var n=S(t,r);n&&(o("hoverdistance"),o("spikedistance"));var i=o("dragmode");i==="select"&&o("selectdirection");var a=r._has("mapbox"),s=r._has("map"),f=r._has("geo"),c=r._basePlotModules.length;r.dragmode==="zoom"&&((a||s||f)&&c===1||(a||s)&&f&&c===2)&&(r.dragmode="pan"),E(t,r,o),h.coerceFont(o,"hoverlabel.grouptitlefont",r.hoverlabel.font)}}}),Jw=Ge({"src/components/fx/calc.js"(K,G){var h=_n(),b=Ro();G.exports=function(e){var t=e.calcdata,r=e._fullLayout;function o(f){return function(c){return h.coerceHoverinfo({hoverinfo:c},{_module:f._module},r)}}for(var n=0;n"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),mx=Ge({"src/components/shapes/draw_newshape/constants.js"(K,G){var h=32;G.exports={CIRCLE_SIDES:h,i000:0,i090:h/4,i180:h/2,i270:h/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),gx=Ge({"src/components/selections/helpers.js"(K,G){var h=_n().strTranslate;function b(t,r){switch(t.type){case"log":return t.p2d(r);case"date":return t.p2r(r,0,t.calendar);default:return t.p2r(r)}}function S(t,r){switch(t.type){case"log":return t.d2p(r);case"date":return t.r2p(r,0,t.calendar);default:return t.r2p(r)}}function E(t){var r=t._id.charAt(0)==="y"?1:0;return function(o){return b(t,o[r])}}function e(t){return h(t.xaxis._offset,t.yaxis._offset)}G.exports={p2r:b,r2p:S,axValue:E,getTransform:e}}}),_p=Ge({"src/components/shapes/draw_newshape/helpers.js"(K){var G=lm(),h=mx(),b=h.CIRCLE_SIDES,S=h.SQRT2,E=gx(),e=E.p2r,t=E.r2p,r=[0,3,4,5,6,1,2],o=[0,3,4,1,2];K.writePaths=function(a){var s=a.length;if(!s)return"M0,0Z";for(var f="",c=0;c0&&gl&&(x="X"),x});return c>l&&(g=g.replace(/[\s,]*X.*/,""),h.log("Ignoring extra params in segment "+f)),p+g})}function E(e,t){t=t||0;var r=0;return t&&e&&(e.type==="category"||e.type==="multicategory")&&(r=(e.r2p(1)-e.r2p(0))*t),r}}}),e2=Ge({"src/components/shapes/display_labels.js"(K,G){var h=_n(),b=Ts(),S=nc(),E=As(),e=_p().readPaths,t=fm(),r=t.getPathString,o=lv(),n=ad().FROM_TL;G.exports=function(f,c,p,v){if(v.selectAll(".shape-label").remove(),!!(p.label.text||p.label.texttemplate)){var T;if(p.label.texttemplate){var l={};if(p.type!=="path"){var g=b.getFromId(f,p.xref),x=b.getFromId(f,p.yref);for(var A in o){var M=o[A](p,g,x);M!==void 0&&(l[A]=M)}}T=h.texttemplateStringForShapes({data:[l],fallback:p.label.texttemplatefallback,locale:f._fullLayout._d3locale,template:p.label.texttemplate})}else T=p.label.text;var _={"data-index":c},w=p.label.font,m={"data-notex":1},u=v.append("g").attr(_).classed("shape-label",!0),d=u.append("text").attr(m).classed("shape-label-text",!0).text(T),y,I,L,z;if(p.path){var F=r(f,p),N=e(F,f);y=1/0,L=1/0,I=-1/0,z=-1/0;for(var B=0;B=s?v=f-p:v=p-f,-180/Math.PI*Math.atan2(v,T)}function a(s,f,c,p,v,T,l){var g=v.label.textposition,x=v.label.textangle,A=v.label.padding,M=v.type,_=Math.PI/180*T,w=Math.sin(_),m=Math.cos(_),u=v.label.xanchor,d=v.label.yanchor,y,I,L,z;if(M==="line"){g==="start"?(y=s,I=f):g==="end"?(y=c,I=p):(y=(s+c)/2,I=(f+p)/2),u==="auto"&&(g==="start"?x==="auto"?c>s?u="left":cs?u="right":cs?u="right":cs?u="left":c1&&!(at.length===2&&at[1][0]==="Z")&&(V===0&&(at[0][0]="M"),y[ce]=at,N(),B())}}function de(at,et){if(at===2){ce=+et.srcElement.getAttribute("data-i"),V=+et.srcElement.getAttribute("data-j");var Pe=y[ce];!T(Pe)&&!l(Pe)&&ie()}}function Se(at){fe=[];for(var et=0;etN&&Xe>B&&!xe.shiftKey?s.getCursor(Qe/Ee,1-Lt/Xe):"move";f(y,Ct),Nt=Ct.split("-")[0]}}function Er(xe){l(d)||(R&&(ee=pe(I.xanchor)),U&&(ne=Ne(I.yanchor)),I.type==="path"?Le=I.path:(fe=R?I.x0:pe(I.x0),le=U?I.y0:Ne(I.y0),ce=R?I.x1:pe(I.x1),V=U?I.y1:Ne(I.y1)),feV?($=le,ae="y0",ue=V,ie="y1"):($=V,ae="y1",ue=le,ie="y0"),kr(xe),je(z,I),ke(y,I,d),Ft.moveFn=Nt==="move"?Ur:Mt,Ft.altKey=xe.altKey)}function $r(){l(d)||(f(y),Je(z),A(y,d,I),b.call("_guiRelayout",d,F.getUpdateObj()))}function Sr(){l(d)||Je(z)}function Ur(xe,ye){if(I.type==="path"){var Ee=function(Lt){return Lt},Xe=Ee,Qe=Ee;R?re("xanchor",I.xanchor=ut(ee+xe)):(Xe=function(Ct){return ut(pe(Ct)+xe)},ze&&ze.type==="date"&&(Xe=p.encodeDate(Xe))),U?re("yanchor",I.yanchor=dt(ne+ye)):(Qe=function(Ct){return dt(Ne(Ct)+ye)},st&&st.type==="date"&&(Qe=p.encodeDate(Qe))),re("path",I.path=_(Le,Xe,Qe))}else R?re("xanchor",I.xanchor=ut(ee+xe)):(re("x0",I.x0=ut(fe+xe)),re("x1",I.x1=ut(ce+xe))),U?re("yanchor",I.yanchor=dt(ne+ye)):(re("y0",I.y0=dt(le+ye)),re("y1",I.y1=dt(V+ye)));y.attr("d",v(d,I)),je(z,I),r(d,L,I,Fe)}function Mt(xe,ye){if(Z){var Ee=function(Un){return Un},Xe=Ee,Qe=Ee;R?re("xanchor",I.xanchor=ut(ee+xe)):(Xe=function(ka){return ut(pe(ka)+xe)},ze&&ze.type==="date"&&(Xe=p.encodeDate(Xe))),U?re("yanchor",I.yanchor=dt(ne+ye)):(Qe=function(ka){return dt(Ne(ka)+ye)},st&&st.type==="date"&&(Qe=p.encodeDate(Qe))),re("path",I.path=_(Le,Xe,Qe))}else if(j){if(Nt==="resize-over-start-point"){var Lt=fe+xe,Ct=U?le-ye:le+ye;re("x0",I.x0=R?Lt:ut(Lt)),re("y0",I.y0=U?Ct:dt(Ct))}else if(Nt==="resize-over-end-point"){var Ot=ce+xe,Kt=U?V-ye:V+ye;re("x1",I.x1=R?Ot:ut(Ot)),re("y1",I.y1=U?Kt:dt(Kt))}}else{var xr=function(Un){return Nt.indexOf(Un)!==-1},mr=xr("n"),vr=xr("s"),Nr=xr("w"),kn=xr("e"),$n=mr?$+ye:$,Vn=vr?ue+ye:ue,ra=Nr?te+xe:te,na=kn?H+xe:H;U&&(mr&&($n=$-ye),vr&&(Vn=ue-ye)),(!U&&Vn-$n>B||U&&$n-Vn>B)&&(re(ae,I[ae]=U?$n:dt($n)),re(ie,I[ie]=U?Vn:dt(Vn))),na-ra>N&&(re(de,I[de]=R?ra:ut(ra)),re(Se,I[Se]=R?na:ut(na)))}y.attr("d",v(d,I)),je(z,I),r(d,L,I,Fe)}function je(xe,ye){(R||U)&&Ee();function Ee(){var Xe=ye.type!=="path",Qe=xe.selectAll(".visual-cue").data([0]),Lt=1;Qe.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":Lt}).classed("visual-cue",!0);var Ct=pe(R?ye.xanchor:S.midRange(Xe?[ye.x0,ye.x1]:p.extractPathCoords(ye.path,c.paramIsX))),Ot=Ne(U?ye.yanchor:S.midRange(Xe?[ye.y0,ye.y1]:p.extractPathCoords(ye.path,c.paramIsY)));if(Ct=p.roundPositionForSharpStrokeRendering(Ct,Lt),Ot=p.roundPositionForSharpStrokeRendering(Ot,Lt),R&&U){var Kt="M"+(Ct-1-Lt)+","+(Ot-1-Lt)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Qe.attr("d",Kt)}else if(R){var xr="M"+(Ct-1-Lt)+","+(Ot-9-Lt)+"v18 h2 v-18 Z";Qe.attr("d",xr)}else{var mr="M"+(Ct-9-Lt)+","+(Ot-1-Lt)+"h18 v2 h-18 Z";Qe.attr("d",mr)}}}function Je(xe){xe.selectAll(".visual-cue").remove()}function ke(xe,ye,Ee){var Xe=ye.xref,Qe=ye.yref,Lt=E.getFromId(Ee,Xe),Ct=E.getFromId(Ee,Qe),Ot="";Xe!=="paper"&&!Lt.autorange&&(Ot+=Xe),Qe!=="paper"&&!Ct.autorange&&(Ot+=Qe),i.setClipUrl(xe,Ot?"clip"+Ee._fullLayout._uid+Ot:null,Ee)}}function _(d,y,I){return d.replace(c.segmentRE,function(L){var z=0,F=L.charAt(0),N=c.paramIsX[F],B=c.paramIsY[F],R=c.numParams[F],U=L.slice(1).replace(c.paramRE,function(j){return z>=R||(N[z]?j=y(j):B[z]&&(j=I(j)),z++),j});return F+U})}function w(d,y){if(g(d)){var I=y.node(),L=+I.getAttribute("data-index");if(L>=0){if(L===d._fullLayout._activeShapeIndex){m(d);return}d._fullLayout._activeShapeIndex=L,d._fullLayout._deactivateShape=m,T(d)}}}function m(d){if(g(d)){var y=d._fullLayout._activeShapeIndex;y>=0&&(o(d),delete d._fullLayout._activeShapeIndex,T(d))}}function u(d){if(g(d)){o(d);var y=d._fullLayout._activeShapeIndex,I=(d.layout||{}).shapes||[];if(y1?(le=["toggleHover"],ce=["resetViews"]):u?(fe=["zoomInGeo","zoomOutGeo"],le=["hoverClosestGeo"],ce=["resetGeo"]):m?(le=["hoverClosest3d"],ce=["resetCameraDefault3d","resetCameraLastSave3d"]):L?(fe=["zoomInMapbox","zoomOutMapbox"],le=["toggleHover"],ce=["resetViewMapbox"]):z?(fe=["zoomInMap","zoomOutMap"],le=["toggleHover"],ce=["resetViewMap"]):d?le=["hoverClosestPie"]:B?(le=["hoverClosestCartesian","hoverCompareCartesian"],ce=["resetViewSankey"]):le=["toggleHover"],w&&le.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||U)&&(le=[]),w&&!R&&(fe=["zoomIn2d","zoomOut2d","autoScale2d"],ce[0]!=="resetViews"&&(ce=["resetScale2d"])),m?V=["zoom3d","pan3d","orbitRotation","tableRotation"]:w&&!R||I?V=["zoom2d","pan2d"]:L||z||u?V=["pan2d"]:F&&(V=["zoom2d"]),a(T)&&V.push("select2d","lasso2d");var ee=[],ne=function(H){ee.indexOf(H)===-1&&le.indexOf(H)!==-1&&ee.push(H)};if(Array.isArray(M)){for(var $=[],ue=0;uex?T.slice(x):l.slice(g))+A}function f(p,v){for(var T=v._size,l=T.h/T.w,g={},x=Object.keys(p),A=0;At*I&&!N)){for(x=0;xV&&iele&&(le=ie);var Se=(le-fe)/(2*ce);u/=Se,fe=_.l2r(fe),le=_.l2r(le),_.range=_._input.range=j=B[1]||Z[1]<=B[0])&&re[0]R[0])return!0}return!1}function A(B){var R=B._fullLayout,U=R._size,j=U.p,Z=i.list(B,"",!0),re,fe,le,ce,V,ee;if(R._paperdiv.style({width:B._context.responsive&&R.autosize&&!B._context._hasZeroWidth&&!B.layout.width?"100%":R.width+"px",height:B._context.responsive&&R.autosize&&!B._context._hasZeroHeight&&!B.layout.height?"100%":R.height+"px"}).selectAll(".main-svg").call(r.setSize,R.width,R.height),B._context.setBackground(B,R.paper_bgcolor),K.drawMainTitle(B),n.manage(B),!R._has("cartesian"))return b.previousPromises(B);function ne(ke,xe,ye){var Ee=ke._lw/2;if(ke._id.charAt(0)==="x"){if(xe){if(ye==="top")return xe._offset-j-Ee}else return U.t+U.h*(1-(ke.position||0))+Ee%1;return xe._offset+xe._length+j+Ee}if(xe){if(ye==="right")return xe._offset+xe._length+j+Ee}else return U.l+U.w*(ke.position||0)+Ee%1;return xe._offset-j-Ee}for(re=0;re0){y(B,re,V,ce),le.attr({x:fe,y:re,"text-anchor":j,dy:z(R.yanchor)}).call(E.positionText,fe,re);var ee=(R.text.match(E.BR_TAG_ALL)||[]).length;if(ee){var ne=a.LINE_SPACING*ee+a.MID_SHIFT;R.y===0&&(ne=-ne),le.selectAll(".line").each(function(){var ae=+this.getAttribute("dy").slice(0,-2)-ne+"em";this.setAttribute("dy",ae)})}var $=G.select(B).selectAll(".gtitle-subtitle");if($.node()){var ue=le.node().getBBox(),te=ue.y+ue.height,H=te+o.SUBTITLE_PADDING_EM*R.subtitle.font.size;$.attr({x:fe,y:H,"text-anchor":j,dy:z(R.yanchor)}).call(E.positionText,fe,H)}}}};function m(B,R,U,j,Z){var re=R.yref==="paper"?B._fullLayout._size.h:B._fullLayout.height,fe=S.isTopAnchor(R)?j:j-Z,le=U==="b"?re-fe:fe;return S.isTopAnchor(R)&&U==="t"||S.isBottomAnchor(R)&&U==="b"?!1:le.5?"t":"b",fe=B._fullLayout.margin[re],le=0;return R.yref==="paper"?le=U+R.pad.t+R.pad.b:R.yref==="container"&&(le=u(re,j,Z,B._fullLayout.height,U)+R.pad.t+R.pad.b),le>fe?le:0}function y(B,R,U,j){var Z="title.automargin",re=B._fullLayout.title,fe=re.y>.5?"t":"b",le={x:re.x,y:re.y,t:0,b:0},ce={};re.yref==="paper"&&m(B,re,fe,R,j)?le[fe]=U:re.yref==="container"&&(ce[fe]=U,B._fullLayout._reservedMargin[Z]=ce),b.allowAutoMargin(B,Z),b.autoMargin(B,Z,le)}function I(B,R){var U=B.title,j=B._size,Z=0;return R===v?Z=U.pad.l:R===l&&(Z=-U.pad.r),U.xref==="paper"?j.l+j.w*U.x+Z:B.width*U.x+Z}function L(B,R){var U=B.title,j=B._size,Z=0;return R==="0em"||!R?Z=-U.pad.b:R===a.CAP_SHIFT+"em"&&(Z=U.pad.t),U.y==="auto"?j.t/2:U.yref==="paper"?j.t+j.h-j.h*U.y+Z:B.height-B.height*U.y+Z}function z(B){return B==="top"?a.CAP_SHIFT+.3+"em":B==="bottom"?"-0.3em":a.MID_SHIFT+"em"}function F(B){var R=B.title,U=T;return S.isRightAnchor(R)?U=l:S.isLeftAnchor(R)&&(U=v),U}function N(B){var R=B.title,U="0em";return S.isTopAnchor(R)?U=a.CAP_SHIFT+"em":S.isMiddleAnchor(R)&&(U=a.MID_SHIFT+"em"),U}K.doTraceStyle=function(B){var R=B.calcdata,U=[],j;for(j=0;j=0;F--){var N=M.append("path").attr(w).style("opacity",F?.1:m).call(E.stroke,d).call(E.fill,u).call(e.dashLine,F?"solid":I,F?4+y:y);if(s(N,v,g),L){var B=t(v.layout,"selections",g);N.style({cursor:"move"});var R={element:N.node(),plotinfo:x,gd:v,editHelpers:B,isActiveSelection:!0},U=h(_,v);b(U,N,R)}else N.style("pointer-events",F?"all":"none");z[F]=N}var j=z[0],Z=z[1];Z.node().addEventListener("click",function(){return f(v,j)})}}function s(v,T,l){var g=l.xref+l.yref;e.setClipUrl(v,"clip"+T._fullLayout._uid+g,T)}function f(v,T){if(i(v)){var l=T.node(),g=+l.getAttribute("data-index");if(g>=0){if(g===v._fullLayout._activeSelectionIndex){p(v);return}v._fullLayout._activeSelectionIndex=g,v._fullLayout._deactivateSelection=p,n(v)}}}function c(v){if(i(v)){var T=v._fullLayout.selections.length-1;v._fullLayout._activeSelectionIndex=T,v._fullLayout._deactivateSelection=p,n(v)}}function p(v){if(i(v)){var T=v._fullLayout._activeSelectionIndex;T>=0&&(S(v),delete v._fullLayout._activeSelectionIndex,n(v))}}}}),jM=Ge({"node_modules/polybooljs/lib/build-log.js"(K,G){function h(){var b,S=0,E=!1;function e(t,r){return b.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),b}return b={list:[],segmentId:function(){return S++},checkIntersection:function(t,r){return e("check",{seg1:t,seg2:r})},segmentChop:function(t,r){return e("div_seg",{seg:t,pt:r}),e("chop",{seg:t,pt:r})},statusRemove:function(t){return e("pop_seg",{seg:t})},segmentUpdate:function(t){return e("seg_update",{seg:t})},segmentNew:function(t,r){return e("new_seg",{seg:t,primary:r})},segmentRemove:function(t){return e("rem_seg",{seg:t})},tempStatus:function(t,r,o){return e("temp_status",{seg:t,above:r,below:o})},rewind:function(t){return e("rewind",{seg:t})},status:function(t,r,o){return e("status",{seg:t,above:r,below:o})},vert:function(t){return t===E?b:(E=t,e("vert",{x:t}))},log:function(t){return typeof t!="string"&&(t=JSON.stringify(t,!1," ")),e("log",{txt:t})},reset:function(){return e("reset")},selected:function(t){return e("selected",{segs:t})},chainStart:function(t){return e("chain_start",{seg:t})},chainRemoveHead:function(t,r){return e("chain_rem_head",{index:t,pt:r})},chainRemoveTail:function(t,r){return e("chain_rem_tail",{index:t,pt:r})},chainNew:function(t,r){return e("chain_new",{pt1:t,pt2:r})},chainMatch:function(t){return e("chain_match",{index:t})},chainClose:function(t){return e("chain_close",{index:t})},chainAddHead:function(t,r){return e("chain_add_head",{index:t,pt:r})},chainAddTail:function(t,r){return e("chain_add_tail",{index:t,pt:r})},chainConnect:function(t,r){return e("chain_con",{index1:t,index2:r})},chainReverse:function(t){return e("chain_rev",{index:t})},chainJoin:function(t,r){return e("chain_join",{index1:t,index2:r})},done:function(){return e("done")}},b}G.exports=h}}),qM=Ge({"node_modules/polybooljs/lib/epsilon.js"(K,G){function h(b){typeof b!="number"&&(b=1e-10);var S={epsilon:function(E){return typeof E=="number"&&(b=E),b},pointAboveOrOnLine:function(E,e,t){var r=e[0],o=e[1],n=t[0],i=t[1],a=E[0],s=E[1];return(n-r)*(s-o)-(i-o)*(a-r)>=-b},pointBetween:function(E,e,t){var r=E[1]-e[1],o=t[0]-e[0],n=E[0]-e[0],i=t[1]-e[1],a=n*o+r*i;if(a-b)},pointsSameX:function(E,e){return Math.abs(E[0]-e[0])b!=n-r>b&&(o-s)*(r-f)/(n-f)+s-t>b&&(i=!i),o=s,n=f}return i}};return S}G.exports=h}}),VM=Ge({"node_modules/polybooljs/lib/linked-list.js"(K,G){var h={create:function(){var b={root:{root:!0,next:null},exists:function(S){return!(S===null||S===b.root)},isEmpty:function(){return b.root.next===null},getHead:function(){return b.root.next},insertBefore:function(S,E){for(var e=b.root,t=b.root.next;t!==null;){if(E(t)){S.prev=t.prev,S.next=t,t.prev.next=S,t.prev=S;return}e=t,t=t.next}e.next=S,S.prev=e,S.next=null},findTransition:function(S){for(var E=b.root,e=b.root.next;e!==null&&!S(e);)E=e,e=e.next;return{before:E===b.root?null:E,after:e,insert:function(t){return t.prev=E,t.next=e,E.next=t,e!==null&&(e.prev=t),t}}}};return b},node:function(b){return b.prev=null,b.next=null,b.remove=function(){b.prev.next=b.next,b.next&&(b.next.prev=b.prev),b.prev=null,b.next=null},b}};G.exports=h}}),np=Ge({"node_modules/polybooljs/lib/intersecter.js"(K,G){var h=VM();function b(S,E,e){function t(T,l){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:null,below:null},otherFill:null}}function r(T,l,g){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:g.myFill.above,below:g.myFill.below},otherFill:null}}var o=h.create();function n(T,l,g,x,A,M){var _=E.pointsCompare(l,A);return _!==0?_:E.pointsSame(g,M)?0:T!==x?T?1:-1:E.pointAboveOrOnLine(g,x?A:M,x?M:A)?1:-1}function i(T,l){o.insertBefore(T,function(g){var x=n(T.isStart,T.pt,l,g.isStart,g.pt,g.other.pt);return x<0})}function a(T,l){var g=h.node({isStart:!0,pt:T.start,seg:T,primary:l,other:null,status:null});return i(g,T.end),g}function s(T,l,g){var x=h.node({isStart:!1,pt:l.end,seg:l,primary:g,other:T,status:null});T.other=x,i(x,T.pt)}function f(T,l){var g=a(T,l);return s(g,T,l),g}function c(T,l){e&&e.segmentChop(T.seg,l),T.other.remove(),T.seg.end=l,T.other.pt=l,i(T.other,T.pt)}function p(T,l){var g=r(l,T.seg.end,T.seg);return c(T,l),f(g,T.primary)}function v(T,l){var g=h.create();function x(N,B){var R=N.seg.start,U=N.seg.end,j=B.seg.start,Z=B.seg.end;return E.pointsCollinear(R,j,Z)?E.pointsCollinear(U,j,Z)||E.pointAboveOrOnLine(U,j,Z)?1:-1:E.pointAboveOrOnLine(R,j,Z)?1:-1}function A(N){return g.findTransition(function(B){var R=x(N,B.ev);return R>0})}function M(N,B){var R=N.seg,U=B.seg,j=R.start,Z=R.end,re=U.start,fe=U.end;e&&e.checkIntersection(R,U);var le=E.linesIntersect(j,Z,re,fe);if(le===!1){if(!E.pointsCollinear(j,Z,re)||E.pointsSame(j,fe)||E.pointsSame(Z,re))return!1;var ce=E.pointsSame(j,re),V=E.pointsSame(Z,fe);if(ce&&V)return B;var ee=!ce&&E.pointBetween(j,re,fe),ne=!V&&E.pointBetween(Z,re,fe);if(ce)return ne?p(B,Z):p(N,fe),B;ee&&(V||(ne?p(B,Z):p(N,fe)),p(B,j))}else le.alongA===0&&(le.alongB===-1?p(N,re):le.alongB===0?p(N,le.pt):le.alongB===1&&p(N,fe)),le.alongB===0&&(le.alongA===-1?p(B,j):le.alongA===0?p(B,le.pt):le.alongA===1&&p(B,Z));return!1}for(var _=[];!o.isEmpty();){var w=o.getHead();if(e&&e.vert(w.pt[0]),w.isStart){let N=function(){if(u){var B=M(w,u);if(B)return B}return d?M(w,d):!1};e&&e.segmentNew(w.seg,w.primary);var m=A(w),u=m.before?m.before.ev:null,d=m.after?m.after.ev:null;e&&e.tempStatus(w.seg,u?u.seg:!1,d?d.seg:!1);var y=N();if(y){if(S){var I;w.seg.myFill.below===null?I=!0:I=w.seg.myFill.above!==w.seg.myFill.below,I&&(y.seg.myFill.above=!y.seg.myFill.above)}else y.seg.otherFill=w.seg.myFill;e&&e.segmentUpdate(y.seg),w.other.remove(),w.remove()}if(o.getHead()!==w){e&&e.rewind(w.seg);continue}if(S){var I;w.seg.myFill.below===null?I=!0:I=w.seg.myFill.above!==w.seg.myFill.below,d?w.seg.myFill.below=d.seg.myFill.above:w.seg.myFill.below=T,I?w.seg.myFill.above=!w.seg.myFill.below:w.seg.myFill.above=w.seg.myFill.below}else if(w.seg.otherFill===null){var L;d?w.primary===d.primary?L=d.seg.otherFill.above:L=d.seg.myFill.above:L=w.primary?l:T,w.seg.otherFill={above:L,below:L}}e&&e.status(w.seg,u?u.seg:!1,d?d.seg:!1),w.other.status=m.insert(h.node({ev:w}))}else{var z=w.status;if(z===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(g.exists(z.prev)&&g.exists(z.next)&&M(z.prev.ev,z.next.ev),e&&e.statusRemove(z.ev.seg),z.remove(),!w.primary){var F=w.seg.myFill;w.seg.myFill=w.seg.otherFill,w.seg.otherFill=F}_.push(w.seg)}o.getHead().remove()}return e&&e.done(),_}return S?{addRegion:function(T){for(var l,g=T[T.length-1],x=0;xr!=p>r&&t<(c-s)*(r-f)/(p-f)+s;v&&(o=!o)}return o}}}),ny=Ge({"src/lib/polygon.js"(K,G){var h=sx().dot,b=Ii().BADNUM,S=G.exports={};S.tester=function(e){var t=e.slice(),r=t[0][0],o=r,n=t[0][1],i=n,a;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),a=1;ao||A===b||Ai||g&&f(l))}function p(l,g){var x=l[0],A=l[1];if(x===b||xo||A===b||Ai)return!1;var M=t.length,_=t[0][0],w=t[0][1],m=0,u,d,y,I,L;for(u=1;uMath.max(d,_)||A>Math.max(y,w)))if(Aa||Math.abs(h(p,f))>o)return!0;return!1},S.filter=function(e,t){var r=[e[0]],o=0,n=0;function i(s){e.push(s);var f=r.length,c=o;r.splice(n+1);for(var p=c+1;p1){var a=e.pop();i(a)}return{addPt:i,raw:e,filtered:r}}}}),HM=Ge({"src/components/selections/constants.js"(K,G){G.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),ay=Ge({"src/components/selections/select.js"(K,G){var h=h5(),b=d5(),S=Ro(),E=As().dashStyle,e=go(),t=Yf(),r=Kd().makeEventData,o=jp(),n=o.freeMode,i=o.rectMode,a=o.drawMode,s=o.openMode,f=o.selectMode,c=fm(),p=yx(),v=ag(),T=om().clearOutline,l=_p(),g=l.handleEllipse,x=l.readPaths,A=Qw().newShapes,M=o5(),_=u5().activateLastSelection,w=_n(),m=w.sorterAsc,u=ny(),d=R0(),y=Df().getFromId,I=k1(),L=_x().redrawReglTraces,z=HM(),F=z.MINSELECT,N=u.filter,B=u.tester,R=gx(),U=R.p2r,j=R.axValue,Z=R.getTransform;function re(je){return je.subplot!==void 0}function fe(je,Je,ke,xe,ye){var Ee=!re(xe),Xe=n(ye),Qe=i(ye),Lt=s(ye),Ct=a(ye),Ot=f(ye),Kt=ye==="drawline",xr=ye==="drawcircle",mr=Kt||xr,vr=xe.gd,Nr=vr._fullLayout,kn=Ot&&Nr.newselection.mode==="immediate"&&Ee,$n=Nr._zoomlayer,Vn=xe.element.getBoundingClientRect(),ra=xe.plotinfo,na=Z(ra),Un=Je-Vn.left,ka=ke-Vn.top;Nr._calcInverseTransform(vr);var Va=w.apply3DTransform(Nr._invTransform)(Un,ka);Un=Va[0],ka=Va[1];var sr=Nr._invScaleX,Vt=Nr._invScaleY,or=Un,ur=ka,Gr="M"+Un+","+ka,ln=xe.xaxes[0],gn=xe.yaxes[0],An=ln._length,Qn=gn._length,pa=je.altKey&&!(a(ye)&&Lt),ha,_a,Ca,Hn,pi,Si,Dt;$(je,vr,xe),Xe&&(ha=N([[Un,ka]],z.BENDPX));var xt=$n.selectAll("path.select-outline-"+ra.id).data([1]),Cr=Ct?Nr.newshape:Nr.newselection;Ct&&(xe.hasText=Cr.label.text||Cr.label.texttemplate);var jr=Ct&&!Lt?Cr.fillcolor:"rgba(0,0,0,0)",Vr=Cr.line.color||(Ee?e.contrast(vr._fullLayout.plot_bgcolor):"#7f7f7f");xt.enter().append("path").attr("class","select-outline select-outline-"+ra.id).style({opacity:Ct?Cr.opacity/2:1,"stroke-dasharray":E(Cr.line.dash,Cr.line.width),"stroke-width":Cr.line.width+"px","shape-rendering":"crispEdges"}).call(e.stroke,Vr).call(e.fill,jr).attr("fill-rule","evenodd").classed("cursor-move",!!Ct).attr("transform",na).attr("d",Gr+"Z");var Dr=$n.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",na).attr("d","M0,0Z");if(Ct&&xe.hasText){var qr=$n.select(".label-temp");qr.empty()&&(qr=$n.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var un=Nr._uid+z.SELECTID,Jr=[],At=ie(vr,xe.xaxes,xe.yaxes,xe.subplot);kn&&!je.shiftKey&&(xe._clearSubplotSelections=function(){if(Ee){var zr=ln._id,cn=gn._id;dt(vr,zr,cn,At);for(var Rn=(vr.layout||{}).selections||[],qn=[],jn=!1,fn=0;fn=0){vr._fullLayout._deactivateShape(vr);return}if(!Ct){var Rn=Nr.clickmode;d.done(un).then(function(){if(d.clear(un),zr===2){for(xt.remove(),pi=0;pi-1&&le(cn,vr,xe.xaxes,xe.yaxes,xe.subplot,xe,xt),Rn==="event"&&Ur(vr,void 0);t.click(vr,cn,ra.id)}).catch(w.error)}},xe.doneFn=function(){Dr.remove(),d.done(un).then(function(){d.clear(un),!kn&&Hn&&xe.selectionDefs&&(Hn.subtract=pa,xe.selectionDefs.push(Hn),xe.mergedPolygons.length=0,[].push.apply(xe.mergedPolygons,Ca)),(kn||Ct)&&H(xe,kn),xe.doneFnCompleted&&xe.doneFnCompleted(Jr),Ot&&Ur(vr,Dt)}).catch(w.error)}}function le(je,Je,ke,xe,ye,Ee,Xe){var Qe=Je._hoverdata,Lt=Je._fullLayout,Ct=Lt.clickmode,Ot=Ct.indexOf("event")>-1,Kt=[],xr,mr,vr,Nr,kn,$n,Vn,ra,na,Un;if(Se(Qe)){$(je,Je,Ee),xr=ie(Je,ke,xe,ye);var ka=Le(Qe,xr),Va=ka.pointNumbers.length>0;if(Va?ze(xr,ka):Ye(xr)&&(Vn=Fe(ka))){for(Xe&&Xe.remove(),Un=0;Un=0}function te(je){return je._fullLayout._activeSelectionIndex>=0}function H(je,Je){var ke=je.dragmode,xe=je.plotinfo,ye=je.gd;ue(ye)&&ye._fullLayout._deactivateShape(ye),te(ye)&&ye._fullLayout._deactivateSelection(ye);var Ee=ye._fullLayout,Xe=Ee._zoomlayer,Qe=a(ke),Lt=f(ke);if(Qe||Lt){var Ct=Xe.selectAll(".select-outline-"+xe.id);if(Ct&&ye._fullLayout._outlining){var Ot;Qe&&(Ot=A(Ct,je)),Ot&&S.call("_guiRelayout",ye,{shapes:Ot});var Kt;Lt&&!re(je)&&(Kt=M(Ct,je)),Kt&&(ye._fullLayout._noEmitSelectedAtStart=!0,S.call("_guiRelayout",ye,{selections:Kt}).then(function(){Je&&_(ye)})),ye._fullLayout._outlining=!1}}xe.selection={},xe.selection.selectionDefs=je.selectionDefs=[],xe.selection.mergedPolygons=je.mergedPolygons=[]}function ae(je){return je._id}function ie(je,Je,ke,xe){if(!je.calcdata)return[];var ye=[],Ee=Je.map(ae),Xe=ke.map(ae),Qe,Lt,Ct;for(Ct=0;Ct0,Ee=ye?xe[0]:ke;return Je.selectedpoints?Je.selectedpoints.indexOf(Ee)>-1:!1}function ze(je,Je){var ke=[],xe,ye,Ee,Xe;for(Xe=0;Xe0&&ke.push(xe);if(ke.length===1&&(Ee=ke[0]===Je.searchInfo,Ee&&(ye=Je.searchInfo.cd[0].trace,ye.selectedpoints.length===Je.pointNumbers.length))){for(Xe=0;Xe1||(Je+=xe.selectedpoints.length,Je>1)))return!1;return Je===1}function st(je,Je,ke){var xe;for(xe=0;xe-1&&Je;if(!Xe&&Je){var zr=Ft(je,!0);if(zr.length){var cn=zr[0].xref,Rn=zr[0].yref;if(cn&&Rn){var qn=ar(zr),jn=Er([y(je,cn,"x"),y(je,Rn,"y")]);jn(Jr,qn)}}je._fullLayout._noEmitSelectedAtStart?je._fullLayout._noEmitSelectedAtStart=!1:lr&&Ur(je,Jr),xr._reselect=!1}if(!Xe&&xr._deselect){var fn=xr._deselect;Qe=fn.xref,Lt=fn.yref,ut(Qe,Lt,Ot)||dt(je,Qe,Lt,xe),lr&&(Jr.points.length?Ur(je,Jr):Mt(je)),xr._deselect=!1}return{eventData:Jr,selectionTesters:ke}}function Ne(je){var Je=je.calcdata;if(Je)for(var ke=0;ke=0){jr._fullLayout._deactivateShape(jr);return}var Vr=jr._fullLayout.clickmode;if(ee(jr),xt===2&&!Pe&&_a(),et)Vr.indexOf("select")>-1&&m(Cr,jr,dt,nt,Se.id,Ot),Vr.indexOf("event")>-1&&a.click(jr,Cr,Se.id);else if(xt===1&&Pe){var Dr=st?pe:Ae,qr=st==="s"||ct==="w"?0:1,un=Dr._name+".range["+qr+"]",Jr=R(Dr,qr),At="left",lr="middle";if(Dr.fixedrange)return;st?(lr=st==="n"?"top":"bottom",Dr.side==="right"&&(At="right")):ct==="e"&&(At="right"),jr._context.showAxisRangeEntryBoxes&&h.select(Ct).call(o.makeEditable,{gd:jr,immediate:!0,background:jr._fullLayout.paper_bgcolor,text:String(Jr),fill:Dr.tickfont?Dr.tickfont.color:"#444",horizontalAlign:At,verticalAlign:lr}).on("edit",function(zr){var cn=Dr.d2r(zr);cn!==void 0&&t.call("_guiRelayout",jr,un,cn)})}}c.init(Ot);var mr,vr,Nr,kn,$n,Vn,ra,na,Un,ka;function Va(xt,Cr,jr){var Vr=Ct.getBoundingClientRect();mr=Cr-Vr.left,vr=jr-Vr.top,de._fullLayout._calcInverseTransform(de);var Dr=b.apply3DTransform(de._fullLayout._invTransform)(mr,vr);mr=Dr[0],vr=Dr[1],Nr={l:mr,r:mr,w:0,t:vr,b:vr,h:0},kn=de._hmpixcount?de._hmlumcount/de._hmpixcount:E(de._fullLayout.plot_bgcolor).getLuminance(),$n="M0,0H"+Qt+"V"+ar+"H0V0",Vn=!1,ra="xy",ka=!1,na=fe(at,kn,Ft,Nt,$n),Un=le(at,Ft,Nt)}function sr(xt,Cr){if(de._transitioningWithDuration)return!1;var jr=Math.max(0,Math.min(Qt,Ee*xt+mr)),Vr=Math.max(0,Math.min(ar,Xe*Cr+vr)),Dr=Math.abs(jr-mr),qr=Math.abs(Vr-vr);Nr.l=Math.min(mr,jr),Nr.r=Math.max(mr,jr),Nr.t=Math.min(vr,Vr),Nr.b=Math.max(vr,Vr);function un(){ra="",Nr.r=Nr.l,Nr.t=Nr.b,Un.attr("d","M0,0Z")}if(kr.isSubplotConstrained)Dr>I||qr>I?(ra="xy",Dr/Qt>qr/ar?(qr=Dr*ar/Qt,vr>Vr?Nr.t=vr-qr:Nr.b=vr+qr):(Dr=qr*Qt/ar,mr>jr?Nr.l=mr-Dr:Nr.r=mr+Dr),Un.attr("d",te(Nr))):un();else if(Er.isSubplotConstrained)if(Dr>I||qr>I){ra="xy";var Jr=Math.min(Nr.l/Qt,(ar-Nr.b)/ar),At=Math.max(Nr.r/Qt,(ar-Nr.t)/ar);Nr.l=Jr*Qt,Nr.r=At*Qt,Nr.b=(1-Jr)*ar,Nr.t=(1-At)*ar,Un.attr("d",te(Nr))}else un();else!Sr||qr0){var zr;if(Er.isSubplotConstrained||!$r&&Sr.length===1){for(zr=0;zr1&&(un.maxallowed!==void 0&&Mt===(un.range[0]1&&(Jr.maxallowed!==void 0&&je===(Jr.range[0]=0?Math.min(de,.9):1/(1/Math.max(de,-.3)+3.222))}function re(de,Se,Le){return de?de==="nsew"?Le?"":Se==="pan"?"move":"crosshair":de.toLowerCase()+"-resize":"pointer"}function fe(de,Se,Le,Fe,ze){return de.append("path").attr("class","zoombox").style({fill:Se>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(Le,Fe)).attr("d",ze+"Z")}function le(de,Se,Le){return de.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(Se,Le)).attr("d","M0,0Z")}function ce(de,Se,Le,Fe,ze,Ye){de.attr("d",Fe+"M"+Le.l+","+Le.t+"v"+Le.h+"h"+Le.w+"v-"+Le.h+"h-"+Le.w+"Z"),V(de,Se,ze,Ye)}function V(de,Se,Le,Fe){Le||(de.transition().style("fill",Fe>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Se.transition().style("opacity",1).duration(200))}function ee(de){h.select(de).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function ne(de){L&&de.data&&de._context.showTips&&(b.notifier(b._(de,"Double-click to zoom back out"),"long"),L=!1)}function $(de,Se){return"M"+(de.l-.5)+","+(Se-I-.5)+"h-3v"+(2*I+1)+"h3ZM"+(de.r+.5)+","+(Se-I-.5)+"h3v"+(2*I+1)+"h-3Z"}function ue(de,Se){return"M"+(Se-I-.5)+","+(de.t-.5)+"v-3h"+(2*I+1)+"v3ZM"+(Se-I-.5)+","+(de.b+.5)+"v3h"+(2*I+1)+"v-3Z"}function te(de){var Se=Math.floor(Math.min(de.b-de.t,de.r-de.l,I)/2);return"M"+(de.l-3.5)+","+(de.t-.5+Se)+"h3v"+-Se+"h"+Se+"v-3h-"+(Se+3)+"ZM"+(de.r+3.5)+","+(de.t-.5+Se)+"h-3v"+-Se+"h"+-Se+"v-3h"+(Se+3)+"ZM"+(de.r+3.5)+","+(de.b+.5-Se)+"h-3v"+Se+"h"+-Se+"v3h"+(Se+3)+"ZM"+(de.l-3.5)+","+(de.b+.5-Se)+"h3v"+Se+"h"+Se+"v3h-"+(Se+3)+"Z"}function H(de,Se,Le,Fe,ze){for(var Ye=!1,st={},ct={},at,et,Pe,Ae,pe=(ze||{}).xaHash,Ne=(ze||{}).yaHash,ut=0;ut1&&b.warn("Full array edits are incompatible with other edits",f);var x=i[""][""];if(t(x))n.set(null);else if(Array.isArray(x))n.set(x);else return b.warn("Unrecognized full array edit value",f,x),!0;return T?!1:(c(l,g),p(o),!0)}var A=Object.keys(i).map(Number).sort(S),M=n.get(),_=M||[],w=s(g,f).get(),m=[],u=-1,d=_.length,y,I,L,z,F,N,B,R;for(y=0;y_.length-(B?0:1)){b.warn("index out of range",f,L);continue}if(N!==void 0)F.length>1&&b.warn("Insertion & removal are incompatible with edits to the same index.",f,L),t(N)?m.push(L):B?(N==="add"&&(N={}),_.splice(L,0,N),w&&w.splice(L,0,{})):b.warn("Unrecognized full object edit value",f,L,N),u===-1&&(u=L);else for(I=0;I=0;y--)_.splice(m[y],1),w&&w.splice(m[y],1);if(_.length?M||n.set(_):n.set(null),T)return!1;if(c(l,g),v!==h){var U;if(u===-1)U=A;else{for(d=Math.max(_.length,d),U=[],y=0;y=u));y++)U.push(L);for(y=u;y0&&b.log("Clearing previous rejected promises from queue."),l._promises=[]},K.cleanLayout=function(l){var g;l||(l={}),l.xaxis1&&(l.xaxis||(l.xaxis=l.xaxis1),delete l.xaxis1),l.yaxis1&&(l.yaxis||(l.yaxis=l.yaxis1),delete l.yaxis1),l.scene1&&(l.scene||(l.scene=l.scene1),delete l.scene1);var x=(S.subplotsRegistry.cartesian||{}).attrRegex;(S.subplotsRegistry.polar||{}).attrRegex,(S.subplotsRegistry.ternary||{}).attrRegex,(S.subplotsRegistry.gl3d||{}).attrRegex;var A=Object.keys(l);for(g=0;g3?(L.x=1.02,L.xanchor="left"):L.x<-2&&(L.x=-.02,L.xanchor="right"),L.y>3?(L.y=1.02,L.yanchor="bottom"):L.y<-2&&(L.y=-.02,L.yanchor="top")),l.dragmode==="rotate"&&(l.dragmode="orbit"),e.clean(l),l.template&&l.template.layout&&K.cleanLayout(l.template.layout),l};function i(l,g){var x=l[g],A=g.charAt(0);x&&x!=="paper"&&(l[g]=t(x,A,!0))}K.cleanData=function(l){for(var g=0;g0)return l.slice(0,g)}K.hasParent=function(l,g){for(var x=v(g);x;){if(x in l)return!0;x=v(x)}return!1},K.clearAxisTypes=function(l,g,x){for(var A=0;A{const x=(...A)=>A.every(M=>b.isPlainObject(M))||A.every(M=>Array.isArray(M));if([l,g].every(A=>Array.isArray(A))){if(l.length!==g.length)return!1;for(let A=0;Ab.isPlainObject(A))){if(Object.keys(l).length!==Object.keys(g).length)return!1;for(const A in l){if(A.startsWith("_"))continue;const M=l[A],_=g[A];if(M!==_&&!(x(M,_)?T(M,_):!1))return!1}return!0}return!1};K.collectionsAreEqual=T}}),wx=Ge({"src/plot_api/plot_api.js"(K){var G=ki(),h=Ei(),b=Xw(),S=_n(),E=S.nestedProperty,e=A1(),t=yp(),r=Ro(),o=ry(),n=ef(),i=Ts(),a=KT(),s=id(),f=As(),c=go(),p=p5().initInteractions,v=Lv(),T=Qf().clearOutline,l=al().dfltConfig,g=XM(),x=m5(),A=_x(),M=Hc(),_=sh().AX_NAME_PATTERN,w=0,m=5;function u(ke,xe,ye,Ee){var Xe;if(ke=S.getGraphDiv(ke),e.init(ke),S.isPlainObject(xe)){var Qe=xe;xe=Qe.data,ye=Qe.layout,Ee=Qe.config,Xe=Qe.frames}var Lt=e.triggerHandler(ke,"plotly_beforeplot",[xe,ye,Ee]);if(Lt===!1)return Promise.reject();!xe&&!ye&&!S.isPlotDiv(ke)&&S.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",ke);function Ct(){if(Xe)return K.addFrames(ke,Xe)}z(ke,Ee),ye||(ye={}),G.select(ke).classed("js-plotly-plot",!0),f.makeTester(),Array.isArray(ke._promises)||(ke._promises=[]);var Ot=(ke.data||[]).length===0&&Array.isArray(xe);Array.isArray(xe)&&(x.cleanData(xe),Ot?ke.data=xe:ke.data.push.apply(ke.data,xe),ke.empty=!1),(!ke.layout||Ot)&&(ke.layout=x.cleanLayout(ye)),n.supplyDefaults(ke);var Kt=ke._fullLayout,xr=Kt._has("cartesian");Kt._replotting=!0,(Ot||Kt._shouldCreateBgLayer)&&(Je(ke),Kt._shouldCreateBgLayer&&delete Kt._shouldCreateBgLayer),f.initGradients(ke),f.initPatterns(ke),Ot&&i.saveShowSpikeInitial(ke);var mr=!ke.calcdata||ke.calcdata.length!==(ke._fullData||[]).length;mr&&n.doCalcdata(ke);for(var vr=0;vr=ke.data.length||Xe<-ke.data.length)throw new Error(ye+" must be valid indices for gd.data.");if(xe.indexOf(Xe,Ee+1)>-1||Xe>=0&&xe.indexOf(-ke.data.length+Xe)>-1||Xe<0&&xe.indexOf(ke.data.length+Xe)>-1)throw new Error("each index in "+ye+" must be unique.")}}function U(ke,xe,ye){if(!Array.isArray(ke.data))throw new Error("gd.data must be an array.");if(typeof xe>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(xe)||(xe=[xe]),R(ke,xe,"currentIndices"),typeof ye<"u"&&!Array.isArray(ye)&&(ye=[ye]),typeof ye<"u"&&R(ke,ye,"newIndices"),typeof ye<"u"&&xe.length!==ye.length)throw new Error("current and new indices must be of equal length.")}function j(ke,xe,ye){var Ee,Xe;if(!Array.isArray(ke.data))throw new Error("gd.data must be an array.");if(typeof xe>"u")throw new Error("traces must be defined.");for(Array.isArray(xe)||(xe=[xe]),Ee=0;Ee"u")throw new Error("indices must be an integer or array of integers");R(ke,ye,"indices");for(var Qe in xe){if(!Array.isArray(xe[Qe])||xe[Qe].length!==ye.length)throw new Error("attribute "+Qe+" must be an array of length equal to indices array length");if(Xe&&(!(Qe in Ee)||!Array.isArray(Ee[Qe])||Ee[Qe].length!==xe[Qe].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function re(ke,xe,ye,Ee){var Xe=S.isPlainObject(Ee),Qe=[],Lt,Ct,Ot,Kt,xr;Array.isArray(ye)||(ye=[ye]),ye=B(ye,ke.data.length-1);for(var mr in xe)for(var vr=0;vr=0&&xr=0&&xr"u")return Kt=K.redraw(ke),t.add(ke,Xe,Lt,Qe,Ct),Kt;Array.isArray(ye)||(ye=[ye]);try{U(ke,Ee,ye)}catch(xr){throw ke.data.splice(ke.data.length-xe.length,xe.length),xr}return t.startSequence(ke),t.add(ke,Xe,Lt,Qe,Ct),Kt=K.moveTraces(ke,Ee,ye),t.stopSequence(ke),Kt}function ne(ke,xe){ke=S.getGraphDiv(ke);var ye=[],Ee=K.addTraces,Xe=ne,Qe=[ke,ye,xe],Lt=[ke,xe],Ct,Ot;if(typeof xe>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(xe)||(xe=[xe]),R(ke,xe,"indices"),xe=B(xe,ke.data.length-1),xe.sort(S.sorterDes),Ct=0;Ct"u")for(ye=[],Kt=0;Kt0&&typeof or.parts[ln]!="string";)ln--;var gn=or.parts[ln],An=or.parts[ln-1]+"."+gn,Qn=or.parts.slice(0,ln).join("."),pa=E(ke.layout,Qn).get(),ha=E(Ee,Qn).get(),_a=or.get();if(ur!==void 0){ra[Vt]=ur,na[Vt]=gn==="reverse"?ur:te(_a);var Ca=o.getLayoutValObject(Ee,or.parts);if(Ca&&Ca.impliedEdits&&ur!==null)for(var Hn in Ca.impliedEdits)Un(S.relativeAttr(Vt,Hn),Ca.impliedEdits[Hn]);if(["width","height"].indexOf(Vt)!==-1)if(ur){Un("autosize",null);var pi=Vt==="height"?"width":"height";Un(pi,Ee[pi])}else Ee[Vt]=ke._initialAutoSize[Vt];else if(Vt==="autosize")Un("width",ur?null:Ee.width),Un("height",ur?null:Ee.height);else if(An.match(ze))sr(An),E(Ee,Qn+"._inputRange").set(null);else if(An.match(Ye)){sr(An),E(Ee,Qn+"._inputRange").set(null);var Si=E(Ee,Qn).get();Si._inputDomain&&(Si._input.domain=Si._inputDomain.slice())}else An.match(st)&&E(Ee,Qn+"._inputDomain").set(null);if(gn==="type"){Va=pa;var Dt=ha.type==="linear"&&ur==="log",xt=ha.type==="log"&&ur==="linear";if(Dt||xt){if(!Va||!Va.range)Un(Qn+".autorange",!0);else if(ha.autorange)Dt&&(Va.range=Va.range[1]>Va.range[0]?[1,2]:[2,1]);else{var Cr=Va.range[0],jr=Va.range[1];Dt?(Cr<=0&&jr<=0&&Un(Qn+".autorange",!0),Cr<=0?Cr=jr/1e6:jr<=0&&(jr=Cr/1e6),Un(Qn+".range[0]",Math.log(Cr)/Math.LN10),Un(Qn+".range[1]",Math.log(jr)/Math.LN10)):(Un(Qn+".range[0]",Math.pow(10,Cr)),Un(Qn+".range[1]",Math.pow(10,jr)))}Array.isArray(Ee._subplots.polar)&&Ee._subplots.polar.length&&Ee[or.parts[0]]&&or.parts[1]==="radialaxis"&&delete Ee[or.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(ke,ha,ur,Un),r.getComponentMethod("images","convertCoords")(ke,ha,ur,Un)}else Un(Qn+".autorange",!0),Un(Qn+".range",null);E(Ee,Qn+"._inputRange").set(null)}else if(gn.match(_)){var Vr=E(Ee,Vt).get(),Dr=(ur||{}).type;(!Dr||Dr==="-")&&(Dr="linear"),r.getComponentMethod("annotations","convertCoords")(ke,Vr,Dr,Un),r.getComponentMethod("images","convertCoords")(ke,Vr,Dr,Un)}var qr=g.containerArrayMatch(Vt);if(qr){xr=qr.array,mr=qr.index;var un=qr.property,Jr=Ca||{editType:"calc"};mr!==""&&un===""&&(g.isAddVal(ur)?na[Vt]=null:g.isRemoveVal(ur)?na[Vt]=(E(ye,xr).get()||[])[mr]:S.warn("unrecognized full object value",xe)),M.update(Vn,Jr),Kt[xr]||(Kt[xr]={});var At=Kt[xr][mr];At||(At=Kt[xr][mr]={}),At[un]=ur,delete xe[Vt]}else gn==="reverse"?(pa.range?pa.range.reverse():(Un(Qn+".autorange",!0),pa.range=[1,0]),ha.autorange?Vn.calc=!0:Vn.plot=!0):(Vt==="dragmode"&&(ur===!1&&_a!==!1||ur!==!1&&_a===!1)||Ee._has("scatter-like")&&Ee._has("regl")&&Vt==="dragmode"&&(ur==="lasso"||ur==="select")&&!(_a==="lasso"||_a==="select")?Vn.plot=!0:Ca?M.update(Vn,Ca):Vn.calc=!0,or.set(ur))}}for(xr in Kt){var lr=g.applyContainerArrayChanges(ke,Qe(ye,xr),Kt[xr],Vn,Qe);lr||(Vn.plot=!0)}for(var zr in ka){Va=i.getFromId(ke,zr);var cn=Va&&Va._constraintGroup;if(cn){Vn.calc=!0;for(var Rn in cn)ka[Rn]||(i.getFromId(ke,Rn)._constraintShrinkable=!0)}}(at(ke)||xe.height||xe.width)&&(Vn.plot=!0);var qn=Ee.shapes;for(mr=0;mr1;)if(Ee.pop(),ye=E(xe,Ee.join(".")+".uirevision").get(),ye!==void 0)return ye;return xe.uirevision}function dt(ke,xe){for(var ye=0;ye[Qn,ke._ev.listeners(Qn)]);Qe=K.newPlot(ke,xe,ye,Ee).then(()=>{for(const[Qn,pa]of An)pa.forEach(ha=>ke.on(Qn,ha));return K.react(ke,xe,ye,Ee)})}else{ke.data=xe||[],x.cleanData(ke.data),ke.layout=ye||{},x.cleanLayout(ke.layout),Nt(ke.data,ke.layout,Ct,Ot),n.supplyDefaults(ke,{skipUpdateCalc:!0});var mr=ke._fullData,vr=ke._fullLayout,Nr=vr.datarevision===void 0,kn=vr.transition,$n=kr(ke,Ot,vr,Nr,kn),Vn=$n.newDataRevision,ra=ar(ke,Ct,mr,Nr,kn,Vn);if(at(ke)&&($n.layoutReplot=!0),ra.calc||$n.calc){ke.calcdata=void 0;for(var na=Object.getOwnPropertyNames(vr),Un=0;Un(xr||ke.emit("plotly_react",{config:Ee,data:xe,layout:ye}),ke))}function ar(ke,xe,ye,Ee,Xe,Qe){var Lt=xe.length===ye.length;if(!Xe&&!Lt)return{fullReplot:!0,calc:!0};var Ct=M.traceFlags();Ct.arrays={},Ct.nChanges=0,Ct.nChangesAnim=0;var Ot,Kt;function xr(Nr){var kn=o.getTraceValObject(Kt,Nr);return!Kt._module.animatable&&kn.anim&&(kn.anim=!1),kn}var mr={getValObject:xr,flags:Ct,immutable:Ee,transition:Xe,newDataRevision:Qe,gd:ke},vr={};for(Ot=0;Ot=Xe.length?Xe[0]:Xe[Kt]:Xe}function Ct(Kt){return Array.isArray(Qe)?Kt>=Qe.length?Qe[0]:Qe[Kt]:Qe}function Ot(Kt,xr){var mr=0;return function(){if(Kt&&++mr===xr)return Kt()}}return new Promise(function(Kt,xr){function mr(){if(Ee._frameQueue.length!==0){for(;Ee._frameQueue.length;){var gn=Ee._frameQueue.pop();gn.onInterrupt&&gn.onInterrupt()}ke.emit("plotly_animationinterrupted",[])}}function vr(gn){if(gn.length!==0){for(var An=0;AnEe._timeToNext&&kn()};gn()}var Vn=0;function ra(gn){return Array.isArray(Xe)?Vn>=Xe.length?gn.transitionOpts=Xe[Vn]:gn.transitionOpts=Xe[0]:gn.transitionOpts=Xe,Vn++,gn}var na,Un,ka=[],Va=xe==null,sr=Array.isArray(xe),Vt=!Va&&!sr&&S.isPlainObject(xe);if(Vt)ka.push({type:"object",data:ra(S.extendFlat({},xe))});else if(Va||["string","number"].indexOf(typeof xe)!==-1)for(na=0;na0&&GrGr)&&ln.push(Un);ka=ln}}ka.length>0?vr(ka):(ke.emit("plotly_animated"),Kt())})}function Sr(ke,xe,ye){if(ke=S.getGraphDiv(ke),xe==null)return Promise.resolve();if(!S.isPlotDiv(ke))throw new Error("This element is not a Plotly plot: "+ke+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Ee,Xe,Qe,Lt,Ct=ke._transitionData._frames,Ot=ke._transitionData._frameHash;if(!Array.isArray(xe))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+xe);var Kt=Ct.length+xe.length*2,xr=[],mr={};for(Ee=xe.length-1;Ee>=0;Ee--)if(S.isPlainObject(xe[Ee])){var vr=xe[Ee].name,Nr=(Ot[vr]||mr[vr]||{}).name,kn=xe[Ee].name,$n=Ot[Nr]||mr[Nr];Nr&&kn&&typeof kn=="number"&&$n&&wor.index?-1:Vt.index=0;Ee--){if(Xe=xr[Ee].frame,typeof Xe.name=="number"&&S.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!Xe.name)for(;Ot[Xe.name="frame "+ke._transitionData._counter++];);if(Ot[Xe.name]){for(Qe=0;Qe=0;ye--)Ee=xe[ye],Qe.push({type:"delete",index:Ee}),Lt.unshift({type:"insert",index:Ee,value:Xe[Ee]});var Ct=n.modifyFrames,Ot=n.modifyFrames,Kt=[ke,Lt],xr=[ke,Qe];return t&&t.add(ke,Ct,Kt,Ot,xr),n.modifyFrames(ke,Qe)}function Mt(ke){ke=S.getGraphDiv(ke);var xe=ke._fullLayout||{},ye=ke._fullData||[];return n.cleanPlot([],{},ye,xe),n.purge(ke),e.purge(ke),xe._container&&xe._container.remove(),delete ke._context,ke}function je(ke){var xe=ke._fullLayout,ye=ke.getBoundingClientRect();if(!S.equalDomRects(ye,xe._lastBBox)){var Ee=xe._invTransform=S.inverseTransformMatrix(S.getFullTransformMatrix(ke));xe._invScaleX=Math.sqrt(Ee[0][0]*Ee[0][0]+Ee[0][1]*Ee[0][1]+Ee[0][2]*Ee[0][2]),xe._invScaleY=Math.sqrt(Ee[1][0]*Ee[1][0]+Ee[1][1]*Ee[1][1]+Ee[1][2]*Ee[1][2]),xe._lastBBox=ye}}function Je(ke){var xe=G.select(ke),ye=ke._fullLayout;if(ye._calcInverseTransform=je,ye._calcInverseTransform(ke),ye._container=xe.selectAll(".plot-container").data([0]),ye._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),ye._paperdiv=ye._container.selectAll(".svg-container").data([0]),ye._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),ye._glcontainer=ye._paperdiv.selectAll(".gl-container").data([{}]),ye._glcontainer.enter().append("div").classed("gl-container",!0),ye._paperdiv.selectAll(".main-svg").remove(),ye._paperdiv.select(".modebar-container").remove(),ye._paper=ye._paperdiv.insert("svg",":first-child").classed("main-svg",!0),ye._toppaper=ye._paperdiv.append("svg").classed("main-svg",!0),ye._modebardiv=ye._paperdiv.append("div"),delete ye._modeBar,ye._hoverpaper=ye._paperdiv.append("svg").classed("main-svg",!0),!ye._uid){var Ee={};G.selectAll("defs").each(function(){this.id&&(Ee[this.id.split("-")[1]]=1)}),ye._uid=S.randstr(Ee)}ye._paperdiv.selectAll(".main-svg").attr(v.svgAttrs),ye._defs=ye._paper.append("defs").attr("id","defs-"+ye._uid),ye._clips=ye._defs.append("g").classed("clips",!0),ye._topdefs=ye._toppaper.append("defs").attr("id","topdefs-"+ye._uid),ye._topclips=ye._topdefs.append("g").classed("clips",!0),ye._bgLayer=ye._paper.append("g").classed("bglayer",!0),ye._draggers=ye._paper.append("g").classed("draglayer",!0);var Xe=ye._paper.append("g").classed("layer-below",!0);ye._imageLowerLayer=Xe.append("g").classed("imagelayer",!0),ye._shapeLowerLayer=Xe.append("g").classed("shapelayer",!0),ye._cartesianlayer=ye._paper.append("g").classed("cartesianlayer",!0),ye._polarlayer=ye._paper.append("g").classed("polarlayer",!0),ye._smithlayer=ye._paper.append("g").classed("smithlayer",!0),ye._ternarylayer=ye._paper.append("g").classed("ternarylayer",!0),ye._geolayer=ye._paper.append("g").classed("geolayer",!0),ye._funnelarealayer=ye._paper.append("g").classed("funnelarealayer",!0),ye._pielayer=ye._paper.append("g").classed("pielayer",!0),ye._iciclelayer=ye._paper.append("g").classed("iciclelayer",!0),ye._treemaplayer=ye._paper.append("g").classed("treemaplayer",!0),ye._sunburstlayer=ye._paper.append("g").classed("sunburstlayer",!0),ye._indicatorlayer=ye._toppaper.append("g").classed("indicatorlayer",!0),ye._glimages=ye._paper.append("g").classed("glimages",!0);var Qe=ye._toppaper.append("g").classed("layer-above",!0);ye._imageUpperLayer=Qe.append("g").classed("imagelayer",!0),ye._shapeUpperLayer=Qe.append("g").classed("shapelayer",!0),ye._selectionLayer=ye._toppaper.append("g").classed("selectionlayer",!0),ye._infolayer=ye._toppaper.append("g").classed("infolayer",!0),ye._menulayer=ye._toppaper.append("g").classed("menulayer",!0),ye._zoomlayer=ye._toppaper.append("g").classed("zoomlayer",!0),ye._hoverlayer=ye._hoverpaper.append("g").classed("hoverlayer",!0),ye._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),ke.emit("plotly_framework")}K.animate=$r,K.addFrames=Sr,K.deleteFrames=Ur,K.addTraces=ee,K.deleteTraces=ne,K.extendTraces=ce,K.moveTraces=$,K.prependTraces=V,K.newPlot=N,K._doPlot=u,K.purge=Mt,K.react=Qt,K.redraw=F,K.relayout=Se,K.restyle=ue,K.setPlotConfig=y,K.update=et,K._guiRelayout=Pe(Se),K._guiRestyle=Pe(ue),K._guiUpdate=Pe(et),K._storeDirectGUIEdit=ie}}),f0=Ge({"src/snapshot/helpers.js"(K){var G=Ro();K.getDelay=function(S){return S._has&&(S._has("gl3d")||S._has("mapbox")||S._has("map"))?500:0},K.getRedrawFunc=function(S){return function(){G.getComponentMethod("colorbar","draw")(S)}},K.encodeSVG=function(S){return"data:image/svg+xml,"+encodeURIComponent(S)},K.encodeJSON=function(S){return"data:application/json,"+encodeURIComponent(S)};var h=window.URL||window.webkitURL;K.createObjectURL=function(S){return h.createObjectURL(S)},K.revokeObjectURL=function(S){return h.revokeObjectURL(S)},K.createBlob=function(S,E){if(E==="svg")return new window.Blob([S],{type:"image/svg+xml;charset=utf-8"});if(E==="full-json")return new window.Blob([S],{type:"application/json;charset=utf-8"});var e=b(window.atob(S));return new window.Blob([e],{type:"image/"+E})},K.octetStream=function(S){document.location.href="data:application/octet-stream"+S};function b(S){for(var E=S.length,e=new ArrayBuffer(E),t=new Uint8Array(e),r=0;r")!==-1?"":i.html(s).text()});return i.remove(),a}function o(n){return n.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}G.exports=function(i,a,s){var f=i._fullLayout,c=f._paper,p=f._toppaper,v=f.width,T=f.height,l;c.insert("rect",":first-child").call(b.setRect,0,0,v,T).call(S.fill,f.paper_bgcolor);var g=f._basePlotModules||[];for(l=0;l1&&M.push(s("object","layout"))),b.supplyDefaults(_);for(var u=_._fullData,d=w.length,y=0;yI.length&&A.push(s("unused",M,d.concat(I.length)));var R=I.length,U=Array.isArray(B);U&&(R=Math.min(R,B.length));var j,Z,re,fe,le;if(L.dimensions===2)for(Z=0;ZI[Z].length&&A.push(s("unused",M,d.concat(Z,I[Z].length)));var ce=I[Z].length;for(j=0;j<(U?Math.min(ce,B[Z].length):ce);j++)re=U?B[Z][j]:B,fe=y[Z][j],le=I[Z][j],h.validate(fe,re)?le!==fe&&le!==+fe&&A.push(s("dynamic",M,d.concat(Z,j),fe,le)):A.push(s("value",M,d.concat(Z,j),fe))}else A.push(s("array",M,d.concat(Z),y[Z]));else for(Z=0;ZF?A.push({code:"unused",traceType:y,templateCount:z,dataCount:F}):F>z&&A.push({code:"reused",traceType:y,templateCount:z,dataCount:F})}}function N(B,R){for(var U in B)if(U.charAt(0)!=="_"){var j=B[U],Z=s(B,U,R);h(j)?(Array.isArray(B)&&j._template===!1&&j.templateitemname&&A.push({code:"missing",path:Z,templateitemname:j.templateitemname}),N(j,Z)):Array.isArray(j)&&f(j)&&N(j,Z)}}if(N({data:_,layout:M},""),A.length)return A.map(c)};function f(p){for(var v=0;v=0;c--){var p=e[c];if(p.type==="scatter"&&p.xaxis===s.xaxis&&p.yaxis===s.yaxis){p.opacity=void 0;break}}}}}}}),u2=Ge({"src/traces/scatter/layout_defaults.js"(K,G){var h=_n(),b=sm();G.exports=function(S,E){function e(r,o){return h.coerce(S,E,b,r,o)}var t=E.barmode==="group";E.scattermode==="group"&&e("scattergap",t?E.bargap:.2)}}}),Gp=Ge({"src/plots/cartesian/align_period.js"(K,G){var h=Ei(),b=_n(),S=b.dateTime2ms,E=b.incrementMonth,e=Ii(),t=e.ONEAVGMONTH;G.exports=function(o,n,i,a){if(n.type!=="date")return{vals:a};var s=o[i+"periodalignment"];if(!s)return{vals:a};var f=o[i+"period"],c;if(h(f)){if(f=+f,f<=0)return{vals:a}}else if(typeof f=="string"&&f.charAt(0)==="M"){var p=+f.substring(1);if(p>0&&Math.round(p)===p)c=p;else return{vals:a}}for(var v=n.calendar,T=s==="start",l=s==="end",g=o[i+"period0"],x=S(g,v)||0,A=[],M=[],_=[],w=a.length,m=0;mu;)I=E(I,-c,v);for(;I<=u;)I=E(I,c,v);y=E(I,-c,v)}else{for(d=Math.round((u-x)/f),I=x+d*f;I>u;)I-=f;for(;I<=u;)I+=f;y=I-f}A[m]=T?y:l?I:(y+I)/2,M[m]=y,_[m]=I}return{vals:A,starts:M,ends:_}}}}),sp=Ge({"src/traces/scatter/colorscale_calc.js"(K,G){var h=gd().hasColorscale,b=_d(),S=uu();G.exports=function(e,t){S.hasLines(t)&&h(t,"line")&&b(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),S.hasMarkers(t)&&(h(t,"marker")&&b(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),h(t,"marker.line")&&b(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),h0=Ge({"src/traces/scatter/arrays_to_calcdata.js"(K,G){var h=_n();G.exports=function(S,E){for(var e=0;eN&&y[R].gap;)R--;for(j=y[R].s,B=y.length-1;B>R;B--)y[B].s=j;for(;NU+B||!h(R))}for(var Z=0;Zz[v]&&v0?e:t)/(v._m*g*(v._m>0?e:t)))),Kt*=1e3}if(xr===S){if(l&&(xr=v.c2p(Ot.y,!0)),xr===S)return!1;xr*=1e3}return[Kt,xr]}function ae(Ct,Ot,Kt,xr){var mr=Kt-Ct,vr=xr-Ot,Nr=.5-Ct,kn=.5-Ot,$n=mr*mr+vr*vr,Vn=mr*Nr+vr*kn;if(Vn>0&&Vn<$n){var ra=Nr*vr-kn*mr;if(ra*ra<$n)return!0}}var ie,de;function Se(Ct,Ot){var Kt=Ct[0]/g,xr=Ct[1]/x,mr=Math.max(0,-Kt,Kt-1,-xr,xr-1);return mr&&ie!==void 0&&ae(Kt,xr,ie,de)&&(mr=0),mr&&Ot&&ae(Kt,xr,Ot[0]/g,Ot[1]/x)&&(mr=0),(1+i.toleranceGrowth*mr)*w}function Le(Ct,Ot){var Kt=Ct[0]-Ot[0],xr=Ct[1]-Ot[1];return Math.sqrt(Kt*Kt+xr*xr)}var Fe=i.maxScreensAway,ze=-g*Fe,Ye=g*(1+Fe),st=-x*Fe,ct=x*(1+Fe),at=[[ze,st,Ye,st],[Ye,st,Ye,ct],[Ye,ct,ze,ct],[ze,ct,ze,st]],et,Pe,Ae,pe,Ne,ut;function dt(Ct,Ot){for(var Kt=[],xr=0,mr=0;mr<4;mr++){var vr=at[mr],Nr=o(Ct[0],Ct[1],Ot[0],Ot[1],vr[0],vr[1],vr[2],vr[3]);Nr&&(!xr||Math.abs(Nr.x-Kt[0][0])>1||Math.abs(Nr.y-Kt[0][1])>1)&&(Nr=[Nr.x,Nr.y],xr&&Le(Nr,Ct)Ye||Ct[1]ct)return[n(Ct[0],ze,Ye),n(Ct[1],st,ct)]}function Ft(Ct,Ot){if(Ct[0]===Ot[0]&&(Ct[0]===ze||Ct[0]===Ye)||Ct[1]===Ot[1]&&(Ct[1]===st||Ct[1]===ct))return!0}function Nt(Ct,Ot){var Kt=[],xr=nt(Ct),mr=nt(Ot);return xr&&mr&&Ft(xr,mr)||(xr&&Kt.push(xr),mr&&Kt.push(mr)),Kt}function Qt(Ct,Ot,Kt){return function(xr,mr){var vr=nt(xr),Nr=nt(mr),kn=[];if(vr&&Nr&&Ft(vr,Nr))return kn;vr&&kn.push(vr),Nr&&kn.push(Nr);var $n=2*r.constrain((xr[Ct]+mr[Ct])/2,Ot,Kt)-((vr||xr)[Ct]+(Nr||mr)[Ct]);if($n){var Vn;vr&&Nr?Vn=$n>0==vr[Ct]>Nr[Ct]?vr:Nr:Vn=vr||Nr,Vn[Ct]+=$n}return kn}}var ar;m==="linear"||m==="spline"?ar=dt:m==="hv"||m==="vh"?ar=Nt:m==="hvh"?ar=Qt(0,ze,Ye):m==="vhv"&&(ar=Qt(1,st,ct));function kr(Ct,Ot){var Kt=Ot[0]-Ct[0],xr=(Ot[1]-Ct[1])/Kt,mr=(Ct[1]*Ot[0]-Ot[1]*Ct[0])/Kt;return mr>0?[xr>0?ze:Ye,ct]:[xr>0?Ye:ze,st]}function Er(Ct){var Ot=Ct[0],Kt=Ct[1],xr=Ot===z[F-1][0],mr=Kt===z[F-1][1];if(!(xr&&mr))if(F>1){var vr=Ot===z[F-2][0],Nr=Kt===z[F-2][1];xr&&(Ot===ze||Ot===Ye)&&vr?Nr?F--:z[F-1]=Ct:mr&&(Kt===st||Kt===ct)&&Nr?vr?F--:z[F-1]=Ct:z[F++]=Ct}else z[F++]=Ct}function $r(Ct){z[F-1][0]!==Ct[0]&&z[F-1][1]!==Ct[1]&&Er([Ae,pe]),Er(Ct),Ne=null,Ae=pe=0}var Sr=r.isArrayOrTypedArray(M);function Ur(Ct){if(Ct&&A&&(Ct.i=N,Ct.d=s,Ct.trace=c,Ct.marker=Sr?M[Ct.i]:M,Ct.backoff=A),ie=Ct[0]/g,de=Ct[1]/x,et=Ct[0]Ye?Ye:0,Pe=Ct[1]ct?ct:0,et||Pe){if(!F)z[F++]=[et||Ct[0],Pe||Ct[1]];else if(Ne){var Ot=ar(Ne,Ct);Ot.length>1&&($r(Ot[0]),z[F++]=Ot[1])}else ut=ar(z[F-1],Ct)[0],z[F++]=ut;var Kt=z[F-1];et&&Pe&&(Kt[0]!==et||Kt[1]!==Pe)?(Ne&&(Ae!==et&&pe!==Pe?Er(Ae&&pe?kr(Ne,Ct):[Ae||et,pe||Pe]):Ae&&pe&&Er([Ae,pe])),Er([et,Pe])):Ae-et&&pe-Pe&&Er([et||Ae,Pe||pe]),Ne=Ct,Ae=et,pe=Pe}else Ne&&$r(ar(Ne,Ct)[0]),z[F++]=Ct}for(N=0;NSe(Z,Mt))break;R=Z,ne=le[0]*fe[0]+le[1]*fe[1],ne>V?(V=ne,U=Z,re=!1):ne=s.length||!Z)break;Ur(Z),B=Z}}Ne&&Er([Ae||Ne[0],pe||Ne[1]]),y.push(z.slice(0,F))}var je=m.slice(m.length-1);if(A&&je!=="h"&&je!=="v"){for(var Je=!1,ke=-1,xe=[],ye=0;ye=0?i=p:(i=p=c,c++),i0,m=n(p,v,T);if(A=l.selectAll("g.trace").data(m,function(d){return d[0].trace.uid}),A.enter().append("g").attr("class",function(d){return"trace scatter trace"+d[0].trace.uid}).style("stroke-miterlimit",2),A.order(),a(p,A,v),w){x&&(M=x());var u=h.transition().duration(g.duration).ease(g.easing).each("end",function(){M&&M()}).each("interrupt",function(){M&&M()});u.each(function(){l.selectAll("g.trace").each(function(d,y){s(p,y,v,d,m,this,g)})})}else A.each(function(d,y){s(p,y,v,d,m,this,g)});_&&A.exit().remove(),l.selectAll("path:not([d])").remove()};function a(c,p,v){p.each(function(T){var l=E(h.select(this),"g","fills");t.setClipUrl(l,v.layerClipId,c);var g=T[0].trace,x=[];g._ownfill&&x.push("_ownFill"),g._nexttrace&&x.push("_nextFill");var A=l.selectAll("g").data(x,e);A.enter().append("g"),A.exit().each(function(M){g[M]=null}).remove(),A.order().each(function(M){g[M]=E(h.select(this),"path","js-fill")})})}function s(c,p,v,T,l,g,x){var A=c._context.staticPlot,M;f(c,p,v,T,l);var _=!!x&&x.duration>0;function w(Er){return _?Er.transition():Er}var m=v.xaxis,u=v.yaxis,d=T[0].trace,y=d.line,I=h.select(g),L=E(I,"g","errorbars"),z=E(I,"g","lines"),F=E(I,"g","points"),N=E(I,"g","text");if(b.getComponentMethod("errorbars","plot")(c,L,v,x),d.visible!==!0)return;w(I).style("opacity",d.opacity);var B,R,U=d.fill.charAt(d.fill.length-1);U!=="x"&&U!=="y"&&(U="");var j,Z;U==="y"?(j=1,Z=u.c2p(0,!0)):U==="x"&&(j=0,Z=m.c2p(0,!0)),T[0][v.isRangePlot?"nodeRangePlot3":"node3"]=I;var re="",fe=[],le=d._prevtrace,ce=null,V=null;le&&(re=le._prevRevpath||"",R=le._nextFill,fe=le._ownPolygons,ce=le._fillsegments,V=le._fillElement);var ee,ne,$="",ue="",te,H,ae,ie,de,Se,Le=[];d._polygons=[];var Fe=[],ze=[],Ye=S.noop;if(B=d._ownFill,r.hasLines(d)||d.fill!=="none"){R&&R.datum(T),["hv","vh","hvh","vhv"].indexOf(y.shape)!==-1?(te=t.steps(y.shape),H=t.steps(y.shape.split("").reverse().join(""))):y.shape==="spline"?te=H=function(Er){var $r=Er[Er.length-1];return Er.length>1&&Er[0][0]===$r[0]&&Er[0][1]===$r[1]?t.smoothclosed(Er.slice(1),y.smoothing):t.smoothopen(Er,y.smoothing)}:te=H=function(Er){return"M"+Er.join("L")},ae=function(Er){return H(Er.reverse())},ze=o(T,{xaxis:m,yaxis:u,trace:d,connectGaps:d.connectgaps,baseTolerance:Math.max(y.width||1,3)/4,shape:y.shape,backoff:y.backoff,simplify:y.simplify,fill:d.fill}),Fe=new Array(ze.length);var st=0;for(M=0;M=A[0]&&I.x<=A[1]&&I.y>=M[0]&&I.y<=M[1]}),u=Math.ceil(m.length/w),d=0;l.forEach(function(I,L){var z=I[0].trace;r.hasMarkers(z)&&z.marker.maxdisplayed>0&&L=Math.min(le,ce)&&v<=Math.max(le,ce)?0:1/0}var V=Math.max(3,fe.mrc||0),ee=1-1/V,ne=Math.abs(c.c2p(fe.x)-v);return ne=Math.min(le,ce)&&T<=Math.max(le,ce)?0:1/0}var V=Math.max(3,fe.mrc||0),ee=1-1/V,ne=Math.abs(p.c2p(fe.y)-T);return neue!=Fe>=ue&&(de=ae[H-1][0],Se=ae[H][0],Fe-Le&&(ie=de+(Se-de)*(ue-Le)/(Fe-Le),V=Math.min(V,ie),ee=Math.max(ee,ie)));return V=Math.max(V,0),ee=Math.min(ee,c._length),{x0:V,x1:ee,y0:ue,y1:ue}}if(g.indexOf("fills")!==-1&&f._fillElement){var j=R(f._fillElement)&&!R(f._fillExclusionElement);if(j){var Z=U(f._polygons);Z===null&&(Z={x0:l[0],x1:l[0],y0:l[1],y1:l[1]});var re=e.defaultLine;return e.opacity(f.fillcolor)?re=f.fillcolor:e.opacity((f.line||{}).color)&&(re=f.line.color),h.extendFlat(o,{distance:o.maxHoverDistance,x0:Z.x0,x1:Z.x1,y0:Z.y0,y1:Z.y1,color:re,hovertemplate:!1}),delete o.index,f.text&&!h.isArrayOrTypedArray(f.text)?o.text=String(f.text):o.text=f.name,[o]}}}}}),ug=Ge({"src/traces/scatter/select.js"(K,G){var h=uu();G.exports=function(S,E){var e=S.cd,t=S.xaxis,r=S.yaxis,o=[],n=e[0].trace,i,a,s,f,c=!h.hasMarkers(n)&&!h.hasText(n);if(c)return[];if(E===!1)for(i=0;i0&&(a["_"+n+"axes"]||{})[o])return a;if((a[n+"axis"]||n)===o){if(t(a,n))return a;if((a[n]||[]).length||a[n+"0"])return a}}}function e(r){return{v:"x",h:"y"}[r.orientation||"v"]}function t(r,o){var n=e(r),i=h(r,"box-violin"),a=h(r._fullInput||{},"candlestick");return i&&!a&&o===n&&r[n]===void 0&&r[n+"0"]===void 0}}}),zf=Ge({"src/plots/cartesian/category_order_defaults.js"(K,G){var h=ws().isTypedArraySpec;function b(S,E){var e=E.dataAttr||S._id.charAt(0),t={},r,o,n;if(E.axData)r=E.axData;else for(r=[],o=0;o0||h(o),i;n&&(i="array");var a=t("categoryorder",i),s;a==="array"&&(s=t("categoryarray")),!n&&a==="array"&&(a=e.categoryorder="trace"),a==="trace"?e._initialCategories=[]:a==="array"?e._initialCategories=s.slice():(s=b(e,r).sort(),a==="category ascending"?e._initialCategories=s:a==="category descending"&&(e._initialCategories=s.reverse()))}}}}),Hu=Ge({"src/plots/cartesian/line_grid_defaults.js"(K,G){var h=Rs().mix,b=Xf(),S=_n();G.exports=function(e,t,r,o){o=o||{};var n=o.dfltColor;function i(d,y){return S.coerce2(e,t,o.attributes,d,y)}var a=i("linecolor",n),s=i("linewidth"),f=r("showline",o.showLine||!!a||!!s);f||(delete t.linecolor,delete t.linewidth);var c=h(n,o.bgColor,o.blend||b.lightFraction).toRgbString(),p=i("gridcolor",c),v=i("gridwidth"),T=i("griddash"),l=r("showgrid",o.showGrid||!!p||!!v||!!T);if(l||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var g=h(t.gridcolor,o.bgColor,67).toRgbString(),x=i("minor.gridcolor",g),A=i("minor.gridwidth",t.gridwidth||1),M=i("minor.griddash",t.griddash||"solid"),_=r("minor.showgrid",!!x||!!A||!!M);_||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){i("zerolinelayer");var w=i("zerolinecolor",n),m=i("zerolinewidth"),u=r("zeroline",o.showGrid||!!w||!!m);u||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}}}),Xp=Ge({"src/plots/cartesian/axis_defaults.js"(K,G){var h=Ei(),b=Ro(),S=_n(),E=_u(),e=yd(),t=id(),r=rg(),o=z0(),n=Fp(),i=Pv(),a=zf(),s=Hu(),f=KT(),c=rp(),p=sh().WEEKDAY_PATTERN,v=sh().HOUR_PATTERN;G.exports=function(A,M,_,w,m){var u=w.letter,d=w.font||{},y=w.splomStash||{},I=_("visible",!w.visibleDflt),L=M._template||{},z=M.type||L.type||"-",F;if(z==="date"){var N=b.getComponentMethod("calendars","handleDefaults");N(A,M,"calendar",w.calendar),w.noTicklabelmode||(F=_("ticklabelmode"))}!w.noTicklabelindex&&(z==="date"||z==="linear")&&_("ticklabelindex");var B="";(!w.noTicklabelposition||z==="multicategory")&&(B=S.coerce(A,M,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:F==="period"?["outside","inside"]:u==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),w.noTicklabeloverflow||_("ticklabeloverflow",B.indexOf("inside")!==-1?"hide past domain":z==="category"||z==="multicategory"?"allow":"hide past div"),c(M,m),f(A,M,_,w),a(A,M,_,w),w.noHover||(z!=="category"&&_("hoverformat"),w.noUnifiedhovertitle||_("unifiedhovertitle.text"));var R=_("color"),U=R!==t.color.dflt?R:d.color,j=y.label||m._dfltTitle[u];if(i(A,M,_,z,w),!I)return M;_("title.text",j),S.coerceFont(_,"title.font",d,{overrideDflt:{size:S.bigFont(d.size),color:U}}),r(A,M,_,z);var Z=w.hasMinor;if(Z&&(E.newContainer(M,"minor"),r(A,M,_,z,{isMinor:!0})),n(A,M,_,z,w),o(A,M,_,w),Z){var re=w.isMinor;w.isMinor=!0,o(A,M,_,w),w.isMinor=re}s(A,M,_,{dfltColor:R,bgColor:w.bgColor,showGrid:w.showGrid,hasMinor:Z,attributes:t}),Z&&!M.minor.ticks&&!M.minor.showgrid&&delete M.minor,(M.showline||M.ticks)&&_("mirror");var fe=z==="multicategory";if(!w.noTickson&&(z==="category"||fe)&&(M.ticks||M.showgrid)&&(fe?(_("tickson","boundaries"),delete M.ticklabelposition):_("tickson")),fe){var le=_("showdividers");le&&(_("dividercolor"),_("dividerwidth"))}if(z==="date")if(e(A,M,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:T}),!M.rangebreaks.length)delete M.rangebreaks;else{for(var ce=0;ce=2){var u="",d,y;if(m.length===2){for(d=0;d<2;d++)if(y=g(m[d]),y){u=p;break}}var I=_("pattern",u);if(I===p)for(d=0;d<2;d++)y=g(m[d]),y&&(A.bounds[d]=m[d]=y-1);if(I)for(d=0;d<2;d++)switch(y=m[d],I){case p:if(!h(y)){A.enabled=!1;return}if(y=+y,y!==Math.floor(y)||y<0||y>=7){A.enabled=!1;return}A.bounds[d]=m[d]=y;break;case v:if(!h(y)){A.enabled=!1;return}if(y=+y,y<0||y>24){A.enabled=!1;return}A.bounds[d]=m[d]=y;break}if(M.autorange===!1){var L=M.range;if(L[0]L[1]){A.enabled=!1;return}}else if(m[0]>L[0]&&m[1]_[1]-1/4096&&(e.domain=c),b.noneOrAll(E.domain,e.domain,c),e.tickmode==="sync"&&(e.tickmode="auto")}return t("layer"),e}}}),c2=Ge({"src/plots/cartesian/layout_defaults.js"(K,G){var h=_n(),b=go(),S=Kd().isUnifiedHover,E=i5(),e=_u(),t=w1(),r=id(),o=Ud(),n=Xp(),i=og(),a=Rv(),s=Df(),f=s.id2name,c=s.name2id,p=sh().AX_ID_PATTERN,v=Ro(),T=v.traceIs,l=v.getComponentMethod;function g(x,A,M){Array.isArray(x[A])?x[A].push(M):x[A]=[M]}G.exports=function(A,M,_){var w=M.autotypenumbers,m={},u={},d={},y={},I={},L={},z={},F={},N={},B={},R,U;for(R=0;R<_.length;R++){var j=_[R];if(T(j,"cartesian")){var Z;if(j.xaxis)Z=f(j.xaxis),g(m,Z,j);else if(j.xaxes)for(U=0;U rect").call(E.setTranslate,0,0).call(E.setScale,1,1),M.plot.call(E.setTranslate,_._offset,w._offset).call(E.setScale,1,1);var m=M.plot.selectAll(".scatterlayer .trace");m.selectAll(".point").call(E.setPointGroupScale,1,1),m.selectAll(".textpoint").call(E.setTextPointsScale,1,1),m.call(E.hideOutsideRangePoints,M)}function f(M,_){var w=M.plotinfo,m=w.xaxis,u=w.yaxis,d=m._length,y=u._length,I=!!M.xr1,L=!!M.yr1,z=[];if(I){var F=S.simpleMap(M.xr0,m.r2l),N=S.simpleMap(M.xr1,m.r2l),B=F[1]-F[0],R=N[1]-N[0];z[0]=(F[0]*(1-_)+_*N[0]-F[0])/(F[1]-F[0])*d,z[2]=d*(1-_+_*R/B),m.range[0]=m.l2r(F[0]*(1-_)+_*N[0]),m.range[1]=m.l2r(F[1]*(1-_)+_*N[1])}else z[0]=0,z[2]=d;if(L){var U=S.simpleMap(M.yr0,u.r2l),j=S.simpleMap(M.yr1,u.r2l),Z=U[1]-U[0],re=j[1]-j[0];z[1]=(U[1]*(1-_)+_*j[1]-U[1])/(U[0]-U[1])*y,z[3]=y*(1-_+_*re/Z),u.range[0]=m.l2r(U[0]*(1-_)+_*j[0]),u.range[1]=u.l2r(U[1]*(1-_)+_*j[1])}else z[1]=0,z[3]=y;e.drawOne(r,m,{skipTitle:!0}),e.drawOne(r,u,{skipTitle:!0}),e.redrawComponents(r,[m._id,u._id]);var fe=I?d/z[2]:1,le=L?y/z[3]:1,ce=I?z[0]:0,V=L?z[1]:0,ee=I?z[0]/z[2]*d:0,ne=L?z[1]/z[3]*y:0,$=m._offset-ee,ue=u._offset-ne;w.clipRect.call(E.setTranslate,ce,V).call(E.setScale,1/fe,1/le),w.plot.call(E.setTranslate,$,ue).call(E.setScale,fe,le),E.setPointGroupScale(w.zoomScalePts,1/fe,1/le),E.setTextPointsScale(w.zoomScaleTxt,1/fe,1/le)}var c;i&&(c=i());function p(){for(var M={},_=0;_n.duration?(p(),g=window.cancelAnimationFrame(A)):g=window.requestAnimationFrame(A)}return T=Date.now(),g=window.requestAnimationFrame(A),Promise.resolve()}}}),_h=Ge({"src/plots/cartesian/index.js"(K){var G=ki(),h=Ro(),b=_n(),S=ef(),E=As(),e=Bd().getModuleCalcData,t=Df(),r=sh(),o=Lv(),n=b.ensureSingle;function i(T,l,g){return b.ensureSingle(T,l,g,function(x){x.datum(g)})}var a=r.zindexSeparator;K.name="cartesian",K.attr=["xaxis","yaxis"],K.idRoot=["x","y"],K.idRegex=r.idRegex,K.attrRegex=r.attrRegex,K.attributes=y5(),K.layoutAttributes=id(),K.supplyLayoutDefaults=c2(),K.transitionAxes=pm(),K.finalizeSubplots=function(T,l){var g=l._subplots,x=g.xaxis,A=g.yaxis,M=g.cartesian,_=M,w={},m={},u,d,y;for(u=0;u<_.length;u++){var I=_[u].split("y");w[I[0]]=1,m["y"+I[1]]=1}for(u=0;u0){var L=I.id;if(L.indexOf(a)!==-1)continue;L+=a+(u+1),I=b.extendFlat({},I,{id:L,plot:A._cartesianlayer.selectAll(".subplot").select("."+L)})}for(var z=[],F,N=0;N<_.length;N++){var B=_[N],R=B[0].trace;d===(R.zorder||0)&&R.xaxis+R.yaxis===y&&((l.indexOf(R.index)!==-1||R.carpet)&&(F&&F[0].trace.xaxis+F[0].trace.yaxis===y&&["tonextx","tonexty","tonext"].indexOf(R.fill)!==-1&&z.indexOf(F)===-1&&z.push(F),z.push(B)),F=B)}s(T,I,z,g,x)}}};function s(T,l,g,x,A){for(var M=r.traceLayerClasses,_=T._fullLayout,w=_._zindices,m=_._modules,u,d,y,I=[],L=[],z=0;z1&&(Z+=a+j),U.push(w+Z),_=0;_1,y=l.mainplotinfo;if(!l.mainplot||d)if(u)l.xlines=n(x,"path","xlines-above"),l.ylines=n(x,"path","ylines-above"),l.xaxislayer=n(x,"g","xaxislayer-above"),l.yaxislayer=n(x,"g","yaxislayer-above");else{if(!_){var I=n(x,"g","layer-subplot");l.shapelayer=n(I,"g","shapelayer"),l.imagelayer=n(I,"g","imagelayer"),y&&d?(l.minorGridlayer=y.minorGridlayer,l.gridlayer=y.gridlayer,l.zerolinelayer=y.zerolinelayer):(l.minorGridlayer=n(x,"g","minor-gridlayer"),l.gridlayer=n(x,"g","gridlayer"),l.zerolinelayer=n(x,"g","zerolinelayer"));var L=n(x,"g","layer-between");l.shapelayerBetween=n(L,"g","shapelayer"),l.imagelayerBetween=n(L,"g","imagelayer"),n(x,"path","xlines-below"),n(x,"path","ylines-below"),l.overlinesBelow=n(x,"g","overlines-below"),n(x,"g","xaxislayer-below"),n(x,"g","yaxislayer-below"),l.overaxesBelow=n(x,"g","overaxes-below")}l.overplot=n(x,"g","overplot"),l.plot=n(l.overplot,"g",A),y&&d?l.zerolinelayerAbove=y.zerolinelayerAbove:l.zerolinelayerAbove=n(x,"g","zerolinelayer-above"),_||(l.xlines=n(x,"path","xlines-above"),l.ylines=n(x,"path","ylines-above"),l.overlinesAbove=n(x,"g","overlines-above"),n(x,"g","xaxislayer-above"),n(x,"g","yaxislayer-above"),l.overaxesAbove=n(x,"g","overaxes-above"),l.xlines=x.select(".xlines-"+w),l.ylines=x.select(".ylines-"+m),l.xaxislayer=x.select(".xaxislayer-"+w),l.yaxislayer=x.select(".yaxislayer-"+m))}else{var z=y.plotgroup,F=A+"-x",N=A+"-y";l.minorGridlayer=y.minorGridlayer,l.gridlayer=y.gridlayer,l.zerolinelayer=y.zerolinelayer,l.zerolinelayerAbove=y.zerolinelayerAbove,n(y.overlinesBelow,"path",F),n(y.overlinesBelow,"path",N),n(y.overaxesBelow,"g",F),n(y.overaxesBelow,"g",N),l.plot=n(y.overplot,"g",A),n(y.overlinesAbove,"path",F),n(y.overlinesAbove,"path",N),n(y.overaxesAbove,"g",F),n(y.overaxesAbove,"g",N),l.xlines=z.select(".overlines-"+w).select("."+F),l.ylines=z.select(".overlines-"+m).select("."+N),l.xaxislayer=z.select(".overaxes-"+w).select("."+F),l.yaxislayer=z.select(".overaxes-"+m).select("."+N)}_||(u||(i(l.minorGridlayer,"g",l.xaxis._id),i(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(B){return B[0]}).sort(t.idSort),i(l.gridlayer,"g",l.xaxis._id),i(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(B){return B[0]}).sort(t.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function p(T,l){if(T){var g={};T.each(function(m){var u=m[0],d=G.select(this);d.remove(),v(u,l),g[u]=!0});for(var x in l._plots)for(var A=l._plots[x],M=A.overlays||[],_=0;_=0,l=i.indexOf("end")>=0,g=f.backoff*p+a.standoff,x=c.backoff*v+a.startstandoff,A,M,_,w;if(s.nodeName==="line"){A={x:+n.attr("x1"),y:+n.attr("y1")},M={x:+n.attr("x2"),y:+n.attr("y2")};var m=A.x-M.x,u=A.y-M.y;if(_=Math.atan2(u,m),w=_+Math.PI,g&&x&&g+x>Math.sqrt(m*m+u*u)){Z();return}if(g){if(g*g>m*m+u*u){Z();return}var d=g*Math.cos(_),y=g*Math.sin(_);M.x+=d,M.y+=y,n.attr({x2:M.x,y2:M.y})}if(x){if(x*x>m*m+u*u){Z();return}var I=x*Math.cos(_),L=x*Math.sin(_);A.x-=I,A.y-=L,n.attr({x1:A.x,y1:A.y})}}else if(s.nodeName==="path"){var z=s.getTotalLength(),F="";if(z2/3?Un="right":Un="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[Un]}for(var ut=!1,dt=["x","y"],nt=0;nt1)&&(Qt===Nt?(Qe=ar.r2fraction(x["a"+Ft]),(Qe<0||Qe>1)&&(ut=!0)):ut=!0),Je=ar._offset+ar.r2p(x[Ft]),ye=.5}else{var Lt=Xe==="domain";Ft==="x"?(xe=x[Ft],Je=Lt?ar._offset+ar._length*xe:Je=u.l+u.w*xe):(xe=1-x[Ft],Je=Lt?ar._offset+ar._length*xe:Je=u.t+u.h*xe),ye=x.showarrow?.5:xe}if(x.showarrow){je.head=Je;var Ct=x["a"+Ft];if(Ee=Er*Ne(.5,x.xanchor)-$r*Ne(.5,x.yanchor),Qt===Nt){var Ot=t.getRefType(Qt);Ot==="domain"?(Ft==="y"&&(Ct=1-Ct),je.tail=ar._offset+ar._length*Ct):Ot==="paper"?Ft==="y"?(Ct=1-Ct,je.tail=u.t+u.h*Ct):je.tail=u.l+u.w*Ct:je.tail=ar._offset+ar.r2p(Ct),ke=Ee}else je.tail=Je+Ct,ke=Ee+Ct;je.text=je.tail+Ee;var Kt=m[Ft==="x"?"width":"height"];if(Nt==="paper"&&(je.head=E.constrain(je.head,1,Kt-1)),Qt==="pixel"){var xr=-Math.max(je.tail-3,je.text),mr=Math.min(je.tail+3,je.text)-Kt;xr>0?(je.tail+=xr,je.text+=xr):mr>0&&(je.tail-=mr,je.text-=mr)}je.tail+=Mt,je.head+=Mt}else Ee=Sr*Ne(ye,Ur),ke=Ee,je.text=Je+Ee;je.text+=Mt,Ee+=Mt,ke+=Mt,x["_"+Ft+"padplus"]=Sr/2+ke,x["_"+Ft+"padminus"]=Sr/2-ke,x["_"+Ft+"size"]=Sr,x["_"+Ft+"shift"]=Ee}if(ut){ce.remove();return}var vr=0,Nr=0;if(x.align!=="left"&&(vr=(et-ct)*(x.align==="center"?.5:1)),x.valign!=="top"&&(Nr=(Pe-at)*(x.valign==="middle"?.5:1)),Ye)ze.select("svg").attr({x:ne+vr-1,y:ne+Nr}).call(o.setClipUrl,ue?B:null,g);else{var kn=ne+Nr-st.top,$n=ne+vr-st.left;ie.call(i.positionText,$n,kn).call(o.setClipUrl,ue?B:null,g)}te.select("rect").call(o.setRect,ne,ne,et,Pe),$.call(o.setRect,V/2,V/2,Ae-V,pe-V),ce.call(o.setTranslate,Math.round(R.x.text-Ae/2),Math.round(R.y.text-pe/2)),Z.attr({transform:"rotate("+U+","+R.x.text+","+R.y.text+")"});var Vn=function(na,Un){j.selectAll(".annotation-arrow-g").remove();var ka=R.x.head,Va=R.y.head,sr=R.x.tail+na,Vt=R.y.tail+Un,or=R.x.text+na,ur=R.y.text+Un,Gr=E.rotationXYMatrix(U,or,ur),ln=E.apply2DTransform(Gr),gn=E.apply2DTransform2(Gr),An=+$.attr("width"),Qn=+$.attr("height"),pa=or-.5*An,ha=pa+An,_a=ur-.5*Qn,Ca=_a+Qn,Hn=[[pa,_a,pa,Ca],[pa,Ca,ha,Ca],[ha,Ca,ha,_a],[ha,_a,pa,_a]].map(gn);if(!Hn.reduce(function(At,lr){return At^!!E.segmentsIntersect(ka,Va,ka+1e6,Va+1e6,lr[0],lr[1],lr[2],lr[3])},!1)){Hn.forEach(function(At){var lr=E.segmentsIntersect(sr,Vt,ka,Va,At[0],At[1],At[2],At[3]);lr&&(sr=lr.x,Vt=lr.y)});var pi=x.arrowwidth,Si=x.arrowcolor,Dt=x.arrowside,xt=j.append("g").style({opacity:r.opacity(Si)}).classed("annotation-arrow-g",!0),Cr=xt.append("path").attr("d","M"+sr+","+Vt+"L"+ka+","+Va).style("stroke-width",pi+"px").call(r.stroke,r.rgb(Si));if(c(Cr,Dt,x),d.annotationPosition&&Cr.node().parentNode&&!M){var jr=ka,Vr=Va;if(x.standoff){var Dr=Math.sqrt(Math.pow(ka-sr,2)+Math.pow(Va-Vt,2));jr+=x.standoff*(sr-ka)/Dr,Vr+=x.standoff*(Vt-Va)/Dr}var qr=xt.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(sr-jr)+","+(Vt-Vr),transform:e(jr,Vr)}).style("stroke-width",pi+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),un,Jr;s.init({element:qr.node(),gd:g,prepFn:function(){var At=o.getTranslate(ce);un=At.x,Jr=At.y,_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0)},moveFn:function(At,lr){var zr=ln(un,Jr),cn=zr[0]+At,Rn=zr[1]+lr;ce.call(o.setTranslate,cn,Rn),F("x",T(_,At,"x",u,x)),F("y",T(w,lr,"y",u,x)),x.axref===x.xref&&F("ax",T(_,At,"ax",u,x)),x.ayref===x.yref&&F("ay",T(w,lr,"ay",u,x)),xt.attr("transform",e(At,lr)),Z.attr({transform:"rotate("+U+","+cn+","+Rn+")"})},doneFn:function(){b.call("_guiRelayout",g,N());var At=document.querySelector(".js-notes-box-panel");At&&At.redraw(At.selectedObj)}})}}};if(x.showarrow&&Vn(0,0),re){var ra;s.init({element:ce.node(),gd:g,prepFn:function(){ra=Z.attr("transform")},moveFn:function(na,Un){var ka="pointer";if(x.showarrow)x.axref===x.xref?F("ax",T(_,na,"ax",u,x)):F("ax",x.ax+na),x.ayref===x.yref?F("ay",T(w,Un,"ay",u.w,x)):F("ay",x.ay+Un),Vn(na,Un);else{if(M)return;var Va,sr;if(_)Va=T(_,na,"x",u,x);else{var Vt=x._xsize/u.w,or=x.x+(x._xshift-x.xshift)/u.w-Vt/2;Va=s.align(or+na/u.w,Vt,0,1,x.xanchor)}if(w)sr=T(w,Un,"y",u,x);else{var ur=x._ysize/u.h,Gr=x.y-(x._yshift+x.yshift)/u.h-ur/2;sr=s.align(Gr-Un/u.h,ur,0,1,x.yanchor)}F("x",Va),F("y",sr),(!_||!w)&&(ka=s.getCursor(_?.5:Va,w?.5:sr,x.xanchor,x.yanchor))}Z.attr({transform:e(na,Un)+ra}),a(ce,ka)},clickFn:function(na,Un){x.captureevents&&g.emit("plotly_clickannotation",le(Un))},doneFn:function(){a(ce),b.call("_guiRelayout",g,N());var na=document.querySelector(".js-notes-box-panel");na&&na.redraw(na.selectedObj)}})}}d.annotationText?ie.call(i.makeEditable,{delegate:ce,gd:g}).call(de).on("edit",function(Le){x.text=Le,this.call(de),F("text",Le),_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0),b.call("_guiRelayout",g,N())}):ie.call(de)}}}),f2=Ge({"src/components/annotations/click.js"(K,G){var h=_n(),b=Ro(),S=_u().arrayEditor;G.exports={hasClickToShow:E,onClick:e};function E(o,n){var i=t(o,n);return i.on.length>0||i.explicitOff.length>0}function e(o,n){var i=t(o,n),a=i.on,s=i.off.concat(i.explicitOff),f={},c=o._fullLayout.annotations,p,v;if(a.length||s.length){for(p=0;p1){a=!0;break}}a?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+n+'"]').remove():(i._pdata=b(e.glplot.cameraParams,[t.xaxis.r2l(i.x)*r[0],t.yaxis.r2l(i.y)*r[1],t.zaxis.r2l(i.z)*r[2]]),h(e.graphDiv,i,n,e.id,i._xa,i._ya))}}}}),hg=Ge({"src/components/annotations3d/index.js"(K,G){var h=Ro(),b=_n();G.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Yp()}}},layoutAttributes:Yp(),handleDefaults:d2(),includeBasePlot:S,convert:v2(),draw:Sx()};function S(E,e){var t=h.subplotsRegistry.gl3d;if(t)for(var r=t.attrRegex,o=Object.keys(E),n=0;n0?l+p:p;return{ppad:p,ppadplus:v?x:A,ppadminus:v?A:x}}else return{ppad:p}}function o(n,i,a){var s=n._id.charAt(0)==="x"?"x":"y",f=n.type==="category"||n.type==="multicategory",c,p,v=0,T=0,l=f?n.r2c:n.d2c,g=i[s+"sizemode"]==="scaled";if(g?(c=i[s+"0"],p=i[s+"1"],f&&(v=i[s+"0shift"],T=i[s+"1shift"])):(c=i[s+"anchor"],p=i[s+"anchor"]),c!==void 0)return[l(c)+v,l(p)+T];if(i.path){var x=1/0,A=-1/0,M=i.path.match(S.segmentRE),_,w,m,u,d;for(n.type==="date"&&(l=E.decodeDate(l)),_=0;_A&&(A=d)));if(A>=x)return[x,A]}}}}),ZM=Ge({"src/components/shapes/index.js"(K,G){var h=ig();G.exports={moduleType:"component",name:"shapes",layoutAttributes:jd(),supplyLayoutDefaults:Mx(),supplyDrawNewShapeDefaults:x5(),includeBasePlot:P1()("shapes"),calcAutorange:YM(),draw:h.draw,drawOne:h.drawOne}}}),b5=Ge({"src/components/images/attributes.js"(K,G){var h=sh(),b=_u().templatedArray;hm(),G.exports=b("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",h.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",h.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),od=Ge({"src/components/images/defaults.js"(K,G){var h=_n(),b=Ts(),S=yd(),E=b5(),e="images";G.exports=function(o,n){var i={name:e,handleItemDefaults:t};S(o,n,i)};function t(r,o,n){function i(g,x){return h.coerce(r,o,E,g,x)}var a=i("source"),s=i("visible",!!a);if(!s)return o;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var f={_fullLayout:n},c=["x","y"],p=0;p<2;p++){var v=c[p],T=b.coerceRef(r,o,f,v,"paper",void 0);if(T!=="paper"){var l=b.getFromId(f,T);l._imgIndices.push(o._index)}b.coercePosition(o,f,i,T,v,0)}return o}}}),p2=Ge({"src/components/images/draw.js"(K,G){var h=ki(),b=As(),S=Ts(),E=Df(),e=Lv();G.exports=function(r){var o=r._fullLayout,n=[],i={},a=[],s,f;for(f=0;f0);c&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),h.noneOrAll(n,i,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),h.coerceFont(s,"font",a.font),s("bgcolor",a.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function o(n,i){function a(f,c){return h.coerce(n,i,t,f,c)}var s=a("visible",n.method==="skip"||Array.isArray(n.args));s&&(a("method"),a("args"),a("args2"),a("label"),a("execute"))}}}),WM=Ge({"src/components/updatemenus/scrollbox.js"(K,G){G.exports=e;var h=ki(),b=go(),S=As(),E=_n();function e(t,r,o){this.gd=t,this.container=r,this.id=o,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.barWidth=2,e.barLength=20,e.barRadius=2,e.barPad=1,e.barColor="#808BA4",e.prototype.enable=function(r,o,n){var i=this.gd._fullLayout,a=i.width,s=i.height;this.position=r;var f=this.position.l,c=this.position.w,p=this.position.t,v=this.position.h,T=this.position.direction,l=T==="down",g=T==="left",x=T==="right",A=T==="up",M=c,_=v,w,m,u,d;!l&&!g&&!x&&!A&&(this.position.direction="down",l=!0);var y=l||A;y?(w=f,m=w+M,l?(u=p,d=Math.min(u+_,s),_=d-u):(d=p+_,u=Math.max(d-_,0),_=d-u)):(u=p,d=u+_,g?(m=f+M,w=Math.max(m-M,0),M=m-w):(w=f,m=Math.min(w+M,a),M=m-w)),this._box={l:w,t:u,w:M,h:_};var I=c>M,L=e.barLength+2*e.barPad,z=e.barWidth+2*e.barPad,F=f,N=p+v;N+z>s&&(N=s-z);var B=this.container.selectAll("rect.scrollbar-horizontal").data(I?[0]:[]);B.exit().on(".drag",null).remove(),B.enter().append("rect").classed("scrollbar-horizontal",!0).call(b.fill,e.barColor),I?(this.hbar=B.attr({rx:e.barRadius,ry:e.barRadius,x:F,y:N,width:L,height:z}),this._hbarXMin=F+L/2,this._hbarTranslateMax=M-L):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var R=v>_,U=e.barWidth+2*e.barPad,j=e.barLength+2*e.barPad,Z=f+c,re=p;Z+U>a&&(Z=a-U);var fe=this.container.selectAll("rect.scrollbar-vertical").data(R?[0]:[]);fe.exit().on(".drag",null).remove(),fe.enter().append("rect").classed("scrollbar-vertical",!0).call(b.fill,e.barColor),R?(this.vbar=fe.attr({rx:e.barRadius,ry:e.barRadius,x:Z,y:re,width:U,height:j}),this._vbarYMin=re+j/2,this._vbarTranslateMax=_-j):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var le=this.id,ce=w-.5,V=R?m+U+.5:m+.5,ee=u-.5,ne=I?d+z+.5:d+.5,$=i._topdefs.selectAll("#"+le).data(I||R?[0]:[]);if($.exit().remove(),$.enter().append("clipPath").attr("id",le).append("rect"),I||R?(this._clipRect=$.select("rect").attr({x:Math.floor(ce),y:Math.floor(ee),width:Math.ceil(V)-Math.floor(ce),height:Math.ceil(ne)-Math.floor(ee)}),this.container.call(S.setClipUrl,le,this.gd),this.bg.attr({x:f,y:p,width:c,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(S.setClipUrl,null),delete this._clipRect),I||R){var ue=h.behavior.drag().on("dragstart",function(){h.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(ue);var te=h.behavior.drag().on("dragstart",function(){h.event.sourceEvent.preventDefault(),h.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));I&&this.hbar.on(".drag",null).call(te),R&&this.vbar.on(".drag",null).call(te)}this.setTranslate(o,n)},e.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(S.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},e.prototype._onBoxDrag=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r-=h.event.dx),this.vbar&&(o-=h.event.dy),this.setTranslate(r,o)},e.prototype._onBoxWheel=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r+=h.event.deltaY),this.vbar&&(o+=h.event.deltaY),this.setTranslate(r,o)},e.prototype._onBarDrag=function(){var r=this.translateX,o=this.translateY;if(this.hbar){var n=r+this._hbarXMin,i=n+this._hbarTranslateMax,a=E.constrain(h.event.x,n,i),s=(a-n)/(i-n),f=this.position.w-this._box.w;r=s*f}if(this.vbar){var c=o+this._vbarYMin,p=c+this._vbarTranslateMax,v=E.constrain(h.event.y,c,p),T=(v-c)/(p-c),l=this.position.h-this._box.h;o=T*l}this.setTranslate(r,o)},e.prototype.setTranslate=function(r,o){var n=this.position.w-this._box.w,i=this.position.h-this._box.h;if(r=E.constrain(r||0,0,n),o=E.constrain(o||0,0,i),this.translateX=r,this.translateY=o,this.container.call(S.setTranslate,this._box.l-this.position.l-r,this._box.t-this.position.t-o),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+r-.5),y:Math.floor(this.position.t+o-.5)}),this.hbar){var a=r/n;this.hbar.call(S.setTranslate,r+a*this._hbarTranslateMax,o)}if(this.vbar){var s=o/i;this.vbar.call(S.setTranslate,r,o+s*this._vbarTranslateMax)}}}}),w5=Ge({"src/components/updatemenus/draw.js"(K,G){var h=ki(),b=ef(),S=go(),E=As(),e=_n(),t=nc(),r=_u().arrayEditor,o=ad().LINE_SPACING,n=O1(),i=WM();G.exports=function(L){var z=L._fullLayout,F=e.filterVisible(z[n.name]);function N(le){b.autoMargin(L,u(le))}var B=z._menulayer.selectAll("g."+n.containerClassName).data(F.length>0?[0]:[]);if(B.enter().append("g").classed(n.containerClassName,!0).style("cursor","pointer"),B.exit().each(function(){h.select(this).selectAll("g."+n.headerGroupClassName).each(N)}).remove(),F.length!==0){var R=B.selectAll("g."+n.headerGroupClassName).data(F,a);R.enter().append("g").classed(n.headerGroupClassName,!0);for(var U=e.ensureSingle(B,"g",n.dropdownButtonGroupClassName,function(le){le.style("pointer-events","all")}),j=0;j0?[0]:[]);Z.enter().append("g").classed(n.containerClassName,!0).style("cursor",R?null:"ew-resize");function re(V){V._commandObserver&&(V._commandObserver.remove(),delete V._commandObserver),b.autoMargin(B,c(V))}if(Z.exit().each(function(){h.select(this).selectAll("g."+n.groupClassName).each(re)}).remove(),j.length!==0){var fe=Z.selectAll("g."+n.groupClassName).data(j,v);fe.enter().append("g").classed(n.groupClassName,!0),fe.exit().each(re).remove();for(var le=0;le0&&(fe=fe.transition().duration(B.transition.duration).ease(B.transition.easing)),fe.attr("transform",t(re-n.gripWidth*.5,B._dims.currentValueTotalHeight))}}function I(N,B){var R=N._dims;return R.inputAreaStart+n.stepInset+(R.inputAreaLength-2*n.stepInset)*Math.min(1,Math.max(0,B))}function L(N,B){var R=N._dims;return Math.min(1,Math.max(0,(B-n.stepInset-R.inputAreaStart)/(R.inputAreaLength-2*n.stepInset-2*R.inputAreaStart)))}function z(N,B,R){var U=R._dims,j=e.ensureSingle(N,"rect",n.railTouchRectClass,function(Z){Z.call(m,B,N,R).style("pointer-events","all")});j.attr({width:U.inputAreaLength,height:Math.max(U.inputAreaWidth,n.tickOffset+R.ticklen+U.labelHeight)}).call(S.fill,R.bgcolor).attr("opacity",0),E.setTranslate(j,0,U.currentValueTotalHeight)}function F(N,B){var R=B._dims,U=R.inputAreaLength-n.railInset*2,j=e.ensureSingle(N,"rect",n.railRectClass);j.attr({width:U,height:n.railWidth,rx:n.railRadius,ry:n.railRadius,"shape-rendering":"crispEdges"}).call(S.stroke,B.bordercolor).call(S.fill,B.bgcolor).style("stroke-width",B.borderwidth+"px"),E.setTranslate(j,n.railInset,(R.inputAreaWidth-n.railWidth)*.5+R.currentValueTotalHeight)}}}),T5=Ge({"src/components/sliders/index.js"(K,G){var h=F1();G.exports={moduleType:"component",name:h.name,layoutAttributes:gm(),supplyLayoutDefaults:m2(),draw:Ex()}}}),ym=Ge({"src/components/rangeslider/attributes.js"(K,G){var h=Xf();G.exports={bgcolor:{valType:"color",dflt:h.background,editType:"plot"},bordercolor:{valType:"color",dflt:h.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),kx=Ge({"src/components/rangeslider/oppaxis_attributes.js"(K,G){G.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),hy=Ge({"src/components/rangeslider/constants.js"(K,G){G.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),Cx=Ge({"src/components/rangeslider/helpers.js"(K){var G=Df(),h=nc(),b=hy(),S=ad().LINE_SPACING,E=b.name;function e(t){var r=t&&t[E];return r&&r.visible}K.isVisible=e,K.makeData=function(t){for(var r=G.list({_fullLayout:t},"x",!0),o=t.margin,n=[],i=0;i=ct.max)Ye=de[st+1];else if(ze=ct.pmax)Ye=de[st+1];else if(ze0?m.touches[0].clientX:0}function p(m,u,d,y){if(u._context.staticPlot)return;var I=m.select("rect."+f.slideBoxClassName).node(),L=m.select("rect."+f.grabAreaMinClassName).node(),z=m.select("rect."+f.grabAreaMaxClassName).node();function F(){var N=h.event,B=N.target,R=c(N),U=R-m.node().getBoundingClientRect().left,j=y.d2p(d._rl[0]),Z=y.d2p(d._rl[1]),re=a.coverSlip();this.addEventListener("touchmove",fe),this.addEventListener("touchend",le),re.addEventListener("mousemove",fe),re.addEventListener("mouseup",le);function fe(ce){var V=c(ce),ee=+V-R,ne,$,ue;switch(B){case I:if(ue="ew-resize",j+ee>d._length||Z+ee<0)return;ne=j+ee,$=Z+ee;break;case L:if(ue="col-resize",j+ee>d._length)return;ne=j+ee,$=Z;break;case z:if(ue="col-resize",Z+ee<0)return;ne=j,$=Z+ee;break;default:ue="ew-resize",ne=U,$=U+ee;break}if($0);if(g){var x=o(a,s,f);T("x",x[0]),T("y",x[1]),h.noneOrAll(i,a,["x","y"]),T("xanchor"),T("yanchor"),h.coerceFont(T,"font",s.font);var A=T("bgcolor");T("activecolor",b.contrast(A,t.lightAmount,t.darkAmount)),T("bordercolor"),T("borderwidth")}};function r(n,i,a,s){var f=s.calendar;function c(T,l){return h.coerce(n,i,e.buttons,T,l)}var p=c("visible");if(p){var v=c("step");v!=="all"&&(f&&f!=="gregorian"&&(v==="month"||v==="year")?i.stepmode="backward":c("stepmode"),c("count")),c("label")}}function o(n,i,a){for(var s=a.filter(function(v){return i[v].anchor===n._id}),f=0,c=0;c1)){delete f.grid;return}if(!T&&!l&&!g){var d=w("pattern")==="independent";d&&(T=!0)}_._hasSubplotGrid=T;var y=w("roworder"),I=y==="top to bottom",L=T?.2:.1,z=T?.3:.1,F,N;x&&f._splomGridDflt&&(F=f._splomGridDflt.xside,N=f._splomGridDflt.yside),_._domains={x:n("x",w,L,F,u),y:n("y",w,z,N,m,I)}}function n(s,f,c,p,v,T){var l=f(s+"gap",c),g=f("domain."+s);f(s+"side",p);for(var x=new Array(v),A=g[0],M=(g[1]-A)/(v-l),_=M*(1-l),w=0;w0,p=r._context.staticPlot;o.each(function(v){var T=v[0].trace,l=T.error_x||{},g=T.error_y||{},x;T.ids&&(x=function(w){return w.id});var A=E.hasMarkers(T)&&T.marker.maxdisplayed>0;!g.visible&&!l.visible&&(v=[]);var M=h.select(this).selectAll("g.errorbar").data(v,x);if(M.exit().remove(),!!v.length){l.visible||M.selectAll("path.xerror").remove(),g.visible||M.selectAll("path.yerror").remove(),M.style("opacity",1);var _=M.enter().append("g").classed("errorbar",!0);c&&_.style("opacity",0).transition().duration(i.duration).style("opacity",1),S.setClipUrl(M,n.layerClipId,r),M.each(function(w){var m=h.select(this),u=e(w,s,f);if(!(A&&!w.vis)){var d,y=m.select("path.yerror");if(g.visible&&b(u.x)&&b(u.yh)&&b(u.ys)){var I=g.width;d="M"+(u.x-I)+","+u.yh+"h"+2*I+"m-"+I+",0V"+u.ys,u.noYS||(d+="m-"+I+",0h"+2*I),a=!y.size(),a?y=m.append("path").style("vector-effect",p?"none":"non-scaling-stroke").classed("yerror",!0):c&&(y=y.transition().duration(i.duration).ease(i.easing)),y.attr("d",d)}else y.remove();var L=m.select("path.xerror");if(l.visible&&b(u.y)&&b(u.xh)&&b(u.xs)){var z=(l.copy_ystyle?g:l).width;d="M"+u.xh+","+(u.y-z)+"v"+2*z+"m0,-"+z+"H"+u.xs,u.noXS||(d+="m0,-"+z+"v"+2*z),a=!L.size(),a?L=m.append("path").style("vector-effect",p?"none":"non-scaling-stroke").classed("xerror",!0):c&&(L=L.transition().duration(i.duration).ease(i.easing)),L.attr("d",d)}else L.remove()}})}})};function e(t,r,o){var n={x:r.c2p(t.x),y:o.c2p(t.y)};return t.yh!==void 0&&(n.yh=o.c2p(t.yh),n.ys=o.c2p(t.ys),b(n.ys)||(n.noYS=!0,n.ys=o.c2p(t.ys,!0))),t.xh!==void 0&&(n.xh=r.c2p(t.xh),n.xs=r.c2p(t.xs),b(n.xs)||(n.noXS=!0,n.xs=r.c2p(t.xs,!0))),n}}}),xm=Ge({"src/components/errorbars/style.js"(K,G){var h=ki(),b=go();G.exports=function(E){E.each(function(e){var t=e[0].trace,r=t.error_y||{},o=t.error_x||{},n=h.select(this);n.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(b.stroke,r.color),o.copy_ystyle&&(o=r),n.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(b.stroke,o.color)})}}}),bm=Ge({"src/components/errorbars/index.js"(K,G){var h=_n(),b=Hc().overrideAll,S=_m(),E={error_x:h.extendFlat({},S),error_y:h.extendFlat({},S)};delete E.error_x.copy_zstyle,delete E.error_y.copy_zstyle,delete E.error_y.copy_ystyle;var e={error_x:h.extendFlat({},S),error_y:h.extendFlat({},S),error_z:h.extendFlat({},S)};delete e.error_x.copy_ystyle,delete e.error_y.copy_ystyle,delete e.error_z.copy_ystyle,delete e.error_z.copy_zstyle,G.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:E,bar:E,histogram:E,scatter3d:b(e,"calc","nested"),scattergl:b(E,"calc","nested")}},supplyDefaults:M5(),calc:_2(),makeComputeError:U0(),plot:x2(),style:xm(),hoverInfo:t};function t(r,o,n){(o.error_y||{}).visible&&(n.yerr=r.yh-r.y,o.error_y.symmetric||(n.yerrneg=r.y-r.ys)),(o.error_x||{}).visible&&(n.xerr=r.xh-r.x,o.error_x.symmetric||(n.xerrneg=r.x-r.xs))}}}),U1=Ge({"src/components/colorbar/constants.js"(K,G){G.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),b2=Ge({"src/components/colorbar/draw.js"(K,G){var h=ki(),b=Rs(),S=ef(),E=Ro(),e=Ts(),t=uv(),r=_n(),o=r.strTranslate,n=Ji().extendFlat,i=Up(),a=As(),s=go(),f=um(),c=nc(),p=gd().flipScale,v=Xp(),T=Rv(),l=id(),g=ad(),x=g.LINE_SPACING,A=g.FROM_TL,M=g.FROM_BR,_=U1().cn;function w(L){var z=L._fullLayout,F=z._infolayer.selectAll("g."+_.colorbar).data(m(L),function(N){return N._id});F.enter().append("g").attr("class",function(N){return N._id}).classed(_.colorbar,!0),F.each(function(N){var B=h.select(this);r.ensureSingle(B,"rect",_.cbbg),r.ensureSingle(B,"g",_.cbfills),r.ensureSingle(B,"g",_.cblines),r.ensureSingle(B,"g",_.cbaxis,function(U){U.classed(_.crisp,!0)}),r.ensureSingle(B,"g",_.cbtitleunshift,function(U){U.append("g").classed(_.cbtitle,!0)}),r.ensureSingle(B,"rect",_.cboutline);var R=u(B,N,L);R&&R.then&&(L._promises||[]).push(R),L._context.edits.colorbarPosition&&d(B,N,L)}),F.exit().each(function(N){S.autoMargin(L,N._id)}).remove(),F.order()}function m(L){var z=L._fullLayout,F=L.calcdata,N=[],B,R,U,j;function Z(H){return n(H,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function re(){typeof j.calc=="function"?j.calc(L,U,B):(B._fillgradient=R.reversescale?p(R.colorscale):R.colorscale,B._zrange=[R[j.min],R[j.max]])}for(var fe=0;fe1){var je=Math.pow(10,Math.floor(Math.log(Mt)/Math.LN10));Sr*=je*r.roundUp(Mt/je,[2,5,10]),(Math.abs(st.start)/st.size+1e-6)%1<2e-6&&(Er.tick0=0)}Er.dtick=Sr}Er.domain=N?[ar+ee/ae.h,ar+Ne-ee/ae.h]:[ar+V/ae.w,ar+Ne-V/ae.w],Er.setScale(),L.attr("transform",o(Math.round(ae.l),Math.round(ae.t)));var Je=L.select("."+_.cbtitleunshift).attr("transform",o(-Math.round(ae.l),-Math.round(ae.t))),ke=Er.ticklabelposition,xe=Er.title.font.size,ye=L.select("."+_.cbaxis),Ee,Xe=0,Qe=0;function Lt(mr,vr){var Nr={propContainer:Er,propName:z._propPrefix+"title.text",traceIndex:z._traceIndex,_meta:z._meta,placeholder:H._dfltTitle.colorbar,containerGroup:L.select("."+_.cbtitle)},kn=mr.charAt(0)==="h"?mr.slice(1):"h"+mr;L.selectAll("."+kn+",."+kn+"-math-group").remove(),f.draw(F,mr,n(Nr,vr||{}))}function Ct(){if(N&&$r||!N&&!$r){var mr,vr;Le==="top"&&(mr=V+ae.l+ut*ne,vr=ee+ae.t+dt*(1-ar-Ne)+3+xe*.75),Le==="bottom"&&(mr=V+ae.l+ut*ne,vr=ee+ae.t+dt*(1-ar)-3-xe*.25),Le==="right"&&(vr=ee+ae.t+dt*$+3+xe*.75,mr=V+ae.l+ut*ar),Lt(Er._id+"title",{attributes:{x:mr,y:vr,"text-anchor":N?"start":"middle"}})}}function Ot(){if(N&&!$r||!N&&$r){var mr=Er.position||0,vr=Er._offset+Er._length/2,Nr,kn;if(Le==="right")kn=vr,Nr=ae.l+ut*mr+10+xe*(Er.showticklabels?1:.5);else if(Nr=vr,Le==="bottom"&&(kn=ae.t+dt*mr+10+(ke.indexOf("inside")===-1?Er.tickfont.size:0)+(Er.ticks!=="inside"&&z.ticklen||0)),Le==="top"){var $n=Se.text.split("
").length;kn=ae.t+dt*mr+10-Pe-x*xe*$n}Lt((N?"h":"v")+Er._id+"title",{avoid:{selection:h.select(F).selectAll("g."+Er._id+"tick"),side:Le,offsetTop:N?0:ae.t,offsetLeft:N?ae.l:0,maxShift:N?H.width:H.height},attributes:{x:Nr,y:kn,"text-anchor":"middle"},transform:{rotate:N?-90:0,offset:0}})}}function Kt(){if(!N&&!$r||N&&$r){var mr=L.select("."+_.cbtitle),vr=mr.select("text"),Nr=[-Z/2,Z/2],kn=mr.select(".h"+Er._id+"title-math-group").node(),$n=15.6;vr.node()&&($n=parseInt(vr.node().style.fontSize,10)*x);var Vn;if(kn?(Vn=a.bBox(kn),Qe=Vn.width,Xe=Vn.height,Xe>$n&&(Nr[1]-=(Xe-$n)/2)):vr.node()&&!vr.classed(_.jsPlaceholder)&&(Vn=a.bBox(vr.node()),Qe=Vn.width,Xe=Vn.height),N){if(Xe){if(Xe+=5,Le==="top")Er.domain[1]-=Xe/ae.h,Nr[1]*=-1;else{Er.domain[0]+=Xe/ae.h;var ra=c.lineCount(vr);Nr[1]+=(1-ra)*$n}mr.attr("transform",o(Nr[0],Nr[1])),Er.setScale()}}else Qe&&(Le==="right"&&(Er.domain[0]+=(Qe+xe/2)/ae.w),mr.attr("transform",o(Nr[0],Nr[1])),Er.setScale())}L.selectAll("."+_.cbfills+",."+_.cblines).attr("transform",N?o(0,Math.round(ae.h*(1-Er.domain[1]))):o(Math.round(ae.w*Er.domain[0]),0)),ye.attr("transform",N?o(0,Math.round(-ae.t)):o(Math.round(-ae.l),0));var na=L.select("."+_.cbfills).selectAll("rect."+_.cbfill).attr("style","").data(at);na.enter().append("rect").classed(_.cbfill,!0).attr("style",""),na.exit().remove();var Un=Fe.map(Er.c2p).map(Math.round).sort(function(or,ur){return or-ur});na.each(function(or,ur){var Gr=[ur===0?Fe[0]:(at[ur]+at[ur-1])/2,ur===at.length-1?Fe[1]:(at[ur]+at[ur+1])/2].map(Er.c2p).map(Math.round);N&&(Gr[1]=r.constrain(Gr[1]+(Gr[1]>Gr[0])?1:-1,Un[0],Un[1]));var ln=h.select(this).attr(N?"x":"y",nt).attr(N?"y":"x",h.min(Gr)).attr(N?"width":"height",Math.max(Pe,2)).attr(N?"height":"width",Math.max(h.max(Gr)-h.min(Gr),2));if(z._fillgradient)a.gradient(ln,F,z._id,N?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var gn=Ye(or).replace("e-","");ln.attr("fill",b(gn).toHexString())}});var ka=L.select("."+_.cblines).selectAll("path."+_.cbline).data(de.color&&de.width?et:[]);ka.enter().append("path").classed(_.cbline,!0),ka.exit().remove(),ka.each(function(or){var ur=nt,Gr=Math.round(Er.c2p(or))+de.width/2%1;h.select(this).attr("d","M"+(N?ur+","+Gr:Gr+","+ur)+(N?"h":"v")+Pe).call(a.lineGroupStyle,de.width,ze(or),de.dash)}),ye.selectAll("g."+Er._id+"tick,path").remove();var Va=nt+Pe+(Z||0)/2-(z.ticks==="outside"?1:0),sr=e.calcTicks(Er),Vt=e.getTickSigns(Er)[2];return e.drawTicks(F,Er,{vals:Er.ticks==="inside"?e.clipEnds(Er,sr):sr,layer:ye,path:e.makeTickPath(Er,Va,Vt),transFn:e.makeTransTickFn(Er)}),e.drawLabels(F,Er,{vals:sr,layer:ye,transFn:e.makeTransTickLabelFn(Er),labelFns:e.makeLabelFns(Er,Va)})}function xr(){var mr,vr=Pe+Z/2;ke.indexOf("inside")===-1&&(mr=a.bBox(ye.node()),vr+=N?mr.width:mr.height),Ee=Je.select("text");var Nr=0,kn=N&&Le==="top",$n=!N&&Le==="right",Vn=0;if(Ee.node()&&!Ee.classed(_.jsPlaceholder)){var ra,na=Je.select(".h"+Er._id+"title-math-group").node();na&&(N&&$r||!N&&!$r)?(mr=a.bBox(na),Nr=mr.width,ra=mr.height):(mr=a.bBox(Je.node()),Nr=mr.right-ae.l-(N?nt:kr),ra=mr.bottom-ae.t-(N?kr:nt),!N&&Le==="top"&&(vr+=mr.height,Vn=mr.height)),$n&&(Ee.attr("transform",o(Nr/2+xe/2,0)),Nr*=2),vr=Math.max(vr,N?Nr:ra)}var Un=(N?V:ee)*2+vr+re+Z/2,ka=0;!N&&Se.text&&ce==="bottom"&&$<=0&&(ka=Un/2,Un+=ka,Vn+=ka),H._hColorbarMoveTitle=ka,H._hColorbarMoveCBTitle=Vn;var Va=re+Z,sr=(N?nt:kr)-Va/2-(N?V:0),Vt=(N?kr:nt)-(N?pe:ee+Vn-ka);L.select("."+_.cbbg).attr("x",sr).attr("y",Vt).attr(N?"width":"height",Math.max(Un-ka,2)).attr(N?"height":"width",Math.max(pe+Va,2)).call(s.fill,fe).call(s.stroke,z.bordercolor).style("stroke-width",re);var or=$n?Math.max(Nr-10,0):0;L.selectAll("."+_.cboutline).attr("x",(N?nt:kr+V)+or).attr("y",(N?kr+ee-pe:nt)+(kn?Xe:0)).attr(N?"width":"height",Math.max(Pe,2)).attr(N?"height":"width",Math.max(pe-(N?2*ee+Xe:2*V+or),2)).call(s.stroke,z.outlinecolor).style({fill:"none","stroke-width":Z});var ur=N?Ft*Un:0,Gr=N?0:(1-Nt)*Un-Vn;if(ur=te?ae.l-ur:-ur,Gr=ue?ae.t-Gr:-Gr,L.attr("transform",o(ur,Gr)),!N&&(re||b(fe).getAlpha()&&!b.equals(H.paper_bgcolor,fe))){var ln=ye.selectAll("text"),gn=ln[0].length,An=L.select("."+_.cbbg).node(),Qn=a.bBox(An),pa=a.getTranslate(L),ha=2;ln.each(function(Vr,Dr){var qr=0,un=gn-1;if(Dr===qr||Dr===un){var Jr=a.bBox(this),At=a.getTranslate(this),lr;if(Dr===un){var zr=Jr.right+At.x,cn=Qn.right+pa.x+kr-re-ha+ne;lr=cn-zr,lr>0&&(lr=0)}else if(Dr===qr){var Rn=Jr.left+At.x,qn=Qn.left+pa.x+kr+re+ha;lr=qn-Rn,lr<0&&(lr=0)}lr&&(gn<3?this.setAttribute("transform","translate("+lr+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var _a={},Ca=A[le],Hn=M[le],pi=A[ce],Si=M[ce],Dt=Un-Pe;N?(R==="pixels"?(_a.y=$,_a.t=pe*pi,_a.b=pe*Si):(_a.t=_a.b=0,_a.yt=$+B*pi,_a.yb=$-B*Si),j==="pixels"?(_a.x=ne,_a.l=Un*Ca,_a.r=Un*Hn):(_a.l=Dt*Ca,_a.r=Dt*Hn,_a.xl=ne-U*Ca,_a.xr=ne+U*Hn)):(R==="pixels"?(_a.x=ne,_a.l=pe*Ca,_a.r=pe*Hn):(_a.l=_a.r=0,_a.xl=ne+B*Ca,_a.xr=ne-B*Hn),j==="pixels"?(_a.y=1-$,_a.t=Un*pi,_a.b=Un*Si):(_a.t=Dt*pi,_a.b=Dt*Si,_a.yt=$-U*pi,_a.yb=$+U*Si));var xt=z.y<.5?"b":"t",Cr=z.x<.5?"l":"r";F._fullLayout._reservedMargin[z._id]={};var jr={r:H.width-sr-ur,l:sr+_a.r,b:H.height-Vt-Gr,t:Vt+_a.b};te&&ue?S.autoMargin(F,z._id,_a):te?F._fullLayout._reservedMargin[z._id][xt]=jr[xt]:ue||N?F._fullLayout._reservedMargin[z._id][Cr]=jr[Cr]:F._fullLayout._reservedMargin[z._id][xt]=jr[xt]}return r.syncOrAsync([S.previousPromises,Ct,Kt,Ot,S.previousPromises,xr],F)}function d(L,z,F){var N=z.orientation==="v",B=F._fullLayout,R=B._size,U,j,Z;t.init({element:L.node(),gd:F,prepFn:function(){U=L.attr("transform"),i(L)},moveFn:function(re,fe){L.attr("transform",U+o(re,fe)),j=t.align((N?z._uFrac:z._vFrac)+re/R.w,N?z._thickFrac:z._lenFrac,0,1,z.xanchor),Z=t.align((N?z._vFrac:1-z._uFrac)-fe/R.h,N?z._lenFrac:z._thickFrac,0,1,z.yanchor);var le=t.getCursor(j,Z,z.xanchor,z.yanchor);i(L,le)},doneFn:function(){if(i(L),j!==void 0&&Z!==void 0){var re={};re[z._propPrefix+"x"]=j,re[z._propPrefix+"y"]=Z,z._traceIndex!==void 0?E.call("_guiRestyle",F,re,z._traceIndex):E.call("_guiRelayout",F,re)}}})}function y(L,z,F){var N=z._levels,B=[],R=[],U,j,Z=N.end+N.size/100,re=N.size,fe=1.001*F[0]-.001*F[1],le=1.001*F[1]-.001*F[0];for(j=0;j<1e5&&(U=N.start+j*re,!(re>0?U>=Z:U<=Z));j++)U>fe&&U0?U>=Z:U<=Z));j++)U>F[0]&&U-1}G.exports=function(o,n){var i,a=o.data,s=o.layout,f=E([],a),c=E({},s,e(n.tileClass)),p=o._context||{};if(n.width&&(c.width=n.width),n.height&&(c.height=n.height),n.tileClass==="thumbnail"||n.tileClass==="themes__thumb"){c.annotations=[];var v=Object.keys(c);for(i=0;i=0)return p}else if(typeof p=="string"&&(p=p.trim(),p.slice(-1)==="%"&&h(p.slice(0,-1))&&(p=+p.slice(0,-1),p>=0)))return p+"%"}function c(p,v,T,l,g,x){x=x||{};var A=x.moduleHasSelected!==!1,M=x.moduleHasUnselected!==!1,_=x.moduleHasConstrain!==!1,w=x.moduleHasCliponaxis!==!1,m=x.moduleHasTextangle!==!1,u=x.moduleHasInsideanchor!==!1,d=!!x.hasPathbar,y=Array.isArray(g)||g==="auto",I=y||g==="inside",L=y||g==="outside";if(I||L){var z=i(l,"textfont",T.font),F=b.extendFlat({},z),N=p.textfont&&p.textfont.color,B=!N;if(B&&delete F.color,i(l,"insidetextfont",F),d){var R=b.extendFlat({},z);B&&delete R.color,i(l,"pathbar.textfont",R)}L&&i(l,"outsidetextfont",z),A&&l("selected.textfont.color"),M&&l("unselected.textfont.color"),_&&l("constraintext"),w&&l("cliponaxis"),m&&l("textangle"),l("texttemplate"),l("texttemplatefallback")}I&&u&&l("insidetextanchor")}G.exports={supplyDefaults:a,crossTraceDefaults:s,handleText:c,validateCornerradius:f}}}),S2=Ge({"src/traces/bar/layout_defaults.js"(K,G){var h=Ro(),b=Ts(),S=_n(),E=Iv(),e=Dv().validateCornerradius;G.exports=function(t,r,o){function n(A,M){return S.coerce(t,r,E,A,M)}for(var i=!1,a=!1,s=!1,f={},c=n("barmode"),p=c==="group",v=0;v0&&!f[l]&&(s=!0),f[l]=!0),T.visible&&T.type==="histogram"){var g=b.getFromId({_fullLayout:r},T[T.orientation==="v"?"xaxis":"yaxis"]);g.type!=="category"&&(a=!0)}}if(!i){delete r.barmode;return}c!=="overlay"&&n("barnorm"),n("bargap",a&&!s?0:.2),n("bargroupgap");var x=n("barcornerradius");r.barcornerradius=e(x)}}}),Zp=Ge({"src/traces/bar/arrays_to_calcdata.js"(K,G){var h=_n();G.exports=function(S,E){for(var e=0;er;if(!o)return E}return e!==void 0?e:S.dflt},K.coerceColor=function(S,E,e){return h(E).isValid()?E:e!==void 0?e:S.dflt},K.coerceEnumerated=function(S,E,e){return S.coerceNumber&&(E=+E),S.values.indexOf(E)!==-1?E:e!==void 0?e:S.dflt},K.getValue=function(S,E){var e;return b(S)?E1||d.bargap===0&&d.bargroupgap===0&&!y[0].trace.marker.line.width)&&h.select(this).attr("shape-rendering","crispEdges")}),m.selectAll("g.points").each(function(y){var I=h.select(this),L=y[0].trace;f(I,L,w)}),e.getComponentMethod("errorbars","style")(m)}function f(w,m,u){S.pointStyle(w.selectAll("path"),m,u),c(w,m,u)}function c(w,m,u){w.selectAll("text").each(function(d){var y=h.select(this),I=E.ensureUniformFontSize(u,l(y,d,m,u));S.font(y,I)})}function p(w,m,u){var d=m[0].trace;d.selectedpoints?v(u,d,w):(f(u,d,w),e.getComponentMethod("errorbars","style")(u))}function v(w,m,u){S.selectedPointStyle(w.selectAll("path"),m),T(w.selectAll("text"),m,u)}function T(w,m,u){w.each(function(d){var y=h.select(this),I;if(d.selected){I=E.ensureUniformFontSize(u,l(y,d,m,u));var L=m.selected.textfont&&m.selected.textfont.color;L&&(I.color=L),S.font(y,I)}else S.selectedTextStyle(y,m)})}function l(w,m,u,d){var y=d._fullLayout.font,I=u.textfont;if(w.classed("bartext-inside")){var L=_(m,u);I=x(u,m.i,y,L)}else w.classed("bartext-outside")&&(I=A(u,m.i,y));return I}function g(w,m,u){return M(o,w.textfont,m,u)}function x(w,m,u,d){var y=g(w,m,u),I=w._input.textfont===void 0||w._input.textfont.color===void 0||Array.isArray(w.textfont.color)&&w.textfont.color[m]===void 0;return I&&(y={color:b.contrast(d),family:y.family,size:y.size,weight:y.weight,style:y.style,variant:y.variant,textcase:y.textcase,lineposition:y.lineposition,shadow:y.shadow}),M(n,w.insidetextfont,m,y)}function A(w,m,u){var d=g(w,m,u);return M(i,w.outsidetextfont,m,d)}function M(w,m,u,d){m=m||{};var y=a.getValue(m.family,u),I=a.getValue(m.size,u),L=a.getValue(m.color,u),z=a.getValue(m.weight,u),F=a.getValue(m.style,u),N=a.getValue(m.variant,u),B=a.getValue(m.textcase,u),R=a.getValue(m.lineposition,u),U=a.getValue(m.shadow,u);return{family:a.coerceString(w.family,y,d.family),size:a.coerceNumber(w.size,I,d.size),color:a.coerceColor(w.color,L,d.color),weight:a.coerceString(w.weight,z,d.weight),style:a.coerceString(w.style,F,d.style),variant:a.coerceString(w.variant,N,d.variant),textcase:a.coerceString(w.variant,B,d.textcase),lineposition:a.coerceString(w.variant,R,d.lineposition),shadow:a.coerceString(w.variant,U,d.shadow)}}function _(w,m){return m.type==="waterfall"?m[w.dir].marker.color:w.mcc||w.mc||m.marker.color}G.exports={style:s,styleTextPoints:c,styleOnSelect:p,getInsideTextFont:x,getOutsideTextFont:A,getBarColor:_,resizeText:t}}}),su=Ge({"src/traces/bar/plot.js"(K,G){var h=ki(),b=Ei(),S=_n(),E=nc(),e=go(),t=As(),r=Ro(),o=Ts().tickText,n=fc(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=xd(),f=py(),c=wm(),p=qh(),v=p.text,T=p.textposition,l=Kd().appendArrayPointValue,g=c.TEXTPAD;function x(re){return re.id}function A(re){if(re.ids)return x}function M(re){return(re>0)-(re<0)}function _(re,fe){return re0}function d(re,fe,le,ce,V,ee){var ne=fe.xaxis,$=fe.yaxis,ue=re._fullLayout,te=re._context.staticPlot;V||(V={mode:ue.barmode,norm:ue.barmode,gap:ue.bargap,groupgap:ue.bargroupgap},a("bar",ue));var H=S.makeTraceGroups(ce,le,"trace bars").each(function(ae){var ie=h.select(this),de=ae[0].trace,Se=ae[0].t,Le=de.type==="waterfall",Fe=de.type==="funnel",ze=de.type==="histogram",Ye=de.type==="bar",st=Ye||Fe,ct=0;Le&&de.connector.visible&&de.connector.mode==="between"&&(ct=de.connector.line.width/2);var at=de.orientation==="h",et=u(V),Pe=S.ensureSingle(ie,"g","points"),Ae=A(de),pe=Pe.selectAll("g.point").data(S.identity,Ae);pe.enter().append("g").classed("point",!0),pe.exit().remove(),pe.each(function(ut,dt){var nt=h.select(this),Ft=w(ut,ne,$,at),Nt=Ft[0][0],Qt=Ft[0][1],ar=Ft[1][0],kr=Ft[1][1],Er=(at?Qt-Nt:kr-ar)===0;Er&&st&&f.getLineWidth(de,ut)&&(Er=!1),Er||(Er=!b(Nt)||!b(Qt)||!b(ar)||!b(kr)),ut.isBlank=Er,Er&&(at?Qt=Nt:kr=ar),ct&&!Er&&(at?(Nt-=_(Nt,Qt)*ct,Qt+=_(Nt,Qt)*ct):(ar-=_(ar,kr)*ct,kr+=_(ar,kr)*ct));var $r,Sr;if(de.type==="waterfall"){if(!Er){var Ur=de[ut.dir].marker;$r=Ur.line.width,Sr=Ur.color}}else $r=f.getLineWidth(de,ut),Sr=ut.mc||de.marker.color;function Mt(Va){var sr=h.round($r/2%1,2);return V.gap===0&&V.groupgap===0?h.round(Math.round(Va)-sr,2):Va}function je(Va,sr,Vt){return Vt&&Va===sr?Va:Math.abs(Va-sr)>=2?Mt(Va):Va>sr?Math.ceil(Va):Math.floor(Va)}var Je=e.opacity(Sr),ke=Je<1||$r>.01?Mt:je;re._context.staticPlot||(Nt=ke(Nt,Qt,at),Qt=ke(Qt,Nt,at),ar=ke(ar,kr,!at),kr=ke(kr,ar,!at));var xe=at?ne.c2p:$.c2p,ye;ut.s0>0?ye=ut._sMax:ut.s0<0?ye=ut._sMin:ye=ut.s1>0?ut._sMax:ut._sMin;function Ee(Va,sr){if(!Va)return 0;var Vt=Math.abs(at?kr-ar:Qt-Nt),or=Math.abs(at?Qt-Nt:kr-ar),ur=ke(Math.abs(xe(ye,!0)-xe(0,!0))),Gr=ut.hasB?Math.min(Vt/2,or/2):Math.min(Vt/2,ur),ln;if(sr==="%"){var gn=Math.min(50,Va);ln=Vt*(gn/100)}else ln=Va;return ke(Math.max(Math.min(ln,Gr),0))}var Xe=Ye||ze?Ee(Se.cornerradiusvalue,Se.cornerradiusform):0,Qe,Lt,Ct="M"+Nt+","+ar+"V"+kr+"H"+Qt+"V"+ar+"Z",Ot=0;if(Xe&&ut.s){var Kt=M(ut.s0)===0||M(ut.s)===M(ut.s0)?ut.s1:ut.s0;if(Ot=ke(ut.hasB?0:Math.abs(xe(ye,!0)-xe(Kt,!0))),Ot0?Math.sqrt(Ot*(2*Xe-Ot)):0,$n=xr>0?Math.max:Math.min;Qe="M"+Nt+","+ar+"V"+(kr-Nr*mr)+"H"+$n(Qt-(Xe-Ot)*xr,Nt)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+Qt+","+(kr-Xe*mr-kn)+"V"+(ar+Xe*mr+kn)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+$n(Qt-(Xe-Ot)*xr,Nt)+","+(ar+Nr*mr)+"Z"}else if(ut.hasB)Qe="M"+(Nt+Xe*xr)+","+ar+"A "+Xe+","+Xe+" 0 0 "+vr+" "+Nt+","+(ar+Xe*mr)+"V"+(kr-Xe*mr)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Nt+Xe*xr)+","+kr+"H"+(Qt-Xe*xr)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+Qt+","+(kr-Xe*mr)+"V"+(ar+Xe*mr)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Qt-Xe*xr)+","+ar+"Z";else{Lt=Math.abs(kr-ar)+Ot;var Vn=Lt0?Math.sqrt(Ot*(2*Xe-Ot)):0,na=mr>0?Math.max:Math.min;Qe="M"+(Nt+Vn*xr)+","+ar+"V"+na(kr-(Xe-Ot)*mr,ar)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Nt+Xe*xr-ra)+","+kr+"H"+(Qt-Xe*xr+ra)+"A "+Xe+","+Xe+" 0 0 "+vr+" "+(Qt-Vn*xr)+","+na(kr-(Xe-Ot)*mr,ar)+"V"+ar+"Z"}}else Qe=Ct}else Qe=Ct;var Un=m(S.ensureSingle(nt,"path"),ue,V,ee);if(Un.style("vector-effect",te?"none":"non-scaling-stroke").attr("d",isNaN((Qt-Nt)*(kr-ar))||Er&&re._context.staticPlot?"M0,0Z":Qe).call(t.setClipUrl,fe.layerClipId,re),!ue.uniformtext.mode&&et){var ka=t.makePointStyleFns(de);t.singlePointStyle(ut,Un,de,ka,re)}y(re,fe,nt,ae,dt,Nt,Qt,ar,kr,Xe,Ot,V,ee),fe.layerClipId&&t.hideOutsideRangePoint(ut,nt.select("text"),ne,$,de.xcalendar,de.ycalendar)});var Ne=de.cliponaxis===!1;t.setClipUrl(ie,Ne?null:fe.layerClipId,re)});r.getComponentMethod("errorbars","plot")(re,H,fe,V)}function y(re,fe,le,ce,V,ee,ne,$,ue,te,H,ae,ie){var de=fe.xaxis,Se=fe.yaxis,Le=re._fullLayout,Fe;function ze(Lt,Ct,Ot){var Kt=S.ensureSingle(Lt,"text").text(Ct).attr({class:"bartext bartext-"+Fe,"text-anchor":"middle","data-notex":1}).call(t.font,Ot).call(E.convertToTspans,re);return Kt}var Ye=ce[0].trace,st=Ye.orientation==="h",ct=R(Le,ce,V,de,Se);Fe=U(Ye,V);var at=ae.mode==="stack"||ae.mode==="relative",et=ce[V],Pe=!at||et._outmost,Ae=et.hasB,pe=te&&te-H>g;if(!ct||Fe==="none"||(et.isBlank||ee===ne||$===ue)&&(Fe==="auto"||Fe==="inside")){le.select("text").remove();return}var Ne=Le.font,ut=s.getBarColor(ce[V],Ye),dt=s.getInsideTextFont(Ye,V,Ne,ut),nt=s.getOutsideTextFont(Ye,V,Ne),Ft=Ye.insidetextanchor||"end",Nt=le.datum();st?de.type==="log"&&Nt.s0<=0&&(de.range[0]0&&Mt>0,ke;pe?Ae?ke=I(kr-2*te,Er,Ur,Mt,st)||I(kr,Er-2*te,Ur,Mt,st):st?ke=I(kr-(te-H),Er,Ur,Mt,st)||I(kr,Er-2*(te-H),Ur,Mt,st):ke=I(kr,Er-(te-H),Ur,Mt,st)||I(kr-2*(te-H),Er,Ur,Mt,st):ke=I(kr,Er,Ur,Mt,st),Je&&ke?Fe="inside":(Fe="outside",$r.remove(),$r=null)}else Fe="inside";if(!$r){je=S.ensureUniformFontSize(re,Fe==="outside"?nt:dt),$r=ze(le,ct,je);var xe=$r.attr("transform");if($r.attr("transform",""),Sr=t.bBox($r.node()),Ur=Sr.width,Mt=Sr.height,$r.attr("transform",xe),Ur<=0||Mt<=0){$r.remove();return}}var ye=Ye.textangle,Ee,Xe;Fe==="outside"?(Xe=Ye.constraintext==="both"||Ye.constraintext==="outside",Ee=B(ee,ne,$,ue,Sr,{isHorizontal:st,constrained:Xe,angle:ye})):(Xe=Ye.constraintext==="both"||Ye.constraintext==="inside",Ee=F(ee,ne,$,ue,Sr,{isHorizontal:st,constrained:Xe,angle:ye,anchor:Ft,hasB:Ae,r:te,overhead:H})),Ee.fontSize=je.size,i(Ye.type==="histogram"?"bar":Ye.type,Ee,Le),et.transform=Ee;var Qe=m($r,Le,ae,ie);S.setTransormAndDisplay(Qe,Ee)}function I(re,fe,le,ce,V){if(re<0||fe<0)return!1;var ee=le<=re&&ce<=fe,ne=le<=fe&&ce<=re,$=V?re>=le*(fe/ce):fe>=ce*(re/le);return ee||ne||$}function L(re){return re==="auto"?0:re}function z(re,fe){var le=Math.PI/180*fe,ce=Math.abs(Math.sin(le)),V=Math.abs(Math.cos(le));return{x:re.width*V+re.height*ce,y:re.width*ce+re.height*V}}function F(re,fe,le,ce,V,ee){var ne=!!ee.isHorizontal,$=!!ee.constrained,ue=ee.angle||0,te=ee.anchor,H=te==="end",ae=te==="start",ie=ee.leftToRight||0,de=(ie+1)/2,Se=1-de,Le=ee.hasB,Fe=ee.r,ze=ee.overhead,Ye=V.width,st=V.height,ct=Math.abs(fe-re),at=Math.abs(ce-le),et=ct>2*g&&at>2*g?g:0;ct-=2*et,at-=2*et;var Pe=L(ue);ue==="auto"&&!(Ye<=ct&&st<=at)&&(Ye>ct||st>at)&&(!(Ye>at||st>ct)||Yeg){var ut=N(re,fe,le,ce,Ae,Fe,ze,ne,Le);pe=ut.scale,Ne=ut.pad}else pe=1,$&&(pe=Math.min(1,ct/Ae.x,at/Ae.y)),Ne=0;var dt=V.left*Se+V.right*de,nt=(V.top+V.bottom)/2,Ft=(re+g)*Se+(fe-g)*de,Nt=(le+ce)/2,Qt=0,ar=0;if(ae||H){var kr=(ne?Ae.x:Ae.y)/2;Fe&&(H||Le)&&(et+=Ne);var Er=ne?_(re,fe):_(le,ce);ne?ae?(Ft=re+Er*et,Qt=-Er*kr):(Ft=fe-Er*et,Qt=Er*kr):ae?(Nt=le+Er*et,ar=-Er*kr):(Nt=ce-Er*et,ar=Er*kr)}return{textX:dt,textY:nt,targetX:Ft,targetY:Nt,anchorX:Qt,anchorY:ar,scale:pe,rotate:Pe}}function N(re,fe,le,ce,V,ee,ne,$,ue){var te=Math.max(0,Math.abs(fe-re)-2*g),H=Math.max(0,Math.abs(ce-le)-2*g),ae=ee-g,ie=ne?ae-Math.sqrt(ae*ae-(ae-ne)*(ae-ne)):ae,de=ue?ae*2:$?ae-ne:2*ie,Se=ue?ae*2:$?2*ie:ae-ne,Le,Fe,ze,Ye,st;return V.y/V.x>=H/(te-de)?Ye=H/V.y:V.y/V.x<=(H-Se)/te?Ye=te/V.x:!ue&&$?(Le=V.x*V.x+V.y*V.y/4,Fe=-2*V.x*(te-ae)-V.y*(H/2-ae),ze=(te-ae)*(te-ae)+(H/2-ae)*(H/2-ae)-ae*ae,Ye=(-Fe+Math.sqrt(Fe*Fe-4*Le*ze))/(2*Le)):ue?(Le=(V.x*V.x+V.y*V.y)/4,Fe=-V.x*(te/2-ae)-V.y*(H/2-ae),ze=(te/2-ae)*(te/2-ae)+(H/2-ae)*(H/2-ae)-ae*ae,Ye=(-Fe+Math.sqrt(Fe*Fe-4*Le*ze))/(2*Le)):(Le=V.x*V.x/4+V.y*V.y,Fe=-V.x*(te/2-ae)-2*V.y*(H-ae),ze=(te/2-ae)*(te/2-ae)+(H-ae)*(H-ae)-ae*ae,Ye=(-Fe+Math.sqrt(Fe*Fe-4*Le*ze))/(2*Le)),Ye=Math.min(1,Ye),$?st=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(H-V.y*Ye)/2)*(ae-(H-V.y*Ye)/2)))-ne):st=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(te-V.x*Ye)/2)*(ae-(te-V.x*Ye)/2)))-ne),{scale:Ye,pad:st}}function B(re,fe,le,ce,V,ee){var ne=!!ee.isHorizontal,$=!!ee.constrained,ue=ee.angle||0,te=V.width,H=V.height,ae=Math.abs(fe-re),ie=Math.abs(ce-le),de;ne?de=ie>2*g?g:0:de=ae>2*g?g:0;var Se=1;$&&(Se=ne?Math.min(1,ie/H):Math.min(1,ae/te));var Le=L(ue),Fe=z(V,Le),ze=(ne?Fe.x:Fe.y)/2,Ye=(V.left+V.right)/2,st=(V.top+V.bottom)/2,ct=(re+fe)/2,at=(le+ce)/2,et=0,Pe=0,Ae=ne?_(fe,re):_(le,ce);return ne?(ct=fe-Ae*de,et=Ae*ze):(at=ce+Ae*de,Pe=-Ae*ze),{textX:Ye,textY:st,targetX:ct,targetY:at,anchorX:et,anchorY:Pe,scale:Se,rotate:Le}}function R(re,fe,le,ce,V){var ee=fe[0].trace,ne=ee.texttemplate,$;return ne?$=j(re,fe,le,ce,V):ee.textinfo?$=Z(fe,le,ce,V):$=f.getValue(ee.text,le),f.coerceString(v,$)}function U(re,fe){var le=f.getValue(re.textposition,fe);return f.coerceEnumerated(T,le)}function j(re,fe,le,ce,V){var ee=fe[0].trace,ne=S.castOption(ee,le,"texttemplate");if(!ne)return"";var $=ee.type==="histogram",ue=ee.type==="waterfall",te=ee.type==="funnel",H=ee.orientation==="h",ae,ie,de,Se;H?(ae="y",ie=V,de="x",Se=ce):(ae="x",ie=ce,de="y",Se=V);function Le(et){return o(ie,ie.c2l(et),!0).text}function Fe(et){return o(Se,Se.c2l(et),!0).text}var ze=fe[le],Ye={};Ye.label=ze.p,Ye.labelLabel=Ye[ae+"Label"]=Le(ze.p);var st=S.castOption(ee,ze.i,"text");(st===0||st)&&(Ye.text=st),Ye.value=ze.s,Ye.valueLabel=Ye[de+"Label"]=Fe(ze.s);var ct={};l(ct,ee,ze.i),($||ct.x===void 0)&&(ct.x=H?Ye.value:Ye.label),($||ct.y===void 0)&&(ct.y=H?Ye.label:Ye.value),($||ct.xLabel===void 0)&&(ct.xLabel=H?Ye.valueLabel:Ye.labelLabel),($||ct.yLabel===void 0)&&(ct.yLabel=H?Ye.labelLabel:Ye.valueLabel),ue&&(Ye.delta=+ze.rawS||ze.s,Ye.deltaLabel=Fe(Ye.delta),Ye.final=ze.v,Ye.finalLabel=Fe(Ye.final),Ye.initial=Ye.final-Ye.delta,Ye.initialLabel=Fe(Ye.initial)),te&&(Ye.value=ze.s,Ye.valueLabel=Fe(Ye.value),Ye.percentInitial=ze.begR,Ye.percentInitialLabel=S.formatPercent(ze.begR),Ye.percentPrevious=ze.difR,Ye.percentPreviousLabel=S.formatPercent(ze.difR),Ye.percentTotal=ze.sumR,Ye.percenTotalLabel=S.formatPercent(ze.sumR));var at=S.castOption(ee,ze.i,"customdata");return at&&(Ye.customdata=at),S.texttemplateString({data:[ct,Ye,ee._meta],fallback:ee.texttemplatefallback,labels:Ye,locale:re._d3locale,template:ne})}function Z(re,fe,le,ce){var V=re[0].trace,ee=V.orientation==="h",ne=V.type==="waterfall",$=V.type==="funnel";function ue(at){var et=ee?ce:le;return o(et,at,!0).text}function te(at){var et=ee?le:ce;return o(et,+at,!0).text}var H=V.textinfo,ae=re[fe],ie=H.split("+"),de=[],Se,Le=function(at){return ie.indexOf(at)!==-1};if(Le("label")&&de.push(ue(re[fe].p)),Le("text")&&(Se=S.castOption(V,ae.i,"text"),(Se===0||Se)&&de.push(Se)),ne){var Fe=+ae.rawS||ae.s,ze=ae.v,Ye=ze-Fe;Le("initial")&&de.push(te(Ye)),Le("delta")&&de.push(te(Fe)),Le("final")&&de.push(te(ze))}if($){Le("value")&&de.push(te(ae.s));var st=0;Le("percent initial")&&st++,Le("percent previous")&&st++,Le("percent total")&&st++;var ct=st>1;Le("percent initial")&&(Se=S.formatPercent(ae.begR),ct&&(Se+=" of initial"),de.push(Se)),Le("percent previous")&&(Se=S.formatPercent(ae.difR),ct&&(Se+=" of previous"),de.push(Se)),Le("percent total")&&(Se=S.formatPercent(ae.sumR),ct&&(Se+=" of total"),de.push(Se))}return de.join("
")}G.exports={plot:d,toMoveInsideBar:F}}}),Lc=Ge({"src/traces/bar/hover.js"(K,G){var h=Yf(),b=Ro(),S=go(),E=_n().fillText,e=py().getLineWidth,t=Ts().hoverLabelText,r=Ii().BADNUM;function o(a,s,f,c,p){var v=n(a,s,f,c,p);if(v){var T=v.cd,l=T[0].trace,g=T[v.index];return v.color=i(l,g),b.getComponentMethod("errorbars","hoverInfo")(g,l,v),[v]}}function n(a,s,f,c,p){var v=a.cd,T=v[0].trace,l=v[0].t,g=c==="closest",x=T.type==="waterfall",A=a.maxHoverDistance,M=a.maxSpikeDistance,_,w,m,u,d,y,I;T.orientation==="h"?(_=f,w=s,m="y",u="x",d=ce,y=re):(_=s,w=f,m="x",u="y",y=ce,d=re);var L=T[m+"period"],z=g||L;function F(Se){return B(Se,-1)}function N(Se){return B(Se,1)}function B(Se,Le){var Fe=Se.w;return Se[m]+Le*Fe/2}function R(Se){return Se[m+"End"]-Se[m+"Start"]}var U=g?F:L?function(Se){return Se.p-R(Se)/2}:function(Se){return Math.min(F(Se),Se.p-l.bardelta/2)},j=g?N:L?function(Se){return Se.p+R(Se)/2}:function(Se){return Math.max(N(Se),Se.p+l.bardelta/2)};function Z(Se,Le,Fe){return p.finiteRange&&(Fe=0),h.inbox(Se-_,Le-_,Fe+Math.min(1,Math.abs(Le-Se)/I)-1)}function re(Se){return Z(U(Se),j(Se),A)}function fe(Se){return Z(F(Se),N(Se),M)}function le(Se){var Le=Se[u];if(x){var Fe=Math.abs(Se.rawS)||0;w>0?Le+=Fe:w<0&&(Le-=Fe)}return Le}function ce(Se){var Le=w,Fe=Se.b,ze=le(Se);return h.inbox(Fe-Le,ze-Le,A+(ze-Le)/(ze-Fe)-1)}function V(Se){var Le=w,Fe=Se.b,ze=le(Se);return h.inbox(Fe-Le,ze-Le,M+(ze-Le)/(ze-Fe)-1)}var ee=a[m+"a"],ne=a[u+"a"];I=Math.abs(ee.r2c(ee.range[1])-ee.r2c(ee.range[0]));function $(Se){return(d(Se)+y(Se))/2}var ue=h.getDistanceFunction(c,d,y,$);if(h.getClosest(v,ue,a),a.index!==!1&&v[a.index].p!==r){z||(U=function(Se){return Math.min(F(Se),Se.p-l.bargroupwidth/2)},j=function(Se){return Math.max(N(Se),Se.p+l.bargroupwidth/2)});var te=a.index,H=v[te],ae=T.base?H.b+H.s:H.s;a[u+"0"]=a[u+"1"]=ne.c2p(H[u],!0),a[u+"LabelVal"]=ae;var ie=l.extents[l.extents.round(H.p)];a[m+"0"]=ee.c2p(g?U(H):ie[0],!0),a[m+"1"]=ee.c2p(g?j(H):ie[1],!0);var de=H.orig_p!==void 0;return a[m+"LabelVal"]=de?H.orig_p:H.p,a.labelLabel=t(ee,a[m+"LabelVal"],T[m+"hoverformat"]),a.valueLabel=t(ne,a[u+"LabelVal"],T[u+"hoverformat"]),a.baseLabel=t(ne,H.b,T[u+"hoverformat"]),a.spikeDistance=(V(H)+fe(H))/2,a[m+"Spike"]=ee.c2p(H.p,!0),E(H,T,a),a.hovertemplate=T.hovertemplate,a}}function i(a,s){var f=s.mcc||a.marker.color,c=s.mlcc||a.marker.line.color,p=e(a,s);if(S.opacity(f))return f;if(S.opacity(c)&&p)return c}G.exports={hoverPoints:o,hoverOnBars:n,getTraceColor:i}}}),sd=Ge({"src/traces/bar/event_data.js"(K,G){G.exports=function(b,S,E){return b.x="xVal"in S?S.xVal:S.x,b.y="yVal"in S?S.yVal:S.y,S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),E.orientation==="h"?(b.label=b.y,b.value=b.x):(b.label=b.x,b.value=b.y),b}}}),Tm=Ge({"src/traces/bar/select.js"(K,G){G.exports=function(S,E){var e=S.cd,t=S.xaxis,r=S.yaxis,o=e[0].trace,n=o.type==="funnel",i=o.orientation==="h",a=[],s;if(E===!1)for(s=0;s0?(L="v",m>0?z=Math.min(d,u):z=Math.min(u)):m>0?(L="h",z=Math.min(d)):z=0;if(!z){f.visible=!1;return}f._length=z;var U=c("orientation",L);f._hasPreCompStats?U==="v"&&m===0?(c("x0",0),c("dx",1)):U==="h"&&w===0&&(c("y0",0),c("dy",1)):U==="v"&&m===0?c("x0"):U==="h"&&w===0&&c("y0");var j=b.getComponentMethod("calendars","handleTraceDefaults");j(s,f,["x","y"],p)}function i(s,f,c,p){var v=p.prefix,T=h.coerce2(s,f,r,"marker.outliercolor"),l=c("marker.line.outliercolor"),g="outliers";f._hasPreCompStats?g="all":(T||l)&&(g="suspectedoutliers");var x=c(v+"points",g);x?(c("jitter",x==="all"?.3:0),c("pointpos",x==="all"?-1.5:0),c("marker.symbol"),c("marker.opacity"),c("marker.size"),c("marker.angle"),c("marker.color",f.line.color),c("marker.line.color"),c("marker.line.width"),x==="suspectedoutliers"&&(c("marker.line.outliercolor",f.marker.color),c("marker.line.outlierwidth")),c("selected.marker.color"),c("unselected.marker.color"),c("selected.marker.size"),c("unselected.marker.size"),c("text"),c("hovertext")):delete f.marker;var A=c("hoveron");(A==="all"||A.indexOf("points")!==-1)&&(c("hovertemplate"),c("hovertemplatefallback")),h.coerceSelectionMarkerOpacity(f,c)}function a(s,f){var c,p;function v(x){return h.coerce(p._input,p,r,x)}for(var T=0;Tle.uf};if(M._hasPreCompStats){var te=M[z],H=function(Er){return L.d2c((M[Er]||[])[y])},ae=1/0,ie=-1/0;for(y=0;y=le.q1&&le.q3>=le.med){var Se=H("lowerfence");le.lf=Se!==e&&Se<=le.q1?Se:p(le,V,ee);var Le=H("upperfence");le.uf=Le!==e&&Le>=le.q3?Le:v(le,V,ee);var Fe=H("mean");le.mean=Fe!==e?Fe:ee?E.mean(V,ee):(le.q1+le.q3)/2;var ze=H("sd");le.sd=Fe!==e&&ze>=0?ze:ee?E.stdev(V,ee,le.mean):le.q3-le.q1,le.lo=T(le),le.uo=l(le);var Ye=H("notchspan");Ye=Ye!==e&&Ye>0?Ye:g(le,ee),le.ln=le.med-Ye,le.un=le.med+Ye;var st=le.lf,ct=le.uf;M.boxpoints&&V.length&&(st=Math.min(st,V[0]),ct=Math.max(ct,V[ee-1])),M.notched&&(st=Math.min(st,le.ln),ct=Math.max(ct,le.un)),le.min=st,le.max=ct}else{E.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+le.q1,"median = "+le.med,"q3 = "+le.q3].join(` +`));var at;le.med!==e?at=le.med:le.q1!==e?le.q3!==e?at=(le.q1+le.q3)/2:at=le.q1:le.q3!==e?at=le.q3:at=0,le.med=at,le.q1=le.q3=at,le.lf=le.uf=at,le.mean=le.sd=at,le.ln=le.un=at,le.min=le.max=at}ae=Math.min(ae,le.min),ie=Math.max(ie,le.max),le.pts2=ce.filter(ue),u.push(le)}}M._extremes[L._id]=b.findExtremes(L,[ae,ie],{padded:!0})}else{var et=L.makeCalcdata(M,z),Pe=o(re,fe),Ae=re.length,pe=n(Ae);for(y=0;y=0&&Ne0){if(le={},le.pos=le[N]=re[y],ce=le.pts=pe[y].sort(f),V=le[z]=ce.map(c),ee=V.length,le.min=V[0],le.max=V[ee-1],le.mean=E.mean(V,ee),le.sd=E.stdev(V,ee,le.mean)*M.sdmultiple,le.med=E.interp(V,.5),ee%2&&(Ft||Nt)){var Qt,ar;Ft?(Qt=V.slice(0,ee/2),ar=V.slice(ee/2+1)):Nt&&(Qt=V.slice(0,ee/2+1),ar=V.slice(ee/2)),le.q1=E.interp(Qt,.5),le.q3=E.interp(ar,.5)}else le.q1=E.interp(V,.25),le.q3=E.interp(V,.75);le.lf=p(le,V,ee),le.uf=v(le,V,ee),le.lo=T(le),le.uo=l(le);var kr=g(le,ee);le.ln=le.med-kr,le.un=le.med+kr,ut=Math.min(ut,le.ln),dt=Math.max(dt,le.un),le.pts2=ce.filter(ue),u.push(le)}M.notched&&E.isTypedArray(et)&&(et=Array.from(et)),M._extremes[L._id]=b.findExtremes(L,M.notched?et.concat([ut,dt]):et,{padded:!0})}return s(u,M),u.length>0?(u[0].t={num:_[d],dPos:fe,posLetter:N,valLetter:z,labels:{med:t(A,"median:"),min:t(A,"min:"),q1:t(A,"q1:"),q3:t(A,"q3:"),max:t(A,"max:"),mean:M.boxmean==="sd"||M.sizemode==="sd"?t(A,"mean ± σ:").replace("σ",M.sdmultiple===1?"σ":M.sdmultiple+"σ"):t(A,"mean:"),lf:t(A,"lower fence:"),uf:t(A,"upper fence:")}},_[d]++,u):[{t:{empty:!0}}]};function r(x,A,M,_){var w=A in x,m=A+"0"in x,u="d"+A in x;if(w||m&&u){var d=M.makeCalcdata(x,A),y=S(x,M,A,d).vals;return[y,d]}var I;m?I=x[A+"0"]:"name"in x&&(M.type==="category"||h(x.name)&&["linear","log"].indexOf(M.type)!==-1||E.isDateTime(x.name)&&M.type==="date")?I=x.name:I=_;for(var L=M.type==="multicategory"?M.r2c_just_indices(I):M.d2c(I,0,x[A+"calendar"]),z=x._length,F=new Array(z),N=0;N1,m=1-s[r+"gap"],u=1-s[r+"groupgap"];for(p=0;p0;if(L==="positive"?(le=z*(I?1:.5),ee=V,ce=ee=N):L==="negative"?(le=ee=N,ce=z*(I?1:.5),ne=V):(le=ce=z,ee=ne=V),ie){var de=d.pointpos,Se=d.jitter,Le=d.marker.size/2,Fe=0;de+Se>=0&&(Fe=V*(de+Se),Fe>le?(ae=!0,te=Le,$=Fe):Fe>ee&&(te=Le,$=le)),Fe<=le&&($=le);var ze=0;de-Se<=0&&(ze=-V*(de-Se),ze>ce?(ae=!0,H=Le,ue=ze):ze>ne&&(H=Le,ue=ce)),ze<=ce&&(ue=ce)}else $=le,ue=ce;var Ye=new Array(T.length);for(v=0;vM.lo&&(U.so=!0)}return w});A.enter().append("path").classed("point",!0),A.exit().remove(),A.call(S.translatePoints,c,p)}function n(i,a,s,f){var c=a.val,p=a.pos,v=!!p.rangebreaks,T=f.bPos,l=f.bPosPxOffset||0,g=s.boxmean||(s.meanline||{}).visible,x,A;Array.isArray(f.bdPos)?(x=f.bdPos[0],A=f.bdPos[1]):(x=f.bdPos,A=f.bdPos);var M=i.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?b.identity:[]);M.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),M.exit().remove(),M.each(function(_){var w=p.c2l(_.pos+T,!0),m=p.l2p(w-x)+l,u=p.l2p(w+A)+l,d=v?(m+u)/2:p.l2p(w)+l,y=c.c2p(_.mean,!0),I=c.c2p(_.mean-_.sd,!0),L=c.c2p(_.mean+_.sd,!0);s.orientation==="h"?h.select(this).attr("d","M"+y+","+m+"V"+u+(g==="sd"?"m0,0L"+I+","+d+"L"+y+","+m+"L"+L+","+d+"Z":"")):h.select(this).attr("d","M"+m+","+y+"H"+u+(g==="sd"?"m0,0L"+d+","+I+"L"+m+","+y+"L"+d+","+L+"Z":""))})}G.exports={plot:t,plotBoxAndWhiskers:r,plotPoints:o,plotBoxMean:n}}}),Ix=Ge({"src/traces/box/style.js"(K,G){var h=ki(),b=go(),S=As();function E(t,r,o){var n=o||h.select(t).selectAll("g.trace.boxes");n.style("opacity",function(i){return i[0].trace.opacity}),n.each(function(i){var a=h.select(this),s=i[0].trace,f=s.line.width;function c(T,l,g,x){T.style("stroke-width",l+"px").call(b.stroke,g).call(b.fill,x)}var p=a.selectAll("path.box");if(s.type==="candlestick")p.each(function(T){if(!T.empty){var l=h.select(this),g=s[T.dir];c(l,g.line.width,g.line.color,g.fillcolor),l.style("opacity",s.selectedpoints&&!T.selected?.3:1)}});else{c(p,f,s.line.color,s.fillcolor),a.selectAll("path.mean").style({"stroke-width":f,"stroke-dasharray":2*f+"px,"+f+"px"}).call(b.stroke,s.line.color);var v=a.selectAll("path.point");S.pointStyle(v,s,t)}})}function e(t,r,o){var n=r[0].trace,i=o.selectAll("path.point");n.selectedpoints?S.selectedPointStyle(i,n):S.pointStyle(i,n,t)}G.exports={style:E,styleOnSelect:e}}}),E2=Ge({"src/traces/box/hover.js"(K,G){var h=Ts(),b=_n(),S=Yf(),E=go(),e=b.fillText;function t(n,i,a,s){var f=n.cd,c=f[0].trace,p=c.hoveron,v=[],T;return p.indexOf("boxes")!==-1&&(v=v.concat(r(n,i,a,s))),p.indexOf("points")!==-1&&(T=o(n,i,a)),s==="closest"?T?[T]:v:(T&&v.push(T),v)}function r(n,i,a,s){var f=n.cd,c=n.xa,p=n.ya,v=f[0].trace,T=f[0].t,l=v.type==="violin",g,x,A,M,_,w,m,u,d,y,I,L=T.bdPos,z,F,N=T.wHover,B=function(ze){return A.c2l(ze.pos)+T.bPos-A.c2l(w)};l&&v.side!=="both"?(v.side==="positive"&&(d=function(ze){var Ye=B(ze);return S.inbox(Ye,Ye+N,y)},z=L,F=0),v.side==="negative"&&(d=function(ze){var Ye=B(ze);return S.inbox(Ye-N,Ye,y)},z=0,F=L)):(d=function(ze){var Ye=B(ze);return S.inbox(Ye-N,Ye+N,y)},z=F=L);var R;l?R=function(ze){return S.inbox(ze.span[0]-_,ze.span[1]-_,y)}:R=function(ze){return S.inbox(ze.min-_,ze.max-_,y)},v.orientation==="h"?(_=i,w=a,m=R,u=d,g="y",A=p,x="x",M=c):(_=a,w=i,m=d,u=R,g="x",A=c,x="y",M=p);var U=Math.min(1,L/Math.abs(A.r2c(A.range[1])-A.r2c(A.range[0])));y=n.maxHoverDistance-U,I=n.maxSpikeDistance-U;function j(ze){return(m(ze)+u(ze))/2}var Z=S.getDistanceFunction(s,m,u,j);if(S.getClosest(f,Z,n),n.index===!1)return[];var re=f[n.index],fe=v.line.color,le=(v.marker||{}).color;E.opacity(fe)&&v.line.width?n.color=fe:E.opacity(le)&&v.boxpoints?n.color=le:n.color=v.fillcolor,n[g+"0"]=A.c2p(re.pos+T.bPos-F,!0),n[g+"1"]=A.c2p(re.pos+T.bPos+z,!0),n[g+"LabelVal"]=re.orig_p!==void 0?re.orig_p:re.pos;var ce=g+"Spike";n.spikeDistance=j(re)*I/y,n[ce]=A.c2p(re.pos,!0);var V=v.boxmean||v.sizemode==="sd"||(v.meanline||{}).visible,ee=v.boxpoints||v.points,ne=ee&&V?["max","uf","q3","med","mean","q1","lf","min"]:ee&&!V?["max","uf","q3","med","q1","lf","min"]:!ee&&V?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],$=M.range[1]0&&(o=!0);for(var s=0;st){var r=t-E[b];return E[b]=t,r}}else return E[b]=t,t;return 0},max:function(b,S,E,e){var t=e[S];if(h(t))if(t=Number(t),h(E[b])){if(E[b]m&&mE){var y=u===b?1:6,I=u===b?"M12":"M1";return function(L,z){var F=T.c2d(L,b,l),N=F.indexOf("-",y);N>0&&(F=F.slice(0,N));var B=T.d2c(F,0,l);if(Br?f>E?f>b*1.1?b:f>S*1.1?S:E:f>e?e:f>t?t:r:Math.pow(10,Math.floor(Math.log(f)/Math.LN10))}function a(f,c,p,v,T,l){if(v&&f>E){var g=s(c,T,l),x=s(p,T,l),A=f===b?0:1;return g[A]!==x[A]}return Math.floor(p/f)-Math.floor(c/f)>.1}function s(f,c,p){var v=c.c2d(f,b,p).split("-");return v[0]===""&&(v.unshift(),v[0]="-"+v[0]),v}}}),Bx=Ge({"src/traces/histogram/calc.js"(K,G){var h=Ei(),b=_n(),S=Ro(),E=Ts(),{hasColorscale:e}=gd(),t=_d(),r=Zp(),o=Ox(),n=v0(),i=G1(),a=Fx();function s(T,l){var g=[],x=[],A=l.orientation==="h",M=E.getFromId(T,A?l.yaxis:l.xaxis),_=A?"y":"x",w={x:"y",y:"x"}[_],m=l[_+"calendar"],u=l.cumulative,d,y=f(T,l,M,_),I=y[0],L=y[1],z=typeof I.size=="string",F=[],N=z?F:I,B=[],R=[],U=[],j=0,Z=l.histnorm,re=l.histfunc,fe=Z.indexOf("density")!==-1,le,ce,V;u.enabled&&fe&&(Z=Z.replace(/ ?density$/,""),fe=!1);var ee=re==="max"||re==="min",ne=ee?null:0,$=o.count,ue=n[Z],te=!1,H=function(Ne){return M.r2c(Ne,0,m)},ae;for(b.isArrayOrTypedArray(l[w])&&re!=="count"&&(ae=l[w],te=re==="avg",$=o[re]),d=H(I.start),ce=H(I.end)+(d-E.tickIncrement(d,I.size,!1,m))/1e6;d=0&&V=Pe;d--)if(x[d]){Ae=d;break}for(d=Pe;d<=Ae;d++)if(h(g[d])&&h(x[d])){var pe={p:g[d],s:x[d],b:0};u.enabled||(pe.pts=U[d],Le?pe.ph0=pe.ph1=U[d].length?L[U[d][0]]:g[d]:(l._computePh=!0,pe.ph0=ct(F[d]),pe.ph1=ct(F[d+1],!0))),et.push(pe)}return et.length===1&&(et[0].width1=E.tickIncrement(et[0].p,I.size,!1,m)-et[0].p),e(l,"marker")&&t(T,l,{vals:l.marker.color,containerStr:"marker",cLetter:"c"}),e(l,"marker.line")&&t(T,l,{vals:l.marker.line.color,containerStr:"marker.line",cLetter:"c"}),r(et,l),b.isArrayOrTypedArray(l.selectedpoints)&&b.tagSelected(et,l,Ye),et}function f(T,l,g,x,A){var M=x+"bins",_=T._fullLayout,w=l["_"+x+"bingroup"],m=_._histogramBinOpts[w],u=_.barmode==="overlay",d,y,I,L,z,F,N,B=function(st){return g.r2c(st,0,L)},R=function(st){return g.c2r(st,0,L)},U=g.type==="date"?function(st){return st||st===0?b.cleanDate(st,null,L):null}:function(st){return h(st)?Number(st):null};function j(st,ct,at){ct[st+"Found"]?(ct[st]=U(ct[st]),ct[st]===null&&(ct[st]=at[st])):(F[st]=ct[st]=at[st],b.nestedProperty(y[0],M+"."+st).set(at[st]))}if(l["_"+x+"autoBinFinished"])delete l["_"+x+"autoBinFinished"];else{y=m.traces;var Z=[],re=!0,fe=!1,le=!1;for(d=0;d"u"){if(A)return[V,z,!0];V=c(T,l,g,x,M)}N=I.cumulative||{},N.enabled&&N.currentbin!=="include"&&(N.direction==="decreasing"?V.start=R(E.tickIncrement(B(V.start),V.size,!0,L)):V.end=R(E.tickIncrement(B(V.end),V.size,!1,L))),m.size=V.size,m.sizeFound||(F.size=V.size,b.nestedProperty(y[0],M+".size").set(V.size)),j("start",m,V),j("end",m,V)}z=l["_"+x+"pos0"],delete l["_"+x+"pos0"];var ne=l._input[M]||{},$=b.extendFlat({},m),ue=m.start,te=g.r2l(ne.start),H=te!==void 0;if((m.startFound||H)&&te!==g.r2l(ue)){var ae=H?te:b.aggNums(Math.min,null,z),ie={type:g.type==="category"||g.type==="multicategory"?"linear":g.type,r2l:g.r2l,dtick:m.size,tick0:ue,calendar:L,range:[ae,E.tickIncrement(ae,m.size,!1,L)].map(g.l2r)},de=E.tickFirst(ie);de>g.r2l(ae)&&(de=E.tickIncrement(de,m.size,!0,L)),$.start=g.l2r(de),H||b.nestedProperty(l,M+".start").set($.start)}var Se=m.end,Le=g.r2l(ne.end),Fe=Le!==void 0;if((m.endFound||Fe)&&Le!==g.r2l(Se)){var ze=Fe?Le:b.aggNums(Math.max,null,z);$.end=g.l2r(ze),Fe||b.nestedProperty(l,M+".start").set($.end)}var Ye="autobin"+x;return l._input[Ye]===!1&&(l._input[M]=b.extendFlat({},l[M]||{}),delete l._input[Ye],delete l[Ye]),[$,z]}function c(T,l,g,x,A){var M=T._fullLayout,_=p(T,l),w=!1,m=1/0,u=[l],d,y,I;for(d=0;d<_.length;d++)if(y=_[d],y===l)w=!0;else if(!w)I=M._histogramBinOpts[y["_"+x+"bingroup"]],m=Math.min(m,I.size||y[A].size);else{var L=f(T,y,g,x,!0),z=L[0],F=L[2];y["_"+x+"autoBinFinished"]=1,y["_"+x+"pos0"]=L[1],F?u.push(y):m=Math.min(m,z.size)}var N=new Array(u.length);for(d=0;d=0;x--)w(x);else if(l==="increasing"){for(x=1;x=0;x--)T[x]+=T[x+1];g==="exclude"&&(T.push(0),T.shift())}}G.exports={calc:s,calcAllAutoBins:f}}}),C5=Ge({"src/traces/histogram2d/calc.js"(K,G){var h=_n(),b=Ts(),S=Ox(),E=v0(),e=G1(),t=Fx(),r=Bx().calcAllAutoBins;G.exports=function(s,f){var c=b.getFromId(s,f.xaxis),p=b.getFromId(s,f.yaxis),v=f.xcalendar,T=f.ycalendar,l=function(je){return c.r2c(je,0,v)},g=function(je){return p.r2c(je,0,T)},x=function(je){return c.c2r(je,0,v)},A=function(je){return p.c2r(je,0,T)},M,_,w,m,u=r(s,f,c,"x"),d=u[0],y=u[1],I=r(s,f,p,"y"),L=I[0],z=I[1],F=f._length;y.length>F&&y.splice(F,y.length-F),z.length>F&&z.splice(F,z.length-F);var N=[],B=[],R=[],U=typeof d.size=="string",j=typeof L.size=="string",Z=[],re=[],fe=U?Z:d,le=j?re:L,ce=0,V=[],ee=[],ne=f.histnorm,$=f.histfunc,ue=ne.indexOf("density")!==-1,te=$==="max"||$==="min",H=te?null:0,ae=S.count,ie=E[ne],de=!1,Se=[],Le=[],Fe="z"in f?f.z:"marker"in f&&Array.isArray(f.marker.color)?f.marker.color:"";Fe&&$!=="count"&&(de=$==="avg",ae=S[$]);var ze=d.size,Ye=l(d.start),st=l(d.end)+(Ye-b.tickIncrement(Ye,ze,!1,v))/1e6;for(M=Ye;M=0&&w=0&&mb;i++)n=e(r,o,E(n));return n>b&&h.log("interp2d didn't converge quickly",n),r};function e(t,r,o){var n=0,i,a,s,f,c,p,v,T,l,g,x,A,M;for(f=0;fA&&(n=Math.max(n,Math.abs(t[a][s]-x)/(M-A))))}return n}}}),qx=Ge({"src/traces/heatmap/find_empties.js"(K,G){var h=_n().maxRowLength;G.exports=function(S){var E=[],e={},t=[],r=S[0],o=[],n=[0,0,0],i=h(S),a,s,f,c,p,v,T,l;for(s=0;s=0;p--)c=t[p],s=c[0],f=c[1],v=((e[[s-1,f]]||n)[2]+(e[[s+1,f]]||n)[2]+(e[[s,f-1]]||n)[2]+(e[[s,f+1]]||n)[2])/20,v&&(T[c]=[s,f,v],t.splice(p,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(c in T)e[c]=T[c],E.push(T[c])}return E.sort(function(g,x){return x[2]-g[2]})}}}),L2=Ge({"src/traces/heatmap/make_bound_array.js"(K,G){var h=Ro(),b=_n().isArrayOrTypedArray;G.exports=function(E,e,t,r,o,n){var i=[],a=h.traceIs(E,"contour"),s=h.traceIs(E,"histogram"),f,c,p,v=b(e)&&e.length>1;if(v&&!s&&n.type!=="category"){var T=e.length;if(T<=o){if(a)i=Array.from(e).slice(0,o);else if(o===1)n.type==="log"?i=[.5*e[0],2*e[0]]:i=[e[0]-.5,e[0]+.5];else if(n.type==="log"){for(i=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],p=1;p1){var ne=(ee[ee.length-1]-ee[0])/(ee.length-1),$=Math.abs(ne/100);for(F=0;F$)return!1}return!0}T._islinear=!1,l.type==="log"||g.type==="log"?M==="fast"&&R("log axis found"):U(_)?U(d)?T._islinear=!0:M==="fast"&&R("y scale is not linear"):M==="fast"&&R("x scale is not linear");var j=b.maxRowLength(z),Z=T.xtype==="scaled"?"":_,re=a(T,Z,w,m,j,l),fe=T.ytype==="scaled"?"":d,le=a(T,fe,y,I,z.length,g);T._extremes[l._id]=S.findExtremes(l,re),T._extremes[g._id]=S.findExtremes(g,le);var ce={x:re,y:le,z,text:T._text||T.text,hovertext:T._hovertext||T.hovertext};if(T.xperiodalignment&&u&&(ce.orig_x=u),T.yperiodalignment&&L&&(ce.orig_y=L),Z&&Z.length===re.length-1&&(ce.xCenter=Z),fe&&fe.length===le.length-1&&(ce.yCenter=fe),A&&(ce.xRanges=N.xRanges,ce.yRanges=N.yRanges,ce.pts=N.pts),x||t(v,T,{vals:z,cLetter:"z"}),x&&T.contours&&T.contours.coloring==="heatmap"){var V={type:T.type==="contour"?"heatmap":"histogram2d",xcalendar:T.xcalendar,ycalendar:T.ycalendar};ce.xfill=a(V,Z,w,m,j,l),ce.yfill=a(V,fe,y,I,z.length,g)}return[ce]};function f(p){for(var v=[],T=p.length,l=0;l0;)ue=d.c2p(U[ie]),ie--;for(ue<$&&(te=ue,ue=$,$=te,ee=!0),ie=0;H===void 0&&ie0;)ae=y.c2p(j[ie]),ie--;ae=d._length||ue<=0||H>=y._length||ae<=0;if(st){var ct=L.selectAll("image").data([]);ct.exit().remove(),g(L);return}var at,et;Le==="fast"?(at=V,et=ce):(at=ze,et=Ye);var Pe=document.createElement("canvas");Pe.width=at,Pe.height=et;var Ae=Pe.getContext("2d",{willReadFrequently:!0}),pe=a(F,{noNumericCheck:!0,returnArray:!0}),Ne,ut;Le==="fast"?(Ne=ee?function(In){return V-1-In}:t.identity,ut=ne?function(In){return ce-1-In}:t.identity):(Ne=function(In){return t.constrain(Math.round(d.c2p(U[In])-$),0,ze)},ut=function(In){return t.constrain(Math.round(y.c2p(j[In])-H),0,Ye)});var dt=ut(0),nt=[dt,dt],Ft=ee?0:1,Nt=ne?0:1,Qt=0,ar=0,kr=0,Er=0,$r,Sr,Ur,Mt,je;function Je(In,gi){if(In!==void 0){var Ea=pe(In);return Ea[0]=Math.round(Ea[0]),Ea[1]=Math.round(Ea[1]),Ea[2]=Math.round(Ea[2]),Qt+=gi,ar+=Ea[0]*gi,kr+=Ea[1]*gi,Er+=Ea[2]*gi,Ea}return[0,0,0,0]}function ke(In,gi,Ea,Ci){var Xi=In[Ea.bin0];if(Xi===void 0)return Je(void 0,1);var so=In[Ea.bin1],io=gi[Ea.bin0],Mo=gi[Ea.bin1],ui=so-Xi||0,ts=io-Xi||0,Ho;return so===void 0?Mo===void 0?Ho=0:io===void 0?Ho=2*(Mo-Xi):Ho=(2*Mo-io-Xi)*2/3:Mo===void 0?io===void 0?Ho=0:Ho=(2*Xi-so-io)*2/3:io===void 0?Ho=(2*Mo-so-Xi)*2/3:Ho=Mo+Xi-so-io,Je(Xi+Ea.frac*ui+Ci.frac*(ts+Ea.frac*Ho))}if(Le!=="default"){var xe=0,ye;try{ye=new Uint8Array(at*et*4)}catch{ye=new Array(at*et*4)}if(Le==="smooth"){var Ee=Z||U,Xe=re||j,Qe=new Array(Ee.length),Lt=new Array(Xe.length),Ct=new Array(ze),Ot=Z?A:x,Kt=re?A:x,xr,mr,vr;for(ie=0;iepa||pa>y._length))for(de=ln;de_a||_a>d._length)){var Ca=o({x:ha,y:Qn},F,_._fullLayout);Ca.x=ha,Ca.y=Qn;var Hn=z.z[ie][de];Hn===void 0?(Ca.z="",Ca.zLabel=""):(Ca.z=Hn,Ca.zLabel=e.tickText(sr,Hn,"hover").text);var pi=z.text&&z.text[ie]&&z.text[ie][de];(pi===void 0||pi===!1)&&(pi=""),Ca.text=pi;var Si=t.texttemplateString({data:[Ca,F._meta],fallback:F.texttemplatefallback,labels:Ca,locale:_._fullLayout._d3locale,template:ka});if(Si){var Dt=Si.split("
"),xt=Dt.length,Cr=0;for(Se=0;Se=g[0].length||I<0||I>g.length)return}else{if(h.inbox(o-T[0],o-T[T.length-1],0)>0||h.inbox(n-l[0],n-l[l.length-1],0)>0)return;if(s){var L;for(w=[2*T[0]-T[1]],L=1;L=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),Z1=Ge({"src/traces/contour/attributes.js"(K,G){var h=bd(),b=Gc(),S=mc(),E=S.axisHoverFormat,e=S.descriptionOnlyNumbers,t=zu(),r=md().dash,o=Us(),n=Ji().extendFlat,i=Jx(),a=i.COMPARISON_OPS2,s=i.INTERVAL_OPS,f=b.line;G.exports=n({z:h.z,x:h.x,x0:h.x0,dx:h.dx,y:h.y,y0:h.y0,dy:h.dy,xperiod:h.xperiod,yperiod:h.yperiod,xperiod0:b.xperiod0,yperiod0:b.yperiod0,xperiodalignment:h.xperiodalignment,yperiodalignment:h.yperiodalignment,text:h.text,hovertext:h.hovertext,transpose:h.transpose,xtype:h.xtype,ytype:h.ytype,xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:h.hovertemplate,hovertemplatefallback:h.hovertemplatefallback,texttemplate:n({},h.texttemplate,{}),texttemplatefallback:h.texttemplatefallback,textfont:n({},h.textfont,{}),hoverongaps:h.hoverongaps,connectgaps:n({},h.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:o({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:e("contour label")},operation:{valType:"enumerated",values:[].concat(a).concat(s),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n({},f.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:n({},f.smoothing,{}),editType:"plot"},zorder:b.zorder},t("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),Qx=Ge({"src/traces/histogram2dcontour/attributes.js"(K,G){var h=$x(),b=Z1(),S=zu(),E=mc().axisHoverFormat,e=Ji().extendFlat;G.exports=e({x:h.x,y:h.y,z:h.z,marker:h.marker,histnorm:h.histnorm,histfunc:h.histfunc,nbinsx:h.nbinsx,xbins:h.xbins,nbinsy:h.nbinsy,ybins:h.ybins,autobinx:h.autobinx,autobiny:h.autobiny,bingroup:h.bingroup,xbingroup:h.xbingroup,ybingroup:h.ybingroup,autocontour:b.autocontour,ncontours:b.ncontours,contours:b.contours,line:{color:b.line.color,width:e({},b.line.width,{dflt:.5}),dash:b.line.dash,smoothing:b.line.smoothing,editType:"plot"},xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:h.hovertemplate,hovertemplatefallback:h.hovertemplatefallback,texttemplate:b.texttemplate,texttemplatefallback:b.texttemplatefallback,textfont:b.textfont},S("",{cLetter:"z",editTypeOverride:"calc"}))}}),eb=Ge({"src/traces/contour/contours_defaults.js"(K,G){G.exports=function(b,S,E,e){var t=e("contours.start"),r=e("contours.end"),o=t===!1||r===!1,n=E("contours.size"),i;o?i=S.autocontour=!0:i=E("autocontour",!1),(i||!n)&&E("ncontours")}}}),I2=Ge({"src/traces/contour/label_defaults.js"(K,G){var h=_n();G.exports=function(S,E,e,t){t||(t={});var r=S("contours.showlabels");if(r){var o=E.font;h.coerceFont(S,"contours.labelfont",o,{overrideDflt:{color:e}}),S("contours.labelformat")}t.hasHover!==!1&&S("zhoverformat")}}}),W1=Ge({"src/traces/contour/style_defaults.js"(K,G){var h=yh(),b=I2();G.exports=function(E,e,t,r,o){var n=t("contours.coloring"),i,a="";n==="fill"&&(i=t("contours.showlines")),i!==!1&&(n!=="lines"&&(a=t("line.color","#000")),t("line.width",.5),t("line.dash")),n!=="none"&&(E.showlegend!==!0&&(e.showlegend=!1),e._dfltShowLegend=!1,h(E,e,r,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),b(t,r,a,o)}}}),F5=Ge({"src/traces/histogram2dcontour/defaults.js"(K,G){var h=_n(),b=Kx(),S=eb(),E=W1(),e=yg(),t=Qx();G.exports=function(o,n,i,a){function s(c,p){return h.coerce(o,n,t,c,p)}function f(c){return h.coerce2(o,n,t,c)}b(o,n,s,a),n.visible!==!1&&(S(o,n,s,f),E(o,n,s,a),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),s("hovertemplatefallback"),n.contours&&n.contours.coloring==="heatmap"&&e(s,a))}}}),D2=Ge({"src/traces/contour/set_contours.js"(K,G){var h=Ts(),b=_n();G.exports=function(e,t){var r=e.contours;if(e.autocontour){var o=e.zmin,n=e.zmax;(e.zauto||o===void 0)&&(o=b.aggNums(Math.min,null,t)),(e.zauto||n===void 0)&&(n=b.aggNums(Math.max,null,t));var i=S(o,n,e.ncontours);r.size=i.dtick,r.start=h.tickFirst(i),i.range.reverse(),r.end=h.tickFirst(i),r.start===o&&(r.start+=r.size),r.end===n&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),b.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if(r.type!=="constraint"){var a=r.start,s=r.end,f=e._input.contours;if(a>s&&(r.start=f.start=s,s=r.end=f.end=a,a=r.start),!(r.size>0)){var c;a===s?c=1:c=S(a,s,e.ncontours).dtick,f.size=r.size=c}}};function S(E,e,t){var r={type:"linear",range:[E,e]};return h.autoTicks(r,(e-E)/(t||15)),r}}}),tb=Ge({"src/traces/contour/end_plus.js"(K,G){G.exports=function(b){return b.end+b.size/1e6}}}),rb=Ge({"src/traces/contour/calc.js"(K,G){var h=kc(),b=X1(),S=D2(),E=tb();G.exports=function(t,r){var o=b(t,r),n=o[0].z;S(r,n);var i=r.contours,a=h.extractOpts(r),s;if(i.coloring==="heatmap"&&a.auto&&r.autocontour===!1){var f=i.start,c=E(i),p=i.size||1,v=Math.floor((c-f)/p)+1;isFinite(p)||(p=1,v=1);var T=f-p/2,l=T+v*p;s=[T,l]}else s=n;return h.calc(t,r,{vals:s,cLetter:"z"}),o}}}),$1=Ge({"src/traces/contour/constants.js"(K,G){G.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),z2=Ge({"src/traces/contour/make_crossings.js"(K,G){var h=$1();G.exports=function(E){var e=E[0].z,t=e.length,r=e[0].length,o=t===2||r===2,n,i,a,s,f,c,p,v,T;for(i=0;iS?0:1)+(E[0][1]>S?0:2)+(E[1][1]>S?0:4)+(E[1][0]>S?0:8);if(e===5||e===10){var t=(E[0][0]+E[0][1]+E[1][0]+E[1][1])/4;return S>t?e===5?713:1114:e===5?104:208}return e===15?0:e}}}),nb=Ge({"src/traces/contour/find_all_paths.js"(K,G){var h=_n(),b=$1();G.exports=function(n,i,a){var s,f,c,p,v;for(i=i||.01,a=a||.01,c=0;c20?(c=b.CHOOSESADDLE[c][(p[0]||p[1])<0?0:1],o.crossings[f]=b.SADDLEREMAINDER[c]):delete o.crossings[f],p=b.NEWDELTA[c],!p){h.log("Found bad marching index:",c,n,o.level);break}v.push(r(o,n,p)),n[0]+=p[0],n[1]+=p[1],f=n.join(","),S(v[v.length-1],v[v.length-2],a,s)&&v.pop();var M=p[0]&&(n[0]<0||n[0]>l-2)||p[1]&&(n[1]<0||n[1]>T-2),_=n[0]===g[0]&&n[1]===g[1]&&p[0]===x[0]&&p[1]===x[1];if(_||i&&M)break;c=o.crossings[f]}A===1e4&&h.log("Infinite loop in contour?");var w=S(v[0],v[v.length-1],a,s),m=0,u=.2*o.smoothing,d=[],y=0,I,L,z,F,N,B,R,U,j,Z,re;for(A=1;A=y;A--)if(I=d[A],I=y&&I+d[L]U&&j--,o.edgepaths[j]=re.concat(v,Z));break}V||(o.edgepaths[U]=v.concat(Z))}for(U=0;U20&&n?o===208||o===1114?a=i[0]===0?1:-1:s=i[1]===0?1:-1:b.BOTTOMSTART.indexOf(o)!==-1?s=1:b.LEFTSTART.indexOf(o)!==-1?a=1:b.TOPSTART.indexOf(o)!==-1?s=-1:a=-1,[a,s]}function r(o,n,i){var a=n[0]+Math.max(i[0],0),s=n[1]+Math.max(i[1],0),f=o.z[s][a],c=o.xaxis,p=o.yaxis;if(i[1]){var v=(o.level-f)/(o.z[s][a+1]-f),T=(v!==1?(1-v)*c.c2l(o.x[a]):0)+(v!==0?v*c.c2l(o.x[a+1]):0);return[c.c2p(c.l2c(T),!0),p.c2p(o.y[s],!0),a+v,s]}else{var l=(o.level-f)/(o.z[s+1][a]-f),g=(l!==1?(1-l)*p.c2l(o.y[s]):0)+(l!==0?l*p.c2l(o.y[s+1]):0);return[c.c2p(o.x[a],!0),p.c2p(p.l2c(g),!0),a,s+l]}}}}),B5=Ge({"src/traces/contour/constraint_mapping.js"(K,G){var h=Jx(),b=Ei();G.exports={"[]":E("[]"),"][":E("]["),">":e(">"),"<":e("<"),"=":e("=")};function S(t,r){var o=Array.isArray(r),n;function i(a){return b(a)?+a:null}return h.COMPARISON_OPS2.indexOf(t)!==-1?n=i(o?r[0]:r):h.INTERVAL_OPS.indexOf(t)!==-1?n=o?[i(r[0]),i(r[1])]:[i(r),i(r)]:h.SET_OPS.indexOf(t)!==-1&&(n=o?r.map(i):[i(r)]),n}function E(t){return function(r){r=S(t,r);var o=Math.min(r[0],r[1]),n=Math.max(r[0],r[1]);return{start:o,end:n,size:n-o}}}function e(t){return function(r){return r=S(t,r),{start:r,end:1/0,size:1/0}}}}}),O2=Ge({"src/traces/contour/empty_pathinfo.js"(K,G){var h=_n(),b=B5(),S=tb();G.exports=function(e,t,r){for(var o=e.type==="constraint"?b[e._operation](e.value):e,n=o.size,i=[],a=S(o),s=r.trace._carpetTrace,f=s?{xaxis:s.aaxis,yaxis:s.baxis,x:r.a,y:r.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:r.x,y:r.y},c=o.start;c1e3){h.warn("Too many contours, clipping at 1000",e);break}return i}}}),N5=Ge({"src/traces/contour/convert_to_constraints.js"(K,G){var h=_n();G.exports=function(S,E){var e,t,r,o=function(a){return a.reverse()},n=function(a){return a};switch(E){case"=":case"<":return S;case">":for(S.length!==1&&h.warn("Contour data invalid for the specified inequality operation."),t=S[0],e=0;er.level||r.starts.length&&t===r.level)}break;case"constraint":if(S.prefixBoundary=!1,S.edgepaths.length)return;var o=S.x.length,n=S.y.length,i=-1/0,a=1/0;for(e=0;e":s>i&&(S.prefixBoundary=!0);break;case"<":(si||S.starts.length&&c===a)&&(S.prefixBoundary=!0);break;case"][":f=Math.min(s[0],s[1]),c=Math.max(s[0],s[1]),fi&&(S.prefixBoundary=!0);break}break}}}}),ab=Ge({"src/traces/contour/plot.js"(K){var G=ki(),h=_n(),b=As(),S=kc(),E=nc(),e=Ts(),t=rp(),r=Hx(),o=z2(),n=nb(),i=O2(),a=N5(),s=U5(),f=$1(),c=f.LABELOPTIMIZER;K.plot=function(_,w,m,u){var d=w.xaxis,y=w.yaxis;h.makeTraceGroups(u,m,"contour").each(function(I){var L=G.select(this),z=I[0],F=z.trace,N=z.x,B=z.y,R=F.contours,U=i(R,w,z),j=h.ensureSingle(L,"g","heatmapcoloring"),Z=[];R.coloring==="heatmap"&&(Z=[I]),r(_,w,Z,j),o(U),n(U);var re=d.c2p(N[0],!0),fe=d.c2p(N[N.length-1],!0),le=y.c2p(B[0],!0),ce=y.c2p(B[B.length-1],!0),V=[[re,ce],[fe,ce],[fe,le],[re,le]],ee=U;R.type==="constraint"&&(ee=a(U,R._operation)),p(L,V,R),v(L,ee,V,R),l(L,U,_,z,R),x(L,w,_,z,V)})};function p(M,_,w){var m=h.ensureSingle(M,"g","contourbg"),u=m.selectAll("path").data(w.coloring==="fill"?[0]:[]);u.enter().append("path"),u.exit().remove(),u.attr("d","M"+_.join("L")+"Z").style("stroke","none")}function v(M,_,w,m){var u=m.coloring==="fill"||m.type==="constraint"&&m._operation!=="=",d="M"+w.join("L")+"Z";u&&s(_,m);var y=h.ensureSingle(M,"g","contourfill"),I=y.selectAll("path").data(u?_:[]);I.enter().append("path"),I.exit().remove(),I.each(function(L){var z=(L.prefixBoundary?d:"")+T(L,w);z?G.select(this).attr("d",z).style("stroke","none"):G.select(this).remove()})}function T(M,_){var w="",m=0,u=M.edgepaths.map(function(re,fe){return fe}),d=!0,y,I,L,z,F,N;function B(re){return Math.abs(re[1]-_[0][1])<.01}function R(re){return Math.abs(re[1]-_[2][1])<.01}function U(re){return Math.abs(re[0]-_[0][0])<.01}function j(re){return Math.abs(re[0]-_[2][0])<.01}for(;u.length;){for(N=b.smoothopen(M.edgepaths[m],M.smoothing),w+=d?N:N.replace(/^M/,"L"),u.splice(u.indexOf(m),1),y=M.edgepaths[m][M.edgepaths[m].length-1],z=-1,L=0;L<4;L++){if(!y){h.log("Missing end?",m,M);break}for(B(y)&&!j(y)?I=_[1]:U(y)?I=_[0]:R(y)?I=_[3]:j(y)&&(I=_[2]),F=0;F=0&&(I=Z,z=F):Math.abs(y[1]-I[1])<.01?Math.abs(y[1]-Z[1])<.01&&(Z[0]-y[0])*(I[0]-Z[0])>=0&&(I=Z,z=F):h.log("endpt to newendpt is not vert. or horz.",y,I,Z)}if(y=I,z>=0)break;w+="L"+I}if(z===M.edgepaths.length){h.log("unclosed perimeter path");break}m=z,d=u.indexOf(m)===-1,d&&(m=u[0],w+="Z")}for(m=0;mc.MAXCOST*2)break;B&&(I/=2),y=z-I/2,L=y+I*1.5}if(N<=c.MAXCOST)return F};function g(M,_,w,m){var u=_.width/2,d=_.height/2,y=M.x,I=M.y,L=M.theta,z=Math.cos(L)*u,F=Math.sin(L)*u,N=(y>m.center?m.right-y:y-m.left)/(z+Math.abs(Math.sin(L)*d)),B=(I>m.middle?m.bottom-I:I-m.top)/(Math.abs(F)+Math.cos(L)*d);if(N<1||B<1)return 1/0;var R=c.EDGECOST*(1/(N-1)+1/(B-1));R+=c.ANGLECOST*L*L;for(var U=y-z,j=I-F,Z=y+z,re=I+F,fe=0;fe=x)&&(r<=g&&(r=g),o>=x&&(o=x),i=Math.floor((o-r)/n)+1,a=0),l=0;lg&&(p.unshift(g),v.unshift(v[0])),p[p.length-1]2?s.value=s.value.slice(2):s.length===0?s.value=[0,1]:s.length<2?(f=parseFloat(s.value[0]),s.value=[f,f+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:h(s.value)&&(f=parseFloat(s.value),s.value=[f,f+1])):(a("contours.value",0),h(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}}),N2=Ge({"src/traces/contour/defaults.js"(K,G){var h=_n(),b=bh(),S=Vp(),E=B2(),e=eb(),t=W1(),r=yg(),o=Z1();G.exports=function(i,a,s,f){function c(l,g){return h.coerce(i,a,o,l,g)}function p(l){return h.coerce2(i,a,o,l)}var v=b(i,a,c,f);if(!v){a.visible=!1;return}S(i,a,f,c),c("xhoverformat"),c("yhoverformat"),c("text"),c("hovertext"),c("hoverongaps"),c("hovertemplate"),c("hovertemplatefallback");var T=c("contours.type")==="constraint";c("connectgaps",h.isArray1D(a.z)),T?E(i,a,c,f,s):(e(i,a,c,p),t(i,a,c,f)),a.contours&&a.contours.coloring==="heatmap"&&r(c,f),c("zorder")}}}),q5=Ge({"src/traces/contour/index.js"(K,G){G.exports={attributes:Z1(),supplyDefaults:N2(),calc:rb(),plot:ab().plot,style:K1(),colorbar:xy(),hoverPoints:F2(),moduleType:"trace",name:"contour",basePlotModule:_h(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),U2=Ge({"lib/contour.js"(K,G){G.exports=q5()}}),ib=Ge({"src/traces/scatterternary/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=cv(),e=Gc(),t=Jl(),r=zu(),o=md().dash,n=Ji().extendFlat,i=e.marker,a=e.line,s=i.line;G.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:n({},e.mode,{dflt:"markers"}),text:n({},e.text,{}),texttemplate:b({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:n({},e.hovertext,{}),line:{color:a.color,width:a.width,dash:o,backoff:a.backoff,shape:n({},a.shape,{values:["linear","spline"]}),smoothing:a.smoothing,editType:"calc"},connectgaps:e.connectgaps,cliponaxis:e.cliponaxis,fill:n({},e.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:E(),marker:n({symbol:i.symbol,opacity:i.opacity,angle:i.angle,angleref:i.angleref,standoff:i.standoff,maxdisplayed:i.maxdisplayed,size:i.size,sizeref:i.sizeref,sizemin:i.sizemin,sizemode:i.sizemode,line:n({width:s.width,editType:"calc"},r("marker.line")),gradient:i.gradient,editType:"calc"},r("marker")),textfont:e.textfont,textposition:e.textposition,selected:e.selected,unselected:e.unselected,hoverinfo:n({},t.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:e.hoveron,hovertemplate:h(),hovertemplatefallback:S()}}}),V5=Ge({"src/traces/scatterternary/defaults.js"(K,G){var h=_n(),b=c0(),S=uu(),E=Jd(),e=Hp(),t=Qd(),r=op(),o=Nd(),n=ib();G.exports=function(a,s,f,c){function p(M,_){return h.coerce(a,s,n,M,_)}var v=p("a"),T=p("b"),l=p("c"),g;if(v?(g=v.length,T?(g=Math.min(g,T.length),l&&(g=Math.min(g,l.length))):l?g=Math.min(g,l.length):g=0):T&&l&&(g=Math.min(T.length,l.length)),!g){s.visible=!1;return}s._length=g,p("sum"),p("text"),p("hovertext"),s.hoveron!=="fills"&&(p("hovertemplate"),p("hovertemplatefallback"));var x=g"),o.hovertemplate=c.hovertemplate,r}}}),Y5=Ge({"src/traces/scatterternary/event_data.js"(K,G){G.exports=function(b,S,E,e,t){if(S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),e[t]){var r=e[t];b.a=r.a,b.b=r.b,b.c=r.c}else b.a=S.a,b.b=S.b,b.c=S.c;return b}}}),ob=Ge({"src/plots/ternary/ternary.js"(K,G){var h=ki(),b=Rs(),S=Ro(),E=_n(),e=E.strTranslate,t=E._,r=go(),o=As(),n=rp(),i=Ji().extendFlat,a=ef(),s=Ts(),f=uv(),c=Yf(),p=jp(),v=p.freeMode,T=p.rectMode,l=um(),g=Qf().prepSelect,x=Qf().selectOnClick,A=Qf().clearOutline,M=Qf().clearSelectionsCache,_=sh();function w(R,U){this.id=R.id,this.graphDiv=R.graphDiv,this.init(U),this.makeFramework(U),this.updateFx(U),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}G.exports=w;var m=w.prototype;m.init=function(R){this.container=R._ternarylayer,this.defs=R._defs,this.layoutId=R._uid,this.traceHash={},this.layers={}},m.plot=function(R,U){var j=this,Z=U[j.id],re=U._size;j._hasClipOnAxisFalse=!1;for(var fe=0;feu*ee?(de=ee,ie=de*u):(ie=V,de=ie/u),Se=le*ie/V,Le=ce*de/ee,H=U.l+U.w*re-ie/2,ae=U.t+U.h*(1-fe)-de/2,j.x0=H,j.y0=ae,j.w=ie,j.h=de,j.sum=ne,j.xaxis={type:"linear",range:[$+2*te-ne,ne-$-2*ue],domain:[re-Se/2,re+Se/2],_id:"x"},n(j.xaxis,j.graphDiv._fullLayout),j.xaxis.setScale(),j.xaxis.isPtWithinRange=function(Ne){return Ne.a>=j.aaxis.range[0]&&Ne.a<=j.aaxis.range[1]&&Ne.b>=j.baxis.range[1]&&Ne.b<=j.baxis.range[0]&&Ne.c>=j.caxis.range[1]&&Ne.c<=j.caxis.range[0]},j.yaxis={type:"linear",range:[$,ne-ue-te],domain:[fe-Le/2,fe+Le/2],_id:"y"},n(j.yaxis,j.graphDiv._fullLayout),j.yaxis.setScale(),j.yaxis.isPtWithinRange=function(){return!0};var Fe=j.yaxis.domain[0],ze=j.aaxis=i({},R.aaxis,{range:[$,ne-ue-te],side:"left",tickangle:(+R.aaxis.tickangle||0)-30,domain:[Fe,Fe+Le*u],anchor:"free",position:0,_id:"y",_length:ie});n(ze,j.graphDiv._fullLayout),ze.setScale();var Ye=j.baxis=i({},R.baxis,{range:[ne-$-te,ue],side:"bottom",domain:j.xaxis.domain,anchor:"free",position:0,_id:"x",_length:ie});n(Ye,j.graphDiv._fullLayout),Ye.setScale();var st=j.caxis=i({},R.caxis,{range:[ne-$-ue,te],side:"right",tickangle:(+R.caxis.tickangle||0)+30,domain:[Fe,Fe+Le*u],anchor:"free",position:0,_id:"y",_length:ie});n(st,j.graphDiv._fullLayout),st.setScale();var ct="M"+H+","+(ae+de)+"h"+ie+"l-"+ie/2+",-"+de+"Z";j.clipDef.select("path").attr("d",ct),j.layers.plotbg.select("path").attr("d",ct);var at="M0,"+de+"h"+ie+"l-"+ie/2+",-"+de+"Z";j.clipDefRelative.select("path").attr("d",at);var et=e(H,ae);j.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",et),j.clipDefRelative.select("path").attr("transform",null);var Pe=e(H-Ye._offset,ae+de);j.layers.baxis.attr("transform",Pe),j.layers.bgrid.attr("transform",Pe);var Ae=e(H+ie/2,ae)+"rotate(30)"+e(0,-ze._offset);j.layers.aaxis.attr("transform",Ae),j.layers.agrid.attr("transform",Ae);var pe=e(H+ie/2,ae)+"rotate(-30)"+e(0,-st._offset);j.layers.caxis.attr("transform",pe),j.layers.cgrid.attr("transform",pe),j.drawAxes(!0),j.layers.aline.select("path").attr("d",ze.showline?"M"+H+","+(ae+de)+"l"+ie/2+",-"+de:"M0,0").call(r.stroke,ze.linecolor||"#000").style("stroke-width",(ze.linewidth||0)+"px"),j.layers.bline.select("path").attr("d",Ye.showline?"M"+H+","+(ae+de)+"h"+ie:"M0,0").call(r.stroke,Ye.linecolor||"#000").style("stroke-width",(Ye.linewidth||0)+"px"),j.layers.cline.select("path").attr("d",st.showline?"M"+(H+ie/2)+","+ae+"l"+ie/2+","+de:"M0,0").call(r.stroke,st.linecolor||"#000").style("stroke-width",(st.linewidth||0)+"px"),j.graphDiv._context.staticPlot||j.initInteractions(),o.setClipUrl(j.layers.frontplot,j._hasClipOnAxisFalse?null:j.clipId,j.graphDiv)},m.drawAxes=function(R){var U=this,j=U.graphDiv,Z=U.id.slice(7)+"title",re=U.layers,fe=U.aaxis,le=U.baxis,ce=U.caxis;if(U.drawAx(fe),U.drawAx(le),U.drawAx(ce),R){var V=Math.max(fe.showticklabels?fe.tickfont.size/2:0,(ce.showticklabels?ce.tickfont.size*.75:0)+(ce.ticks==="outside"?ce.ticklen*.87:0)),ee=(le.showticklabels?le.tickfont.size:0)+(le.ticks==="outside"?le.ticklen:0)+3;re["a-title"]=l.draw(j,"a"+Z,{propContainer:fe,propName:U.id+".aaxis.title.text",placeholder:t(j,"Click to enter Component A title"),attributes:{x:U.x0+U.w/2,y:U.y0-fe.title.font.size/3-V,"text-anchor":"middle"}}),re["b-title"]=l.draw(j,"b"+Z,{propContainer:le,propName:U.id+".baxis.title.text",placeholder:t(j,"Click to enter Component B title"),attributes:{x:U.x0-ee,y:U.y0+U.h+le.title.font.size*.83+ee,"text-anchor":"middle"}}),re["c-title"]=l.draw(j,"c"+Z,{propContainer:ce,propName:U.id+".caxis.title.text",placeholder:t(j,"Click to enter Component C title"),attributes:{x:U.x0+U.w+ee,y:U.y0+U.h+ce.title.font.size*.83+ee,"text-anchor":"middle"}})}},m.drawAx=function(R){var U=this,j=U.graphDiv,Z=R._name,re=Z.charAt(0),fe=R._id,le=U.layers[Z],ce=30,V=re+"tickLayout",ee=d(R);U[V]!==ee&&(le.selectAll("."+fe+"tick").remove(),U[V]=ee),R.setScale();var ne=s.calcTicks(R),$=s.clipEnds(R,ne),ue=s.makeTransTickFn(R),te=s.getTickSigns(R)[2],H=E.deg2rad(ce),ae=te*(R.linewidth||1)/2,ie=te*R.ticklen,de=U.w,Se=U.h,Le=re==="b"?"M0,"+ae+"l"+Math.sin(H)*ie+","+Math.cos(H)*ie:"M"+ae+",0l"+Math.cos(H)*ie+","+-Math.sin(H)*ie,Fe={a:"M0,0l"+Se+",-"+de/2,b:"M0,0l-"+de/2+",-"+Se,c:"M0,0l-"+Se+","+de/2}[re];s.drawTicks(j,R,{vals:R.ticks==="inside"?$:ne,layer:le,path:Le,transFn:ue,crisp:!1}),s.drawGrid(j,R,{vals:$,layer:U.layers[re+"grid"],path:Fe,transFn:ue,crisp:!1}),s.drawLabels(j,R,{vals:ne,layer:le,transFn:ue,labelFns:s.makeLabelFns(R,0,ce)})};function d(R){return R.ticks+String(R.ticklen)+String(R.showticklabels)}var y=_.MINZOOM/2+.87,I="m-0.87,.5h"+y+"v3h-"+(y+5.2)+"l"+(y/2+2.6)+",-"+(y*.87+4.5)+"l2.6,1.5l-"+y/2+","+y*.87+"Z",L="m0.87,.5h-"+y+"v3h"+(y+5.2)+"l-"+(y/2+2.6)+",-"+(y*.87+4.5)+"l-2.6,1.5l"+y/2+","+y*.87+"Z",z="m0,1l"+y/2+","+y*.87+"l2.6,-1.5l-"+(y/2+2.6)+",-"+(y*.87+4.5)+"l-"+(y/2+2.6)+","+(y*.87+4.5)+"l2.6,1.5l"+y/2+",-"+y*.87+"Z",F="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",N=!0;m.clearOutline=function(){M(this.dragOptions),A(this.dragOptions.gd)},m.initInteractions=function(){var R=this,U=R.layers.plotbg.select("path").node(),j=R.graphDiv,Z=j._fullLayout._zoomlayer,re,fe;this.dragOptions={element:U,gd:j,plotinfo:{id:R.id,domain:j._fullLayout[R.id].domain,xaxis:R.xaxis,yaxis:R.yaxis},subplot:R.id,prepFn:function(Pe,Ae,pe){R.dragOptions.xaxes=[R.xaxis],R.dragOptions.yaxes=[R.yaxis],re=j._fullLayout._invScaleX,fe=j._fullLayout._invScaleY;var Ne=R.dragOptions.dragmode=j._fullLayout.dragmode;v(Ne)?R.dragOptions.minDrag=1:R.dragOptions.minDrag=void 0,Ne==="zoom"?(R.dragOptions.moveFn=Ye,R.dragOptions.clickFn=de,R.dragOptions.doneFn=st,Se(Pe,Ae,pe)):Ne==="pan"?(R.dragOptions.moveFn=at,R.dragOptions.clickFn=de,R.dragOptions.doneFn=et,ct(),R.clearOutline(j)):(T(Ne)||v(Ne))&&g(Pe,Ae,pe,R.dragOptions,Ne)}};var le,ce,V,ee,ne,$,ue,te,H,ae;function ie(Pe){var Ae={};return Ae[R.id+".aaxis.min"]=Pe.a,Ae[R.id+".baxis.min"]=Pe.b,Ae[R.id+".caxis.min"]=Pe.c,Ae}function de(Pe,Ae){var pe=j._fullLayout.clickmode;B(j),Pe===2&&(j.emit("plotly_doubleclick",null),S.call("_guiRelayout",j,ie({a:0,b:0,c:0}))),pe.indexOf("select")>-1&&Pe===1&&x(Ae,j,[R.xaxis],[R.yaxis],R.id,R.dragOptions),pe.indexOf("event")>-1&&c.click(j,Ae,R.id)}function Se(Pe,Ae,pe){var Ne=U.getBoundingClientRect();le=Ae-Ne.left,ce=pe-Ne.top,j._fullLayout._calcInverseTransform(j);var ut=j._fullLayout._invTransform,dt=E.apply3DTransform(ut)(le,ce);le=dt[0],ce=dt[1],V={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},ne=V,ee=R.aaxis.range[1]-V.a,$=b(R.graphDiv._fullLayout[R.id].bgcolor).getLuminance(),ue="M0,"+R.h+"L"+R.w/2+", 0L"+R.w+","+R.h+"Z",te=!1,H=Z.append("path").attr("class","zoombox").attr("transform",e(R.x0,R.y0)).style({fill:$>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",ue),ae=Z.append("path").attr("class","zoombox-corners").attr("transform",e(R.x0,R.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),R.clearOutline(j)}function Le(Pe,Ae){return 1-Ae/R.h}function Fe(Pe,Ae){return 1-(Pe+(R.h-Ae)/Math.sqrt(3))/R.w}function ze(Pe,Ae){return(Pe-(R.h-Ae)/Math.sqrt(3))/R.w}function Ye(Pe,Ae){var pe=le+Pe*re,Ne=ce+Ae*fe,ut=Math.max(0,Math.min(1,Le(le,ce),Le(pe,Ne))),dt=Math.max(0,Math.min(1,Fe(le,ce),Fe(pe,Ne))),nt=Math.max(0,Math.min(1,ze(le,ce),ze(pe,Ne))),Ft=(ut/2+nt)*R.w,Nt=(1-ut/2-dt)*R.w,Qt=(Ft+Nt)/2,ar=Nt-Ft,kr=(1-ut)*R.h,Er=kr-ar/u;ar<_.MINZOOM?(ne=V,H.attr("d",ue),ae.attr("d","M0,0Z")):(ne={a:V.a+ut*ee,b:V.b+dt*ee,c:V.c+nt*ee},H.attr("d",ue+"M"+Ft+","+kr+"H"+Nt+"L"+Qt+","+Er+"L"+Ft+","+kr+"Z"),ae.attr("d","M"+le+","+ce+F+"M"+Ft+","+kr+I+"M"+Nt+","+kr+L+"M"+Qt+","+Er+z)),te||(H.transition().style("fill",$>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ae.transition().style("opacity",1).duration(200),te=!0),j.emit("plotly_relayouting",ie(ne))}function st(){B(j),ne!==V&&(S.call("_guiRelayout",j,ie(ne)),N&&j.data&&j._context.showTips&&(E.notifier(t(j,"Double-click to zoom back out"),"long"),N=!1))}function ct(){V={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},ne=V}function at(Pe,Ae){var pe=Pe/R.xaxis._m,Ne=Ae/R.yaxis._m;ne={a:V.a-Ne,b:V.b+(pe+Ne)/2,c:V.c-(pe-Ne)/2};var ut=[ne.a,ne.b,ne.c].sort(E.sorterAsc),dt={a:ut.indexOf(ne.a),b:ut.indexOf(ne.b),c:ut.indexOf(ne.c)};ut[0]<0&&(ut[1]+ut[0]/2<0?(ut[2]+=ut[0]+ut[1],ut[0]=ut[1]=0):(ut[2]+=ut[0]/2,ut[1]+=ut[0]/2,ut[0]=0),ne={a:ut[dt.a],b:ut[dt.b],c:ut[dt.c]},Ae=(V.a-ne.a)*R.yaxis._m,Pe=(V.c-ne.c-V.b+ne.b)*R.xaxis._m);var nt=e(R.x0+Pe,R.y0+Ae);R.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",nt);var Ft=e(-Pe,-Ae);R.clipDefRelative.select("path").attr("transform",Ft),R.aaxis.range=[ne.a,R.sum-ne.b-ne.c],R.baxis.range=[R.sum-ne.a-ne.c,ne.b],R.caxis.range=[R.sum-ne.a-ne.b,ne.c],R.drawAxes(!1),R._hasClipOnAxisFalse&&R.plotContainer.select(".scatterlayer").selectAll(".trace").call(o.hideOutsideRangePoints,R),j.emit("plotly_relayouting",ie(ne))}function et(){S.call("_guiRelayout",j,ie(ne))}U.onmousemove=function(Pe){c.hover(j,Pe,R.id),j._fullLayout._lasthover=U,j._fullLayout._hoversubplot=R.id},U.onmouseout=function(Pe){j._dragging||f.unhover(j,Pe)},f.init(this.dragOptions)};function B(R){h.select(R).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),j2=Ge({"src/plots/ternary/layout_attributes.js"(K,G){var h=Xf(),b=Cc().attributes,S=id(),E=Hc().overrideAll,e=Ji().extendFlat,t={title:{text:S.title.text,font:S.title.font},color:S.color,tickmode:S.minor.tickmode,nticks:e({},S.nticks,{dflt:6,min:1}),tick0:S.tick0,dtick:S.dtick,tickvals:S.tickvals,ticktext:S.ticktext,ticks:S.ticks,ticklen:S.ticklen,tickwidth:S.tickwidth,tickcolor:S.tickcolor,ticklabelstep:S.ticklabelstep,showticklabels:S.showticklabels,labelalias:S.labelalias,showtickprefix:S.showtickprefix,tickprefix:S.tickprefix,showticksuffix:S.showticksuffix,ticksuffix:S.ticksuffix,showexponent:S.showexponent,exponentformat:S.exponentformat,minexponent:S.minexponent,separatethousands:S.separatethousands,tickfont:S.tickfont,tickangle:S.tickangle,tickformat:S.tickformat,tickformatstops:S.tickformatstops,hoverformat:S.hoverformat,showline:e({},S.showline,{dflt:!0}),linecolor:S.linecolor,linewidth:S.linewidth,showgrid:e({},S.showgrid,{dflt:!0}),gridcolor:S.gridcolor,gridwidth:S.gridwidth,griddash:S.griddash,layer:S.layer,min:{valType:"number",dflt:0,min:0}},r=G.exports=E({domain:b({name:"ternary"}),bgcolor:{valType:"color",dflt:h.background},sum:{valType:"number",dflt:1,min:0},aaxis:t,baxis:t,caxis:t},"plot","from-root");r.uirevision={valType:"any",editType:"none"},r.aaxis.uirevision=r.baxis.uirevision=r.caxis.uirevision={valType:"any",editType:"none"}}}),q0=Ge({"src/plots/subplot_defaults.js"(K,G){var h=_n(),b=_u(),S=Cc().defaults;G.exports=function(e,t,r,o){var n=o.type,i=o.attributes,a=o.handleDefaults,s=o.partition||"x",f=t._subplots[n],c=f.length,p=c&&f[0].replace(/\d+$/,""),v,T;function l(M,_){return h.coerce(v,T,i,M,_)}for(var g=0;g=g&&(w.min=0,m.min=0,u.min=0,c.aaxis&&delete c.aaxis.min,c.baxis&&delete c.baxis.min,c.caxis&&delete c.caxis.min)}function f(c,p,v,T){var l=i[p._name];function g(d,y){return S.coerce(c,p,l,d,y)}g("uirevision",T.uirevision),p.type="linear";var x=g("color"),A=x!==l.color.dflt?x:v.font.color,M=p._name,_=M.charAt(0).toUpperCase(),w="Component "+_,m=g("title.text",w);p._hovertitle=m===w?m:_,S.coerceFont(g,"title.font",v.font,{overrideDflt:{size:S.bigFont(v.font.size),color:A}}),g("min"),o(c,p,g,"linear"),t(c,p,g,"linear"),e(c,p,g,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(c,p,g,{outerTicks:!0});var u=g("showticklabels");u&&(S.coerceFont(g,"tickfont",v.font,{overrideDflt:{color:A}}),g("tickangle"),g("tickformat")),n(c,p,g,{dfltColor:x,bgColor:v.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),g("hoverformat"),g("layer")}}}),W5=Ge({"src/plots/ternary/index.js"(K){var G=ob(),h=Bd().getSubplotCalcData,b=_n().counterRegex,S="ternary";K.name=S;var E=K.attr="subplot";K.idRoot=S,K.idRegex=K.attrRegex=b(S);var e=K.attributes={};e[E]={valType:"subplotid",dflt:"ternary",editType:"calc"},K.layoutAttributes=j2(),K.supplyLayoutDefaults=Z5(),K.plot=function(r){for(var o=r._fullLayout,n=r.calcdata,i=o._subplots[S],a=0;a0){var M=r.xa,_=r.ya,w,m,u,d,y;c.orientation==="h"?(y=o,w="y",u=_,m="x",d=M):(y=n,w="x",u=M,m="y",d=_);var I=f[r.index];if(y>=I.span[0]&&y<=I.span[1]){var L=b.extendFlat({},r),z=d.c2p(y,!0),F=e.getKdeValue(I,c,y),N=e.getPositionOnKdePath(I,c,z),B=u._offset,R=u._length;L[w+"0"]=N[0],L[w+"1"]=N[1],L[m+"0"]=L[m+"1"]=z,L[m+"Label"]=m+": "+S.hoverLabelText(d,y,c[m+"hoverformat"])+", "+f[0].t.labels.kde+" "+F.toFixed(3);for(var U=0,j=0;j path").each(function(v){if(!v.isBlank){var T=p.marker;h.select(this).call(S.fill,v.mc||T.color).call(S.stroke,v.mlc||T.line.color).call(b.dashLine,T.line.dash,v.mlw||T.line.width).style("opacity",p.selectedpoints&&!v.selected?E:1)}}),r(c,p,n),c.selectAll(".regions").each(function(){h.select(this).selectAll("path").style("stroke-width",0).call(S.fill,p.connector.fillcolor)}),c.selectAll(".lines").each(function(){var v=p.connector.line;b.lineGroupStyle(h.select(this).selectAll("path"),v.width,v.color,v.dash)})})}G.exports={style:o}}}),K2=Ge({"src/traces/funnel/hover.js"(K,G){var h=go().opacity,b=Lc().hoverOnBars,S=_n().formatPercent;G.exports=function(t,r,o,n,i){var a=b(t,r,o,n,i);if(a){var s=a.cd,f=s[0].trace,c=f.orientation==="h",p=a.index,v=s[p],T=c?"x":"y";a[T+"LabelVal"]=v.s,a.percentInitial=v.begR,a.percentInitialLabel=S(v.begR,1),a.percentPrevious=v.difR,a.percentPreviousLabel=S(v.difR,1),a.percentTotal=v.sumR,a.percentTotalLabel=S(v.sumR,1);var l=v.hi||f.hoverinfo,g=[];if(l&&l!=="none"&&l!=="skip"){var x=l==="all",A=l.split("+"),M=function(_){return x||A.indexOf(_)!==-1};M("percent initial")&&g.push(a.percentInitialLabel+" of initial"),M("percent previous")&&g.push(a.percentPreviousLabel+" of previous"),M("percent total")&&g.push(a.percentTotalLabel+" of total")}return a.extraText=g.join("
"),a.color=E(f,v),[a]}};function E(e,t){var r=e.marker,o=t.mc||r.color,n=t.mlc||r.line.color,i=t.mlw||r.line.width;if(h(o))return o;if(h(n)&&i)return n}}}),rA=Ge({"src/traces/funnel/event_data.js"(K,G){G.exports=function(b,S){return b.x="xVal"in S?S.xVal:S.x,b.y="yVal"in S?S.yVal:S.y,"percentInitial"in S&&(b.percentInitial=S.percentInitial),"percentPrevious"in S&&(b.percentPrevious=S.percentPrevious),"percentTotal"in S&&(b.percentTotal=S.percentTotal),S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),b}}}),J2=Ge({"src/traces/funnel/index.js"(K,G){G.exports={attributes:H2(),layoutAttributes:G2(),supplyDefaults:X2().supplyDefaults,crossTraceDefaults:X2().crossTraceDefaults,supplyLayoutDefaults:Y2(),calc:W2(),crossTraceCalc:tA(),plot:$2(),style:cb().style,hoverPoints:K2(),eventData:rA(),selectPoints:Tm(),moduleType:"trace",name:"funnel",basePlotModule:_h(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),nA=Ge({"lib/funnel.js"(K,G){G.exports=J2()}}),V0=Ge({"src/traces/waterfall/constants.js"(K,G){G.exports={eventDataKeys:["initial","delta","final"]}}}),fb=Ge({"src/traces/waterfall/attributes.js"(K,G){var h=qh(),b=Gc().line,S=Jl(),E=mc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=V0(),n=Ji().extendFlat,i=go();function a(s){return{marker:{color:n({},h.marker.color,{arrayOk:!1,editType:"style"}),line:{color:n({},h.marker.line.color,{arrayOk:!1,editType:"style"}),width:n({},h.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}G.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:h.x,x0:h.x0,dx:h.dx,y:h.y,y0:h.y0,dy:h.dy,xperiod:h.xperiod,yperiod:h.yperiod,xperiod0:h.xperiod0,yperiod0:h.yperiod0,xperiodalignment:h.xperiodalignment,yperiodalignment:h.yperiodalignment,xhoverformat:E("x"),yhoverformat:E("y"),hovertext:h.hovertext,hovertemplate:e({},{keys:o.eventDataKeys}),hovertemplatefallback:r(),hoverinfo:n({},S.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:t({editType:"plot"},{keys:o.eventDataKeys.concat(["label"])}),texttemplatefallback:r({editType:"plot"}),text:h.text,textposition:h.textposition,insidetextanchor:h.insidetextanchor,textangle:h.textangle,textfont:h.textfont,insidetextfont:h.insidetextfont,outsidetextfont:h.outsidetextfont,constraintext:h.constraintext,cliponaxis:h.cliponaxis,orientation:h.orientation,offset:h.offset,width:h.width,increasing:a(),decreasing:a(),totals:a(),connector:{line:{color:n({},b.color,{dflt:i.defaultLine}),width:n({},b.width,{editType:"plot"}),dash:b.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:h.offsetgroup,alignmentgroup:h.alignmentgroup,zorder:h.zorder}}}),aA=Ge({"src/traces/waterfall/layout_attributes.js"(K,G){G.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),by=Ge({"src/constants/delta.js"(K,G){G.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),p0=Ge({"src/traces/waterfall/defaults.js"(K,G){var h=_n(),b=O0(),S=Dv().handleText,E=qp(),e=Vp(),t=fb(),r=go(),o=by(),n=o.INCREASING.COLOR,i=o.DECREASING.COLOR,a="#4499FF";function s(p,v,T){p(v+".marker.color",T),p(v+".marker.line.color",r.defaultLine),p(v+".marker.line.width")}function f(p,v,T,l){function g(w,m){return h.coerce(p,v,t,w,m)}var x=E(p,v,l,g);if(!x){v.visible=!1;return}e(p,v,l,g),g("xhoverformat"),g("yhoverformat"),g("measure"),g("orientation",v.x&&!v.y?"h":"v"),g("base"),g("offset"),g("width"),g("text"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var A=g("textposition");S(p,v,l,g,A,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),v.textposition!=="none"&&(g("texttemplate"),g("texttemplatefallback"),v.texttemplate||g("textinfo")),s(g,"increasing",n),s(g,"decreasing",i),s(g,"totals",a);var M=g("connector.visible");if(M){g("connector.mode");var _=g("connector.line.width");_&&(g("connector.line.color"),g("connector.line.dash"))}g("zorder")}function c(p,v){var T,l;function g(A){return h.coerce(l._input,l,t,A)}if(v.waterfallmode==="group")for(var x=0;x0&&(g?y+="M"+u[0]+","+d[1]+"V"+d[0]:y+="M"+u[1]+","+d[0]+"H"+u[0]),x!=="between"&&(_.isSum||w path").each(function(v){if(!v.isBlank){var T=p[v.dir].marker;h.select(this).call(S.fill,T.color).call(S.stroke,T.line.color).call(b.dashLine,T.line.dash,T.line.width).style("opacity",p.selectedpoints&&!v.selected?E:1)}}),r(c,p,n),c.selectAll(".lines").each(function(){var v=p.connector.line;b.lineGroupStyle(h.select(this).selectAll("path"),v.width,v.color,v.dash)})})}G.exports={style:o}}}),rE=Ge({"src/traces/waterfall/hover.js"(K,G){var h=Ts().hoverLabelText,b=go().opacity,S=Lc().hoverOnBars,E=by(),e={increasing:E.INCREASING.SYMBOL,decreasing:E.DECREASING.SYMBOL};G.exports=function(o,n,i,a,s){var f=S(o,n,i,a,s);if(!f)return;var c=f.cd,p=c[0].trace,v=p.orientation==="h",T=v?"x":"y",l=v?o.xa:o.ya;function g(I){return h(l,I,p[T+"hoverformat"])}var x=f.index,A=c[x],M=A.isSum?A.b+A.s:A.rawS;f.initial=A.b+A.s-M,f.delta=M,f.final=f.initial+f.delta;var _=g(Math.abs(f.delta));f.deltaLabel=M<0?"("+_+")":_,f.finalLabel=g(f.final),f.initialLabel=g(f.initial);var w=A.hi||p.hoverinfo,m=[];if(w&&w!=="none"&&w!=="skip"){var u=w==="all",d=w.split("+"),y=function(I){return u||d.indexOf(I)!==-1};A.isSum||(y("final")&&(v?!y("x"):!y("y"))&&m.push(f.finalLabel),y("delta")&&(M<0?m.push(f.deltaLabel+" "+e.decreasing):m.push(f.deltaLabel+" "+e.increasing)),y("initial")&&m.push("Initial: "+f.initialLabel))}return m.length&&(f.extraText=m.join("
")),f.color=t(p,A),[f]};function t(r,o){var n=r[o.dir].marker,i=n.color,a=n.line.color,s=n.line.width;if(b(i))return i;if(b(a)&&s)return a}}}),nE=Ge({"src/traces/waterfall/event_data.js"(K,G){G.exports=function(b,S){return b.x="xVal"in S?S.xVal:S.x,b.y="yVal"in S?S.yVal:S.y,"initial"in S&&(b.initial=S.initial),"delta"in S&&(b.delta=S.delta),"final"in S&&(b.final=S.final),S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),b}}}),oA=Ge({"src/traces/waterfall/index.js"(K,G){G.exports={attributes:fb(),layoutAttributes:aA(),supplyDefaults:p0().supplyDefaults,crossTraceDefaults:p0().crossTraceDefaults,supplyLayoutDefaults:Q2(),calc:iA(),crossTraceCalc:hb(),plot:e_(),style:eh().style,hoverPoints:rE(),eventData:nE(),selectPoints:Tm(),moduleType:"trace",name:"waterfall",basePlotModule:_h(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),t_=Ge({"lib/waterfall.js"(K,G){G.exports=oA()}}),wp=Ge({"src/traces/image/constants.js"(K,G){G.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(h){return h.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(h){return h.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(h){return h.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(h){var b=h.slice(0,3);return b[1]=b[1]+"%",b[2]=b[2]+"%",b},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(h){var b=h.slice(0,4);return b[1]=b[1]+"%",b[2]=b[2]+"%",b},suffix:["°","%","%",""]}}}}}),e3=Ge({"src/traces/image/attributes.js"(K,G){var h=Jl(),b=Gc().zorder,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=Ji().extendFlat,t=wp().colormodel,r=["rgb","rgba","rgba256","hsl","hsla"],o=[],n=[];for(a=0;a0)throw new Error("Invalid string. Length must be a multiple of 4");var p=f.indexOf("=");p===-1&&(p=c);var v=p===c?0:4-p%4;return[p,v]}function r(f){var c=t(f),p=c[0],v=c[1];return(p+v)*3/4-v}function o(f,c,p){return(c+p)*3/4-p}function n(f){var c,p=t(f),v=p[0],T=p[1],l=new b(o(f,v,T)),g=0,x=T>0?v-4:v,A;for(A=0;A>16&255,l[g++]=c>>8&255,l[g++]=c&255;return T===2&&(c=h[f.charCodeAt(A)]<<2|h[f.charCodeAt(A+1)]>>4,l[g++]=c&255),T===1&&(c=h[f.charCodeAt(A)]<<10|h[f.charCodeAt(A+1)]<<4|h[f.charCodeAt(A+2)]>>2,l[g++]=c>>8&255,l[g++]=c&255),l}function i(f){return G[f>>18&63]+G[f>>12&63]+G[f>>6&63]+G[f&63]}function a(f,c,p){for(var v,T=[],l=c;lx?x:g+l));return v===1?(c=f[p-1],T.push(G[c>>2]+G[c<<4&63]+"==")):v===2&&(c=(f[p-2]<<8)+f[p-1],T.push(G[c>>10]+G[c>>4&63]+G[c<<2&63]+"=")),T.join("")}}}),t3=Ge({"node_modules/ieee754/index.js"(K){K.read=function(G,h,b,S,E){var e,t,r=E*8-S-1,o=(1<>1,i=-7,a=b?E-1:0,s=b?-1:1,f=G[h+a];for(a+=s,e=f&(1<<-i)-1,f>>=-i,i+=r;i>0;e=e*256+G[h+a],a+=s,i-=8);for(t=e&(1<<-i)-1,e>>=-i,i+=S;i>0;t=t*256+G[h+a],a+=s,i-=8);if(e===0)e=1-n;else{if(e===o)return t?NaN:(f?-1:1)*(1/0);t=t+Math.pow(2,S),e=e-n}return(f?-1:1)*t*Math.pow(2,e-S)},K.write=function(G,h,b,S,E,e){var t,r,o,n=e*8-E-1,i=(1<>1,s=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=S?0:e-1,c=S?1:-1,p=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(r=isNaN(h)?1:0,t=i):(t=Math.floor(Math.log(h)/Math.LN2),h*(o=Math.pow(2,-t))<1&&(t--,o*=2),t+a>=1?h+=s/o:h+=s*Math.pow(2,1-a),h*o>=2&&(t++,o/=2),t+a>=i?(r=0,t=i):t+a>=1?(r=(h*o-1)*Math.pow(2,E),t=t+a):(r=h*Math.pow(2,a-1)*Math.pow(2,E),t=0));E>=8;G[b+f]=r&255,f+=c,r/=256,E-=8);for(t=t<0;G[b+f]=t&255,f+=c,t/=256,n-=8);G[b+f-c]|=p*128}}}),xg=Ge({"node_modules/buffer/index.js"(K){var G=lA(),h=t3(),b=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;K.Buffer=t,K.SlowBuffer=T,K.INSPECT_MAX_BYTES=50;var S=2147483647;K.kMaxLength=S,t.TYPED_ARRAY_SUPPORT=E(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function E(){try{const Pe=new Uint8Array(1),Ae={foo:function(){return 42}};return Object.setPrototypeOf(Ae,Uint8Array.prototype),Object.setPrototypeOf(Pe,Ae),Pe.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function e(Pe){if(Pe>S)throw new RangeError('The value "'+Pe+'" is invalid for option "size"');const Ae=new Uint8Array(Pe);return Object.setPrototypeOf(Ae,t.prototype),Ae}function t(Pe,Ae,pe){if(typeof Pe=="number"){if(typeof Ae=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(Pe)}return r(Pe,Ae,pe)}t.poolSize=8192;function r(Pe,Ae,pe){if(typeof Pe=="string")return a(Pe,Ae);if(ArrayBuffer.isView(Pe))return f(Pe);if(Pe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Pe);if(Ye(Pe,ArrayBuffer)||Pe&&Ye(Pe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ye(Pe,SharedArrayBuffer)||Pe&&Ye(Pe.buffer,SharedArrayBuffer)))return c(Pe,Ae,pe);if(typeof Pe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Ne=Pe.valueOf&&Pe.valueOf();if(Ne!=null&&Ne!==Pe)return t.from(Ne,Ae,pe);const ut=p(Pe);if(ut)return ut;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Pe[Symbol.toPrimitive]=="function")return t.from(Pe[Symbol.toPrimitive]("string"),Ae,pe);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Pe)}t.from=function(Pe,Ae,pe){return r(Pe,Ae,pe)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function o(Pe){if(typeof Pe!="number")throw new TypeError('"size" argument must be of type number');if(Pe<0)throw new RangeError('The value "'+Pe+'" is invalid for option "size"')}function n(Pe,Ae,pe){return o(Pe),Pe<=0?e(Pe):Ae!==void 0?typeof pe=="string"?e(Pe).fill(Ae,pe):e(Pe).fill(Ae):e(Pe)}t.alloc=function(Pe,Ae,pe){return n(Pe,Ae,pe)};function i(Pe){return o(Pe),e(Pe<0?0:v(Pe)|0)}t.allocUnsafe=function(Pe){return i(Pe)},t.allocUnsafeSlow=function(Pe){return i(Pe)};function a(Pe,Ae){if((typeof Ae!="string"||Ae==="")&&(Ae="utf8"),!t.isEncoding(Ae))throw new TypeError("Unknown encoding: "+Ae);const pe=l(Pe,Ae)|0;let Ne=e(pe);const ut=Ne.write(Pe,Ae);return ut!==pe&&(Ne=Ne.slice(0,ut)),Ne}function s(Pe){const Ae=Pe.length<0?0:v(Pe.length)|0,pe=e(Ae);for(let Ne=0;Ne=S)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S.toString(16)+" bytes");return Pe|0}function T(Pe){return+Pe!=Pe&&(Pe=0),t.alloc(+Pe)}t.isBuffer=function(Ae){return Ae!=null&&Ae._isBuffer===!0&&Ae!==t.prototype},t.compare=function(Ae,pe){if(Ye(Ae,Uint8Array)&&(Ae=t.from(Ae,Ae.offset,Ae.byteLength)),Ye(pe,Uint8Array)&&(pe=t.from(pe,pe.offset,pe.byteLength)),!t.isBuffer(Ae)||!t.isBuffer(pe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Ae===pe)return 0;let Ne=Ae.length,ut=pe.length;for(let dt=0,nt=Math.min(Ne,ut);dtut.length?(t.isBuffer(nt)||(nt=t.from(nt)),nt.copy(ut,dt)):Uint8Array.prototype.set.call(ut,nt,dt);else if(t.isBuffer(nt))nt.copy(ut,dt);else throw new TypeError('"list" argument must be an Array of Buffers');dt+=nt.length}return ut};function l(Pe,Ae){if(t.isBuffer(Pe))return Pe.length;if(ArrayBuffer.isView(Pe)||Ye(Pe,ArrayBuffer))return Pe.byteLength;if(typeof Pe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Pe);const pe=Pe.length,Ne=arguments.length>2&&arguments[2]===!0;if(!Ne&&pe===0)return 0;let ut=!1;for(;;)switch(Ae){case"ascii":case"latin1":case"binary":return pe;case"utf8":case"utf-8":return de(Pe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe*2;case"hex":return pe>>>1;case"base64":return Fe(Pe).length;default:if(ut)return Ne?-1:de(Pe).length;Ae=(""+Ae).toLowerCase(),ut=!0}}t.byteLength=l;function g(Pe,Ae,pe){let Ne=!1;if((Ae===void 0||Ae<0)&&(Ae=0),Ae>this.length||((pe===void 0||pe>this.length)&&(pe=this.length),pe<=0)||(pe>>>=0,Ae>>>=0,pe<=Ae))return"";for(Pe||(Pe="utf8");;)switch(Pe){case"hex":return B(this,Ae,pe);case"utf8":case"utf-8":return I(this,Ae,pe);case"ascii":return F(this,Ae,pe);case"latin1":case"binary":return N(this,Ae,pe);case"base64":return y(this,Ae,pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,Ae,pe);default:if(Ne)throw new TypeError("Unknown encoding: "+Pe);Pe=(Pe+"").toLowerCase(),Ne=!0}}t.prototype._isBuffer=!0;function x(Pe,Ae,pe){const Ne=Pe[Ae];Pe[Ae]=Pe[pe],Pe[pe]=Ne}t.prototype.swap16=function(){const Ae=this.length;if(Ae%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let pe=0;pepe&&(Ae+=" ... "),""},b&&(t.prototype[b]=t.prototype.inspect),t.prototype.compare=function(Ae,pe,Ne,ut,dt){if(Ye(Ae,Uint8Array)&&(Ae=t.from(Ae,Ae.offset,Ae.byteLength)),!t.isBuffer(Ae))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Ae);if(pe===void 0&&(pe=0),Ne===void 0&&(Ne=Ae?Ae.length:0),ut===void 0&&(ut=0),dt===void 0&&(dt=this.length),pe<0||Ne>Ae.length||ut<0||dt>this.length)throw new RangeError("out of range index");if(ut>=dt&&pe>=Ne)return 0;if(ut>=dt)return-1;if(pe>=Ne)return 1;if(pe>>>=0,Ne>>>=0,ut>>>=0,dt>>>=0,this===Ae)return 0;let nt=dt-ut,Ft=Ne-pe;const Nt=Math.min(nt,Ft),Qt=this.slice(ut,dt),ar=Ae.slice(pe,Ne);for(let kr=0;kr2147483647?pe=2147483647:pe<-2147483648&&(pe=-2147483648),pe=+pe,st(pe)&&(pe=ut?0:Pe.length-1),pe<0&&(pe=Pe.length+pe),pe>=Pe.length){if(ut)return-1;pe=Pe.length-1}else if(pe<0)if(ut)pe=0;else return-1;if(typeof Ae=="string"&&(Ae=t.from(Ae,Ne)),t.isBuffer(Ae))return Ae.length===0?-1:M(Pe,Ae,pe,Ne,ut);if(typeof Ae=="number")return Ae=Ae&255,typeof Uint8Array.prototype.indexOf=="function"?ut?Uint8Array.prototype.indexOf.call(Pe,Ae,pe):Uint8Array.prototype.lastIndexOf.call(Pe,Ae,pe):M(Pe,[Ae],pe,Ne,ut);throw new TypeError("val must be string, number or Buffer")}function M(Pe,Ae,pe,Ne,ut){let dt=1,nt=Pe.length,Ft=Ae.length;if(Ne!==void 0&&(Ne=String(Ne).toLowerCase(),Ne==="ucs2"||Ne==="ucs-2"||Ne==="utf16le"||Ne==="utf-16le")){if(Pe.length<2||Ae.length<2)return-1;dt=2,nt/=2,Ft/=2,pe/=2}function Nt(ar,kr){return dt===1?ar[kr]:ar.readUInt16BE(kr*dt)}let Qt;if(ut){let ar=-1;for(Qt=pe;Qtnt&&(pe=nt-Ft),Qt=pe;Qt>=0;Qt--){let ar=!0;for(let kr=0;krut&&(Ne=ut)):Ne=ut;const dt=Ae.length;Ne>dt/2&&(Ne=dt/2);let nt;for(nt=0;nt>>0,isFinite(Ne)?(Ne=Ne>>>0,ut===void 0&&(ut="utf8")):(ut=Ne,Ne=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const dt=this.length-pe;if((Ne===void 0||Ne>dt)&&(Ne=dt),Ae.length>0&&(Ne<0||pe<0)||pe>this.length)throw new RangeError("Attempt to write outside buffer bounds");ut||(ut="utf8");let nt=!1;for(;;)switch(ut){case"hex":return _(this,Ae,pe,Ne);case"utf8":case"utf-8":return w(this,Ae,pe,Ne);case"ascii":case"latin1":case"binary":return m(this,Ae,pe,Ne);case"base64":return u(this,Ae,pe,Ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,Ae,pe,Ne);default:if(nt)throw new TypeError("Unknown encoding: "+ut);ut=(""+ut).toLowerCase(),nt=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function y(Pe,Ae,pe){return Ae===0&&pe===Pe.length?G.fromByteArray(Pe):G.fromByteArray(Pe.slice(Ae,pe))}function I(Pe,Ae,pe){pe=Math.min(Pe.length,pe);const Ne=[];let ut=Ae;for(;ut239?4:dt>223?3:dt>191?2:1;if(ut+Ft<=pe){let Nt,Qt,ar,kr;switch(Ft){case 1:dt<128&&(nt=dt);break;case 2:Nt=Pe[ut+1],(Nt&192)===128&&(kr=(dt&31)<<6|Nt&63,kr>127&&(nt=kr));break;case 3:Nt=Pe[ut+1],Qt=Pe[ut+2],(Nt&192)===128&&(Qt&192)===128&&(kr=(dt&15)<<12|(Nt&63)<<6|Qt&63,kr>2047&&(kr<55296||kr>57343)&&(nt=kr));break;case 4:Nt=Pe[ut+1],Qt=Pe[ut+2],ar=Pe[ut+3],(Nt&192)===128&&(Qt&192)===128&&(ar&192)===128&&(kr=(dt&15)<<18|(Nt&63)<<12|(Qt&63)<<6|ar&63,kr>65535&&kr<1114112&&(nt=kr))}}nt===null?(nt=65533,Ft=1):nt>65535&&(nt-=65536,Ne.push(nt>>>10&1023|55296),nt=56320|nt&1023),Ne.push(nt),ut+=Ft}return z(Ne)}var L=4096;function z(Pe){const Ae=Pe.length;if(Ae<=L)return String.fromCharCode.apply(String,Pe);let pe="",Ne=0;for(;NeNe)&&(pe=Ne);let ut="";for(let dt=Ae;dtNe&&(Ae=Ne),pe<0?(pe+=Ne,pe<0&&(pe=0)):pe>Ne&&(pe=Ne),pepe)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(Ae,pe,Ne){Ae=Ae>>>0,pe=pe>>>0,Ne||U(Ae,pe,this.length);let ut=this[Ae],dt=1,nt=0;for(;++nt>>0,pe=pe>>>0,Ne||U(Ae,pe,this.length);let ut=this[Ae+--pe],dt=1;for(;pe>0&&(dt*=256);)ut+=this[Ae+--pe]*dt;return ut},t.prototype.readUint8=t.prototype.readUInt8=function(Ae,pe){return Ae=Ae>>>0,pe||U(Ae,1,this.length),this[Ae]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(Ae,pe){return Ae=Ae>>>0,pe||U(Ae,2,this.length),this[Ae]|this[Ae+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(Ae,pe){return Ae=Ae>>>0,pe||U(Ae,2,this.length),this[Ae]<<8|this[Ae+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(Ae,pe){return Ae=Ae>>>0,pe||U(Ae,4,this.length),(this[Ae]|this[Ae+1]<<8|this[Ae+2]<<16)+this[Ae+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(Ae,pe){return Ae=Ae>>>0,pe||U(Ae,4,this.length),this[Ae]*16777216+(this[Ae+1]<<16|this[Ae+2]<<8|this[Ae+3])},t.prototype.readBigUInt64LE=at(function(Ae){Ae=Ae>>>0,te(Ae,"offset");const pe=this[Ae],Ne=this[Ae+7];(pe===void 0||Ne===void 0)&&H(Ae,this.length-8);const ut=pe+this[++Ae]*2**8+this[++Ae]*2**16+this[++Ae]*2**24,dt=this[++Ae]+this[++Ae]*2**8+this[++Ae]*2**16+Ne*2**24;return BigInt(ut)+(BigInt(dt)<>>0,te(Ae,"offset");const pe=this[Ae],Ne=this[Ae+7];(pe===void 0||Ne===void 0)&&H(Ae,this.length-8);const ut=pe*2**24+this[++Ae]*2**16+this[++Ae]*2**8+this[++Ae],dt=this[++Ae]*2**24+this[++Ae]*2**16+this[++Ae]*2**8+Ne;return(BigInt(ut)<>>0,pe=pe>>>0,Ne||U(Ae,pe,this.length);let ut=this[Ae],dt=1,nt=0;for(;++nt=dt&&(ut-=Math.pow(2,8*pe)),ut},t.prototype.readIntBE=function(Ae,pe,Ne){Ae=Ae>>>0,pe=pe>>>0,Ne||U(Ae,pe,this.length);let ut=pe,dt=1,nt=this[Ae+--ut];for(;ut>0&&(dt*=256);)nt+=this[Ae+--ut]*dt;return dt*=128,nt>=dt&&(nt-=Math.pow(2,8*pe)),nt},t.prototype.readInt8=function(Ae,pe){return Ae=Ae>>>0,pe||U(Ae,1,this.length),this[Ae]&128?(255-this[Ae]+1)*-1:this[Ae]},t.prototype.readInt16LE=function(Ae,pe){Ae=Ae>>>0,pe||U(Ae,2,this.length);const Ne=this[Ae]|this[Ae+1]<<8;return Ne&32768?Ne|4294901760:Ne},t.prototype.readInt16BE=function(Ae,pe){Ae=Ae>>>0,pe||U(Ae,2,this.length);const Ne=this[Ae+1]|this[Ae]<<8;return Ne&32768?Ne|4294901760:Ne},t.prototype.readInt32LE=function(Ae,pe){return Ae=Ae>>>0,pe||U(Ae,4,this.length),this[Ae]|this[Ae+1]<<8|this[Ae+2]<<16|this[Ae+3]<<24},t.prototype.readInt32BE=function(Ae,pe){return Ae=Ae>>>0,pe||U(Ae,4,this.length),this[Ae]<<24|this[Ae+1]<<16|this[Ae+2]<<8|this[Ae+3]},t.prototype.readBigInt64LE=at(function(Ae){Ae=Ae>>>0,te(Ae,"offset");const pe=this[Ae],Ne=this[Ae+7];(pe===void 0||Ne===void 0)&&H(Ae,this.length-8);const ut=this[Ae+4]+this[Ae+5]*2**8+this[Ae+6]*2**16+(Ne<<24);return(BigInt(ut)<>>0,te(Ae,"offset");const pe=this[Ae],Ne=this[Ae+7];(pe===void 0||Ne===void 0)&&H(Ae,this.length-8);const ut=(pe<<24)+this[++Ae]*2**16+this[++Ae]*2**8+this[++Ae];return(BigInt(ut)<>>0,pe||U(Ae,4,this.length),h.read(this,Ae,!0,23,4)},t.prototype.readFloatBE=function(Ae,pe){return Ae=Ae>>>0,pe||U(Ae,4,this.length),h.read(this,Ae,!1,23,4)},t.prototype.readDoubleLE=function(Ae,pe){return Ae=Ae>>>0,pe||U(Ae,8,this.length),h.read(this,Ae,!0,52,8)},t.prototype.readDoubleBE=function(Ae,pe){return Ae=Ae>>>0,pe||U(Ae,8,this.length),h.read(this,Ae,!1,52,8)};function j(Pe,Ae,pe,Ne,ut,dt){if(!t.isBuffer(Pe))throw new TypeError('"buffer" argument must be a Buffer instance');if(Ae>ut||AePe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(Ae,pe,Ne,ut){if(Ae=+Ae,pe=pe>>>0,Ne=Ne>>>0,!ut){const Ft=Math.pow(2,8*Ne)-1;j(this,Ae,pe,Ne,Ft,0)}let dt=1,nt=0;for(this[pe]=Ae&255;++nt>>0,Ne=Ne>>>0,!ut){const Ft=Math.pow(2,8*Ne)-1;j(this,Ae,pe,Ne,Ft,0)}let dt=Ne-1,nt=1;for(this[pe+dt]=Ae&255;--dt>=0&&(nt*=256);)this[pe+dt]=Ae/nt&255;return pe+Ne},t.prototype.writeUint8=t.prototype.writeUInt8=function(Ae,pe,Ne){return Ae=+Ae,pe=pe>>>0,Ne||j(this,Ae,pe,1,255,0),this[pe]=Ae&255,pe+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(Ae,pe,Ne){return Ae=+Ae,pe=pe>>>0,Ne||j(this,Ae,pe,2,65535,0),this[pe]=Ae&255,this[pe+1]=Ae>>>8,pe+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(Ae,pe,Ne){return Ae=+Ae,pe=pe>>>0,Ne||j(this,Ae,pe,2,65535,0),this[pe]=Ae>>>8,this[pe+1]=Ae&255,pe+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(Ae,pe,Ne){return Ae=+Ae,pe=pe>>>0,Ne||j(this,Ae,pe,4,4294967295,0),this[pe+3]=Ae>>>24,this[pe+2]=Ae>>>16,this[pe+1]=Ae>>>8,this[pe]=Ae&255,pe+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(Ae,pe,Ne){return Ae=+Ae,pe=pe>>>0,Ne||j(this,Ae,pe,4,4294967295,0),this[pe]=Ae>>>24,this[pe+1]=Ae>>>16,this[pe+2]=Ae>>>8,this[pe+3]=Ae&255,pe+4};function Z(Pe,Ae,pe,Ne,ut){ue(Ae,Ne,ut,Pe,pe,7);let dt=Number(Ae&BigInt(4294967295));Pe[pe++]=dt,dt=dt>>8,Pe[pe++]=dt,dt=dt>>8,Pe[pe++]=dt,dt=dt>>8,Pe[pe++]=dt;let nt=Number(Ae>>BigInt(32)&BigInt(4294967295));return Pe[pe++]=nt,nt=nt>>8,Pe[pe++]=nt,nt=nt>>8,Pe[pe++]=nt,nt=nt>>8,Pe[pe++]=nt,pe}function re(Pe,Ae,pe,Ne,ut){ue(Ae,Ne,ut,Pe,pe,7);let dt=Number(Ae&BigInt(4294967295));Pe[pe+7]=dt,dt=dt>>8,Pe[pe+6]=dt,dt=dt>>8,Pe[pe+5]=dt,dt=dt>>8,Pe[pe+4]=dt;let nt=Number(Ae>>BigInt(32)&BigInt(4294967295));return Pe[pe+3]=nt,nt=nt>>8,Pe[pe+2]=nt,nt=nt>>8,Pe[pe+1]=nt,nt=nt>>8,Pe[pe]=nt,pe+8}t.prototype.writeBigUInt64LE=at(function(Ae,pe=0){return Z(this,Ae,pe,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=at(function(Ae,pe=0){return re(this,Ae,pe,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(Ae,pe,Ne,ut){if(Ae=+Ae,pe=pe>>>0,!ut){const Nt=Math.pow(2,8*Ne-1);j(this,Ae,pe,Ne,Nt-1,-Nt)}let dt=0,nt=1,Ft=0;for(this[pe]=Ae&255;++dt>0)-Ft&255;return pe+Ne},t.prototype.writeIntBE=function(Ae,pe,Ne,ut){if(Ae=+Ae,pe=pe>>>0,!ut){const Nt=Math.pow(2,8*Ne-1);j(this,Ae,pe,Ne,Nt-1,-Nt)}let dt=Ne-1,nt=1,Ft=0;for(this[pe+dt]=Ae&255;--dt>=0&&(nt*=256);)Ae<0&&Ft===0&&this[pe+dt+1]!==0&&(Ft=1),this[pe+dt]=(Ae/nt>>0)-Ft&255;return pe+Ne},t.prototype.writeInt8=function(Ae,pe,Ne){return Ae=+Ae,pe=pe>>>0,Ne||j(this,Ae,pe,1,127,-128),Ae<0&&(Ae=255+Ae+1),this[pe]=Ae&255,pe+1},t.prototype.writeInt16LE=function(Ae,pe,Ne){return Ae=+Ae,pe=pe>>>0,Ne||j(this,Ae,pe,2,32767,-32768),this[pe]=Ae&255,this[pe+1]=Ae>>>8,pe+2},t.prototype.writeInt16BE=function(Ae,pe,Ne){return Ae=+Ae,pe=pe>>>0,Ne||j(this,Ae,pe,2,32767,-32768),this[pe]=Ae>>>8,this[pe+1]=Ae&255,pe+2},t.prototype.writeInt32LE=function(Ae,pe,Ne){return Ae=+Ae,pe=pe>>>0,Ne||j(this,Ae,pe,4,2147483647,-2147483648),this[pe]=Ae&255,this[pe+1]=Ae>>>8,this[pe+2]=Ae>>>16,this[pe+3]=Ae>>>24,pe+4},t.prototype.writeInt32BE=function(Ae,pe,Ne){return Ae=+Ae,pe=pe>>>0,Ne||j(this,Ae,pe,4,2147483647,-2147483648),Ae<0&&(Ae=4294967295+Ae+1),this[pe]=Ae>>>24,this[pe+1]=Ae>>>16,this[pe+2]=Ae>>>8,this[pe+3]=Ae&255,pe+4},t.prototype.writeBigInt64LE=at(function(Ae,pe=0){return Z(this,Ae,pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=at(function(Ae,pe=0){return re(this,Ae,pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function fe(Pe,Ae,pe,Ne,ut,dt){if(pe+Ne>Pe.length)throw new RangeError("Index out of range");if(pe<0)throw new RangeError("Index out of range")}function le(Pe,Ae,pe,Ne,ut){return Ae=+Ae,pe=pe>>>0,ut||fe(Pe,Ae,pe,4),h.write(Pe,Ae,pe,Ne,23,4),pe+4}t.prototype.writeFloatLE=function(Ae,pe,Ne){return le(this,Ae,pe,!0,Ne)},t.prototype.writeFloatBE=function(Ae,pe,Ne){return le(this,Ae,pe,!1,Ne)};function ce(Pe,Ae,pe,Ne,ut){return Ae=+Ae,pe=pe>>>0,ut||fe(Pe,Ae,pe,8),h.write(Pe,Ae,pe,Ne,52,8),pe+8}t.prototype.writeDoubleLE=function(Ae,pe,Ne){return ce(this,Ae,pe,!0,Ne)},t.prototype.writeDoubleBE=function(Ae,pe,Ne){return ce(this,Ae,pe,!1,Ne)},t.prototype.copy=function(Ae,pe,Ne,ut){if(!t.isBuffer(Ae))throw new TypeError("argument should be a Buffer");if(Ne||(Ne=0),!ut&&ut!==0&&(ut=this.length),pe>=Ae.length&&(pe=Ae.length),pe||(pe=0),ut>0&&ut=this.length)throw new RangeError("Index out of range");if(ut<0)throw new RangeError("sourceEnd out of bounds");ut>this.length&&(ut=this.length),Ae.length-pe>>0,Ne=Ne===void 0?this.length:Ne>>>0,Ae||(Ae=0);let dt;if(typeof Ae=="number")for(dt=pe;dt2**32?ut=ne(String(pe)):typeof pe=="bigint"&&(ut=String(pe),(pe>BigInt(2)**BigInt(32)||pe<-(BigInt(2)**BigInt(32)))&&(ut=ne(ut)),ut+="n"),Ne+=` It must be ${Ae}. Received ${ut}`,Ne},RangeError);function ne(Pe){let Ae="",pe=Pe.length;const Ne=Pe[0]==="-"?1:0;for(;pe>=Ne+4;pe-=3)Ae=`_${Pe.slice(pe-3,pe)}${Ae}`;return`${Pe.slice(0,pe)}${Ae}`}function $(Pe,Ae,pe){te(Ae,"offset"),(Pe[Ae]===void 0||Pe[Ae+pe]===void 0)&&H(Ae,Pe.length-(pe+1))}function ue(Pe,Ae,pe,Ne,ut,dt){if(Pe>pe||Pe= 0${nt} and < 2${nt} ** ${(dt+1)*8}${nt}`:Ft=`>= -(2${nt} ** ${(dt+1)*8-1}${nt}) and < 2 ** ${(dt+1)*8-1}${nt}`,new V.ERR_OUT_OF_RANGE("value",Ft,Pe)}$(Ne,ut,dt)}function te(Pe,Ae){if(typeof Pe!="number")throw new V.ERR_INVALID_ARG_TYPE(Ae,"number",Pe)}function H(Pe,Ae,pe){throw Math.floor(Pe)!==Pe?(te(Pe,pe),new V.ERR_OUT_OF_RANGE("offset","an integer",Pe)):Ae<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Ae}`,Pe)}var ae=/[^+/0-9A-Za-z-_]/g;function ie(Pe){if(Pe=Pe.split("=")[0],Pe=Pe.trim().replace(ae,""),Pe.length<2)return"";for(;Pe.length%4!==0;)Pe=Pe+"=";return Pe}function de(Pe,Ae){Ae=Ae||1/0;let pe;const Ne=Pe.length;let ut=null;const dt=[];for(let nt=0;nt55295&&pe<57344){if(!ut){if(pe>56319){(Ae-=3)>-1&&dt.push(239,191,189);continue}else if(nt+1===Ne){(Ae-=3)>-1&&dt.push(239,191,189);continue}ut=pe;continue}if(pe<56320){(Ae-=3)>-1&&dt.push(239,191,189),ut=pe;continue}pe=(ut-55296<<10|pe-56320)+65536}else ut&&(Ae-=3)>-1&&dt.push(239,191,189);if(ut=null,pe<128){if((Ae-=1)<0)break;dt.push(pe)}else if(pe<2048){if((Ae-=2)<0)break;dt.push(pe>>6|192,pe&63|128)}else if(pe<65536){if((Ae-=3)<0)break;dt.push(pe>>12|224,pe>>6&63|128,pe&63|128)}else if(pe<1114112){if((Ae-=4)<0)break;dt.push(pe>>18|240,pe>>12&63|128,pe>>6&63|128,pe&63|128)}else throw new Error("Invalid code point")}return dt}function Se(Pe){const Ae=[];for(let pe=0;pe>8,ut=pe%256,dt.push(ut),dt.push(Ne);return dt}function Fe(Pe){return G.toByteArray(ie(Pe))}function ze(Pe,Ae,pe,Ne){let ut;for(ut=0;ut=Ae.length||ut>=Pe.length);++ut)Ae[ut+pe]=Pe[ut];return ut}function Ye(Pe,Ae){return Pe instanceof Ae||Pe!=null&&Pe.constructor!=null&&Pe.constructor.name!=null&&Pe.constructor.name===Ae.name}function st(Pe){return Pe!==Pe}var ct=(function(){const Pe="0123456789abcdef",Ae=new Array(256);for(let pe=0;pe<16;++pe){const Ne=pe*16;for(let ut=0;ut<16;++ut)Ae[Ne+ut]=Pe[pe]+Pe[ut]}return Ae})();function at(Pe){return typeof BigInt>"u"?et:Pe}function et(){throw new Error("BigInt not supported")}}}),r_=Ge({"node_modules/has-symbols/shams.js"(K,G){G.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var b={},S=Symbol("test"),E=Object(S);if(typeof S=="string"||Object.prototype.toString.call(S)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var e=42;b[S]=e;for(var t in b)return!1;if(typeof Object.keys=="function"&&Object.keys(b).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(b).length!==0)return!1;var r=Object.getOwnPropertySymbols(b);if(r.length!==1||r[0]!==S||!Object.prototype.propertyIsEnumerable.call(b,S))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(b,S);if(o.value!==e||o.enumerable!==!0)return!1}return!0}}}),wy=Ge({"node_modules/has-tostringtag/shams.js"(K,G){var h=r_();G.exports=function(){return h()&&!!Symbol.toStringTag}}}),n_=Ge({"node_modules/es-object-atoms/index.js"(K,G){G.exports=Object}}),uA=Ge({"node_modules/es-errors/index.js"(K,G){G.exports=Error}}),H0=Ge({"node_modules/es-errors/eval.js"(K,G){G.exports=EvalError}}),ld=Ge({"node_modules/es-errors/range.js"(K,G){G.exports=RangeError}}),r3=Ge({"node_modules/es-errors/ref.js"(K,G){G.exports=ReferenceError}}),n3=Ge({"node_modules/es-errors/syntax.js"(K,G){G.exports=SyntaxError}}),Rh=Ge({"node_modules/es-errors/type.js"(K,G){G.exports=TypeError}}),aE=Ge({"node_modules/es-errors/uri.js"(K,G){G.exports=URIError}}),cA=Ge({"node_modules/math-intrinsics/abs.js"(K,G){G.exports=Math.abs}}),fA=Ge({"node_modules/math-intrinsics/floor.js"(K,G){G.exports=Math.floor}}),lh=Ge({"node_modules/math-intrinsics/max.js"(K,G){G.exports=Math.max}}),zv=Ge({"node_modules/math-intrinsics/min.js"(K,G){G.exports=Math.min}}),G0=Ge({"node_modules/math-intrinsics/pow.js"(K,G){G.exports=Math.pow}}),hA=Ge({"node_modules/math-intrinsics/round.js"(K,G){G.exports=Math.round}}),dA=Ge({"node_modules/math-intrinsics/isNaN.js"(K,G){G.exports=Number.isNaN||function(b){return b!==b}}}),vA=Ge({"node_modules/math-intrinsics/sign.js"(K,G){var h=dA();G.exports=function(S){return h(S)||S===0?S:S<0?-1:1}}}),iE=Ge({"node_modules/gopd/gOPD.js"(K,G){G.exports=Object.getOwnPropertyDescriptor}}),X0=Ge({"node_modules/gopd/index.js"(K,G){var h=iE();if(h)try{h([],"length")}catch{h=null}G.exports=h}}),ev=Ge({"node_modules/es-define-property/index.js"(K,G){var h=Object.defineProperty||!1;if(h)try{h({},"a",{value:1})}catch{h=!1}G.exports=h}}),$p=Ge({"node_modules/has-symbols/index.js"(K,G){var h=typeof Symbol<"u"&&Symbol,b=r_();G.exports=function(){return typeof h!="function"||typeof Symbol!="function"||typeof h("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:b()}}}),a3=Ge({"node_modules/get-proto/Reflect.getPrototypeOf.js"(K,G){G.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),Tv=Ge({"node_modules/get-proto/Object.getPrototypeOf.js"(K,G){var h=n_();G.exports=h.getPrototypeOf||null}}),pA=Ge({"node_modules/function-bind/implementation.js"(K,G){var h="Function.prototype.bind called on incompatible ",b=Object.prototype.toString,S=Math.max,E="[object Function]",e=function(n,i){for(var a=[],s=0;s"u"||!w?h:w(Uint8Array),z={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?h:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?h:ArrayBuffer,"%ArrayIteratorPrototype%":_&&w?w([][Symbol.iterator]()):h,"%AsyncFromSyncIteratorPrototype%":h,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":typeof Atomics>"u"?h:Atomics,"%BigInt%":typeof BigInt>"u"?h:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?h:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?h:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?h:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":S,"%eval%":eval,"%EvalError%":E,"%Float16Array%":typeof Float16Array>"u"?h:Float16Array,"%Float32Array%":typeof Float32Array>"u"?h:Float32Array,"%Float64Array%":typeof Float64Array>"u"?h:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?h:FinalizationRegistry,"%Function%":T,"%GeneratorFunction%":I,"%Int8Array%":typeof Int8Array>"u"?h:Int8Array,"%Int16Array%":typeof Int16Array>"u"?h:Int16Array,"%Int32Array%":typeof Int32Array>"u"?h:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_&&w?w(w([][Symbol.iterator]())):h,"%JSON%":typeof JSON=="object"?JSON:h,"%Map%":typeof Map>"u"?h:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_||!w?h:w(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":b,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?h:Promise,"%Proxy%":typeof Proxy>"u"?h:Proxy,"%RangeError%":e,"%ReferenceError%":t,"%Reflect%":typeof Reflect>"u"?h:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?h:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_||!w?h:w(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?h:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_&&w?w(""[Symbol.iterator]()):h,"%Symbol%":_?Symbol:h,"%SyntaxError%":r,"%ThrowTypeError%":M,"%TypedArray%":L,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?h:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?h:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?h:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?h:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?h:WeakMap,"%WeakRef%":typeof WeakRef>"u"?h:WeakRef,"%WeakSet%":typeof WeakSet>"u"?h:WeakSet,"%Function.prototype.call%":y,"%Function.prototype.apply%":d,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":m,"%Math.abs%":i,"%Math.floor%":a,"%Math.max%":s,"%Math.min%":f,"%Math.pow%":c,"%Math.round%":p,"%Math.sign%":v,"%Reflect.getPrototypeOf%":u};if(w)try{null.error}catch($){F=w(w($)),z["%Error.prototype%"]=F}var F,N=function $(ue){var te;if(ue==="%AsyncFunction%")te=l("async function () {}");else if(ue==="%GeneratorFunction%")te=l("function* () {}");else if(ue==="%AsyncGeneratorFunction%")te=l("async function* () {}");else if(ue==="%AsyncGenerator%"){var H=$("%AsyncGeneratorFunction%");H&&(te=H.prototype)}else if(ue==="%AsyncIteratorPrototype%"){var ae=$("%AsyncGenerator%");ae&&w&&(te=w(ae.prototype))}return z[ue]=te,te},B={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=fp(),U=a_(),j=R.call(y,Array.prototype.concat),Z=R.call(d,Array.prototype.splice),re=R.call(y,String.prototype.replace),fe=R.call(y,String.prototype.slice),le=R.call(y,RegExp.prototype.exec),ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,ee=function(ue){var te=fe(ue,0,1),H=fe(ue,-1);if(te==="%"&&H!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(H==="%"&&te!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var ae=[];return re(ue,ce,function(ie,de,Se,Le){ae[ae.length]=Se?re(Le,V,"$1"):de||ie}),ae},ne=function(ue,te){var H=ue,ae;if(U(B,H)&&(ae=B[H],H="%"+ae[0]+"%"),U(z,H)){var ie=z[H];if(ie===I&&(ie=N(H)),typeof ie>"u"&&!te)throw new o("intrinsic "+ue+" exists, but is not available. Please file an issue!");return{alias:ae,name:H,value:ie}}throw new r("intrinsic "+ue+" does not exist!")};G.exports=function(ue,te){if(typeof ue!="string"||ue.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof te!="boolean")throw new o('"allowMissing" argument must be a boolean');if(le(/^%?[^%]*%?$/,ue)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var H=ee(ue),ae=H.length>0?H[0]:"",ie=ne("%"+ae+"%",te),de=ie.name,Se=ie.value,Le=!1,Fe=ie.alias;Fe&&(ae=Fe[0],Z(H,j([0,1],Fe)));for(var ze=1,Ye=!0;ze=H.length){var et=g(Se,st);Ye=!!et,Ye&&"get"in et&&!("originalValue"in et.get)?Se=et.get:Se=Se[st]}else Ye=U(Se,st),Se=Se[st];Ye&&!Le&&(z[de]=Se)}}return Se}}}),Ay=Ge({"node_modules/define-data-property/index.js"(K,G){var h=ev(),b=n3(),S=Rh(),E=X0();G.exports=function(t,r,o){if(!t||typeof t!="object"&&typeof t!="function")throw new S("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new S("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new S("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new S("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new S("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new S("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,f=!!E&&E(t,r);if(h)h(t,r,{configurable:a===null&&f?f.configurable:!a,enumerable:n===null&&f?f.enumerable:!n,value:o,writable:i===null&&f?f.writable:!i});else if(s||!n&&!i&&!a)t[r]=o;else throw new b("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),s3=Ge({"node_modules/has-property-descriptors/index.js"(K,G){var h=ev(),b=function(){return!!h};b.hasArrayLengthDefineBug=function(){if(!h)return null;try{return h([],"length",{value:1}).length!==1}catch{return!0}},G.exports=b}}),gA=Ge({"node_modules/set-function-length/index.js"(K,G){var h=bg(),b=Ay(),S=s3()(),E=X0(),e=Rh(),t=h("%Math.floor%");G.exports=function(o,n){if(typeof o!="function")throw new e("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||t(n)!==n)throw new e("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],a=!0,s=!0;if("length"in o&&E){var f=E(o,"length");f&&!f.configurable&&(a=!1),f&&!f.writable&&(s=!1)}return(a||s||!i)&&(S?b(o,"length",n,!0,!0):b(o,"length",n)),o}}}),Mm=Ge({"node_modules/call-bind/index.js"(K,G){var h=fp(),b=bg(),S=gA(),E=Rh(),e=b("%Function.prototype.apply%"),t=b("%Function.prototype.call%"),r=b("%Reflect.apply%",!0)||h.call(t,e),o=ev(),n=b("%Math.max%");G.exports=function(s){if(typeof s!="function")throw new E("a function is required");var f=r(h,t,arguments);return S(f,1+n(0,s.length-(arguments.length-1)),!0)};var i=function(){return r(h,e,arguments)};o?o(G.exports,"apply",{value:i}):G.exports.apply=i}}),Sy=Ge({"node_modules/call-bind/callBound.js"(K,G){var h=bg(),b=Mm(),S=b(h("String.prototype.indexOf"));G.exports=function(e,t){var r=h(e,!!t);return typeof r=="function"&&S(e,".prototype.")>-1?b(r):r}}}),db=Ge({"node_modules/is-arguments/index.js"(K,G){var h=wy()(),b=Sy(),S=b("Object.prototype.toString"),E=function(o){return h&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:S(o)==="[object Arguments]"},e=function(o){return E(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&S(o)!=="[object Array]"&&S(o.callee)==="[object Function]"},t=(function(){return E(arguments)})();E.isLegacyArguments=e,G.exports=t?E:e}}),yA=Ge({"node_modules/is-generator-function/index.js"(K,G){var h=Object.prototype.toString,b=Function.prototype.toString,S=/^\s*(?:function)?\*/,E=wy()(),e=Object.getPrototypeOf,t=function(){if(!E)return!1;try{return Function("return function*() {}")()}catch{}},r;G.exports=function(n){if(typeof n!="function")return!1;if(S.test(b.call(n)))return!0;if(!E){var i=h.call(n);return i==="[object GeneratorFunction]"}if(!e)return!1;if(typeof r>"u"){var a=t();r=a?e(a):!1}return e(n)===r}}}),oE=Ge({"node_modules/is-callable/index.js"(K,G){var h=Function.prototype.toString,b=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,S,E;if(typeof b=="function"&&typeof Object.defineProperty=="function")try{S=Object.defineProperty({},"length",{get:function(){throw E}}),E={},b(function(){throw 42},null,S)}catch(g){g!==E&&(b=null)}else b=null;var e=/^\s*class\b/,t=function(x){try{var A=h.call(x);return e.test(A)}catch{return!1}},r=function(x){try{return t(x)?!1:(h.call(x),!0)}catch{return!1}},o=Object.prototype.toString,n="[object Object]",i="[object Function]",a="[object GeneratorFunction]",s="[object HTMLAllCollection]",f="[object HTML document.all class]",c="[object HTMLCollection]",p=typeof Symbol=="function"&&!!Symbol.toStringTag,v=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(l=document.all,o.call(l)===o.call(document.all)&&(T=function(x){if((v||!x)&&(typeof x>"u"||typeof x=="object"))try{var A=o.call(x);return(A===s||A===f||A===c||A===n)&&x("")==null}catch{}return!1}));var l;G.exports=b?function(x){if(T(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;try{b(x,null,S)}catch(A){if(A!==E)return!1}return!t(x)&&r(x)}:function(x){if(T(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;if(p)return r(x);if(t(x))return!1;var A=o.call(x);return A!==i&&A!==a&&!/^\[object HTML/.test(A)?!1:r(x)}}}),_A=Ge({"node_modules/for-each/index.js"(K,G){var h=oE(),b=Object.prototype.toString,S=Object.prototype.hasOwnProperty,E=function(n,i,a){for(var s=0,f=n.length;s=3&&(s=a),b.call(n)==="[object Array]"?E(n,i,s):typeof n=="string"?e(n,i,s):t(n,i,s)};G.exports=r}}),Pc=Ge({"node_modules/available-typed-arrays/index.js"(K,G){var h=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],b=typeof globalThis>"u"?window:globalThis;G.exports=function(){for(var E=[],e=0;e"u"?window:globalThis,n=b(),i=E("String.prototype.slice"),a=Object.getPrototypeOf,s=E("Array.prototype.indexOf",!0)||function(T,l){for(var g=0;g-1?l:l!=="Object"?!1:p(T)}return e?c(T):null}}}),ac=Ge({"node_modules/is-typed-array/index.js"(K,G){var h=_A(),b=Pc(),S=Sy(),E=S("Object.prototype.toString"),e=wy()(),t=X0(),r=typeof globalThis>"u"?window:globalThis,o=b(),n=S("Array.prototype.indexOf",!0)||function(p,v){for(var T=0;T-1}return t?f(p):!1}}}),ic=Ge({"node_modules/util/support/types.js"(K){var G=db(),h=yA(),b=Of(),S=ac();function E(Le){return Le.call.bind(Le)}var e=typeof BigInt<"u",t=typeof Symbol<"u",r=E(Object.prototype.toString),o=E(Number.prototype.valueOf),n=E(String.prototype.valueOf),i=E(Boolean.prototype.valueOf);e&&(a=E(BigInt.prototype.valueOf));var a;t&&(s=E(Symbol.prototype.valueOf));var s;function f(Le,Fe){if(typeof Le!="object")return!1;try{return Fe(Le),!0}catch{return!1}}K.isArgumentsObject=G,K.isGeneratorFunction=h,K.isTypedArray=S;function c(Le){return typeof Promise<"u"&&Le instanceof Promise||Le!==null&&typeof Le=="object"&&typeof Le.then=="function"&&typeof Le.catch=="function"}K.isPromise=c;function p(Le){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Le):S(Le)||Z(Le)}K.isArrayBufferView=p;function v(Le){return b(Le)==="Uint8Array"}K.isUint8Array=v;function T(Le){return b(Le)==="Uint8ClampedArray"}K.isUint8ClampedArray=T;function l(Le){return b(Le)==="Uint16Array"}K.isUint16Array=l;function g(Le){return b(Le)==="Uint32Array"}K.isUint32Array=g;function x(Le){return b(Le)==="Int8Array"}K.isInt8Array=x;function A(Le){return b(Le)==="Int16Array"}K.isInt16Array=A;function M(Le){return b(Le)==="Int32Array"}K.isInt32Array=M;function _(Le){return b(Le)==="Float32Array"}K.isFloat32Array=_;function w(Le){return b(Le)==="Float64Array"}K.isFloat64Array=w;function m(Le){return b(Le)==="BigInt64Array"}K.isBigInt64Array=m;function u(Le){return b(Le)==="BigUint64Array"}K.isBigUint64Array=u;function d(Le){return r(Le)==="[object Map]"}d.working=typeof Map<"u"&&d(new Map);function y(Le){return typeof Map>"u"?!1:d.working?d(Le):Le instanceof Map}K.isMap=y;function I(Le){return r(Le)==="[object Set]"}I.working=typeof Set<"u"&&I(new Set);function L(Le){return typeof Set>"u"?!1:I.working?I(Le):Le instanceof Set}K.isSet=L;function z(Le){return r(Le)==="[object WeakMap]"}z.working=typeof WeakMap<"u"&&z(new WeakMap);function F(Le){return typeof WeakMap>"u"?!1:z.working?z(Le):Le instanceof WeakMap}K.isWeakMap=F;function N(Le){return r(Le)==="[object WeakSet]"}N.working=typeof WeakSet<"u"&&N(new WeakSet);function B(Le){return N(Le)}K.isWeakSet=B;function R(Le){return r(Le)==="[object ArrayBuffer]"}R.working=typeof ArrayBuffer<"u"&&R(new ArrayBuffer);function U(Le){return typeof ArrayBuffer>"u"?!1:R.working?R(Le):Le instanceof ArrayBuffer}K.isArrayBuffer=U;function j(Le){return r(Le)==="[object DataView]"}j.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&j(new DataView(new ArrayBuffer(1),0,1));function Z(Le){return typeof DataView>"u"?!1:j.working?j(Le):Le instanceof DataView}K.isDataView=Z;var re=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function fe(Le){return r(Le)==="[object SharedArrayBuffer]"}function le(Le){return typeof re>"u"?!1:(typeof fe.working>"u"&&(fe.working=fe(new re)),fe.working?fe(Le):Le instanceof re)}K.isSharedArrayBuffer=le;function ce(Le){return r(Le)==="[object AsyncFunction]"}K.isAsyncFunction=ce;function V(Le){return r(Le)==="[object Map Iterator]"}K.isMapIterator=V;function ee(Le){return r(Le)==="[object Set Iterator]"}K.isSetIterator=ee;function ne(Le){return r(Le)==="[object Generator]"}K.isGeneratorObject=ne;function $(Le){return r(Le)==="[object WebAssembly.Module]"}K.isWebAssemblyCompiledModule=$;function ue(Le){return f(Le,o)}K.isNumberObject=ue;function te(Le){return f(Le,n)}K.isStringObject=te;function H(Le){return f(Le,i)}K.isBooleanObject=H;function ae(Le){return e&&f(Le,a)}K.isBigIntObject=ae;function ie(Le){return t&&f(Le,s)}K.isSymbolObject=ie;function de(Le){return ue(Le)||te(Le)||H(Le)||ae(Le)||ie(Le)}K.isBoxedPrimitive=de;function Se(Le){return typeof Uint8Array<"u"&&(U(Le)||le(Le))}K.isAnyArrayBuffer=Se,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Le){Object.defineProperty(K,Le,{enumerable:!1,value:function(){throw new Error(Le+" is not supported in userland")}})})}}),tf=Ge({"node_modules/util/support/isBufferBrowser.js"(K,G){G.exports=function(b){return b&&typeof b=="object"&&typeof b.copy=="function"&&typeof b.fill=="function"&&typeof b.readUInt8=="function"}}}),Ov=Ge({"(disabled):node_modules/util/util.js"(K){var G=Object.getOwnPropertyDescriptors||function(Z){for(var re=Object.keys(Z),fe={},le=0;le=le)return ee;switch(ee){case"%s":return String(fe[re++]);case"%d":return Number(fe[re++]);case"%j":try{return JSON.stringify(fe[re++])}catch{return"[Circular]"}default:return ee}}),V=fe[re];re"u")return function(){return K.deprecate(j,Z).apply(this,arguments)};var re=!1;function fe(){if(!re){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),re=!0}return j.apply(this,arguments)}return fe};var b={},S=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),S=new RegExp("^"+E+"$","i");var E;K.debuglog=function(j){if(j=j.toUpperCase(),!b[j])if(S.test(j)){var Z=process.pid;b[j]=function(){var re=K.format.apply(K,arguments);console.error("%s %d: %s",j,Z,re)}}else b[j]=function(){};return b[j]};function e(j,Z){var re={seen:[],stylize:r};return arguments.length>=3&&(re.depth=arguments[2]),arguments.length>=4&&(re.colors=arguments[3]),v(Z)?re.showHidden=Z:Z&&K._extend(re,Z),M(re.showHidden)&&(re.showHidden=!1),M(re.depth)&&(re.depth=2),M(re.colors)&&(re.colors=!1),M(re.customInspect)&&(re.customInspect=!0),re.colors&&(re.stylize=t),n(re,j,re.depth)}K.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(j,Z){var re=e.styles[Z];return re?"\x1B["+e.colors[re][0]+"m"+j+"\x1B["+e.colors[re][1]+"m":j}function r(j,Z){return j}function o(j){var Z={};return j.forEach(function(re,fe){Z[re]=!0}),Z}function n(j,Z,re){if(j.customInspect&&Z&&d(Z.inspect)&&Z.inspect!==K.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var fe=Z.inspect(re,j);return x(fe)||(fe=n(j,fe,re)),fe}var le=i(j,Z);if(le)return le;var ce=Object.keys(Z),V=o(ce);if(j.showHidden&&(ce=Object.getOwnPropertyNames(Z)),u(Z)&&(ce.indexOf("message")>=0||ce.indexOf("description")>=0))return a(Z);if(ce.length===0){if(d(Z)){var ee=Z.name?": "+Z.name:"";return j.stylize("[Function"+ee+"]","special")}if(_(Z))return j.stylize(RegExp.prototype.toString.call(Z),"regexp");if(m(Z))return j.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return a(Z)}var ne="",$=!1,ue=["{","}"];if(p(Z)&&($=!0,ue=["[","]"]),d(Z)){var te=Z.name?": "+Z.name:"";ne=" [Function"+te+"]"}if(_(Z)&&(ne=" "+RegExp.prototype.toString.call(Z)),m(Z)&&(ne=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&(ne=" "+a(Z)),ce.length===0&&(!$||Z.length==0))return ue[0]+ne+ue[1];if(re<0)return _(Z)?j.stylize(RegExp.prototype.toString.call(Z),"regexp"):j.stylize("[Object]","special");j.seen.push(Z);var H;return $?H=s(j,Z,re,V,ce):H=ce.map(function(ae){return f(j,Z,re,V,ae,$)}),j.seen.pop(),c(H,ne,ue)}function i(j,Z){if(M(Z))return j.stylize("undefined","undefined");if(x(Z)){var re="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return j.stylize(re,"string")}if(g(Z))return j.stylize(""+Z,"number");if(v(Z))return j.stylize(""+Z,"boolean");if(T(Z))return j.stylize("null","null")}function a(j){return"["+Error.prototype.toString.call(j)+"]"}function s(j,Z,re,fe,le){for(var ce=[],V=0,ee=Z.length;V-1&&(ce?ee=ee.split(` -`).map(function(K){return" "+K}).join(` +`).map(function($){return" "+$}).join(` `).slice(2):ee=` `+ee.split(` -`).map(function(K){return" "+K}).join(` +`).map(function($){return" "+$}).join(` `))):ee=j.stylize("[Circular]","special")),M(V)){if(ce&&le.match(/^\d+$/))return ee;V=JSON.stringify(""+le),V.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(V=V.slice(1,-1),V=j.stylize(V,"name")):(V=V.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),V=j.stylize(V,"string"))}return V+": "+ee}function c(j,Z,re){var fe=j.reduce(function(le,ce){return ce.indexOf(` `)>=0,le+ce.replace(/\u001b\[\d\d?m/g,"").length+1},0);return fe>60?re[0]+(Z===""?"":Z+` `)+" "+j.join(`, - `)+" "+re[1]:re[0]+Z+" "+j.join(", ")+" "+re[1]}$.types=rc();function p(j){return Array.isArray(j)}$.isArray=p;function d(j){return typeof j=="boolean"}$.isBoolean=d;function T(j){return j===null}$.isNull=T;function l(j){return j==null}$.isNullOrUndefined=l;function g(j){return typeof j=="number"}$.isNumber=g;function x(j){return typeof j=="string"}$.isString=x;function A(j){return typeof j=="symbol"}$.isSymbol=A;function M(j){return j===void 0}$.isUndefined=M;function _(j){return w(j)&&I(j)==="[object RegExp]"}$.isRegExp=_,$.types.isRegExp=_;function w(j){return typeof j=="object"&&j!==null}$.isObject=w;function m(j){return w(j)&&I(j)==="[object Date]"}$.isDate=m,$.types.isDate=m;function u(j){return w(j)&&(I(j)==="[object Error]"||j instanceof Error)}$.isError=u,$.types.isNativeError=u;function v(j){return typeof j=="function"}$.isFunction=v;function y(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}$.isPrimitive=y,$.isBuffer=Jc();function I(j){return Object.prototype.toString.call(j)}function L(j){return j<10?"0"+j.toString(10):j.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var j=new Date,Z=[L(j.getHours()),L(j.getMinutes()),L(j.getSeconds())].join(":");return[j.getDate(),z[j.getMonth()],Z].join(" ")}$.log=function(){console.log("%s - %s",F(),$.format.apply($,arguments))},$.inherits=gp(),$._extend=function(j,Z){if(!Z||!w(Z))return j;for(var re=Object.keys(Z),fe=re.length;fe--;)j[re[fe]]=Z[re[fe]];return j};function N(j,Z){return Object.prototype.hasOwnProperty.call(j,Z)}var B=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;$.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(B&&Z[B]){var re=Z[B];if(typeof re!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(re,B,{value:re,enumerable:!1,writable:!1,configurable:!0}),re}function re(){for(var fe,le,ce=new Promise(function(ne,K){fe=ne,le=K}),V=[],ee=0;ee0?this.tail.next=d:this.head=d,this.tail=d,++this.length}},{key:"unshift",value:function(p){var d={data:p,next:this.head};this.length===0&&(this.tail=d),this.head=d,++this.length}},{key:"shift",value:function(){if(this.length!==0){var p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(p){if(this.length===0)return"";for(var d=this.head,T=""+d.data;d=d.next;)T+=p+d.data;return T}},{key:"concat",value:function(p){if(this.length===0)return o.alloc(0);for(var d=o.allocUnsafe(p>>>0),T=this.head,l=0;T;)s(T.data,d,l),l+=T.data.length,T=T.next;return d}},{key:"consume",value:function(p,d){var T;return pg.length?g.length:p;if(x===g.length?l+=g:l+=g.slice(0,p),p-=x,p===0){x===g.length?(++T,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=g.slice(x));break}++T}return this.length-=T,l}},{key:"_getBuffer",value:function(p){var d=o.allocUnsafe(p),T=this.head,l=1;for(T.data.copy(d),p-=T.data.length;T=T.next;){var g=T.data,x=p>g.length?g.length:p;if(g.copy(d,d.length-p,0,x),p-=x,p===0){x===g.length?(++l,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=g.slice(x));break}++l}return this.length-=l,d}},{key:a,value:function(p,d){return i(this,b({},d,{depth:0,customInspect:!1}))}}]),f})()}}),_g=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"($,G){function h(r,o){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(o?o(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(e,this,r)):process.nextTick(e,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!o&&s?n._writableState?n._writableState.errorEmitted?process.nextTick(S,n):(n._writableState.errorEmitted=!0,process.nextTick(b,n,s)):process.nextTick(b,n,s):o?(process.nextTick(S,n),o(s)):process.nextTick(S,n)}),this)}function b(r,o){e(r,o),S(r)}function S(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function E(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function e(r,o){r.emit("error",o)}function t(r,o){var n=r._readableState,i=r._writableState;n&&n.autoDestroy||i&&i.autoDestroy?r.destroy(o):r.emit("error",o)}G.exports={destroy:h,undestroy:E,errorOrDestroy:t}}}),Tm=Ge({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"($,G){function h(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n}var b={};function S(o,n,i){i||(i=Error);function a(f,c,p){return typeof n=="string"?n:n(f,c,p)}var s=(function(f){h(c,f);function c(p,d,T){return f.call(this,a(p,d,T))||this}return c})(i);s.prototype.name=i.name,s.prototype.code=o,b[o]=s}function E(o,n){if(Array.isArray(o)){var i=o.length;return o=o.map(function(a){return String(a)}),i>2?"one of ".concat(n," ").concat(o.slice(0,i-1).join(", "),", or ")+o[i-1]:i===2?"one of ".concat(n," ").concat(o[0]," or ").concat(o[1]):"of ".concat(n," ").concat(o[0])}else return"of ".concat(n," ").concat(String(o))}function e(o,n,i){return o.substr(0,n.length)===n}function t(o,n,i){return(i===void 0||i>o.length)&&(i=o.length),o.substring(i-n.length,i)===n}function r(o,n,i){return typeof i!="number"&&(i=0),i+n.length>o.length?!1:o.indexOf(n,i)!==-1}S("ERR_INVALID_OPT_VALUE",function(o,n){return'The value "'+n+'" is invalid for option "'+o+'"'},TypeError),S("ERR_INVALID_ARG_TYPE",function(o,n,i){var a;typeof n=="string"&&e(n,"not ")?(a="must not be",n=n.replace(/^not /,"")):a="must be";var s;if(t(o," argument"))s="The ".concat(o," ").concat(a," ").concat(E(n,"type"));else{var f=r(o,".")?"property":"argument";s='The "'.concat(o,'" ').concat(f," ").concat(a," ").concat(E(n,"type"))}return s+=". Received type ".concat(typeof i),s},TypeError),S("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),S("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),S("ERR_STREAM_PREMATURE_CLOSE","Premature close"),S("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),S("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),S("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),S("ERR_STREAM_WRITE_AFTER_END","write after end"),S("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),S("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),S("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),G.exports.codes=b}}),h0=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"($,G){var h=Tm().codes.ERR_INVALID_OPT_VALUE;function b(E,e,t){return E.highWaterMark!=null?E.highWaterMark:e?E[t]:null}function S(E,e,t,r){var o=b(e,r,t);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var n=r?t:"highWaterMark";throw new h(n,o)}return Math.floor(o)}return E.objectMode?16:16*1024}G.exports={getHighWaterMark:S}}}),Ch=Ge({"node_modules/util-deprecate/browser.js"($,G){G.exports=h;function h(S,E){if(b("noDeprecation"))return S;var e=!1;function t(){if(!e){if(b("throwDeprecation"))throw new Error(E);b("traceDeprecation")?console.trace(E):console.warn(E),e=!0}return S.apply(this,arguments)}return t}function b(S){try{if(!window.localStorage)return!1}catch{return!1}var E=window.localStorage[S];return E==null?!1:String(E).toLowerCase()==="true"}}}),H0=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"($,G){G.exports=m;function h(V){var ee=this;this.next=null,this.entry=null,this.finish=function(){ce(ee,V)}}var b;m.WritableState=_;var S={deprecate:Ch()},E=qp(),e=gg().Buffer,t=window.Uint8Array||function(){};function r(V){return e.from(V)}function o(V){return e.isBuffer(V)||V instanceof t}var n=_g(),i=h0(),a=i.getHighWaterMark,s=Tm().codes,f=s.ERR_INVALID_ARG_TYPE,c=s.ERR_METHOD_NOT_IMPLEMENTED,p=s.ERR_MULTIPLE_CALLBACK,d=s.ERR_STREAM_CANNOT_PIPE,T=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,g=s.ERR_STREAM_WRITE_AFTER_END,x=s.ERR_UNKNOWN_ENCODING,A=n.errorOrDestroy;gp()(m,E);function M(){}function _(V,ee,ne){b=b||yp(),V=V||{},typeof ne!="boolean"&&(ne=ee instanceof b),this.objectMode=!!V.objectMode,ne&&(this.objectMode=this.objectMode||!!V.writableObjectMode),this.highWaterMark=a(this,V,"writableHighWaterMark",ne),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var K=V.decodeStrings===!1;this.decodeStrings=!K,this.defaultEncoding=V.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ue){N(ee,ue)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=V.emitClose!==!1,this.autoDestroy=!!V.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new h(this)}_.prototype.getBuffer=function(){for(var ee=this.bufferedRequest,ne=[];ee;)ne.push(ee),ee=ee.next;return ne},(function(){try{Object.defineProperty(_.prototype,"buffer",{get:S.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var w;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(ee){return w.call(this,ee)?!0:this!==m?!1:ee&&ee._writableState instanceof _}})):w=function(ee){return ee instanceof this};function m(V){b=b||yp();var ee=this instanceof b;if(!ee&&!w.call(m,this))return new m(V);this._writableState=new _(V,this,ee),this.writable=!0,V&&(typeof V.write=="function"&&(this._write=V.write),typeof V.writev=="function"&&(this._writev=V.writev),typeof V.destroy=="function"&&(this._destroy=V.destroy),typeof V.final=="function"&&(this._final=V.final)),E.call(this)}m.prototype.pipe=function(){A(this,new d)};function u(V,ee){var ne=new g;A(V,ne),process.nextTick(ee,ne)}function v(V,ee,ne,K){var ue;return ne===null?ue=new l:typeof ne!="string"&&!ee.objectMode&&(ue=new f("chunk",["string","Buffer"],ne)),ue?(A(V,ue),process.nextTick(K,ue),!1):!0}m.prototype.write=function(V,ee,ne){var K=this._writableState,ue=!1,te=!K.objectMode&&o(V);return te&&!e.isBuffer(V)&&(V=r(V)),typeof ee=="function"&&(ne=ee,ee=null),te?ee="buffer":ee||(ee=K.defaultEncoding),typeof ne!="function"&&(ne=M),K.ending?u(this,ne):(te||v(this,K,V,ne))&&(K.pendingcb++,ue=I(this,K,te,V,ee,ne)),ue},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var V=this._writableState;V.corked&&(V.corked--,!V.writing&&!V.corked&&!V.bufferProcessing&&V.bufferedRequest&&U(this,V))},m.prototype.setDefaultEncoding=function(ee){if(typeof ee=="string"&&(ee=ee.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ee+"").toLowerCase())>-1))throw new x(ee);return this._writableState.defaultEncoding=ee,this},Object.defineProperty(m.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function y(V,ee,ne){return!V.objectMode&&V.decodeStrings!==!1&&typeof ee=="string"&&(ee=e.from(ee,ne)),ee}Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function I(V,ee,ne,K,ue,te){if(!ne){var H=y(ee,K,ue);K!==H&&(ne=!0,ue="buffer",K=H)}var ae=ee.objectMode?1:K.length;ee.length+=ae;var ie=ee.length>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function t(T,l,g){var x=l.length-1;if(x=0?(A>0&&(T.lastNeed=A-1),A):--x=0?(A>0&&(T.lastNeed=A-2),A):--x=0?(A>0&&(A===2?A=0:T.lastNeed=A-3),A):0))}function r(T,l,g){if((l[0]&192)!==128)return T.lastNeed=0,"�";if(T.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return T.lastNeed=1,"�";if(T.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return T.lastNeed=2,"�"}}function o(T){var l=this.lastTotal-this.lastNeed,g=r(this,T);if(g!==void 0)return g;if(this.lastNeed<=T.length)return T.copy(this.lastChar,l,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,l,0,T.length),this.lastNeed-=T.length}function n(T,l){var g=t(this,T,l);if(!this.lastNeed)return T.toString("utf8",l);this.lastTotal=g;var x=T.length-(g-this.lastNeed);return T.copy(this.lastChar,0,x),T.toString("utf8",l,x)}function i(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+"�":l}function a(T,l){if((T.length-l)%2===0){var g=T.toString("utf16le",l);if(g){var x=g.charCodeAt(g.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],g.slice(0,-1)}return g}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",l,T.length-1)}function s(T){var l=T&&T.length?this.write(T):"";if(this.lastNeed){var g=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,g)}return l}function f(T,l){var g=(T.length-l)%3;return g===0?T.toString("base64",l):(this.lastNeed=3-g,this.lastTotal=3,g===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",l,T.length-g))}function c(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function p(T){return T.toString(this.encoding)}function d(T){return T&&T.length?this.write(T):""}}}),Am=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"($,G){var h=Tm().codes.ERR_STREAM_PREMATURE_CLOSE;function b(t){var r=!1;return function(){if(!r){r=!0;for(var o=arguments.length,n=new Array(o),i=0;i0)if(typeof H!="string"&&!Ae.objectMode&&Object.getPrototypeOf(H)!==E.prototype&&(H=t(H)),ie)Ae.endEmitted?M(te,new l):y(te,Ae,H,!0);else if(Ae.ended)M(te,new d);else{if(Ae.destroyed)return!1;Ae.reading=!1,Ae.decoder&&!ae?(H=Ae.decoder.write(H),Ae.objectMode||H.length!==0?y(te,Ae,H,!1):U(te,Ae)):y(te,Ae,H,!1)}else ie||(Ae.reading=!1,U(te,Ae))}return!Ae.ended&&(Ae.length=L?te=L:(te--,te|=te>>>1,te|=te>>>2,te|=te>>>4,te|=te>>>8,te|=te>>>16,te++),te}function F(te,H){return te<=0||H.length===0&&H.ended?0:H.objectMode?1:te!==te?H.flowing&&H.length?H.buffer.head.data.length:H.length:(te>H.highWaterMark&&(H.highWaterMark=z(te)),te<=H.length?te:H.ended?H.length:(H.needReadable=!0,0))}u.prototype.read=function(te){n("read",te),te=parseInt(te,10);var H=this._readableState,ae=te;if(te!==0&&(H.emittedReadable=!1),te===0&&H.needReadable&&((H.highWaterMark!==0?H.length>=H.highWaterMark:H.length>0)||H.ended))return n("read: emitReadable",H.length,H.ended),H.length===0&&H.ended?ne(this):B(this),null;if(te=F(te,H),te===0&&H.ended)return H.length===0&&ne(this),null;var ie=H.needReadable;n("need readable",ie),(H.length===0||H.length-te0?ve=ee(te,H):ve=null,ve===null?(H.needReadable=H.length<=H.highWaterMark,te=0):(H.length-=te,H.awaitDrain=0),H.length===0&&(H.ended||(H.needReadable=!0),ae!==te&&H.ended&&ne(this)),ve!==null&&this.emit("data",ve),ve};function N(te,H){if(n("onEofChunk"),!H.ended){if(H.decoder){var ae=H.decoder.end();ae&&ae.length&&(H.buffer.push(ae),H.length+=H.objectMode?1:ae.length)}H.ended=!0,H.sync?B(te):(H.needReadable=!1,H.emittedReadable||(H.emittedReadable=!0,R(te)))}}function B(te){var H=te._readableState;n("emitReadable",H.needReadable,H.emittedReadable),H.needReadable=!1,H.emittedReadable||(n("emitReadable",H.flowing),H.emittedReadable=!0,process.nextTick(R,te))}function R(te){var H=te._readableState;n("emitReadable_",H.destroyed,H.length,H.ended),!H.destroyed&&(H.length||H.ended)&&(te.emit("readable"),H.emittedReadable=!1),H.needReadable=!H.flowing&&!H.ended&&H.length<=H.highWaterMark,V(te)}function U(te,H){H.readingMore||(H.readingMore=!0,process.nextTick(j,te,H))}function j(te,H){for(;!H.reading&&!H.ended&&(H.length1&&ue(ie.pipes,te)!==-1)&&!Ye&&(n("false write response, pause",ie.awaitDrain),ie.awaitDrain++),ae.pause())}function nt(pe){n("onerror",pe),Te(),te.removeListener("error",nt),b(te,"error")===0&&M(te,pe)}w(te,"error",nt);function Qe(){te.removeListener("finish",Le),Te()}te.once("close",Qe);function Le(){n("onfinish"),te.removeListener("close",Qe),Te()}te.once("finish",Le);function Te(){n("unpipe"),ae.unpipe(te)}return te.emit("pipe",ae),ie.flowing||(n("pipe resume"),ae.resume()),te};function Z(te){return function(){var ae=te._readableState;n("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&b(te,"data")&&(ae.flowing=!0,V(te))}}u.prototype.unpipe=function(te){var H=this._readableState,ae={hasUnpiped:!1};if(H.pipesCount===0)return this;if(H.pipesCount===1)return te&&te!==H.pipes?this:(te||(te=H.pipes),H.pipes=null,H.pipesCount=0,H.flowing=!1,te&&te.emit("unpipe",this,ae),this);if(!te){var ie=H.pipes,ve=H.pipesCount;H.pipes=null,H.pipesCount=0,H.flowing=!1;for(var Ae=0;Ae0,ie.flowing!==!1&&this.resume()):te==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,n("on readable",ie.length,ie.reading),ie.length?B(this):ie.reading||process.nextTick(fe,this)),ae},u.prototype.addListener=u.prototype.on,u.prototype.removeListener=function(te,H){var ae=S.prototype.removeListener.call(this,te,H);return te==="readable"&&process.nextTick(re,this),ae},u.prototype.removeAllListeners=function(te){var H=S.prototype.removeAllListeners.apply(this,arguments);return(te==="readable"||te===void 0)&&process.nextTick(re,this),H};function re(te){var H=te._readableState;H.readableListening=te.listenerCount("readable")>0,H.resumeScheduled&&!H.paused?H.flowing=!0:te.listenerCount("data")>0&&te.resume()}function fe(te){n("readable nexttick read 0"),te.read(0)}u.prototype.resume=function(){var te=this._readableState;return te.flowing||(n("resume"),te.flowing=!te.readableListening,le(this,te)),te.paused=!1,this};function le(te,H){H.resumeScheduled||(H.resumeScheduled=!0,process.nextTick(ce,te,H))}function ce(te,H){n("resume",H.reading),H.reading||te.read(0),H.resumeScheduled=!1,te.emit("resume"),V(te),H.flowing&&!H.reading&&te.read(0)}u.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function V(te){var H=te._readableState;for(n("flow",H.flowing);H.flowing&&te.read()!==null;);}u.prototype.wrap=function(te){var H=this,ae=this._readableState,ie=!1;te.on("end",function(){if(n("wrapped end"),ae.decoder&&!ae.ended){var Ce=ae.decoder.end();Ce&&Ce.length&&H.push(Ce)}H.push(null)}),te.on("data",function(Ce){if(n("wrapped data"),ae.decoder&&(Ce=ae.decoder.write(Ce)),!(ae.objectMode&&Ce==null)&&!(!ae.objectMode&&(!Ce||!Ce.length))){var Fe=H.push(Ce);Fe||(ie=!0,te.pause())}});for(var ve in te)this[ve]===void 0&&typeof te[ve]=="function"&&(this[ve]=(function(Fe){return function(){return te[Fe].apply(te,arguments)}})(ve));for(var Ae=0;Ae<_.length;Ae++)te.on(_[Ae],this.emit.bind(this,_[Ae]));return this._read=function(Ce){n("wrapped _read",Ce),ie&&(ie=!1,te.resume())},this},typeof Symbol=="function"&&(u.prototype[Symbol.asyncIterator]=function(){return x===void 0&&(x=t_()),x(this)}),Object.defineProperty(u.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(u.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(u.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(H){this._readableState&&(this._readableState.flowing=H)}}),u._fromList=ee,Object.defineProperty(u.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ee(te,H){if(H.length===0)return null;var ae;return H.objectMode?ae=H.buffer.shift():!te||te>=H.length?(H.decoder?ae=H.buffer.join(""):H.buffer.length===1?ae=H.buffer.first():ae=H.buffer.concat(H.length),H.buffer.clear()):ae=H.buffer.consume(te,H.decoder),ae}function ne(te){var H=te._readableState;n("endReadable",H.endEmitted),H.endEmitted||(H.ended=!0,process.nextTick(K,H,te))}function K(te,H){if(n("endReadableNT",te.endEmitted,te.length),!te.endEmitted&&te.length===0&&(te.endEmitted=!0,H.readable=!1,H.emit("end"),te.autoDestroy)){var ae=H._writableState;(!ae||ae.autoDestroy&&ae.finished)&&H.destroy()}}typeof Symbol=="function"&&(u.from=function(te,H){return A===void 0&&(A=Rd()),A(u,te,H)});function ue(te,H){for(var ae=0,ie=te.length;ae0;return o(g,A,M,function(_){T||(T=_),_&&l.forEach(n),!A&&(l.forEach(n),d(T))})});return c.reduce(i)}G.exports=s}}),vb=Ge({"node_modules/stream-browserify/index.js"($,G){G.exports=S;var h=L0().EventEmitter,b=gp();b(S,h),S.Readable=fb(),S.Writable=H0(),S.Duplex=yp(),S.Transform=r_(),S.PassThrough=fA(),S.finished=Am(),S.pipeline=hb(),S.Stream=S;function S(){h.call(this)}S.prototype.pipe=function(E,e){var t=this;function r(c){E.writable&&E.write(c)===!1&&t.pause&&t.pause()}t.on("data",r);function o(){t.readable&&t.resume&&t.resume()}E.on("drain",o),!E._isStdio&&(!e||e.end!==!1)&&(t.on("end",i),t.on("close",a));var n=!1;function i(){n||(n=!0,E.end())}function a(){n||(n=!0,typeof E.destroy=="function"&&E.destroy())}function s(c){if(f(),h.listenerCount(this,"error")===0)throw c}t.on("error",s),E.on("error",s);function f(){t.removeListener("data",r),E.removeListener("drain",o),t.removeListener("end",i),t.removeListener("close",a),t.removeListener("error",s),E.removeListener("error",s),t.removeListener("end",f),t.removeListener("close",f),E.removeListener("close",f)}return t.on("end",f),t.on("close",f),E.on("close",f),E.emit("pipe",t),E}}}),_p=Ge({"node_modules/util/util.js"($){var G=Object.getOwnPropertyDescriptors||function(Z){for(var re=Object.keys(Z),fe={},le=0;le=le)return ee;switch(ee){case"%s":return String(fe[re++]);case"%d":return Number(fe[re++]);case"%j":try{return JSON.stringify(fe[re++])}catch{return"[Circular]"}default:return ee}}),V=fe[re];re"u")return function(){return $.deprecate(j,Z).apply(this,arguments)};var re=!1;function fe(){if(!re){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),re=!0}return j.apply(this,arguments)}return fe};var b={},S=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),S=new RegExp("^"+E+"$","i");var E;$.debuglog=function(j){if(j=j.toUpperCase(),!b[j])if(S.test(j)){var Z=process.pid;b[j]=function(){var re=$.format.apply($,arguments);console.error("%s %d: %s",j,Z,re)}}else b[j]=function(){};return b[j]};function e(j,Z){var re={seen:[],stylize:r};return arguments.length>=3&&(re.depth=arguments[2]),arguments.length>=4&&(re.colors=arguments[3]),d(Z)?re.showHidden=Z:Z&&$._extend(re,Z),M(re.showHidden)&&(re.showHidden=!1),M(re.depth)&&(re.depth=2),M(re.colors)&&(re.colors=!1),M(re.customInspect)&&(re.customInspect=!0),re.colors&&(re.stylize=t),n(re,j,re.depth)}$.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(j,Z){var re=e.styles[Z];return re?"\x1B["+e.colors[re][0]+"m"+j+"\x1B["+e.colors[re][1]+"m":j}function r(j,Z){return j}function o(j){var Z={};return j.forEach(function(re,fe){Z[re]=!0}),Z}function n(j,Z,re){if(j.customInspect&&Z&&v(Z.inspect)&&Z.inspect!==$.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var fe=Z.inspect(re,j);return x(fe)||(fe=n(j,fe,re)),fe}var le=i(j,Z);if(le)return le;var ce=Object.keys(Z),V=o(ce);if(j.showHidden&&(ce=Object.getOwnPropertyNames(Z)),u(Z)&&(ce.indexOf("message")>=0||ce.indexOf("description")>=0))return a(Z);if(ce.length===0){if(v(Z)){var ee=Z.name?": "+Z.name:"";return j.stylize("[Function"+ee+"]","special")}if(_(Z))return j.stylize(RegExp.prototype.toString.call(Z),"regexp");if(m(Z))return j.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return a(Z)}var ne="",K=!1,ue=["{","}"];if(p(Z)&&(K=!0,ue=["[","]"]),v(Z)){var te=Z.name?": "+Z.name:"";ne=" [Function"+te+"]"}if(_(Z)&&(ne=" "+RegExp.prototype.toString.call(Z)),m(Z)&&(ne=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&(ne=" "+a(Z)),ce.length===0&&(!K||Z.length==0))return ue[0]+ne+ue[1];if(re<0)return _(Z)?j.stylize(RegExp.prototype.toString.call(Z),"regexp"):j.stylize("[Object]","special");j.seen.push(Z);var H;return K?H=s(j,Z,re,V,ce):H=ce.map(function(ae){return f(j,Z,re,V,ae,K)}),j.seen.pop(),c(H,ne,ue)}function i(j,Z){if(M(Z))return j.stylize("undefined","undefined");if(x(Z)){var re="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return j.stylize(re,"string")}if(g(Z))return j.stylize(""+Z,"number");if(d(Z))return j.stylize(""+Z,"boolean");if(T(Z))return j.stylize("null","null")}function a(j){return"["+Error.prototype.toString.call(j)+"]"}function s(j,Z,re,fe,le){for(var ce=[],V=0,ee=Z.length;V"u"}K.isPrimitive=y,K.isBuffer=tf();function I(j){return Object.prototype.toString.call(j)}function L(j){return j<10?"0"+j.toString(10):j.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var j=new Date,Z=[L(j.getHours()),L(j.getMinutes()),L(j.getSeconds())].join(":");return[j.getDate(),z[j.getMonth()],Z].join(" ")}K.log=function(){console.log("%s - %s",F(),K.format.apply(K,arguments))},K.inherits=Tp(),K._extend=function(j,Z){if(!Z||!w(Z))return j;for(var re=Object.keys(Z),fe=re.length;fe--;)j[re[fe]]=Z[re[fe]];return j};function N(j,Z){return Object.prototype.hasOwnProperty.call(j,Z)}var B=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;K.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(B&&Z[B]){var re=Z[B];if(typeof re!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(re,B,{value:re,enumerable:!1,writable:!1,configurable:!0}),re}function re(){for(var fe,le,ce=new Promise(function(ne,$){fe=ne,le=$}),V=[],ee=0;ee0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(p){var v={data:p,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(p){if(this.length===0)return"";for(var v=this.head,T=""+v.data;v=v.next;)T+=p+v.data;return T}},{key:"concat",value:function(p){if(this.length===0)return o.alloc(0);for(var v=o.allocUnsafe(p>>>0),T=this.head,l=0;T;)s(T.data,v,l),l+=T.data.length,T=T.next;return v}},{key:"consume",value:function(p,v){var T;return pg.length?g.length:p;if(x===g.length?l+=g:l+=g.slice(0,p),p-=x,p===0){x===g.length?(++T,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=g.slice(x));break}++T}return this.length-=T,l}},{key:"_getBuffer",value:function(p){var v=o.allocUnsafe(p),T=this.head,l=1;for(T.data.copy(v),p-=T.data.length;T=T.next;){var g=T.data,x=p>g.length?g.length:p;if(g.copy(v,v.length-p,0,x),p-=x,p===0){x===g.length?(++l,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=g.slice(x));break}++l}return this.length-=l,v}},{key:a,value:function(p,v){return i(this,b({},v,{depth:0,customInspect:!1}))}}]),f})()}}),wg=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(K,G){function h(r,o){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(o?o(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(e,this,r)):process.nextTick(e,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!o&&s?n._writableState?n._writableState.errorEmitted?process.nextTick(S,n):(n._writableState.errorEmitted=!0,process.nextTick(b,n,s)):process.nextTick(b,n,s):o?(process.nextTick(S,n),o(s)):process.nextTick(S,n)}),this)}function b(r,o){e(r,o),S(r)}function S(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function E(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function e(r,o){r.emit("error",o)}function t(r,o){var n=r._readableState,i=r._writableState;n&&n.autoDestroy||i&&i.autoDestroy?r.destroy(o):r.emit("error",o)}G.exports={destroy:h,undestroy:E,errorOrDestroy:t}}}),km=Ge({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(K,G){function h(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n}var b={};function S(o,n,i){i||(i=Error);function a(f,c,p){return typeof n=="string"?n:n(f,c,p)}var s=(function(f){h(c,f);function c(p,v,T){return f.call(this,a(p,v,T))||this}return c})(i);s.prototype.name=i.name,s.prototype.code=o,b[o]=s}function E(o,n){if(Array.isArray(o)){var i=o.length;return o=o.map(function(a){return String(a)}),i>2?"one of ".concat(n," ").concat(o.slice(0,i-1).join(", "),", or ")+o[i-1]:i===2?"one of ".concat(n," ").concat(o[0]," or ").concat(o[1]):"of ".concat(n," ").concat(o[0])}else return"of ".concat(n," ").concat(String(o))}function e(o,n,i){return o.substr(0,n.length)===n}function t(o,n,i){return(i===void 0||i>o.length)&&(i=o.length),o.substring(i-n.length,i)===n}function r(o,n,i){return typeof i!="number"&&(i=0),i+n.length>o.length?!1:o.indexOf(n,i)!==-1}S("ERR_INVALID_OPT_VALUE",function(o,n){return'The value "'+n+'" is invalid for option "'+o+'"'},TypeError),S("ERR_INVALID_ARG_TYPE",function(o,n,i){var a;typeof n=="string"&&e(n,"not ")?(a="must not be",n=n.replace(/^not /,"")):a="must be";var s;if(t(o," argument"))s="The ".concat(o," ").concat(a," ").concat(E(n,"type"));else{var f=r(o,".")?"property":"argument";s='The "'.concat(o,'" ').concat(f," ").concat(a," ").concat(E(n,"type"))}return s+=". Received type ".concat(typeof i),s},TypeError),S("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),S("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),S("ERR_STREAM_PREMATURE_CLOSE","Premature close"),S("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),S("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),S("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),S("ERR_STREAM_WRITE_AFTER_END","write after end"),S("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),S("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),S("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),G.exports.codes=b}}),g0=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(K,G){var h=km().codes.ERR_INVALID_OPT_VALUE;function b(E,e,t){return E.highWaterMark!=null?E.highWaterMark:e?E[t]:null}function S(E,e,t,r){var o=b(e,r,t);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var n=r?t:"highWaterMark";throw new h(n,o)}return Math.floor(o)}return E.objectMode?16:16*1024}G.exports={getHighWaterMark:S}}}),Ih=Ge({"node_modules/util-deprecate/browser.js"(K,G){G.exports=h;function h(S,E){if(b("noDeprecation"))return S;var e=!1;function t(){if(!e){if(b("throwDeprecation"))throw new Error(E);b("traceDeprecation")?console.trace(E):console.warn(E),e=!0}return S.apply(this,arguments)}return t}function b(S){try{if(!window.localStorage)return!1}catch{return!1}var E=window.localStorage[S];return E==null?!1:String(E).toLowerCase()==="true"}}}),Z0=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(K,G){G.exports=m;function h(V){var ee=this;this.next=null,this.entry=null,this.finish=function(){ce(ee,V)}}var b;m.WritableState=_;var S={deprecate:Ih()},E=Wp(),e=xg().Buffer,t=window.Uint8Array||function(){};function r(V){return e.from(V)}function o(V){return e.isBuffer(V)||V instanceof t}var n=wg(),i=g0(),a=i.getHighWaterMark,s=km().codes,f=s.ERR_INVALID_ARG_TYPE,c=s.ERR_METHOD_NOT_IMPLEMENTED,p=s.ERR_MULTIPLE_CALLBACK,v=s.ERR_STREAM_CANNOT_PIPE,T=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,g=s.ERR_STREAM_WRITE_AFTER_END,x=s.ERR_UNKNOWN_ENCODING,A=n.errorOrDestroy;Tp()(m,E);function M(){}function _(V,ee,ne){b=b||Ap(),V=V||{},typeof ne!="boolean"&&(ne=ee instanceof b),this.objectMode=!!V.objectMode,ne&&(this.objectMode=this.objectMode||!!V.writableObjectMode),this.highWaterMark=a(this,V,"writableHighWaterMark",ne),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var $=V.decodeStrings===!1;this.decodeStrings=!$,this.defaultEncoding=V.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ue){N(ee,ue)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=V.emitClose!==!1,this.autoDestroy=!!V.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new h(this)}_.prototype.getBuffer=function(){for(var ee=this.bufferedRequest,ne=[];ee;)ne.push(ee),ee=ee.next;return ne},(function(){try{Object.defineProperty(_.prototype,"buffer",{get:S.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var w;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(ee){return w.call(this,ee)?!0:this!==m?!1:ee&&ee._writableState instanceof _}})):w=function(ee){return ee instanceof this};function m(V){b=b||Ap();var ee=this instanceof b;if(!ee&&!w.call(m,this))return new m(V);this._writableState=new _(V,this,ee),this.writable=!0,V&&(typeof V.write=="function"&&(this._write=V.write),typeof V.writev=="function"&&(this._writev=V.writev),typeof V.destroy=="function"&&(this._destroy=V.destroy),typeof V.final=="function"&&(this._final=V.final)),E.call(this)}m.prototype.pipe=function(){A(this,new v)};function u(V,ee){var ne=new g;A(V,ne),process.nextTick(ee,ne)}function d(V,ee,ne,$){var ue;return ne===null?ue=new l:typeof ne!="string"&&!ee.objectMode&&(ue=new f("chunk",["string","Buffer"],ne)),ue?(A(V,ue),process.nextTick($,ue),!1):!0}m.prototype.write=function(V,ee,ne){var $=this._writableState,ue=!1,te=!$.objectMode&&o(V);return te&&!e.isBuffer(V)&&(V=r(V)),typeof ee=="function"&&(ne=ee,ee=null),te?ee="buffer":ee||(ee=$.defaultEncoding),typeof ne!="function"&&(ne=M),$.ending?u(this,ne):(te||d(this,$,V,ne))&&($.pendingcb++,ue=I(this,$,te,V,ee,ne)),ue},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var V=this._writableState;V.corked&&(V.corked--,!V.writing&&!V.corked&&!V.bufferProcessing&&V.bufferedRequest&&U(this,V))},m.prototype.setDefaultEncoding=function(ee){if(typeof ee=="string"&&(ee=ee.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ee+"").toLowerCase())>-1))throw new x(ee);return this._writableState.defaultEncoding=ee,this},Object.defineProperty(m.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function y(V,ee,ne){return!V.objectMode&&V.decodeStrings!==!1&&typeof ee=="string"&&(ee=e.from(ee,ne)),ee}Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function I(V,ee,ne,$,ue,te){if(!ne){var H=y(ee,$,ue);$!==H&&(ne=!0,ue="buffer",$=H)}var ae=ee.objectMode?1:$.length;ee.length+=ae;var ie=ee.length>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function t(T,l,g){var x=l.length-1;if(x=0?(A>0&&(T.lastNeed=A-1),A):--x=0?(A>0&&(T.lastNeed=A-2),A):--x=0?(A>0&&(A===2?A=0:T.lastNeed=A-3),A):0))}function r(T,l,g){if((l[0]&192)!==128)return T.lastNeed=0,"�";if(T.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return T.lastNeed=1,"�";if(T.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return T.lastNeed=2,"�"}}function o(T){var l=this.lastTotal-this.lastNeed,g=r(this,T);if(g!==void 0)return g;if(this.lastNeed<=T.length)return T.copy(this.lastChar,l,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,l,0,T.length),this.lastNeed-=T.length}function n(T,l){var g=t(this,T,l);if(!this.lastNeed)return T.toString("utf8",l);this.lastTotal=g;var x=T.length-(g-this.lastNeed);return T.copy(this.lastChar,0,x),T.toString("utf8",l,x)}function i(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+"�":l}function a(T,l){if((T.length-l)%2===0){var g=T.toString("utf16le",l);if(g){var x=g.charCodeAt(g.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],g.slice(0,-1)}return g}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",l,T.length-1)}function s(T){var l=T&&T.length?this.write(T):"";if(this.lastNeed){var g=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,g)}return l}function f(T,l){var g=(T.length-l)%3;return g===0?T.toString("base64",l):(this.lastNeed=3-g,this.lastTotal=3,g===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",l,T.length-g))}function c(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function p(T){return T.toString(this.encoding)}function v(T){return T&&T.length?this.write(T):""}}}),Cm=Ge({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(K,G){var h=km().codes.ERR_STREAM_PREMATURE_CLOSE;function b(t){var r=!1;return function(){if(!r){r=!0;for(var o=arguments.length,n=new Array(o),i=0;i0)if(typeof H!="string"&&!Se.objectMode&&Object.getPrototypeOf(H)!==E.prototype&&(H=t(H)),ie)Se.endEmitted?M(te,new l):y(te,Se,H,!0);else if(Se.ended)M(te,new v);else{if(Se.destroyed)return!1;Se.reading=!1,Se.decoder&&!ae?(H=Se.decoder.write(H),Se.objectMode||H.length!==0?y(te,Se,H,!1):U(te,Se)):y(te,Se,H,!1)}else ie||(Se.reading=!1,U(te,Se))}return!Se.ended&&(Se.length=L?te=L:(te--,te|=te>>>1,te|=te>>>2,te|=te>>>4,te|=te>>>8,te|=te>>>16,te++),te}function F(te,H){return te<=0||H.length===0&&H.ended?0:H.objectMode?1:te!==te?H.flowing&&H.length?H.buffer.head.data.length:H.length:(te>H.highWaterMark&&(H.highWaterMark=z(te)),te<=H.length?te:H.ended?H.length:(H.needReadable=!0,0))}u.prototype.read=function(te){n("read",te),te=parseInt(te,10);var H=this._readableState,ae=te;if(te!==0&&(H.emittedReadable=!1),te===0&&H.needReadable&&((H.highWaterMark!==0?H.length>=H.highWaterMark:H.length>0)||H.ended))return n("read: emitReadable",H.length,H.ended),H.length===0&&H.ended?ne(this):B(this),null;if(te=F(te,H),te===0&&H.ended)return H.length===0&&ne(this),null;var ie=H.needReadable;n("need readable",ie),(H.length===0||H.length-te0?de=ee(te,H):de=null,de===null?(H.needReadable=H.length<=H.highWaterMark,te=0):(H.length-=te,H.awaitDrain=0),H.length===0&&(H.ended||(H.needReadable=!0),ae!==te&&H.ended&&ne(this)),de!==null&&this.emit("data",de),de};function N(te,H){if(n("onEofChunk"),!H.ended){if(H.decoder){var ae=H.decoder.end();ae&&ae.length&&(H.buffer.push(ae),H.length+=H.objectMode?1:ae.length)}H.ended=!0,H.sync?B(te):(H.needReadable=!1,H.emittedReadable||(H.emittedReadable=!0,R(te)))}}function B(te){var H=te._readableState;n("emitReadable",H.needReadable,H.emittedReadable),H.needReadable=!1,H.emittedReadable||(n("emitReadable",H.flowing),H.emittedReadable=!0,process.nextTick(R,te))}function R(te){var H=te._readableState;n("emitReadable_",H.destroyed,H.length,H.ended),!H.destroyed&&(H.length||H.ended)&&(te.emit("readable"),H.emittedReadable=!1),H.needReadable=!H.flowing&&!H.ended&&H.length<=H.highWaterMark,V(te)}function U(te,H){H.readingMore||(H.readingMore=!0,process.nextTick(j,te,H))}function j(te,H){for(;!H.reading&&!H.ended&&(H.length1&&ue(ie.pipes,te)!==-1)&&!Ye&&(n("false write response, pause",ie.awaitDrain),ie.awaitDrain++),ae.pause())}function at(pe){n("onerror",pe),Ae(),te.removeListener("error",at),b(te,"error")===0&&M(te,pe)}w(te,"error",at);function et(){te.removeListener("finish",Pe),Ae()}te.once("close",et);function Pe(){n("onfinish"),te.removeListener("close",et),Ae()}te.once("finish",Pe);function Ae(){n("unpipe"),ae.unpipe(te)}return te.emit("pipe",ae),ie.flowing||(n("pipe resume"),ae.resume()),te};function Z(te){return function(){var ae=te._readableState;n("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&b(te,"data")&&(ae.flowing=!0,V(te))}}u.prototype.unpipe=function(te){var H=this._readableState,ae={hasUnpiped:!1};if(H.pipesCount===0)return this;if(H.pipesCount===1)return te&&te!==H.pipes?this:(te||(te=H.pipes),H.pipes=null,H.pipesCount=0,H.flowing=!1,te&&te.emit("unpipe",this,ae),this);if(!te){var ie=H.pipes,de=H.pipesCount;H.pipes=null,H.pipesCount=0,H.flowing=!1;for(var Se=0;Se0,ie.flowing!==!1&&this.resume()):te==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,n("on readable",ie.length,ie.reading),ie.length?B(this):ie.reading||process.nextTick(fe,this)),ae},u.prototype.addListener=u.prototype.on,u.prototype.removeListener=function(te,H){var ae=S.prototype.removeListener.call(this,te,H);return te==="readable"&&process.nextTick(re,this),ae},u.prototype.removeAllListeners=function(te){var H=S.prototype.removeAllListeners.apply(this,arguments);return(te==="readable"||te===void 0)&&process.nextTick(re,this),H};function re(te){var H=te._readableState;H.readableListening=te.listenerCount("readable")>0,H.resumeScheduled&&!H.paused?H.flowing=!0:te.listenerCount("data")>0&&te.resume()}function fe(te){n("readable nexttick read 0"),te.read(0)}u.prototype.resume=function(){var te=this._readableState;return te.flowing||(n("resume"),te.flowing=!te.readableListening,le(this,te)),te.paused=!1,this};function le(te,H){H.resumeScheduled||(H.resumeScheduled=!0,process.nextTick(ce,te,H))}function ce(te,H){n("resume",H.reading),H.reading||te.read(0),H.resumeScheduled=!1,te.emit("resume"),V(te),H.flowing&&!H.reading&&te.read(0)}u.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function V(te){var H=te._readableState;for(n("flow",H.flowing);H.flowing&&te.read()!==null;);}u.prototype.wrap=function(te){var H=this,ae=this._readableState,ie=!1;te.on("end",function(){if(n("wrapped end"),ae.decoder&&!ae.ended){var Le=ae.decoder.end();Le&&Le.length&&H.push(Le)}H.push(null)}),te.on("data",function(Le){if(n("wrapped data"),ae.decoder&&(Le=ae.decoder.write(Le)),!(ae.objectMode&&Le==null)&&!(!ae.objectMode&&(!Le||!Le.length))){var Fe=H.push(Le);Fe||(ie=!0,te.pause())}});for(var de in te)this[de]===void 0&&typeof te[de]=="function"&&(this[de]=(function(Fe){return function(){return te[Fe].apply(te,arguments)}})(de));for(var Se=0;Se<_.length;Se++)te.on(_[Se],this.emit.bind(this,_[Se]));return this._read=function(Le){n("wrapped _read",Le),ie&&(ie=!1,te.resume())},this},typeof Symbol=="function"&&(u.prototype[Symbol.asyncIterator]=function(){return x===void 0&&(x=i_()),x(this)}),Object.defineProperty(u.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(u.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(u.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(H){this._readableState&&(this._readableState.flowing=H)}}),u._fromList=ee,Object.defineProperty(u.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ee(te,H){if(H.length===0)return null;var ae;return H.objectMode?ae=H.buffer.shift():!te||te>=H.length?(H.decoder?ae=H.buffer.join(""):H.buffer.length===1?ae=H.buffer.first():ae=H.buffer.concat(H.length),H.buffer.clear()):ae=H.buffer.consume(te,H.decoder),ae}function ne(te){var H=te._readableState;n("endReadable",H.endEmitted),H.endEmitted||(H.ended=!0,process.nextTick($,H,te))}function $(te,H){if(n("endReadableNT",te.endEmitted,te.length),!te.endEmitted&&te.length===0&&(te.endEmitted=!0,H.readable=!1,H.emit("end"),te.autoDestroy)){var ae=H._writableState;(!ae||ae.autoDestroy&&ae.finished)&&H.destroy()}}typeof Symbol=="function"&&(u.from=function(te,H){return A===void 0&&(A=Bv()),A(u,te,H)});function ue(te,H){for(var ae=0,ie=te.length;ae0;return o(g,A,M,function(_){T||(T=_),_&&l.forEach(n),!A&&(l.forEach(n),v(T))})});return c.reduce(i)}G.exports=s}}),mb=Ge({"node_modules/stream-browserify/index.js"(K,G){G.exports=S;var h=D0().EventEmitter,b=Tp();b(S,h),S.Readable=vb(),S.Writable=Z0(),S.Duplex=Ap(),S.Transform=o_(),S.PassThrough=xA(),S.finished=Cm(),S.pipeline=pb(),S.Stream=S;function S(){h.call(this)}S.prototype.pipe=function(E,e){var t=this;function r(c){E.writable&&E.write(c)===!1&&t.pause&&t.pause()}t.on("data",r);function o(){t.readable&&t.resume&&t.resume()}E.on("drain",o),!E._isStdio&&(!e||e.end!==!1)&&(t.on("end",i),t.on("close",a));var n=!1;function i(){n||(n=!0,E.end())}function a(){n||(n=!0,typeof E.destroy=="function"&&E.destroy())}function s(c){if(f(),h.listenerCount(this,"error")===0)throw c}t.on("error",s),E.on("error",s);function f(){t.removeListener("data",r),E.removeListener("drain",o),t.removeListener("end",i),t.removeListener("close",a),t.removeListener("error",s),E.removeListener("error",s),t.removeListener("end",f),t.removeListener("close",f),E.removeListener("close",f)}return t.on("end",f),t.on("close",f),E.on("close",f),E.emit("pipe",t),E}}}),Sp=Ge({"node_modules/util/util.js"(K){var G=Object.getOwnPropertyDescriptors||function(Z){for(var re=Object.keys(Z),fe={},le=0;le=le)return ee;switch(ee){case"%s":return String(fe[re++]);case"%d":return Number(fe[re++]);case"%j":try{return JSON.stringify(fe[re++])}catch{return"[Circular]"}default:return ee}}),V=fe[re];re"u")return function(){return K.deprecate(j,Z).apply(this,arguments)};var re=!1;function fe(){if(!re){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),re=!0}return j.apply(this,arguments)}return fe};var b={},S=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),S=new RegExp("^"+E+"$","i");var E;K.debuglog=function(j){if(j=j.toUpperCase(),!b[j])if(S.test(j)){var Z=process.pid;b[j]=function(){var re=K.format.apply(K,arguments);console.error("%s %d: %s",j,Z,re)}}else b[j]=function(){};return b[j]};function e(j,Z){var re={seen:[],stylize:r};return arguments.length>=3&&(re.depth=arguments[2]),arguments.length>=4&&(re.colors=arguments[3]),v(Z)?re.showHidden=Z:Z&&K._extend(re,Z),M(re.showHidden)&&(re.showHidden=!1),M(re.depth)&&(re.depth=2),M(re.colors)&&(re.colors=!1),M(re.customInspect)&&(re.customInspect=!0),re.colors&&(re.stylize=t),n(re,j,re.depth)}K.inspect=e,e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(j,Z){var re=e.styles[Z];return re?"\x1B["+e.colors[re][0]+"m"+j+"\x1B["+e.colors[re][1]+"m":j}function r(j,Z){return j}function o(j){var Z={};return j.forEach(function(re,fe){Z[re]=!0}),Z}function n(j,Z,re){if(j.customInspect&&Z&&d(Z.inspect)&&Z.inspect!==K.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var fe=Z.inspect(re,j);return x(fe)||(fe=n(j,fe,re)),fe}var le=i(j,Z);if(le)return le;var ce=Object.keys(Z),V=o(ce);if(j.showHidden&&(ce=Object.getOwnPropertyNames(Z)),u(Z)&&(ce.indexOf("message")>=0||ce.indexOf("description")>=0))return a(Z);if(ce.length===0){if(d(Z)){var ee=Z.name?": "+Z.name:"";return j.stylize("[Function"+ee+"]","special")}if(_(Z))return j.stylize(RegExp.prototype.toString.call(Z),"regexp");if(m(Z))return j.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return a(Z)}var ne="",$=!1,ue=["{","}"];if(p(Z)&&($=!0,ue=["[","]"]),d(Z)){var te=Z.name?": "+Z.name:"";ne=" [Function"+te+"]"}if(_(Z)&&(ne=" "+RegExp.prototype.toString.call(Z)),m(Z)&&(ne=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&(ne=" "+a(Z)),ce.length===0&&(!$||Z.length==0))return ue[0]+ne+ue[1];if(re<0)return _(Z)?j.stylize(RegExp.prototype.toString.call(Z),"regexp"):j.stylize("[Object]","special");j.seen.push(Z);var H;return $?H=s(j,Z,re,V,ce):H=ce.map(function(ae){return f(j,Z,re,V,ae,$)}),j.seen.pop(),c(H,ne,ue)}function i(j,Z){if(M(Z))return j.stylize("undefined","undefined");if(x(Z)){var re="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return j.stylize(re,"string")}if(g(Z))return j.stylize(""+Z,"number");if(v(Z))return j.stylize(""+Z,"boolean");if(T(Z))return j.stylize("null","null")}function a(j){return"["+Error.prototype.toString.call(j)+"]"}function s(j,Z,re,fe,le){for(var ce=[],V=0,ee=Z.length;V-1&&(ce?ee=ee.split(` -`).map(function(K){return" "+K}).join(` +`).map(function($){return" "+$}).join(` `).slice(2):ee=` `+ee.split(` -`).map(function(K){return" "+K}).join(` +`).map(function($){return" "+$}).join(` `))):ee=j.stylize("[Circular]","special")),M(V)){if(ce&&le.match(/^\d+$/))return ee;V=JSON.stringify(""+le),V.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(V=V.slice(1,-1),V=j.stylize(V,"name")):(V=V.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),V=j.stylize(V,"string"))}return V+": "+ee}function c(j,Z,re){var fe=j.reduce(function(le,ce){return ce.indexOf(` `)>=0,le+ce.replace(/\u001b\[\d\d?m/g,"").length+1},0);return fe>60?re[0]+(Z===""?"":Z+` `)+" "+j.join(`, - `)+" "+re[1]:re[0]+Z+" "+j.join(", ")+" "+re[1]}$.types=rc();function p(j){return Array.isArray(j)}$.isArray=p;function d(j){return typeof j=="boolean"}$.isBoolean=d;function T(j){return j===null}$.isNull=T;function l(j){return j==null}$.isNullOrUndefined=l;function g(j){return typeof j=="number"}$.isNumber=g;function x(j){return typeof j=="string"}$.isString=x;function A(j){return typeof j=="symbol"}$.isSymbol=A;function M(j){return j===void 0}$.isUndefined=M;function _(j){return w(j)&&I(j)==="[object RegExp]"}$.isRegExp=_,$.types.isRegExp=_;function w(j){return typeof j=="object"&&j!==null}$.isObject=w;function m(j){return w(j)&&I(j)==="[object Date]"}$.isDate=m,$.types.isDate=m;function u(j){return w(j)&&(I(j)==="[object Error]"||j instanceof Error)}$.isError=u,$.types.isNativeError=u;function v(j){return typeof j=="function"}$.isFunction=v;function y(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}$.isPrimitive=y,$.isBuffer=Jc();function I(j){return Object.prototype.toString.call(j)}function L(j){return j<10?"0"+j.toString(10):j.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var j=new Date,Z=[L(j.getHours()),L(j.getMinutes()),L(j.getSeconds())].join(":");return[j.getDate(),z[j.getMonth()],Z].join(" ")}$.log=function(){console.log("%s - %s",F(),$.format.apply($,arguments))},$.inherits=gp(),$._extend=function(j,Z){if(!Z||!w(Z))return j;for(var re=Object.keys(Z),fe=re.length;fe--;)j[re[fe]]=Z[re[fe]];return j};function N(j,Z){return Object.prototype.hasOwnProperty.call(j,Z)}var B=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;$.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(B&&Z[B]){var re=Z[B];if(typeof re!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(re,B,{value:re,enumerable:!1,writable:!1,configurable:!0}),re}function re(){for(var fe,le,ce=new Promise(function(ne,K){fe=ne,le=K}),V=[],ee=0;ee"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 i(g){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},i(g)}var a={},s,f;function c(g,x,A){A||(A=Error);function M(w,m,u){return typeof x=="string"?x:x(w,m,u)}var _=(function(w){E(u,w);var m=t(u);function u(v,y,I){var L;return S(this,u),L=m.call(this,M(v,y,I)),L.code=g,L}return b(u)})(A);a[g]=_}function p(g,x){if(Array.isArray(g)){var A=g.length;return g=g.map(function(M){return String(M)}),A>2?"one of ".concat(x," ").concat(g.slice(0,A-1).join(", "),", or ")+g[A-1]:A===2?"one of ".concat(x," ").concat(g[0]," or ").concat(g[1]):"of ".concat(x," ").concat(g[0])}else return"of ".concat(x," ").concat(String(g))}function d(g,x,A){return g.substr(0,x.length)===x}function T(g,x,A){return(A===void 0||A>g.length)&&(A=g.length),g.substring(A-x.length,A)===x}function l(g,x,A){return typeof A!="number"&&(A=0),A+x.length>g.length?!1:g.indexOf(x,A)!==-1}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",function(g,x,A){s===void 0&&(s=Ty()),s(typeof g=="string","'name' must be a string");var M;typeof x=="string"&&d(x,"not ")?(M="must not be",x=x.replace(/^not /,"")):M="must be";var _;if(T(g," argument"))_="The ".concat(g," ").concat(M," ").concat(p(x,"type"));else{var w=l(g,".")?"property":"argument";_='The "'.concat(g,'" ').concat(w," ").concat(M," ").concat(p(x,"type"))}return _+=". Received type ".concat(h(A)),_},TypeError),c("ERR_INVALID_ARG_VALUE",function(g,x){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";f===void 0&&(f=_p());var M=f.inspect(x);return M.length>128&&(M="".concat(M.slice(0,128),"...")),"The argument '".concat(g,"' ").concat(A,". Received ").concat(M)},TypeError),c("ERR_INVALID_RETURN_VALUE",function(g,x,A){var M;return A&&A.constructor&&A.constructor.name?M="instance of ".concat(A.constructor.name):M="type ".concat(h(A)),"Expected ".concat(g,' to be returned from the "').concat(x,'"')+" function but got ".concat(M,".")},TypeError),c("ERR_MISSING_ARGS",function(){for(var g=arguments.length,x=new Array(g),A=0;A0,"At least one arg needs to be specified");var M="The ",_=x.length;switch(x=x.map(function(w){return'"'.concat(w,'"')}),_){case 1:M+="".concat(x[0]," argument");break;case 2:M+="".concat(x[0]," and ").concat(x[1]," arguments");break;default:M+=x.slice(0,_-1).join(", "),M+=", and ".concat(x[_-1]," arguments");break}return"".concat(M," must be specified")},TypeError),G.exports.codes=a}}),Sm=Ge({"node_modules/assert/build/internal/assert/assertion_error.js"($,G){function h(U,j){var Z=Object.keys(U);if(Object.getOwnPropertySymbols){var re=Object.getOwnPropertySymbols(U);j&&(re=re.filter(function(fe){return Object.getOwnPropertyDescriptor(U,fe).enumerable})),Z.push.apply(Z,re)}return Z}function b(U){for(var j=1;j"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 d(U){return Function.toString.call(U).indexOf("[native code]")!==-1}function T(U,j){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(re,fe){return re.__proto__=fe,re},T(U,j)}function l(U){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},l(U)}function g(U){"@babel/helpers - typeof";return g=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},g(U)}var x=_p(),A=x.inspect,M=iv(),_=M.codes.ERR_INVALID_ARG_TYPE;function w(U,j,Z){return(Z===void 0||Z>U.length)&&(Z=U.length),U.substring(Z-j.length,Z)===j}function m(U,j){if(j=Math.floor(j),U.length==0||j==0)return"";var Z=U.length*j;for(j=Math.floor(Math.log(j)/Math.log(2));j;)U+=U,j--;return U+=U.substring(0,Z-U.length),U}var u="",v="",y="",I="",L={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},z=10;function F(U){var j=Object.keys(U),Z=Object.create(Object.getPrototypeOf(U));return j.forEach(function(re){Z[re]=U[re]}),Object.defineProperty(Z,"message",{value:U.message}),Z}function N(U){return A(U,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function B(U,j,Z){var re="",fe="",le=0,ce="",V=!1,ee=N(U),ne=ee.split(` -`),K=N(j).split(` -`),ue=0,te="";if(Z==="strictEqual"&&g(U)==="object"&&g(j)==="object"&&U!==null&&j!==null&&(Z="strictEqualObject"),ne.length===1&&K.length===1&&ne[0]!==K[0]){var H=ne[0].length+K[0].length;if(H<=z){if((g(U)!=="object"||U===null)&&(g(j)!=="object"||j===null)&&(U!==0||j!==0))return"".concat(L[Z],` + `)+" "+re[1]:re[0]+Z+" "+j.join(", ")+" "+re[1]}K.types=ic();function p(j){return Array.isArray(j)}K.isArray=p;function v(j){return typeof j=="boolean"}K.isBoolean=v;function T(j){return j===null}K.isNull=T;function l(j){return j==null}K.isNullOrUndefined=l;function g(j){return typeof j=="number"}K.isNumber=g;function x(j){return typeof j=="string"}K.isString=x;function A(j){return typeof j=="symbol"}K.isSymbol=A;function M(j){return j===void 0}K.isUndefined=M;function _(j){return w(j)&&I(j)==="[object RegExp]"}K.isRegExp=_,K.types.isRegExp=_;function w(j){return typeof j=="object"&&j!==null}K.isObject=w;function m(j){return w(j)&&I(j)==="[object Date]"}K.isDate=m,K.types.isDate=m;function u(j){return w(j)&&(I(j)==="[object Error]"||j instanceof Error)}K.isError=u,K.types.isNativeError=u;function d(j){return typeof j=="function"}K.isFunction=d;function y(j){return j===null||typeof j=="boolean"||typeof j=="number"||typeof j=="string"||typeof j=="symbol"||typeof j>"u"}K.isPrimitive=y,K.isBuffer=tf();function I(j){return Object.prototype.toString.call(j)}function L(j){return j<10?"0"+j.toString(10):j.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var j=new Date,Z=[L(j.getHours()),L(j.getMinutes()),L(j.getSeconds())].join(":");return[j.getDate(),z[j.getMonth()],Z].join(" ")}K.log=function(){console.log("%s - %s",F(),K.format.apply(K,arguments))},K.inherits=Tp(),K._extend=function(j,Z){if(!Z||!w(Z))return j;for(var re=Object.keys(Z),fe=re.length;fe--;)j[re[fe]]=Z[re[fe]];return j};function N(j,Z){return Object.prototype.hasOwnProperty.call(j,Z)}var B=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;K.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(B&&Z[B]){var re=Z[B];if(typeof re!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(re,B,{value:re,enumerable:!1,writable:!1,configurable:!0}),re}function re(){for(var fe,le,ce=new Promise(function(ne,$){fe=ne,le=$}),V=[],ee=0;ee"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 i(g){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},i(g)}var a={},s,f;function c(g,x,A){A||(A=Error);function M(w,m,u){return typeof x=="string"?x:x(w,m,u)}var _=(function(w){E(u,w);var m=t(u);function u(d,y,I){var L;return S(this,u),L=m.call(this,M(d,y,I)),L.code=g,L}return b(u)})(A);a[g]=_}function p(g,x){if(Array.isArray(g)){var A=g.length;return g=g.map(function(M){return String(M)}),A>2?"one of ".concat(x," ").concat(g.slice(0,A-1).join(", "),", or ")+g[A-1]:A===2?"one of ".concat(x," ").concat(g[0]," or ").concat(g[1]):"of ".concat(x," ").concat(g[0])}else return"of ".concat(x," ").concat(String(g))}function v(g,x,A){return g.substr(0,x.length)===x}function T(g,x,A){return(A===void 0||A>g.length)&&(A=g.length),g.substring(A-x.length,A)===x}function l(g,x,A){return typeof A!="number"&&(A=0),A+x.length>g.length?!1:g.indexOf(x,A)!==-1}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",function(g,x,A){s===void 0&&(s=Ey()),s(typeof g=="string","'name' must be a string");var M;typeof x=="string"&&v(x,"not ")?(M="must not be",x=x.replace(/^not /,"")):M="must be";var _;if(T(g," argument"))_="The ".concat(g," ").concat(M," ").concat(p(x,"type"));else{var w=l(g,".")?"property":"argument";_='The "'.concat(g,'" ').concat(w," ").concat(M," ").concat(p(x,"type"))}return _+=". Received type ".concat(h(A)),_},TypeError),c("ERR_INVALID_ARG_VALUE",function(g,x){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";f===void 0&&(f=Sp());var M=f.inspect(x);return M.length>128&&(M="".concat(M.slice(0,128),"...")),"The argument '".concat(g,"' ").concat(A,". Received ").concat(M)},TypeError),c("ERR_INVALID_RETURN_VALUE",function(g,x,A){var M;return A&&A.constructor&&A.constructor.name?M="instance of ".concat(A.constructor.name):M="type ".concat(h(A)),"Expected ".concat(g,' to be returned from the "').concat(x,'"')+" function but got ".concat(M,".")},TypeError),c("ERR_MISSING_ARGS",function(){for(var g=arguments.length,x=new Array(g),A=0;A0,"At least one arg needs to be specified");var M="The ",_=x.length;switch(x=x.map(function(w){return'"'.concat(w,'"')}),_){case 1:M+="".concat(x[0]," argument");break;case 2:M+="".concat(x[0]," and ").concat(x[1]," arguments");break;default:M+=x.slice(0,_-1).join(", "),M+=", and ".concat(x[_-1]," arguments");break}return"".concat(M," must be specified")},TypeError),G.exports.codes=a}}),Lm=Ge({"node_modules/assert/build/internal/assert/assertion_error.js"(K,G){function h(U,j){var Z=Object.keys(U);if(Object.getOwnPropertySymbols){var re=Object.getOwnPropertySymbols(U);j&&(re=re.filter(function(fe){return Object.getOwnPropertyDescriptor(U,fe).enumerable})),Z.push.apply(Z,re)}return Z}function b(U){for(var j=1;j"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 v(U){return Function.toString.call(U).indexOf("[native code]")!==-1}function T(U,j){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(re,fe){return re.__proto__=fe,re},T(U,j)}function l(U){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},l(U)}function g(U){"@babel/helpers - typeof";return g=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},g(U)}var x=Sp(),A=x.inspect,M=ud(),_=M.codes.ERR_INVALID_ARG_TYPE;function w(U,j,Z){return(Z===void 0||Z>U.length)&&(Z=U.length),U.substring(Z-j.length,Z)===j}function m(U,j){if(j=Math.floor(j),U.length==0||j==0)return"";var Z=U.length*j;for(j=Math.floor(Math.log(j)/Math.log(2));j;)U+=U,j--;return U+=U.substring(0,Z-U.length),U}var u="",d="",y="",I="",L={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},z=10;function F(U){var j=Object.keys(U),Z=Object.create(Object.getPrototypeOf(U));return j.forEach(function(re){Z[re]=U[re]}),Object.defineProperty(Z,"message",{value:U.message}),Z}function N(U){return A(U,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function B(U,j,Z){var re="",fe="",le=0,ce="",V=!1,ee=N(U),ne=ee.split(` +`),$=N(j).split(` +`),ue=0,te="";if(Z==="strictEqual"&&g(U)==="object"&&g(j)==="object"&&U!==null&&j!==null&&(Z="strictEqualObject"),ne.length===1&&$.length===1&&ne[0]!==$[0]){var H=ne[0].length+$[0].length;if(H<=z){if((g(U)!=="object"||U===null)&&(g(j)!=="object"||j===null)&&(U!==0||j!==0))return"".concat(L[Z],` -`)+"".concat(ne[0]," !== ").concat(K[0],` -`)}else if(Z!=="strictEqualObject"){var ae=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(H2&&(te=` - `.concat(m(" ",ue),"^"),ue=0)}}}for(var ie=ne[ne.length-1],ve=K[K.length-1];ie===ve&&(ue++<2?ce=` - `.concat(ie).concat(ce):re=ie,ne.pop(),K.pop(),!(ne.length===0||K.length===0));)ie=ne[ne.length-1],ve=K[K.length-1];var Ae=Math.max(ne.length,K.length);if(Ae===0){var Ce=ee.split(` -`);if(Ce.length>30)for(Ce[26]="".concat(u,"...").concat(I);Ce.length>27;)Ce.pop();return"".concat(L.notIdentical,` +`)+"".concat(ne[0]," !== ").concat($[0],` +`)}else if(Z!=="strictEqualObject"){var ae=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(H2&&(te=` + `.concat(m(" ",ue),"^"),ue=0)}}}for(var ie=ne[ne.length-1],de=$[$.length-1];ie===de&&(ue++<2?ce=` + `.concat(ie).concat(ce):re=ie,ne.pop(),$.pop(),!(ne.length===0||$.length===0));)ie=ne[ne.length-1],de=$[$.length-1];var Se=Math.max(ne.length,$.length);if(Se===0){var Le=ee.split(` +`);if(Le.length>30)for(Le[26]="".concat(u,"...").concat(I);Le.length>27;)Le.pop();return"".concat(L.notIdentical,` -`).concat(Ce.join(` +`).concat(Le.join(` `),` `)}ue>3&&(ce=` `.concat(u,"...").concat(I).concat(ce),V=!0),re!==""&&(ce=` `.concat(re).concat(ce),re="");var Fe=0,ze=L[Z]+` -`.concat(v,"+ actual").concat(I," ").concat(y,"- expected").concat(I),Ye=" ".concat(u,"...").concat(I," Lines skipped");for(ue=0;ue1&&ue>2&&(it>4?(fe+=` -`.concat(u,"...").concat(I),V=!0):it>3&&(fe+=` - `.concat(K[ue-2]),Fe++),fe+=` - `.concat(K[ue-1]),Fe++),le=ue,re+=` -`.concat(y,"-").concat(I," ").concat(K[ue]),Fe++;else if(K.length1&&ue>2&&(it>4?(fe+=` -`.concat(u,"...").concat(I),V=!0):it>3&&(fe+=` +`.concat(d,"+ actual").concat(I," ").concat(y,"- expected").concat(I),Ye=" ".concat(u,"...").concat(I," Lines skipped");for(ue=0;ue1&&ue>2&&(st>4?(fe+=` +`.concat(u,"...").concat(I),V=!0):st>3&&(fe+=` + `.concat($[ue-2]),Fe++),fe+=` + `.concat($[ue-1]),Fe++),le=ue,re+=` +`.concat(y,"-").concat(I," ").concat($[ue]),Fe++;else if($.length1&&ue>2&&(st>4?(fe+=` +`.concat(u,"...").concat(I),V=!0):st>3&&(fe+=` `.concat(ne[ue-2]),Fe++),fe+=` `.concat(ne[ue-1]),Fe++),le=ue,fe+=` -`.concat(v,"+").concat(I," ").concat(ne[ue]),Fe++;else{var st=K[ue],nt=ne[ue],Qe=nt!==st&&(!w(nt,",")||nt.slice(0,-1)!==st);Qe&&w(st,",")&&st.slice(0,-1)===nt&&(Qe=!1,nt+=","),Qe?(it>1&&ue>2&&(it>4?(fe+=` -`.concat(u,"...").concat(I),V=!0):it>3&&(fe+=` +`.concat(d,"+").concat(I," ").concat(ne[ue]),Fe++;else{var ct=$[ue],at=ne[ue],et=at!==ct&&(!w(at,",")||at.slice(0,-1)!==ct);et&&w(ct,",")&&ct.slice(0,-1)===at&&(et=!1,at+=","),et?(st>1&&ue>2&&(st>4?(fe+=` +`.concat(u,"...").concat(I),V=!0):st>3&&(fe+=` `.concat(ne[ue-2]),Fe++),fe+=` `.concat(ne[ue-1]),Fe++),le=ue,fe+=` -`.concat(v,"+").concat(I," ").concat(nt),re+=` -`.concat(y,"-").concat(I," ").concat(st),Fe+=2):(fe+=re,re="",(it===1||ue===0)&&(fe+=` - `.concat(nt),Fe++))}if(Fe>20&&ue20&&ue30)for(H[26]="".concat(u,"...").concat(I);H.length>27;)H.pop();H.length===1?le=Z.call(this,"".concat(te," ").concat(H[0])):le=Z.call(this,"".concat(te,` `).concat(H.join(` `),` -`))}else{var ae=N(ne),ie="",ve=L[V];V==="notDeepEqual"||V==="notEqual"?(ae="".concat(L[V],` +`))}else{var ae=N(ne),ie="",de=L[V];V==="notDeepEqual"||V==="notEqual"?(ae="".concat(L[V],` -`).concat(ae),ae.length>1024&&(ae="".concat(ae.slice(0,1021),"..."))):(ie="".concat(N(K)),ae.length>512&&(ae="".concat(ae.slice(0,509),"...")),ie.length>512&&(ie="".concat(ie.slice(0,509),"...")),V==="deepEqual"||V==="equal"?ae="".concat(ve,` +`).concat(ae),ae.length>1024&&(ae="".concat(ae.slice(0,1021),"..."))):(ie="".concat(N($)),ae.length>512&&(ae="".concat(ae.slice(0,509),"...")),ie.length>512&&(ie="".concat(ie.slice(0,509),"...")),V==="deepEqual"||V==="equal"?ae="".concat(de,` `).concat(ae,` should equal -`):ie=" ".concat(V," ").concat(ie)),le=Z.call(this,"".concat(ae).concat(ie))}return Error.stackTraceLimit=ue,le.generatedMessage=!ce,Object.defineProperty(s(le),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),le.code="ERR_ASSERTION",le.actual=ne,le.expected=K,le.operator=V,Error.captureStackTrace&&Error.captureStackTrace(s(le),ee),le.stack,le.name="AssertionError",a(le)}return t(re,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:j,value:function(le,ce){return A(this,b(b({},ce),{},{customInspect:!1,depth:0}))}}]),re})(f(Error),A.custom);G.exports=R}}),xg=Ge({"node_modules/object-keys/isArguments.js"($,G){var h=Object.prototype.toString;G.exports=function(S){var E=h.call(S),e=E==="[object Arguments]";return e||(e=E!=="[object Array]"&&S!==null&&typeof S=="object"&&typeof S.length=="number"&&S.length>=0&&h.call(S.callee)==="[object Function]"),e}}}),G0=Ge({"node_modules/object-keys/implementation.js"($,G){var h;Object.keys||(b=Object.prototype.hasOwnProperty,S=Object.prototype.toString,E=xg(),e=Object.prototype.propertyIsEnumerable,t=!e.call({toString:null},"toString"),r=e.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=function(f){var c=f.constructor;return c&&c.prototype===f},i={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},a=(function(){if(typeof window>"u")return!1;for(var f in window)try{if(!i["$"+f]&&b.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{n(window[f])}catch{return!0}}catch{return!0}return!1})(),s=function(f){if(typeof window>"u"||!a)return n(f);try{return n(f)}catch{return!1}},h=function(c){var p=c!==null&&typeof c=="object",d=S.call(c)==="[object Function]",T=E(c),l=p&&S.call(c)==="[object String]",g=[];if(!p&&!d&&!T)throw new TypeError("Object.keys called on a non-object");var x=r&&d;if(l&&c.length>0&&!b.call(c,0))for(var A=0;A0)for(var M=0;M2?arguments[2]:{},c=h(s);b&&(c=E.call(c,Object.getOwnPropertySymbols(s)));for(var p=0;pQe.length)&&(Le=Qe.length);for(var Te=0,pe=new Array(Le);Te10)return!0;for(var Le=0;Le57)return!0}return Qe.length===10&&Qe>=Math.pow(2,32)}function R(Qe){return Object.keys(Qe).filter(B).concat(s(Qe).filter(Object.prototype.propertyIsEnumerable.bind(Qe)))}function U(Qe,Le){if(Qe===Le)return 0;for(var Te=Qe.length,pe=Le.length,Ne=0,ot=Math.min(Te,pe);Ne1?V-1:0),ne=1;ne1?V-1:0),ne=1;ne1?V-1:0),ne=1;ne1?V-1:0),ne=1;ne=0&&h.call(S.callee)==="[object Function]"),e}}}),W0=Ge({"node_modules/object-keys/implementation.js"(K,G){var h;Object.keys||(b=Object.prototype.hasOwnProperty,S=Object.prototype.toString,E=Tg(),e=Object.prototype.propertyIsEnumerable,t=!e.call({toString:null},"toString"),r=e.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=function(f){var c=f.constructor;return c&&c.prototype===f},i={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},a=(function(){if(typeof window>"u")return!1;for(var f in window)try{if(!i["$"+f]&&b.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{n(window[f])}catch{return!0}}catch{return!0}return!1})(),s=function(f){if(typeof window>"u"||!a)return n(f);try{return n(f)}catch{return!1}},h=function(c){var p=c!==null&&typeof c=="object",v=S.call(c)==="[object Function]",T=E(c),l=p&&S.call(c)==="[object String]",g=[];if(!p&&!v&&!T)throw new TypeError("Object.keys called on a non-object");var x=r&&v;if(l&&c.length>0&&!b.call(c,0))for(var A=0;A0)for(var M=0;M2?arguments[2]:{},c=h(s);b&&(c=E.call(c,Object.getOwnPropertySymbols(s)));for(var p=0;pet.length)&&(Pe=et.length);for(var Ae=0,pe=new Array(Pe);Ae10)return!0;for(var Pe=0;Pe57)return!0}return et.length===10&&et>=Math.pow(2,32)}function R(et){return Object.keys(et).filter(B).concat(s(et).filter(Object.prototype.propertyIsEnumerable.bind(et)))}function U(et,Pe){if(et===Pe)return 0;for(var Ae=et.length,pe=Pe.length,Ne=0,ut=Math.min(Ae,pe);Ne1?V-1:0),ne=1;ne1?V-1:0),ne=1;ne1?V-1:0),ne=1;ne1?V-1:0),ne=1;ne0)return t(i);if(s==="number"&&isNaN(i)===!1)return a.long?o(i):r(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function t(i){if(i=String(i),!(i.length>100)){var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(a){var s=parseFloat(a[1]),f=(a[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return s*e;case"days":case"day":case"d":return s*E;case"hours":case"hour":case"hrs":case"hr":case"h":return s*S;case"minutes":case"minute":case"mins":case"min":case"m":return s*b;case"seconds":case"second":case"secs":case"sec":case"s":return s*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(i){return i>=E?Math.round(i/E)+"d":i>=S?Math.round(i/S)+"h":i>=b?Math.round(i/b)+"m":i>=h?Math.round(i/h)+"s":i+"ms"}function o(i){return n(i,E,"day")||n(i,S,"hour")||n(i,b,"minute")||n(i,h,"second")||i+" ms"}function n(i,a,s){if(!(i=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}$.formatters.j=function(r){try{return JSON.stringify(r)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}};function b(r){var o=this.useColors;if(r[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+r[0]+(o?"%c ":" ")+"+"+$.humanize(this.diff),!!o){var n="color: "+this.color;r.splice(1,0,n,"color: inherit");var i=0,a=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(i++,s==="%c"&&(a=i))}),r.splice(a,0,n)}}function S(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function E(r){try{r==null?$.storage.removeItem("debug"):$.storage.debug=r}catch{}}function e(){var r;try{r=$.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=ut.DEBUG),r}$.enable(e());function t(){try{return window.localStorage}catch{}}}}),mA=Ge({"node_modules/stream-parser/index.js"($,G){var h=Ty(),b=pA()("stream-parser");G.exports=r;var S=-1,E=0,e=1,t=2;function r(l){var g=l&&typeof l._transform=="function",x=l&&typeof l._write=="function";if(!g&&!x)throw new Error("must pass a Writable or Transform stream in");b("extending Parser into stream"),l._bytes=n,l._skipBytes=i,g&&(l._passthrough=a),g?l._transform=f:l._write=s}function o(l){b("initializing parser stream"),l._parserBytesLeft=0,l._parserBuffers=[],l._parserBuffered=0,l._parserState=S,l._parserCallback=null,typeof l.push=="function"&&(l._parserOutput=l.push.bind(l)),l._parserInit=!0}function n(l,g){h(!this._parserCallback,'there is already a "callback" set!'),h(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||o(this),b("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=g,this._parserState=E}function i(l,g){h(!this._parserCallback,'there is already a "callback" set!'),h(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||o(this),b("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=g,this._parserState=e}function a(l,g){h(!this._parserCallback,'There is already a "callback" set!'),h(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||o(this),b("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=g,this._parserState=t}function s(l,g,x){this._parserInit||o(this),b("write(%o bytes)",l.length),typeof g=="function"&&(x=g),d(this,l,null,x)}function f(l,g,x){this._parserInit||o(this),b("transform(%o bytes)",l.length),typeof g!="function"&&(g=this._parserOutput),d(this,l,g,x)}function c(l,g,x,A){return l._parserBytesLeft<=0?A(new Error("got data but not currently parsing anything")):g.length<=l._parserBytesLeft?function(){return p(l,g,x,A)}:function(){var M=g.slice(0,l._parserBytesLeft);return p(l,M,x,function(_){if(_)return A(_);if(g.length>M.length)return function(){return c(l,g.slice(M.length),x,A)}})}}function p(l,g,x,A){if(l._parserBytesLeft-=g.length,b("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===E?(l._parserBuffers.push(g),l._parserBuffered+=g.length):l._parserState===t&&x(g),l._parserBytesLeft===0){var M=l._parserCallback;if(M&&l._parserState===E&&l._parserBuffers.length>1&&(g=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==E&&(g=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=S,l._parserBuffers.splice(0),M){var _=[];g&&_.push(g),x&&_.push(x);var w=M.length>_.length;w&&_.push(T(A));var m=M.apply(l,_);if(!w||A===m)return A}}else return A}var d=T(c);function T(l){return function(){for(var g=l.apply(this,arguments);typeof g=="function";)g=g();return g}}}}),kc=Ge({"node_modules/probe-image-size/lib/common.js"($){var G=vb().Transform,h=mA();function b(){G.call(this,{readableObjectMode:!0})}b.prototype=Object.create(G.prototype),b.prototype.constructor=b,h(b.prototype),$.ParserStream=b,$.sliceEq=function(E,e,t){for(var r=e,o=0;o>4&15,c=a[4]&15,p=a[5]>>4&15,d=h(a,6),T=8,l=0;ld.width||p.width===d.width&&p.height>d.height?p:d}),f=a.reduce(function(p,d){return p.height>d.height||p.height===d.height&&p.width>d.width?p:d}),c;return s.width>f.height||s.width===f.height&&s.height>f.width?c=s:c=f,c}G.exports.readSizeFromMeta=function(a){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(n(a,s),!!s.sizes.length){var f=i(s.sizes),c=1;s.transforms.forEach(function(d){var T={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},l={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(d.type==="imir"&&(d.value===0?c=l[c]:(c=l[c],c=T[c],c=T[c])),d.type==="irot")for(var g=0;g0&&!this.aborted;){var t=this.ifds_to_read.shift();t.offset&&this.scan_ifd(t.id,t.offset,E)}},S.prototype.read_uint16=function(E){var e=this.input;if(E+2>e.length)throw h("unexpected EOF","EBADDATA");return this.big_endian?e[E]*256+e[E+1]:e[E]+e[E+1]*256},S.prototype.read_uint32=function(E){var e=this.input;if(E+4>e.length)throw h("unexpected EOF","EBADDATA");return this.big_endian?e[E]*16777216+e[E+1]*65536+e[E+2]*256+e[E+3]:e[E]+e[E+1]*256+e[E+2]*65536+e[E+3]*16777216},S.prototype.is_subifd_link=function(E,e){return E===0&&e===34665||E===0&&e===34853||E===34665&&e===40965},S.prototype.exif_format_length=function(E){switch(E){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},S.prototype.exif_format_read=function(E,e){var t;switch(E){case 1:case 2:return t=this.input[e],t;case 6:return t=this.input[e],t|(t&128)*33554430;case 3:return t=this.read_uint16(e),t;case 8:return t=this.read_uint16(e),t|(t&32768)*131070;case 4:return t=this.read_uint32(e),t;case 9:return t=this.read_uint32(e),t|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},S.prototype.scan_ifd=function(E,e,t){var r=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw h("unexpected EOF","EBADDATA");for(var d=[],T=c,l=0;l0&&(this.ifds_to_read.push({id:n,offset:d[0]}),p=!0);var x={is_big_endian:this.big_endian,ifd:E,tag:n,format:i,count:a,entry_offset:e+this.start,data_length:f,data_offset:c+this.start,value:d,is_subifd_link:p};if(t(x)===!1){this.aborted=!0;return}e+=12}E===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},G.exports.ExifParser=S,G.exports.get_orientation=function(E){var e=0;try{return new S(E,0,E.length).each(function(t){if(t.ifd===0&&t.tag===274&&Array.isArray(t.value))return e=t.value[0],!1}),e}catch{return-1}}}}),HM=Ge({"node_modules/probe-image-size/lib/parse_sync/avif.js"($,G){var h=kc().str2arr,b=kc().sliceEq,S=kc().readUInt32BE,E=mb(),e=a_(),t=h("ftyp");G.exports=function(r){if(b(r,4,t)){var o=E.unbox(r,0);if(o){var n=E.getMimeType(o.data);if(n){for(var i,a=o.end;;){var s=E.unbox(r,a);if(!s)break;if(a=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){i=s.data;break}}if(i){var f=E.readSizeFromMeta(i);if(f){var c={width:f.width,height:f.height,type:n.type,mime:n.mime,wUnits:"px",hUnits:"px"};if(f.variants.length>1&&(c.variants=f.variants),f.orientation&&(c.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=r.length){var p=S(r,f.exif_location.offset),d=r.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),T=e.get_orientation(d);T>0&&(c.orientation=T)}return c}}}}}}}}),GM=Ge({"node_modules/probe-image-size/lib/parse_sync/bmp.js"($,G){var h=kc().str2arr,b=kc().sliceEq,S=kc().readUInt16LE,E=h("BM");G.exports=function(e){if(!(e.length<26)&&b(e,0,E))return{width:S(e,18),height:S(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),XM=Ge({"node_modules/probe-image-size/lib/parse_sync/gif.js"($,G){var h=kc().str2arr,b=kc().sliceEq,S=kc().readUInt16LE,E=h("GIF87a"),e=h("GIF89a");G.exports=function(t){if(!(t.length<10)&&!(!b(t,0,E)&&!b(t,0,e)))return{width:S(t,6),height:S(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),gA=Ge({"node_modules/probe-image-size/lib/parse_sync/ico.js"($,G){var h=kc().readUInt16LE,b=0,S=1,E=16;G.exports=function(e){var t=h(e,0),r=h(e,2),o=h(e,4);if(!(t!==b||r!==S||!o)){for(var n=[],i={width:0,height:0},a=0;ai.width||f>i.height)&&(i=c)}return{width:i.width,height:i.height,variants:n,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),yA=Ge({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"($,G){var h=kc().readUInt16BE,b=kc().str2arr,S=kc().sliceEq,E=a_(),e=b("Exif\0\0");G.exports=function(t){if(!(t.length<2)&&!(t[0]!==255||t[1]!==216||t[2]!==255))for(var r=2;;){for(;;){if(t.length-r<2)return;if(t[r++]===255)break}for(var o=t[r++],n;o===255;)o=t[r++];if(208<=o&&o<=217||o===1)n=0;else if(192<=o&&o<=254){if(t.length-r<2)return;n=h(t,r)-2,r+=2}else return;if(o===217||o===218)return;var i;if(o===225&&n>=10&&S(t,r,e)&&(i=E.get_orientation(t.slice(r+6,r+n))),n>=5&&192<=o&&o<=207&&o!==196&&o!==200&&o!==204){if(t.length-r0&&(a.orientation=i),a}r+=n}}}}),Sy=Ge({"node_modules/probe-image-size/lib/parse_sync/png.js"($,G){var h=kc().str2arr,b=kc().sliceEq,S=kc().readUInt32BE,E=h(`‰PNG\r +`));var te=new a({actual:le,expected:ce,message:V,operator:ne,stackStartFn:ee});throw te.generatedMessage=ue,te}}w.match=function le(ce,V,ee){re(ce,V,ee,le,"match")},w.doesNotMatch=function le(ce,V,ee){re(ce,V,ee,le,"doesNotMatch")};function fe(){for(var le=arguments.length,ce=new Array(le),V=0;V0)return t(i);if(s==="number"&&isNaN(i)===!1)return a.long?o(i):r(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function t(i){if(i=String(i),!(i.length>100)){var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(a){var s=parseFloat(a[1]),f=(a[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return s*e;case"days":case"day":case"d":return s*E;case"hours":case"hour":case"hrs":case"hr":case"h":return s*S;case"minutes":case"minute":case"mins":case"min":case"m":return s*b;case"seconds":case"second":case"secs":case"sec":case"s":return s*h;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(i){return i>=E?Math.round(i/E)+"d":i>=S?Math.round(i/S)+"h":i>=b?Math.round(i/b)+"m":i>=h?Math.round(i/h)+"s":i+"ms"}function o(i){return n(i,E,"day")||n(i,S,"hour")||n(i,b,"minute")||n(i,h,"second")||i+" ms"}function n(i,a,s){if(!(i=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}K.formatters.j=function(r){try{return JSON.stringify(r)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}};function b(r){var o=this.useColors;if(r[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+r[0]+(o?"%c ":" ")+"+"+K.humanize(this.diff),!!o){var n="color: "+this.color;r.splice(1,0,n,"color: inherit");var i=0,a=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(i++,s==="%c"&&(a=i))}),r.splice(a,0,n)}}function S(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function E(r){try{r==null?K.storage.removeItem("debug"):K.storage.debug=r}catch{}}function e(){var r;try{r=K.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=Ke.DEBUG),r}K.enable(e());function t(){try{return window.localStorage}catch{}}}}),SA=Ge({"node_modules/stream-parser/index.js"(K,G){var h=Ey(),b=AA()("stream-parser");G.exports=r;var S=-1,E=0,e=1,t=2;function r(l){var g=l&&typeof l._transform=="function",x=l&&typeof l._write=="function";if(!g&&!x)throw new Error("must pass a Writable or Transform stream in");b("extending Parser into stream"),l._bytes=n,l._skipBytes=i,g&&(l._passthrough=a),g?l._transform=f:l._write=s}function o(l){b("initializing parser stream"),l._parserBytesLeft=0,l._parserBuffers=[],l._parserBuffered=0,l._parserState=S,l._parserCallback=null,typeof l.push=="function"&&(l._parserOutput=l.push.bind(l)),l._parserInit=!0}function n(l,g){h(!this._parserCallback,'there is already a "callback" set!'),h(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||o(this),b("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=g,this._parserState=E}function i(l,g){h(!this._parserCallback,'there is already a "callback" set!'),h(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||o(this),b("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=g,this._parserState=e}function a(l,g){h(!this._parserCallback,'There is already a "callback" set!'),h(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||o(this),b("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=g,this._parserState=t}function s(l,g,x){this._parserInit||o(this),b("write(%o bytes)",l.length),typeof g=="function"&&(x=g),v(this,l,null,x)}function f(l,g,x){this._parserInit||o(this),b("transform(%o bytes)",l.length),typeof g!="function"&&(g=this._parserOutput),v(this,l,g,x)}function c(l,g,x,A){return l._parserBytesLeft<=0?A(new Error("got data but not currently parsing anything")):g.length<=l._parserBytesLeft?function(){return p(l,g,x,A)}:function(){var M=g.slice(0,l._parserBytesLeft);return p(l,M,x,function(_){if(_)return A(_);if(g.length>M.length)return function(){return c(l,g.slice(M.length),x,A)}})}}function p(l,g,x,A){if(l._parserBytesLeft-=g.length,b("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===E?(l._parserBuffers.push(g),l._parserBuffered+=g.length):l._parserState===t&&x(g),l._parserBytesLeft===0){var M=l._parserCallback;if(M&&l._parserState===E&&l._parserBuffers.length>1&&(g=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==E&&(g=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=S,l._parserBuffers.splice(0),M){var _=[];g&&_.push(g),x&&_.push(x);var w=M.length>_.length;w&&_.push(T(A));var m=M.apply(l,_);if(!w||A===m)return A}}else return A}var v=T(c);function T(l){return function(){for(var g=l.apply(this,arguments);typeof g=="function";)g=g();return g}}}}),Rc=Ge({"node_modules/probe-image-size/lib/common.js"(K){var G=mb().Transform,h=SA();function b(){G.call(this,{readableObjectMode:!0})}b.prototype=Object.create(G.prototype),b.prototype.constructor=b,h(b.prototype),K.ParserStream=b,K.sliceEq=function(E,e,t){for(var r=e,o=0;o>4&15,c=a[4]&15,p=a[5]>>4&15,v=h(a,6),T=8,l=0;lv.width||p.width===v.width&&p.height>v.height?p:v}),f=a.reduce(function(p,v){return p.height>v.height||p.height===v.height&&p.width>v.width?p:v}),c;return s.width>f.height||s.width===f.height&&s.height>f.width?c=s:c=f,c}G.exports.readSizeFromMeta=function(a){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(n(a,s),!!s.sizes.length){var f=i(s.sizes),c=1;s.transforms.forEach(function(v){var T={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},l={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(v.type==="imir"&&(v.value===0?c=l[c]:(c=l[c],c=T[c],c=T[c])),v.type==="irot")for(var g=0;g0&&!this.aborted;){var t=this.ifds_to_read.shift();t.offset&&this.scan_ifd(t.id,t.offset,E)}},S.prototype.read_uint16=function(E){var e=this.input;if(E+2>e.length)throw h("unexpected EOF","EBADDATA");return this.big_endian?e[E]*256+e[E+1]:e[E]+e[E+1]*256},S.prototype.read_uint32=function(E){var e=this.input;if(E+4>e.length)throw h("unexpected EOF","EBADDATA");return this.big_endian?e[E]*16777216+e[E+1]*65536+e[E+2]*256+e[E+3]:e[E]+e[E+1]*256+e[E+2]*65536+e[E+3]*16777216},S.prototype.is_subifd_link=function(E,e){return E===0&&e===34665||E===0&&e===34853||E===34665&&e===40965},S.prototype.exif_format_length=function(E){switch(E){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},S.prototype.exif_format_read=function(E,e){var t;switch(E){case 1:case 2:return t=this.input[e],t;case 6:return t=this.input[e],t|(t&128)*33554430;case 3:return t=this.read_uint16(e),t;case 8:return t=this.read_uint16(e),t|(t&32768)*131070;case 4:return t=this.read_uint32(e),t;case 9:return t=this.read_uint32(e),t|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},S.prototype.scan_ifd=function(E,e,t){var r=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw h("unexpected EOF","EBADDATA");for(var v=[],T=c,l=0;l0&&(this.ifds_to_read.push({id:n,offset:v[0]}),p=!0);var x={is_big_endian:this.big_endian,ifd:E,tag:n,format:i,count:a,entry_offset:e+this.start,data_length:f,data_offset:c+this.start,value:v,is_subifd_link:p};if(t(x)===!1){this.aborted=!0;return}e+=12}E===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},G.exports.ExifParser=S,G.exports.get_orientation=function(E){var e=0;try{return new S(E,0,E.length).each(function(t){if(t.ifd===0&&t.tag===274&&Array.isArray(t.value))return e=t.value[0],!1}),e}catch{return-1}}}}),lE=Ge({"node_modules/probe-image-size/lib/parse_sync/avif.js"(K,G){var h=Rc().str2arr,b=Rc().sliceEq,S=Rc().readUInt32BE,E=_b(),e=l_(),t=h("ftyp");G.exports=function(r){if(b(r,4,t)){var o=E.unbox(r,0);if(o){var n=E.getMimeType(o.data);if(n){for(var i,a=o.end;;){var s=E.unbox(r,a);if(!s)break;if(a=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){i=s.data;break}}if(i){var f=E.readSizeFromMeta(i);if(f){var c={width:f.width,height:f.height,type:n.type,mime:n.mime,wUnits:"px",hUnits:"px"};if(f.variants.length>1&&(c.variants=f.variants),f.orientation&&(c.orientation=f.orientation),f.exif_location&&f.exif_location.offset+f.exif_location.length<=r.length){var p=S(r,f.exif_location.offset),v=r.slice(f.exif_location.offset+p+4,f.exif_location.offset+f.exif_location.length),T=e.get_orientation(v);T>0&&(c.orientation=T)}return c}}}}}}}}),uE=Ge({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(K,G){var h=Rc().str2arr,b=Rc().sliceEq,S=Rc().readUInt16LE,E=h("BM");G.exports=function(e){if(!(e.length<26)&&b(e,0,E))return{width:S(e,18),height:S(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),cE=Ge({"node_modules/probe-image-size/lib/parse_sync/gif.js"(K,G){var h=Rc().str2arr,b=Rc().sliceEq,S=Rc().readUInt16LE,E=h("GIF87a"),e=h("GIF89a");G.exports=function(t){if(!(t.length<10)&&!(!b(t,0,E)&&!b(t,0,e)))return{width:S(t,6),height:S(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),MA=Ge({"node_modules/probe-image-size/lib/parse_sync/ico.js"(K,G){var h=Rc().readUInt16LE,b=0,S=1,E=16;G.exports=function(e){var t=h(e,0),r=h(e,2),o=h(e,4);if(!(t!==b||r!==S||!o)){for(var n=[],i={width:0,height:0},a=0;ai.width||f>i.height)&&(i=c)}return{width:i.width,height:i.height,variants:n,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),EA=Ge({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(K,G){var h=Rc().readUInt16BE,b=Rc().str2arr,S=Rc().sliceEq,E=l_(),e=b("Exif\0\0");G.exports=function(t){if(!(t.length<2)&&!(t[0]!==255||t[1]!==216||t[2]!==255))for(var r=2;;){for(;;){if(t.length-r<2)return;if(t[r++]===255)break}for(var o=t[r++],n;o===255;)o=t[r++];if(208<=o&&o<=217||o===1)n=0;else if(192<=o&&o<=254){if(t.length-r<2)return;n=h(t,r)-2,r+=2}else return;if(o===217||o===218)return;var i;if(o===225&&n>=10&&S(t,r,e)&&(i=E.get_orientation(t.slice(r+6,r+n))),n>=5&&192<=o&&o<=207&&o!==196&&o!==200&&o!==204){if(t.length-r0&&(a.orientation=i),a}r+=n}}}}),Cy=Ge({"node_modules/probe-image-size/lib/parse_sync/png.js"(K,G){var h=Rc().str2arr,b=Rc().sliceEq,S=Rc().readUInt32BE,E=h(`‰PNG\r  -`),e=h("IHDR");G.exports=function(t){if(!(t.length<24)&&b(t,0,E)&&b(t,12,e))return{width:S(t,16),height:S(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),gb=Ge({"node_modules/probe-image-size/lib/parse_sync/psd.js"($,G){var h=kc().str2arr,b=kc().sliceEq,S=kc().readUInt32BE,E=h("8BPS\0");G.exports=function(e){if(!(e.length<22)&&b(e,0,E))return{width:S(e,18),height:S(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),_A=Ge({"node_modules/probe-image-size/lib/parse_sync/svg.js"($,G){function h(s){return s===32||s===9||s===13||s===10}function b(s){return typeof s=="number"&&isFinite(s)&&s>0}function S(s){var f=0,c=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(f=3);f]*>/,e=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,t=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,n=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function i(s){var f=s.match(t),c=s.match(r),p=s.match(o);return{width:f&&(f[1]||f[2]),height:c&&(c[1]||c[2]),viewbox:p&&(p[1]||p[2])}}function a(s){return n.test(s)?s.match(n)[0]:"px"}G.exports=function(s){if(S(s)){for(var f="",c=0;c>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function i(a,s){return{width:(a[s+6]<<16|a[s+5]<<8|a[s+4])+1,height:(a[s+9]<a.length)){for(;s+8=10?f=f||o(a,s+8):d==="VP8L"&&T>=9?f=f||n(a,s+8):d==="VP8X"&&T>=10?f=f||i(a,s+8):d==="EXIF"&&(c=e.get_orientation(a.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(f)return c>0&&(f.orientation=c),f}}}}}),wA=Ge({"node_modules/probe-image-size/lib/parsers_sync.js"($,G){G.exports={avif:HM(),bmp:GM(),gif:XM(),ico:gA(),jpeg:yA(),png:Sy(),psd:gb(),svg:_A(),tiff:xA(),webp:bA()}}}),TA=Ge({"node_modules/probe-image-size/sync.js"($,G){var h=wA();function b(S){for(var E=Object.keys(h),e=0;e0;)I=f.c2p(M+N*u),N--;for(N=0;z===void 0&&N0;)F=c.c2p(_+N*v),N--;if(IV[0];if(ee||ne){var K=y+R/2,ue=z+U/2;le+="transform:"+S(K+"px",ue+"px")+"scale("+(ee?-1:1)+","+(ne?-1:1)+")"+S(-K+"px",-ue+"px")+";"}}fe.attr("style",le);var te=new Promise(function(H){if(g._hasZ)H();else if(g._hasSource)if(g._canvas&&g._canvas.el.width===w&&g._canvas.el.height===m&&g._canvas.source===g.source)H();else{var ae=document.createElement("canvas");ae.width=w,ae.height=m;var ie=ae.getContext("2d",{willReadFrequently:!0});g._image=g._image||new Image;var ve=g._image;ve.onload=function(){ie.drawImage(ve,0,0),g._canvas={el:ae,source:g.source},H()},ve.setAttribute("src",g.source)}}).then(function(){var H,ae;if(g._hasZ)ae=re(function(Ae,Ce){var Fe=A[Ce][Ae];return b.isTypedArray(Fe)&&(Fe=Array.from(Fe)),Fe}),H=ae.toDataURL("image/png");else if(g._hasSource)if(x)H=g.source;else{var ie=g._canvas.el.getContext("2d",{willReadFrequently:!0}),ve=ie.getImageData(0,0,w,m).data;ae=re(function(Ae,Ce){var Fe=4*(Ce*w+Ae);return[ve[Fe],ve[Fe+1],ve[Fe+2],ve[Fe+3]]}),H=ae.toDataURL("image/png")}fe.attr({"xlink:href":H,height:U,width:R,x:y,y:z})});n._promises.push(te)})}}}),MA=Ge({"src/traces/image/style.js"($,G){var h=Za();G.exports=function(S){h.select(S).selectAll(".im image").style("opacity",function(E){return E[0].trace.opacity})}}}),lf=Ge({"src/traces/image/hover.js"($,G){var h=qf(),b=yn(),S=b.isArrayOrTypedArray,E=mp();G.exports=function(t,r,o){var n=t.cd[0],i=n.trace,a=t.xa,s=t.ya;if(!(h.inbox(r-n.x0,r-(n.x0+n.w*i.dx),0)>0||h.inbox(o-n.y0,o-(n.y0+n.h*i.dy),0)>0)){var f=Math.floor((r-n.x0)/i.dx),c=Math.floor(Math.abs(o-n.y0)/i.dy),p;if(i._hasZ?p=n.z[c][f]:i._hasSource&&(p=i._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,c,1,1).data),!!p){var d=n.hi||i.hoverinfo,T;if(d){var l=d.split("+");l.indexOf("all")!==-1&&(l=["color"]),l.indexOf("color")!==-1&&(T=!0)}var g=E.colormodel[i.colormodel],x=g.colormodel||i.colormodel,A=x.length,M=i._scaler(p),_=g.suffix,w=[];(i.hovertemplate||T)&&(w.push("["+[M[0]+_[0],M[1]+_[1],M[2]+_[2]].join(", ")),A===4&&w.push(", "+M[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=x.toUpperCase()+": "+w);var m;S(i.hovertext)&&S(i.hovertext[c])?m=i.hovertext[c][f]:S(i.text)&&S(i.text[c])&&(m=i.text[c][f]);var u=s.c2p(n.y0+(c+.5)*i.dy),v=n.x0+(f+.5)*i.dx,y=n.y0+(c+.5)*i.dy,I="["+p.slice(0,i.colormodel.length).join(", ")+"]";return[b.extendFlat(t,{index:[c,f],x0:a.c2p(n.x0+f*i.dx),x1:a.c2p(n.x0+(f+1)*i.dx),y0:u,y1:u,color:M,xVal:v,xLabelVal:v,yVal:y,yLabelVal:y,zLabelVal:I,text:m,hovertemplateLabels:{zLabel:I,colorLabel:w,"color[0]Label":M[0]+_[0],"color[1]Label":M[1]+_[1],"color[2]Label":M[2]+_[2],"color[3]Label":M[3]+_[3]}})]}}}}}),s3=Ge({"src/traces/image/event_data.js"($,G){G.exports=function(b,S){return"xVal"in S&&(b.x=S.xVal),"yVal"in S&&(b.y=S.yVal),S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),b.color=S.color,b.colormodel=S.trace.colormodel,b.z||(b.z=S.color),b}}}),YM=Ge({"src/traces/image/index.js"($,G){G.exports={attributes:W2(),supplyDefaults:J5(),calc:yb(),plot:SA(),style:MA(),hoverPoints:lf(),eventData:s3(),moduleType:"trace",name:"image",basePlotModule:ph(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),EA=Ge({"lib/image.js"($,G){G.exports=YM()}}),My=Ge({"src/traces/pie/attributes.js"($,G){var h=nu(),b=Sc().attributes,S=Fs(),E=rh(),{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=Qi().extendFlat,n=hv().pattern,i=S({editType:"plot",arrayOk:!0,colorEditType:"plot"});G.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:E.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:n,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},h.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:e({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:r(),texttemplate:t({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:r({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:o({},i,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:o({},i,{}),outsidetextfont:o({},i,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:o({},h.showlegend,{arrayOk:!0}),legend:o({},h.legend,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:o({},i,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:b({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Ey=Ge({"src/traces/pie/defaults.js"($,G){var h=Ga(),b=yn(),S=My(),E=Sc().defaults,e=kd().handleText,t=yn().coercePattern;function r(i,a){var s=b.isArrayOrTypedArray(i),f=b.isArrayOrTypedArray(a),c=Math.min(s?i.length:1/0,f?a.length:1/0);if(isFinite(c)||(c=0),c&&f){for(var p,d=0;d0){p=!0;break}}p||(c=0)}return{hasLabels:s,hasValues:f,len:c}}function o(i,a,s,f,c){var p=f("marker.line.width");p&&f("marker.line.color",c?void 0:s.paper_bgcolor);var d=f("marker.colors");t(f,"marker.pattern",d),i.marker&&!a.marker.pattern.fgcolor&&(a.marker.pattern.fgcolor=i.marker.colors),a.marker.pattern.bgcolor||(a.marker.pattern.bgcolor=s.paper_bgcolor)}function n(i,a,s,f){function c(y,I){return b.coerce(i,a,S,y,I)}var p=c("labels"),d=c("values"),T=r(p,d),l=T.len;if(a._hasLabels=T.hasLabels,a._hasValues=T.hasValues,!a._hasLabels&&a._hasValues&&(c("label0"),c("dlabel")),!l){a.visible=!1;return}a._length=l,o(i,a,f,c,!0),c("scalegroup");var g=c("text"),x=c("texttemplate");c("texttemplatefallback");var A;if(x||(A=c("textinfo",b.isArrayOrTypedArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),x||A&&A!=="none"){var M=c("textposition");e(i,a,f,c,M,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var _=Array.isArray(M)||M==="auto",w=_||M==="outside";w&&c("automargin"),(M==="inside"||M==="auto"||Array.isArray(M))&&c("insidetextorientation")}else A==="none"&&c("textposition","none");E(a,f,c);var m=c("hole"),u=c("title.text");if(u){var v=c("title.position",m?"middle center":"top center");!m&&v==="middle center"&&(a.title.position="top center"),b.coerceFont(c,"title.font",f.font)}c("sort"),c("direction"),c("rotation"),c("pull")}G.exports={handleLabelsAndValues:r,handleMarkerDefaults:o,supplyDefaults:n}}}),l3=Ge({"src/traces/pie/layout_attributes.js"($,G){G.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),_b=Ge({"src/traces/pie/layout_defaults.js"($,G){var h=yn(),b=l3();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("hiddenlabels"),t("piecolorway",e.colorway),t("extendpiecolors")}}}),v0=Ge({"src/traces/pie/calc.js"($,G){var h=Ga(),b=ks(),S=So(),E={};function e(n,i){var a=[],s=n._fullLayout,f=s.hiddenlabels||[],c=i.labels,p=i.marker.colors||[],d=i.values,T=i._length,l=i._hasValues&&T,g,x;if(i.dlabel)for(c=new Array(T),g=0;g=0});var I=i.type==="funnelarea"?w:i.sort;return I&&a.sort(function(L,z){return z.v-L.v}),a[0]&&(a[0].vTotal=_),a}function t(n){return function(a,s){return!a||(a=b(a),!a.isValid())?!1:(a=S.addOpacity(a,a.getAlpha()),n[s]||(n[s]=a),a)}}function r(n,i){var a=(i||{}).type;a||(a="pie");var s=n._fullLayout,f=n.calcdata,c=s[a+"colorway"],p=s["_"+a+"colormap"];s["extend"+a+"colors"]&&(c=o(c,E));for(var d=0,T=0;T0&&(ot+=Nt*pe.pxmid[0],ft+=Nt*pe.pxmid[1])}pe.cxFinal=ot,pe.cyFinal=ft;function $t(Mt,je,$e,Ee){var xe=Ee*(je[0]-Mt[0]),ye=Ee*(je[1]-Mt[1]);return"a"+Ee*ve.r+","+Ee*ve.r+" 0 "+pe.largeArc+($e?" 1 ":" 0 ")+xe+","+ye}var rr=Ae.hole;if(pe.v===ve.vTotal){var Er="M"+(ot+pe.px0[0])+","+(ft+pe.px0[1])+$t(pe.px0,pe.pxmid,!0,1)+$t(pe.pxmid,pe.px0,!0,1)+"Z";rr?Ft.attr("d","M"+(ot+rr*pe.px0[0])+","+(ft+rr*pe.px0[1])+$t(pe.px0,pe.pxmid,!1,rr)+$t(pe.pxmid,pe.px0,!1,rr)+"Z"+Er):Ft.attr("d",Er)}else{var Mr=$t(pe.px0,pe.px1,!0,1);if(rr){var Wr=1-rr;Ft.attr("d","M"+(ot+rr*pe.px1[0])+","+(ft+rr*pe.px1[1])+$t(pe.px1,pe.px0,!1,rr)+"l"+Wr*pe.px0[0]+","+Wr*pe.px0[1]+Mr+"Z")}else Ft.attr("d","M"+ot+","+ft+"l"+pe.px0[0]+","+pe.px0[1]+Mr+"Z")}ce(ee,pe,ve);var Sr=c.castOption(Ae.textposition,pe.pts),Br=rt.selectAll("g.slicetext").data(pe.text&&Sr!=="none"?[0]:[]);Br.enter().append("g").classed("slicetext",!0),Br.exit().remove(),Br.each(function(){var Mt=t.ensureSingle(h.select(this),"text","",function(Je){Je.attr("data-notex",1)}),je=t.ensureUniformFontSize(ee,Sr==="outside"?x(Ae,pe,ue.font):A(Ae,pe,ue.font));Mt.text(pe.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(e.font,je).call(n.convertToTspans,ee);var $e=e.bBox(Mt.node()),Ee;if(Sr==="outside")Ee=z($e,pe);else if(Ee=_($e,pe,ve),Sr==="auto"&&Ee.scale<1){var xe=t.ensureUniformFontSize(ee,Ae.outsidetextfont);Mt.call(e.font,xe),$e=e.bBox(Mt.node()),Ee=z($e,pe)}var ye=Ee.textPosAngle,Me=ye===void 0?pe.pxmid:le(ve.r,ye);if(Ee.targetX=ot+Me[0]*Ee.rCenter+(Ee.x||0),Ee.targetY=ft+Me[1]*Ee.rCenter+(Ee.y||0),V(Ee,$e),Ee.outside){var Xe=Ee.targetY;pe.yLabelMin=Xe-$e.height/2,pe.yLabelMid=Xe,pe.yLabelMax=Xe+$e.height/2,pe.labelExtraX=0,pe.labelExtraY=0,ze=!0}Ee.fontSize=je.size,a(Ae.type,Ee,ue),ae[Ne].transform=Ee,t.setTransormAndDisplay(Mt,Ee)})});var Ye=h.select(this).selectAll("g.titletext").data(Ae.title.text?[0]:[]);if(Ye.enter().append("g").classed("titletext",!0),Ye.exit().remove(),Ye.each(function(){var pe=t.ensureSingle(h.select(this),"text","",function(ft){ft.attr("data-notex",1)}),Ne=Ae.title.text;Ae._meta&&(Ne=t.templateString(Ne,Ae._meta)),pe.text(Ne).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(e.font,Ae.title.font).call(n.convertToTspans,ee);var ot;Ae.title.position==="middle center"?ot=F(ve):ot=N(ve,te),pe.attr("transform",o(ot.x,ot.y)+r(Math.min(1,ot.scale))+o(ot.tx,ot.ty))}),ze&&j(Fe,Ae),l(Ce,Ae),ze&&Ae.automargin){var it=e.bBox(ie.node()),st=Ae.domain,nt=te.w*(st.x[1]-st.x[0]),Qe=te.h*(st.y[1]-st.y[0]),Le=(.5*nt-ve.r)/te.w,Te=(.5*Qe-ve.r)/te.h;b.autoMargin(ee,"pie."+Ae.uid+".automargin",{xl:st.x[0]-Le,xr:st.x[1]+Le,yb:st.y[0]-Te,yt:st.y[1]+Te,l:Math.max(ve.cx-ve.r-it.left,0),r:Math.max(it.right-(ve.cx+ve.r),0),b:Math.max(it.bottom-(ve.cy+ve.r),0),t:Math.max(ve.cy-ve.r-it.top,0),pad:5})}})});setTimeout(function(){H.selectAll("tspan").each(function(){var ae=h.select(this);ae.attr("dy")&&ae.attr("dy",ae.attr("dy"))})},0)}function l(ee,ne){ee.each(function(K){var ue=h.select(this);if(!K.labelExtraX&&!K.labelExtraY){ue.select("path.textline").remove();return}var te=ue.select("g.slicetext text");K.transform.targetX+=K.labelExtraX,K.transform.targetY+=K.labelExtraY,t.setTransormAndDisplay(te,K.transform);var H=K.cxFinal+K.pxmid[0],ae=K.cyFinal+K.pxmid[1],ie="M"+H+","+ae,ve=(K.yLabelMax-K.yLabelMin)*(K.pxmid[0]<0?-1:1)/4;if(K.labelExtraX){var Ae=K.labelExtraX*K.pxmid[1]/K.pxmid[0],Ce=K.yLabelMid+K.labelExtraY-(K.cyFinal+K.pxmid[1]);Math.abs(Ae)>Math.abs(Ce)?ie+="l"+Ce*K.pxmid[0]/K.pxmid[1]+","+Ce+"H"+(H+K.labelExtraX+ve):ie+="l"+K.labelExtraX+","+Ae+"v"+(Ce-Ae)+"h"+ve}else ie+="V"+(K.yLabelMid+K.labelExtraY)+"h"+ve;t.ensureSingle(ue,"path","textline").call(E.stroke,ne.outsidetextfont.color).attr({"stroke-width":Math.min(2,ne.outsidetextfont.size/8),d:ie,fill:"none"})})}function g(ee,ne,K){var ue=K[0],te=ue.cx,H=ue.cy,ae=ue.trace,ie=ae.type==="funnelarea";"_hasHoverLabel"in ae||(ae._hasHoverLabel=!1),"_hasHoverEvent"in ae||(ae._hasHoverEvent=!1),ee.on("mouseover",function(ve){var Ae=ne._fullLayout,Ce=ne._fullData[ae.index];if(!(ne._dragging||Ae.hovermode===!1)){var Fe=Ce.hoverinfo;if(Array.isArray(Fe)&&(Fe=S.castHoverinfo({hoverinfo:[c.castOption(Fe,ve.pts)],_module:ae._module},Ae,0)),Fe==="all"&&(Fe="label+text+value+percent+name"),Ce.hovertemplate||Fe!=="none"&&Fe!=="skip"&&Fe){var ze=ve.rInscribed||0,Ye=te+ve.pxmid[0]*(1-ze),it=H+ve.pxmid[1]*(1-ze),st=Ae.separators,nt=[];if(Fe&&Fe.indexOf("label")!==-1&&nt.push(ve.label),ve.text=c.castOption(Ce.hovertext||Ce.text,ve.pts),Fe&&Fe.indexOf("text")!==-1){var Qe=ve.text;t.isValidTextValue(Qe)&&nt.push(Qe)}ve.value=ve.v,ve.valueLabel=c.formatPieValue(ve.v,st),Fe&&Fe.indexOf("value")!==-1&&nt.push(ve.valueLabel),ve.percent=ve.v/ue.vTotal,ve.percentLabel=c.formatPiePercent(ve.percent,st),Fe&&Fe.indexOf("percent")!==-1&&nt.push(ve.percentLabel);var Le=Ce.hoverlabel,Te=Le.font,pe=[];S.loneHover({trace:ae,x0:Ye-ze*ue.r,x1:Ye+ze*ue.r,y:it,_x0:ie?te+ve.TL[0]:Ye-ze*ue.r,_x1:ie?te+ve.TR[0]:Ye+ze*ue.r,_y0:ie?H+ve.TL[1]:it-ze*ue.r,_y1:ie?H+ve.BL[1]:it+ze*ue.r,text:nt.join("
"),name:Ce.hovertemplate||Fe.indexOf("name")!==-1?Ce.name:void 0,idealAlign:ve.pxmid[0]<0?"left":"right",color:c.castOption(Le.bgcolor,ve.pts)||ve.color,borderColor:c.castOption(Le.bordercolor,ve.pts),fontFamily:c.castOption(Te.family,ve.pts),fontSize:c.castOption(Te.size,ve.pts),fontColor:c.castOption(Te.color,ve.pts),nameLength:c.castOption(Le.namelength,ve.pts),textAlign:c.castOption(Le.align,ve.pts),hovertemplate:c.castOption(Ce.hovertemplate,ve.pts),hovertemplateLabels:ve,eventData:[p(ve,Ce)]},{container:Ae._hoverlayer.node(),outerContainer:Ae._paper.node(),gd:ne,inOut_bbox:pe}),ve.bbox=pe[0],ae._hasHoverLabel=!0}ae._hasHoverEvent=!0,ne.emit("plotly_hover",{points:[p(ve,Ce)],event:h.event})}}),ee.on("mouseout",function(ve){var Ae=ne._fullLayout,Ce=ne._fullData[ae.index],Fe=h.select(this).datum();ae._hasHoverEvent&&(ve.originalEvent=h.event,ne.emit("plotly_unhover",{points:[p(Fe,Ce)],event:h.event}),ae._hasHoverEvent=!1),ae._hasHoverLabel&&(S.loneUnhover(Ae._hoverlayer.node()),ae._hasHoverLabel=!1)}),ee.on("click",function(ve){var Ae=ne._fullLayout,Ce=ne._fullData[ae.index];ne._dragging||Ae.hovermode===!1||(ne._hoverdata=[p(ve,Ce)],S.click(ne,h.event))})}function x(ee,ne,K){var ue=c.castOption(ee.outsidetextfont.color,ne.pts)||c.castOption(ee.textfont.color,ne.pts)||K.color,te=c.castOption(ee.outsidetextfont.family,ne.pts)||c.castOption(ee.textfont.family,ne.pts)||K.family,H=c.castOption(ee.outsidetextfont.size,ne.pts)||c.castOption(ee.textfont.size,ne.pts)||K.size,ae=c.castOption(ee.outsidetextfont.weight,ne.pts)||c.castOption(ee.textfont.weight,ne.pts)||K.weight,ie=c.castOption(ee.outsidetextfont.style,ne.pts)||c.castOption(ee.textfont.style,ne.pts)||K.style,ve=c.castOption(ee.outsidetextfont.variant,ne.pts)||c.castOption(ee.textfont.variant,ne.pts)||K.variant,Ae=c.castOption(ee.outsidetextfont.textcase,ne.pts)||c.castOption(ee.textfont.textcase,ne.pts)||K.textcase,Ce=c.castOption(ee.outsidetextfont.lineposition,ne.pts)||c.castOption(ee.textfont.lineposition,ne.pts)||K.lineposition,Fe=c.castOption(ee.outsidetextfont.shadow,ne.pts)||c.castOption(ee.textfont.shadow,ne.pts)||K.shadow;return{color:ue,family:te,size:H,weight:ae,style:ie,variant:ve,textcase:Ae,lineposition:Ce,shadow:Fe}}function A(ee,ne,K){var ue=c.castOption(ee.insidetextfont.color,ne.pts);!ue&&ee._input.textfont&&(ue=c.castOption(ee._input.textfont.color,ne.pts));var te=c.castOption(ee.insidetextfont.family,ne.pts)||c.castOption(ee.textfont.family,ne.pts)||K.family,H=c.castOption(ee.insidetextfont.size,ne.pts)||c.castOption(ee.textfont.size,ne.pts)||K.size,ae=c.castOption(ee.insidetextfont.weight,ne.pts)||c.castOption(ee.textfont.weight,ne.pts)||K.weight,ie=c.castOption(ee.insidetextfont.style,ne.pts)||c.castOption(ee.textfont.style,ne.pts)||K.style,ve=c.castOption(ee.insidetextfont.variant,ne.pts)||c.castOption(ee.textfont.variant,ne.pts)||K.variant,Ae=c.castOption(ee.insidetextfont.textcase,ne.pts)||c.castOption(ee.textfont.textcase,ne.pts)||K.textcase,Ce=c.castOption(ee.insidetextfont.lineposition,ne.pts)||c.castOption(ee.textfont.lineposition,ne.pts)||K.lineposition,Fe=c.castOption(ee.insidetextfont.shadow,ne.pts)||c.castOption(ee.textfont.shadow,ne.pts)||K.shadow;return{color:ue||E.contrast(ne.color),family:te,size:H,weight:ae,style:ie,variant:ve,textcase:Ae,lineposition:Ce,shadow:Fe}}function M(ee,ne){for(var K,ue,te=0;te=-4;Le-=2)Qe(Math.PI*Le,"tan");for(Le=4;Le>=-4;Le-=2)Qe(Math.PI*(Le+1),"tan")}if(Fe||Ye){for(Le=4;Le>=-4;Le-=2)Qe(Math.PI*(Le+1.5),"rad");for(Le=4;Le>=-4;Le-=2)Qe(Math.PI*(Le+.5),"rad")}}if(ie||it||Fe){var Te=Math.sqrt(ee.width*ee.width+ee.height*ee.height);if(nt={scale:te*ue*2/Te,rCenter:1-te,rotate:0},nt.textPosAngle=(ne.startangle+ne.stopangle)/2,nt.scale>=1)return nt;st.push(nt)}(it||Ye)&&(nt=m(ee,ue,ae,ve,Ae),nt.textPosAngle=(ne.startangle+ne.stopangle)/2,st.push(nt)),(it||ze)&&(nt=u(ee,ue,ae,ve,Ae),nt.textPosAngle=(ne.startangle+ne.stopangle)/2,st.push(nt));for(var pe=0,Ne=0,ot=0;ot=1)break}return st[pe]}function w(ee,ne){var K=ee.startangle,ue=ee.stopangle;return K>ne&&ne>ue||K0?1:-1)/2,y:H/(1+K*K/(ue*ue)),outside:!0}}function F(ee){var ne=Math.sqrt(ee.titleBox.width*ee.titleBox.width+ee.titleBox.height*ee.titleBox.height);return{x:ee.cx,y:ee.cy,scale:ee.trace.hole*ee.r*2/ne,tx:0,ty:-ee.titleBox.height/2+ee.trace.title.font.size}}function N(ee,ne){var K=1,ue=1,te,H=ee.trace,ae={x:ee.cx,y:ee.cy},ie={tx:0,ty:0};ie.ty+=H.title.font.size,te=U(H),H.title.position.indexOf("top")!==-1?(ae.y-=(1+te)*ee.r,ie.ty-=ee.titleBox.height):H.title.position.indexOf("bottom")!==-1&&(ae.y+=(1+te)*ee.r);var ve=B(ee.r,ee.trace.aspectratio),Ae=ne.w*(H.domain.x[1]-H.domain.x[0])/2;return H.title.position.indexOf("left")!==-1?(Ae=Ae+ve,ae.x-=(1+te)*ve,ie.tx+=ee.titleBox.width/2):H.title.position.indexOf("center")!==-1?Ae*=2:H.title.position.indexOf("right")!==-1&&(Ae=Ae+ve,ae.x+=(1+te)*ve,ie.tx-=ee.titleBox.width/2),K=Ae/ee.titleBox.width,ue=R(ee,ne)/ee.titleBox.height,{x:ae.x,y:ae.y,scale:Math.min(K,ue),tx:ie.tx,ty:ie.ty}}function B(ee,ne){return ee/(ne===void 0?1:ne)}function R(ee,ne){var K=ee.trace,ue=ne.h*(K.domain.y[1]-K.domain.y[0]);return Math.min(ee.titleBox.height,ue/2)}function U(ee){var ne=ee.pull;if(!ne)return 0;var K;if(t.isArrayOrTypedArray(ne))for(ne=0,K=0;Kne&&(ne=ee.pull[K]);return ne}function j(ee,ne){var K,ue,te,H,ae,ie,ve,Ae,Ce,Fe,ze,Ye,it;function st(Te,pe){return Te.pxmid[1]-pe.pxmid[1]}function nt(Te,pe){return pe.pxmid[1]-Te.pxmid[1]}function Qe(Te,pe){pe||(pe={});var Ne=pe.labelExtraY+(ue?pe.yLabelMax:pe.yLabelMin),ot=ue?Te.yLabelMin:Te.yLabelMax,ft=ue?Te.yLabelMax:Te.yLabelMin,rt=Te.cyFinal+ae(Te.px0[1],Te.px1[1]),Ft=Ne-ot,Nt,$t,rr,Er,Mr,Wr;if(Ft*ve>0&&(Te.labelExtraY=Ft),!!t.isArrayOrTypedArray(ne.pull))for($t=0;$t=(c.castOption(ne.pull,rr.pts)||0))&&((Te.pxmid[1]-rr.pxmid[1])*ve>0?(Er=rr.cyFinal+ae(rr.px0[1],rr.px1[1]),Ft=Er-ot-Te.labelExtraY,Ft*ve>0&&(Te.labelExtraY+=Ft)):(ft+Te.labelExtraY-rt)*ve>0&&(Nt=3*ie*Math.abs($t-Fe.indexOf(Te)),Mr=rr.cxFinal+H(rr.px0[0],rr.px1[0]),Wr=Mr+Nt-(Te.cxFinal+Te.pxmid[0])-Te.labelExtraX,Wr*ie>0&&(Te.labelExtraX+=Wr)))}for(ue=0;ue<2;ue++)for(te=ue?st:nt,ae=ue?Math.max:Math.min,ve=ue?1:-1,K=0;K<2;K++){for(H=K?Math.max:Math.min,ie=K?1:-1,Ae=ee[ue][K],Ae.sort(te),Ce=ee[1-ue][K],Fe=Ce.concat(Ae),Ye=[],ze=0;ze1?(Ae=K.r,Ce=Ae/te.aspectratio):(Ce=K.r,Ae=Ce*te.aspectratio),Ae*=(1+te.baseratio)/2,ve=Ae*Ce}ae=Math.min(ae,ve/K.vTotal)}for(ue=0;uene.vTotal/2?1:0,Ae.halfangle=Math.PI*Math.min(Ae.v/ne.vTotal,.5),Ae.ring=1-ue.hole,Ae.rInscribed=L(Ae,ne))}function le(ee,ne){return[ee*Math.sin(ne),-ee*Math.cos(ne)]}function ce(ee,ne,K){var ue=ee._fullLayout,te=K.trace,H=te.texttemplate,ae=te.textinfo;if(!H&&ae&&ae!=="none"){var ie=ae.split("+"),ve=function(pe){return ie.indexOf(pe)!==-1},Ae=ve("label"),Ce=ve("text"),Fe=ve("value"),ze=ve("percent"),Ye=ue.separators,it;if(it=Ae?[ne.label]:[],Ce){var st=c.getFirstFilled(te.text,ne.pts);d(st)&&it.push(st)}Fe&&it.push(c.formatPieValue(ne.v,Ye)),ze&&it.push(c.formatPiePercent(ne.v/K.vTotal,Ye)),ne.text=it.join("
")}function nt(pe){return{label:pe.label,value:pe.v,valueLabel:c.formatPieValue(pe.v,ue.separators),percent:pe.v/K.vTotal,percentLabel:c.formatPiePercent(pe.v/K.vTotal,ue.separators),color:pe.color,text:pe.text,customdata:t.castOption(te,pe.i,"customdata")}}if(H){var Qe=t.castOption(te,ne.i,"texttemplate");if(!Qe)ne.text="";else{var Le=nt(ne),Te=c.getFirstFilled(te.text,ne.pts);(d(Te)||Te==="")&&(Le.text=Te),ne.text=t.texttemplateString({data:[Le,te._meta],fallback:te.texttemplatefallback,labels:Le,locale:ee._fullLayout._d3locale,template:Qe})}}}function V(ee,ne){var K=ee.rotate*Math.PI/180,ue=Math.cos(K),te=Math.sin(K),H=(ne.left+ne.right)/2,ae=(ne.top+ne.bottom)/2;ee.textX=H*ue-ae*te,ee.textY=H*te+ae*ue,ee.noCenter=!0}G.exports={plot:T,formatSliceLabel:ce,transformInsideText:_,determineInsideTextFont:A,positionTitleOutside:N,prerenderTitles:M,layoutAreas:Z,attachFxHandlers:g,computeTransform:V}}}),c3=Ge({"src/traces/pie/style.js"($,G){var h=Za(),b=w1(),S=sc().resizeText;G.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");S(e,t,"pie"),t.each(function(r){var o=r[0],n=o.trace,i=h.select(this);i.style({opacity:n.opacity}),i.selectAll("path.surface").each(function(a){h.select(this).call(b,a,n,e)})})}}}),Em=Ge({"src/traces/pie/base_plot.js"($){var G=$c();$.name="pie",$.plot=function(h,b,S,E){G.plotBasePlot($.name,h,b,S,E)},$.clean=function(h,b,S,E){G.cleanBasePlot($.name,h,b,S,E)}}}),d0=Ge({"src/traces/pie/index.js"($,G){G.exports={attributes:My(),supplyDefaults:Ey().supplyDefaults,supplyLayoutDefaults:_b(),layoutAttributes:l3(),calc:v0().calc,crossTraceCalc:v0().crossTraceCalc,plot:ky().plot,style:c3(),styleOne:w1(),moduleType:"trace",name:"pie",basePlotModule:Em(),categories:["pie-like","pie","showLegend"],meta:{}}}}),i_=Ge({"lib/pie.js"($,G){G.exports=d0()}}),ZM=Ge({"src/traces/sunburst/base_plot.js"($){var G=$c();$.name="sunburst",$.plot=function(h,b,S,E){G.plotBasePlot($.name,h,b,S,E)},$.clean=function(h,b,S,E){G.cleanBasePlot($.name,h,b,S,E)}}}),f3=Ge({"src/traces/sunburst/constants.js"($,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),o_=Ge({"src/traces/sunburst/attributes.js"($,G){var h=nu(),{hovertemplateAttrs:b,texttemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=Ru(),t=Sc().attributes,r=My(),o=f3(),n=Qi().extendFlat,i=hv().pattern;G.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:n({colors:{valType:"data_array",editType:"calc"},line:{color:n({},r.marker.line.color,{dflt:null}),width:n({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:i,editType:"calc"},e("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:r.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:S({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:E({editType:"plot"}),hovertext:r.hovertext,hoverinfo:n({},h.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:b({},{keys:o.eventDataKeys}),hovertemplatefallback:E(),textfont:r.textfont,insidetextorientation:r.insidetextorientation,insidetextfont:r.insidetextfont,outsidetextfont:n({},r.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:r.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:t({name:"sunburst",trace:!0,editType:"calc"})}}}),h3=Ge({"src/traces/sunburst/layout_attributes.js"($,G){G.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),kA=Ge({"src/traces/sunburst/defaults.js"($,G){var h=yn(),b=o_(),S=Sc().defaults,E=kd().handleText,e=Ey().handleMarkerDefaults,t=Ac(),r=t.hasColorscale,o=t.handleDefaults;G.exports=function(i,a,s,f){function c(A,M){return h.coerce(i,a,b,A,M)}var p=c("labels"),d=c("parents");if(!p||!p.length||!d||!d.length){a.visible=!1;return}var T=c("values");T&&T.length?c("branchvalues"):c("count"),c("level"),c("maxdepth"),e(i,a,f,c);var l=a._hasColorscale=r(i,"marker","colors")||(i.marker||{}).coloraxis;l&&o(i,a,f,c,{prefix:"marker.",cLetter:"c"}),c("leaf.opacity",l?1:.7);var g=c("text");c("texttemplate"),c("texttemplatefallback"),a.texttemplate||c("textinfo",h.isArrayOrTypedArray(g)?"text+label":"label"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback");var x="auto";E(i,a,f,c,x,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),c("insidetextorientation"),c("sort"),c("rotation"),c("root.color"),S(a,f,c),a._length=null}}}),WM=Ge({"src/traces/sunburst/layout_defaults.js"($,G){var h=yn(),b=h3();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("sunburstcolorway",e.colorway),t("extendsunburstcolors")}}}),Cy=Ge({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($):(h=h||self,b(h.d3=h.d3||{}))})($,function(h){function b(Ee,xe){return Ee.parent===xe.parent?1:2}function S(Ee){return Ee.reduce(E,0)/Ee.length}function E(Ee,xe){return Ee+xe.x}function e(Ee){return 1+Ee.reduce(t,0)}function t(Ee,xe){return Math.max(Ee,xe.y)}function r(Ee){for(var xe;xe=Ee.children;)Ee=xe[0];return Ee}function o(Ee){for(var xe;xe=Ee.children;)Ee=xe[xe.length-1];return Ee}function n(){var Ee=b,xe=1,ye=1,Me=!1;function Xe(Je){var Lt,Ct=0;Je.eachAfter(function(hr){var Fr=hr.children;Fr?(hr.x=S(Fr),hr.y=e(Fr)):(hr.x=Lt?Ct+=Ee(hr,Lt):0,hr.y=0,Lt=hr)});var Ot=r(Je),Wt=o(Je),_r=Ot.x-Ee(Ot,Wt)/2,pr=Wt.x+Ee(Wt,Ot)/2;return Je.eachAfter(Me?function(hr){hr.x=(hr.x-Je.x)*xe,hr.y=(Je.y-hr.y)*ye}:function(hr){hr.x=(hr.x-_r)/(pr-_r)*xe,hr.y=(1-(Je.y?hr.y/Je.y:1))*ye})}return Xe.separation=function(Je){return arguments.length?(Ee=Je,Xe):Ee},Xe.size=function(Je){return arguments.length?(Me=!1,xe=+Je[0],ye=+Je[1],Xe):Me?null:[xe,ye]},Xe.nodeSize=function(Je){return arguments.length?(Me=!0,xe=+Je[0],ye=+Je[1],Xe):Me?[xe,ye]:null},Xe}function i(Ee){var xe=0,ye=Ee.children,Me=ye&&ye.length;if(!Me)xe=1;else for(;--Me>=0;)xe+=ye[Me].value;Ee.value=xe}function a(){return this.eachAfter(i)}function s(Ee){var xe=this,ye,Me=[xe],Xe,Je,Lt;do for(ye=Me.reverse(),Me=[];xe=ye.pop();)if(Ee(xe),Xe=xe.children,Xe)for(Je=0,Lt=Xe.length;Je=0;--Xe)ye.push(Me[Xe]);return this}function c(Ee){for(var xe=this,ye=[xe],Me=[],Xe,Je,Lt;xe=ye.pop();)if(Me.push(xe),Xe=xe.children,Xe)for(Je=0,Lt=Xe.length;Je=0;)ye+=Me[Xe].value;xe.value=ye})}function d(Ee){return this.eachBefore(function(xe){xe.children&&xe.children.sort(Ee)})}function T(Ee){for(var xe=this,ye=l(xe,Ee),Me=[xe];xe!==ye;)xe=xe.parent,Me.push(xe);for(var Xe=Me.length;Ee!==ye;)Me.splice(Xe,0,Ee),Ee=Ee.parent;return Me}function l(Ee,xe){if(Ee===xe)return Ee;var ye=Ee.ancestors(),Me=xe.ancestors(),Xe=null;for(Ee=ye.pop(),xe=Me.pop();Ee===xe;)Xe=Ee,Ee=ye.pop(),xe=Me.pop();return Xe}function g(){for(var Ee=this,xe=[Ee];Ee=Ee.parent;)xe.push(Ee);return xe}function x(){var Ee=[];return this.each(function(xe){Ee.push(xe)}),Ee}function A(){var Ee=[];return this.eachBefore(function(xe){xe.children||Ee.push(xe)}),Ee}function M(){var Ee=this,xe=[];return Ee.each(function(ye){ye!==Ee&&xe.push({source:ye.parent,target:ye})}),xe}function _(Ee,xe){var ye=new y(Ee),Me=+Ee.value&&(ye.value=Ee.value),Xe,Je=[ye],Lt,Ct,Ot,Wt;for(xe==null&&(xe=m);Xe=Je.pop();)if(Me&&(Xe.value=+Xe.data.value),(Ct=xe(Xe.data))&&(Wt=Ct.length))for(Xe.children=new Array(Wt),Ot=Wt-1;Ot>=0;--Ot)Je.push(Lt=Xe.children[Ot]=new y(Ct[Ot])),Lt.parent=Xe,Lt.depth=Xe.depth+1;return ye.eachBefore(v)}function w(){return _(this).eachBefore(u)}function m(Ee){return Ee.children}function u(Ee){Ee.data=Ee.data.data}function v(Ee){var xe=0;do Ee.height=xe;while((Ee=Ee.parent)&&Ee.height<++xe)}function y(Ee){this.data=Ee,this.depth=this.height=0,this.parent=null}y.prototype=_.prototype={constructor:y,count:a,each:s,eachAfter:c,eachBefore:f,sum:p,sort:d,path:T,ancestors:g,descendants:x,leaves:A,links:M,copy:w};var I=Array.prototype.slice;function L(Ee){for(var xe=Ee.length,ye,Me;xe;)Me=Math.random()*xe--|0,ye=Ee[xe],Ee[xe]=Ee[Me],Ee[Me]=ye;return Ee}function z(Ee){for(var xe=0,ye=(Ee=L(I.call(Ee))).length,Me=[],Xe,Je;xe0&&ye*ye>Me*Me+Xe*Xe}function R(Ee,xe){for(var ye=0;yeOt?(Xe=(Wt+Ot-Je)/(2*Wt),Ct=Math.sqrt(Math.max(0,Ot/Wt-Xe*Xe)),ye.x=Ee.x-Xe*Me-Ct*Lt,ye.y=Ee.y-Xe*Lt+Ct*Me):(Xe=(Wt+Je-Ot)/(2*Wt),Ct=Math.sqrt(Math.max(0,Je/Wt-Xe*Xe)),ye.x=xe.x+Xe*Me-Ct*Lt,ye.y=xe.y+Xe*Lt+Ct*Me)):(ye.x=xe.x+ye.r,ye.y=xe.y)}function le(Ee,xe){var ye=Ee.r+xe.r-1e-6,Me=xe.x-Ee.x,Xe=xe.y-Ee.y;return ye>0&&ye*ye>Me*Me+Xe*Xe}function ce(Ee){var xe=Ee._,ye=Ee.next._,Me=xe.r+ye.r,Xe=(xe.x*ye.r+ye.x*xe.r)/Me,Je=(xe.y*ye.r+ye.y*xe.r)/Me;return Xe*Xe+Je*Je}function V(Ee){this._=Ee,this.next=null,this.previous=null}function ee(Ee){if(!(Xe=Ee.length))return 0;var xe,ye,Me,Xe,Je,Lt,Ct,Ot,Wt,_r,pr;if(xe=Ee[0],xe.x=0,xe.y=0,!(Xe>1))return xe.r;if(ye=Ee[1],xe.x=-ye.r,ye.x=xe.r,ye.y=0,!(Xe>2))return xe.r+ye.r;fe(ye,xe,Me=Ee[2]),xe=new V(xe),ye=new V(ye),Me=new V(Me),xe.next=Me.previous=ye,ye.next=xe.previous=Me,Me.next=ye.previous=xe;e:for(Ct=3;Ct0)throw new Error("cycle");return Ct}return ye.id=function(Me){return arguments.length?(Ee=ue(Me),ye):Ee},ye.parentId=function(Me){return arguments.length?(xe=ue(Me),ye):xe},ye}function pe(Ee,xe){return Ee.parent===xe.parent?1:2}function Ne(Ee){var xe=Ee.children;return xe?xe[0]:Ee.t}function ot(Ee){var xe=Ee.children;return xe?xe[xe.length-1]:Ee.t}function ft(Ee,xe,ye){var Me=ye/(xe.i-Ee.i);xe.c-=Me,xe.s+=ye,Ee.c+=Me,xe.z+=ye,xe.m+=ye}function rt(Ee){for(var xe=0,ye=0,Me=Ee.children,Xe=Me.length,Je;--Xe>=0;)Je=Me[Xe],Je.z+=xe,Je.m+=xe,xe+=Je.s+(ye+=Je.c)}function Ft(Ee,xe,ye){return Ee.a.parent===xe.parent?Ee.a:ye}function Nt(Ee,xe){this._=Ee,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=xe}Nt.prototype=Object.create(y.prototype);function $t(Ee){for(var xe=new Nt(Ee,0),ye,Me=[xe],Xe,Je,Lt,Ct;ye=Me.pop();)if(Je=ye._.children)for(ye.children=new Array(Ct=Je.length),Lt=Ct-1;Lt>=0;--Lt)Me.push(Xe=ye.children[Lt]=new Nt(Je[Lt],Lt)),Xe.parent=ye;return(xe.parent=new Nt(null,0)).children=[xe],xe}function rr(){var Ee=pe,xe=1,ye=1,Me=null;function Xe(Wt){var _r=$t(Wt);if(_r.eachAfter(Je),_r.parent.m=-_r.z,_r.eachBefore(Lt),Me)Wt.eachBefore(Ot);else{var pr=Wt,hr=Wt,Fr=Wt;Wt.eachBefore(function(ra){ra.xhr.x&&(hr=ra),ra.depth>Fr.depth&&(Fr=ra)});var En=pr===hr?1:Ee(pr,hr)/2,Kn=En-pr.x,qn=xe/(hr.x+En+Kn),ta=ye/(Fr.depth||1);Wt.eachBefore(function(ra){ra.x=(ra.x+Kn)*qn,ra.y=ra.depth*ta})}return Wt}function Je(Wt){var _r=Wt.children,pr=Wt.parent.children,hr=Wt.i?pr[Wt.i-1]:null;if(_r){rt(Wt);var Fr=(_r[0].z+_r[_r.length-1].z)/2;hr?(Wt.z=hr.z+Ee(Wt._,hr._),Wt.m=Wt.z-Fr):Wt.z=Fr}else hr&&(Wt.z=hr.z+Ee(Wt._,hr._));Wt.parent.A=Ct(Wt,hr,Wt.parent.A||pr[0])}function Lt(Wt){Wt._.x=Wt.z+Wt.parent.m,Wt.m+=Wt.parent.m}function Ct(Wt,_r,pr){if(_r){for(var hr=Wt,Fr=Wt,En=_r,Kn=hr.parent.children[0],qn=hr.m,ta=Fr.m,ra=En.m,Nn=Kn.m,ka;En=ot(En),hr=Ne(hr),En&&hr;)Kn=Ne(Kn),Fr=ot(Fr),Fr.a=Wt,ka=En.z+ra-hr.z-qn+Ee(En._,hr._),ka>0&&(ft(Ft(En,Wt,pr),Wt,ka),qn+=ka,ta+=ka),ra+=En.m,qn+=hr.m,Nn+=Kn.m,ta+=Fr.m;En&&!ot(Fr)&&(Fr.t=En,Fr.m+=ra-ta),hr&&!Ne(Kn)&&(Kn.t=hr,Kn.m+=qn-Nn,pr=Wt)}return pr}function Ot(Wt){Wt.x*=xe,Wt.y=Wt.depth*ye}return Xe.separation=function(Wt){return arguments.length?(Ee=Wt,Xe):Ee},Xe.size=function(Wt){return arguments.length?(Me=!1,xe=+Wt[0],ye=+Wt[1],Xe):Me?null:[xe,ye]},Xe.nodeSize=function(Wt){return arguments.length?(Me=!0,xe=+Wt[0],ye=+Wt[1],Xe):Me?[xe,ye]:null},Xe}function Er(Ee,xe,ye,Me,Xe){for(var Je=Ee.children,Lt,Ct=-1,Ot=Je.length,Wt=Ee.value&&(Xe-ye)/Ee.value;++Ctra&&(ra=Wt),ir=qn*qn*qa,Nn=Math.max(ra/ir,ir/ta),Nn>ka){qn-=Wt;break}ka=Nn}Lt.push(Ot={value:qn,dice:Fr1?Me:1)},ye})(Mr);function Br(){var Ee=Sr,xe=!1,ye=1,Me=1,Xe=[0],Je=te,Lt=te,Ct=te,Ot=te,Wt=te;function _r(hr){return hr.x0=hr.y0=0,hr.x1=ye,hr.y1=Me,hr.eachBefore(pr),Xe=[0],xe&&hr.eachBefore(Fe),hr}function pr(hr){var Fr=Xe[hr.depth],En=hr.x0+Fr,Kn=hr.y0+Fr,qn=hr.x1-Fr,ta=hr.y1-Fr;qn=hr-1){var ra=Je[pr];ra.x0=En,ra.y0=Kn,ra.x1=qn,ra.y1=ta;return}for(var Nn=Wt[pr],ka=Fr/2+Nn,qa=pr+1,ir=hr-1;qa>>1;Wt[qt]ta-Kn){var Vr=(En*lr+qn*ar)/Fr;_r(pr,qa,ar,En,Kn,Vr,ta),_r(qa,hr,lr,Vr,Kn,qn,ta)}else{var sn=(Kn*lr+ta*ar)/Fr;_r(pr,qa,ar,En,Kn,qn,sn),_r(qa,hr,lr,En,sn,qn,ta)}}}function je(Ee,xe,ye,Me,Xe){(Ee.depth&1?Er:ze)(Ee,xe,ye,Me,Xe)}var $e=(function Ee(xe){function ye(Me,Xe,Je,Lt,Ct){if((Ot=Me._squarify)&&Ot.ratio===xe)for(var Ot,Wt,_r,pr,hr=-1,Fr,En=Ot.length,Kn=Me.value;++hr1?Me:1)},ye})(Mr);h.cluster=n,h.hierarchy=_,h.pack=ie,h.packEnclose=z,h.packSiblings=ne,h.partition=Ye,h.stratify=Te,h.tree=rr,h.treemap=Br,h.treemapBinary=Mt,h.treemapDice=ze,h.treemapResquarify=$e,h.treemapSlice=Er,h.treemapSliceDice=je,h.treemapSquarify=Sr,Object.defineProperty(h,"__esModule",{value:!0})})}}),s_=Ge({"src/traces/sunburst/calc.js"($){var G=Cy(),h=Ga(),b=yn(),S=Ac().makeColorScaleFuncFromTrace,E=v0().makePullColorFn,e=v0().generateExtendedColors,t=Ac().calc,r=hi().ALMOST_EQUAL,o={},n={},i={};$.calc=function(s,f){var c=s._fullLayout,p=f.ids,d=b.isArrayOrTypedArray(p),T=f.labels,l=f.parents,g=f.values,x=b.isArrayOrTypedArray(g),A=[],M={},_={},w=function(ne,K){M[ne]?M[ne].push(K):M[ne]=[K],_[K]=1},m=function(ne){return ne||typeof ne=="number"},u=function(ne){return!x||h(g[ne])&&g[ne]>=0},v,y,I;d?(v=Math.min(p.length,l.length),y=function(ne){return m(p[ne])&&u(ne)},I=function(ne){return String(p[ne])}):(v=Math.min(T.length,l.length),y=function(ne){return m(T[ne])&&u(ne)},I=function(ne){return String(T[ne])}),x&&(v=Math.min(v,g.length));for(var L=0;L1){for(var U=b.randstr(),j=0;j0}function S(s){var f=0,c=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(f=3);f]*>/,e=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,t=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,n=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function i(s){var f=s.match(t),c=s.match(r),p=s.match(o);return{width:f&&(f[1]||f[2]),height:c&&(c[1]||c[2]),viewbox:p&&(p[1]||p[2])}}function a(s){return n.test(s)?s.match(n)[0]:"px"}G.exports=function(s){if(S(s)){for(var f="",c=0;c>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function i(a,s){return{width:(a[s+6]<<16|a[s+5]<<8|a[s+4])+1,height:(a[s+9]<a.length)){for(;s+8=10?f=f||o(a,s+8):v==="VP8L"&&T>=9?f=f||n(a,s+8):v==="VP8X"&&T>=10?f=f||i(a,s+8):v==="EXIF"&&(c=e.get_orientation(a.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(f)return c>0&&(f.orientation=c),f}}}}}),PA=Ge({"node_modules/probe-image-size/lib/parsers_sync.js"(K,G){G.exports={avif:lE(),bmp:uE(),gif:cE(),ico:MA(),jpeg:EA(),png:Cy(),psd:xb(),svg:kA(),tiff:CA(),webp:LA()}}}),RA=Ge({"node_modules/probe-image-size/sync.js"(K,G){var h=PA();function b(S){for(var E=Object.keys(h),e=0;e0;)I=f.c2p(M+N*u),N--;for(N=0;z===void 0&&N0;)F=c.c2p(_+N*d),N--;if(IV[0];if(ee||ne){var $=y+R/2,ue=z+U/2;le+="transform:"+S($+"px",ue+"px")+"scale("+(ee?-1:1)+","+(ne?-1:1)+")"+S(-$+"px",-ue+"px")+";"}}fe.attr("style",le);var te=new Promise(function(H){if(g._hasZ)H();else if(g._hasSource)if(g._canvas&&g._canvas.el.width===w&&g._canvas.el.height===m&&g._canvas.source===g.source)H();else{var ae=document.createElement("canvas");ae.width=w,ae.height=m;var ie=ae.getContext("2d",{willReadFrequently:!0});g._image=g._image||new Image;var de=g._image;de.onload=function(){ie.drawImage(de,0,0),g._canvas={el:ae,source:g.source},H()},de.setAttribute("src",g.source)}}).then(function(){var H,ae;if(g._hasZ)ae=re(function(Se,Le){var Fe=A[Le][Se];return b.isTypedArray(Fe)&&(Fe=Array.from(Fe)),Fe}),H=ae.toDataURL("image/png");else if(g._hasSource)if(x)H=g.source;else{var ie=g._canvas.el.getContext("2d",{willReadFrequently:!0}),de=ie.getImageData(0,0,w,m).data;ae=re(function(Se,Le){var Fe=4*(Le*w+Se);return[de[Fe],de[Fe+1],de[Fe+2],de[Fe+3]]}),H=ae.toDataURL("image/png")}fe.attr({"xlink:href":H,height:U,width:R,x:y,y:z})});n._promises.push(te)})}}}),zA=Ge({"src/traces/image/style.js"(K,G){var h=ki();G.exports=function(S){h.select(S).selectAll(".im image").style("opacity",function(E){return E[0].trace.opacity})}}}),hf=Ge({"src/traces/image/hover.js"(K,G){var h=Yf(),b=_n(),S=b.isArrayOrTypedArray,E=wp();G.exports=function(t,r,o){var n=t.cd[0],i=n.trace,a=t.xa,s=t.ya;if(!(h.inbox(r-n.x0,r-(n.x0+n.w*i.dx),0)>0||h.inbox(o-n.y0,o-(n.y0+n.h*i.dy),0)>0)){var f=Math.floor((r-n.x0)/i.dx),c=Math.floor(Math.abs(o-n.y0)/i.dy),p;if(i._hasZ?p=n.z[c][f]:i._hasSource&&(p=i._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,c,1,1).data),!!p){var v=n.hi||i.hoverinfo,T;if(v){var l=v.split("+");l.indexOf("all")!==-1&&(l=["color"]),l.indexOf("color")!==-1&&(T=!0)}var g=E.colormodel[i.colormodel],x=g.colormodel||i.colormodel,A=x.length,M=i._scaler(p),_=g.suffix,w=[];(i.hovertemplate||T)&&(w.push("["+[M[0]+_[0],M[1]+_[1],M[2]+_[2]].join(", ")),A===4&&w.push(", "+M[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=x.toUpperCase()+": "+w);var m;S(i.hovertext)&&S(i.hovertext[c])?m=i.hovertext[c][f]:S(i.text)&&S(i.text[c])&&(m=i.text[c][f]);var u=s.c2p(n.y0+(c+.5)*i.dy),d=n.x0+(f+.5)*i.dx,y=n.y0+(c+.5)*i.dy,I="["+p.slice(0,i.colormodel.length).join(", ")+"]";return[b.extendFlat(t,{index:[c,f],x0:a.c2p(n.x0+f*i.dx),x1:a.c2p(n.x0+(f+1)*i.dx),y0:u,y1:u,color:M,xVal:d,xLabelVal:d,yVal:y,yLabelVal:y,zLabelVal:I,text:m,hovertemplateLabels:{zLabel:I,colorLabel:w,"color[0]Label":M[0]+_[0],"color[1]Label":M[1]+_[1],"color[2]Label":M[2]+_[2],"color[3]Label":M[3]+_[3]}})]}}}}}),h3=Ge({"src/traces/image/event_data.js"(K,G){G.exports=function(b,S){return"xVal"in S&&(b.x=S.xVal),"yVal"in S&&(b.y=S.yVal),S.xa&&(b.xaxis=S.xa),S.ya&&(b.yaxis=S.ya),b.color=S.color,b.colormodel=S.trace.colormodel,b.z||(b.z=S.color),b}}}),fE=Ge({"src/traces/image/index.js"(K,G){G.exports={attributes:e3(),supplyDefaults:sA(),calc:bb(),plot:DA(),style:zA(),hoverPoints:hf(),eventData:h3(),moduleType:"trace",name:"image",basePlotModule:_h(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),OA=Ge({"lib/image.js"(K,G){G.exports=fE()}}),Ly=Ge({"src/traces/pie/attributes.js"(K,G){var h=Jl(),b=Cc().attributes,S=Us(),E=Xf(),{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=Ji().extendFlat,n=md().pattern,i=S({editType:"plot",arrayOk:!0,colorEditType:"plot"});G.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:E.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:n,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},h.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:e({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:r(),texttemplate:t({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:r({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:o({},i,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:o({},i,{}),outsidetextfont:o({},i,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:o({},h.showlegend,{arrayOk:!0}),legend:o({},h.legend,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:o({},i,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:b({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Py=Ge({"src/traces/pie/defaults.js"(K,G){var h=Ei(),b=_n(),S=Ly(),E=Cc().defaults,e=Dv().handleText,t=_n().coercePattern;function r(i,a){var s=b.isArrayOrTypedArray(i),f=b.isArrayOrTypedArray(a),c=Math.min(s?i.length:1/0,f?a.length:1/0);if(isFinite(c)||(c=0),c&&f){for(var p,v=0;v0){p=!0;break}}p||(c=0)}return{hasLabels:s,hasValues:f,len:c}}function o(i,a,s,f,c){var p=f("marker.line.width");p&&f("marker.line.color",c?void 0:s.paper_bgcolor);var v=f("marker.colors");t(f,"marker.pattern",v),i.marker&&!a.marker.pattern.fgcolor&&(a.marker.pattern.fgcolor=i.marker.colors),a.marker.pattern.bgcolor||(a.marker.pattern.bgcolor=s.paper_bgcolor)}function n(i,a,s,f){function c(y,I){return b.coerce(i,a,S,y,I)}var p=c("labels"),v=c("values"),T=r(p,v),l=T.len;if(a._hasLabels=T.hasLabels,a._hasValues=T.hasValues,!a._hasLabels&&a._hasValues&&(c("label0"),c("dlabel")),!l){a.visible=!1;return}a._length=l,o(i,a,f,c,!0),c("scalegroup");var g=c("text"),x=c("texttemplate");c("texttemplatefallback");var A;if(x||(A=c("textinfo",b.isArrayOrTypedArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),x||A&&A!=="none"){var M=c("textposition");e(i,a,f,c,M,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var _=Array.isArray(M)||M==="auto",w=_||M==="outside";w&&c("automargin"),(M==="inside"||M==="auto"||Array.isArray(M))&&c("insidetextorientation")}else A==="none"&&c("textposition","none");E(a,f,c);var m=c("hole"),u=c("title.text");if(u){var d=c("title.position",m?"middle center":"top center");!m&&d==="middle center"&&(a.title.position="top center"),b.coerceFont(c,"title.font",f.font)}c("sort"),c("direction"),c("rotation"),c("pull")}G.exports={handleLabelsAndValues:r,handleMarkerDefaults:o,supplyDefaults:n}}}),d3=Ge({"src/traces/pie/layout_attributes.js"(K,G){G.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),wb=Ge({"src/traces/pie/layout_defaults.js"(K,G){var h=_n(),b=d3();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("hiddenlabels"),t("piecolorway",e.colorway),t("extendpiecolors")}}}),y0=Ge({"src/traces/pie/calc.js"(K,G){var h=Ei(),b=Rs(),S=go(),E={};function e(n,i){var a=[],s=n._fullLayout,f=s.hiddenlabels||[],c=i.labels,p=i.marker.colors||[],v=i.values,T=i._length,l=i._hasValues&&T,g,x;if(i.dlabel)for(c=new Array(T),g=0;g=0});var I=i.type==="funnelarea"?w:i.sort;return I&&a.sort(function(L,z){return z.v-L.v}),a[0]&&(a[0].vTotal=_),a}function t(n){return function(a,s){return!a||(a=b(a),!a.isValid())?!1:(a=S.addOpacity(a,a.getAlpha()),n[s]||(n[s]=a),a)}}function r(n,i){var a=(i||{}).type;a||(a="pie");var s=n._fullLayout,f=n.calcdata,c=s[a+"colorway"],p=s["_"+a+"colormap"];s["extend"+a+"colors"]&&(c=o(c,E));for(var v=0,T=0;T0&&(ut+=Nt*pe.pxmid[0],dt+=Nt*pe.pxmid[1])}pe.cxFinal=ut,pe.cyFinal=dt;function Qt(Mt,je,Je,ke){var xe=ke*(je[0]-Mt[0]),ye=ke*(je[1]-Mt[1]);return"a"+ke*de.r+","+ke*de.r+" 0 "+pe.largeArc+(Je?" 1 ":" 0 ")+xe+","+ye}var ar=Se.hole;if(pe.v===de.vTotal){var kr="M"+(ut+pe.px0[0])+","+(dt+pe.px0[1])+Qt(pe.px0,pe.pxmid,!0,1)+Qt(pe.pxmid,pe.px0,!0,1)+"Z";ar?Ft.attr("d","M"+(ut+ar*pe.px0[0])+","+(dt+ar*pe.px0[1])+Qt(pe.px0,pe.pxmid,!1,ar)+Qt(pe.pxmid,pe.px0,!1,ar)+"Z"+kr):Ft.attr("d",kr)}else{var Er=Qt(pe.px0,pe.px1,!0,1);if(ar){var $r=1-ar;Ft.attr("d","M"+(ut+ar*pe.px1[0])+","+(dt+ar*pe.px1[1])+Qt(pe.px1,pe.px0,!1,ar)+"l"+$r*pe.px0[0]+","+$r*pe.px0[1]+Er+"Z")}else Ft.attr("d","M"+ut+","+dt+"l"+pe.px0[0]+","+pe.px0[1]+Er+"Z")}ce(ee,pe,de);var Sr=c.castOption(Se.textposition,pe.pts),Ur=nt.selectAll("g.slicetext").data(pe.text&&Sr!=="none"?[0]:[]);Ur.enter().append("g").classed("slicetext",!0),Ur.exit().remove(),Ur.each(function(){var Mt=t.ensureSingle(h.select(this),"text","",function(Qe){Qe.attr("data-notex",1)}),je=t.ensureUniformFontSize(ee,Sr==="outside"?x(Se,pe,ue.font):A(Se,pe,ue.font));Mt.text(pe.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(e.font,je).call(n.convertToTspans,ee);var Je=e.bBox(Mt.node()),ke;if(Sr==="outside")ke=z(Je,pe);else if(ke=_(Je,pe,de),Sr==="auto"&&ke.scale<1){var xe=t.ensureUniformFontSize(ee,Se.outsidetextfont);Mt.call(e.font,xe),Je=e.bBox(Mt.node()),ke=z(Je,pe)}var ye=ke.textPosAngle,Ee=ye===void 0?pe.pxmid:le(de.r,ye);if(ke.targetX=ut+Ee[0]*ke.rCenter+(ke.x||0),ke.targetY=dt+Ee[1]*ke.rCenter+(ke.y||0),V(ke,Je),ke.outside){var Xe=ke.targetY;pe.yLabelMin=Xe-Je.height/2,pe.yLabelMid=Xe,pe.yLabelMax=Xe+Je.height/2,pe.labelExtraX=0,pe.labelExtraY=0,ze=!0}ke.fontSize=je.size,a(Se.type,ke,ue),ae[Ne].transform=ke,t.setTransormAndDisplay(Mt,ke)})});var Ye=h.select(this).selectAll("g.titletext").data(Se.title.text?[0]:[]);if(Ye.enter().append("g").classed("titletext",!0),Ye.exit().remove(),Ye.each(function(){var pe=t.ensureSingle(h.select(this),"text","",function(dt){dt.attr("data-notex",1)}),Ne=Se.title.text;Se._meta&&(Ne=t.templateString(Ne,Se._meta)),pe.text(Ne).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(e.font,Se.title.font).call(n.convertToTspans,ee);var ut;Se.title.position==="middle center"?ut=F(de):ut=N(de,te),pe.attr("transform",o(ut.x,ut.y)+r(Math.min(1,ut.scale))+o(ut.tx,ut.ty))}),ze&&j(Fe,Se),l(Le,Se),ze&&Se.automargin){var st=e.bBox(ie.node()),ct=Se.domain,at=te.w*(ct.x[1]-ct.x[0]),et=te.h*(ct.y[1]-ct.y[0]),Pe=(.5*at-de.r)/te.w,Ae=(.5*et-de.r)/te.h;b.autoMargin(ee,"pie."+Se.uid+".automargin",{xl:ct.x[0]-Pe,xr:ct.x[1]+Pe,yb:ct.y[0]-Ae,yt:ct.y[1]+Ae,l:Math.max(de.cx-de.r-st.left,0),r:Math.max(st.right-(de.cx+de.r),0),b:Math.max(st.bottom-(de.cy+de.r),0),t:Math.max(de.cy-de.r-st.top,0),pad:5})}})});setTimeout(function(){H.selectAll("tspan").each(function(){var ae=h.select(this);ae.attr("dy")&&ae.attr("dy",ae.attr("dy"))})},0)}function l(ee,ne){ee.each(function($){var ue=h.select(this);if(!$.labelExtraX&&!$.labelExtraY){ue.select("path.textline").remove();return}var te=ue.select("g.slicetext text");$.transform.targetX+=$.labelExtraX,$.transform.targetY+=$.labelExtraY,t.setTransormAndDisplay(te,$.transform);var H=$.cxFinal+$.pxmid[0],ae=$.cyFinal+$.pxmid[1],ie="M"+H+","+ae,de=($.yLabelMax-$.yLabelMin)*($.pxmid[0]<0?-1:1)/4;if($.labelExtraX){var Se=$.labelExtraX*$.pxmid[1]/$.pxmid[0],Le=$.yLabelMid+$.labelExtraY-($.cyFinal+$.pxmid[1]);Math.abs(Se)>Math.abs(Le)?ie+="l"+Le*$.pxmid[0]/$.pxmid[1]+","+Le+"H"+(H+$.labelExtraX+de):ie+="l"+$.labelExtraX+","+Se+"v"+(Le-Se)+"h"+de}else ie+="V"+($.yLabelMid+$.labelExtraY)+"h"+de;t.ensureSingle(ue,"path","textline").call(E.stroke,ne.outsidetextfont.color).attr({"stroke-width":Math.min(2,ne.outsidetextfont.size/8),d:ie,fill:"none"})})}function g(ee,ne,$){var ue=$[0],te=ue.cx,H=ue.cy,ae=ue.trace,ie=ae.type==="funnelarea";"_hasHoverLabel"in ae||(ae._hasHoverLabel=!1),"_hasHoverEvent"in ae||(ae._hasHoverEvent=!1),ee.on("mouseover",function(de){var Se=ne._fullLayout,Le=ne._fullData[ae.index];if(!(ne._dragging||Se.hovermode===!1)){var Fe=Le.hoverinfo;if(Array.isArray(Fe)&&(Fe=S.castHoverinfo({hoverinfo:[c.castOption(Fe,de.pts)],_module:ae._module},Se,0)),Fe==="all"&&(Fe="label+text+value+percent+name"),Le.hovertemplate||Fe!=="none"&&Fe!=="skip"&&Fe){var ze=de.rInscribed||0,Ye=te+de.pxmid[0]*(1-ze),st=H+de.pxmid[1]*(1-ze),ct=Se.separators,at=[];if(Fe&&Fe.indexOf("label")!==-1&&at.push(de.label),de.text=c.castOption(Le.hovertext||Le.text,de.pts),Fe&&Fe.indexOf("text")!==-1){var et=de.text;t.isValidTextValue(et)&&at.push(et)}de.value=de.v,de.valueLabel=c.formatPieValue(de.v,ct),Fe&&Fe.indexOf("value")!==-1&&at.push(de.valueLabel),de.percent=de.v/ue.vTotal,de.percentLabel=c.formatPiePercent(de.percent,ct),Fe&&Fe.indexOf("percent")!==-1&&at.push(de.percentLabel);var Pe=Le.hoverlabel,Ae=Pe.font,pe=[];S.loneHover({trace:ae,x0:Ye-ze*ue.r,x1:Ye+ze*ue.r,y:st,_x0:ie?te+de.TL[0]:Ye-ze*ue.r,_x1:ie?te+de.TR[0]:Ye+ze*ue.r,_y0:ie?H+de.TL[1]:st-ze*ue.r,_y1:ie?H+de.BL[1]:st+ze*ue.r,text:at.join("
"),name:Le.hovertemplate||Fe.indexOf("name")!==-1?Le.name:void 0,idealAlign:de.pxmid[0]<0?"left":"right",color:c.castOption(Pe.bgcolor,de.pts)||de.color,borderColor:c.castOption(Pe.bordercolor,de.pts),fontFamily:c.castOption(Ae.family,de.pts),fontSize:c.castOption(Ae.size,de.pts),fontColor:c.castOption(Ae.color,de.pts),nameLength:c.castOption(Pe.namelength,de.pts),textAlign:c.castOption(Pe.align,de.pts),hovertemplate:c.castOption(Le.hovertemplate,de.pts),hovertemplateLabels:de,eventData:[p(de,Le)]},{container:Se._hoverlayer.node(),outerContainer:Se._paper.node(),gd:ne,inOut_bbox:pe}),de.bbox=pe[0],ae._hasHoverLabel=!0}ae._hasHoverEvent=!0,ne.emit("plotly_hover",{points:[p(de,Le)],event:h.event})}}),ee.on("mouseout",function(de){var Se=ne._fullLayout,Le=ne._fullData[ae.index],Fe=h.select(this).datum();ae._hasHoverEvent&&(de.originalEvent=h.event,ne.emit("plotly_unhover",{points:[p(Fe,Le)],event:h.event}),ae._hasHoverEvent=!1),ae._hasHoverLabel&&(S.loneUnhover(Se._hoverlayer.node()),ae._hasHoverLabel=!1)}),ee.on("click",function(de){var Se=ne._fullLayout,Le=ne._fullData[ae.index];ne._dragging||Se.hovermode===!1||(ne._hoverdata=[p(de,Le)],S.click(ne,h.event))})}function x(ee,ne,$){var ue=c.castOption(ee.outsidetextfont.color,ne.pts)||c.castOption(ee.textfont.color,ne.pts)||$.color,te=c.castOption(ee.outsidetextfont.family,ne.pts)||c.castOption(ee.textfont.family,ne.pts)||$.family,H=c.castOption(ee.outsidetextfont.size,ne.pts)||c.castOption(ee.textfont.size,ne.pts)||$.size,ae=c.castOption(ee.outsidetextfont.weight,ne.pts)||c.castOption(ee.textfont.weight,ne.pts)||$.weight,ie=c.castOption(ee.outsidetextfont.style,ne.pts)||c.castOption(ee.textfont.style,ne.pts)||$.style,de=c.castOption(ee.outsidetextfont.variant,ne.pts)||c.castOption(ee.textfont.variant,ne.pts)||$.variant,Se=c.castOption(ee.outsidetextfont.textcase,ne.pts)||c.castOption(ee.textfont.textcase,ne.pts)||$.textcase,Le=c.castOption(ee.outsidetextfont.lineposition,ne.pts)||c.castOption(ee.textfont.lineposition,ne.pts)||$.lineposition,Fe=c.castOption(ee.outsidetextfont.shadow,ne.pts)||c.castOption(ee.textfont.shadow,ne.pts)||$.shadow;return{color:ue,family:te,size:H,weight:ae,style:ie,variant:de,textcase:Se,lineposition:Le,shadow:Fe}}function A(ee,ne,$){var ue=c.castOption(ee.insidetextfont.color,ne.pts);!ue&&ee._input.textfont&&(ue=c.castOption(ee._input.textfont.color,ne.pts));var te=c.castOption(ee.insidetextfont.family,ne.pts)||c.castOption(ee.textfont.family,ne.pts)||$.family,H=c.castOption(ee.insidetextfont.size,ne.pts)||c.castOption(ee.textfont.size,ne.pts)||$.size,ae=c.castOption(ee.insidetextfont.weight,ne.pts)||c.castOption(ee.textfont.weight,ne.pts)||$.weight,ie=c.castOption(ee.insidetextfont.style,ne.pts)||c.castOption(ee.textfont.style,ne.pts)||$.style,de=c.castOption(ee.insidetextfont.variant,ne.pts)||c.castOption(ee.textfont.variant,ne.pts)||$.variant,Se=c.castOption(ee.insidetextfont.textcase,ne.pts)||c.castOption(ee.textfont.textcase,ne.pts)||$.textcase,Le=c.castOption(ee.insidetextfont.lineposition,ne.pts)||c.castOption(ee.textfont.lineposition,ne.pts)||$.lineposition,Fe=c.castOption(ee.insidetextfont.shadow,ne.pts)||c.castOption(ee.textfont.shadow,ne.pts)||$.shadow;return{color:ue||E.contrast(ne.color),family:te,size:H,weight:ae,style:ie,variant:de,textcase:Se,lineposition:Le,shadow:Fe}}function M(ee,ne){for(var $,ue,te=0;te=-4;Pe-=2)et(Math.PI*Pe,"tan");for(Pe=4;Pe>=-4;Pe-=2)et(Math.PI*(Pe+1),"tan")}if(Fe||Ye){for(Pe=4;Pe>=-4;Pe-=2)et(Math.PI*(Pe+1.5),"rad");for(Pe=4;Pe>=-4;Pe-=2)et(Math.PI*(Pe+.5),"rad")}}if(ie||st||Fe){var Ae=Math.sqrt(ee.width*ee.width+ee.height*ee.height);if(at={scale:te*ue*2/Ae,rCenter:1-te,rotate:0},at.textPosAngle=(ne.startangle+ne.stopangle)/2,at.scale>=1)return at;ct.push(at)}(st||Ye)&&(at=m(ee,ue,ae,de,Se),at.textPosAngle=(ne.startangle+ne.stopangle)/2,ct.push(at)),(st||ze)&&(at=u(ee,ue,ae,de,Se),at.textPosAngle=(ne.startangle+ne.stopangle)/2,ct.push(at));for(var pe=0,Ne=0,ut=0;ut=1)break}return ct[pe]}function w(ee,ne){var $=ee.startangle,ue=ee.stopangle;return $>ne&&ne>ue||$0?1:-1)/2,y:H/(1+$*$/(ue*ue)),outside:!0}}function F(ee){var ne=Math.sqrt(ee.titleBox.width*ee.titleBox.width+ee.titleBox.height*ee.titleBox.height);return{x:ee.cx,y:ee.cy,scale:ee.trace.hole*ee.r*2/ne,tx:0,ty:-ee.titleBox.height/2+ee.trace.title.font.size}}function N(ee,ne){var $=1,ue=1,te,H=ee.trace,ae={x:ee.cx,y:ee.cy},ie={tx:0,ty:0};ie.ty+=H.title.font.size,te=U(H),H.title.position.indexOf("top")!==-1?(ae.y-=(1+te)*ee.r,ie.ty-=ee.titleBox.height):H.title.position.indexOf("bottom")!==-1&&(ae.y+=(1+te)*ee.r);var de=B(ee.r,ee.trace.aspectratio),Se=ne.w*(H.domain.x[1]-H.domain.x[0])/2;return H.title.position.indexOf("left")!==-1?(Se=Se+de,ae.x-=(1+te)*de,ie.tx+=ee.titleBox.width/2):H.title.position.indexOf("center")!==-1?Se*=2:H.title.position.indexOf("right")!==-1&&(Se=Se+de,ae.x+=(1+te)*de,ie.tx-=ee.titleBox.width/2),$=Se/ee.titleBox.width,ue=R(ee,ne)/ee.titleBox.height,{x:ae.x,y:ae.y,scale:Math.min($,ue),tx:ie.tx,ty:ie.ty}}function B(ee,ne){return ee/(ne===void 0?1:ne)}function R(ee,ne){var $=ee.trace,ue=ne.h*($.domain.y[1]-$.domain.y[0]);return Math.min(ee.titleBox.height,ue/2)}function U(ee){var ne=ee.pull;if(!ne)return 0;var $;if(t.isArrayOrTypedArray(ne))for(ne=0,$=0;$ne&&(ne=ee.pull[$]);return ne}function j(ee,ne){var $,ue,te,H,ae,ie,de,Se,Le,Fe,ze,Ye,st;function ct(Ae,pe){return Ae.pxmid[1]-pe.pxmid[1]}function at(Ae,pe){return pe.pxmid[1]-Ae.pxmid[1]}function et(Ae,pe){pe||(pe={});var Ne=pe.labelExtraY+(ue?pe.yLabelMax:pe.yLabelMin),ut=ue?Ae.yLabelMin:Ae.yLabelMax,dt=ue?Ae.yLabelMax:Ae.yLabelMin,nt=Ae.cyFinal+ae(Ae.px0[1],Ae.px1[1]),Ft=Ne-ut,Nt,Qt,ar,kr,Er,$r;if(Ft*de>0&&(Ae.labelExtraY=Ft),!!t.isArrayOrTypedArray(ne.pull))for(Qt=0;Qt=(c.castOption(ne.pull,ar.pts)||0))&&((Ae.pxmid[1]-ar.pxmid[1])*de>0?(kr=ar.cyFinal+ae(ar.px0[1],ar.px1[1]),Ft=kr-ut-Ae.labelExtraY,Ft*de>0&&(Ae.labelExtraY+=Ft)):(dt+Ae.labelExtraY-nt)*de>0&&(Nt=3*ie*Math.abs(Qt-Fe.indexOf(Ae)),Er=ar.cxFinal+H(ar.px0[0],ar.px1[0]),$r=Er+Nt-(Ae.cxFinal+Ae.pxmid[0])-Ae.labelExtraX,$r*ie>0&&(Ae.labelExtraX+=$r)))}for(ue=0;ue<2;ue++)for(te=ue?ct:at,ae=ue?Math.max:Math.min,de=ue?1:-1,$=0;$<2;$++){for(H=$?Math.max:Math.min,ie=$?1:-1,Se=ee[ue][$],Se.sort(te),Le=ee[1-ue][$],Fe=Le.concat(Se),Ye=[],ze=0;ze1?(Se=$.r,Le=Se/te.aspectratio):(Le=$.r,Se=Le*te.aspectratio),Se*=(1+te.baseratio)/2,de=Se*Le}ae=Math.min(ae,de/$.vTotal)}for(ue=0;uene.vTotal/2?1:0,Se.halfangle=Math.PI*Math.min(Se.v/ne.vTotal,.5),Se.ring=1-ue.hole,Se.rInscribed=L(Se,ne))}function le(ee,ne){return[ee*Math.sin(ne),-ee*Math.cos(ne)]}function ce(ee,ne,$){var ue=ee._fullLayout,te=$.trace,H=te.texttemplate,ae=te.textinfo;if(!H&&ae&&ae!=="none"){var ie=ae.split("+"),de=function(pe){return ie.indexOf(pe)!==-1},Se=de("label"),Le=de("text"),Fe=de("value"),ze=de("percent"),Ye=ue.separators,st;if(st=Se?[ne.label]:[],Le){var ct=c.getFirstFilled(te.text,ne.pts);v(ct)&&st.push(ct)}Fe&&st.push(c.formatPieValue(ne.v,Ye)),ze&&st.push(c.formatPiePercent(ne.v/$.vTotal,Ye)),ne.text=st.join("
")}function at(pe){return{label:pe.label,value:pe.v,valueLabel:c.formatPieValue(pe.v,ue.separators),percent:pe.v/$.vTotal,percentLabel:c.formatPiePercent(pe.v/$.vTotal,ue.separators),color:pe.color,text:pe.text,customdata:t.castOption(te,pe.i,"customdata")}}if(H){var et=t.castOption(te,ne.i,"texttemplate");if(!et)ne.text="";else{var Pe=at(ne),Ae=c.getFirstFilled(te.text,ne.pts);(v(Ae)||Ae==="")&&(Pe.text=Ae),ne.text=t.texttemplateString({data:[Pe,te._meta],fallback:te.texttemplatefallback,labels:Pe,locale:ee._fullLayout._d3locale,template:et})}}}function V(ee,ne){var $=ee.rotate*Math.PI/180,ue=Math.cos($),te=Math.sin($),H=(ne.left+ne.right)/2,ae=(ne.top+ne.bottom)/2;ee.textX=H*ue-ae*te,ee.textY=H*te+ae*ue,ee.noCenter=!0}G.exports={plot:T,formatSliceLabel:ce,transformInsideText:_,determineInsideTextFont:A,positionTitleOutside:N,prerenderTitles:M,layoutAreas:Z,attachFxHandlers:g,computeTransform:V}}}),p3=Ge({"src/traces/pie/style.js"(K,G){var h=ki(),b=M1(),S=fc().resizeText;G.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");S(e,t,"pie"),t.each(function(r){var o=r[0],n=o.trace,i=h.select(this);i.style({opacity:n.opacity}),i.selectAll("path.surface").each(function(a){h.select(this).call(b,a,n,e)})})}}}),Rm=Ge({"src/traces/pie/base_plot.js"(K){var G=ef();K.name="pie",K.plot=function(h,b,S,E){G.plotBasePlot(K.name,h,b,S,E)},K.clean=function(h,b,S,E){G.cleanBasePlot(K.name,h,b,S,E)}}}),_0=Ge({"src/traces/pie/index.js"(K,G){G.exports={attributes:Ly(),supplyDefaults:Py().supplyDefaults,supplyLayoutDefaults:wb(),layoutAttributes:d3(),calc:y0().calc,crossTraceCalc:y0().crossTraceCalc,plot:Ry().plot,style:p3(),styleOne:M1(),moduleType:"trace",name:"pie",basePlotModule:Rm(),categories:["pie-like","pie","showLegend"],meta:{}}}}),u_=Ge({"lib/pie.js"(K,G){G.exports=_0()}}),hE=Ge({"src/traces/sunburst/base_plot.js"(K){var G=ef();K.name="sunburst",K.plot=function(h,b,S,E){G.plotBasePlot(K.name,h,b,S,E)},K.clean=function(h,b,S,E){G.cleanBasePlot(K.name,h,b,S,E)}}}),m3=Ge({"src/traces/sunburst/constants.js"(K,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),c_=Ge({"src/traces/sunburst/attributes.js"(K,G){var h=Jl(),{hovertemplateAttrs:b,texttemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=zu(),t=Cc().attributes,r=Ly(),o=m3(),n=Ji().extendFlat,i=md().pattern;G.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:n({colors:{valType:"data_array",editType:"calc"},line:{color:n({},r.marker.line.color,{dflt:null}),width:n({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:i,editType:"calc"},e("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:r.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:S({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:E({editType:"plot"}),hovertext:r.hovertext,hoverinfo:n({},h.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:b({},{keys:o.eventDataKeys}),hovertemplatefallback:E(),textfont:r.textfont,insidetextorientation:r.insidetextorientation,insidetextfont:r.insidetextfont,outsidetextfont:n({},r.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:r.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:t({name:"sunburst",trace:!0,editType:"calc"})}}}),g3=Ge({"src/traces/sunburst/layout_attributes.js"(K,G){G.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),FA=Ge({"src/traces/sunburst/defaults.js"(K,G){var h=_n(),b=c_(),S=Cc().defaults,E=Dv().handleText,e=Py().handleMarkerDefaults,t=kc(),r=t.hasColorscale,o=t.handleDefaults;G.exports=function(i,a,s,f){function c(A,M){return h.coerce(i,a,b,A,M)}var p=c("labels"),v=c("parents");if(!p||!p.length||!v||!v.length){a.visible=!1;return}var T=c("values");T&&T.length?c("branchvalues"):c("count"),c("level"),c("maxdepth"),e(i,a,f,c);var l=a._hasColorscale=r(i,"marker","colors")||(i.marker||{}).coloraxis;l&&o(i,a,f,c,{prefix:"marker.",cLetter:"c"}),c("leaf.opacity",l?1:.7);var g=c("text");c("texttemplate"),c("texttemplatefallback"),a.texttemplate||c("textinfo",h.isArrayOrTypedArray(g)?"text+label":"label"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback");var x="auto";E(i,a,f,c,x,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),c("insidetextorientation"),c("sort"),c("rotation"),c("root.color"),S(a,f,c),a._length=null}}}),dE=Ge({"src/traces/sunburst/layout_defaults.js"(K,G){var h=_n(),b=g3();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("sunburstcolorway",e.colorway),t("extendsunburstcolors")}}}),Iy=Ge({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K):(h=h||self,b(h.d3=h.d3||{}))})(K,function(h){function b(ke,xe){return ke.parent===xe.parent?1:2}function S(ke){return ke.reduce(E,0)/ke.length}function E(ke,xe){return ke+xe.x}function e(ke){return 1+ke.reduce(t,0)}function t(ke,xe){return Math.max(ke,xe.y)}function r(ke){for(var xe;xe=ke.children;)ke=xe[0];return ke}function o(ke){for(var xe;xe=ke.children;)ke=xe[xe.length-1];return ke}function n(){var ke=b,xe=1,ye=1,Ee=!1;function Xe(Qe){var Lt,Ct=0;Qe.eachAfter(function(vr){var Nr=vr.children;Nr?(vr.x=S(Nr),vr.y=e(Nr)):(vr.x=Lt?Ct+=ke(vr,Lt):0,vr.y=0,Lt=vr)});var Ot=r(Qe),Kt=o(Qe),xr=Ot.x-ke(Ot,Kt)/2,mr=Kt.x+ke(Kt,Ot)/2;return Qe.eachAfter(Ee?function(vr){vr.x=(vr.x-Qe.x)*xe,vr.y=(Qe.y-vr.y)*ye}:function(vr){vr.x=(vr.x-xr)/(mr-xr)*xe,vr.y=(1-(Qe.y?vr.y/Qe.y:1))*ye})}return Xe.separation=function(Qe){return arguments.length?(ke=Qe,Xe):ke},Xe.size=function(Qe){return arguments.length?(Ee=!1,xe=+Qe[0],ye=+Qe[1],Xe):Ee?null:[xe,ye]},Xe.nodeSize=function(Qe){return arguments.length?(Ee=!0,xe=+Qe[0],ye=+Qe[1],Xe):Ee?[xe,ye]:null},Xe}function i(ke){var xe=0,ye=ke.children,Ee=ye&&ye.length;if(!Ee)xe=1;else for(;--Ee>=0;)xe+=ye[Ee].value;ke.value=xe}function a(){return this.eachAfter(i)}function s(ke){var xe=this,ye,Ee=[xe],Xe,Qe,Lt;do for(ye=Ee.reverse(),Ee=[];xe=ye.pop();)if(ke(xe),Xe=xe.children,Xe)for(Qe=0,Lt=Xe.length;Qe=0;--Xe)ye.push(Ee[Xe]);return this}function c(ke){for(var xe=this,ye=[xe],Ee=[],Xe,Qe,Lt;xe=ye.pop();)if(Ee.push(xe),Xe=xe.children,Xe)for(Qe=0,Lt=Xe.length;Qe=0;)ye+=Ee[Xe].value;xe.value=ye})}function v(ke){return this.eachBefore(function(xe){xe.children&&xe.children.sort(ke)})}function T(ke){for(var xe=this,ye=l(xe,ke),Ee=[xe];xe!==ye;)xe=xe.parent,Ee.push(xe);for(var Xe=Ee.length;ke!==ye;)Ee.splice(Xe,0,ke),ke=ke.parent;return Ee}function l(ke,xe){if(ke===xe)return ke;var ye=ke.ancestors(),Ee=xe.ancestors(),Xe=null;for(ke=ye.pop(),xe=Ee.pop();ke===xe;)Xe=ke,ke=ye.pop(),xe=Ee.pop();return Xe}function g(){for(var ke=this,xe=[ke];ke=ke.parent;)xe.push(ke);return xe}function x(){var ke=[];return this.each(function(xe){ke.push(xe)}),ke}function A(){var ke=[];return this.eachBefore(function(xe){xe.children||ke.push(xe)}),ke}function M(){var ke=this,xe=[];return ke.each(function(ye){ye!==ke&&xe.push({source:ye.parent,target:ye})}),xe}function _(ke,xe){var ye=new y(ke),Ee=+ke.value&&(ye.value=ke.value),Xe,Qe=[ye],Lt,Ct,Ot,Kt;for(xe==null&&(xe=m);Xe=Qe.pop();)if(Ee&&(Xe.value=+Xe.data.value),(Ct=xe(Xe.data))&&(Kt=Ct.length))for(Xe.children=new Array(Kt),Ot=Kt-1;Ot>=0;--Ot)Qe.push(Lt=Xe.children[Ot]=new y(Ct[Ot])),Lt.parent=Xe,Lt.depth=Xe.depth+1;return ye.eachBefore(d)}function w(){return _(this).eachBefore(u)}function m(ke){return ke.children}function u(ke){ke.data=ke.data.data}function d(ke){var xe=0;do ke.height=xe;while((ke=ke.parent)&&ke.height<++xe)}function y(ke){this.data=ke,this.depth=this.height=0,this.parent=null}y.prototype=_.prototype={constructor:y,count:a,each:s,eachAfter:c,eachBefore:f,sum:p,sort:v,path:T,ancestors:g,descendants:x,leaves:A,links:M,copy:w};var I=Array.prototype.slice;function L(ke){for(var xe=ke.length,ye,Ee;xe;)Ee=Math.random()*xe--|0,ye=ke[xe],ke[xe]=ke[Ee],ke[Ee]=ye;return ke}function z(ke){for(var xe=0,ye=(ke=L(I.call(ke))).length,Ee=[],Xe,Qe;xe0&&ye*ye>Ee*Ee+Xe*Xe}function R(ke,xe){for(var ye=0;yeOt?(Xe=(Kt+Ot-Qe)/(2*Kt),Ct=Math.sqrt(Math.max(0,Ot/Kt-Xe*Xe)),ye.x=ke.x-Xe*Ee-Ct*Lt,ye.y=ke.y-Xe*Lt+Ct*Ee):(Xe=(Kt+Qe-Ot)/(2*Kt),Ct=Math.sqrt(Math.max(0,Qe/Kt-Xe*Xe)),ye.x=xe.x+Xe*Ee-Ct*Lt,ye.y=xe.y+Xe*Lt+Ct*Ee)):(ye.x=xe.x+ye.r,ye.y=xe.y)}function le(ke,xe){var ye=ke.r+xe.r-1e-6,Ee=xe.x-ke.x,Xe=xe.y-ke.y;return ye>0&&ye*ye>Ee*Ee+Xe*Xe}function ce(ke){var xe=ke._,ye=ke.next._,Ee=xe.r+ye.r,Xe=(xe.x*ye.r+ye.x*xe.r)/Ee,Qe=(xe.y*ye.r+ye.y*xe.r)/Ee;return Xe*Xe+Qe*Qe}function V(ke){this._=ke,this.next=null,this.previous=null}function ee(ke){if(!(Xe=ke.length))return 0;var xe,ye,Ee,Xe,Qe,Lt,Ct,Ot,Kt,xr,mr;if(xe=ke[0],xe.x=0,xe.y=0,!(Xe>1))return xe.r;if(ye=ke[1],xe.x=-ye.r,ye.x=xe.r,ye.y=0,!(Xe>2))return xe.r+ye.r;fe(ye,xe,Ee=ke[2]),xe=new V(xe),ye=new V(ye),Ee=new V(Ee),xe.next=Ee.previous=ye,ye.next=xe.previous=Ee,Ee.next=ye.previous=xe;e:for(Ct=3;Ct0)throw new Error("cycle");return Ct}return ye.id=function(Ee){return arguments.length?(ke=ue(Ee),ye):ke},ye.parentId=function(Ee){return arguments.length?(xe=ue(Ee),ye):xe},ye}function pe(ke,xe){return ke.parent===xe.parent?1:2}function Ne(ke){var xe=ke.children;return xe?xe[0]:ke.t}function ut(ke){var xe=ke.children;return xe?xe[xe.length-1]:ke.t}function dt(ke,xe,ye){var Ee=ye/(xe.i-ke.i);xe.c-=Ee,xe.s+=ye,ke.c+=Ee,xe.z+=ye,xe.m+=ye}function nt(ke){for(var xe=0,ye=0,Ee=ke.children,Xe=Ee.length,Qe;--Xe>=0;)Qe=Ee[Xe],Qe.z+=xe,Qe.m+=xe,xe+=Qe.s+(ye+=Qe.c)}function Ft(ke,xe,ye){return ke.a.parent===xe.parent?ke.a:ye}function Nt(ke,xe){this._=ke,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=xe}Nt.prototype=Object.create(y.prototype);function Qt(ke){for(var xe=new Nt(ke,0),ye,Ee=[xe],Xe,Qe,Lt,Ct;ye=Ee.pop();)if(Qe=ye._.children)for(ye.children=new Array(Ct=Qe.length),Lt=Ct-1;Lt>=0;--Lt)Ee.push(Xe=ye.children[Lt]=new Nt(Qe[Lt],Lt)),Xe.parent=ye;return(xe.parent=new Nt(null,0)).children=[xe],xe}function ar(){var ke=pe,xe=1,ye=1,Ee=null;function Xe(Kt){var xr=Qt(Kt);if(xr.eachAfter(Qe),xr.parent.m=-xr.z,xr.eachBefore(Lt),Ee)Kt.eachBefore(Ot);else{var mr=Kt,vr=Kt,Nr=Kt;Kt.eachBefore(function(na){na.xvr.x&&(vr=na),na.depth>Nr.depth&&(Nr=na)});var kn=mr===vr?1:ke(mr,vr)/2,$n=kn-mr.x,Vn=xe/(vr.x+kn+$n),ra=ye/(Nr.depth||1);Kt.eachBefore(function(na){na.x=(na.x+$n)*Vn,na.y=na.depth*ra})}return Kt}function Qe(Kt){var xr=Kt.children,mr=Kt.parent.children,vr=Kt.i?mr[Kt.i-1]:null;if(xr){nt(Kt);var Nr=(xr[0].z+xr[xr.length-1].z)/2;vr?(Kt.z=vr.z+ke(Kt._,vr._),Kt.m=Kt.z-Nr):Kt.z=Nr}else vr&&(Kt.z=vr.z+ke(Kt._,vr._));Kt.parent.A=Ct(Kt,vr,Kt.parent.A||mr[0])}function Lt(Kt){Kt._.x=Kt.z+Kt.parent.m,Kt.m+=Kt.parent.m}function Ct(Kt,xr,mr){if(xr){for(var vr=Kt,Nr=Kt,kn=xr,$n=vr.parent.children[0],Vn=vr.m,ra=Nr.m,na=kn.m,Un=$n.m,ka;kn=ut(kn),vr=Ne(vr),kn&&vr;)$n=Ne($n),Nr=ut(Nr),Nr.a=Kt,ka=kn.z+na-vr.z-Vn+ke(kn._,vr._),ka>0&&(dt(Ft(kn,Kt,mr),Kt,ka),Vn+=ka,ra+=ka),na+=kn.m,Vn+=vr.m,Un+=$n.m,ra+=Nr.m;kn&&!ut(Nr)&&(Nr.t=kn,Nr.m+=na-ra),vr&&!Ne($n)&&($n.t=vr,$n.m+=Vn-Un,mr=Kt)}return mr}function Ot(Kt){Kt.x*=xe,Kt.y=Kt.depth*ye}return Xe.separation=function(Kt){return arguments.length?(ke=Kt,Xe):ke},Xe.size=function(Kt){return arguments.length?(Ee=!1,xe=+Kt[0],ye=+Kt[1],Xe):Ee?null:[xe,ye]},Xe.nodeSize=function(Kt){return arguments.length?(Ee=!0,xe=+Kt[0],ye=+Kt[1],Xe):Ee?[xe,ye]:null},Xe}function kr(ke,xe,ye,Ee,Xe){for(var Qe=ke.children,Lt,Ct=-1,Ot=Qe.length,Kt=ke.value&&(Xe-ye)/ke.value;++Ctna&&(na=Kt),sr=Vn*Vn*Va,Un=Math.max(na/sr,sr/ra),Un>ka){Vn-=Kt;break}ka=Un}Lt.push(Ot={value:Vn,dice:Nr1?Ee:1)},ye})(Er);function Ur(){var ke=Sr,xe=!1,ye=1,Ee=1,Xe=[0],Qe=te,Lt=te,Ct=te,Ot=te,Kt=te;function xr(vr){return vr.x0=vr.y0=0,vr.x1=ye,vr.y1=Ee,vr.eachBefore(mr),Xe=[0],xe&&vr.eachBefore(Fe),vr}function mr(vr){var Nr=Xe[vr.depth],kn=vr.x0+Nr,$n=vr.y0+Nr,Vn=vr.x1-Nr,ra=vr.y1-Nr;Vn=vr-1){var na=Qe[mr];na.x0=kn,na.y0=$n,na.x1=Vn,na.y1=ra;return}for(var Un=Kt[mr],ka=Nr/2+Un,Va=mr+1,sr=vr-1;Va>>1;Kt[Vt]ra-$n){var Gr=(kn*ur+Vn*or)/Nr;xr(mr,Va,or,kn,$n,Gr,ra),xr(Va,vr,ur,Gr,$n,Vn,ra)}else{var ln=($n*ur+ra*or)/Nr;xr(mr,Va,or,kn,$n,Vn,ln),xr(Va,vr,ur,kn,ln,Vn,ra)}}}function je(ke,xe,ye,Ee,Xe){(ke.depth&1?kr:ze)(ke,xe,ye,Ee,Xe)}var Je=(function ke(xe){function ye(Ee,Xe,Qe,Lt,Ct){if((Ot=Ee._squarify)&&Ot.ratio===xe)for(var Ot,Kt,xr,mr,vr=-1,Nr,kn=Ot.length,$n=Ee.value;++vr1?Ee:1)},ye})(Er);h.cluster=n,h.hierarchy=_,h.pack=ie,h.packEnclose=z,h.packSiblings=ne,h.partition=Ye,h.stratify=Ae,h.tree=ar,h.treemap=Ur,h.treemapBinary=Mt,h.treemapDice=ze,h.treemapResquarify=Je,h.treemapSlice=kr,h.treemapSliceDice=je,h.treemapSquarify=Sr,Object.defineProperty(h,"__esModule",{value:!0})})}}),f_=Ge({"src/traces/sunburst/calc.js"(K){var G=Iy(),h=Ei(),b=_n(),S=kc().makeColorScaleFuncFromTrace,E=y0().makePullColorFn,e=y0().generateExtendedColors,t=kc().calc,r=Ii().ALMOST_EQUAL,o={},n={},i={};K.calc=function(s,f){var c=s._fullLayout,p=f.ids,v=b.isArrayOrTypedArray(p),T=f.labels,l=f.parents,g=f.values,x=b.isArrayOrTypedArray(g),A=[],M={},_={},w=function(ne,$){M[ne]?M[ne].push($):M[ne]=[$],_[$]=1},m=function(ne){return ne||typeof ne=="number"},u=function(ne){return!x||h(g[ne])&&g[ne]>=0},d,y,I;v?(d=Math.min(p.length,l.length),y=function(ne){return m(p[ne])&&u(ne)},I=function(ne){return String(p[ne])}):(d=Math.min(T.length,l.length),y=function(ne){return m(T[ne])&&u(ne)},I=function(ne){return String(T[ne])}),x&&(d=Math.min(d,g.length));for(var L=0;L1){for(var U=b.randstr(),j=0;j>8&15|G>>4&240,G>>4&15|G&240,(G&15)<<4|G&15,1):h===8?Py(G>>24&255,G>>16&255,G>>8&255,(G&255)/255):h===4?Py(G>>12&15|G>>8&240,G>>8&15|G>>4&240,G>>4&15|G&240,((G&15)<<4|G&15)/255):null):(G=m3.exec($))?new yv(G[1],G[2],G[3],1):(G=Ab.exec($))?new yv(G[1]*255/100,G[2]*255/100,G[3]*255/100,1):(G=Sb.exec($))?Py(G[1],G[2],G[3],G[4]):(G=RA.exec($))?Py(G[1]*255/100,G[2]*255/100,G[3]*255/100,G[4]):(G=g3.exec($))?PA(G[1],G[2]/100,G[3]/100,1):(G=IA.exec($))?PA(G[1],G[2]/100,G[3]/100,G[4]):Mb.hasOwnProperty($)?ju(Mb[$]):$==="transparent"?new yv(NaN,NaN,NaN,0):null}function ju($){return new yv($>>16&255,$>>8&255,$&255,1)}function Py($,G,h,b){return b<=0&&($=G=h=NaN),new yv($,G,h,b)}function Ry($){return $ instanceof p0||($=Ly($)),$?($=$.rgb(),new yv($.r,$.g,$.b,$.opacity)):new yv}function Iy($,G,h,b){return arguments.length===1?Ry($):new yv($,G,h,b??1)}function yv($,G,h,b){this.r=+$,this.g=+G,this.b=+h,this.opacity=+b}function xb(){return`#${wg(this.r)}${wg(this.g)}${wg(this.b)}`}function f_(){return`#${wg(this.r)}${wg(this.g)}${wg(this.b)}${wg((isNaN(this.opacity)?1:this.opacity)*255)}`}function h_(){const $=bb(this.opacity);return`${$===1?"rgb(":"rgba("}${km(this.r)}, ${km(this.g)}, ${km(this.b)}${$===1?")":`, ${$})`}`}function bb($){return isNaN($)?1:Math.max(0,Math.min(1,$))}function km($){return Math.max(0,Math.min(255,Math.round($)||0))}function wg($){return $=km($),($<16?"0":"")+$.toString(16)}function PA($,G,h,b){return b<=0?$=G=h=NaN:h<=0||h>=1?$=G=NaN:G<=0&&($=NaN),new qu($,G,h,b)}function v3($){if($ instanceof qu)return new qu($.h,$.s,$.l,$.opacity);if($ instanceof p0||($=Ly($)),!$)return new qu;if($ instanceof qu)return $;$=$.rgb();var G=$.r/255,h=$.g/255,b=$.b/255,S=Math.min(G,h,b),E=Math.max(G,h,b),e=NaN,t=E-S,r=(E+S)/2;return t?(G===E?e=(h-b)/t+(h0&&r<1?0:e,new qu(e,t,r,$.opacity)}function wb($,G,h,b){return arguments.length===1?v3($):new qu($,G,h,b??1)}function qu($,G,h,b){this.h=+$,this.s=+G,this.l=+h,this.opacity=+b}function Tb($){return $=($||0)%360,$<0?$+360:$}function ov($){return Math.max(0,Math.min(1,$||0))}function d3($,G,h){return($<60?G+(h-G)*$/60:$<180?h:$<240?G+(h-G)*(240-$)/60:G)*255}var X0,Tg,Y0,Cm,Dd,p3,m3,Ab,Sb,RA,g3,IA,Mb,y3=si({"node_modules/d3-color/src/color.js"(){u_(),X0=.7,Tg=1/X0,Y0="\\s*([+-]?\\d+)\\s*",Cm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",p3=/^#([0-9a-f]{3,8})$/,m3=new RegExp(`^rgb\\(${Y0},${Y0},${Y0}\\)$`),Ab=new RegExp(`^rgb\\(${Dd},${Dd},${Dd}\\)$`),Sb=new RegExp(`^rgba\\(${Y0},${Y0},${Y0},${Cm}\\)$`),RA=new RegExp(`^rgba\\(${Dd},${Dd},${Dd},${Cm}\\)$`),g3=new RegExp(`^hsl\\(${Cm},${Dd},${Dd}\\)$`),IA=new RegExp(`^hsla\\(${Cm},${Dd},${Dd},${Cm}\\)$`),Mb={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},bg(p0,Ly,{copy($){return Object.assign(new this.constructor,this,$)},displayable(){return this.rgb().displayable()},hex:CA,formatHex:CA,formatHex8:KM,formatHsl:c_,formatRgb:LA,toString:LA}),bg(yv,Iy,l_(p0,{brighter($){return $=$==null?Tg:Math.pow(Tg,$),new yv(this.r*$,this.g*$,this.b*$,this.opacity)},darker($){return $=$==null?X0:Math.pow(X0,$),new yv(this.r*$,this.g*$,this.b*$,this.opacity)},rgb(){return this},clamp(){return new yv(km(this.r),km(this.g),km(this.b),bb(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:xb,formatHex:xb,formatHex8:f_,formatRgb:h_,toString:h_})),bg(qu,wb,l_(p0,{brighter($){return $=$==null?Tg:Math.pow(Tg,$),new qu(this.h,this.s,this.l*$,this.opacity)},darker($){return $=$==null?X0:Math.pow(X0,$),new qu(this.h,this.s,this.l*$,this.opacity)},rgb(){var $=this.h%360+(this.h<0)*360,G=isNaN($)||isNaN(this.s)?0:this.s,h=this.l,b=h+(h<.5?h:1-h)*G,S=2*h-b;return new yv(d3($>=240?$-240:$+120,S,b),d3($,S,b),d3($<120?$+240:$-120,S,b),this.opacity)},clamp(){return new qu(Tb(this.h),ov(this.s),ov(this.l),bb(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 $=bb(this.opacity);return`${$===1?"hsl(":"hsla("}${Tb(this.h)}, ${ov(this.s)*100}%, ${ov(this.l)*100}%${$===1?")":`, ${$})`}`}}))}}),_3,m0,x3=si({"node_modules/d3-color/src/math.js"(){_3=Math.PI/180,m0=180/Math.PI}});function b3($){if($ instanceof g0)return new g0($.l,$.a,$.b,$.opacity);if($ instanceof Gp)return T3($);$ instanceof yv||($=Ry($));var G=p_($.r),h=p_($.g),b=p_($.b),S=w3((.2225045*G+.7168786*h+.0606169*b)/Ag),E,e;return G===h&&h===b?E=e=S:(E=w3((.4360747*G+.3850649*h+.1430804*b)/kb),e=w3((.0139322*G+.0971045*h+.7141733*b)/Od)),new g0(116*S-16,500*(E-S),200*(S-e),$.opacity)}function v_($,G,h,b){return arguments.length===1?b3($):new g0($,G,h,b??1)}function g0($,G,h,b){this.l=+$,this.a=+G,this.b=+h,this.opacity=+b}function w3($){return $>DA?Math.pow($,.3333333333333333):$/Xp+Cb}function Eb($){return $>y0?$*$*$:Xp*($-Cb)}function d_($){return 255*($<=.0031308?12.92*$:1.055*Math.pow($,.4166666666666667)-.055)}function p_($){return($/=255)<=.04045?$/12.92:Math.pow(($+.055)/1.055,2.4)}function $M($){if($ instanceof Gp)return new Gp($.h,$.c,$.l,$.opacity);if($ instanceof g0||($=b3($)),$.a===0&&$.b===0)return new Gp(NaN,0<$.l&&$.l<100?0:NaN,$.l,$.opacity);var G=Math.atan2($.b,$.a)*m0;return new Gp(G<0?G+360:G,Math.sqrt($.a*$.a+$.b*$.b),$.l,$.opacity)}function zd($,G,h,b){return arguments.length===1?$M($):new Gp($,G,h,b??1)}function Gp($,G,h,b){this.h=+$,this.c=+G,this.l=+h,this.opacity=+b}function T3($){if(isNaN($.h))return new g0($.l,0,0,$.opacity);var G=$.h*_3;return new g0($.l,Math.cos(G)*$.c,Math.sin(G)*$.c,$.opacity)}var Dy,kb,Ag,Od,Cb,y0,Xp,DA,JM=si({"node_modules/d3-color/src/lab.js"(){u_(),y3(),x3(),Dy=18,kb=.96422,Ag=1,Od=.82521,Cb=4/29,y0=6/29,Xp=3*y0*y0,DA=y0*y0*y0,bg(g0,v_,l_(p0,{brighter($){return new g0(this.l+Dy*($??1),this.a,this.b,this.opacity)},darker($){return new g0(this.l-Dy*($??1),this.a,this.b,this.opacity)},rgb(){var $=(this.l+16)/116,G=isNaN(this.a)?$:$+this.a/500,h=isNaN(this.b)?$:$-this.b/200;return G=kb*Eb(G),$=Ag*Eb($),h=Od*Eb(h),new yv(d_(3.1338561*G-1.6168667*$-.4906146*h),d_(-.9787684*G+1.9161415*$+.033454*h),d_(.0719453*G-.2289914*$+1.4052427*h),this.opacity)}})),bg(Gp,zd,l_(p0,{brighter($){return new Gp(this.h,this.c,this.l+Dy*($??1),this.opacity)},darker($){return new Gp(this.h,this.c,this.l-Dy*($??1),this.opacity)},rgb(){return T3(this).rgb()}}))}});function zy($){if($ instanceof Sg)return new Sg($.h,$.s,$.l,$.opacity);$ instanceof yv||($=Ry($));var G=$.r/255,h=$.g/255,b=$.b/255,S=(Lm*b+S3*G-Ib*h)/(Lm+S3-Ib),E=b-S,e=(Oy*(h-S)-Rb*E)/m_,t=Math.sqrt(e*e+E*E)/(Oy*S*(1-S)),r=t?Math.atan2(e,E)*m0-120:NaN;return new Sg(r<0?r+360:r,t,S,$.opacity)}function Lb($,G,h,b){return arguments.length===1?zy($):new Sg($,G,h,b??1)}function Sg($,G,h,b){this.h=+$,this.s=+G,this.l=+h,this.opacity=+b}var A3,Pb,Rb,m_,Oy,S3,Ib,Lm,g_=si({"node_modules/d3-color/src/cubehelix.js"(){u_(),y3(),x3(),A3=-.14861,Pb=1.78277,Rb=-.29227,m_=-.90649,Oy=1.97294,S3=Oy*m_,Ib=Oy*Pb,Lm=Pb*Rb-m_*A3,bg(Sg,Lb,l_(p0,{brighter($){return $=$==null?Tg:Math.pow(Tg,$),new Sg(this.h,this.s,this.l*$,this.opacity)},darker($){return $=$==null?X0:Math.pow(X0,$),new Sg(this.h,this.s,this.l*$,this.opacity)},rgb(){var $=isNaN(this.h)?0:(this.h+120)*_3,G=+this.l,h=isNaN(this.s)?0:this.s*G*(1-G),b=Math.cos($),S=Math.sin($);return new yv(255*(G+h*(A3*b+Pb*S)),255*(G+h*(Rb*b+m_*S)),255*(G+h*(Oy*b)),this.opacity)}}))}}),Mg=si({"node_modules/d3-color/src/index.js"(){y3(),JM(),g_()}});function zA($,G,h,b,S){var E=$*$,e=E*$;return((1-3*$+3*E-e)*G+(4-6*E+3*e)*h+(1+3*$+3*E-3*e)*b+e*S)/6}function Eg($){var G=$.length-1;return function(h){var b=h<=0?h=0:h>=1?(h=1,G-1):Math.floor(h*G),S=$[b],E=$[b+1],e=b>0?$[b-1]:2*S-E,t=b()=>$}});function __($,G){return function(h){return $+h*G}}function OA($,G,h){return $=Math.pow($,h),G=Math.pow(G,h)-$,h=1/h,function(b){return Math.pow($+b*G,h)}}function x_($,G){var h=G-$;return h?__($,h>180||h<-180?h-360*Math.round(h/360):h):Cg(isNaN($)?G:$)}function QM($){return($=+$)==1?_v:function(G,h){return h-G?OA(G,h,$):Cg(isNaN(G)?h:G)}}function _v($,G){var h=G-$;return h?__($,h):Cg(isNaN($)?G:$)}var Fy=si({"node_modules/d3-interpolate/src/color.js"(){Db()}});function zb($){return function(G){var h=G.length,b=new Array(h),S=new Array(h),E=new Array(h),e,t;for(e=0;eh&&(E=G.slice(h,E),t[e]?t[e]+=E:t[++e]=E),(b=b[0])===(S=S[0])?t[e]?t[e]+=S:t[++e]=S:(t[++e]=null,r.push({i:e,x:Yp(b,S)})),h=Ny.lastIndex;return h180?n+=360:n-o>180&&(o+=360),a.push({i:i.push(S(i)+"rotate(",null,b)-2,x:Yp(o,n)})):n&&i.push(S(i)+"rotate("+n+b)}function t(o,n,i,a){o!==n?a.push({i:i.push(S(i)+"skewX(",null,b)-2,x:Yp(o,n)}):n&&i.push(S(i)+"skewX("+n+b)}function r(o,n,i,a,s,f){if(o!==i||n!==a){var c=s.push(S(s)+"scale(",null,",",null,")");f.push({i:c-4,x:Yp(o,i)},{i:c-2,x:Yp(n,a)})}else(i!==1||a!==1)&&s.push(S(s)+"scale("+i+","+a+")")}return function(o,n){var i=[],a=[];return o=$(o),n=$(n),E(o.translateX,o.translateY,n.translateX,n.translateY,i,a),e(o.rotate,n.rotate,i,a),t(o.skewX,n.skewX,i,a),r(o.scaleX,o.scaleY,n.scaleX,n.scaleY,i,a),o=n=null,function(s){for(var f=-1,c=a.length,p;++fUy,interpolateArray:()=>FA,interpolateBasis:()=>Eg,interpolateBasisClosed:()=>M3,interpolateCubehelix:()=>Ii,interpolateCubehelixLong:()=>Ui,interpolateDate:()=>P3,interpolateDiscrete:()=>Pm,interpolateHcl:()=>Ma,interpolateHclLong:()=>ki,interpolateHsl:()=>de,interpolateHslLong:()=>Re,interpolateHue:()=>M_,interpolateLab:()=>Pt,interpolateNumber:()=>Yp,interpolateNumberArray:()=>E3,interpolateObject:()=>S_,interpolateRgb:()=>Ob,interpolateRgbBasis:()=>b_,interpolateRgbBasisClosed:()=>w_,interpolateRound:()=>Im,interpolateString:()=>Bb,interpolateTransformCss:()=>z3,interpolateTransformSvg:()=>Rg,interpolateZoom:()=>C_,piecewise:()=>Ul,quantize:()=>ci});var oo=si({"node_modules/d3-interpolate/src/index.js"(){Zp(),L3(),kg(),y_(),Fb(),Rm(),E_(),A_(),k3(),BA(),tE(),I3(),jA(),O(),T_(),ct(),Rr(),io(),$s(),bf(),Xa()}}),bl=Ge({"src/traces/sunburst/fill_one.js"($,G){var h=Ms(),b=So();G.exports=function(E,e,t,r,o){var n=e.data.data,i=n.i,a=o||n.color;if(i>=0){e.i=n.i;var s=t.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=a,e.color=a):(s.color=a,e.color=a),h.pointStyle(E,t,r,e)}else b.fill(E,a)}}}),gc=Ge({"src/traces/sunburst/style.js"($,G){var h=Za(),b=So(),S=yn(),E=sc().resizeText,e=bl();function t(o){var n=o._fullLayout._sunburstlayer.selectAll(".trace");E(o,n,"sunburst"),n.each(function(i){var a=h.select(this),s=i[0],f=s.trace;a.style("opacity",f.opacity),a.selectAll("path.surface").each(function(c){h.select(this).call(r,c,f,o)})})}function r(o,n,i,a){var s=n.data.data,f=!n.children,c=s.i,p=S.castOption(i,c,"marker.line.color")||b.defaultLine,d=S.castOption(i,c,"marker.line.width")||0;o.call(e,n,i,a).style("stroke-width",d).call(b.stroke,p).style("opacity",f?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),qs=Ge({"src/traces/sunburst/helpers.js"($){var G=yn(),h=So(),b=Ip(),S=eg();$.findEntryWithLevel=function(r,o){var n;return o&&r.eachAfter(function(i){if($.getPtId(i)===o)return n=i.copy()}),n||r},$.findEntryWithChild=function(r,o){var n;return r.eachAfter(function(i){for(var a=i.children||[],s=0;s0)},$.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},$.isHeader=function(r,o){return!($.isLeaf(r)||r.depth===o._maxDepth-1)};function t(r){return r.data.data.pid}$.getParent=function(r,o){return $.findEntryWithLevel(r,t(o))},$.listPath=function(r,o){var n=r.parent;if(!n)return[];var i=o?[n.data[o]]:[n];return $.listPath(n,o).concat(i)},$.getPath=function(r){return $.listPath(r,"label").join("/")+"/"},$.formatValue=S.formatPieValue,$.formatPercent=function(r,o){var n=G.formatPercent(r,0);return n==="0%"&&(n=S.formatPiePercent(r,o)),n}}}),gu=Ge({"src/traces/sunburst/fx.js"($,G){var h=Za(),b=Io(),S=Hv().appendArrayPointValue,E=qf(),e=yn(),t=x1(),r=qs(),o=eg(),n=o.formatPieValue;G.exports=function(s,f,c,p,d){var T=p[0],l=T.trace,g=T.hierarchy,x=l.type==="sunburst",A=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var M=function(m){var u=c._fullLayout;if(!(c._dragging||u.hovermode===!1)){var v=c._fullData[l.index],y=m.data.data,I=y.i,L=r.isHierarchyRoot(m),z=r.getParent(g,m),F=r.getValue(m),N=function(ae){return e.castOption(v,I,ae)},B=N("hovertemplate"),R=E.castHoverinfo(v,u,I),U=u.separators,j;if(B||R&&R!=="none"&&R!=="skip"){var Z,re;x&&(Z=T.cx+m.pxmid[0]*(1-m.rInscribed),re=T.cy+m.pxmid[1]*(1-m.rInscribed)),A&&(Z=m._hoverX,re=m._hoverY);var fe={},le=[],ce=[],V=function(ae){return le.indexOf(ae)!==-1};R&&(le=R==="all"?v._module.attributes.hoverinfo.flags:R.split("+")),fe.label=y.label,V("label")&&fe.label&&ce.push(fe.label),y.hasOwnProperty("v")&&(fe.value=y.v,fe.valueLabel=n(fe.value,U),V("value")&&ce.push(fe.valueLabel)),fe.currentPath=m.currentPath=r.getPath(m.data),V("current path")&&!L&&ce.push(fe.currentPath);var ee,ne=[],K=function(){ne.indexOf(ee)===-1&&(ce.push(ee),ne.push(ee))};fe.percentParent=m.percentParent=F/r.getValue(z),fe.parent=m.parentString=r.getPtLabel(z),V("percent parent")&&(ee=r.formatPercent(fe.percentParent,U)+" of "+fe.parent,K()),fe.percentEntry=m.percentEntry=F/r.getValue(f),fe.entry=m.entry=r.getPtLabel(f),V("percent entry")&&!L&&!m.onPathbar&&(ee=r.formatPercent(fe.percentEntry,U)+" of "+fe.entry,K()),fe.percentRoot=m.percentRoot=F/r.getValue(g),fe.root=m.root=r.getPtLabel(g),V("percent root")&&!L&&(ee=r.formatPercent(fe.percentRoot,U)+" of "+fe.root,K()),fe.text=N("hovertext")||N("text"),V("text")&&(ee=fe.text,e.isValidTextValue(ee)&&ce.push(ee)),j=[i(m,v,d.eventDataKeys)];var ue={trace:v,y:re,_x0:m._x0,_x1:m._x1,_y0:m._y0,_y1:m._y1,text:ce.join("
"),name:B||V("name")?v.name:void 0,color:N("hoverlabel.bgcolor")||y.color,borderColor:N("hoverlabel.bordercolor"),fontFamily:N("hoverlabel.font.family"),fontSize:N("hoverlabel.font.size"),fontColor:N("hoverlabel.font.color"),fontWeight:N("hoverlabel.font.weight"),fontStyle:N("hoverlabel.font.style"),fontVariant:N("hoverlabel.font.variant"),nameLength:N("hoverlabel.namelength"),textAlign:N("hoverlabel.align"),hovertemplate:B,hovertemplateLabels:fe,eventData:j};x&&(ue.x0=Z-m.rInscribed*m.rpx1,ue.x1=Z+m.rInscribed*m.rpx1,ue.idealAlign=m.pxmid[0]<0?"left":"right"),A&&(ue.x=Z,ue.idealAlign=Z<0?"left":"right");var te=[];E.loneHover(ue,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:c,inOut_bbox:te}),j[0].bbox=te[0],l._hasHoverLabel=!0}if(A){var H=s.select("path.surface");d.styleOne(H,m,v,c,{hovered:!0})}l._hasHoverEvent=!0,c.emit("plotly_hover",{points:j||[i(m,v,d.eventDataKeys)],event:h.event})}},_=function(m){var u=c._fullLayout,v=c._fullData[l.index],y=h.select(this).datum();if(l._hasHoverEvent&&(m.originalEvent=h.event,c.emit("plotly_unhover",{points:[i(y,v,d.eventDataKeys)],event:h.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(E.loneUnhover(u._hoverlayer.node()),l._hasHoverLabel=!1),A){var I=s.select("path.surface");d.styleOne(I,y,v,c,{hovered:!1})}},w=function(m){var u=c._fullLayout,v=c._fullData[l.index],y=x&&(r.isHierarchyRoot(m)||r.isLeaf(m)),I=r.getPtId(m),L=r.isEntry(m)?r.findEntryWithChild(g,I):r.findEntryWithLevel(g,I),z=r.getPtId(L),F={points:[i(m,v,d.eventDataKeys)],event:h.event};y||(F.nextLevel=z);var N=t.triggerHandler(c,"plotly_"+l.type+"click",F);if(N!==!1&&u.hovermode&&(c._hoverdata=[i(m,v,d.eventDataKeys)],E.click(c,h.event)),!y&&N!==!1&&!c._dragging&&!c._transitioning){b.call("_storeDirectGUIEdit",v,u._tracePreGUI[v.uid],{level:v.level});var B={data:[{level:z}],traces:[l.index]},R={frame:{redraw:!1,duration:d.transitionTime},transition:{duration:d.transitionTime,easing:d.transitionEasing},mode:"immediate",fromcurrent:!0};E.loneUnhover(u._hoverlayer.node()),b.call("animate",c,B,R)}};s.on("mouseover",M),s.on("mouseout",_),s.on("click",w)};function i(a,s,f){for(var c=a.data.data,p={curveNumber:s.index,pointNumber:c.i,data:s._input,fullData:s},d=0;dft.x1?2*Math.PI:0)+ae;rt=pe.rpx1Ye?2*Math.PI:0)+ae;ot={x0:rt,x1:rt}}else ot={rpx0:le,rpx1:le},E.extendFlat(ot,Te(pe));else ot={rpx0:0,rpx1:0};else ot={x0:ae,x1:ae};return b(ot,ft)}function Le(pe){var Ne=ne[T.getPtId(pe)],ot,ft=pe.transform;if(Ne)ot=Ne;else if(ot={rpx1:pe.rpx1,transform:{textPosAngle:ft.textPosAngle,scale:0,rotate:ft.rotate,rCenter:ft.rCenter,x:ft.x,y:ft.y}},ee)if(pe.parent)if(Ye){var rt=pe.x1>Ye?2*Math.PI:0;ot.x0=ot.x1=rt}else E.extendFlat(ot,Te(pe));else ot.x0=ot.x1=ae;else ot.x0=ot.x1=ae;var Ft=b(ot.transform.textPosAngle,pe.transform.textPosAngle),Nt=b(ot.rpx1,pe.rpx1),$t=b(ot.x0,pe.x0),rr=b(ot.x1,pe.x1),Er=b(ot.transform.scale,ft.scale),Mr=b(ot.transform.rotate,ft.rotate),Wr=ft.rCenter===0?3:ot.transform.rCenter===0?1/3:1,Sr=b(ot.transform.rCenter,ft.rCenter),Br=function(Mt){return Sr(Math.pow(Mt,Wr))};return function(Mt){var je=Nt(Mt);$t(Mt),rr(Mt);var $e=Br(Mt),Ee=Ft(Mt),xe={rpx1:je,transform:{textPosAngle:Ee,rCenter:$e,x:ft.x,y:ft.y}};return r(N.type,ft,y),{transform:{targetX:Fe(xe),targetY:ze(xe),scale:Er(Mt),rotate:Mr(Mt),rCenter:$e}}}}function Te(pe){var Ne=pe.parent,ot=ne[T.getPtId(Ne)],ft={};if(ot){var rt=Ne.children,Ft=rt.indexOf(pe),Nt=rt.length,$t=b(ot.x0,ot.x1);ft.x0=$t(Ft/Nt),ft.x1=$t(Ft/Nt)}else ft.x0=ft.x1=0;return ft}}function g(_){return h.partition().size([2*Math.PI,_.height+1])(_)}$.formatSliceLabel=function(_,w,m,u,v){var y=m.texttemplate,I=m.textinfo;if(!y&&(!I||I==="none"))return"";var L=v.separators,z=u[0],F=_.data.data,N=z.hierarchy,B=T.isHierarchyRoot(_),R=T.getParent(N,_),U=T.getValue(_);if(!y){var j=I.split("+"),Z=function(te){return j.indexOf(te)!==-1},re=[],fe;if(Z("label")&&F.label&&re.push(F.label),F.hasOwnProperty("v")&&Z("value")&&re.push(T.formatValue(F.v,L)),!B){Z("current path")&&re.push(T.getPath(_.data));var le=0;Z("percent parent")&&le++,Z("percent entry")&&le++,Z("percent root")&&le++;var ce=le>1;if(le){var V,ee=function(te){fe=T.formatPercent(V,L),ce&&(fe+=" of "+te),re.push(fe)};Z("percent parent")&&!B&&(V=U/T.getValue(R),ee("parent")),Z("percent entry")&&(V=U/T.getValue(w),ee("entry")),Z("percent root")&&(V=U/T.getValue(N),ee("root"))}}return Z("text")&&(fe=E.castOption(m,F.i,"text"),E.isValidTextValue(fe)&&re.push(fe)),re.join("
")}var ne=E.castOption(m,F.i,"texttemplate");if(!ne)return"";var K={};F.label&&(K.label=F.label),F.hasOwnProperty("v")&&(K.value=F.v,K.valueLabel=T.formatValue(F.v,L)),K.currentPath=T.getPath(_.data),B||(K.percentParent=U/T.getValue(R),K.percentParentLabel=T.formatPercent(K.percentParent,L),K.parent=T.getPtLabel(R)),K.percentEntry=U/T.getValue(w),K.percentEntryLabel=T.formatPercent(K.percentEntry,L),K.entry=T.getPtLabel(w),K.percentRoot=U/T.getValue(N),K.percentRootLabel=T.formatPercent(K.percentRoot,L),K.root=T.getPtLabel(N),F.hasOwnProperty("color")&&(K.color=F.color);var ue=E.castOption(m,F.i,"text");return(E.isValidTextValue(ue)||ue==="")&&(K.text=ue),K.customdata=E.castOption(m,F.i,"customdata"),E.texttemplateString({data:[K,m._meta],fallback:m.texttemplatefallback,labels:K,locale:v._d3locale,template:ne})};function x(_){return _.rpx0===0&&E.isFullCircle([_.x0,_.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(_.halfangle)),_.ring/2))}function A(_){return M(_.rpx1,_.transform.textPosAngle)}function M(_,w){return[_*Math.sin(w),-_*Math.cos(w)]}}}),Cc=Ge({"src/traces/sunburst/index.js"($,G){G.exports={moduleType:"trace",name:"sunburst",basePlotModule:ZM(),categories:[],animatable:!0,attributes:o_(),layoutAttributes:h3(),supplyDefaults:kA(),supplyLayoutDefaults:WM(),calc:s_().calc,crossTraceCalc:s_().crossTraceCalc,plot:Vu().plot,style:gc().style,colorbar:Vf(),meta:{}}}}),Dm=Ge({"lib/sunburst.js"($,G){G.exports=Cc()}}),rE=Ge({"src/traces/treemap/base_plot.js"($){var G=$c();$.name="treemap",$.plot=function(h,b,S,E){G.plotBasePlot($.name,h,b,S,E)},$.clean=function(h,b,S,E){G.cleanBasePlot($.name,h,b,S,E)}}}),Gb=Ge({"src/traces/treemap/constants.js"($,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),nE=Ge({"src/traces/treemap/attributes.js"($,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=Ru(),e=Sc().attributes,t=My(),r=o_(),o=Gb(),n=Qi().extendFlat,i=hv().pattern;G.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:n({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:r.marker.colors,pattern:i,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:r.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:n({},t.textfont,{}),editType:"calc"},text:t.text,textinfo:r.textinfo,texttemplate:b({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:S({editType:"plot"}),hovertext:t.hovertext,hoverinfo:r.hoverinfo,hovertemplate:h({},{keys:o.eventDataKeys}),hovertemplatefallback:S(),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:n({},t.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:t.sort,root:r.root,domain:e({name:"treemap",trace:!0,editType:"calc"})}}}),wk=Ge({"src/traces/treemap/layout_attributes.js"($,G){G.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),B4=Ge({"src/traces/treemap/defaults.js"($,G){var h=yn(),b=nE(),S=So(),E=Sc().defaults,e=kd().handleText,t=gm().TEXTPAD,r=Ey().handleMarkerDefaults,o=Ac(),n=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,f,c,p){function d(v,y){return h.coerce(s,f,b,v,y)}var T=d("labels"),l=d("parents");if(!T||!T.length||!l||!l.length){f.visible=!1;return}var g=d("values");g&&g.length?d("branchvalues"):d("count"),d("level"),d("maxdepth");var x=d("tiling.packing");x==="squarify"&&d("tiling.squarifyratio"),d("tiling.flip"),d("tiling.pad");var A=d("text");d("texttemplate"),d("texttemplatefallback"),f.texttemplate||d("textinfo",h.isArrayOrTypedArray(A)?"text+label":"label"),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback");var M=d("pathbar.visible"),_="auto";e(s,f,p,d,_,{hasPathbar:M,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("textposition");var w=f.textposition.indexOf("bottom")!==-1;r(s,f,p,d);var m=f._hasColorscale=n(s,"marker","colors")||(s.marker||{}).coloraxis;m?i(s,f,p,d,{prefix:"marker.",cLetter:"c"}):d("marker.depthfade",!(f.marker.colors||[]).length);var u=f.textfont.size*2;d("marker.pad.t",w?u/4:u),d("marker.pad.l",u/4),d("marker.pad.r",u/4),d("marker.pad.b",w?u:u/4),d("marker.cornerradius"),f._hovered={marker:{line:{width:2,color:S.contrast(p.paper_bgcolor)}}},M&&(d("pathbar.thickness",f.pathbar.textfont.size+2*t),d("pathbar.side"),d("pathbar.edgeshape")),d("sort"),d("root.color"),E(f,p,d),f._length=null}}}),N4=Ge({"src/traces/treemap/layout_defaults.js"($,G){var h=yn(),b=wk();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),Tk=Ge({"src/traces/treemap/calc.js"($){var G=s_();$.calc=function(h,b){return G.calc(h,b)},$.crossTraceCalc=function(h){return G._runCrossTraceCalc("treemap",h)}}}),Ak=Ge({"src/traces/treemap/flip_tree.js"($,G){G.exports=function h(b,S,E){var e;E.swapXY&&(e=b.x0,b.x0=b.y0,b.y0=e,e=b.x1,b.x1=b.y1,b.y1=e),E.flipX&&(e=b.x0,b.x0=S[0]-b.x1,b.x1=S[0]-e),E.flipY&&(e=b.y0,b.y0=S[1]-b.y1,b.y1=S[1]-e);var t=b.children;if(t)for(var r=0;r0)for(var u=0;u").join(" ")||"";var ce=b.ensureSingle(fe,"g","slicetext"),V=b.ensureSingle(ce,"text","",function(ne){ne.attr("data-notex",1)}),ee=b.ensureUniformFontSize(s,o.determineTextFont(N,re,z.font,{onPathbar:!0}));V.text(re._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(S.font,ee).call(E.convertToTspans,s),re.textBB=S.bBox(V.node()),re.transform=_(re,{fontSize:ee.size,onPathbar:!0}),re.transform.fontSize=ee.size,m?V.transition().attrTween("transform",function(ne){var K=y(ne,i,I,[l,g]);return function(ue){return w(K(ue))}}):V.attr("transform",w(re))})}}}),j4=Ge({"src/traces/treemap/plot_one.js"($,G){var h=Za(),b=(oo(),mi(Ti)).interpolate,S=qs(),E=yn(),e=gm().TEXTPAD,t=au(),r=t.toMoveInsideBar,o=sc(),n=o.recordMinTextSize,i=Gb(),a=U4();function s(f){return S.isHierarchyRoot(f)?"":S.getPtId(f)}G.exports=function(c,p,d,T,l){var g=c._fullLayout,x=p[0],A=x.trace,M=A.type,_=M==="icicle",w=x.hierarchy,m=S.findEntryWithLevel(w,A.level),u=h.select(d),v=u.selectAll("g.pathbar"),y=u.selectAll("g.slice");if(!m){v.remove(),y.remove();return}var I=S.isHierarchyRoot(m),L=!g.uniformtext.mode&&S.hasTransition(T),z=S.getMaxDepth(A),F=function(Sr){return Sr.data.depth-m.data.depth-1?U+re:-(Z+re):0,le={x0:j,x1:j,y0:fe,y1:fe+Z},ce=function(Sr,Br,Mt){var je=A.tiling.pad,$e=function(Me){return Me-je<=Br.x0},Ee=function(Me){return Me+je>=Br.x1},xe=function(Me){return Me-je<=Br.y0},ye=function(Me){return Me+je>=Br.y1};return Sr.x0===Br.x0&&Sr.x1===Br.x1&&Sr.y0===Br.y0&&Sr.y1===Br.y1?{x0:Sr.x0,x1:Sr.x1,y0:Sr.y0,y1:Sr.y1}:{x0:$e(Sr.x0-je)?0:Ee(Sr.x0-je)?Mt[0]:Sr.x0,x1:$e(Sr.x1+je)?0:Ee(Sr.x1+je)?Mt[0]:Sr.x1,y0:xe(Sr.y0-je)?0:ye(Sr.y0-je)?Mt[1]:Sr.y0,y1:xe(Sr.y1+je)?0:ye(Sr.y1+je)?Mt[1]:Sr.y1}},V=null,ee={},ne={},K=null,ue=function(Sr,Br){return Br?ee[s(Sr)]:ne[s(Sr)]},te=function(Sr,Br,Mt,je){if(Br)return ee[s(w)]||le;var $e=ne[A.level]||Mt;return F(Sr)?ce(Sr,$e,je):{}};x.hasMultipleRoots&&I&&z++,A._maxDepth=z,A._backgroundColor=g.paper_bgcolor,A._entryDepth=m.data.depth,A._atRootLevel=I;var H=-R/2+N.l+N.w*(B.x[1]+B.x[0])/2,ae=-U/2+N.t+N.h*(1-(B.y[1]+B.y[0])/2),ie=function(Sr){return H+Sr},ve=function(Sr){return ae+Sr},Ae=ve(0),Ce=ie(0),Fe=function(Sr){return Ce+Sr},ze=function(Sr){return Ae+Sr};function Ye(Sr,Br){return Sr+","+Br}var it=Fe(0),st=function(Sr){Sr.x=Math.max(it,Sr.x)},nt=A.pathbar.edgeshape,Qe=function(Sr){var Br=Fe(Math.max(Math.min(Sr.x0,Sr.x0),0)),Mt=Fe(Math.min(Math.max(Sr.x1,Sr.x1),j)),je=ze(Sr.y0),$e=ze(Sr.y1),Ee=Z/2,xe={},ye={};xe.x=Br,ye.x=Mt,xe.y=ye.y=(je+$e)/2;var Me={x:Br,y:je},Xe={x:Mt,y:je},Je={x:Mt,y:$e},Lt={x:Br,y:$e};return nt===">"?(Me.x-=Ee,Xe.x-=Ee,Je.x-=Ee,Lt.x-=Ee):nt==="/"?(Je.x-=Ee,Lt.x-=Ee,xe.x-=Ee/2,ye.x-=Ee/2):nt==="\\"?(Me.x-=Ee,Xe.x-=Ee,xe.x-=Ee/2,ye.x-=Ee/2):nt==="<"&&(xe.x-=Ee,ye.x-=Ee),st(Me),st(Lt),st(xe),st(Xe),st(Je),st(ye),"M"+Ye(Me.x,Me.y)+"L"+Ye(Xe.x,Xe.y)+"L"+Ye(ye.x,ye.y)+"L"+Ye(Je.x,Je.y)+"L"+Ye(Lt.x,Lt.y)+"L"+Ye(xe.x,xe.y)+"Z"},Le=A[_?"tiling":"marker"].pad,Te=function(Sr){return A.textposition.indexOf(Sr)!==-1},pe=Te("top"),Ne=Te("left"),ot=Te("right"),ft=Te("bottom"),rt=function(Sr){var Br=ie(Sr.x0),Mt=ie(Sr.x1),je=ve(Sr.y0),$e=ve(Sr.y1),Ee=Mt-Br,xe=$e-je;if(!Ee||!xe)return"";var ye=A.marker.cornerradius||0,Me=Math.min(ye,Ee/2,xe/2);Me&&Sr.data&&Sr.data.data&&Sr.data.data.label&&(pe&&(Me=Math.min(Me,Le.t)),Ne&&(Me=Math.min(Me,Le.l)),ot&&(Me=Math.min(Me,Le.r)),ft&&(Me=Math.min(Me,Le.b)));var Xe=function(Je,Lt){return Me?"a"+Ye(Me,Me)+" 0 0 1 "+Ye(Je,Lt):""};return"M"+Ye(Br,je+Me)+Xe(Me,-Me)+"L"+Ye(Mt-Me,je)+Xe(Me,Me)+"L"+Ye(Mt,$e-Me)+Xe(-Me,Me)+"L"+Ye(Br+Me,$e)+Xe(-Me,-Me)+"Z"},Ft=function(Sr,Br){var Mt=Sr.x0,je=Sr.x1,$e=Sr.y0,Ee=Sr.y1,xe=Sr.textBB,ye=pe||Br.isHeader&&!ft,Me=ye?"start":ft?"end":"middle",Xe=Te("right"),Je=Te("left")||Br.onPathbar,Lt=Je?-1:Xe?1:0;if(Br.isHeader){if(Mt+=(_?Le:Le.l)-e,je-=(_?Le:Le.r)-e,Mt>=je){var Ct=(Mt+je)/2;Mt=Ct,je=Ct}var Ot;ft?(Ot=Ee-(_?Le:Le.b),$e-1,flipY:B.tiling.flip.indexOf("y")>-1,pad:{inner:B.tiling.pad,top:B.marker.pad.t,left:B.marker.pad.l,right:B.marker.pad.r,bottom:B.marker.pad.b}}),fe=re.descendants(),le=1/0,ce=-1/0;fe.forEach(function(ue){var te=ue.depth;te>=B._maxDepth?(ue.x0=ue.x1=(ue.x0+ue.x1)/2,ue.y0=ue.y1=(ue.y0+ue.y1)/2):(le=Math.min(le,te),ce=Math.max(ce,te))}),d=d.data(fe,o.getPtId),B._maxVisibleLayers=isFinite(ce)?ce-le+1:0,d.enter().append("g").classed("slice",!0),u(d,a,L,[l,g],M),d.order();var V=null;if(m&&I){var ee=o.getPtId(I);d.each(function(ue){V===null&&o.getPtId(ue)===ee&&(V={x0:ue.x0,x1:ue.x1,y0:ue.y0,y1:ue.y1})})}var ne=function(){return V||{x0:0,x1:l,y0:0,y1:g}},K=d;return m&&(K=K.transition().each("end",function(){var ue=h.select(this);o.setSliceCursor(ue,f,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),K.each(function(ue){var te=o.isHeader(ue,B);ue._x0=x(ue.x0),ue._x1=x(ue.x1),ue._y0=A(ue.y0),ue._y1=A(ue.y1),ue._hoverX=x(ue.x1-B.marker.pad.r),ue._hoverY=A(j?ue.y1-B.marker.pad.b/2:ue.y0+B.marker.pad.t/2);var H=h.select(this),ae=b.ensureSingle(H,"path","surface",function(ze){ze.style("pointer-events",z?"none":"all")});m?ae.transition().attrTween("d",function(ze){var Ye=v(ze,a,ne(),[l,g]);return function(it){return M(Ye(it))}}):ae.attr("d",M),H.call(n,p,f,c,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,f,{isTransitioning:f._transitioning}),ae.call(t,ue,B,f,{hovered:!1}),ue.x0===ue.x1||ue.y0===ue.y1?ue._text="":te?ue._text=Z?"":o.getPtLabel(ue)||"":ue._text=i(ue,p,B,c,F)||"";var ie=b.ensureSingle(H,"g","slicetext"),ve=b.ensureSingle(ie,"text","",function(ze){ze.attr("data-notex",1)}),Ae=b.ensureUniformFontSize(f,o.determineTextFont(B,ue,F.font)),Ce=ue._text||" ",Fe=te&&Ce.indexOf("
")===-1;ve.text(Ce).classed("slicetext",!0).attr("text-anchor",U?"end":R||Fe?"start":"middle").call(S.font,Ae).call(E.convertToTspans,f),ue.textBB=S.bBox(ve.node()),ue.transform=_(ue,{fontSize:Ae.size,isHeader:te}),ue.transform.fontSize=Ae.size,m?ve.transition().attrTween("transform",function(ze){var Ye=y(ze,a,ne(),[l,g]);return function(it){return w(Ye(it))}}):ve.attr("transform",w(ue))}),V}}}),V4=Ge({"src/traces/treemap/plot.js"($,G){var h=Mk(),b=q4();G.exports=function(E,e,t,r){return h(E,e,t,r,{type:"treemap",drawDescendants:b})}}}),H4=Ge({"src/traces/treemap/index.js"($,G){G.exports={moduleType:"trace",name:"treemap",basePlotModule:rE(),categories:[],animatable:!0,attributes:nE(),layoutAttributes:wk(),supplyDefaults:B4(),supplyLayoutDefaults:N4(),calc:Tk().calc,crossTraceCalc:Tk().crossTraceCalc,plot:V4(),style:aE().style,colorbar:Vf(),meta:{}}}}),G4=Ge({"lib/treemap.js"($,G){G.exports=H4()}}),X4=Ge({"src/traces/icicle/base_plot.js"($){var G=$c();$.name="icicle",$.plot=function(h,b,S,E){G.plotBasePlot($.name,h,b,S,E)},$.clean=function(h,b,S,E){G.cleanBasePlot($.name,h,b,S,E)}}}),Ek=Ge({"src/traces/icicle/attributes.js"($,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=Ru(),e=Sc().attributes,t=My(),r=o_(),o=nE(),n=Gb(),i=Qi().extendFlat,a=hv().pattern;G.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:o.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:i({colors:r.marker.colors,line:r.marker.line,pattern:a,editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),leaf:r.leaf,pathbar:o.pathbar,text:t.text,textinfo:r.textinfo,texttemplate:b({editType:"plot"},{keys:n.eventDataKeys.concat(["label","value"])}),texttemplatefallback:S({editType:"plot"}),hovertext:t.hovertext,hoverinfo:r.hoverinfo,hovertemplate:h({},{keys:n.eventDataKeys}),hovertemplatefallback:S(),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:o.outsidetextfont,textposition:o.textposition,sort:t.sort,root:r.root,domain:e({name:"icicle",trace:!0,editType:"calc"})}}}),kk=Ge({"src/traces/icicle/layout_attributes.js"($,G){G.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Y4=Ge({"src/traces/icicle/defaults.js"($,G){var h=yn(),b=Ek(),S=So(),E=Sc().defaults,e=kd().handleText,t=gm().TEXTPAD,r=Ey().handleMarkerDefaults,o=Ac(),n=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,f,c,p){function d(w,m){return h.coerce(s,f,b,w,m)}var T=d("labels"),l=d("parents");if(!T||!T.length||!l||!l.length){f.visible=!1;return}var g=d("values");g&&g.length?d("branchvalues"):d("count"),d("level"),d("maxdepth"),d("tiling.orientation"),d("tiling.flip"),d("tiling.pad");var x=d("text");d("texttemplate"),d("texttemplatefallback"),f.texttemplate||d("textinfo",h.isArrayOrTypedArray(x)?"text+label":"label"),d("hovertext"),d("hovertemplate"),d("hovertemplatefallback");var A=d("pathbar.visible"),M="auto";e(s,f,p,d,M,{hasPathbar:A,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("textposition"),r(s,f,p,d);var _=f._hasColorscale=n(s,"marker","colors")||(s.marker||{}).coloraxis;_&&i(s,f,p,d,{prefix:"marker.",cLetter:"c"}),d("leaf.opacity",_?1:.7),f._hovered={marker:{line:{width:2,color:S.contrast(p.paper_bgcolor)}}},A&&(d("pathbar.thickness",f.pathbar.textfont.size+2*t),d("pathbar.side"),d("pathbar.edgeshape")),d("sort"),d("root.color"),E(f,p,d),f._length=null}}}),Z4=Ge({"src/traces/icicle/layout_defaults.js"($,G){var h=yn(),b=kk();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),Ck=Ge({"src/traces/icicle/calc.js"($){var G=s_();$.calc=function(h,b){return G.calc(h,b)},$.crossTraceCalc=function(h){return G._runCrossTraceCalc("icicle",h)}}}),W4=Ge({"src/traces/icicle/partition.js"($,G){var h=Cy(),b=Ak();G.exports=function(E,e,t){var r=t.flipX,o=t.flipY,n=t.orientation==="h",i=t.maxDepth,a=e[0],s=e[1];i&&(a=(E.height+1)*e[0]/Math.min(E.height+1,i),s=(E.height+1)*e[1]/Math.min(E.height+1,i));var f=h.partition().padding(t.pad.inner).size(n?[e[1],a]:[e[0],s])(E);return(n||r||o)&&b(f,e,{swapXY:n,flipX:r,flipY:o}),f}}}),Lk=Ge({"src/traces/icicle/style.js"($,G){var h=Za(),b=So(),S=yn(),E=sc().resizeText,e=bl();function t(o){var n=o._fullLayout._iciclelayer.selectAll(".trace");E(o,n,"icicle"),n.each(function(i){var a=h.select(this),s=i[0],f=s.trace;a.style("opacity",f.opacity),a.selectAll("path.surface").each(function(c){h.select(this).call(r,c,f,o)})})}function r(o,n,i,a){var s=n.data.data,f=!n.children,c=s.i,p=S.castOption(i,c,"marker.line.color")||b.defaultLine,d=S.castOption(i,c,"marker.line.width")||0;o.call(e,n,i,a).style("stroke-width",d).call(b.stroke,p).style("opacity",f?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),K4=Ge({"src/traces/icicle/draw_descendants.js"($,G){var h=Za(),b=yn(),S=Ms(),E=ec(),e=W4(),t=Lk().styleOne,r=Gb(),o=qs(),n=gu(),i=Vu().formatSliceLabel,a=!1;G.exports=function(f,c,p,d,T){var l=T.width,g=T.height,x=T.viewX,A=T.viewY,M=T.pathSlice,_=T.toMoveInsideSlice,w=T.strTransform,m=T.hasTransition,u=T.handleSlicesExit,v=T.makeUpdateSliceInterpolator,y=T.makeUpdateTextInterpolator,I=T.prevEntry,L={},z=f._context.staticPlot,F=f._fullLayout,N=c[0],B=N.trace,R=B.textposition.indexOf("left")!==-1,U=B.textposition.indexOf("right")!==-1,j=B.textposition.indexOf("bottom")!==-1,Z=e(p,[l,g],{flipX:B.tiling.flip.indexOf("x")>-1,flipY:B.tiling.flip.indexOf("y")>-1,orientation:B.tiling.orientation,pad:{inner:B.tiling.pad},maxDepth:B._maxDepth}),re=Z.descendants(),fe=1/0,le=-1/0;re.forEach(function(K){var ue=K.depth;ue>=B._maxDepth?(K.x0=K.x1=(K.x0+K.x1)/2,K.y0=K.y1=(K.y0+K.y1)/2):(fe=Math.min(fe,ue),le=Math.max(le,ue))}),d=d.data(re,o.getPtId),B._maxVisibleLayers=isFinite(le)?le-fe+1:0,d.enter().append("g").classed("slice",!0),u(d,a,L,[l,g],M),d.order();var ce=null;if(m&&I){var V=o.getPtId(I);d.each(function(K){ce===null&&o.getPtId(K)===V&&(ce={x0:K.x0,x1:K.x1,y0:K.y0,y1:K.y1})})}var ee=function(){return ce||{x0:0,x1:l,y0:0,y1:g}},ne=d;return m&&(ne=ne.transition().each("end",function(){var K=h.select(this);o.setSliceCursor(K,f,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ne.each(function(K){K._x0=x(K.x0),K._x1=x(K.x1),K._y0=A(K.y0),K._y1=A(K.y1),K._hoverX=x(K.x1-B.tiling.pad),K._hoverY=A(j?K.y1-B.tiling.pad/2:K.y0+B.tiling.pad/2);var ue=h.select(this),te=b.ensureSingle(ue,"path","surface",function(ve){ve.style("pointer-events",z?"none":"all")});m?te.transition().attrTween("d",function(ve){var Ae=v(ve,a,ee(),[l,g],{orientation:B.tiling.orientation,flipX:B.tiling.flip.indexOf("x")>-1,flipY:B.tiling.flip.indexOf("y")>-1});return function(Ce){return M(Ae(Ce))}}):te.attr("d",M),ue.call(n,p,f,c,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,f,{isTransitioning:f._transitioning}),te.call(t,K,B,f,{hovered:!1}),K.x0===K.x1||K.y0===K.y1?K._text="":K._text=i(K,p,B,c,F)||"";var H=b.ensureSingle(ue,"g","slicetext"),ae=b.ensureSingle(H,"text","",function(ve){ve.attr("data-notex",1)}),ie=b.ensureUniformFontSize(f,o.determineTextFont(B,K,F.font));ae.text(K._text||" ").classed("slicetext",!0).attr("text-anchor",U?"end":R?"start":"middle").call(S.font,ie).call(E.convertToTspans,f),K.textBB=S.bBox(ae.node()),K.transform=_(K,{fontSize:ie.size}),K.transform.fontSize=ie.size,m?ae.transition().attrTween("transform",function(ve){var Ae=y(ve,a,ee(),[l,g]);return function(Ce){return w(Ae(Ce))}}):ae.attr("transform",w(K))}),ce}}}),$4=Ge({"src/traces/icicle/plot.js"($,G){var h=Mk(),b=K4();G.exports=function(E,e,t,r){return h(E,e,t,r,{type:"icicle",drawDescendants:b})}}}),J4=Ge({"src/traces/icicle/index.js"($,G){G.exports={moduleType:"trace",name:"icicle",basePlotModule:X4(),categories:[],animatable:!0,attributes:Ek(),layoutAttributes:kk(),supplyDefaults:Y4(),supplyLayoutDefaults:Z4(),calc:Ck().calc,crossTraceCalc:Ck().crossTraceCalc,plot:$4(),style:Lk().style,colorbar:Vf(),meta:{}}}}),Q4=Ge({"lib/icicle.js"($,G){G.exports=J4()}}),eP=Ge({"src/traces/funnelarea/base_plot.js"($){var G=$c();$.name="funnelarea",$.plot=function(h,b,S,E){G.plotBasePlot($.name,h,b,S,E)},$.clean=function(h,b,S,E){G.cleanBasePlot($.name,h,b,S,E)}}}),Pk=Ge({"src/traces/funnelarea/attributes.js"($,G){var h=My(),b=nu(),S=Sc().attributes,{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=Qi().extendFlat;G.exports={labels:h.labels,label0:h.label0,dlabel:h.dlabel,values:h.values,marker:{colors:h.marker.colors,line:{color:r({},h.marker.line.color,{dflt:null}),width:r({},h.marker.line.width,{dflt:1}),editType:"calc"},pattern:h.marker.pattern,editType:"calc"},text:h.text,hovertext:h.hovertext,scalegroup:r({},h.scalegroup,{}),textinfo:r({},h.textinfo,{flags:["label","text","value","percent"]}),texttemplate:e({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:t({editType:"plot"}),hoverinfo:r({},b.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:E({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:t(),textposition:r({},h.textposition,{values:["inside","none"],dflt:"inside"}),textfont:h.textfont,insidetextfont:h.insidetextfont,title:{text:h.title.text,font:h.title.font,position:r({},h.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:S({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),Rk=Ge({"src/traces/funnelarea/layout_attributes.js"($,G){var h=l3().hiddenlabels;G.exports={hiddenlabels:h,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),tP=Ge({"src/traces/funnelarea/defaults.js"($,G){var h=yn(),b=Pk(),S=Sc().defaults,E=kd().handleText,e=Ey().handleLabelsAndValues,t=Ey().handleMarkerDefaults;G.exports=function(o,n,i,a){function s(M,_){return h.coerce(o,n,b,M,_)}var f=s("labels"),c=s("values"),p=e(f,c),d=p.len;if(n._hasLabels=p.hasLabels,n._hasValues=p.hasValues,!n._hasLabels&&n._hasValues&&(s("label0"),s("dlabel")),!d){n.visible=!1;return}n._length=d,t(o,n,a,s),s("scalegroup");var T=s("text"),l=s("texttemplate");s("texttemplatefallback");var g;if(l||(g=s("textinfo",Array.isArray(T)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),l||g&&g!=="none"){var x=s("textposition");E(o,n,a,s,x,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else g==="none"&&s("textposition","none");S(n,a,s);var A=s("title.text");A&&(s("title.position"),h.coerceFont(s,"title.font",a.font)),s("aspectratio"),s("baseratio")}}}),rP=Ge({"src/traces/funnelarea/layout_defaults.js"($,G){var h=yn(),b=Rk();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("hiddenlabels"),t("funnelareacolorway",e.colorway),t("extendfunnelareacolors")}}}),Ik=Ge({"src/traces/funnelarea/calc.js"($,G){var h=v0();function b(E,e){return h.calc(E,e)}function S(E){h.crossTraceCalc(E,{type:"funnelarea"})}G.exports={calc:b,crossTraceCalc:S}}}),nP=Ge({"src/traces/funnelarea/plot.js"($,G){var h=Za(),b=Ms(),S=yn(),E=S.strScale,e=S.strTranslate,t=ec(),r=au(),o=r.toMoveInsideBar,n=sc(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=eg(),f=ky(),c=f.attachFxHandlers,p=f.determineInsideTextFont,d=f.layoutAreas,T=f.prerenderTitles,l=f.positionTitleOutside,g=f.formatSliceLabel;G.exports=function(w,m){var u=w._context.staticPlot,v=w._fullLayout;a("funnelarea",v),T(m,w),d(m,v._size),S.makeTraceGroups(v._funnelarealayer,m,"trace").each(function(y){var I=h.select(this),L=y[0],z=L.trace;M(y),I.each(function(){var F=h.select(this).selectAll("g.slice").data(y);F.enter().append("g").classed("slice",!0),F.exit().remove(),F.each(function(B,R){if(B.hidden){h.select(this).selectAll("path,g").remove();return}B.pointNumber=B.i,B.curveNumber=z.index;var U=L.cx,j=L.cy,Z=h.select(this),re=Z.selectAll("path.surface").data([B]);re.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),Z.call(c,w,y);var fe="M"+(U+B.TR[0])+","+(j+B.TR[1])+x(B.TR,B.BR)+x(B.BR,B.BL)+x(B.BL,B.TL)+"Z";re.attr("d",fe),g(w,B,L);var le=s.castOption(z.textposition,B.pts),ce=Z.selectAll("g.slicetext").data(B.text&&le!=="none"?[0]:[]);ce.enter().append("g").classed("slicetext",!0),ce.exit().remove(),ce.each(function(){var V=S.ensureSingle(h.select(this),"text","",function(ie){ie.attr("data-notex",1)}),ee=S.ensureUniformFontSize(w,p(z,B,v.font));V.text(B.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(b.font,ee).call(t.convertToTspans,w);var ne=b.bBox(V.node()),K,ue,te,H=Math.min(B.BL[1],B.BR[1])+j,ae=Math.max(B.TL[1],B.TR[1])+j;ue=Math.max(B.TL[0],B.BL[0])+U,te=Math.min(B.TR[0],B.BR[0])+U,K=o(ue,te,H,ae,ne,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),K.fontSize=ee.size,i(z.type,K,v),y[R].transform=K,S.setTransormAndDisplay(V,K)})});var N=h.select(this).selectAll("g.titletext").data(z.title.text?[0]:[]);N.enter().append("g").classed("titletext",!0),N.exit().remove(),N.each(function(){var B=S.ensureSingle(h.select(this),"text","",function(j){j.attr("data-notex",1)}),R=z.title.text;z._meta&&(R=S.templateString(R,z._meta)),B.text(R).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(b.font,z.title.font).call(t.convertToTspans,w);var U=l(L,v._size);B.attr("transform",e(U.x,U.y)+E(Math.min(1,U.scale))+e(U.tx,U.ty))})})})};function x(_,w){var m=w[0]-_[0],u=w[1]-_[1];return"l"+m+","+u}function A(_,w){return[.5*(_[0]+w[0]),.5*(_[1]+w[1])]}function M(_){if(!_.length)return;var w=_[0],m=w.trace,u=m.aspectratio,v=m.baseratio;v>.999&&(v=.999);var y=Math.pow(v,2),I=w.vTotal,L=I*y/(1-y),z=I,F=L/I;function N(){var ve=Math.sqrt(F);return{x:ve,y:-ve}}function B(){var ve=N();return[ve.x,ve.y]}var R,U=[];U.push(B());var j,Z;for(j=_.length-1;j>-1;j--)if(Z=_[j],!Z.hidden){var re=Z.v/z;F+=re,U.push(B())}var fe=1/0,le=-1/0;for(j=0;j-1;j--)if(Z=_[j],!Z.hidden){H+=1;var ae=U[H][0],ie=U[H][1];Z.TL=[-ae,ie],Z.TR=[ae,ie],Z.BL=ue,Z.BR=te,Z.pxmid=A(Z.TR,Z.BR),ue=Z.TL,te=Z.TR}}}}),aP=Ge({"src/traces/funnelarea/style.js"($,G){var h=Za(),b=w1(),S=sc().resizeText;G.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");S(e,t,"funnelarea"),t.each(function(r){var o=r[0],n=o.trace,i=h.select(this);i.style({opacity:n.opacity}),i.selectAll("path.surface").each(function(a){h.select(this).call(b,a,n,e)})})}}}),iP=Ge({"src/traces/funnelarea/index.js"($,G){G.exports={moduleType:"trace",name:"funnelarea",basePlotModule:eP(),categories:["pie-like","funnelarea","showLegend"],attributes:Pk(),layoutAttributes:Rk(),supplyDefaults:tP(),supplyLayoutDefaults:rP(),calc:Ik().calc,crossTraceCalc:Ik().crossTraceCalc,plot:nP(),style:aP(),styleOne:w1(),meta:{}}}}),oP=Ge({"lib/funnelarea.js"($,G){G.exports=iP()}}),sd=Ge({"stackgl_modules/index.js"($,G){(function(){var h={24:(function(e){var t={left:0,top:0};e.exports=r;function r(n,i,a){i=i||n.currentTarget||n.srcElement,Array.isArray(a)||(a=[0,0]);var s=n.clientX||0,f=n.clientY||0,c=o(i);return a[0]=s-c.left,a[1]=f-c.top,a}function o(n){return n===window||n===document||n===document.body?t:n.getBoundingClientRect()}}),109:(function(e){e.exports=t;function t(r,o,n,i){var a=n[0],s=n[2],f=o[0]-a,c=o[2]-s,p=Math.sin(i),d=Math.cos(i);return r[0]=a+c*p+f*d,r[1]=o[1],r[2]=s+c*d-f*p,r}}),160:(function(e){e.exports=t;function t(r,o,n){return r[0]=Math.max(o[0],n[0]),r[1]=Math.max(o[1],n[1]),r[2]=Math.max(o[2],n[2]),r[3]=Math.max(o[3],n[3]),r}}),216:(function(e){e.exports=t;function t(r,o){for(var n={},i=0;i1){p[0]in f||(f[p[0]]=[]),f=f[p[0]];for(var d=1;d=0;--R){var ee=N[R];U=ee[0];var ne=z[U],K=ne[0],ue=ne[1],te=L[K],H=L[ue];if((te[0]-H[0]||te[1]-H[1])<0){var ae=K;K=ue,ue=ae}ne[0]=K;var ie=ne[1]=ee[1],ve;for(B&&(ve=ne[2]);R>0&&N[R-1][0]===U;){var ee=N[--R],Ae=ee[1];B?z.push([ie,Ae,ve]):z.push([ie,Ae]),ie=Ae}B?z.push([ie,ue,ve]):z.push([ie,ue])}return j}function _(L,z,F){for(var N=z.length,B=new o(N),R=[],U=0;Uz[2]?1:0)}function u(L,z,F){if(L.length!==0){if(z)for(var N=0;N0||U.length>0}function I(L,z,F){var N;if(F){N=z;for(var B=new Array(z.length),R=0;R>8&15|G>>4&240,G>>4&15|G&240,(G&15)<<4|G&15,1):h===8?zy(G>>24&255,G>>16&255,G>>8&255,(G&255)/255):h===4?zy(G>>12&15|G>>8&240,G>>8&15|G>>4&240,G>>4&15|G&240,((G&15)<<4|G&15)/255):null):(G=b3.exec(K))?new wd(G[1],G[2],G[3],1):(G=Eb.exec(K))?new wd(G[1]*255/100,G[2]*255/100,G[3]*255/100,1):(G=kb.exec(K))?zy(G[1],G[2],G[3],G[4]):(G=jA.exec(K))?zy(G[1]*255/100,G[2]*255/100,G[3]*255/100,G[4]):(G=w3.exec(K))?UA(G[1],G[2]/100,G[3]/100,1):(G=qA.exec(K))?UA(G[1],G[2]/100,G[3]/100,G[4]):Cb.hasOwnProperty(K)?Gu(Cb[K]):K==="transparent"?new wd(NaN,NaN,NaN,0):null}function Gu(K){return new wd(K>>16&255,K>>8&255,K&255,1)}function zy(K,G,h,b){return b<=0&&(K=G=h=NaN),new wd(K,G,h,b)}function Oy(K){return K instanceof x0||(K=Dy(K)),K?(K=K.rgb(),new wd(K.r,K.g,K.b,K.opacity)):new wd}function Fy(K,G,h,b){return arguments.length===1?Oy(K):new wd(K,G,h,b??1)}function wd(K,G,h,b){this.r=+K,this.g=+G,this.b=+h,this.opacity=+b}function Tb(){return`#${Sg(this.r)}${Sg(this.g)}${Sg(this.b)}`}function p_(){return`#${Sg(this.r)}${Sg(this.g)}${Sg(this.b)}${Sg((isNaN(this.opacity)?1:this.opacity)*255)}`}function m_(){const K=Ab(this.opacity);return`${K===1?"rgb(":"rgba("}${Im(this.r)}, ${Im(this.g)}, ${Im(this.b)}${K===1?")":`, ${K})`}`}function Ab(K){return isNaN(K)?1:Math.max(0,Math.min(1,K))}function Im(K){return Math.max(0,Math.min(255,Math.round(K)||0))}function Sg(K){return K=Im(K),(K<16?"0":"")+K.toString(16)}function UA(K,G,h,b){return b<=0?K=G=h=NaN:h<=0||h>=1?K=G=NaN:G<=0&&(K=NaN),new Xu(K,G,h,b)}function y3(K){if(K instanceof Xu)return new Xu(K.h,K.s,K.l,K.opacity);if(K instanceof x0||(K=Dy(K)),!K)return new Xu;if(K instanceof Xu)return K;K=K.rgb();var G=K.r/255,h=K.g/255,b=K.b/255,S=Math.min(G,h,b),E=Math.max(G,h,b),e=NaN,t=E-S,r=(E+S)/2;return t?(G===E?e=(h-b)/t+(h0&&r<1?0:e,new Xu(e,t,r,K.opacity)}function Sb(K,G,h,b){return arguments.length===1?y3(K):new Xu(K,G,h,b??1)}function Xu(K,G,h,b){this.h=+K,this.s=+G,this.l=+h,this.opacity=+b}function Mb(K){return K=(K||0)%360,K<0?K+360:K}function cd(K){return Math.max(0,Math.min(1,K||0))}function _3(K,G,h){return(K<60?G+(h-G)*K/60:K<180?h:K<240?G+(h-G)*(240-K)/60:G)*255}var $0,Mg,K0,Dm,Uv,x3,b3,Eb,kb,jA,w3,qA,Cb,T3=hi({"node_modules/d3-color/src/color.js"(){d_(),$0=.7,Mg=1/$0,K0="\\s*([+-]?\\d+)\\s*",Dm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Uv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",x3=/^#([0-9a-f]{3,8})$/,b3=new RegExp(`^rgb\\(${K0},${K0},${K0}\\)$`),Eb=new RegExp(`^rgb\\(${Uv},${Uv},${Uv}\\)$`),kb=new RegExp(`^rgba\\(${K0},${K0},${K0},${Dm}\\)$`),jA=new RegExp(`^rgba\\(${Uv},${Uv},${Uv},${Dm}\\)$`),w3=new RegExp(`^hsl\\(${Dm},${Uv},${Uv}\\)$`),qA=new RegExp(`^hsla\\(${Dm},${Uv},${Uv},${Dm}\\)$`),Cb={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},Ag(x0,Dy,{copy(K){return Object.assign(new this.constructor,this,K)},displayable(){return this.rgb().displayable()},hex:BA,formatHex:BA,formatHex8:vE,formatHsl:v_,formatRgb:NA,toString:NA}),Ag(wd,Fy,h_(x0,{brighter(K){return K=K==null?Mg:Math.pow(Mg,K),new wd(this.r*K,this.g*K,this.b*K,this.opacity)},darker(K){return K=K==null?$0:Math.pow($0,K),new wd(this.r*K,this.g*K,this.b*K,this.opacity)},rgb(){return this},clamp(){return new wd(Im(this.r),Im(this.g),Im(this.b),Ab(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:Tb,formatHex:Tb,formatHex8:p_,formatRgb:m_,toString:m_})),Ag(Xu,Sb,h_(x0,{brighter(K){return K=K==null?Mg:Math.pow(Mg,K),new Xu(this.h,this.s,this.l*K,this.opacity)},darker(K){return K=K==null?$0:Math.pow($0,K),new Xu(this.h,this.s,this.l*K,this.opacity)},rgb(){var K=this.h%360+(this.h<0)*360,G=isNaN(K)||isNaN(this.s)?0:this.s,h=this.l,b=h+(h<.5?h:1-h)*G,S=2*h-b;return new wd(_3(K>=240?K-240:K+120,S,b),_3(K,S,b),_3(K<120?K+240:K-120,S,b),this.opacity)},clamp(){return new Xu(Mb(this.h),cd(this.s),cd(this.l),Ab(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 K=Ab(this.opacity);return`${K===1?"hsl(":"hsla("}${Mb(this.h)}, ${cd(this.s)*100}%, ${cd(this.l)*100}%${K===1?")":`, ${K})`}`}}))}}),A3,b0,S3=hi({"node_modules/d3-color/src/math.js"(){A3=Math.PI/180,b0=180/Math.PI}});function M3(K){if(K instanceof w0)return new w0(K.l,K.a,K.b,K.opacity);if(K instanceof Jp)return k3(K);K instanceof wd||(K=Oy(K));var G=__(K.r),h=__(K.g),b=__(K.b),S=E3((.2225045*G+.7168786*h+.0606169*b)/Eg),E,e;return G===h&&h===b?E=e=S:(E=E3((.4360747*G+.3850649*h+.1430804*b)/Pb),e=E3((.0139322*G+.0971045*h+.7141733*b)/qv)),new w0(116*S-16,500*(E-S),200*(S-e),K.opacity)}function g_(K,G,h,b){return arguments.length===1?M3(K):new w0(K,G,h,b??1)}function w0(K,G,h,b){this.l=+K,this.a=+G,this.b=+h,this.opacity=+b}function E3(K){return K>VA?Math.pow(K,.3333333333333333):K/Qp+Rb}function Lb(K){return K>T0?K*K*K:Qp*(K-Rb)}function y_(K){return 255*(K<=.0031308?12.92*K:1.055*Math.pow(K,.4166666666666667)-.055)}function __(K){return(K/=255)<=.04045?K/12.92:Math.pow((K+.055)/1.055,2.4)}function pE(K){if(K instanceof Jp)return new Jp(K.h,K.c,K.l,K.opacity);if(K instanceof w0||(K=M3(K)),K.a===0&&K.b===0)return new Jp(NaN,0=1?(h=1,G-1):Math.floor(h*G),S=K[b],E=K[b+1],e=b>0?K[b-1]:2*S-E,t=b()=>K}});function T_(K,G){return function(h){return K+h*G}}function GA(K,G,h){return K=Math.pow(K,h),G=Math.pow(G,h)-K,h=1/h,function(b){return Math.pow(K+b*G,h)}}function A_(K,G){var h=G-K;return h?T_(K,h>180||h<-180?h-360*Math.round(h/360):h):Rg(isNaN(K)?G:K)}function gE(K){return(K=+K)==1?Td:function(G,h){return h-G?GA(G,h,K):Rg(isNaN(G)?h:G)}}function Td(K,G){var h=G-K;return h?T_(K,h):Rg(isNaN(K)?G:K)}var jy=hi({"node_modules/d3-interpolate/src/color.js"(){Fb()}});function Bb(K){return function(G){var h=G.length,b=new Array(h),S=new Array(h),E=new Array(h),e,t;for(e=0;eh&&(E=G.slice(h,E),t[e]?t[e]+=E:t[++e]=E),(b=b[0])===(S=S[0])?t[e]?t[e]+=S:t[++e]=S:(t[++e]=null,r.push({i:e,x:e0(b,S)})),h=Vy.lastIndex;return h180?n+=360:n-o>180&&(o+=360),a.push({i:i.push(S(i)+"rotate(",null,b)-2,x:e0(o,n)})):n&&i.push(S(i)+"rotate("+n+b)}function t(o,n,i,a){o!==n?a.push({i:i.push(S(i)+"skewX(",null,b)-2,x:e0(o,n)}):n&&i.push(S(i)+"skewX("+n+b)}function r(o,n,i,a,s,f){if(o!==i||n!==a){var c=s.push(S(s)+"scale(",null,",",null,")");f.push({i:c-4,x:e0(o,i)},{i:c-2,x:e0(n,a)})}else(i!==1||a!==1)&&s.push(S(s)+"scale("+i+","+a+")")}return function(o,n){var i=[],a=[];return o=K(o),n=K(n),E(o.translateX,o.translateY,n.translateX,n.translateY,i,a),e(o.rotate,n.rotate,i,a),t(o.skewX,n.skewX,i,a),r(o.scaleX,o.scaleY,n.scaleX,n.scaleY,i,a),o=n=null,function(s){for(var f=-1,c=a.length,p;++fHy,interpolateArray:()=>XA,interpolateBasis:()=>Lg,interpolateBasisClosed:()=>P3,interpolateCubehelix:()=>Pi,interpolateCubehelixLong:()=>Ui,interpolateDate:()=>O3,interpolateDiscrete:()=>Om,interpolateHcl:()=>Ma,interpolateHclLong:()=>Ai,interpolateHsl:()=>ve,interpolateHslLong:()=>Ie,interpolateHue:()=>L_,interpolateLab:()=>Pt,interpolateNumber:()=>e0,interpolateNumberArray:()=>R3,interpolateObject:()=>C_,interpolateRgb:()=>Nb,interpolateRgbBasis:()=>S_,interpolateRgbBasisClosed:()=>M_,interpolateRound:()=>Bm,interpolateString:()=>jb,interpolateTransformCss:()=>U3,interpolateTransformSvg:()=>zg,interpolateZoom:()=>I_,piecewise:()=>ql,quantize:()=>si});var ao=hi({"node_modules/d3-interpolate/src/index.js"(){t0(),z3(),Pg(),w_(),Ub(),Fm(),P_(),k_(),I3(),YA(),_E(),B3(),$A(),O(),E_(),ht(),Ir(),no(),$s(),Sf(),Xa()}}),bl=Ge({"src/traces/sunburst/fill_one.js"(K,G){var h=As(),b=go();G.exports=function(E,e,t,r,o){var n=e.data.data,i=n.i,a=o||n.color;if(i>=0){e.i=n.i;var s=t.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=a,e.color=a):(s.color=a,e.color=a),h.pointStyle(E,t,r,e)}else b.fill(E,a)}}}),bc=Ge({"src/traces/sunburst/style.js"(K,G){var h=ki(),b=go(),S=_n(),E=fc().resizeText,e=bl();function t(o){var n=o._fullLayout._sunburstlayer.selectAll(".trace");E(o,n,"sunburst"),n.each(function(i){var a=h.select(this),s=i[0],f=s.trace;a.style("opacity",f.opacity),a.selectAll("path.surface").each(function(c){h.select(this).call(r,c,f,o)})})}function r(o,n,i,a){var s=n.data.data,f=!n.children,c=s.i,p=S.castOption(i,c,"marker.line.color")||b.defaultLine,v=S.castOption(i,c,"marker.line.width")||0;o.call(e,n,i,a).style("stroke-width",v).call(b.stroke,p).style("opacity",f?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),js=Ge({"src/traces/sunburst/helpers.js"(K){var G=_n(),h=go(),b=Up(),S=ng();K.findEntryWithLevel=function(r,o){var n;return o&&r.eachAfter(function(i){if(K.getPtId(i)===o)return n=i.copy()}),n||r},K.findEntryWithChild=function(r,o){var n;return r.eachAfter(function(i){for(var a=i.children||[],s=0;s0)},K.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},K.isHeader=function(r,o){return!(K.isLeaf(r)||r.depth===o._maxDepth-1)};function t(r){return r.data.data.pid}K.getParent=function(r,o){return K.findEntryWithLevel(r,t(o))},K.listPath=function(r,o){var n=r.parent;if(!n)return[];var i=o?[n.data[o]]:[n];return K.listPath(n,o).concat(i)},K.getPath=function(r){return K.listPath(r,"label").join("/")+"/"},K.formatValue=S.formatPieValue,K.formatPercent=function(r,o){var n=G.formatPercent(r,0);return n==="0%"&&(n=S.formatPiePercent(r,o)),n}}}),xu=Ge({"src/traces/sunburst/fx.js"(K,G){var h=ki(),b=Ro(),S=Kd().appendArrayPointValue,E=Yf(),e=_n(),t=A1(),r=js(),o=ng(),n=o.formatPieValue;G.exports=function(s,f,c,p,v){var T=p[0],l=T.trace,g=T.hierarchy,x=l.type==="sunburst",A=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var M=function(m){var u=c._fullLayout;if(!(c._dragging||u.hovermode===!1)){var d=c._fullData[l.index],y=m.data.data,I=y.i,L=r.isHierarchyRoot(m),z=r.getParent(g,m),F=r.getValue(m),N=function(ae){return e.castOption(d,I,ae)},B=N("hovertemplate"),R=E.castHoverinfo(d,u,I),U=u.separators,j;if(B||R&&R!=="none"&&R!=="skip"){var Z,re;x&&(Z=T.cx+m.pxmid[0]*(1-m.rInscribed),re=T.cy+m.pxmid[1]*(1-m.rInscribed)),A&&(Z=m._hoverX,re=m._hoverY);var fe={},le=[],ce=[],V=function(ae){return le.indexOf(ae)!==-1};R&&(le=R==="all"?d._module.attributes.hoverinfo.flags:R.split("+")),fe.label=y.label,V("label")&&fe.label&&ce.push(fe.label),y.hasOwnProperty("v")&&(fe.value=y.v,fe.valueLabel=n(fe.value,U),V("value")&&ce.push(fe.valueLabel)),fe.currentPath=m.currentPath=r.getPath(m.data),V("current path")&&!L&&ce.push(fe.currentPath);var ee,ne=[],$=function(){ne.indexOf(ee)===-1&&(ce.push(ee),ne.push(ee))};fe.percentParent=m.percentParent=F/r.getValue(z),fe.parent=m.parentString=r.getPtLabel(z),V("percent parent")&&(ee=r.formatPercent(fe.percentParent,U)+" of "+fe.parent,$()),fe.percentEntry=m.percentEntry=F/r.getValue(f),fe.entry=m.entry=r.getPtLabel(f),V("percent entry")&&!L&&!m.onPathbar&&(ee=r.formatPercent(fe.percentEntry,U)+" of "+fe.entry,$()),fe.percentRoot=m.percentRoot=F/r.getValue(g),fe.root=m.root=r.getPtLabel(g),V("percent root")&&!L&&(ee=r.formatPercent(fe.percentRoot,U)+" of "+fe.root,$()),fe.text=N("hovertext")||N("text"),V("text")&&(ee=fe.text,e.isValidTextValue(ee)&&ce.push(ee)),j=[i(m,d,v.eventDataKeys)];var ue={trace:d,y:re,_x0:m._x0,_x1:m._x1,_y0:m._y0,_y1:m._y1,text:ce.join("
"),name:B||V("name")?d.name:void 0,color:N("hoverlabel.bgcolor")||y.color,borderColor:N("hoverlabel.bordercolor"),fontFamily:N("hoverlabel.font.family"),fontSize:N("hoverlabel.font.size"),fontColor:N("hoverlabel.font.color"),fontWeight:N("hoverlabel.font.weight"),fontStyle:N("hoverlabel.font.style"),fontVariant:N("hoverlabel.font.variant"),nameLength:N("hoverlabel.namelength"),textAlign:N("hoverlabel.align"),hovertemplate:B,hovertemplateLabels:fe,eventData:j};x&&(ue.x0=Z-m.rInscribed*m.rpx1,ue.x1=Z+m.rInscribed*m.rpx1,ue.idealAlign=m.pxmid[0]<0?"left":"right"),A&&(ue.x=Z,ue.idealAlign=Z<0?"left":"right");var te=[];E.loneHover(ue,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:c,inOut_bbox:te}),j[0].bbox=te[0],l._hasHoverLabel=!0}if(A){var H=s.select("path.surface");v.styleOne(H,m,d,c,{hovered:!0})}l._hasHoverEvent=!0,c.emit("plotly_hover",{points:j||[i(m,d,v.eventDataKeys)],event:h.event})}},_=function(m){var u=c._fullLayout,d=c._fullData[l.index],y=h.select(this).datum();if(l._hasHoverEvent&&(m.originalEvent=h.event,c.emit("plotly_unhover",{points:[i(y,d,v.eventDataKeys)],event:h.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(E.loneUnhover(u._hoverlayer.node()),l._hasHoverLabel=!1),A){var I=s.select("path.surface");v.styleOne(I,y,d,c,{hovered:!1})}},w=function(m){var u=c._fullLayout,d=c._fullData[l.index],y=x&&(r.isHierarchyRoot(m)||r.isLeaf(m)),I=r.getPtId(m),L=r.isEntry(m)?r.findEntryWithChild(g,I):r.findEntryWithLevel(g,I),z=r.getPtId(L),F={points:[i(m,d,v.eventDataKeys)],event:h.event};y||(F.nextLevel=z);var N=t.triggerHandler(c,"plotly_"+l.type+"click",F);if(N!==!1&&u.hovermode&&(c._hoverdata=[i(m,d,v.eventDataKeys)],E.click(c,h.event)),!y&&N!==!1&&!c._dragging&&!c._transitioning){b.call("_storeDirectGUIEdit",d,u._tracePreGUI[d.uid],{level:d.level});var B={data:[{level:z}],traces:[l.index]},R={frame:{redraw:!1,duration:v.transitionTime},transition:{duration:v.transitionTime,easing:v.transitionEasing},mode:"immediate",fromcurrent:!0};E.loneUnhover(u._hoverlayer.node()),b.call("animate",c,B,R)}};s.on("mouseover",M),s.on("mouseout",_),s.on("click",w)};function i(a,s,f){for(var c=a.data.data,p={curveNumber:s.index,pointNumber:c.i,data:s._input,fullData:s},v=0;vdt.x1?2*Math.PI:0)+ae;nt=pe.rpx1Ye?2*Math.PI:0)+ae;ut={x0:nt,x1:nt}}else ut={rpx0:le,rpx1:le},E.extendFlat(ut,Ae(pe));else ut={rpx0:0,rpx1:0};else ut={x0:ae,x1:ae};return b(ut,dt)}function Pe(pe){var Ne=ne[T.getPtId(pe)],ut,dt=pe.transform;if(Ne)ut=Ne;else if(ut={rpx1:pe.rpx1,transform:{textPosAngle:dt.textPosAngle,scale:0,rotate:dt.rotate,rCenter:dt.rCenter,x:dt.x,y:dt.y}},ee)if(pe.parent)if(Ye){var nt=pe.x1>Ye?2*Math.PI:0;ut.x0=ut.x1=nt}else E.extendFlat(ut,Ae(pe));else ut.x0=ut.x1=ae;else ut.x0=ut.x1=ae;var Ft=b(ut.transform.textPosAngle,pe.transform.textPosAngle),Nt=b(ut.rpx1,pe.rpx1),Qt=b(ut.x0,pe.x0),ar=b(ut.x1,pe.x1),kr=b(ut.transform.scale,dt.scale),Er=b(ut.transform.rotate,dt.rotate),$r=dt.rCenter===0?3:ut.transform.rCenter===0?1/3:1,Sr=b(ut.transform.rCenter,dt.rCenter),Ur=function(Mt){return Sr(Math.pow(Mt,$r))};return function(Mt){var je=Nt(Mt);Qt(Mt),ar(Mt);var Je=Ur(Mt),ke=Ft(Mt),xe={rpx1:je,transform:{textPosAngle:ke,rCenter:Je,x:dt.x,y:dt.y}};return r(N.type,dt,y),{transform:{targetX:Fe(xe),targetY:ze(xe),scale:kr(Mt),rotate:Er(Mt),rCenter:Je}}}}function Ae(pe){var Ne=pe.parent,ut=ne[T.getPtId(Ne)],dt={};if(ut){var nt=Ne.children,Ft=nt.indexOf(pe),Nt=nt.length,Qt=b(ut.x0,ut.x1);dt.x0=Qt(Ft/Nt),dt.x1=Qt(Ft/Nt)}else dt.x0=dt.x1=0;return dt}}function g(_){return h.partition().size([2*Math.PI,_.height+1])(_)}K.formatSliceLabel=function(_,w,m,u,d){var y=m.texttemplate,I=m.textinfo;if(!y&&(!I||I==="none"))return"";var L=d.separators,z=u[0],F=_.data.data,N=z.hierarchy,B=T.isHierarchyRoot(_),R=T.getParent(N,_),U=T.getValue(_);if(!y){var j=I.split("+"),Z=function(te){return j.indexOf(te)!==-1},re=[],fe;if(Z("label")&&F.label&&re.push(F.label),F.hasOwnProperty("v")&&Z("value")&&re.push(T.formatValue(F.v,L)),!B){Z("current path")&&re.push(T.getPath(_.data));var le=0;Z("percent parent")&&le++,Z("percent entry")&&le++,Z("percent root")&&le++;var ce=le>1;if(le){var V,ee=function(te){fe=T.formatPercent(V,L),ce&&(fe+=" of "+te),re.push(fe)};Z("percent parent")&&!B&&(V=U/T.getValue(R),ee("parent")),Z("percent entry")&&(V=U/T.getValue(w),ee("entry")),Z("percent root")&&(V=U/T.getValue(N),ee("root"))}}return Z("text")&&(fe=E.castOption(m,F.i,"text"),E.isValidTextValue(fe)&&re.push(fe)),re.join("
")}var ne=E.castOption(m,F.i,"texttemplate");if(!ne)return"";var $={};F.label&&($.label=F.label),F.hasOwnProperty("v")&&($.value=F.v,$.valueLabel=T.formatValue(F.v,L)),$.currentPath=T.getPath(_.data),B||($.percentParent=U/T.getValue(R),$.percentParentLabel=T.formatPercent($.percentParent,L),$.parent=T.getPtLabel(R)),$.percentEntry=U/T.getValue(w),$.percentEntryLabel=T.formatPercent($.percentEntry,L),$.entry=T.getPtLabel(w),$.percentRoot=U/T.getValue(N),$.percentRootLabel=T.formatPercent($.percentRoot,L),$.root=T.getPtLabel(N),F.hasOwnProperty("color")&&($.color=F.color);var ue=E.castOption(m,F.i,"text");return(E.isValidTextValue(ue)||ue==="")&&($.text=ue),$.customdata=E.castOption(m,F.i,"customdata"),E.texttemplateString({data:[$,m._meta],fallback:m.texttemplatefallback,labels:$,locale:d._d3locale,template:ne})};function x(_){return _.rpx0===0&&E.isFullCircle([_.x0,_.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(_.halfangle)),_.ring/2))}function A(_){return M(_.rpx1,_.transform.textPosAngle)}function M(_,w){return[_*Math.sin(w),-_*Math.cos(w)]}}}),Ic=Ge({"src/traces/sunburst/index.js"(K,G){G.exports={moduleType:"trace",name:"sunburst",basePlotModule:hE(),categories:[],animatable:!0,attributes:c_(),layoutAttributes:g3(),supplyDefaults:FA(),supplyLayoutDefaults:dE(),calc:f_().calc,crossTraceCalc:f_().crossTraceCalc,plot:Yu().plot,style:bc().style,colorbar:Zf(),meta:{}}}}),Nm=Ge({"lib/sunburst.js"(K,G){G.exports=Ic()}}),xE=Ge({"src/traces/treemap/base_plot.js"(K){var G=ef();K.name="treemap",K.plot=function(h,b,S,E){G.plotBasePlot(K.name,h,b,S,E)},K.clean=function(h,b,S,E){G.cleanBasePlot(K.name,h,b,S,E)}}}),Zb=Ge({"src/traces/treemap/constants.js"(K,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),bE=Ge({"src/traces/treemap/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=zu(),e=Cc().attributes,t=Ly(),r=c_(),o=Zb(),n=Ji().extendFlat,i=md().pattern;G.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:n({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:r.marker.colors,pattern:i,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:r.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:n({},t.textfont,{}),editType:"calc"},text:t.text,textinfo:r.textinfo,texttemplate:b({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:S({editType:"plot"}),hovertext:t.hovertext,hoverinfo:r.hoverinfo,hovertemplate:h({},{keys:o.eventDataKeys}),hovertemplatefallback:S(),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:n({},t.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:t.sort,root:r.root,domain:e({name:"treemap",trace:!0,editType:"calc"})}}}),aC=Ge({"src/traces/treemap/layout_attributes.js"(K,G){G.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),uR=Ge({"src/traces/treemap/defaults.js"(K,G){var h=_n(),b=bE(),S=go(),E=Cc().defaults,e=Dv().handleText,t=wm().TEXTPAD,r=Py().handleMarkerDefaults,o=kc(),n=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,f,c,p){function v(d,y){return h.coerce(s,f,b,d,y)}var T=v("labels"),l=v("parents");if(!T||!T.length||!l||!l.length){f.visible=!1;return}var g=v("values");g&&g.length?v("branchvalues"):v("count"),v("level"),v("maxdepth");var x=v("tiling.packing");x==="squarify"&&v("tiling.squarifyratio"),v("tiling.flip"),v("tiling.pad");var A=v("text");v("texttemplate"),v("texttemplatefallback"),f.texttemplate||v("textinfo",h.isArrayOrTypedArray(A)?"text+label":"label"),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback");var M=v("pathbar.visible"),_="auto";e(s,f,p,v,_,{hasPathbar:M,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),v("textposition");var w=f.textposition.indexOf("bottom")!==-1;r(s,f,p,v);var m=f._hasColorscale=n(s,"marker","colors")||(s.marker||{}).coloraxis;m?i(s,f,p,v,{prefix:"marker.",cLetter:"c"}):v("marker.depthfade",!(f.marker.colors||[]).length);var u=f.textfont.size*2;v("marker.pad.t",w?u/4:u),v("marker.pad.l",u/4),v("marker.pad.r",u/4),v("marker.pad.b",w?u:u/4),v("marker.cornerradius"),f._hovered={marker:{line:{width:2,color:S.contrast(p.paper_bgcolor)}}},M&&(v("pathbar.thickness",f.pathbar.textfont.size+2*t),v("pathbar.side"),v("pathbar.edgeshape")),v("sort"),v("root.color"),E(f,p,v),f._length=null}}}),cR=Ge({"src/traces/treemap/layout_defaults.js"(K,G){var h=_n(),b=aC();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),iC=Ge({"src/traces/treemap/calc.js"(K){var G=f_();K.calc=function(h,b){return G.calc(h,b)},K.crossTraceCalc=function(h){return G._runCrossTraceCalc("treemap",h)}}}),oC=Ge({"src/traces/treemap/flip_tree.js"(K,G){G.exports=function h(b,S,E){var e;E.swapXY&&(e=b.x0,b.x0=b.y0,b.y0=e,e=b.x1,b.x1=b.y1,b.y1=e),E.flipX&&(e=b.x0,b.x0=S[0]-b.x1,b.x1=S[0]-e),E.flipY&&(e=b.y0,b.y0=S[1]-b.y1,b.y1=S[1]-e);var t=b.children;if(t)for(var r=0;r0)for(var u=0;u").join(" ")||"";var ce=b.ensureSingle(fe,"g","slicetext"),V=b.ensureSingle(ce,"text","",function(ne){ne.attr("data-notex",1)}),ee=b.ensureUniformFontSize(s,o.determineTextFont(N,re,z.font,{onPathbar:!0}));V.text(re._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(S.font,ee).call(E.convertToTspans,s),re.textBB=S.bBox(V.node()),re.transform=_(re,{fontSize:ee.size,onPathbar:!0}),re.transform.fontSize=ee.size,m?V.transition().attrTween("transform",function(ne){var $=y(ne,i,I,[l,g]);return function(ue){return w($(ue))}}):V.attr("transform",w(re))})}}}),hR=Ge({"src/traces/treemap/plot_one.js"(K,G){var h=ki(),b=(ao(),di(xi)).interpolate,S=js(),E=_n(),e=wm().TEXTPAD,t=su(),r=t.toMoveInsideBar,o=fc(),n=o.recordMinTextSize,i=Zb(),a=fR();function s(f){return S.isHierarchyRoot(f)?"":S.getPtId(f)}G.exports=function(c,p,v,T,l){var g=c._fullLayout,x=p[0],A=x.trace,M=A.type,_=M==="icicle",w=x.hierarchy,m=S.findEntryWithLevel(w,A.level),u=h.select(v),d=u.selectAll("g.pathbar"),y=u.selectAll("g.slice");if(!m){d.remove(),y.remove();return}var I=S.isHierarchyRoot(m),L=!g.uniformtext.mode&&S.hasTransition(T),z=S.getMaxDepth(A),F=function(Sr){return Sr.data.depth-m.data.depth-1?U+re:-(Z+re):0,le={x0:j,x1:j,y0:fe,y1:fe+Z},ce=function(Sr,Ur,Mt){var je=A.tiling.pad,Je=function(Ee){return Ee-je<=Ur.x0},ke=function(Ee){return Ee+je>=Ur.x1},xe=function(Ee){return Ee-je<=Ur.y0},ye=function(Ee){return Ee+je>=Ur.y1};return Sr.x0===Ur.x0&&Sr.x1===Ur.x1&&Sr.y0===Ur.y0&&Sr.y1===Ur.y1?{x0:Sr.x0,x1:Sr.x1,y0:Sr.y0,y1:Sr.y1}:{x0:Je(Sr.x0-je)?0:ke(Sr.x0-je)?Mt[0]:Sr.x0,x1:Je(Sr.x1+je)?0:ke(Sr.x1+je)?Mt[0]:Sr.x1,y0:xe(Sr.y0-je)?0:ye(Sr.y0-je)?Mt[1]:Sr.y0,y1:xe(Sr.y1+je)?0:ye(Sr.y1+je)?Mt[1]:Sr.y1}},V=null,ee={},ne={},$=null,ue=function(Sr,Ur){return Ur?ee[s(Sr)]:ne[s(Sr)]},te=function(Sr,Ur,Mt,je){if(Ur)return ee[s(w)]||le;var Je=ne[A.level]||Mt;return F(Sr)?ce(Sr,Je,je):{}};x.hasMultipleRoots&&I&&z++,A._maxDepth=z,A._backgroundColor=g.paper_bgcolor,A._entryDepth=m.data.depth,A._atRootLevel=I;var H=-R/2+N.l+N.w*(B.x[1]+B.x[0])/2,ae=-U/2+N.t+N.h*(1-(B.y[1]+B.y[0])/2),ie=function(Sr){return H+Sr},de=function(Sr){return ae+Sr},Se=de(0),Le=ie(0),Fe=function(Sr){return Le+Sr},ze=function(Sr){return Se+Sr};function Ye(Sr,Ur){return Sr+","+Ur}var st=Fe(0),ct=function(Sr){Sr.x=Math.max(st,Sr.x)},at=A.pathbar.edgeshape,et=function(Sr){var Ur=Fe(Math.max(Math.min(Sr.x0,Sr.x0),0)),Mt=Fe(Math.min(Math.max(Sr.x1,Sr.x1),j)),je=ze(Sr.y0),Je=ze(Sr.y1),ke=Z/2,xe={},ye={};xe.x=Ur,ye.x=Mt,xe.y=ye.y=(je+Je)/2;var Ee={x:Ur,y:je},Xe={x:Mt,y:je},Qe={x:Mt,y:Je},Lt={x:Ur,y:Je};return at===">"?(Ee.x-=ke,Xe.x-=ke,Qe.x-=ke,Lt.x-=ke):at==="/"?(Qe.x-=ke,Lt.x-=ke,xe.x-=ke/2,ye.x-=ke/2):at==="\\"?(Ee.x-=ke,Xe.x-=ke,xe.x-=ke/2,ye.x-=ke/2):at==="<"&&(xe.x-=ke,ye.x-=ke),ct(Ee),ct(Lt),ct(xe),ct(Xe),ct(Qe),ct(ye),"M"+Ye(Ee.x,Ee.y)+"L"+Ye(Xe.x,Xe.y)+"L"+Ye(ye.x,ye.y)+"L"+Ye(Qe.x,Qe.y)+"L"+Ye(Lt.x,Lt.y)+"L"+Ye(xe.x,xe.y)+"Z"},Pe=A[_?"tiling":"marker"].pad,Ae=function(Sr){return A.textposition.indexOf(Sr)!==-1},pe=Ae("top"),Ne=Ae("left"),ut=Ae("right"),dt=Ae("bottom"),nt=function(Sr){var Ur=ie(Sr.x0),Mt=ie(Sr.x1),je=de(Sr.y0),Je=de(Sr.y1),ke=Mt-Ur,xe=Je-je;if(!ke||!xe)return"";var ye=A.marker.cornerradius||0,Ee=Math.min(ye,ke/2,xe/2);Ee&&Sr.data&&Sr.data.data&&Sr.data.data.label&&(pe&&(Ee=Math.min(Ee,Pe.t)),Ne&&(Ee=Math.min(Ee,Pe.l)),ut&&(Ee=Math.min(Ee,Pe.r)),dt&&(Ee=Math.min(Ee,Pe.b)));var Xe=function(Qe,Lt){return Ee?"a"+Ye(Ee,Ee)+" 0 0 1 "+Ye(Qe,Lt):""};return"M"+Ye(Ur,je+Ee)+Xe(Ee,-Ee)+"L"+Ye(Mt-Ee,je)+Xe(Ee,Ee)+"L"+Ye(Mt,Je-Ee)+Xe(-Ee,Ee)+"L"+Ye(Ur+Ee,Je)+Xe(-Ee,-Ee)+"Z"},Ft=function(Sr,Ur){var Mt=Sr.x0,je=Sr.x1,Je=Sr.y0,ke=Sr.y1,xe=Sr.textBB,ye=pe||Ur.isHeader&&!dt,Ee=ye?"start":dt?"end":"middle",Xe=Ae("right"),Qe=Ae("left")||Ur.onPathbar,Lt=Qe?-1:Xe?1:0;if(Ur.isHeader){if(Mt+=(_?Pe:Pe.l)-e,je-=(_?Pe:Pe.r)-e,Mt>=je){var Ct=(Mt+je)/2;Mt=Ct,je=Ct}var Ot;dt?(Ot=ke-(_?Pe:Pe.b),Je-1,flipY:B.tiling.flip.indexOf("y")>-1,pad:{inner:B.tiling.pad,top:B.marker.pad.t,left:B.marker.pad.l,right:B.marker.pad.r,bottom:B.marker.pad.b}}),fe=re.descendants(),le=1/0,ce=-1/0;fe.forEach(function(ue){var te=ue.depth;te>=B._maxDepth?(ue.x0=ue.x1=(ue.x0+ue.x1)/2,ue.y0=ue.y1=(ue.y0+ue.y1)/2):(le=Math.min(le,te),ce=Math.max(ce,te))}),v=v.data(fe,o.getPtId),B._maxVisibleLayers=isFinite(ce)?ce-le+1:0,v.enter().append("g").classed("slice",!0),u(v,a,L,[l,g],M),v.order();var V=null;if(m&&I){var ee=o.getPtId(I);v.each(function(ue){V===null&&o.getPtId(ue)===ee&&(V={x0:ue.x0,x1:ue.x1,y0:ue.y0,y1:ue.y1})})}var ne=function(){return V||{x0:0,x1:l,y0:0,y1:g}},$=v;return m&&($=$.transition().each("end",function(){var ue=h.select(this);o.setSliceCursor(ue,f,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),$.each(function(ue){var te=o.isHeader(ue,B);ue._x0=x(ue.x0),ue._x1=x(ue.x1),ue._y0=A(ue.y0),ue._y1=A(ue.y1),ue._hoverX=x(ue.x1-B.marker.pad.r),ue._hoverY=A(j?ue.y1-B.marker.pad.b/2:ue.y0+B.marker.pad.t/2);var H=h.select(this),ae=b.ensureSingle(H,"path","surface",function(ze){ze.style("pointer-events",z?"none":"all")});m?ae.transition().attrTween("d",function(ze){var Ye=d(ze,a,ne(),[l,g]);return function(st){return M(Ye(st))}}):ae.attr("d",M),H.call(n,p,f,c,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,f,{isTransitioning:f._transitioning}),ae.call(t,ue,B,f,{hovered:!1}),ue.x0===ue.x1||ue.y0===ue.y1?ue._text="":te?ue._text=Z?"":o.getPtLabel(ue)||"":ue._text=i(ue,p,B,c,F)||"";var ie=b.ensureSingle(H,"g","slicetext"),de=b.ensureSingle(ie,"text","",function(ze){ze.attr("data-notex",1)}),Se=b.ensureUniformFontSize(f,o.determineTextFont(B,ue,F.font)),Le=ue._text||" ",Fe=te&&Le.indexOf("
")===-1;de.text(Le).classed("slicetext",!0).attr("text-anchor",U?"end":R||Fe?"start":"middle").call(S.font,Se).call(E.convertToTspans,f),ue.textBB=S.bBox(de.node()),ue.transform=_(ue,{fontSize:Se.size,isHeader:te}),ue.transform.fontSize=Se.size,m?de.transition().attrTween("transform",function(ze){var Ye=y(ze,a,ne(),[l,g]);return function(st){return w(Ye(st))}}):de.attr("transform",w(ue))}),V}}}),vR=Ge({"src/traces/treemap/plot.js"(K,G){var h=lC(),b=dR();G.exports=function(E,e,t,r){return h(E,e,t,r,{type:"treemap",drawDescendants:b})}}}),pR=Ge({"src/traces/treemap/index.js"(K,G){G.exports={moduleType:"trace",name:"treemap",basePlotModule:xE(),categories:[],animatable:!0,attributes:bE(),layoutAttributes:aC(),supplyDefaults:uR(),supplyLayoutDefaults:cR(),calc:iC().calc,crossTraceCalc:iC().crossTraceCalc,plot:vR(),style:wE().style,colorbar:Zf(),meta:{}}}}),mR=Ge({"lib/treemap.js"(K,G){G.exports=pR()}}),gR=Ge({"src/traces/icicle/base_plot.js"(K){var G=ef();K.name="icicle",K.plot=function(h,b,S,E){G.plotBasePlot(K.name,h,b,S,E)},K.clean=function(h,b,S,E){G.cleanBasePlot(K.name,h,b,S,E)}}}),uC=Ge({"src/traces/icicle/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=zu(),e=Cc().attributes,t=Ly(),r=c_(),o=bE(),n=Zb(),i=Ji().extendFlat,a=md().pattern;G.exports={labels:r.labels,parents:r.parents,values:r.values,branchvalues:r.branchvalues,count:r.count,level:r.level,maxdepth:r.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:o.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:i({colors:r.marker.colors,line:r.marker.line,pattern:a,editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),leaf:r.leaf,pathbar:o.pathbar,text:t.text,textinfo:r.textinfo,texttemplate:b({editType:"plot"},{keys:n.eventDataKeys.concat(["label","value"])}),texttemplatefallback:S({editType:"plot"}),hovertext:t.hovertext,hoverinfo:r.hoverinfo,hovertemplate:h({},{keys:n.eventDataKeys}),hovertemplatefallback:S(),textfont:t.textfont,insidetextfont:t.insidetextfont,outsidetextfont:o.outsidetextfont,textposition:o.textposition,sort:t.sort,root:r.root,domain:e({name:"icicle",trace:!0,editType:"calc"})}}}),cC=Ge({"src/traces/icicle/layout_attributes.js"(K,G){G.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),yR=Ge({"src/traces/icicle/defaults.js"(K,G){var h=_n(),b=uC(),S=go(),E=Cc().defaults,e=Dv().handleText,t=wm().TEXTPAD,r=Py().handleMarkerDefaults,o=kc(),n=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,f,c,p){function v(w,m){return h.coerce(s,f,b,w,m)}var T=v("labels"),l=v("parents");if(!T||!T.length||!l||!l.length){f.visible=!1;return}var g=v("values");g&&g.length?v("branchvalues"):v("count"),v("level"),v("maxdepth"),v("tiling.orientation"),v("tiling.flip"),v("tiling.pad");var x=v("text");v("texttemplate"),v("texttemplatefallback"),f.texttemplate||v("textinfo",h.isArrayOrTypedArray(x)?"text+label":"label"),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback");var A=v("pathbar.visible"),M="auto";e(s,f,p,v,M,{hasPathbar:A,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),v("textposition"),r(s,f,p,v);var _=f._hasColorscale=n(s,"marker","colors")||(s.marker||{}).coloraxis;_&&i(s,f,p,v,{prefix:"marker.",cLetter:"c"}),v("leaf.opacity",_?1:.7),f._hovered={marker:{line:{width:2,color:S.contrast(p.paper_bgcolor)}}},A&&(v("pathbar.thickness",f.pathbar.textfont.size+2*t),v("pathbar.side"),v("pathbar.edgeshape")),v("sort"),v("root.color"),E(f,p,v),f._length=null}}}),_R=Ge({"src/traces/icicle/layout_defaults.js"(K,G){var h=_n(),b=cC();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),fC=Ge({"src/traces/icicle/calc.js"(K){var G=f_();K.calc=function(h,b){return G.calc(h,b)},K.crossTraceCalc=function(h){return G._runCrossTraceCalc("icicle",h)}}}),xR=Ge({"src/traces/icicle/partition.js"(K,G){var h=Iy(),b=oC();G.exports=function(E,e,t){var r=t.flipX,o=t.flipY,n=t.orientation==="h",i=t.maxDepth,a=e[0],s=e[1];i&&(a=(E.height+1)*e[0]/Math.min(E.height+1,i),s=(E.height+1)*e[1]/Math.min(E.height+1,i));var f=h.partition().padding(t.pad.inner).size(n?[e[1],a]:[e[0],s])(E);return(n||r||o)&&b(f,e,{swapXY:n,flipX:r,flipY:o}),f}}}),hC=Ge({"src/traces/icicle/style.js"(K,G){var h=ki(),b=go(),S=_n(),E=fc().resizeText,e=bl();function t(o){var n=o._fullLayout._iciclelayer.selectAll(".trace");E(o,n,"icicle"),n.each(function(i){var a=h.select(this),s=i[0],f=s.trace;a.style("opacity",f.opacity),a.selectAll("path.surface").each(function(c){h.select(this).call(r,c,f,o)})})}function r(o,n,i,a){var s=n.data.data,f=!n.children,c=s.i,p=S.castOption(i,c,"marker.line.color")||b.defaultLine,v=S.castOption(i,c,"marker.line.width")||0;o.call(e,n,i,a).style("stroke-width",v).call(b.stroke,p).style("opacity",f?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),bR=Ge({"src/traces/icicle/draw_descendants.js"(K,G){var h=ki(),b=_n(),S=As(),E=nc(),e=xR(),t=hC().styleOne,r=Zb(),o=js(),n=xu(),i=Yu().formatSliceLabel,a=!1;G.exports=function(f,c,p,v,T){var l=T.width,g=T.height,x=T.viewX,A=T.viewY,M=T.pathSlice,_=T.toMoveInsideSlice,w=T.strTransform,m=T.hasTransition,u=T.handleSlicesExit,d=T.makeUpdateSliceInterpolator,y=T.makeUpdateTextInterpolator,I=T.prevEntry,L={},z=f._context.staticPlot,F=f._fullLayout,N=c[0],B=N.trace,R=B.textposition.indexOf("left")!==-1,U=B.textposition.indexOf("right")!==-1,j=B.textposition.indexOf("bottom")!==-1,Z=e(p,[l,g],{flipX:B.tiling.flip.indexOf("x")>-1,flipY:B.tiling.flip.indexOf("y")>-1,orientation:B.tiling.orientation,pad:{inner:B.tiling.pad},maxDepth:B._maxDepth}),re=Z.descendants(),fe=1/0,le=-1/0;re.forEach(function($){var ue=$.depth;ue>=B._maxDepth?($.x0=$.x1=($.x0+$.x1)/2,$.y0=$.y1=($.y0+$.y1)/2):(fe=Math.min(fe,ue),le=Math.max(le,ue))}),v=v.data(re,o.getPtId),B._maxVisibleLayers=isFinite(le)?le-fe+1:0,v.enter().append("g").classed("slice",!0),u(v,a,L,[l,g],M),v.order();var ce=null;if(m&&I){var V=o.getPtId(I);v.each(function($){ce===null&&o.getPtId($)===V&&(ce={x0:$.x0,x1:$.x1,y0:$.y0,y1:$.y1})})}var ee=function(){return ce||{x0:0,x1:l,y0:0,y1:g}},ne=v;return m&&(ne=ne.transition().each("end",function(){var $=h.select(this);o.setSliceCursor($,f,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ne.each(function($){$._x0=x($.x0),$._x1=x($.x1),$._y0=A($.y0),$._y1=A($.y1),$._hoverX=x($.x1-B.tiling.pad),$._hoverY=A(j?$.y1-B.tiling.pad/2:$.y0+B.tiling.pad/2);var ue=h.select(this),te=b.ensureSingle(ue,"path","surface",function(de){de.style("pointer-events",z?"none":"all")});m?te.transition().attrTween("d",function(de){var Se=d(de,a,ee(),[l,g],{orientation:B.tiling.orientation,flipX:B.tiling.flip.indexOf("x")>-1,flipY:B.tiling.flip.indexOf("y")>-1});return function(Le){return M(Se(Le))}}):te.attr("d",M),ue.call(n,p,f,c,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,f,{isTransitioning:f._transitioning}),te.call(t,$,B,f,{hovered:!1}),$.x0===$.x1||$.y0===$.y1?$._text="":$._text=i($,p,B,c,F)||"";var H=b.ensureSingle(ue,"g","slicetext"),ae=b.ensureSingle(H,"text","",function(de){de.attr("data-notex",1)}),ie=b.ensureUniformFontSize(f,o.determineTextFont(B,$,F.font));ae.text($._text||" ").classed("slicetext",!0).attr("text-anchor",U?"end":R?"start":"middle").call(S.font,ie).call(E.convertToTspans,f),$.textBB=S.bBox(ae.node()),$.transform=_($,{fontSize:ie.size}),$.transform.fontSize=ie.size,m?ae.transition().attrTween("transform",function(de){var Se=y(de,a,ee(),[l,g]);return function(Le){return w(Se(Le))}}):ae.attr("transform",w($))}),ce}}}),wR=Ge({"src/traces/icicle/plot.js"(K,G){var h=lC(),b=bR();G.exports=function(E,e,t,r){return h(E,e,t,r,{type:"icicle",drawDescendants:b})}}}),TR=Ge({"src/traces/icicle/index.js"(K,G){G.exports={moduleType:"trace",name:"icicle",basePlotModule:gR(),categories:[],animatable:!0,attributes:uC(),layoutAttributes:cC(),supplyDefaults:yR(),supplyLayoutDefaults:_R(),calc:fC().calc,crossTraceCalc:fC().crossTraceCalc,plot:wR(),style:hC().style,colorbar:Zf(),meta:{}}}}),AR=Ge({"lib/icicle.js"(K,G){G.exports=TR()}}),SR=Ge({"src/traces/funnelarea/base_plot.js"(K){var G=ef();K.name="funnelarea",K.plot=function(h,b,S,E){G.plotBasePlot(K.name,h,b,S,E)},K.clean=function(h,b,S,E){G.cleanBasePlot(K.name,h,b,S,E)}}}),dC=Ge({"src/traces/funnelarea/attributes.js"(K,G){var h=Ly(),b=Jl(),S=Cc().attributes,{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=Ji().extendFlat;G.exports={labels:h.labels,label0:h.label0,dlabel:h.dlabel,values:h.values,marker:{colors:h.marker.colors,line:{color:r({},h.marker.line.color,{dflt:null}),width:r({},h.marker.line.width,{dflt:1}),editType:"calc"},pattern:h.marker.pattern,editType:"calc"},text:h.text,hovertext:h.hovertext,scalegroup:r({},h.scalegroup,{}),textinfo:r({},h.textinfo,{flags:["label","text","value","percent"]}),texttemplate:e({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:t({editType:"plot"}),hoverinfo:r({},b.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:E({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:t(),textposition:r({},h.textposition,{values:["inside","none"],dflt:"inside"}),textfont:h.textfont,insidetextfont:h.insidetextfont,title:{text:h.title.text,font:h.title.font,position:r({},h.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:S({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),vC=Ge({"src/traces/funnelarea/layout_attributes.js"(K,G){var h=d3().hiddenlabels;G.exports={hiddenlabels:h,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),MR=Ge({"src/traces/funnelarea/defaults.js"(K,G){var h=_n(),b=dC(),S=Cc().defaults,E=Dv().handleText,e=Py().handleLabelsAndValues,t=Py().handleMarkerDefaults;G.exports=function(o,n,i,a){function s(M,_){return h.coerce(o,n,b,M,_)}var f=s("labels"),c=s("values"),p=e(f,c),v=p.len;if(n._hasLabels=p.hasLabels,n._hasValues=p.hasValues,!n._hasLabels&&n._hasValues&&(s("label0"),s("dlabel")),!v){n.visible=!1;return}n._length=v,t(o,n,a,s),s("scalegroup");var T=s("text"),l=s("texttemplate");s("texttemplatefallback");var g;if(l||(g=s("textinfo",Array.isArray(T)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),l||g&&g!=="none"){var x=s("textposition");E(o,n,a,s,x,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else g==="none"&&s("textposition","none");S(n,a,s);var A=s("title.text");A&&(s("title.position"),h.coerceFont(s,"title.font",a.font)),s("aspectratio"),s("baseratio")}}}),ER=Ge({"src/traces/funnelarea/layout_defaults.js"(K,G){var h=_n(),b=vC();G.exports=function(E,e){function t(r,o){return h.coerce(E,e,b,r,o)}t("hiddenlabels"),t("funnelareacolorway",e.colorway),t("extendfunnelareacolors")}}}),pC=Ge({"src/traces/funnelarea/calc.js"(K,G){var h=y0();function b(E,e){return h.calc(E,e)}function S(E){h.crossTraceCalc(E,{type:"funnelarea"})}G.exports={calc:b,crossTraceCalc:S}}}),kR=Ge({"src/traces/funnelarea/plot.js"(K,G){var h=ki(),b=As(),S=_n(),E=S.strScale,e=S.strTranslate,t=nc(),r=su(),o=r.toMoveInsideBar,n=fc(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=ng(),f=Ry(),c=f.attachFxHandlers,p=f.determineInsideTextFont,v=f.layoutAreas,T=f.prerenderTitles,l=f.positionTitleOutside,g=f.formatSliceLabel;G.exports=function(w,m){var u=w._context.staticPlot,d=w._fullLayout;a("funnelarea",d),T(m,w),v(m,d._size),S.makeTraceGroups(d._funnelarealayer,m,"trace").each(function(y){var I=h.select(this),L=y[0],z=L.trace;M(y),I.each(function(){var F=h.select(this).selectAll("g.slice").data(y);F.enter().append("g").classed("slice",!0),F.exit().remove(),F.each(function(B,R){if(B.hidden){h.select(this).selectAll("path,g").remove();return}B.pointNumber=B.i,B.curveNumber=z.index;var U=L.cx,j=L.cy,Z=h.select(this),re=Z.selectAll("path.surface").data([B]);re.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),Z.call(c,w,y);var fe="M"+(U+B.TR[0])+","+(j+B.TR[1])+x(B.TR,B.BR)+x(B.BR,B.BL)+x(B.BL,B.TL)+"Z";re.attr("d",fe),g(w,B,L);var le=s.castOption(z.textposition,B.pts),ce=Z.selectAll("g.slicetext").data(B.text&&le!=="none"?[0]:[]);ce.enter().append("g").classed("slicetext",!0),ce.exit().remove(),ce.each(function(){var V=S.ensureSingle(h.select(this),"text","",function(ie){ie.attr("data-notex",1)}),ee=S.ensureUniformFontSize(w,p(z,B,d.font));V.text(B.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(b.font,ee).call(t.convertToTspans,w);var ne=b.bBox(V.node()),$,ue,te,H=Math.min(B.BL[1],B.BR[1])+j,ae=Math.max(B.TL[1],B.TR[1])+j;ue=Math.max(B.TL[0],B.BL[0])+U,te=Math.min(B.TR[0],B.BR[0])+U,$=o(ue,te,H,ae,ne,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),$.fontSize=ee.size,i(z.type,$,d),y[R].transform=$,S.setTransormAndDisplay(V,$)})});var N=h.select(this).selectAll("g.titletext").data(z.title.text?[0]:[]);N.enter().append("g").classed("titletext",!0),N.exit().remove(),N.each(function(){var B=S.ensureSingle(h.select(this),"text","",function(j){j.attr("data-notex",1)}),R=z.title.text;z._meta&&(R=S.templateString(R,z._meta)),B.text(R).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(b.font,z.title.font).call(t.convertToTspans,w);var U=l(L,d._size);B.attr("transform",e(U.x,U.y)+E(Math.min(1,U.scale))+e(U.tx,U.ty))})})})};function x(_,w){var m=w[0]-_[0],u=w[1]-_[1];return"l"+m+","+u}function A(_,w){return[.5*(_[0]+w[0]),.5*(_[1]+w[1])]}function M(_){if(!_.length)return;var w=_[0],m=w.trace,u=m.aspectratio,d=m.baseratio;d>.999&&(d=.999);var y=Math.pow(d,2),I=w.vTotal,L=I*y/(1-y),z=I,F=L/I;function N(){var de=Math.sqrt(F);return{x:de,y:-de}}function B(){var de=N();return[de.x,de.y]}var R,U=[];U.push(B());var j,Z;for(j=_.length-1;j>-1;j--)if(Z=_[j],!Z.hidden){var re=Z.v/z;F+=re,U.push(B())}var fe=1/0,le=-1/0;for(j=0;j-1;j--)if(Z=_[j],!Z.hidden){H+=1;var ae=U[H][0],ie=U[H][1];Z.TL=[-ae,ie],Z.TR=[ae,ie],Z.BL=ue,Z.BR=te,Z.pxmid=A(Z.TR,Z.BR),ue=Z.TL,te=Z.TR}}}}),CR=Ge({"src/traces/funnelarea/style.js"(K,G){var h=ki(),b=M1(),S=fc().resizeText;G.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");S(e,t,"funnelarea"),t.each(function(r){var o=r[0],n=o.trace,i=h.select(this);i.style({opacity:n.opacity}),i.selectAll("path.surface").each(function(a){h.select(this).call(b,a,n,e)})})}}}),LR=Ge({"src/traces/funnelarea/index.js"(K,G){G.exports={moduleType:"trace",name:"funnelarea",basePlotModule:SR(),categories:["pie-like","funnelarea","showLegend"],attributes:dC(),layoutAttributes:vC(),supplyDefaults:MR(),supplyLayoutDefaults:ER(),calc:pC().calc,crossTraceCalc:pC().crossTraceCalc,plot:kR(),style:CR(),styleOne:M1(),meta:{}}}}),PR=Ge({"lib/funnelarea.js"(K,G){G.exports=LR()}}),dv=Ge({"stackgl_modules/index.js"(K,G){(function(){var h={24:(function(e){var t={left:0,top:0};e.exports=r;function r(n,i,a){i=i||n.currentTarget||n.srcElement,Array.isArray(a)||(a=[0,0]);var s=n.clientX||0,f=n.clientY||0,c=o(i);return a[0]=s-c.left,a[1]=f-c.top,a}function o(n){return n===window||n===document||n===document.body?t:n.getBoundingClientRect()}}),109:(function(e){e.exports=t;function t(r,o,n,i){var a=n[0],s=n[2],f=o[0]-a,c=o[2]-s,p=Math.sin(i),v=Math.cos(i);return r[0]=a+c*p+f*v,r[1]=o[1],r[2]=s+c*v-f*p,r}}),160:(function(e){e.exports=t;function t(r,o,n){return r[0]=Math.max(o[0],n[0]),r[1]=Math.max(o[1],n[1]),r[2]=Math.max(o[2],n[2]),r[3]=Math.max(o[3],n[3]),r}}),216:(function(e){e.exports=t;function t(r,o){for(var n={},i=0;i1){p[0]in f||(f[p[0]]=[]),f=f[p[0]];for(var v=1;v=0;--R){var ee=N[R];U=ee[0];var ne=z[U],$=ne[0],ue=ne[1],te=L[$],H=L[ue];if((te[0]-H[0]||te[1]-H[1])<0){var ae=$;$=ue,ue=ae}ne[0]=$;var ie=ne[1]=ee[1],de;for(B&&(de=ne[2]);R>0&&N[R-1][0]===U;){var ee=N[--R],Se=ee[1];B?z.push([ie,Se,de]):z.push([ie,Se]),ie=Se}B?z.push([ie,ue,de]):z.push([ie,ue])}return j}function _(L,z,F){for(var N=z.length,B=new o(N),R=[],U=0;Uz[2]?1:0)}function u(L,z,F){if(L.length!==0){if(z)for(var N=0;N0||U.length>0}function I(L,z,F){var N;if(F){N=z;for(var B=new Array(z.length),R=0;R1e-6?(g=Math.acos(x),A=Math.sin(g),M=Math.sin((1-i)*g)/A,_=Math.sin(i*g)/A):(M=1-i,_=i),r[0]=M*a+_*p,r[1]=M*s+_*d,r[2]=M*f+_*T,r[3]=M*c+_*l,r}}),799:(function(e,t,r){var o=r(3236),n=r(9405),i=o([`precision mediump float; +}`]);t.meshShader={vertex:n,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}}),620:(function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]}),665:(function(e,t,r){var o=r(3202);e.exports=s;var n=96;function i(f,c){var p=o(getComputedStyle(f).getPropertyValue(c));return p[0]*s(p[1],f)}function a(f,c){var p=document.createElement("div");p.style["font-size"]="128"+f,c.appendChild(p);var v=i(p,"font-size")/128;return c.removeChild(p),v}function s(f,c){switch(c=c||document.body,f=(f||"px").trim().toLowerCase(),(c===window||c===document)&&(c=document.body),f){case"%":return c.clientHeight/100;case"ch":case"ex":return a(f,c);case"em":return i(c,"font-size");case"rem":return i(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return n;case"cm":return n/2.54;case"mm":return n/25.4;case"pt":return n/72;case"pc":return n/6}return 1}}),727:(function(e,t,r){var o=r(2962),n=6;function i(A){var M=A===2?f:A===3?c:A===4?p:A===5?v:T;return A<6?M(o[A]):M(o)}function a(){return[[0]]}function s(A,M){return[[M[0]],[A[0][0]]]}function f(A){return function(_,w){return[A([[+w[0],+_[0][1]],[+w[1],+_[1][1]]]),A([[+_[0][0],+w[0]],[+_[1][0],+w[1]]]),A(_)]}}function c(A){return function(_,w){return[A([[+w[0],+_[0][1],+_[0][2]],[+w[1],+_[1][1],+_[1][2]],[+w[2],+_[2][1],+_[2][2]]]),A([[+_[0][0],+w[0],+_[0][2]],[+_[1][0],+w[1],+_[1][2]],[+_[2][0],+w[2],+_[2][2]]]),A([[+_[0][0],+_[0][1],+w[0]],[+_[1][0],+_[1][1],+w[1]],[+_[2][0],+_[2][1],+w[2]]]),A(_)]}}function p(A){return function(_,w){return[A([[+w[0],+_[0][1],+_[0][2],+_[0][3]],[+w[1],+_[1][1],+_[1][2],+_[1][3]],[+w[2],+_[2][1],+_[2][2],+_[2][3]],[+w[3],+_[3][1],+_[3][2],+_[3][3]]]),A([[+_[0][0],+w[0],+_[0][2],+_[0][3]],[+_[1][0],+w[1],+_[1][2],+_[1][3]],[+_[2][0],+w[2],+_[2][2],+_[2][3]],[+_[3][0],+w[3],+_[3][2],+_[3][3]]]),A([[+_[0][0],+_[0][1],+w[0],+_[0][3]],[+_[1][0],+_[1][1],+w[1],+_[1][3]],[+_[2][0],+_[2][1],+w[2],+_[2][3]],[+_[3][0],+_[3][1],+w[3],+_[3][3]]]),A([[+_[0][0],+_[0][1],+_[0][2],+w[0]],[+_[1][0],+_[1][1],+_[1][2],+w[1]],[+_[2][0],+_[2][1],+_[2][2],+w[2]],[+_[3][0],+_[3][1],+_[3][2],+w[3]]]),A(_)]}}function v(A){return function(_,w){return[A([[+w[0],+_[0][1],+_[0][2],+_[0][3],+_[0][4]],[+w[1],+_[1][1],+_[1][2],+_[1][3],+_[1][4]],[+w[2],+_[2][1],+_[2][2],+_[2][3],+_[2][4]],[+w[3],+_[3][1],+_[3][2],+_[3][3],+_[3][4]],[+w[4],+_[4][1],+_[4][2],+_[4][3],+_[4][4]]]),A([[+_[0][0],+w[0],+_[0][2],+_[0][3],+_[0][4]],[+_[1][0],+w[1],+_[1][2],+_[1][3],+_[1][4]],[+_[2][0],+w[2],+_[2][2],+_[2][3],+_[2][4]],[+_[3][0],+w[3],+_[3][2],+_[3][3],+_[3][4]],[+_[4][0],+w[4],+_[4][2],+_[4][3],+_[4][4]]]),A([[+_[0][0],+_[0][1],+w[0],+_[0][3],+_[0][4]],[+_[1][0],+_[1][1],+w[1],+_[1][3],+_[1][4]],[+_[2][0],+_[2][1],+w[2],+_[2][3],+_[2][4]],[+_[3][0],+_[3][1],+w[3],+_[3][3],+_[3][4]],[+_[4][0],+_[4][1],+w[4],+_[4][3],+_[4][4]]]),A([[+_[0][0],+_[0][1],+_[0][2],+w[0],+_[0][4]],[+_[1][0],+_[1][1],+_[1][2],+w[1],+_[1][4]],[+_[2][0],+_[2][1],+_[2][2],+w[2],+_[2][4]],[+_[3][0],+_[3][1],+_[3][2],+w[3],+_[3][4]],[+_[4][0],+_[4][1],+_[4][2],+w[4],+_[4][4]]]),A([[+_[0][0],+_[0][1],+_[0][2],+_[0][3],+w[0]],[+_[1][0],+_[1][1],+_[1][2],+_[1][3],+w[1]],[+_[2][0],+_[2][1],+_[2][2],+_[2][3],+w[2]],[+_[3][0],+_[3][1],+_[3][2],+_[3][3],+w[3]],[+_[4][0],+_[4][1],+_[4][2],+_[4][3],+w[4]]]),A(_)]}}function T(A){return function(_,w){return[A([[+w[0],+_[0][1],+_[0][2],+_[0][3],+_[0][4],+_[0][5]],[+w[1],+_[1][1],+_[1][2],+_[1][3],+_[1][4],+_[1][5]],[+w[2],+_[2][1],+_[2][2],+_[2][3],+_[2][4],+_[2][5]],[+w[3],+_[3][1],+_[3][2],+_[3][3],+_[3][4],+_[3][5]],[+w[4],+_[4][1],+_[4][2],+_[4][3],+_[4][4],+_[4][5]],[+w[5],+_[5][1],+_[5][2],+_[5][3],+_[5][4],+_[5][5]]]),A([[+_[0][0],+w[0],+_[0][2],+_[0][3],+_[0][4],+_[0][5]],[+_[1][0],+w[1],+_[1][2],+_[1][3],+_[1][4],+_[1][5]],[+_[2][0],+w[2],+_[2][2],+_[2][3],+_[2][4],+_[2][5]],[+_[3][0],+w[3],+_[3][2],+_[3][3],+_[3][4],+_[3][5]],[+_[4][0],+w[4],+_[4][2],+_[4][3],+_[4][4],+_[4][5]],[+_[5][0],+w[5],+_[5][2],+_[5][3],+_[5][4],+_[5][5]]]),A([[+_[0][0],+_[0][1],+w[0],+_[0][3],+_[0][4],+_[0][5]],[+_[1][0],+_[1][1],+w[1],+_[1][3],+_[1][4],+_[1][5]],[+_[2][0],+_[2][1],+w[2],+_[2][3],+_[2][4],+_[2][5]],[+_[3][0],+_[3][1],+w[3],+_[3][3],+_[3][4],+_[3][5]],[+_[4][0],+_[4][1],+w[4],+_[4][3],+_[4][4],+_[4][5]],[+_[5][0],+_[5][1],+w[5],+_[5][3],+_[5][4],+_[5][5]]]),A([[+_[0][0],+_[0][1],+_[0][2],+w[0],+_[0][4],+_[0][5]],[+_[1][0],+_[1][1],+_[1][2],+w[1],+_[1][4],+_[1][5]],[+_[2][0],+_[2][1],+_[2][2],+w[2],+_[2][4],+_[2][5]],[+_[3][0],+_[3][1],+_[3][2],+w[3],+_[3][4],+_[3][5]],[+_[4][0],+_[4][1],+_[4][2],+w[4],+_[4][4],+_[4][5]],[+_[5][0],+_[5][1],+_[5][2],+w[5],+_[5][4],+_[5][5]]]),A([[+_[0][0],+_[0][1],+_[0][2],+_[0][3],+w[0],+_[0][5]],[+_[1][0],+_[1][1],+_[1][2],+_[1][3],+w[1],+_[1][5]],[+_[2][0],+_[2][1],+_[2][2],+_[2][3],+w[2],+_[2][5]],[+_[3][0],+_[3][1],+_[3][2],+_[3][3],+w[3],+_[3][5]],[+_[4][0],+_[4][1],+_[4][2],+_[4][3],+w[4],+_[4][5]],[+_[5][0],+_[5][1],+_[5][2],+_[5][3],+w[5],+_[5][5]]]),A([[+_[0][0],+_[0][1],+_[0][2],+_[0][3],+_[0][4],+w[0]],[+_[1][0],+_[1][1],+_[1][2],+_[1][3],+_[1][4],+w[1]],[+_[2][0],+_[2][1],+_[2][2],+_[2][3],+_[2][4],+w[2]],[+_[3][0],+_[3][1],+_[3][2],+_[3][3],+_[3][4],+w[3]],[+_[4][0],+_[4][1],+_[4][2],+_[4][3],+_[4][4],+w[4]],[+_[5][0],+_[5][1],+_[5][2],+_[5][3],+_[5][4],+w[5]]]),A(_)]}}var l=[a,s];function g(A,M,_,w,m,u,d,y){return function(L,z){switch(L.length){case 0:return A(L,z);case 1:return M(L,z);case 2:return _(L,z);case 3:return w(L,z);case 4:return m(L,z);case 5:return u(L,z)}var F=d[L.length];return F||(F=d[L.length]=y(L.length)),F(L,z)}}function x(){for(;l.length1e-6?(g=Math.acos(x),A=Math.sin(g),M=Math.sin((1-i)*g)/A,_=Math.sin(i*g)/A):(M=1-i,_=i),r[0]=M*a+_*p,r[1]=M*s+_*v,r[2]=M*f+_*T,r[3]=M*c+_*l,r}}),799:(function(e,t,r){var o=r(3236),n=r(9405),i=o([`precision mediump float; #define GLSLIFY 1 attribute vec2 position; varying vec2 uv; @@ -717,7 +717,7 @@ void main() { gl_Position = projection * (view * (model * vec4(position, 1.0))); f_id = id; f_position = position; -}`]),d=o([`precision highp float; +}`]),v=o([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { @@ -810,7 +810,7 @@ uniform vec3 contourColor; void main() { gl_FragColor = vec4(contourColor, 1.0); } -`]);t.meshShader={vertex:n,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:a,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:f,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:T,fragment:d,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:l,fragment:g,attributes:[{name:"position",type:"vec3"}]}}),855:(function(e,t,r){e.exports={init:x,sweepBipartite:_,sweepComplete:w,scanBipartite:m,scanComplete:u};var o=r(1888),n=r(8828),i=r(4192),a=1<<28,s=1024,f=o.mallocInt32(s),c=o.mallocInt32(s),p=o.mallocInt32(s),d=o.mallocInt32(s),T=o.mallocInt32(s),l=o.mallocInt32(s),g=o.mallocDouble(s*8);function x(v){var y=n.nextPow2(v);f.length>>1;i(g,ne);for(var K=0,ue=0,le=0;le=a)te=te-a|0,A(p,d,ue--,te);else if(te>=0)A(f,c,K--,te);else if(te<=-a){te=-te-a|0;for(var H=0;H>>1;i(g,ne);for(var K=0,ue=0,te=0,le=0;le>1===g[2*le+3]>>1&&(ae=2,le+=1),H<0){for(var ie=-(H>>1)-1,ve=0;ve>1)-1;ae===0?A(f,c,K--,ie):ae===1?A(p,d,ue--,ie):ae===2&&A(T,l,te--,ie)}}}function m(v,y,I,L,z,F,N,B,R,U,j,Z){var re=0,fe=2*v,le=y,ce=y+v,V=1,ee=1;L?ee=a:V=a;for(var ne=z;ne>>1;i(g,H);for(var ae=0,ne=0;ne=a?(ve=!L,K-=a):(ve=!!L,K-=1),ve)M(f,c,ae++,K);else{var Ae=Z[K],Ce=fe*K,Fe=j[Ce+y+1],ze=j[Ce+y+1+v];e:for(var Ye=0;Ye>>1;i(g,K);for(var ue=0,ce=0;ce=a)f[ue++]=V-a;else{V-=1;var H=j[V],ae=re*V,ie=U[ae+y+1],ve=U[ae+y+1+v];e:for(var Ae=0;Ae=0;--Ae)if(f[Ae]===V){for(var Ye=Ae+1;Ye>>1;i(g,ne);for(var $=0,ue=0,le=0;le=a)te=te-a|0,A(p,v,ue--,te);else if(te>=0)A(f,c,$--,te);else if(te<=-a){te=-te-a|0;for(var H=0;H<$;++H){var ae=y(f[H],te);if(ae!==void 0)return ae}M(p,v,ue++,te)}else{te=-te-1|0;for(var H=0;H>>1;i(g,ne);for(var $=0,ue=0,te=0,le=0;le>1===g[2*le+3]>>1&&(ae=2,le+=1),H<0){for(var ie=-(H>>1)-1,de=0;de>1)-1;ae===0?A(f,c,$--,ie):ae===1?A(p,v,ue--,ie):ae===2&&A(T,l,te--,ie)}}}function m(d,y,I,L,z,F,N,B,R,U,j,Z){var re=0,fe=2*d,le=y,ce=y+d,V=1,ee=1;L?ee=a:V=a;for(var ne=z;ne>>1;i(g,H);for(var ae=0,ne=0;ne=a?(de=!L,$-=a):(de=!!L,$-=1),de)M(f,c,ae++,$);else{var Se=Z[$],Le=fe*$,Fe=j[Le+y+1],ze=j[Le+y+1+d];e:for(var Ye=0;Ye>>1;i(g,$);for(var ue=0,ce=0;ce<$;++ce){var te=g[2*ce+1]|0;if(te<0){var V=-te;if(V>=a)f[ue++]=V-a;else{V-=1;var H=j[V],ae=re*V,ie=U[ae+y+1],de=U[ae+y+1+d];e:for(var Se=0;Se=0;--Se)if(f[Se]===V){for(var Ye=Se+1;Ye0&&d>0||p<0&&d<0)return!1;var T=o(f,a,s),l=o(c,a,s);return T>0&&l>0||T<0&&l<0?!1:p===0&&d===0&&T===0&&l===0?n(a,s,f,c):!0}}),1278:(function(e,t,r){var o=r(2361),n=Math.pow(2,-1074),i=-1>>>0;e.exports=a;function a(s,f){if(isNaN(s)||isNaN(f))return NaN;if(s===f)return s;if(s===0)return f<0?-n:n;var c=o.hi(s),p=o.lo(s);return f>s==s>0?p===i?(c+=1,p=0):p+=1:p===0?(p=i,c-=1):p-=1,o.pack(p,c)}}),1283:(function(e,t,r){var o=r(9405),n=r(3236),i=n([`precision highp float; +`]);t.createShader=function(c){var p=o(c,i,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p.attributes.normal.location=2,p},t.createPickShader=function(c){var p=o(c,i,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p.attributes.normal.location=2,p},t.createContourShader=function(c){var p=o(c,s,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p},t.createPickContourShader=function(c){var p=o(c,s,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return p.attributes.uv.location=0,p.attributes.f.location=1,p}}),1085:(function(e,t,r){var o=r(1371);e.exports=n;function n(i,a,s){a=typeof a=="number"?a:1,s=s||": ";var f=i.split(/\r?\n/),c=String(f.length+a-1).length;return f.map(function(p,v){var T=v+a,l=String(T).length,g=o(T,c-l);return g+s+p}).join(` +`)}}),1091:(function(e){e.exports=t;function t(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}}),1125:(function(e,t,r){e.exports=i;var o=r(3250)[3];function n(a,s,f,c){for(var p=0;p<2;++p){var v=a[p],T=s[p],l=Math.min(v,T),g=Math.max(v,T),x=f[p],A=c[p],M=Math.min(x,A),_=Math.max(x,A);if(_0&&v>0||p<0&&v<0)return!1;var T=o(f,a,s),l=o(c,a,s);return T>0&&l>0||T<0&&l<0?!1:p===0&&v===0&&T===0&&l===0?n(a,s,f,c):!0}}),1278:(function(e,t,r){var o=r(2361),n=Math.pow(2,-1074),i=-1>>>0;e.exports=a;function a(s,f){if(isNaN(s)||isNaN(f))return NaN;if(s===f)return s;if(s===0)return f<0?-n:n;var c=o.hi(s),p=o.lo(s);return f>s==s>0?p===i?(c+=1,p=0):p+=1:p===0?(p=i,c-=1):p-=1,o.pack(p,c)}}),1283:(function(e,t,r){var o=r(9405),n=r(3236),i=n([`precision highp float; #define GLSLIFY 1 bool outOfRange(float a, float b, float p) { @@ -1259,7 +1259,7 @@ void main() { if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard; gl_FragColor = vec4(pickGroup, pickId.bgr); -}`]),p=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],d={vertex:i,fragment:f,attributes:p},T={vertex:a,fragment:f,attributes:p},l={vertex:s,fragment:f,attributes:p},g={vertex:i,fragment:c,attributes:p},x={vertex:a,fragment:c,attributes:p},A={vertex:s,fragment:c,attributes:p};function M(_,w){var m=o(_,w),u=m.attributes;return u.position.location=0,u.color.location=1,u.glyph.location=2,u.id.location=3,m}t.createPerspective=function(_){return M(_,d)},t.createOrtho=function(_){return M(_,T)},t.createProject=function(_){return M(_,l)},t.createPickPerspective=function(_){return M(_,g)},t.createPickOrtho=function(_){return M(_,x)},t.createPickProject=function(_){return M(_,A)}}),1303:(function(e,t,r){e.exports=i;var o=r(3250);function n(a,s){var f,c;if(s[0][0]s[1][0])f=s[1],c=s[0];else{var p=Math.min(a[0][1],a[1][1]),d=Math.max(a[0][1],a[1][1]),T=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return dl?p-l:d-l}var g,x;a[0][1]s[1][0])f=s[1],c=s[0];else return n(s,a);var p,d;if(a[0][0]a[1][0])p=a[1],d=a[0];else return-n(a,s);var T=o(f,c,d),l=o(f,c,p);if(T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;if(T=o(d,p,c),l=o(d,p,f),T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;return c[0]-d[0]}}),1318:(function(e){e.exports=t;function t(r,o){return r[0].mul(o[1]).cmp(o[0].mul(r[1]))}}),1338:(function(e){function t(n,i,a){var s=n[a]|0;if(s<=0)return[];var f=new Array(s),c;if(a===n.length-1)for(c=0;c"u"&&(i=0),typeof n){case"number":if(n>0)return r(n|0,i);break;case"object":if(typeof n.length=="number")return t(n,i,0);break}return[]}e.exports=o}),1369:(function(e,t,r){var o=r(5716);e.exports=n;function n(i){var a=i.length,s=i.words,f=0;if(a===1)f=s[0];else if(a===2)f=s[0]+s[1]*67108864;else for(var c=0;ci)throw new Error("gl-vao: Too many vertex attributes");for(var a=0;as[1][0])f=s[1],c=s[0];else{var p=Math.min(a[0][1],a[1][1]),v=Math.max(a[0][1],a[1][1]),T=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return vl?p-l:v-l}var g,x;a[0][1]s[1][0])f=s[1],c=s[0];else return n(s,a);var p,v;if(a[0][0]a[1][0])p=a[1],v=a[0];else return-n(a,s);var T=o(f,c,v),l=o(f,c,p);if(T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;if(T=o(v,p,c),l=o(v,p,f),T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;return c[0]-v[0]}}),1318:(function(e){e.exports=t;function t(r,o){return r[0].mul(o[1]).cmp(o[0].mul(r[1]))}}),1338:(function(e){function t(n,i,a){var s=n[a]|0;if(s<=0)return[];var f=new Array(s),c;if(a===n.length-1)for(c=0;c"u"&&(i=0),typeof n){case"number":if(n>0)return r(n|0,i);break;case"object":if(typeof n.length=="number")return t(n,i,0);break}return[]}e.exports=o}),1369:(function(e,t,r){var o=r(5716);e.exports=n;function n(i){var a=i.length,s=i.words,f=0;if(a===1)f=s[0];else if(a===2)f=s[0]+s[1]*67108864;else for(var c=0;ci)throw new Error("gl-vao: Too many vertex attributes");for(var a=0;a=0?y[U]:R)}function z(B){var R=A(B);return R?I in R:v.indexOf(B)>=0}function F(B,R){var U,j=A(B);return j?j[I]=R:(U=v.indexOf(B),U>=0?y[U]=R:(U=v.length,y[U]=R,v[U]=B)),this}function N(B){var R=A(B),U,j;return R?I in R&&delete R[I]:(U=v.indexOf(B),U<0?!1:(j=v.length-1,v[U]=void 0,y[U]=y[j],v[U]=v[j],v.length=j,y.length=j,!0))}return Object.create(u.prototype,{get___:{value:M(L)},has___:{value:M(z)},set___:{value:M(F)},delete___:{value:M(N)}})};u.prototype=Object.create(Object.prototype,{get:{value:function(y,I){return this.get___(y,I)},writable:!0,configurable:!0},has:{value:function(y){return this.has___(y)},writable:!0,configurable:!0},set:{value:function(y,I){return this.set___(y,I)},writable:!0,configurable:!0},delete:{value:function(y){return this.delete___(y)},writable:!0,configurable:!0}}),typeof n=="function"?(function(){o&&typeof Proxy<"u"&&(Proxy=void 0);function v(){this instanceof u||w();var y=new n,I=void 0,L=!1;function z(R,U){return I?y.has(R)?y.get(R):I.get___(R,U):y.get(R,U)}function F(R){return y.has(R)||(I?I.has___(R):!1)}var N;o?N=function(R,U){return y.set(R,U),y.has(R)||(I||(I=new u),I.set(R,U)),this}:N=function(R,U){if(L)try{y.set(R,U)}catch{I||(I=new u),I.set___(R,U)}else y.set(R,U);return this};function B(R){var U=!!y.delete(R);return I&&I.delete___(R)||U}return Object.create(u.prototype,{get___:{value:M(z)},has___:{value:M(F)},set___:{value:M(N)},delete___:{value:M(B)},permitHostObjects___:{value:M(function(R){if(R===r)L=!0;else throw new Error("bogus call to permitHostObjects___")})}})}v.prototype=u.prototype,e.exports=v,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})})():(typeof Proxy<"u"&&(Proxy=void 0),e.exports=u)})()}),1570:(function(e){e.exports=r;var t=[function(){function n(i,a,s,f){for(var c=i.length,p=[],d=0;d>1,x=s[2*g+1];if(x===d)return g;d>1,x=s[2*g+1];if(x===d)return g;d>1,x=s[2*g+1];if(x===d)return g;d=0?y[U]:R)}function z(B){var R=A(B);return R?I in R:d.indexOf(B)>=0}function F(B,R){var U,j=A(B);return j?j[I]=R:(U=d.indexOf(B),U>=0?y[U]=R:(U=d.length,y[U]=R,d[U]=B)),this}function N(B){var R=A(B),U,j;return R?I in R&&delete R[I]:(U=d.indexOf(B),U<0?!1:(j=d.length-1,d[U]=void 0,y[U]=y[j],d[U]=d[j],d.length=j,y.length=j,!0))}return Object.create(u.prototype,{get___:{value:M(L)},has___:{value:M(z)},set___:{value:M(F)},delete___:{value:M(N)}})};u.prototype=Object.create(Object.prototype,{get:{value:function(y,I){return this.get___(y,I)},writable:!0,configurable:!0},has:{value:function(y){return this.has___(y)},writable:!0,configurable:!0},set:{value:function(y,I){return this.set___(y,I)},writable:!0,configurable:!0},delete:{value:function(y){return this.delete___(y)},writable:!0,configurable:!0}}),typeof n=="function"?(function(){o&&typeof Proxy<"u"&&(Proxy=void 0);function d(){this instanceof u||w();var y=new n,I=void 0,L=!1;function z(R,U){return I?y.has(R)?y.get(R):I.get___(R,U):y.get(R,U)}function F(R){return y.has(R)||(I?I.has___(R):!1)}var N;o?N=function(R,U){return y.set(R,U),y.has(R)||(I||(I=new u),I.set(R,U)),this}:N=function(R,U){if(L)try{y.set(R,U)}catch{I||(I=new u),I.set___(R,U)}else y.set(R,U);return this};function B(R){var U=!!y.delete(R);return I&&I.delete___(R)||U}return Object.create(u.prototype,{get___:{value:M(z)},has___:{value:M(F)},set___:{value:M(N)},delete___:{value:M(B)},permitHostObjects___:{value:M(function(R){if(R===r)L=!0;else throw new Error("bogus call to permitHostObjects___")})}})}d.prototype=u.prototype,e.exports=d,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})})():(typeof Proxy<"u"&&(Proxy=void 0),e.exports=u)})()}),1570:(function(e){e.exports=r;var t=[function(){function n(i,a,s,f){for(var c=i.length,p=[],v=0;v>1,x=s[2*g+1];if(x===v)return g;v>1,x=s[2*g+1];if(x===v)return g;v>1,x=s[2*g+1];if(x===v)return g;v0?U.pop():new ArrayBuffer(B)}t.mallocArrayBuffer=g;function x(N){return new Uint8Array(g(N),0,N)}t.mallocUint8=x;function A(N){return new Uint16Array(g(2*N),0,N)}t.mallocUint16=A;function M(N){return new Uint32Array(g(4*N),0,N)}t.mallocUint32=M;function _(N){return new Int8Array(g(N),0,N)}t.mallocInt8=_;function w(N){return new Int16Array(g(2*N),0,N)}t.mallocInt16=w;function m(N){return new Int32Array(g(4*N),0,N)}t.mallocInt32=m;function u(N){return new Float32Array(g(4*N),0,N)}t.mallocFloat32=t.mallocFloat=u;function v(N){return new Float64Array(g(8*N),0,N)}t.mallocFloat64=t.mallocDouble=v;function y(N){return a?new Uint8ClampedArray(g(N),0,N):x(N)}t.mallocUint8Clamped=y;function I(N){return s?new BigUint64Array(g(8*N),0,N):null}t.mallocBigUint64=I;function L(N){return f?new BigInt64Array(g(8*N),0,N):null}t.mallocBigInt64=L;function z(N){return new DataView(g(N),0,N)}t.mallocDataView=z;function F(N){N=o.nextPow2(N);var B=o.log2(N),R=d[B];return R.length>0?R.pop():new i(N)}t.mallocBuffer=F,t.clearCache=function(){for(var B=0;B<32;++B)c.UINT8[B].length=0,c.UINT16[B].length=0,c.UINT32[B].length=0,c.INT8[B].length=0,c.INT16[B].length=0,c.INT32[B].length=0,c.FLOAT[B].length=0,c.DOUBLE[B].length=0,c.BIGUINT64[B].length=0,c.BIGINT64[B].length=0,c.UINT8C[B].length=0,p[B].length=0,d[B].length=0}}),1903:(function(e){e.exports=t;function t(r){var o=new Float32Array(16);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o[4]=r[4],o[5]=r[5],o[6]=r[6],o[7]=r[7],o[8]=r[8],o[9]=r[9],o[10]=r[10],o[11]=r[11],o[12]=r[12],o[13]=r[13],o[14]=r[14],o[15]=r[15],o}}),1944:(function(e,t,r){var o=r(5250),n=r(8210);e.exports=i;function i(a,s){for(var f=o(a[0],s[0]),c=1;c>1,F=f(u[z],v);F<=0?(F===0&&(L=z),y=z+1):F>0&&(I=z-1)}return L}t.findCell=T;function l(u,v){for(var y=new Array(u.length),I=0,L=y.length;I=u.length||f(u[re],z)!==0););}return y}t.incidence=l;function g(u,v){if(!v)return l(d(A(u,0)),u);for(var y=new Array(v),I=0;I>>R&1&&B.push(L[R]);v.push(B)}return p(v)}t.explode=x;function A(u,v){if(v<0)return[];for(var y=[],I=(1<0}_=_.filter(w);for(var m=_.length,u=new Array(m),v=new Array(m),M=0;M0;){var ae=ue.pop(),ie=re[ae];f(ie,function(ze,Ye){return ze-Ye});var ve=ie.length,Ae=te[ae],Ce;if(Ae===0){var N=_[ae];Ce=[N]}for(var M=0;M=0)&&(te[Fe]=Ae^1,ue.push(Fe),Ae===0)){var N=_[Fe];K(N)||(N.reverse(),Ce.push(N))}}Ae===0&&H.push(Ce)}return H}}),2145:(function(e,t){t.uniforms=i,t.attributes=a;var r={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},o=null;function n(s,f){if(!o){var c=Object.keys(r);o={};for(var p=0;p1)for(var g=0;g1&&F.drawBuffersWEBGL(n[z]);var j=v.getExtension("WEBGL_depth_texture");j?N?m.depth=l(v,I,L,j.UNSIGNED_INT_24_8_WEBGL,v.DEPTH_STENCIL,v.DEPTH_STENCIL_ATTACHMENT):B&&(m.depth=l(v,I,L,v.UNSIGNED_SHORT,v.DEPTH_COMPONENT,v.DEPTH_ATTACHMENT)):B&&N?m._depth_rb=g(v,I,L,v.DEPTH_STENCIL,v.DEPTH_STENCIL_ATTACHMENT):B?m._depth_rb=g(v,I,L,v.DEPTH_COMPONENT16,v.DEPTH_ATTACHMENT):N&&(m._depth_rb=g(v,I,L,v.STENCIL_INDEX,v.STENCIL_ATTACHMENT));var Z=v.checkFramebufferStatus(v.FRAMEBUFFER);if(Z!==v.FRAMEBUFFER_COMPLETE){m._destroyed=!0,v.bindFramebuffer(v.FRAMEBUFFER,null),v.deleteFramebuffer(m.handle),m.handle=null,m.depth&&(m.depth.dispose(),m.depth=null),m._depth_rb&&(v.deleteRenderbuffer(m._depth_rb),m._depth_rb=null);for(var U=0;UI||v<0||v>I)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");m._shape[0]=u,m._shape[1]=v;for(var L=c(y),z=0;zL||v<0||v>L)throw new Error("gl-fbo: Parameters are too large for FBO");y=y||{};var z=1;if("color"in y){if(z=Math.max(y.color|0,0),z<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(z>1)if(I){if(z>m.getParameter(I.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+z+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var F=m.UNSIGNED_BYTE,N=m.getExtension("OES_texture_float");if(y.float&&z>0){if(!N)throw new Error("gl-fbo: Context does not support floating point textures");F=m.FLOAT}else y.preferFloat&&z>0&&N&&(F=m.FLOAT);var B=!0;"depth"in y&&(B=!!y.depth);var R=!1;return"stencil"in y&&(R=!!y.stencil),new A(m,u,v,F,z,B,R,I)}}),2272:(function(e,t,r){var o=r(2646)[4];r(2478),e.exports=i;function n(a,s,f,c,p,d){var T=s.opposite(c,p);if(!(T<0)){if(p0;){for(var g=f.pop(),d=f.pop(),x=-1,A=-1,T=p[d],_=1;_=0||(s.flip(d,g),n(a,s,f,x,d,A),n(a,s,f,d,A,x),n(a,s,f,A,g,x),n(a,s,f,g,x,A))}}}),2334:(function(e){e.exports=t;function t(r,o,n){return r[0]=Math.min(o[0],n[0]),r[1]=Math.min(o[1],n[1]),r[2]=Math.min(o[2],n[2]),r[3]=Math.min(o[3],n[3]),r}}),2335:(function(e){e.exports=t;function t(r){var o=new Float32Array(4);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o}}),2361:(function(e){var t=!1;if(typeof Float64Array<"u"){var r=new Float64Array(1),o=new Uint32Array(r.buffer);if(r[0]=1,t=!0,o[1]===1072693248){let i=function(f,c){return o[0]=f,o[1]=c,r[0]},a=function(f){return r[0]=f,o[0]},s=function(f){return r[0]=f,o[1]};e.exports=function(c){return r[0]=c,[o[0],o[1]]},e.exports.pack=i,e.exports.lo=a,e.exports.hi=s}else if(o[0]===1072693248){let i=function(f,c){return o[1]=f,o[0]=c,r[0]},a=function(f){return r[0]=f,o[1]},s=function(f){return r[0]=f,o[0]};e.exports=function(c){return r[0]=c,[o[1],o[0]]},e.exports.pack=i,e.exports.lo=a,e.exports.hi=s}else t=!1}if(!t){let i=function(f,c){return n.writeUInt32LE(f,0,!0),n.writeUInt32LE(c,4,!0),n.readDoubleLE(0,!0)},a=function(f){return n.writeDoubleLE(f,0,!0),n.readUInt32LE(0,!0)},s=function(f){return n.writeDoubleLE(f,0,!0),n.readUInt32LE(4,!0)};var n=new Buffer(8);e.exports=function(c){return n.writeDoubleLE(c,0,!0),[n.readUInt32LE(0,!0),n.readUInt32LE(4,!0)]},e.exports.pack=i,e.exports.lo=a,e.exports.hi=s}e.exports.sign=function(i){return e.exports.hi(i)>>>31},e.exports.exponent=function(i){var a=e.exports.hi(i);return(a<<1>>>21)-1023},e.exports.fraction=function(i){var a=e.exports.lo(i),s=e.exports.hi(i),f=s&(1<<20)-1;return s&2146435072&&(f+=1048576),[a,f]},e.exports.denormalized=function(i){var a=e.exports.hi(i);return!(a&2146435072)}}),2408:(function(e){e.exports=t;function t(r,o,n){var i=Math.sin(n),a=Math.cos(n),s=o[0],f=o[1],c=o[2],p=o[3],d=o[8],T=o[9],l=o[10],g=o[11];return o!==r&&(r[4]=o[4],r[5]=o[5],r[6]=o[6],r[7]=o[7],r[12]=o[12],r[13]=o[13],r[14]=o[14],r[15]=o[15]),r[0]=s*a-d*i,r[1]=f*a-T*i,r[2]=c*a-l*i,r[3]=p*a-g*i,r[8]=s*i+d*a,r[9]=f*i+T*a,r[10]=c*i+l*a,r[11]=p*i+g*a,r}}),2419:(function(e){e.exports=t;function t(r){for(var o=1,n=1;nA-x?i(f,c,p,d,T,l,g,x,A,M,_):a(f,c,p,d,T,l,g,x,A,M,_)}return s}function o(){function i(p,d,T,l,g,x,A,M,_,w,m){for(var u=2*p,v=l,y=u*l;vw-_?l?i(p,d,T,g,x,A,M,_,w,m,u):a(p,d,T,g,x,A,M,_,w,m,u):l?s(p,d,T,g,x,A,M,_,w,m,u):f(p,d,T,g,x,A,M,_,w,m,u)}return c}function n(i){return i?r():o()}t.partial=n(!1),t.full=n(!0)}),2478:(function(e){function t(s,f,c,p,d){for(var T=d+1;p<=d;){var l=p+d>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x>=0?(T=l,d=l-1):p=l+1}return T}function r(s,f,c,p,d){for(var T=d+1;p<=d;){var l=p+d>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x>0?(T=l,d=l-1):p=l+1}return T}function o(s,f,c,p,d){for(var T=p-1;p<=d;){var l=p+d>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x<0?(T=l,p=l+1):d=l-1}return T}function n(s,f,c,p,d){for(var T=p-1;p<=d;){var l=p+d>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x<=0?(T=l,p=l+1):d=l-1}return T}function i(s,f,c,p,d){for(;p<=d;){var T=p+d>>>1,l=s[T],g=c!==void 0?c(l,f):l-f;if(g===0)return T;g<=0?p=T+1:d=T-1}return-1}function a(s,f,c,p,d,T){return typeof c=="function"?T(s,f,c,p===void 0?0:p|0,d===void 0?s.length-1:d|0):T(s,f,void 0,c===void 0?0:c|0,p===void 0?s.length-1:p|0)}e.exports={ge:function(s,f,c,p,d){return a(s,f,c,p,d,t)},gt:function(s,f,c,p,d){return a(s,f,c,p,d,r)},lt:function(s,f,c,p,d){return a(s,f,c,p,d,o)},le:function(s,f,c,p,d){return a(s,f,c,p,d,n)},eq:function(s,f,c,p,d){return a(s,f,c,p,d,i)}}}),2504:(function(e){e.exports=t;function t(r,o,n){var i=n[0],a=n[1],s=n[2];return r[0]=o[0]*i,r[1]=o[1]*i,r[2]=o[2]*i,r[3]=o[3]*i,r[4]=o[4]*a,r[5]=o[5]*a,r[6]=o[6]*a,r[7]=o[7]*a,r[8]=o[8]*s,r[9]=o[9]*s,r[10]=o[10]*s,r[11]=o[11]*s,r[12]=o[12],r[13]=o[13],r[14]=o[14],r[15]=o[15],r}}),2538:(function(e,t,r){var o=r(8902),n=r(5542),i=r(2272),a=r(5023);e.exports=d;function s(T){return[Math.min(T[0],T[1]),Math.max(T[0],T[1])]}function f(T,l){return T[0]-l[0]||T[1]-l[1]}function c(T){return T.map(s).sort(f)}function p(T,l,g){return l in T?T[l]:g}function d(T,l,g){Array.isArray(l)?(g=g||{},l=l||[]):(g=l||{},l=[]);var x=!!p(g,"delaunay",!0),A=!!p(g,"interior",!0),M=!!p(g,"exterior",!0),_=!!p(g,"infinity",!1);if(!A&&!M||T.length===0)return[];var w=o(T,l);if(x||A!==M||_){for(var m=n(T.length,c(l)),u=0;u0){if(fe=1,V[ne++]=p(m[I],x,A,M),I+=j,_>0)for(re=1,L=m[I],K=V[ne]=p(L,x,A,M),H=V[ne+ue],ve=V[ne+ae],Fe=V[ne+Ae],(K!==H||K!==ve||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,H,ve,Fe,x,A,M),ze=ee[ne]=le++),ne+=1,I+=j,re=2;re<_;++re)L=m[I],K=V[ne]=p(L,x,A,M),H=V[ne+ue],ve=V[ne+ae],Fe=V[ne+Ae],(K!==H||K!==ve||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,H,ve,Fe,x,A,M),ze=ee[ne]=le++,Fe!==H&&c(ee[ne+ue],ze,U,F,Fe,H,x,A,M)),ne+=1,I+=j;for(I+=Z,ne=0,Ye=ue,ue=te,te=Ye,Ye=ae,ae=ie,ie=Ye,Ye=Ae,Ae=Ce,Ce=Ye,fe=2;fe0)for(re=1,L=m[I],K=V[ne]=p(L,x,A,M),H=V[ne+ue],ve=V[ne+ae],Fe=V[ne+Ae],(K!==H||K!==ve||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,H,ve,Fe,x,A,M),ze=ee[ne]=le++,Fe!==ve&&c(ee[ne+ae],ze,B,U,ve,Fe,x,A,M)),ne+=1,I+=j,re=2;re<_;++re)L=m[I],K=V[ne]=p(L,x,A,M),H=V[ne+ue],ve=V[ne+ae],Fe=V[ne+Ae],(K!==H||K!==ve||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,H,ve,Fe,x,A,M),ze=ee[ne]=le++,Fe!==ve&&c(ee[ne+ae],ze,B,U,ve,Fe,x,A,M),Fe!==H&&c(ee[ne+ue],ze,U,F,Fe,H,x,A,M)),ne+=1,I+=j;fe&1&&(ne=0),Ye=ue,ue=te,te=Ye,Ye=ae,ae=ie,ie=Ye,Ye=Ae,Ae=Ce,Ce=Ye,I+=Z}}T(ee),T(V)}},"false,1,0":function(f,c,p,d,T){return function(g,x,A,M){var _=g.shape[0]|0,w=g.shape[1]|0,m=g.data,u=g.offset|0,v=g.stride[0]|0,y=g.stride[1]|0,I=u,L,z=-v|0,F=0,N=-y|0,B=0,R=-v-y|0,U=0,j=y|0,Z=v-y*w|0,re=0,fe=0,le=0,ce=2*w|0,V=d(ce),ee=d(ce),ne=0,K=0,ue=-1,te=-1,H=0,ae=-w|0,ie=w|0,ve=0,Ae=-w-1|0,Ce=w-1|0,Fe=0,ze=0,Ye=0;for(fe=0;fe0){if(re=1,V[ne++]=p(m[I],x,A,M),I+=j,w>0)for(fe=1,L=m[I],K=V[ne]=p(L,x,A,M),ve=V[ne+ae],H=V[ne+ue],Fe=V[ne+Ae],(K!==ve||K!==H||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,ve,H,Fe,x,A,M),ze=ee[ne]=le++),ne+=1,I+=j,fe=2;fe0)for(fe=1,L=m[I],K=V[ne]=p(L,x,A,M),ve=V[ne+ae],H=V[ne+ue],Fe=V[ne+Ae],(K!==ve||K!==H||K!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,K,ve,H,Fe,x,A,M),ze=ee[ne]=le++,Fe!==ve&&c(ee[ne+ae],ze,U,F,Fe,ve,x,A,M)),ne+=1,I+=j,fe=2;fe 0"),typeof s.vertex!="function"&&f("Must specify vertex creation function"),typeof s.cell!="function"&&f("Must specify cell creation function"),typeof s.phase!="function"&&f("Must specify phase function");for(var T=s.getters||[],l=new Array(p),g=0;g=0?l[g]=!0:l[g]=!1;return i(s.vertex,s.cell,s.phase,d,c,l)}}),2642:(function(e,t,r){e.exports=i;var o=r(727);function n(a){for(var s=0,f=0;fl[1][2]&&(I[0]=-I[0]),l[0][2]>l[2][0]&&(I[1]=-I[1]),l[1][0]>l[0][1]&&(I[2]=-I[2]),!0};function x(_,w,m){var u=w[0],v=w[1],y=w[2],I=w[3];return _[0]=m[0]*u+m[4]*v+m[8]*y+m[12]*I,_[1]=m[1]*u+m[5]*v+m[9]*y+m[13]*I,_[2]=m[2]*u+m[6]*v+m[10]*y+m[14]*I,_[3]=m[3]*u+m[7]*v+m[11]*y+m[15]*I,_}function A(_,w){_[0][0]=w[0],_[0][1]=w[1],_[0][2]=w[2],_[1][0]=w[4],_[1][1]=w[5],_[1][2]=w[6],_[2][0]=w[8],_[2][1]=w[9],_[2][2]=w[10]}function M(_,w,m,u,v){_[0]=w[0]*u+m[0]*v,_[1]=w[1]*u+m[1]*v,_[2]=w[2]*u+m[2]*v}}),2653:(function(e,t,r){var o=r(3865);e.exports=n;function n(i,a){for(var s=i.length,f=new Array(s),c=0;c=c[A]&&(x+=1);l[g]=x}}return f}function s(f,c){try{return o(f,!0)}catch{var p=n(f);if(p.length<=c)return[];var d=i(f,p),T=o(d,!0);return a(T,p)}}}),2762:(function(e,t,r){var o=r(1888),n=r(5298),i=r(9618),a=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(l,g,x,A,M){this.gl=l,this.type=g,this.handle=x,this.length=A,this.usage=M}var f=s.prototype;f.bind=function(){this.gl.bindBuffer(this.type,this.handle)},f.unbind=function(){this.gl.bindBuffer(this.type,null)},f.dispose=function(){this.gl.deleteBuffer(this.handle)};function c(l,g,x,A,M,_){var w=M.length*M.BYTES_PER_ELEMENT;if(_<0)return l.bufferData(g,M,A),w;if(w+_>x)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(g,_,M),x}function p(l,g){for(var x=o.malloc(l.length,g),A=l.length,M=0;M=0;--A){if(g[A]!==x)return!1;x*=l[A]}return!0}f.update=function(l,g){if(typeof g!="number"&&(g=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var x=l.dtype;if(a.indexOf(x)<0&&(x="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var A=gl.getExtension("OES_element_index_uint");A&&x!=="uint16"?x="uint32":x="uint16"}if(x===l.dtype&&d(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,l.data,g):this.length=c(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),g);else{var M=o.malloc(l.size,x),_=i(M,l.shape);n.assign(_,l),g<0?this.length=c(this.gl,this.type,this.length,this.usage,M,g):this.length=c(this.gl,this.type,this.length,this.usage,M.subarray(0,l.size),g),o.free(M)}}else if(Array.isArray(l)){var w;this.type===this.gl.ELEMENT_ARRAY_BUFFER?w=p(l,"uint16"):w=p(l,"float32"),g<0?this.length=c(this.gl,this.type,this.length,this.usage,w,g):this.length=c(this.gl,this.type,this.length,this.usage,w.subarray(0,l.length),g),o.free(w)}else if(typeof l=="object"&&typeof l.length=="number")this.length=c(this.gl,this.type,this.length,this.usage,l,g);else if(typeof l=="number"||l===void 0){if(g>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");l=l|0,l<=0&&(l=1),this.gl.bufferData(this.type,l|0,this.usage),this.length=l}else throw new Error("gl-buffer: Invalid data type")};function T(l,g,x,A){if(x=x||l.ARRAY_BUFFER,A=A||l.DYNAMIC_DRAW,x!==l.ARRAY_BUFFER&&x!==l.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(A!==l.DYNAMIC_DRAW&&A!==l.STATIC_DRAW&&A!==l.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var M=l.createBuffer(),_=new s(l,x,M,0,A);return _.update(g),_}e.exports=T}),2825:(function(e){e.exports=t;function t(r,o,n){var i=new Float32Array(3);return i[0]=r,i[1]=o,i[2]=n,i}}),2931:(function(e,t,r){e.exports={EPSILON:r(2613),create:r(1091),clone:r(3126),angle:r(8192),fromValues:r(2825),copy:r(3990),set:r(1463),equals:r(9922),exactEquals:r(9265),add:r(5632),subtract:r(6843),sub:r(2229),multiply:r(5847),mul:r(4505),divide:r(6690),div:r(4008),min:r(8107),max:r(7417),floor:r(2681),ceil:r(9226),round:r(2447),scale:r(6621),scaleAndAdd:r(8489),distance:r(7056),dist:r(5455),squaredDistance:r(2953),sqrDist:r(6141),length:r(1387),len:r(868),squaredLength:r(3066),sqrLen:r(5486),negate:r(5093),inverse:r(811),normalize:r(3536),dot:r(244),cross:r(5911),lerp:r(6658),random:r(7636),transformMat4:r(5673),transformMat3:r(492),transformQuat:r(264),rotateX:r(6894),rotateY:r(109),rotateZ:r(8692),forEach:r(5137)}}),2933:(function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r}}),2953:(function(e){e.exports=t;function t(r,o){var n=o[0]-r[0],i=o[1]-r[1],a=o[2]-r[2];return n*n+i*i+a*a}}),2962:(function(e,t,r){var o=r(5250),n=r(8210),i=r(3012),a=r(7004),s=6;function f(A,M,_,w){return function(u){return w(A(_(u[0][0],u[1][1]),_(-u[0][1],u[1][0])))}}function c(A,M,_,w){return function(u){return w(A(M(A(_(u[1][1],u[2][2]),_(-u[1][2],u[2][1])),u[0][0]),A(M(A(_(u[1][0],u[2][2]),_(-u[1][2],u[2][0])),-u[0][1]),M(A(_(u[1][0],u[2][1]),_(-u[1][1],u[2][0])),u[0][2]))))}}function p(A,M,_,w){return function(u){return w(A(A(M(A(M(A(_(u[2][2],u[3][3]),_(-u[2][3],u[3][2])),u[1][1]),A(M(A(_(u[2][1],u[3][3]),_(-u[2][3],u[3][1])),-u[1][2]),M(A(_(u[2][1],u[3][2]),_(-u[2][2],u[3][1])),u[1][3]))),u[0][0]),M(A(M(A(_(u[2][2],u[3][3]),_(-u[2][3],u[3][2])),u[1][0]),A(M(A(_(u[2][0],u[3][3]),_(-u[2][3],u[3][0])),-u[1][2]),M(A(_(u[2][0],u[3][2]),_(-u[2][2],u[3][0])),u[1][3]))),-u[0][1])),A(M(A(M(A(_(u[2][1],u[3][3]),_(-u[2][3],u[3][1])),u[1][0]),A(M(A(_(u[2][0],u[3][3]),_(-u[2][3],u[3][0])),-u[1][1]),M(A(_(u[2][0],u[3][1]),_(-u[2][1],u[3][0])),u[1][3]))),u[0][2]),M(A(M(A(_(u[2][1],u[3][2]),_(-u[2][2],u[3][1])),u[1][0]),A(M(A(_(u[2][0],u[3][2]),_(-u[2][2],u[3][0])),-u[1][1]),M(A(_(u[2][0],u[3][1]),_(-u[2][1],u[3][0])),u[1][2]))),-u[0][3]))))}}function d(A,M,_,w){return function(u){return w(A(A(M(A(A(M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][2]),A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),-u[2][3]),M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][4]))),u[1][1]),M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][3]),M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][4]))),-u[1][2])),A(M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][4]))),u[1][3]),M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][3]))),-u[1][4]))),u[0][0]),M(A(A(M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][2]),A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),-u[2][3]),M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][4]))),u[1][0]),M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][3]),M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),u[2][4]))),-u[1][2])),A(M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][4]))),u[1][3]),M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][3]))),-u[1][4]))),-u[0][1])),A(M(A(A(M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][3]),M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][4]))),u[1][0]),M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][3]),M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),u[2][4]))),-u[1][1])),A(M(A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][4]))),u[1][3]),M(A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][3]))),-u[1][4]))),u[0][2]),A(M(A(A(M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][4]))),u[1][0]),M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][4]))),-u[1][1])),A(M(A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][4]))),u[1][2]),M(A(M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][2]))),-u[1][4]))),-u[0][3]),M(A(A(M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][3]))),u[1][0]),M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][3]))),-u[1][1])),A(M(A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][3]))),u[1][2]),M(A(M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][2]))),-u[1][3]))),u[0][4])))))}}function T(A){var M=A===2?f:A===3?c:A===4?p:A===5?d:void 0;return M(n,i,o,a)}var l=[function(){return[0]},function(M){return[M[0][0]]}];function g(A,M,_,w,m,u,v,y){return function(L){switch(L.length){case 0:return A(L);case 1:return M(L);case 2:return _(L);case 3:return w(L);case 4:return m(L);case 5:return u(L)}var z=v[L.length];return z||(z=v[L.length]=y(L.length)),z(L)}}function x(){for(;l.length0?U.pop():new ArrayBuffer(B)}t.mallocArrayBuffer=g;function x(N){return new Uint8Array(g(N),0,N)}t.mallocUint8=x;function A(N){return new Uint16Array(g(2*N),0,N)}t.mallocUint16=A;function M(N){return new Uint32Array(g(4*N),0,N)}t.mallocUint32=M;function _(N){return new Int8Array(g(N),0,N)}t.mallocInt8=_;function w(N){return new Int16Array(g(2*N),0,N)}t.mallocInt16=w;function m(N){return new Int32Array(g(4*N),0,N)}t.mallocInt32=m;function u(N){return new Float32Array(g(4*N),0,N)}t.mallocFloat32=t.mallocFloat=u;function d(N){return new Float64Array(g(8*N),0,N)}t.mallocFloat64=t.mallocDouble=d;function y(N){return a?new Uint8ClampedArray(g(N),0,N):x(N)}t.mallocUint8Clamped=y;function I(N){return s?new BigUint64Array(g(8*N),0,N):null}t.mallocBigUint64=I;function L(N){return f?new BigInt64Array(g(8*N),0,N):null}t.mallocBigInt64=L;function z(N){return new DataView(g(N),0,N)}t.mallocDataView=z;function F(N){N=o.nextPow2(N);var B=o.log2(N),R=v[B];return R.length>0?R.pop():new i(N)}t.mallocBuffer=F,t.clearCache=function(){for(var B=0;B<32;++B)c.UINT8[B].length=0,c.UINT16[B].length=0,c.UINT32[B].length=0,c.INT8[B].length=0,c.INT16[B].length=0,c.INT32[B].length=0,c.FLOAT[B].length=0,c.DOUBLE[B].length=0,c.BIGUINT64[B].length=0,c.BIGINT64[B].length=0,c.UINT8C[B].length=0,p[B].length=0,v[B].length=0}}),1903:(function(e){e.exports=t;function t(r){var o=new Float32Array(16);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o[4]=r[4],o[5]=r[5],o[6]=r[6],o[7]=r[7],o[8]=r[8],o[9]=r[9],o[10]=r[10],o[11]=r[11],o[12]=r[12],o[13]=r[13],o[14]=r[14],o[15]=r[15],o}}),1944:(function(e,t,r){var o=r(5250),n=r(8210);e.exports=i;function i(a,s){for(var f=o(a[0],s[0]),c=1;c>1,F=f(u[z],d);F<=0?(F===0&&(L=z),y=z+1):F>0&&(I=z-1)}return L}t.findCell=T;function l(u,d){for(var y=new Array(u.length),I=0,L=y.length;I=u.length||f(u[re],z)!==0););}return y}t.incidence=l;function g(u,d){if(!d)return l(v(A(u,0)),u);for(var y=new Array(d),I=0;I>>R&1&&B.push(L[R]);d.push(B)}return p(d)}t.explode=x;function A(u,d){if(d<0)return[];for(var y=[],I=(1<0}_=_.filter(w);for(var m=_.length,u=new Array(m),d=new Array(m),M=0;M0;){var ae=ue.pop(),ie=re[ae];f(ie,function(ze,Ye){return ze-Ye});var de=ie.length,Se=te[ae],Le;if(Se===0){var N=_[ae];Le=[N]}for(var M=0;M=0)&&(te[Fe]=Se^1,ue.push(Fe),Se===0)){var N=_[Fe];$(N)||(N.reverse(),Le.push(N))}}Se===0&&H.push(Le)}return H}}),2145:(function(e,t){t.uniforms=i,t.attributes=a;var r={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},o=null;function n(s,f){if(!o){var c=Object.keys(r);o={};for(var p=0;p1)for(var g=0;g1&&F.drawBuffersWEBGL(n[z]);var j=d.getExtension("WEBGL_depth_texture");j?N?m.depth=l(d,I,L,j.UNSIGNED_INT_24_8_WEBGL,d.DEPTH_STENCIL,d.DEPTH_STENCIL_ATTACHMENT):B&&(m.depth=l(d,I,L,d.UNSIGNED_SHORT,d.DEPTH_COMPONENT,d.DEPTH_ATTACHMENT)):B&&N?m._depth_rb=g(d,I,L,d.DEPTH_STENCIL,d.DEPTH_STENCIL_ATTACHMENT):B?m._depth_rb=g(d,I,L,d.DEPTH_COMPONENT16,d.DEPTH_ATTACHMENT):N&&(m._depth_rb=g(d,I,L,d.STENCIL_INDEX,d.STENCIL_ATTACHMENT));var Z=d.checkFramebufferStatus(d.FRAMEBUFFER);if(Z!==d.FRAMEBUFFER_COMPLETE){m._destroyed=!0,d.bindFramebuffer(d.FRAMEBUFFER,null),d.deleteFramebuffer(m.handle),m.handle=null,m.depth&&(m.depth.dispose(),m.depth=null),m._depth_rb&&(d.deleteRenderbuffer(m._depth_rb),m._depth_rb=null);for(var U=0;UI||d<0||d>I)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");m._shape[0]=u,m._shape[1]=d;for(var L=c(y),z=0;zL||d<0||d>L)throw new Error("gl-fbo: Parameters are too large for FBO");y=y||{};var z=1;if("color"in y){if(z=Math.max(y.color|0,0),z<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(z>1)if(I){if(z>m.getParameter(I.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+z+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var F=m.UNSIGNED_BYTE,N=m.getExtension("OES_texture_float");if(y.float&&z>0){if(!N)throw new Error("gl-fbo: Context does not support floating point textures");F=m.FLOAT}else y.preferFloat&&z>0&&N&&(F=m.FLOAT);var B=!0;"depth"in y&&(B=!!y.depth);var R=!1;return"stencil"in y&&(R=!!y.stencil),new A(m,u,d,F,z,B,R,I)}}),2272:(function(e,t,r){var o=r(2646)[4];r(2478),e.exports=i;function n(a,s,f,c,p,v){var T=s.opposite(c,p);if(!(T<0)){if(p0;){for(var g=f.pop(),v=f.pop(),x=-1,A=-1,T=p[v],_=1;_=0||(s.flip(v,g),n(a,s,f,x,v,A),n(a,s,f,v,A,x),n(a,s,f,A,g,x),n(a,s,f,g,x,A))}}}),2334:(function(e){e.exports=t;function t(r,o,n){return r[0]=Math.min(o[0],n[0]),r[1]=Math.min(o[1],n[1]),r[2]=Math.min(o[2],n[2]),r[3]=Math.min(o[3],n[3]),r}}),2335:(function(e){e.exports=t;function t(r){var o=new Float32Array(4);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o}}),2361:(function(e){var t=!1;if(typeof Float64Array<"u"){var r=new Float64Array(1),o=new Uint32Array(r.buffer);if(r[0]=1,t=!0,o[1]===1072693248){let i=function(f,c){return o[0]=f,o[1]=c,r[0]},a=function(f){return r[0]=f,o[0]},s=function(f){return r[0]=f,o[1]};e.exports=function(c){return r[0]=c,[o[0],o[1]]},e.exports.pack=i,e.exports.lo=a,e.exports.hi=s}else if(o[0]===1072693248){let i=function(f,c){return o[1]=f,o[0]=c,r[0]},a=function(f){return r[0]=f,o[1]},s=function(f){return r[0]=f,o[0]};e.exports=function(c){return r[0]=c,[o[1],o[0]]},e.exports.pack=i,e.exports.lo=a,e.exports.hi=s}else t=!1}if(!t){let i=function(f,c){return n.writeUInt32LE(f,0,!0),n.writeUInt32LE(c,4,!0),n.readDoubleLE(0,!0)},a=function(f){return n.writeDoubleLE(f,0,!0),n.readUInt32LE(0,!0)},s=function(f){return n.writeDoubleLE(f,0,!0),n.readUInt32LE(4,!0)};var n=new Buffer(8);e.exports=function(c){return n.writeDoubleLE(c,0,!0),[n.readUInt32LE(0,!0),n.readUInt32LE(4,!0)]},e.exports.pack=i,e.exports.lo=a,e.exports.hi=s}e.exports.sign=function(i){return e.exports.hi(i)>>>31},e.exports.exponent=function(i){var a=e.exports.hi(i);return(a<<1>>>21)-1023},e.exports.fraction=function(i){var a=e.exports.lo(i),s=e.exports.hi(i),f=s&(1<<20)-1;return s&2146435072&&(f+=1048576),[a,f]},e.exports.denormalized=function(i){var a=e.exports.hi(i);return!(a&2146435072)}}),2408:(function(e){e.exports=t;function t(r,o,n){var i=Math.sin(n),a=Math.cos(n),s=o[0],f=o[1],c=o[2],p=o[3],v=o[8],T=o[9],l=o[10],g=o[11];return o!==r&&(r[4]=o[4],r[5]=o[5],r[6]=o[6],r[7]=o[7],r[12]=o[12],r[13]=o[13],r[14]=o[14],r[15]=o[15]),r[0]=s*a-v*i,r[1]=f*a-T*i,r[2]=c*a-l*i,r[3]=p*a-g*i,r[8]=s*i+v*a,r[9]=f*i+T*a,r[10]=c*i+l*a,r[11]=p*i+g*a,r}}),2419:(function(e){e.exports=t;function t(r){for(var o=1,n=1;nA-x?i(f,c,p,v,T,l,g,x,A,M,_):a(f,c,p,v,T,l,g,x,A,M,_)}return s}function o(){function i(p,v,T,l,g,x,A,M,_,w,m){for(var u=2*p,d=l,y=u*l;dw-_?l?i(p,v,T,g,x,A,M,_,w,m,u):a(p,v,T,g,x,A,M,_,w,m,u):l?s(p,v,T,g,x,A,M,_,w,m,u):f(p,v,T,g,x,A,M,_,w,m,u)}return c}function n(i){return i?r():o()}t.partial=n(!1),t.full=n(!0)}),2478:(function(e){function t(s,f,c,p,v){for(var T=v+1;p<=v;){var l=p+v>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x>=0?(T=l,v=l-1):p=l+1}return T}function r(s,f,c,p,v){for(var T=v+1;p<=v;){var l=p+v>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x>0?(T=l,v=l-1):p=l+1}return T}function o(s,f,c,p,v){for(var T=p-1;p<=v;){var l=p+v>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x<0?(T=l,p=l+1):v=l-1}return T}function n(s,f,c,p,v){for(var T=p-1;p<=v;){var l=p+v>>>1,g=s[l],x=c!==void 0?c(g,f):g-f;x<=0?(T=l,p=l+1):v=l-1}return T}function i(s,f,c,p,v){for(;p<=v;){var T=p+v>>>1,l=s[T],g=c!==void 0?c(l,f):l-f;if(g===0)return T;g<=0?p=T+1:v=T-1}return-1}function a(s,f,c,p,v,T){return typeof c=="function"?T(s,f,c,p===void 0?0:p|0,v===void 0?s.length-1:v|0):T(s,f,void 0,c===void 0?0:c|0,p===void 0?s.length-1:p|0)}e.exports={ge:function(s,f,c,p,v){return a(s,f,c,p,v,t)},gt:function(s,f,c,p,v){return a(s,f,c,p,v,r)},lt:function(s,f,c,p,v){return a(s,f,c,p,v,o)},le:function(s,f,c,p,v){return a(s,f,c,p,v,n)},eq:function(s,f,c,p,v){return a(s,f,c,p,v,i)}}}),2504:(function(e){e.exports=t;function t(r,o,n){var i=n[0],a=n[1],s=n[2];return r[0]=o[0]*i,r[1]=o[1]*i,r[2]=o[2]*i,r[3]=o[3]*i,r[4]=o[4]*a,r[5]=o[5]*a,r[6]=o[6]*a,r[7]=o[7]*a,r[8]=o[8]*s,r[9]=o[9]*s,r[10]=o[10]*s,r[11]=o[11]*s,r[12]=o[12],r[13]=o[13],r[14]=o[14],r[15]=o[15],r}}),2538:(function(e,t,r){var o=r(8902),n=r(5542),i=r(2272),a=r(5023);e.exports=v;function s(T){return[Math.min(T[0],T[1]),Math.max(T[0],T[1])]}function f(T,l){return T[0]-l[0]||T[1]-l[1]}function c(T){return T.map(s).sort(f)}function p(T,l,g){return l in T?T[l]:g}function v(T,l,g){Array.isArray(l)?(g=g||{},l=l||[]):(g=l||{},l=[]);var x=!!p(g,"delaunay",!0),A=!!p(g,"interior",!0),M=!!p(g,"exterior",!0),_=!!p(g,"infinity",!1);if(!A&&!M||T.length===0)return[];var w=o(T,l);if(x||A!==M||_){for(var m=n(T.length,c(l)),u=0;u0){if(fe=1,V[ne++]=p(m[I],x,A,M),I+=j,_>0)for(re=1,L=m[I],$=V[ne]=p(L,x,A,M),H=V[ne+ue],de=V[ne+ae],Fe=V[ne+Se],($!==H||$!==de||$!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,$,H,de,Fe,x,A,M),ze=ee[ne]=le++),ne+=1,I+=j,re=2;re<_;++re)L=m[I],$=V[ne]=p(L,x,A,M),H=V[ne+ue],de=V[ne+ae],Fe=V[ne+Se],($!==H||$!==de||$!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,$,H,de,Fe,x,A,M),ze=ee[ne]=le++,Fe!==H&&c(ee[ne+ue],ze,U,F,Fe,H,x,A,M)),ne+=1,I+=j;for(I+=Z,ne=0,Ye=ue,ue=te,te=Ye,Ye=ae,ae=ie,ie=Ye,Ye=Se,Se=Le,Le=Ye,fe=2;fe0)for(re=1,L=m[I],$=V[ne]=p(L,x,A,M),H=V[ne+ue],de=V[ne+ae],Fe=V[ne+Se],($!==H||$!==de||$!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,$,H,de,Fe,x,A,M),ze=ee[ne]=le++,Fe!==de&&c(ee[ne+ae],ze,B,U,de,Fe,x,A,M)),ne+=1,I+=j,re=2;re<_;++re)L=m[I],$=V[ne]=p(L,x,A,M),H=V[ne+ue],de=V[ne+ae],Fe=V[ne+Se],($!==H||$!==de||$!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,$,H,de,Fe,x,A,M),ze=ee[ne]=le++,Fe!==de&&c(ee[ne+ae],ze,B,U,de,Fe,x,A,M),Fe!==H&&c(ee[ne+ue],ze,U,F,Fe,H,x,A,M)),ne+=1,I+=j;fe&1&&(ne=0),Ye=ue,ue=te,te=Ye,Ye=ae,ae=ie,ie=Ye,Ye=Se,Se=Le,Le=Ye,I+=Z}}T(ee),T(V)}},"false,1,0":function(f,c,p,v,T){return function(g,x,A,M){var _=g.shape[0]|0,w=g.shape[1]|0,m=g.data,u=g.offset|0,d=g.stride[0]|0,y=g.stride[1]|0,I=u,L,z=-d|0,F=0,N=-y|0,B=0,R=-d-y|0,U=0,j=y|0,Z=d-y*w|0,re=0,fe=0,le=0,ce=2*w|0,V=v(ce),ee=v(ce),ne=0,$=0,ue=-1,te=-1,H=0,ae=-w|0,ie=w|0,de=0,Se=-w-1|0,Le=w-1|0,Fe=0,ze=0,Ye=0;for(fe=0;fe0){if(re=1,V[ne++]=p(m[I],x,A,M),I+=j,w>0)for(fe=1,L=m[I],$=V[ne]=p(L,x,A,M),de=V[ne+ae],H=V[ne+ue],Fe=V[ne+Se],($!==de||$!==H||$!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,$,de,H,Fe,x,A,M),ze=ee[ne]=le++),ne+=1,I+=j,fe=2;fe0)for(fe=1,L=m[I],$=V[ne]=p(L,x,A,M),de=V[ne+ae],H=V[ne+ue],Fe=V[ne+Se],($!==de||$!==H||$!==Fe)&&(F=m[I+z],B=m[I+N],U=m[I+R],f(re,fe,L,F,B,U,$,de,H,Fe,x,A,M),ze=ee[ne]=le++,Fe!==de&&c(ee[ne+ae],ze,U,F,Fe,de,x,A,M)),ne+=1,I+=j,fe=2;fe 0"),typeof s.vertex!="function"&&f("Must specify vertex creation function"),typeof s.cell!="function"&&f("Must specify cell creation function"),typeof s.phase!="function"&&f("Must specify phase function");for(var T=s.getters||[],l=new Array(p),g=0;g=0?l[g]=!0:l[g]=!1;return i(s.vertex,s.cell,s.phase,v,c,l)}}),2642:(function(e,t,r){e.exports=i;var o=r(727);function n(a){for(var s=0,f=0;fl[1][2]&&(I[0]=-I[0]),l[0][2]>l[2][0]&&(I[1]=-I[1]),l[1][0]>l[0][1]&&(I[2]=-I[2]),!0};function x(_,w,m){var u=w[0],d=w[1],y=w[2],I=w[3];return _[0]=m[0]*u+m[4]*d+m[8]*y+m[12]*I,_[1]=m[1]*u+m[5]*d+m[9]*y+m[13]*I,_[2]=m[2]*u+m[6]*d+m[10]*y+m[14]*I,_[3]=m[3]*u+m[7]*d+m[11]*y+m[15]*I,_}function A(_,w){_[0][0]=w[0],_[0][1]=w[1],_[0][2]=w[2],_[1][0]=w[4],_[1][1]=w[5],_[1][2]=w[6],_[2][0]=w[8],_[2][1]=w[9],_[2][2]=w[10]}function M(_,w,m,u,d){_[0]=w[0]*u+m[0]*d,_[1]=w[1]*u+m[1]*d,_[2]=w[2]*u+m[2]*d}}),2653:(function(e,t,r){var o=r(3865);e.exports=n;function n(i,a){for(var s=i.length,f=new Array(s),c=0;c=c[A]&&(x+=1);l[g]=x}}return f}function s(f,c){try{return o(f,!0)}catch{var p=n(f);if(p.length<=c)return[];var v=i(f,p),T=o(v,!0);return a(T,p)}}}),2762:(function(e,t,r){var o=r(1888),n=r(5298),i=r(9618),a=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(l,g,x,A,M){this.gl=l,this.type=g,this.handle=x,this.length=A,this.usage=M}var f=s.prototype;f.bind=function(){this.gl.bindBuffer(this.type,this.handle)},f.unbind=function(){this.gl.bindBuffer(this.type,null)},f.dispose=function(){this.gl.deleteBuffer(this.handle)};function c(l,g,x,A,M,_){var w=M.length*M.BYTES_PER_ELEMENT;if(_<0)return l.bufferData(g,M,A),w;if(w+_>x)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(g,_,M),x}function p(l,g){for(var x=o.malloc(l.length,g),A=l.length,M=0;M=0;--A){if(g[A]!==x)return!1;x*=l[A]}return!0}f.update=function(l,g){if(typeof g!="number"&&(g=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var x=l.dtype;if(a.indexOf(x)<0&&(x="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var A=gl.getExtension("OES_element_index_uint");A&&x!=="uint16"?x="uint32":x="uint16"}if(x===l.dtype&&v(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,l.data,g):this.length=c(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),g);else{var M=o.malloc(l.size,x),_=i(M,l.shape);n.assign(_,l),g<0?this.length=c(this.gl,this.type,this.length,this.usage,M,g):this.length=c(this.gl,this.type,this.length,this.usage,M.subarray(0,l.size),g),o.free(M)}}else if(Array.isArray(l)){var w;this.type===this.gl.ELEMENT_ARRAY_BUFFER?w=p(l,"uint16"):w=p(l,"float32"),g<0?this.length=c(this.gl,this.type,this.length,this.usage,w,g):this.length=c(this.gl,this.type,this.length,this.usage,w.subarray(0,l.length),g),o.free(w)}else if(typeof l=="object"&&typeof l.length=="number")this.length=c(this.gl,this.type,this.length,this.usage,l,g);else if(typeof l=="number"||l===void 0){if(g>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");l=l|0,l<=0&&(l=1),this.gl.bufferData(this.type,l|0,this.usage),this.length=l}else throw new Error("gl-buffer: Invalid data type")};function T(l,g,x,A){if(x=x||l.ARRAY_BUFFER,A=A||l.DYNAMIC_DRAW,x!==l.ARRAY_BUFFER&&x!==l.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(A!==l.DYNAMIC_DRAW&&A!==l.STATIC_DRAW&&A!==l.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var M=l.createBuffer(),_=new s(l,x,M,0,A);return _.update(g),_}e.exports=T}),2825:(function(e){e.exports=t;function t(r,o,n){var i=new Float32Array(3);return i[0]=r,i[1]=o,i[2]=n,i}}),2931:(function(e,t,r){e.exports={EPSILON:r(2613),create:r(1091),clone:r(3126),angle:r(8192),fromValues:r(2825),copy:r(3990),set:r(1463),equals:r(9922),exactEquals:r(9265),add:r(5632),subtract:r(6843),sub:r(2229),multiply:r(5847),mul:r(4505),divide:r(6690),div:r(4008),min:r(8107),max:r(7417),floor:r(2681),ceil:r(9226),round:r(2447),scale:r(6621),scaleAndAdd:r(8489),distance:r(7056),dist:r(5455),squaredDistance:r(2953),sqrDist:r(6141),length:r(1387),len:r(868),squaredLength:r(3066),sqrLen:r(5486),negate:r(5093),inverse:r(811),normalize:r(3536),dot:r(244),cross:r(5911),lerp:r(6658),random:r(7636),transformMat4:r(5673),transformMat3:r(492),transformQuat:r(264),rotateX:r(6894),rotateY:r(109),rotateZ:r(8692),forEach:r(5137)}}),2933:(function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r}}),2953:(function(e){e.exports=t;function t(r,o){var n=o[0]-r[0],i=o[1]-r[1],a=o[2]-r[2];return n*n+i*i+a*a}}),2962:(function(e,t,r){var o=r(5250),n=r(8210),i=r(3012),a=r(7004),s=6;function f(A,M,_,w){return function(u){return w(A(_(u[0][0],u[1][1]),_(-u[0][1],u[1][0])))}}function c(A,M,_,w){return function(u){return w(A(M(A(_(u[1][1],u[2][2]),_(-u[1][2],u[2][1])),u[0][0]),A(M(A(_(u[1][0],u[2][2]),_(-u[1][2],u[2][0])),-u[0][1]),M(A(_(u[1][0],u[2][1]),_(-u[1][1],u[2][0])),u[0][2]))))}}function p(A,M,_,w){return function(u){return w(A(A(M(A(M(A(_(u[2][2],u[3][3]),_(-u[2][3],u[3][2])),u[1][1]),A(M(A(_(u[2][1],u[3][3]),_(-u[2][3],u[3][1])),-u[1][2]),M(A(_(u[2][1],u[3][2]),_(-u[2][2],u[3][1])),u[1][3]))),u[0][0]),M(A(M(A(_(u[2][2],u[3][3]),_(-u[2][3],u[3][2])),u[1][0]),A(M(A(_(u[2][0],u[3][3]),_(-u[2][3],u[3][0])),-u[1][2]),M(A(_(u[2][0],u[3][2]),_(-u[2][2],u[3][0])),u[1][3]))),-u[0][1])),A(M(A(M(A(_(u[2][1],u[3][3]),_(-u[2][3],u[3][1])),u[1][0]),A(M(A(_(u[2][0],u[3][3]),_(-u[2][3],u[3][0])),-u[1][1]),M(A(_(u[2][0],u[3][1]),_(-u[2][1],u[3][0])),u[1][3]))),u[0][2]),M(A(M(A(_(u[2][1],u[3][2]),_(-u[2][2],u[3][1])),u[1][0]),A(M(A(_(u[2][0],u[3][2]),_(-u[2][2],u[3][0])),-u[1][1]),M(A(_(u[2][0],u[3][1]),_(-u[2][1],u[3][0])),u[1][2]))),-u[0][3]))))}}function v(A,M,_,w){return function(u){return w(A(A(M(A(A(M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][2]),A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),-u[2][3]),M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][4]))),u[1][1]),M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][3]),M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][4]))),-u[1][2])),A(M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][4]))),u[1][3]),M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][3]))),-u[1][4]))),u[0][0]),M(A(A(M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][2]),A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),-u[2][3]),M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][4]))),u[1][0]),M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][3]),M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),u[2][4]))),-u[1][2])),A(M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][4]))),u[1][3]),M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][3]))),-u[1][4]))),-u[0][1])),A(M(A(A(M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][3]),M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][4]))),u[1][0]),M(A(M(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][3]),M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),u[2][4]))),-u[1][1])),A(M(A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][4]))),u[1][3]),M(A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][3]))),-u[1][4]))),u[0][2]),A(M(A(A(M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][4]))),u[1][0]),M(A(M(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][4]))),-u[1][1])),A(M(A(M(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][4]))),u[1][2]),M(A(M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][2]))),-u[1][4]))),-u[0][3]),M(A(A(M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][1]),A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),-u[2][2]),M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][3]))),u[1][0]),M(A(M(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][2]),M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][3]))),-u[1][1])),A(M(A(M(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][3]))),u[1][2]),M(A(M(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][0]),A(M(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),-u[2][1]),M(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][2]))),-u[1][3]))),u[0][4])))))}}function T(A){var M=A===2?f:A===3?c:A===4?p:A===5?v:void 0;return M(n,i,o,a)}var l=[function(){return[0]},function(M){return[M[0][0]]}];function g(A,M,_,w,m,u,d,y){return function(L){switch(L.length){case 0:return A(L);case 1:return M(L);case 2:return _(L);case 3:return w(L);case 4:return m(L);case 5:return u(L)}var z=d[L.length];return z||(z=d[L.length]=y(L.length)),z(L)}}function x(){for(;l.length0){y=c[z][u][0],L=z;break}I=y[L^1];for(var F=0;F<2;++F)for(var N=c[F][u],B=0;B0&&(y=R,I=U,L=F)}return v||y&&l(y,L),I}function x(m,u){var v=c[u][m][0],y=[m];l(v,u);for(var I=v[u^1];;){for(;I!==m;)y.push(I),I=g(y[y.length-2],I,!1);if(c[0][m].length+c[1][m].length===0)break;var L=y[y.length-1],z=m,F=y[1],N=g(L,z,!0);if(o(a[L],a[z],a[F],a[N])<0)break;y.push(m),I=g(L,z)}return y}function A(m,u){return u[1]===u[u.length-1]}for(var p=0;p0;){c[0][p].length;var w=x(p,M);A(_,w)?_.push.apply(_,w):(_.length>0&&T.push(_),_=w)}_.length>0&&T.push(_)}return T}}),3090:(function(e,t,r){e.exports=n;var o=r(3250)[3];function n(i){var a=i.length;if(a<3){for(var g=new Array(a),s=0;s1&&o(i[c[l-2]],i[c[l-1]],T)<=0;)l-=1,c.pop();for(c.push(d),l=p.length;l>1&&o(i[p[l-2]],i[p[l-1]],T)>=0;)l-=1,p.pop();p.push(d)}for(var g=new Array(p.length+c.length-2),x=0,s=0,A=c.length;s0;--M)g[x++]=p[M];return g}}),3105:(function(e,t){"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var a=i>>r-1;return(i^a)-a},t.min=function(i,a){return a^(i^a)&-(i65535)<<4,i>>>=a,s=(i>255)<<3,i>>>=s,a|=s,s=(i>15)<<2,i>>>=s,a|=s,s=(i>3)<<1,i>>>=s,a|=s,a|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var a=32;return i&=-i,i&&a--,i&65535&&(a-=16),i&16711935&&(a-=8),i&252645135&&(a-=4),i&858993459&&(a-=2),i&1431655765&&(a-=1),a}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var n=new Array(256);(function(i){for(var a=0;a<256;++a){var s=a,f=a,c=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--c;i[a]=f<>>8&255]<<16|n[i>>>16&255]<<8|n[i>>>24&255]},t.interleave2=function(i,a){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,i|a<<1},t.deinterleave2=function(i,a){return i=i>>>a&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,a,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,i|=a<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,a){return i=i>>>a&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var a=i|i-1;return a+1|(~a&-~a)-1>>>o(i)+1}}),3126:(function(e){e.exports=t;function t(r){var o=new Float32Array(3);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o}}),3134:(function(e,t,r){e.exports=n;var o=r(1682);function n(i,a){var s=i.length;if(typeof a!="number"){a=0;for(var f=0;f=0}function c(p,d,T,l){var g=o(d,T,l);if(g===0){var x=n(o(p,d,T)),A=n(o(p,d,l));if(x===A){if(x===0){var M=f(p,d,T),_=f(p,d,l);return M===_?0:M?1:-1}return 0}else{if(A===0)return x>0||f(p,d,l)?-1:1;if(x===0)return A>0||f(p,d,T)?1:-1}return n(A-x)}var w=o(p,d,T);if(w>0)return g>0&&o(p,d,l)>0?1:-1;if(w<0)return g>0||o(p,d,l)>0?1:-1;var m=o(p,d,l);return m>0||f(p,d,T)?1:-1}}),3202:(function(e){e.exports=function(r,o){o||(o=[0,""]),r=String(r);var n=parseFloat(r,10);return o[0]=n,o[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",o}}),3233:(function(e){var t="",r;e.exports=o;function o(n,i){if(typeof n!="string")throw new TypeError("expected a string");if(i===1)return n;if(i===2)return n+n;var a=n.length*i;if(r!==n||typeof r>"u")r=n,t="";else if(t.length>=a)return t.substr(0,a);for(;a>t.length&&i>1;)i&1&&(t+=n),i>>=1,n+=n;return t+=n,t=t.substr(0,a),t}}),3236:(function(e){e.exports=function(t){typeof t=="string"&&(t=[t]);for(var r=[].slice.call(arguments,1),o=[],n=0;n0){if(z<=0)return F;N=L+z}else if(L<0){if(z>=0)return F;N=-(L+z)}else return F;var B=c*N;return F>=B||F<=-B?F:x(v,y,I)},function(v,y,I,L){var z=v[0]-L[0],F=y[0]-L[0],N=I[0]-L[0],B=v[1]-L[1],R=y[1]-L[1],U=I[1]-L[1],j=v[2]-L[2],Z=y[2]-L[2],re=I[2]-L[2],fe=F*U,le=N*R,ce=N*B,V=z*U,ee=z*R,ne=F*B,K=j*(fe-le)+Z*(ce-V)+re*(ee-ne),ue=(Math.abs(fe)+Math.abs(le))*Math.abs(j)+(Math.abs(ce)+Math.abs(V))*Math.abs(Z)+(Math.abs(ee)+Math.abs(ne))*Math.abs(re),te=p*ue;return K>te||-K>te?K:A(v,y,I,L)}];function _(u){var v=M[u.length];return v||(v=M[u.length]=g(u.length)),v.apply(void 0,u)}function w(u,v,y,I,L,z,F){return function(B,R,U,j,Z){switch(arguments.length){case 0:case 1:return 0;case 2:return I(B,R);case 3:return L(B,R,U);case 4:return z(B,R,U,j);case 5:return F(B,R,U,j,Z)}for(var re=new Array(arguments.length),fe=0;fe4)throw new n("","Invalid data type");switch(j.charAt(0)){case"b":case"i":f["uniform"+Z+"iv"](d[z],F);break;case"v":f["uniform"+Z+"fv"](d[z],F);break;default:throw new n("","Unrecognized data type for vector "+name+": "+j)}}else if(j.indexOf("mat")===0&&j.length===4){if(Z=j.charCodeAt(j.length-1)-48,Z<2||Z>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+j);f["uniformMatrix"+Z+"fv"](d[z],!1,F);break}else throw new n("","Unknown uniform data type for "+name+": "+j)}}}}}function g(w,m){if(typeof m!="object")return[[w,m]];var u=[];for(var v in m){var y=m[v],I=w;parseInt(v)+""===v?I+="["+v+"]":I+="."+v,typeof y=="object"?u.push.apply(u,g(I,y)):u.push([I,y])}return u}function x(w){switch(w){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var m=w.indexOf("vec");if(0<=m&&m<=1&&w.length===4+m){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new n("","Invalid data type");return w.charAt(0)==="b"?a(u,!1):a(u,0)}else if(w.indexOf("mat")===0&&w.length===4){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+w);return a(u*u,0)}else throw new n("","Unknown uniform data type for "+name+": "+w)}}function A(w,m,u){if(typeof u=="object"){var v=M(u);Object.defineProperty(w,m,{get:i(v),set:l(u),enumerable:!0,configurable:!1})}else d[u]?Object.defineProperty(w,m,{get:T(u),set:l(u),enumerable:!0,configurable:!1}):w[m]=x(p[u].type)}function M(w){var m;if(Array.isArray(w)){m=new Array(w.length);for(var u=0;u=0!=m>=0&&d.push(x[0]+.5+.5*(w+m)/(w-m))}p+=_,++x[0]}}}function r(){return t()}var o=r;function n(s){var f={};return function(p,d,T){var l=p.dtype,g=p.order,x=[l,g.join()].join(),A=f[x];return A||(f[x]=A=s([l,g])),A(p.shape.slice(0),p.data,p.stride,p.offset|0,d,T)}}function i(s){return n(o.bind(void 0,s))}function a(s){return i({funcName:s.funcName})}e.exports=a({funcName:"zeroCrossings"})}),3352:(function(e,t,r){var o=r(2478),n=0,i=1,a=2;e.exports=v;function s(y,I,L,z,F){this.mid=y,this.left=I,this.right=L,this.leftPoints=z,this.rightPoints=F,this.count=(I?I.count:0)+(L?L.count:0)+z.length}var f=s.prototype;function c(y,I){y.mid=I.mid,y.left=I.left,y.right=I.right,y.leftPoints=I.leftPoints,y.rightPoints=I.rightPoints,y.count=I.count}function p(y,I){var L=w(I);y.mid=L.mid,y.left=L.left,y.right=L.right,y.leftPoints=L.leftPoints,y.rightPoints=L.rightPoints,y.count=L.count}function d(y,I){var L=y.intervals([]);L.push(I),p(y,L)}function T(y,I){var L=y.intervals([]),z=L.indexOf(I);return z<0?n:(L.splice(z,1),p(y,L),i)}f.intervals=function(y){return y.push.apply(y,this.leftPoints),this.left&&this.left.intervals(y),this.right&&this.right.intervals(y),y},f.insert=function(y){var I=this.count-this.leftPoints.length;if(this.count+=1,y[1]3*(I+1)?d(this,y):this.left.insert(y):this.left=w([y]);else if(y[0]>this.mid)this.right?4*(this.right.count+1)>3*(I+1)?d(this,y):this.right.insert(y):this.right=w([y]);else{var L=o.ge(this.leftPoints,y,M),z=o.ge(this.rightPoints,y,_);this.leftPoints.splice(L,0,y),this.rightPoints.splice(z,0,y)}},f.remove=function(y){var I=this.count-this.leftPoints;if(y[1]3*(I-1))return T(this,y);var z=this.left.remove(y);return z===a?(this.left=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else if(y[0]>this.mid){if(!this.right)return n;var F=this.left?this.left.count:0;if(4*F>3*(I-1))return T(this,y);var z=this.right.remove(y);return z===a?(this.right=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else{if(this.count===1)return this.leftPoints[0]===y?a:n;if(this.leftPoints.length===1&&this.leftPoints[0]===y){if(this.left&&this.right){for(var N=this,B=this.left;B.right;)N=B,B=B.right;if(N===this)B.right=this.right;else{var R=this.left,z=this.right;N.count-=B.count,N.right=B.left,B.left=R,B.right=z}c(this,B),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?c(this,this.left):c(this,this.right);return i}for(var R=o.ge(this.leftPoints,y,M);R=0&&y[z][1]>=I;--z){var F=L(y[z]);if(F)return F}}function x(y,I){for(var L=0;Lthis.mid){if(this.right){var L=this.right.queryPoint(y,I);if(L)return L}return g(this.rightPoints,y,I)}else return x(this.leftPoints,I)},f.queryInterval=function(y,I,L){if(ythis.mid&&this.right){var z=this.right.queryInterval(y,I,L);if(z)return z}return Ithis.mid?g(this.rightPoints,y,L):x(this.leftPoints,L)};function A(y,I){return y-I}function M(y,I){var L=y[0]-I[0];return L||y[1]-I[1]}function _(y,I){var L=y[1]-I[1];return L||y[0]-I[0]}function w(y){if(y.length===0)return null;for(var I=[],L=0;L>1],F=[],N=[],B=[],L=0;L=0),_.type){case"b":g=parseInt(g,10).toString(2);break;case"c":g=String.fromCharCode(parseInt(g,10));break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,_.width?parseInt(_.width):0);break;case"e":g=_.precision?parseFloat(g).toExponential(_.precision):parseFloat(g).toExponential();break;case"f":g=_.precision?parseFloat(g).toFixed(_.precision):parseFloat(g);break;case"g":g=_.precision?String(Number(g.toPrecision(_.precision))):parseFloat(g);break;case"o":g=(parseInt(g,10)>>>0).toString(8);break;case"s":g=String(g),g=_.precision?g.substring(0,_.precision):g;break;case"t":g=String(!!g),g=_.precision?g.substring(0,_.precision):g;break;case"T":g=Object.prototype.toString.call(g).slice(8,-1).toLowerCase(),g=_.precision?g.substring(0,_.precision):g;break;case"u":g=parseInt(g,10)>>>0;break;case"v":g=g.valueOf(),g=_.precision?g.substring(0,_.precision):g;break;case"x":g=(parseInt(g,10)>>>0).toString(16);break;case"X":g=(parseInt(g,10)>>>0).toString(16).toUpperCase();break}n.json.test(_.type)?x+=g:(n.number.test(_.type)&&(!v||_.sign)?(y=v?"+":"-",g=g.toString().replace(n.sign,"")):y="",m=_.pad_char?_.pad_char==="0"?"0":_.pad_char.charAt(1):" ",u=_.width-(y+g).length,w=_.width&&u>0?m.repeat(u):"",x+=_.align?y+g+w:m==="0"?y+w+g:w+y+g)}return x}var f=Object.create(null);function c(p){if(f[p])return f[p];for(var d=p,T,l=[],g=0;d;){if((T=n.text.exec(d))!==null)l.push(T[0]);else if((T=n.modulo.exec(d))!==null)l.push("%");else if((T=n.placeholder.exec(d))!==null){if(T[2]){g|=1;var x=[],A=T[2],M=[];if((M=n.key.exec(A))!==null)for(x.push(M[1]);(A=A.substring(M[0].length))!=="";)if((M=n.key_access.exec(A))!==null)x.push(M[1]);else if((M=n.index_access.exec(A))!==null)x.push(M[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");T[2]=x}else g|=2;if(g===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:T[0],param_no:T[1],keys:T[2],sign:T[3],pad_char:T[4],align:T[5],width:T[6],precision:T[7],type:T[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(T[0].length)}return f[p]=l}t.sprintf=i,t.vsprintf=a,typeof window<"u"&&(window.sprintf=i,window.vsprintf=a,o=(function(){return{sprintf:i,vsprintf:a}}).call(t,r,t,e),o!==void 0&&(e.exports=o))})()}),3390:(function(e){e.exports=t;function t(r,o,n,i){var a=new Float32Array(4);return a[0]=r,a[1]=o,a[2]=n,a[3]=i,a}}),3436:(function(e,t,r){var o=r(3236),n=r(9405),i=o([`precision highp float; +`,d)}}return{long:l.trim(),short:g.trim()}}}),3012:(function(e,t,r){var o=r(5250),n=r(9362);e.exports=i;function i(a,s){var f=a.length;if(f===1){var c=o(a[0],s);return c[0]?c:[c[1]]}var p=new Array(2*f),v=[.1,.1],T=[.1,.1],l=0;o(a[0],s,v),v[0]&&(p[l++]=v[0]);for(var g=1;g0){y=c[z][u][0],L=z;break}I=y[L^1];for(var F=0;F<2;++F)for(var N=c[F][u],B=0;B0&&(y=R,I=U,L=F)}return d||y&&l(y,L),I}function x(m,u){var d=c[u][m][0],y=[m];l(d,u);for(var I=d[u^1];;){for(;I!==m;)y.push(I),I=g(y[y.length-2],I,!1);if(c[0][m].length+c[1][m].length===0)break;var L=y[y.length-1],z=m,F=y[1],N=g(L,z,!0);if(o(a[L],a[z],a[F],a[N])<0)break;y.push(m),I=g(L,z)}return y}function A(m,u){return u[1]===u[u.length-1]}for(var p=0;p0;){c[0][p].length;var w=x(p,M);A(_,w)?_.push.apply(_,w):(_.length>0&&T.push(_),_=w)}_.length>0&&T.push(_)}return T}}),3090:(function(e,t,r){e.exports=n;var o=r(3250)[3];function n(i){var a=i.length;if(a<3){for(var g=new Array(a),s=0;s1&&o(i[c[l-2]],i[c[l-1]],T)<=0;)l-=1,c.pop();for(c.push(v),l=p.length;l>1&&o(i[p[l-2]],i[p[l-1]],T)>=0;)l-=1,p.pop();p.push(v)}for(var g=new Array(p.length+c.length-2),x=0,s=0,A=c.length;s0;--M)g[x++]=p[M];return g}}),3105:(function(e,t){"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var a=i>>r-1;return(i^a)-a},t.min=function(i,a){return a^(i^a)&-(i65535)<<4,i>>>=a,s=(i>255)<<3,i>>>=s,a|=s,s=(i>15)<<2,i>>>=s,a|=s,s=(i>3)<<1,i>>>=s,a|=s,a|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var a=32;return i&=-i,i&&a--,i&65535&&(a-=16),i&16711935&&(a-=8),i&252645135&&(a-=4),i&858993459&&(a-=2),i&1431655765&&(a-=1),a}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var n=new Array(256);(function(i){for(var a=0;a<256;++a){var s=a,f=a,c=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--c;i[a]=f<>>8&255]<<16|n[i>>>16&255]<<8|n[i>>>24&255]},t.interleave2=function(i,a){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,i|a<<1},t.deinterleave2=function(i,a){return i=i>>>a&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,a,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,i|=a<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,a){return i=i>>>a&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var a=i|i-1;return a+1|(~a&-~a)-1>>>o(i)+1}}),3126:(function(e){e.exports=t;function t(r){var o=new Float32Array(3);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o}}),3134:(function(e,t,r){e.exports=n;var o=r(1682);function n(i,a){var s=i.length;if(typeof a!="number"){a=0;for(var f=0;f=0}function c(p,v,T,l){var g=o(v,T,l);if(g===0){var x=n(o(p,v,T)),A=n(o(p,v,l));if(x===A){if(x===0){var M=f(p,v,T),_=f(p,v,l);return M===_?0:M?1:-1}return 0}else{if(A===0)return x>0||f(p,v,l)?-1:1;if(x===0)return A>0||f(p,v,T)?1:-1}return n(A-x)}var w=o(p,v,T);if(w>0)return g>0&&o(p,v,l)>0?1:-1;if(w<0)return g>0||o(p,v,l)>0?1:-1;var m=o(p,v,l);return m>0||f(p,v,T)?1:-1}}),3202:(function(e){e.exports=function(r,o){o||(o=[0,""]),r=String(r);var n=parseFloat(r,10);return o[0]=n,o[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",o}}),3233:(function(e){var t="",r;e.exports=o;function o(n,i){if(typeof n!="string")throw new TypeError("expected a string");if(i===1)return n;if(i===2)return n+n;var a=n.length*i;if(r!==n||typeof r>"u")r=n,t="";else if(t.length>=a)return t.substr(0,a);for(;a>t.length&&i>1;)i&1&&(t+=n),i>>=1,n+=n;return t+=n,t=t.substr(0,a),t}}),3236:(function(e){e.exports=function(t){typeof t=="string"&&(t=[t]);for(var r=[].slice.call(arguments,1),o=[],n=0;n0){if(z<=0)return F;N=L+z}else if(L<0){if(z>=0)return F;N=-(L+z)}else return F;var B=c*N;return F>=B||F<=-B?F:x(d,y,I)},function(d,y,I,L){var z=d[0]-L[0],F=y[0]-L[0],N=I[0]-L[0],B=d[1]-L[1],R=y[1]-L[1],U=I[1]-L[1],j=d[2]-L[2],Z=y[2]-L[2],re=I[2]-L[2],fe=F*U,le=N*R,ce=N*B,V=z*U,ee=z*R,ne=F*B,$=j*(fe-le)+Z*(ce-V)+re*(ee-ne),ue=(Math.abs(fe)+Math.abs(le))*Math.abs(j)+(Math.abs(ce)+Math.abs(V))*Math.abs(Z)+(Math.abs(ee)+Math.abs(ne))*Math.abs(re),te=p*ue;return $>te||-$>te?$:A(d,y,I,L)}];function _(u){var d=M[u.length];return d||(d=M[u.length]=g(u.length)),d.apply(void 0,u)}function w(u,d,y,I,L,z,F){return function(B,R,U,j,Z){switch(arguments.length){case 0:case 1:return 0;case 2:return I(B,R);case 3:return L(B,R,U);case 4:return z(B,R,U,j);case 5:return F(B,R,U,j,Z)}for(var re=new Array(arguments.length),fe=0;fe4)throw new n("","Invalid data type");switch(j.charAt(0)){case"b":case"i":f["uniform"+Z+"iv"](v[z],F);break;case"v":f["uniform"+Z+"fv"](v[z],F);break;default:throw new n("","Unrecognized data type for vector "+name+": "+j)}}else if(j.indexOf("mat")===0&&j.length===4){if(Z=j.charCodeAt(j.length-1)-48,Z<2||Z>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+j);f["uniformMatrix"+Z+"fv"](v[z],!1,F);break}else throw new n("","Unknown uniform data type for "+name+": "+j)}}}}}function g(w,m){if(typeof m!="object")return[[w,m]];var u=[];for(var d in m){var y=m[d],I=w;parseInt(d)+""===d?I+="["+d+"]":I+="."+d,typeof y=="object"?u.push.apply(u,g(I,y)):u.push([I,y])}return u}function x(w){switch(w){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var m=w.indexOf("vec");if(0<=m&&m<=1&&w.length===4+m){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new n("","Invalid data type");return w.charAt(0)==="b"?a(u,!1):a(u,0)}else if(w.indexOf("mat")===0&&w.length===4){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+w);return a(u*u,0)}else throw new n("","Unknown uniform data type for "+name+": "+w)}}function A(w,m,u){if(typeof u=="object"){var d=M(u);Object.defineProperty(w,m,{get:i(d),set:l(u),enumerable:!0,configurable:!1})}else v[u]?Object.defineProperty(w,m,{get:T(u),set:l(u),enumerable:!0,configurable:!1}):w[m]=x(p[u].type)}function M(w){var m;if(Array.isArray(w)){m=new Array(w.length);for(var u=0;u=0!=m>=0&&v.push(x[0]+.5+.5*(w+m)/(w-m))}p+=_,++x[0]}}}function r(){return t()}var o=r;function n(s){var f={};return function(p,v,T){var l=p.dtype,g=p.order,x=[l,g.join()].join(),A=f[x];return A||(f[x]=A=s([l,g])),A(p.shape.slice(0),p.data,p.stride,p.offset|0,v,T)}}function i(s){return n(o.bind(void 0,s))}function a(s){return i({funcName:s.funcName})}e.exports=a({funcName:"zeroCrossings"})}),3352:(function(e,t,r){var o=r(2478),n=0,i=1,a=2;e.exports=d;function s(y,I,L,z,F){this.mid=y,this.left=I,this.right=L,this.leftPoints=z,this.rightPoints=F,this.count=(I?I.count:0)+(L?L.count:0)+z.length}var f=s.prototype;function c(y,I){y.mid=I.mid,y.left=I.left,y.right=I.right,y.leftPoints=I.leftPoints,y.rightPoints=I.rightPoints,y.count=I.count}function p(y,I){var L=w(I);y.mid=L.mid,y.left=L.left,y.right=L.right,y.leftPoints=L.leftPoints,y.rightPoints=L.rightPoints,y.count=L.count}function v(y,I){var L=y.intervals([]);L.push(I),p(y,L)}function T(y,I){var L=y.intervals([]),z=L.indexOf(I);return z<0?n:(L.splice(z,1),p(y,L),i)}f.intervals=function(y){return y.push.apply(y,this.leftPoints),this.left&&this.left.intervals(y),this.right&&this.right.intervals(y),y},f.insert=function(y){var I=this.count-this.leftPoints.length;if(this.count+=1,y[1]3*(I+1)?v(this,y):this.left.insert(y):this.left=w([y]);else if(y[0]>this.mid)this.right?4*(this.right.count+1)>3*(I+1)?v(this,y):this.right.insert(y):this.right=w([y]);else{var L=o.ge(this.leftPoints,y,M),z=o.ge(this.rightPoints,y,_);this.leftPoints.splice(L,0,y),this.rightPoints.splice(z,0,y)}},f.remove=function(y){var I=this.count-this.leftPoints;if(y[1]3*(I-1))return T(this,y);var z=this.left.remove(y);return z===a?(this.left=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else if(y[0]>this.mid){if(!this.right)return n;var F=this.left?this.left.count:0;if(4*F>3*(I-1))return T(this,y);var z=this.right.remove(y);return z===a?(this.right=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else{if(this.count===1)return this.leftPoints[0]===y?a:n;if(this.leftPoints.length===1&&this.leftPoints[0]===y){if(this.left&&this.right){for(var N=this,B=this.left;B.right;)N=B,B=B.right;if(N===this)B.right=this.right;else{var R=this.left,z=this.right;N.count-=B.count,N.right=B.left,B.left=R,B.right=z}c(this,B),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?c(this,this.left):c(this,this.right);return i}for(var R=o.ge(this.leftPoints,y,M);R=0&&y[z][1]>=I;--z){var F=L(y[z]);if(F)return F}}function x(y,I){for(var L=0;Lthis.mid){if(this.right){var L=this.right.queryPoint(y,I);if(L)return L}return g(this.rightPoints,y,I)}else return x(this.leftPoints,I)},f.queryInterval=function(y,I,L){if(ythis.mid&&this.right){var z=this.right.queryInterval(y,I,L);if(z)return z}return Ithis.mid?g(this.rightPoints,y,L):x(this.leftPoints,L)};function A(y,I){return y-I}function M(y,I){var L=y[0]-I[0];return L||y[1]-I[1]}function _(y,I){var L=y[1]-I[1];return L||y[0]-I[0]}function w(y){if(y.length===0)return null;for(var I=[],L=0;L>1],F=[],N=[],B=[],L=0;L=0),_.type){case"b":g=parseInt(g,10).toString(2);break;case"c":g=String.fromCharCode(parseInt(g,10));break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,_.width?parseInt(_.width):0);break;case"e":g=_.precision?parseFloat(g).toExponential(_.precision):parseFloat(g).toExponential();break;case"f":g=_.precision?parseFloat(g).toFixed(_.precision):parseFloat(g);break;case"g":g=_.precision?String(Number(g.toPrecision(_.precision))):parseFloat(g);break;case"o":g=(parseInt(g,10)>>>0).toString(8);break;case"s":g=String(g),g=_.precision?g.substring(0,_.precision):g;break;case"t":g=String(!!g),g=_.precision?g.substring(0,_.precision):g;break;case"T":g=Object.prototype.toString.call(g).slice(8,-1).toLowerCase(),g=_.precision?g.substring(0,_.precision):g;break;case"u":g=parseInt(g,10)>>>0;break;case"v":g=g.valueOf(),g=_.precision?g.substring(0,_.precision):g;break;case"x":g=(parseInt(g,10)>>>0).toString(16);break;case"X":g=(parseInt(g,10)>>>0).toString(16).toUpperCase();break}n.json.test(_.type)?x+=g:(n.number.test(_.type)&&(!d||_.sign)?(y=d?"+":"-",g=g.toString().replace(n.sign,"")):y="",m=_.pad_char?_.pad_char==="0"?"0":_.pad_char.charAt(1):" ",u=_.width-(y+g).length,w=_.width&&u>0?m.repeat(u):"",x+=_.align?y+g+w:m==="0"?y+w+g:w+y+g)}return x}var f=Object.create(null);function c(p){if(f[p])return f[p];for(var v=p,T,l=[],g=0;v;){if((T=n.text.exec(v))!==null)l.push(T[0]);else if((T=n.modulo.exec(v))!==null)l.push("%");else if((T=n.placeholder.exec(v))!==null){if(T[2]){g|=1;var x=[],A=T[2],M=[];if((M=n.key.exec(A))!==null)for(x.push(M[1]);(A=A.substring(M[0].length))!=="";)if((M=n.key_access.exec(A))!==null)x.push(M[1]);else if((M=n.index_access.exec(A))!==null)x.push(M[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");T[2]=x}else g|=2;if(g===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:T[0],param_no:T[1],keys:T[2],sign:T[3],pad_char:T[4],align:T[5],width:T[6],precision:T[7],type:T[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");v=v.substring(T[0].length)}return f[p]=l}t.sprintf=i,t.vsprintf=a,typeof window<"u"&&(window.sprintf=i,window.vsprintf=a,o=(function(){return{sprintf:i,vsprintf:a}}).call(t,r,t,e),o!==void 0&&(e.exports=o))})()}),3390:(function(e){e.exports=t;function t(r,o,n,i){var a=new Float32Array(4);return a[0]=r,a[1]=o,a[2]=n,a[3]=i,a}}),3436:(function(e,t,r){var o=r(3236),n=r(9405),i=o([`precision highp float; #define GLSLIFY 1 attribute vec3 position, offset; @@ -1565,11 +1565,11 @@ void main() { ) discard; gl_FragColor = opacity * fragColor; -}`]);e.exports=function(s){return n(s,i,a,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}}),3502:(function(e,t,r){e.exports=i;var o=r(5995),n=r(9127);function i(a,s){return n(o(a,s))}}),3508:(function(e,t,r){var o=r(6852);o=o.slice().filter(function(n){return!/^(gl\_|texture)/.test(n)}),e.exports=o.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])}),3536:(function(e){e.exports=t;function t(r,o){var n=o[0],i=o[1],a=o[2],s=n*n+i*i+a*a;return s>0&&(s=1/Math.sqrt(s),r[0]=o[0]*s,r[1]=o[1]*s,r[2]=o[2]*s),r}}),3545:(function(e,t,r){e.exports=s;var o=r(8105),n=o("lop&&T[w+c]>M;--_,w-=g){for(var m=w,u=w+g,v=0;v>>1,M=2*f,_=A,w=T[M*A+c];g=I?(_=y,w=I):v>=z?(_=u,w=v):(_=L,w=z):I>=z?(_=y,w=I):z>=v?(_=u,w=v):(_=L,w=z);for(var B=M*(x-1),R=M*_,F=0;Fthis.buffer.length){n.free(this.buffer);for(var x=this.buffer=n.mallocUint8(a(g*l*4)),A=0;A_|0},vertex:function(x,A,M,_,w,m,u,v,y,I,L,z,F){var N=(u<<0)+(v<<1)+(y<<2)+(I<<3)|0;if(!(N===0||N===15))switch(N){case 0:L.push([x-.5,A-.5]);break;case 1:L.push([x-.25-.25*(_+M-2*F)/(M-_),A-.25-.25*(w+M-2*F)/(M-w)]);break;case 2:L.push([x-.75-.25*(-_-M+2*F)/(_-M),A-.25-.25*(m+_-2*F)/(_-m)]);break;case 3:L.push([x-.5,A-.5-.5*(w+M+m+_-4*F)/(M-w+_-m)]);break;case 4:L.push([x-.25-.25*(m+w-2*F)/(w-m),A-.75-.25*(-w-M+2*F)/(w-M)]);break;case 5:L.push([x-.5-.5*(_+M+m+w-4*F)/(M-_+w-m),A-.5]);break;case 6:L.push([x-.5-.25*(-_-M+m+w)/(_-M+w-m),A-.5-.25*(-w-M+m+_)/(w-M+_-m)]);break;case 7:L.push([x-.75-.25*(m+w-2*F)/(w-m),A-.75-.25*(m+_-2*F)/(_-m)]);break;case 8:L.push([x-.75-.25*(-m-w+2*F)/(m-w),A-.75-.25*(-m-_+2*F)/(m-_)]);break;case 9:L.push([x-.5-.25*(_+M+-m-w)/(M-_+m-w),A-.5-.25*(w+M+-m-_)/(M-w+m-_)]);break;case 10:L.push([x-.5-.5*(-_-M+-m-w+4*F)/(_-M+m-w),A-.5]);break;case 11:L.push([x-.25-.25*(-m-w+2*F)/(m-w),A-.75-.25*(w+M-2*F)/(M-w)]);break;case 12:L.push([x-.5,A-.5-.5*(-w-M+-m-_+4*F)/(w-M+m-_)]);break;case 13:L.push([x-.75-.25*(_+M-2*F)/(M-_),A-.25-.25*(-m-_+2*F)/(m-_)]);break;case 14:L.push([x-.25-.25*(-_-M+2*F)/(_-M),A-.25-.25*(-w-M+2*F)/(w-M)]);break;case 15:L.push([x-.5,A-.5]);break}},cell:function(x,A,M,_,w,m,u,v,y){w?v.push([x,A]):v.push([A,x])}});return function(g,x){var A=[],M=[];return l(g,A,M,x),{positions:A,cells:M}}}};function a(p,d){var T=p.length+"d",l=i[T];if(l)return l(o,p,d)}function s(p,d){for(var T=n(p,d),l=T.length,g=new Array(l),x=new Array(l),A=0;A>1,T=-7,l=n?a-1:0,g=n?-1:1,x=r[o+l];for(l+=g,s=x&(1<<-T)-1,x>>=-T,T+=c;T>0;s=s*256+r[o+l],l+=g,T-=8);for(f=s&(1<<-T)-1,s>>=-T,T+=i;T>0;f=f*256+r[o+l],l+=g,T-=8);if(s===0)s=1-d;else{if(s===p)return f?NaN:(x?-1:1)*(1/0);f=f+Math.pow(2,i),s=s-d}return(x?-1:1)*f*Math.pow(2,s-i)},t.write=function(r,o,n,i,a,s){var f,c,p,d=s*8-a-1,T=(1<>1,g=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:s-1,A=i?1:-1,M=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(c=isNaN(o)?1:0,f=T):(f=Math.floor(Math.log(o)/Math.LN2),o*(p=Math.pow(2,-f))<1&&(f--,p*=2),f+l>=1?o+=g/p:o+=g*Math.pow(2,1-l),o*p>=2&&(f++,p/=2),f+l>=T?(c=0,f=T):f+l>=1?(c=(o*p-1)*Math.pow(2,a),f=f+l):(c=o*Math.pow(2,l-1)*Math.pow(2,a),f=0));a>=8;r[n+x]=c&255,x+=A,c/=256,a-=8);for(f=f<0;r[n+x]=f&255,x+=A,f/=256,d-=8);r[n+x-A]|=M*128}}),3788:(function(e,t,r){var o=r(8507),n=r(2419);e.exports=i;function i(a,s){return o(a,s)||n(a)-n(s)}}),3837:(function(e,t,r){e.exports=L;var o=r(4935),n=r(501),i=r(5304),a=r(6429),s=r(6444),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,p=DataView;function d(z){return c.isView(z)&&!(z instanceof p)}function T(z){return Array.isArray(z)||d(z)}function l(z,F){return z[0]=F[0],z[1]=F[1],z[2]=F[2],z}function g(z){this.gl=z,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=i(z)}var x=g.prototype;x.update=function(z){z=z||{};function F(K,ue,te){if(te in z){var H=z[te],ae=this[te],ie;(K?T(H)&&T(H[0]):T(H))?this[te]=ie=[ue(H[0]),ue(H[1]),ue(H[2])]:this[te]=ie=[ue(H),ue(H),ue(H)];for(var ve=0;ve<3;++ve)if(ie[ve]!==ae[ve])return!0}return!1}var N=F.bind(this,!1,Number),B=F.bind(this,!1,Boolean),R=F.bind(this,!1,String),U=F.bind(this,!0,function(K){if(T(K)){if(K.length===3)return[+K[0],+K[1],+K[2],1];if(K.length===4)return[+K[0],+K[1],+K[2],+K[3]]}return[0,0,0,1]}),j,Z=!1,re=!1;if("bounds"in z)for(var fe=z.bounds,le=0;le<2;++le)for(var ce=0;ce<3;++ce)fe[le][ce]!==this.bounds[le][ce]&&(re=!0),this.bounds[le][ce]=fe[le][ce];if("ticks"in z){j=z.ticks,Z=!0,this.autoTicks=!1;for(var le=0;le<3;++le)this.tickSpacing[le]=0}else N("tickSpacing")&&(this.autoTicks=!0,re=!0);if(this._firstInit&&("ticks"in z||"tickSpacing"in z||(this.autoTicks=!0),re=!0,Z=!0,this._firstInit=!1),re&&this.autoTicks&&(j=s.create(this.bounds,this.tickSpacing),Z=!0),Z){for(var le=0;le<3;++le)j[le].sort(function(ue,te){return ue.x-te.x});s.equal(j,this.ticks)?Z=!1:this.ticks=j}B("tickEnable"),R("tickFont")&&(Z=!0),R("tickFontStyle")&&(Z=!0),R("tickFontWeight")&&(Z=!0),R("tickFontVariant")&&(Z=!0),N("tickSize"),N("tickAngle"),N("tickPad"),U("tickColor");var V=R("labels");R("labelFont")&&(V=!0),R("labelFontStyle")&&(V=!0),R("labelFontWeight")&&(V=!0),R("labelFontVariant")&&(V=!0),B("labelEnable"),N("labelSize"),N("labelPad"),U("labelColor"),B("lineEnable"),B("lineMirror"),N("lineWidth"),U("lineColor"),B("lineTickEnable"),B("lineTickMirror"),N("lineTickLength"),N("lineTickWidth"),U("lineTickColor"),B("gridEnable"),N("gridWidth"),U("gridColor"),B("zeroEnable"),U("zeroLineColor"),N("zeroLineWidth"),B("backgroundEnable"),U("backgroundColor");var ee=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],ne=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(V||Z)&&this._text.update(this.bounds,this.labels,ee,this.ticks,ne):this._text=o(this.gl,this.bounds,this.labels,ee,this.ticks,ne),this._lines&&Z&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=n(this.gl,this.bounds,this.ticks))};function A(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var M=[new A,new A,new A];function _(z,F,N,B,R){for(var U=z.primalOffset,j=z.primalMinor,Z=z.mirrorOffset,re=z.mirrorMinor,fe=B[F],le=0;le<3;++le)if(F!==le){var ce=U,V=Z,ee=j,ne=re;fe&1<0?(ee[le]=-1,ne[le]=0):(ee[le]=0,ne[le]=1)}}var w=[0,0,0],m={model:f,view:f,projection:f,_ortho:!1};x.isOpaque=function(){return!0},x.isTransparent=function(){return!1},x.drawTransparent=function(z){};var u=0,v=[0,0,0],y=[0,0,0],I=[0,0,0];x.draw=function(z){z=z||m;for(var te=this.gl,F=z.model||f,N=z.view||f,B=z.projection||f,R=this.bounds,U=z._ortho||!1,j=a(F,N,B,R,U),Z=j.cubeEdges,re=j.axis,fe=N[12],le=N[13],ce=N[14],V=N[15],ee=U?2:1,ne=ee*this.pixelRatio*(B[3]*fe+B[7]*le+B[11]*ce+B[15]*V)/te.drawingBufferHeight,K=0;K<3;++K)this.lastCubeProps.cubeEdges[K]=Z[K],this.lastCubeProps.axis[K]=re[K];for(var ue=M,K=0;K<3;++K)_(M[K],K,this.bounds,Z,re);for(var te=this.gl,H=w,K=0;K<3;++K)this.backgroundEnable[K]?H[K]=re[K]:H[K]=0;this._background.draw(F,N,B,R,H,this.backgroundColor),this._lines.bind(F,N,B,this);for(var K=0;K<3;++K){var ae=[0,0,0];re[K]>0?ae[K]=R[1][K]:ae[K]=R[0][K];for(var ie=0;ie<2;++ie){var ve=(K+1+ie)%3,Ae=(K+1+(ie^1))%3;this.gridEnable[ve]&&this._lines.drawGrid(ve,Ae,this.bounds,ae,this.gridColor[ve],this.gridWidth[ve]*this.pixelRatio)}for(var ie=0;ie<2;++ie){var ve=(K+1+ie)%3,Ae=(K+1+(ie^1))%3;this.zeroEnable[Ae]&&Math.min(R[0][Ae],R[1][Ae])<=0&&Math.max(R[0][Ae],R[1][Ae])>=0&&this._lines.drawZero(ve,Ae,this.bounds,ae,this.zeroLineColor[Ae],this.zeroLineWidth[Ae]*this.pixelRatio)}}for(var K=0;K<3;++K){this.lineEnable[K]&&this._lines.drawAxisLine(K,this.bounds,ue[K].primalOffset,this.lineColor[K],this.lineWidth[K]*this.pixelRatio),this.lineMirror[K]&&this._lines.drawAxisLine(K,this.bounds,ue[K].mirrorOffset,this.lineColor[K],this.lineWidth[K]*this.pixelRatio);for(var Ce=l(v,ue[K].primalMinor),Fe=l(y,ue[K].mirrorMinor),ze=this.lineTickLength,ie=0;ie<3;++ie){var Ye=ne/F[5*ie];Ce[ie]*=ze[ie]*Ye,Fe[ie]*=ze[ie]*Ye}this.lineTickEnable[K]&&this._lines.drawAxisTicks(K,ue[K].primalOffset,Ce,this.lineTickColor[K],this.lineTickWidth[K]*this.pixelRatio),this.lineTickMirror[K]&&this._lines.drawAxisTicks(K,ue[K].mirrorOffset,Fe,this.lineTickColor[K],this.lineTickWidth[K]*this.pixelRatio)}this._lines.unbind(),this._text.bind(F,N,B,this.pixelRatio);var it,st=.5,nt,Qe;function Le(rt){Qe=[0,0,0],Qe[rt]=1}function Te(rt,Ft,Nt){var $t=(rt+1)%3,rr=(rt+2)%3,Er=Ft[$t],Mr=Ft[rr],Wr=Nt[$t],Sr=Nt[rr];if(Er>0&&Sr>0){Le($t);return}else if(Er>0&&Sr<0){Le($t);return}else if(Er<0&&Sr>0){Le($t);return}else if(Er<0&&Sr<0){Le($t);return}else if(Mr>0&&Wr>0){Le(rr);return}else if(Mr>0&&Wr<0){Le(rr);return}else if(Mr<0&&Wr>0){Le(rr);return}else if(Mr<0&&Wr<0){Le(rr);return}}for(var K=0;K<3;++K){for(var pe=ue[K].primalMinor,Ne=ue[K].mirrorMinor,ot=l(I,ue[K].primalOffset),ie=0;ie<3;++ie)this.lineTickEnable[K]&&(ot[ie]+=ne*pe[ie]*Math.max(this.lineTickLength[ie],0)/F[5*ie]);var ft=[0,0,0];if(ft[K]=1,this.tickEnable[K]){this.tickAngle[K]===-3600?(this.tickAngle[K]=0,this.tickAlign[K]="auto"):this.tickAlign[K]=-1,nt=1,it=[this.tickAlign[K],st,nt],it[0]==="auto"?it[0]=u:it[0]=parseInt(""+it[0]),Qe=[0,0,0],Te(K,pe,Ne);for(var ie=0;ie<3;++ie)ot[ie]+=ne*pe[ie]*this.tickPad[ie]/F[5*ie];this._text.drawTicks(K,this.tickSize[K],this.tickAngle[K],ot,this.tickColor[K],ft,Qe,it)}if(this.labelEnable[K]){nt=0,Qe=[0,0,0],this.labels[K].length>4&&(Le(K),nt=1),it=[this.labelAlign[K],st,nt],it[0]==="auto"?it[0]=u:it[0]=parseInt(""+it[0]);for(var ie=0;ie<3;++ie)ot[ie]+=ne*pe[ie]*this.labelPad[ie]/F[5*ie];ot[K]+=.5*(R[0][K]+R[1][K]),this._text.drawLabel(K,this.labelSize[K],this.labelAngle[K],ot,this.labelColor[K],[0,0,0],Qe,it)}}this._text.unbind()},x.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function L(z,F){var N=new g(z);return N.update(F),N}}),3840:(function(e){e.exports=M;var t=0,r=1;function o(_,w,m,u,v,y){this._color=_,this.key=w,this.value=m,this.left=u,this.right=v,this._count=y}function n(_){return new o(_._color,_.key,_.value,_.left,_.right,_._count)}function i(_,w){return new o(_,w.key,w.value,w.left,w.right,w._count)}function a(_){_._count=1+(_.left?_.left._count:0)+(_.right?_.right._count:0)}function s(_,w){this._compare=_,this.root=w}var f=s.prototype;Object.defineProperty(f,"keys",{get:function(){var _=[];return this.forEach(function(w,m){_.push(w)}),_}}),Object.defineProperty(f,"values",{get:function(){var _=[];return this.forEach(function(w,m){_.push(m)}),_}}),Object.defineProperty(f,"length",{get:function(){return this.root?this.root._count:0}}),f.insert=function(_,w){for(var m=this._compare,u=this.root,v=[],y=[];u;){var I=m(_,u.key);v.push(u),y.push(I),I<=0?u=u.left:u=u.right}v.push(new o(t,_,w,null,null,1));for(var L=v.length-2;L>=0;--L){var u=v[L];y[L]<=0?v[L]=new o(u._color,u.key,u.value,v[L+1],u.right,u._count+1):v[L]=new o(u._color,u.key,u.value,u.left,v[L+1],u._count+1)}for(var L=v.length-1;L>1;--L){var z=v[L-1],u=v[L];if(z._color===r||u._color===r)break;var F=v[L-2];if(F.left===z)if(z.left===u){var N=F.right;if(N&&N._color===t)z._color=r,F.right=i(r,N),F._color=t,L-=1;else{if(F._color=t,F.left=z.right,z._color=r,z.right=F,v[L-2]=z,v[L-1]=u,a(F),a(z),L>=3){var B=v[L-3];B.left===F?B.left=z:B.right=z}break}}else{var N=F.right;if(N&&N._color===t)z._color=r,F.right=i(r,N),F._color=t,L-=1;else{if(z.right=u.left,F._color=t,F.left=u.right,u._color=r,u.left=z,u.right=F,v[L-2]=u,v[L-1]=z,a(F),a(z),a(u),L>=3){var B=v[L-3];B.left===F?B.left=u:B.right=u}break}}else if(z.right===u){var N=F.left;if(N&&N._color===t)z._color=r,F.left=i(r,N),F._color=t,L-=1;else{if(F._color=t,F.right=z.left,z._color=r,z.left=F,v[L-2]=z,v[L-1]=u,a(F),a(z),L>=3){var B=v[L-3];B.right===F?B.right=z:B.left=z}break}}else{var N=F.left;if(N&&N._color===t)z._color=r,F.left=i(r,N),F._color=t,L-=1;else{if(z.left=u.right,F._color=t,F.right=u.left,u._color=r,u.right=z,u.left=F,v[L-2]=u,v[L-1]=z,a(F),a(z),a(u),L>=3){var B=v[L-3];B.right===F?B.right=u:B.left=u}break}}}return v[0]._color=r,new s(m,v[0])};function c(_,w){if(w.left){var m=c(_,w.left);if(m)return m}var m=_(w.key,w.value);if(m)return m;if(w.right)return c(_,w.right)}function p(_,w,m,u){var v=w(_,u.key);if(v<=0){if(u.left){var y=p(_,w,m,u.left);if(y)return y}var y=m(u.key,u.value);if(y)return y}if(u.right)return p(_,w,m,u.right)}function d(_,w,m,u,v){var y=m(_,v.key),I=m(w,v.key),L;if(y<=0&&(v.left&&(L=d(_,w,m,u,v.left),L)||I>0&&(L=u(v.key,v.value),L)))return L;if(I>0&&v.right)return d(_,w,m,u,v.right)}f.forEach=function(w,m,u){if(this.root)switch(arguments.length){case 1:return c(w,this.root);case 2:return p(m,this._compare,w,this.root);case 3:return this._compare(m,u)>=0?void 0:d(m,u,this._compare,w,this.root)}},Object.defineProperty(f,"begin",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.left;return new T(this,_)}}),Object.defineProperty(f,"end",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.right;return new T(this,_)}}),f.at=function(_){if(_<0)return new T(this,[]);for(var w=this.root,m=[];;){if(m.push(w),w.left){if(_=w.right._count)break;w=w.right}else break}return new T(this,[])},f.ge=function(_){for(var w=this._compare,m=this.root,u=[],v=0;m;){var y=w(_,m.key);u.push(m),y<=0&&(v=u.length),y<=0?m=m.left:m=m.right}return u.length=v,new T(this,u)},f.gt=function(_){for(var w=this._compare,m=this.root,u=[],v=0;m;){var y=w(_,m.key);u.push(m),y<0&&(v=u.length),y<0?m=m.left:m=m.right}return u.length=v,new T(this,u)},f.lt=function(_){for(var w=this._compare,m=this.root,u=[],v=0;m;){var y=w(_,m.key);u.push(m),y>0&&(v=u.length),y<=0?m=m.left:m=m.right}return u.length=v,new T(this,u)},f.le=function(_){for(var w=this._compare,m=this.root,u=[],v=0;m;){var y=w(_,m.key);u.push(m),y>=0&&(v=u.length),y<0?m=m.left:m=m.right}return u.length=v,new T(this,u)},f.find=function(_){for(var w=this._compare,m=this.root,u=[];m;){var v=w(_,m.key);if(u.push(m),v===0)return new T(this,u);v<=0?m=m.left:m=m.right}return new T(this,[])},f.remove=function(_){var w=this.find(_);return w?w.remove():this},f.get=function(_){for(var w=this._compare,m=this.root;m;){var u=w(_,m.key);if(u===0)return m.value;u<=0?m=m.left:m=m.right}};function T(_,w){this.tree=_,this._stack=w}var l=T.prototype;Object.defineProperty(l,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(l,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),l.clone=function(){return new T(this.tree,this._stack.slice())};function g(_,w){_.key=w.key,_.value=w.value,_.left=w.left,_.right=w.right,_._color=w._color,_._count=w._count}function x(_){for(var w,m,u,v,y=_.length-1;y>=0;--y){if(w=_[y],y===0){w._color=r;return}if(m=_[y-1],m.left===w){if(u=m.right,u.right&&u.right._color===t){if(u=m.right=n(u),v=u.right=n(u.right),m.right=u.left,u.left=m,u.right=v,u._color=m._color,w._color=r,m._color=r,v._color=r,a(m),a(u),y>1){var I=_[y-2];I.left===m?I.left=u:I.right=u}_[y-1]=u;return}else if(u.left&&u.left._color===t){if(u=m.right=n(u),v=u.left=n(u.left),m.right=v.left,u.left=v.right,v.left=m,v.right=u,v._color=m._color,m._color=r,u._color=r,w._color=r,a(m),a(u),a(v),y>1){var I=_[y-2];I.left===m?I.left=v:I.right=v}_[y-1]=v;return}if(u._color===r)if(m._color===t){m._color=r,m.right=i(t,u);return}else{m.right=i(t,u);continue}else{if(u=n(u),m.right=u.left,u.left=m,u._color=m._color,m._color=t,a(m),a(u),y>1){var I=_[y-2];I.left===m?I.left=u:I.right=u}_[y-1]=u,_[y]=m,y+1<_.length?_[y+1]=w:_.push(w),y=y+2}}else{if(u=m.left,u.left&&u.left._color===t){if(u=m.left=n(u),v=u.left=n(u.left),m.left=u.right,u.right=m,u.left=v,u._color=m._color,w._color=r,m._color=r,v._color=r,a(m),a(u),y>1){var I=_[y-2];I.right===m?I.right=u:I.left=u}_[y-1]=u;return}else if(u.right&&u.right._color===t){if(u=m.left=n(u),v=u.right=n(u.right),m.left=v.right,u.right=v.left,v.right=m,v.left=u,v._color=m._color,m._color=r,u._color=r,w._color=r,a(m),a(u),a(v),y>1){var I=_[y-2];I.right===m?I.right=v:I.left=v}_[y-1]=v;return}if(u._color===r)if(m._color===t){m._color=r,m.left=i(t,u);return}else{m.left=i(t,u);continue}else{if(u=n(u),m.left=u.right,u.right=m,u._color=m._color,m._color=t,a(m),a(u),y>1){var I=_[y-2];I.right===m?I.right=u:I.left=u}_[y-1]=u,_[y]=m,y+1<_.length?_[y+1]=w:_.push(w),y=y+2}}}}l.remove=function(){var _=this._stack;if(_.length===0)return this.tree;var w=new Array(_.length),m=_[_.length-1];w[w.length-1]=new o(m._color,m.key,m.value,m.left,m.right,m._count);for(var u=_.length-2;u>=0;--u){var m=_[u];m.left===_[u+1]?w[u]=new o(m._color,m.key,m.value,w[u+1],m.right,m._count):w[u]=new o(m._color,m.key,m.value,m.left,w[u+1],m._count)}if(m=w[w.length-1],m.left&&m.right){var v=w.length;for(m=m.left;m.right;)w.push(m),m=m.right;var y=w[v-1];w.push(new o(m._color,y.key,y.value,m.left,m.right,m._count)),w[v-1].key=m.key,w[v-1].value=m.value;for(var u=w.length-2;u>=v;--u)m=w[u],w[u]=new o(m._color,m.key,m.value,m.left,w[u+1],m._count);w[v-1].left=w[v]}if(m=w[w.length-1],m._color===t){var I=w[w.length-2];I.left===m?I.left=null:I.right===m&&(I.right=null),w.pop();for(var u=0;u0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var _=0,w=this._stack;if(w.length===0){var m=this.tree.root;return m?m._count:0}else w[w.length-1].left&&(_=w[w.length-1].left._count);for(var u=w.length-2;u>=0;--u)w[u+1]===w[u].right&&(++_,w[u].left&&(_+=w[u].left._count));return _},enumerable:!0}),l.next=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.right)for(w=w.right;w;)_.push(w),w=w.left;else for(_.pop();_.length>0&&_[_.length-1].right===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].right)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].left===_[w])return!0;return!1}}),l.update=function(_){var w=this._stack;if(w.length===0)throw new Error("Can't update empty node!");var m=new Array(w.length),u=w[w.length-1];m[m.length-1]=new o(u._color,u.key,_,u.left,u.right,u._count);for(var v=w.length-2;v>=0;--v)u=w[v],u.left===w[v+1]?m[v]=new o(u._color,u.key,u.value,m[v+1],u.right,u._count):m[v]=new o(u._color,u.key,u.value,u.left,m[v+1],u._count);return new s(this.tree._compare,m[0])},l.prev=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.left)for(w=w.left;w;)_.push(w),w=w.right;else for(_.pop();_.length>0&&_[_.length-1].left===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].left)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].right===_[w])return!0;return!1}});function A(_,w){return _w?1:0}function M(_){return new s(_||A,null)}}),3865:(function(e,t,r){var o=r(869);e.exports=n;function n(i,a){return o(i[0].mul(a[1]).add(a[0].mul(i[1])),i[1].mul(a[1]))}}),3952:(function(e,t,r){e.exports=i;var o=r(3250);function n(a,s){for(var f=new Array(s+1),c=0;c20?52:f+32}}),4040:(function(e){e.exports=t;function t(r,o,n,i,a,s,f){var c=1/(o-n),p=1/(i-a),d=1/(s-f);return r[0]=-2*c,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*p,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*d,r[11]=0,r[12]=(o+n)*c,r[13]=(a+i)*p,r[14]=(f+s)*d,r[15]=1,r}}),4041:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=n[0],c=n[1],p=n[2],d=n[3],T=d*i+c*s-p*a,l=d*a+p*i-f*s,g=d*s+f*a-c*i,x=-f*i-c*a-p*s;return r[0]=T*d+x*-f+l*-p-g*-c,r[1]=l*d+x*-c+g*-f-T*-p,r[2]=g*d+x*-p+T*-c-l*-f,r[3]=o[3],r}}),4081:(function(e){e.exports=t;function t(r,o,n,i,a,s,f,c,p,d){var T=o+s+d;if(l>0){var l=Math.sqrt(T+1);r[0]=.5*(f-p)/l,r[1]=.5*(c-i)/l,r[2]=.5*(n-s)/l,r[3]=.5*l}else{var g=Math.max(o,s,d),l=Math.sqrt(2*g-T+1);o>=g?(r[0]=.5*l,r[1]=.5*(a+n)/l,r[2]=.5*(c+i)/l,r[3]=.5*(f-p)/l):s>=g?(r[0]=.5*(n+a)/l,r[1]=.5*l,r[2]=.5*(p+f)/l,r[3]=.5*(c-i)/l):(r[0]=.5*(i+c)/l,r[1]=.5*(f+p)/l,r[2]=.5*l,r[3]=.5*(n-a)/l)}return r}}),4100:(function(e,t,r){var o=r(4437),n=r(3837),i=r(5445),a=r(4449),s=r(3589),f=r(2260),c=r(7169),p=r(351),d=r(4772),T=r(4040),l=r(799),g=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:w,createCamera:o};function x(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function A(u,v){var y=null;try{y=u.getContext("webgl",v),y||(y=u.getContext("experimental-webgl",v))}catch{return null}return y}function M(u){var v=Math.round(Math.log(Math.abs(u))/Math.log(10));if(v<0){var y=Math.round(Math.pow(10,-v));return Math.ceil(u*y)/y}else if(v>0){var y=Math.round(Math.pow(10,v));return Math.ceil(u/y)*y}return Math.ceil(u)}function _(u){return typeof u=="boolean"?u:!0}function w(u){u=u||{},u.camera=u.camera||{};var v=u.canvas;if(!v)if(v=document.createElement("canvas"),u.container){var y=u.container;y.appendChild(v)}else document.body.appendChild(v);var I=u.gl;if(I||(u.glOptions&&(g=!!u.glOptions.preserveDrawingBuffer),I=A(v,u.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:g})),!I)throw new Error("webgl not supported");var L=u.bounds||[[-10,-10,-10],[10,10,10]],z=new x,F=f(I,I.drawingBufferWidth,I.drawingBufferHeight,{preferFloat:!g}),N=l(I),B=u.cameraObject&&u.cameraObject._ortho===!0||u.camera.projection&&u.camera.projection.type==="orthographic"||!1,R={eye:u.camera.eye||[2,0,0],center:u.camera.center||[0,0,0],up:u.camera.up||[0,1,0],zoomMin:u.camera.zoomMax||.1,zoomMax:u.camera.zoomMin||100,mode:u.camera.mode||"turntable",_ortho:B},U=u.axes||{},j=n(I,U);j.enable=!U.disable;var Z=u.spikes||{},re=a(I,Z),fe=[],le=[],ce=[],V=[],ee=!0,te=!0,ne=new Array(16),K=new Array(16),ue={view:null,projection:ne,model:K,_ortho:!1},te=!0,H=[I.drawingBufferWidth,I.drawingBufferHeight],ae=u.cameraObject||o(v,R),ie={gl:I,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:v,selection:z,camera:ae,axes:j,axesPixels:null,spikes:re,bounds:L,objects:fe,shape:H,aspect:u.aspectRatio||[1,1,1],pickRadius:u.pickRadius||10,zNear:u.zNear||.01,zFar:u.zFar||1e3,fovy:u.fovy||Math.PI/4,clearColor:u.clearColor||[0,0,0,0],autoResize:_(u.autoResize),autoBounds:_(u.autoBounds),autoScale:!!u.autoScale,autoCenter:_(u.autoCenter),clipToBounds:_(u.clipToBounds),snapToData:!!u.snapToData,onselect:u.onselect||null,onrender:u.onrender||null,onclick:u.onclick||null,cameraParams:ue,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(Qe){this.aspect[0]=Qe.x,this.aspect[1]=Qe.y,this.aspect[2]=Qe.z,te=!0},setBounds:function(Qe,Le){this.bounds[0][Qe]=Le.min,this.bounds[1][Qe]=Le.max},setClearColor:function(Qe){this.clearColor=Qe},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},ve=[I.drawingBufferWidth/ie.pixelRatio|0,I.drawingBufferHeight/ie.pixelRatio|0];function Ae(){if(!ie._stopped&&ie.autoResize){var Qe=v.parentNode,Le=1,Te=1;Qe&&Qe!==document.body?(Le=Qe.clientWidth,Te=Qe.clientHeight):(Le=window.innerWidth,Te=window.innerHeight);var pe=Math.ceil(Le*ie.pixelRatio)|0,Ne=Math.ceil(Te*ie.pixelRatio)|0;if(pe!==v.width||Ne!==v.height){v.width=pe,v.height=Ne;var ot=v.style;ot.position=ot.position||"absolute",ot.left="0px",ot.top="0px",ot.width=Le+"px",ot.height=Te+"px",ee=!0}}}ie.autoResize&&Ae(),window.addEventListener("resize",Ae);function Ce(){for(var Qe=fe.length,Le=V.length,Te=0;Te0&&ce[Le-1]===0;)ce.pop(),V.pop().dispose()}ie.update=function(Qe){ie._stopped||(ee=!0,te=!0)},ie.add=function(Qe){ie._stopped||(Qe.axes=j,fe.push(Qe),le.push(-1),ee=!0,te=!0,Ce())},ie.remove=function(Qe){if(!ie._stopped){var Le=fe.indexOf(Qe);Le<0||(fe.splice(Le,1),le.pop(),ee=!0,te=!0,Ce())}},ie.dispose=function(){if(!ie._stopped&&(ie._stopped=!0,window.removeEventListener("resize",Ae),v.removeEventListener("webglcontextlost",Fe),ie.mouseListener.enabled=!1,!ie.contextLost)){j.dispose(),re.dispose();for(var Qe=0;Qez.distance)continue;for(var Nt=0;Ntd;){var m=l[w-2],u=l[w-1];if(ml[T+1]:!0}function c(d,T,l,g){d*=2;var x=g[d];return x>1,_=M-g,w=M+g,m=x,u=_,v=M,y=w,I=A,L=d+1,z=T-1,F=0;f(m,u,l)&&(F=m,m=u,u=F),f(y,I,l)&&(F=y,y=I,I=F),f(m,v,l)&&(F=m,m=v,v=F),f(u,v,l)&&(F=u,u=v,v=F),f(m,y,l)&&(F=m,m=y,y=F),f(v,y,l)&&(F=v,v=y,y=F),f(u,I,l)&&(F=u,u=I,I=F),f(u,v,l)&&(F=u,u=v,v=F),f(y,I,l)&&(F=y,y=I,I=F);for(var N=l[2*u],B=l[2*u+1],R=l[2*y],U=l[2*y+1],j=2*m,Z=2*v,re=2*I,fe=2*x,le=2*M,ce=2*A,V=0;V<2;++V){var ee=l[j+V],ne=l[Z+V],K=l[re+V];l[fe+V]=ee,l[le+V]=ne,l[ce+V]=K}i(_,d,l),i(w,T,l);for(var ue=L;ue<=z;++ue)if(c(ue,N,B,l))ue!==L&&n(ue,L,l),++L;else if(!c(ue,R,U,l))for(;;)if(c(z,R,U,l)){c(z,N,B,l)?(a(ue,L,z,l),++L,--z):(n(ue,z,l),--z);break}else{if(--z0)if(x[0]!==M[1][0])A=g,g=g.right;else{var u=p(g.right,x);if(u)return u;g=g.left}else{if(x[0]!==M[1][0])return g;var u=p(g.right,x);if(u)return u;g=g.left}}return A}f.castUp=function(g){var x=o.le(this.coordinates,g[0]);if(x<0)return-1;this.slabs[x];var A=p(this.slabs[x],g),M=-1;if(A&&(M=A.value),this.coordinates[x]===g[0]){var _=null;if(A&&(_=A.key),x>0){var w=p(this.slabs[x-1],g);w&&(_?a(w.key,_)>0&&(_=w.key,M=w.value):(M=w.value,_=w.key))}var m=this.horizontal[x];if(m.length>0){var u=o.ge(m,g[1],c);if(u=m.length)return M;v=m[u]}}if(v.start)if(_){var y=i(_[0],_[1],[g[0],v.y]);_[0][0]>_[1][0]&&(y=-y),y>0&&(M=v.index)}else M=v.index;else v.y!==g[1]&&(M=v.index)}}}return M};function d(g,x,A,M){this.y=g,this.index=x,this.start=A,this.closed=M}function T(g,x,A,M){this.x=g,this.segment=x,this.create=A,this.index=M}function l(g){for(var x=g.length,A=2*x,M=new Array(A),_=0;_Math.abs(u))l.rotate(I,0,0,-m*v*Math.PI*_.rotateSpeed/window.innerWidth);else if(!_._ortho){var L=-_.zoomSpeed*y*u/window.innerHeight*(I-l.lastT())/20;l.pan(I,0,0,x*(Math.exp(L)-1))}}},!0)},_.enableMouseListeners(),_}}),4449:(function(e,t,r){var o=r(2762),n=r(8116),i=r(1493);e.exports=T;var a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,g,x,A){this.gl=l,this.buffer=g,this.vao=x,this.shader=A,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var f=s.prototype,c=[0,0,0],p=[0,0,0],d=[0,0];f.isTransparent=function(){return!1},f.drawTransparent=function(l){},f.draw=function(l){var g=this.gl,x=this.vao,A=this.shader;x.bind(),A.bind();var M=l.model||a,_=l.view||a,w=l.projection||a,m;this.axes&&(m=this.axes.lastCubeProps.axis);for(var u=c,v=p,y=0;y<3;++y)m&&m[y]<0?(u[y]=this.bounds[0][y],v[y]=this.bounds[1][y]):(u[y]=this.bounds[1][y],v[y]=this.bounds[0][y]);d[0]=g.drawingBufferWidth,d[1]=g.drawingBufferHeight,A.uniforms.model=M,A.uniforms.view=_,A.uniforms.projection=w,A.uniforms.coordinates=[this.position,u,v],A.uniforms.colors=this.colors,A.uniforms.screenShape=d;for(var y=0;y<3;++y)A.uniforms.lineWidth=this.lineWidth[y]*this.pixelRatio,this.enabled[y]&&(x.draw(g.TRIANGLES,6,6*y),this.drawSides[y]&&x.draw(g.TRIANGLES,12,18+12*y));x.unbind()},f.update=function(l){l&&("bounds"in l&&(this.bounds=l.bounds),"position"in l&&(this.position=l.position),"lineWidth"in l&&(this.lineWidth=l.lineWidth),"colors"in l&&(this.colors=l.colors),"enabled"in l&&(this.enabled=l.enabled),"drawSides"in l&&(this.drawSides=l.drawSides))},f.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function T(l,g){var x=[];function A(u,v,y,I,L,z){var F=[u,v,y,0,0,0,1];F[I+3]=1,F[I]=L,x.push.apply(x,F),F[6]=-1,x.push.apply(x,F),F[I]=z,x.push.apply(x,F),x.push.apply(x,F),F[6]=1,x.push.apply(x,F),F[I]=L,x.push.apply(x,F)}A(0,0,0,0,0,1),A(0,0,0,1,0,1),A(0,0,0,2,0,1),A(1,0,0,1,-1,1),A(1,0,0,2,-1,1),A(0,1,0,0,-1,1),A(0,1,0,2,-1,1),A(0,0,1,0,-1,1),A(0,0,1,1,-1,1);var M=o(l,x),_=n(l,[{type:l.FLOAT,buffer:M,size:3,offset:0,stride:28},{type:l.FLOAT,buffer:M,size:3,offset:12,stride:28},{type:l.FLOAT,buffer:M,size:1,offset:24,stride:28}]),w=i(l);w.attributes.position.location=0,w.attributes.color.location=1,w.attributes.weight.location=2;var m=new s(l,M,_,w);return m.update(g),m}}),4494:(function(e){e.exports=t;function t(r,o){return r[0]=1/o[0],r[1]=1/o[1],r[2]=1/o[2],r[3]=1/o[3],r}}),4505:(function(e,t,r){e.exports=r(5847)}),4578:(function(e){e.exports=t;function t(r,o,n,i,a){return r[0]=o,r[1]=n,r[2]=i,r[3]=a,r}}),4623:(function(e){"use restrict";e.exports=t;function t(r){this.roots=new Array(r),this.ranks=new Array(r);for(var o=0;o0)return 1<=0)return 1<=0;--l)f[l]=c*o[l]+p*n[l]+d*i[l]+T*a[l];return f}return c*o+p*n+d*i[l]+T*a}function r(o,n,i,a,s,f){var c=s-1,p=s*s,d=c*c,T=(1+2*s)*d,l=s*d,g=p*(3-2*s),x=p*c;if(o.length){f||(f=new Array(o.length));for(var A=o.length-1;A>=0;--A)f[A]=T*o[A]+l*n[A]+g*i[A]+x*a[A];return f}return T*o+l*n+g*i+x*a}e.exports=r,e.exports.derivative=t}),4772:(function(e){e.exports=t;function t(r,o,n,i,a){var s=1/Math.tan(o/2),f=1/(i-a);return r[0]=s/n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(a+i)*f,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*a*i*f,r[15]=0,r}}),4793:(function(e,t,r){function o(xe,ye){if(!(xe instanceof ye))throw new TypeError("Cannot call a class as a function")}function n(xe,ye){for(var Me=0;Mew)throw new RangeError('The value "'+xe+'" is invalid for option "size"');var ye=new Uint8Array(xe);return Object.setPrototypeOf(ye,v.prototype),ye}function v(xe,ye,Me){if(typeof xe=="number"){if(typeof ye=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return z(xe)}return y(xe,ye,Me)}v.poolSize=8192;function y(xe,ye,Me){if(typeof xe=="string")return F(xe,ye);if(ArrayBuffer.isView(xe))return B(xe);if(xe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+x(xe));if(Br(xe,ArrayBuffer)||xe&&Br(xe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Br(xe,SharedArrayBuffer)||xe&&Br(xe.buffer,SharedArrayBuffer)))return R(xe,ye,Me);if(typeof xe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Xe=xe.valueOf&&xe.valueOf();if(Xe!=null&&Xe!==xe)return v.from(Xe,ye,Me);var Je=U(xe);if(Je)return Je;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof xe[Symbol.toPrimitive]=="function")return v.from(xe[Symbol.toPrimitive]("string"),ye,Me);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+x(xe))}v.from=function(xe,ye,Me){return y(xe,ye,Me)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function I(xe){if(typeof xe!="number")throw new TypeError('"size" argument must be of type number');if(xe<0)throw new RangeError('The value "'+xe+'" is invalid for option "size"')}function L(xe,ye,Me){return I(xe),xe<=0?u(xe):ye!==void 0?typeof Me=="string"?u(xe).fill(ye,Me):u(xe).fill(ye):u(xe)}v.alloc=function(xe,ye,Me){return L(xe,ye,Me)};function z(xe){return I(xe),u(xe<0?0:j(xe)|0)}v.allocUnsafe=function(xe){return z(xe)},v.allocUnsafeSlow=function(xe){return z(xe)};function F(xe,ye){if((typeof ye!="string"||ye==="")&&(ye="utf8"),!v.isEncoding(ye))throw new TypeError("Unknown encoding: "+ye);var Me=Z(xe,ye)|0,Xe=u(Me),Je=Xe.write(xe,ye);return Je!==Me&&(Xe=Xe.slice(0,Je)),Xe}function N(xe){for(var ye=xe.length<0?0:j(xe.length)|0,Me=u(ye),Xe=0;Xe=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return xe|0}v.isBuffer=function(ye){return ye!=null&&ye._isBuffer===!0&&ye!==v.prototype},v.compare=function(ye,Me){if(Br(ye,Uint8Array)&&(ye=v.from(ye,ye.offset,ye.byteLength)),Br(Me,Uint8Array)&&(Me=v.from(Me,Me.offset,Me.byteLength)),!v.isBuffer(ye)||!v.isBuffer(Me))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ye===Me)return 0;for(var Xe=ye.length,Je=Me.length,Lt=0,Ct=Math.min(Xe,Je);LtJe.length?(v.isBuffer(Ct)||(Ct=v.from(Ct)),Ct.copy(Je,Lt)):Uint8Array.prototype.set.call(Je,Ct,Lt);else if(v.isBuffer(Ct))Ct.copy(Je,Lt);else throw new TypeError('"list" argument must be an Array of Buffers');Lt+=Ct.length}return Je};function Z(xe,ye){if(v.isBuffer(xe))return xe.length;if(ArrayBuffer.isView(xe)||Br(xe,ArrayBuffer))return xe.byteLength;if(typeof xe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+x(xe));var Me=xe.length,Xe=arguments.length>2&&arguments[2]===!0;if(!Xe&&Me===0)return 0;for(var Je=!1;;)switch(ye){case"ascii":case"latin1":case"binary":return Me;case"utf8":case"utf-8":return rr(xe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Me*2;case"hex":return Me>>>1;case"base64":return Wr(xe).length;default:if(Je)return Xe?-1:rr(xe).length;ye=(""+ye).toLowerCase(),Je=!0}}v.byteLength=Z;function re(xe,ye,Me){var Xe=!1;if((ye===void 0||ye<0)&&(ye=0),ye>this.length||((Me===void 0||Me>this.length)&&(Me=this.length),Me<=0)||(Me>>>=0,ye>>>=0,Me<=ye))return"";for(xe||(xe="utf8");;)switch(xe){case"hex":return Ce(this,ye,Me);case"utf8":case"utf-8":return H(this,ye,Me);case"ascii":return ve(this,ye,Me);case"latin1":case"binary":return Ae(this,ye,Me);case"base64":return te(this,ye,Me);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fe(this,ye,Me);default:if(Xe)throw new TypeError("Unknown encoding: "+xe);xe=(xe+"").toLowerCase(),Xe=!0}}v.prototype._isBuffer=!0;function fe(xe,ye,Me){var Xe=xe[ye];xe[ye]=xe[Me],xe[Me]=Xe}v.prototype.swap16=function(){var ye=this.length;if(ye%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Me=0;MeMe&&(ye+=" ... "),""},_&&(v.prototype[_]=v.prototype.inspect),v.prototype.compare=function(ye,Me,Xe,Je,Lt){if(Br(ye,Uint8Array)&&(ye=v.from(ye,ye.offset,ye.byteLength)),!v.isBuffer(ye))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+x(ye));if(Me===void 0&&(Me=0),Xe===void 0&&(Xe=ye?ye.length:0),Je===void 0&&(Je=0),Lt===void 0&&(Lt=this.length),Me<0||Xe>ye.length||Je<0||Lt>this.length)throw new RangeError("out of range index");if(Je>=Lt&&Me>=Xe)return 0;if(Je>=Lt)return-1;if(Me>=Xe)return 1;if(Me>>>=0,Xe>>>=0,Je>>>=0,Lt>>>=0,this===ye)return 0;for(var Ct=Lt-Je,Ot=Xe-Me,Wt=Math.min(Ct,Ot),_r=this.slice(Je,Lt),pr=ye.slice(Me,Xe),hr=0;hr2147483647?Me=2147483647:Me<-2147483648&&(Me=-2147483648),Me=+Me,Mt(Me)&&(Me=Je?0:xe.length-1),Me<0&&(Me=xe.length+Me),Me>=xe.length){if(Je)return-1;Me=xe.length-1}else if(Me<0)if(Je)Me=0;else return-1;if(typeof ye=="string"&&(ye=v.from(ye,Xe)),v.isBuffer(ye))return ye.length===0?-1:ce(xe,ye,Me,Xe,Je);if(typeof ye=="number")return ye=ye&255,typeof Uint8Array.prototype.indexOf=="function"?Je?Uint8Array.prototype.indexOf.call(xe,ye,Me):Uint8Array.prototype.lastIndexOf.call(xe,ye,Me):ce(xe,[ye],Me,Xe,Je);throw new TypeError("val must be string, number or Buffer")}function ce(xe,ye,Me,Xe,Je){var Lt=1,Ct=xe.length,Ot=ye.length;if(Xe!==void 0&&(Xe=String(Xe).toLowerCase(),Xe==="ucs2"||Xe==="ucs-2"||Xe==="utf16le"||Xe==="utf-16le")){if(xe.length<2||ye.length<2)return-1;Lt=2,Ct/=2,Ot/=2,Me/=2}function Wt(En,Kn){return Lt===1?En[Kn]:En.readUInt16BE(Kn*Lt)}var _r;if(Je){var pr=-1;for(_r=Me;_rCt&&(Me=Ct-Ot),_r=Me;_r>=0;_r--){for(var hr=!0,Fr=0;FrJe&&(Xe=Je)):Xe=Je;var Lt=ye.length;Xe>Lt/2&&(Xe=Lt/2);var Ct;for(Ct=0;Ct>>0,isFinite(Xe)?(Xe=Xe>>>0,Je===void 0&&(Je="utf8")):(Je=Xe,Xe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Lt=this.length-Me;if((Xe===void 0||Xe>Lt)&&(Xe=Lt),ye.length>0&&(Xe<0||Me<0)||Me>this.length)throw new RangeError("Attempt to write outside buffer bounds");Je||(Je="utf8");for(var Ct=!1;;)switch(Je){case"hex":return V(this,ye,Me,Xe);case"utf8":case"utf-8":return ee(this,ye,Me,Xe);case"ascii":case"latin1":case"binary":return ne(this,ye,Me,Xe);case"base64":return K(this,ye,Me,Xe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,ye,Me,Xe);default:if(Ct)throw new TypeError("Unknown encoding: "+Je);Je=(""+Je).toLowerCase(),Ct=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function te(xe,ye,Me){return ye===0&&Me===xe.length?A.fromByteArray(xe):A.fromByteArray(xe.slice(ye,Me))}function H(xe,ye,Me){Me=Math.min(xe.length,Me);for(var Xe=[],Je=ye;Je239?4:Lt>223?3:Lt>191?2:1;if(Je+Ot<=Me){var Wt=void 0,_r=void 0,pr=void 0,hr=void 0;switch(Ot){case 1:Lt<128&&(Ct=Lt);break;case 2:Wt=xe[Je+1],(Wt&192)===128&&(hr=(Lt&31)<<6|Wt&63,hr>127&&(Ct=hr));break;case 3:Wt=xe[Je+1],_r=xe[Je+2],(Wt&192)===128&&(_r&192)===128&&(hr=(Lt&15)<<12|(Wt&63)<<6|_r&63,hr>2047&&(hr<55296||hr>57343)&&(Ct=hr));break;case 4:Wt=xe[Je+1],_r=xe[Je+2],pr=xe[Je+3],(Wt&192)===128&&(_r&192)===128&&(pr&192)===128&&(hr=(Lt&15)<<18|(Wt&63)<<12|(_r&63)<<6|pr&63,hr>65535&&hr<1114112&&(Ct=hr))}}Ct===null?(Ct=65533,Ot=1):Ct>65535&&(Ct-=65536,Xe.push(Ct>>>10&1023|55296),Ct=56320|Ct&1023),Xe.push(Ct),Je+=Ot}return ie(Xe)}var ae=4096;function ie(xe){var ye=xe.length;if(ye<=ae)return String.fromCharCode.apply(String,xe);for(var Me="",Xe=0;XeXe)&&(Me=Xe);for(var Je="",Lt=ye;LtXe&&(ye=Xe),Me<0?(Me+=Xe,Me<0&&(Me=0)):Me>Xe&&(Me=Xe),MeMe)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(ye,Me,Xe){ye=ye>>>0,Me=Me>>>0,Xe||ze(ye,Me,this.length);for(var Je=this[ye],Lt=1,Ct=0;++Ct>>0,Me=Me>>>0,Xe||ze(ye,Me,this.length);for(var Je=this[ye+--Me],Lt=1;Me>0&&(Lt*=256);)Je+=this[ye+--Me]*Lt;return Je},v.prototype.readUint8=v.prototype.readUInt8=function(ye,Me){return ye=ye>>>0,Me||ze(ye,1,this.length),this[ye]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,2,this.length),this[ye]|this[ye+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,2,this.length),this[ye]<<8|this[ye+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,4,this.length),(this[ye]|this[ye+1]<<8|this[ye+2]<<16)+this[ye+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,4,this.length),this[ye]*16777216+(this[ye+1]<<16|this[ye+2]<<8|this[ye+3])},v.prototype.readBigUInt64LE=$e(function(ye){ye=ye>>>0,rt(ye,"offset");var Me=this[ye],Xe=this[ye+7];(Me===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Je=Me+this[++ye]*Math.pow(2,8)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,24),Lt=this[++ye]+this[++ye]*Math.pow(2,8)+this[++ye]*Math.pow(2,16)+Xe*Math.pow(2,24);return BigInt(Je)+(BigInt(Lt)<>>0,rt(ye,"offset");var Me=this[ye],Xe=this[ye+7];(Me===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Je=Me*Math.pow(2,24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+this[++ye],Lt=this[++ye]*Math.pow(2,24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+Xe;return(BigInt(Je)<>>0,Me=Me>>>0,Xe||ze(ye,Me,this.length);for(var Je=this[ye],Lt=1,Ct=0;++Ct=Lt&&(Je-=Math.pow(2,8*Me)),Je},v.prototype.readIntBE=function(ye,Me,Xe){ye=ye>>>0,Me=Me>>>0,Xe||ze(ye,Me,this.length);for(var Je=Me,Lt=1,Ct=this[ye+--Je];Je>0&&(Lt*=256);)Ct+=this[ye+--Je]*Lt;return Lt*=128,Ct>=Lt&&(Ct-=Math.pow(2,8*Me)),Ct},v.prototype.readInt8=function(ye,Me){return ye=ye>>>0,Me||ze(ye,1,this.length),this[ye]&128?(255-this[ye]+1)*-1:this[ye]},v.prototype.readInt16LE=function(ye,Me){ye=ye>>>0,Me||ze(ye,2,this.length);var Xe=this[ye]|this[ye+1]<<8;return Xe&32768?Xe|4294901760:Xe},v.prototype.readInt16BE=function(ye,Me){ye=ye>>>0,Me||ze(ye,2,this.length);var Xe=this[ye+1]|this[ye]<<8;return Xe&32768?Xe|4294901760:Xe},v.prototype.readInt32LE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,4,this.length),this[ye]|this[ye+1]<<8|this[ye+2]<<16|this[ye+3]<<24},v.prototype.readInt32BE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,4,this.length),this[ye]<<24|this[ye+1]<<16|this[ye+2]<<8|this[ye+3]},v.prototype.readBigInt64LE=$e(function(ye){ye=ye>>>0,rt(ye,"offset");var Me=this[ye],Xe=this[ye+7];(Me===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Je=this[ye+4]+this[ye+5]*Math.pow(2,8)+this[ye+6]*Math.pow(2,16)+(Xe<<24);return(BigInt(Je)<>>0,rt(ye,"offset");var Me=this[ye],Xe=this[ye+7];(Me===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Je=(Me<<24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+this[++ye];return(BigInt(Je)<>>0,Me||ze(ye,4,this.length),M.read(this,ye,!0,23,4)},v.prototype.readFloatBE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,4,this.length),M.read(this,ye,!1,23,4)},v.prototype.readDoubleLE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,8,this.length),M.read(this,ye,!0,52,8)},v.prototype.readDoubleBE=function(ye,Me){return ye=ye>>>0,Me||ze(ye,8,this.length),M.read(this,ye,!1,52,8)};function Ye(xe,ye,Me,Xe,Je,Lt){if(!v.isBuffer(xe))throw new TypeError('"buffer" argument must be a Buffer instance');if(ye>Je||yexe.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(ye,Me,Xe,Je){if(ye=+ye,Me=Me>>>0,Xe=Xe>>>0,!Je){var Lt=Math.pow(2,8*Xe)-1;Ye(this,ye,Me,Xe,Lt,0)}var Ct=1,Ot=0;for(this[Me]=ye&255;++Ot>>0,Xe=Xe>>>0,!Je){var Lt=Math.pow(2,8*Xe)-1;Ye(this,ye,Me,Xe,Lt,0)}var Ct=Xe-1,Ot=1;for(this[Me+Ct]=ye&255;--Ct>=0&&(Ot*=256);)this[Me+Ct]=ye/Ot&255;return Me+Xe},v.prototype.writeUint8=v.prototype.writeUInt8=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,1,255,0),this[Me]=ye&255,Me+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,2,65535,0),this[Me]=ye&255,this[Me+1]=ye>>>8,Me+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,2,65535,0),this[Me]=ye>>>8,this[Me+1]=ye&255,Me+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,4,4294967295,0),this[Me+3]=ye>>>24,this[Me+2]=ye>>>16,this[Me+1]=ye>>>8,this[Me]=ye&255,Me+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,4,4294967295,0),this[Me]=ye>>>24,this[Me+1]=ye>>>16,this[Me+2]=ye>>>8,this[Me+3]=ye&255,Me+4};function it(xe,ye,Me,Xe,Je){ft(ye,Xe,Je,xe,Me,7);var Lt=Number(ye&BigInt(4294967295));xe[Me++]=Lt,Lt=Lt>>8,xe[Me++]=Lt,Lt=Lt>>8,xe[Me++]=Lt,Lt=Lt>>8,xe[Me++]=Lt;var Ct=Number(ye>>BigInt(32)&BigInt(4294967295));return xe[Me++]=Ct,Ct=Ct>>8,xe[Me++]=Ct,Ct=Ct>>8,xe[Me++]=Ct,Ct=Ct>>8,xe[Me++]=Ct,Me}function st(xe,ye,Me,Xe,Je){ft(ye,Xe,Je,xe,Me,7);var Lt=Number(ye&BigInt(4294967295));xe[Me+7]=Lt,Lt=Lt>>8,xe[Me+6]=Lt,Lt=Lt>>8,xe[Me+5]=Lt,Lt=Lt>>8,xe[Me+4]=Lt;var Ct=Number(ye>>BigInt(32)&BigInt(4294967295));return xe[Me+3]=Ct,Ct=Ct>>8,xe[Me+2]=Ct,Ct=Ct>>8,xe[Me+1]=Ct,Ct=Ct>>8,xe[Me]=Ct,Me+8}v.prototype.writeBigUInt64LE=$e(function(ye){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return it(this,ye,Me,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=$e(function(ye){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return st(this,ye,Me,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(ye,Me,Xe,Je){if(ye=+ye,Me=Me>>>0,!Je){var Lt=Math.pow(2,8*Xe-1);Ye(this,ye,Me,Xe,Lt-1,-Lt)}var Ct=0,Ot=1,Wt=0;for(this[Me]=ye&255;++Ct>0)-Wt&255;return Me+Xe},v.prototype.writeIntBE=function(ye,Me,Xe,Je){if(ye=+ye,Me=Me>>>0,!Je){var Lt=Math.pow(2,8*Xe-1);Ye(this,ye,Me,Xe,Lt-1,-Lt)}var Ct=Xe-1,Ot=1,Wt=0;for(this[Me+Ct]=ye&255;--Ct>=0&&(Ot*=256);)ye<0&&Wt===0&&this[Me+Ct+1]!==0&&(Wt=1),this[Me+Ct]=(ye/Ot>>0)-Wt&255;return Me+Xe},v.prototype.writeInt8=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,1,127,-128),ye<0&&(ye=255+ye+1),this[Me]=ye&255,Me+1},v.prototype.writeInt16LE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,2,32767,-32768),this[Me]=ye&255,this[Me+1]=ye>>>8,Me+2},v.prototype.writeInt16BE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,2,32767,-32768),this[Me]=ye>>>8,this[Me+1]=ye&255,Me+2},v.prototype.writeInt32LE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,4,2147483647,-2147483648),this[Me]=ye&255,this[Me+1]=ye>>>8,this[Me+2]=ye>>>16,this[Me+3]=ye>>>24,Me+4},v.prototype.writeInt32BE=function(ye,Me,Xe){return ye=+ye,Me=Me>>>0,Xe||Ye(this,ye,Me,4,2147483647,-2147483648),ye<0&&(ye=4294967295+ye+1),this[Me]=ye>>>24,this[Me+1]=ye>>>16,this[Me+2]=ye>>>8,this[Me+3]=ye&255,Me+4},v.prototype.writeBigInt64LE=$e(function(ye){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return it(this,ye,Me,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=$e(function(ye){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return st(this,ye,Me,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function nt(xe,ye,Me,Xe,Je,Lt){if(Me+Xe>xe.length)throw new RangeError("Index out of range");if(Me<0)throw new RangeError("Index out of range")}function Qe(xe,ye,Me,Xe,Je){return ye=+ye,Me=Me>>>0,Je||nt(xe,ye,Me,4),M.write(xe,ye,Me,Xe,23,4),Me+4}v.prototype.writeFloatLE=function(ye,Me,Xe){return Qe(this,ye,Me,!0,Xe)},v.prototype.writeFloatBE=function(ye,Me,Xe){return Qe(this,ye,Me,!1,Xe)};function Le(xe,ye,Me,Xe,Je){return ye=+ye,Me=Me>>>0,Je||nt(xe,ye,Me,8),M.write(xe,ye,Me,Xe,52,8),Me+8}v.prototype.writeDoubleLE=function(ye,Me,Xe){return Le(this,ye,Me,!0,Xe)},v.prototype.writeDoubleBE=function(ye,Me,Xe){return Le(this,ye,Me,!1,Xe)},v.prototype.copy=function(ye,Me,Xe,Je){if(!v.isBuffer(ye))throw new TypeError("argument should be a Buffer");if(Xe||(Xe=0),!Je&&Je!==0&&(Je=this.length),Me>=ye.length&&(Me=ye.length),Me||(Me=0),Je>0&&Je=this.length)throw new RangeError("Index out of range");if(Je<0)throw new RangeError("sourceEnd out of bounds");Je>this.length&&(Je=this.length),ye.length-Me>>0,Xe=Xe===void 0?this.length:Xe>>>0,ye||(ye=0);var Ct;if(typeof ye=="number")for(Ct=Me;CtMath.pow(2,32)?Je=Ne(String(Me)):typeof Me=="bigint"&&(Je=String(Me),(Me>Math.pow(BigInt(2),BigInt(32))||Me<-Math.pow(BigInt(2),BigInt(32)))&&(Je=Ne(Je)),Je+="n"),Xe+=" It must be ".concat(ye,". Received ").concat(Je),Xe},RangeError);function Ne(xe){for(var ye="",Me=xe.length,Xe=xe[0]==="-"?1:0;Me>=Xe+4;Me-=3)ye="_".concat(xe.slice(Me-3,Me)).concat(ye);return"".concat(xe.slice(0,Me)).concat(ye)}function ot(xe,ye,Me){rt(ye,"offset"),(xe[ye]===void 0||xe[ye+Me]===void 0)&&Ft(ye,xe.length-(Me+1))}function ft(xe,ye,Me,Xe,Je,Lt){if(xe>Me||xe= 0".concat(Ct," and < 2").concat(Ct," ** ").concat((Lt+1)*8).concat(Ct):Ot=">= -(2".concat(Ct," ** ").concat((Lt+1)*8-1).concat(Ct,") and < 2 ** ")+"".concat((Lt+1)*8-1).concat(Ct),new Te.ERR_OUT_OF_RANGE("value",Ot,xe)}ot(Xe,Je,Lt)}function rt(xe,ye){if(typeof xe!="number")throw new Te.ERR_INVALID_ARG_TYPE(ye,"number",xe)}function Ft(xe,ye,Me){throw Math.floor(xe)!==xe?(rt(xe,Me),new Te.ERR_OUT_OF_RANGE("offset","an integer",xe)):ye<0?new Te.ERR_BUFFER_OUT_OF_BOUNDS:new Te.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(ye),xe)}var Nt=/[^+/0-9A-Za-z-_]/g;function $t(xe){if(xe=xe.split("=")[0],xe=xe.trim().replace(Nt,""),xe.length<2)return"";for(;xe.length%4!==0;)xe=xe+"=";return xe}function rr(xe,ye){ye=ye||1/0;for(var Me,Xe=xe.length,Je=null,Lt=[],Ct=0;Ct55295&&Me<57344){if(!Je){if(Me>56319){(ye-=3)>-1&&Lt.push(239,191,189);continue}else if(Ct+1===Xe){(ye-=3)>-1&&Lt.push(239,191,189);continue}Je=Me;continue}if(Me<56320){(ye-=3)>-1&&Lt.push(239,191,189),Je=Me;continue}Me=(Je-55296<<10|Me-56320)+65536}else Je&&(ye-=3)>-1&&Lt.push(239,191,189);if(Je=null,Me<128){if((ye-=1)<0)break;Lt.push(Me)}else if(Me<2048){if((ye-=2)<0)break;Lt.push(Me>>6|192,Me&63|128)}else if(Me<65536){if((ye-=3)<0)break;Lt.push(Me>>12|224,Me>>6&63|128,Me&63|128)}else if(Me<1114112){if((ye-=4)<0)break;Lt.push(Me>>18|240,Me>>12&63|128,Me>>6&63|128,Me&63|128)}else throw new Error("Invalid code point")}return Lt}function Er(xe){for(var ye=[],Me=0;Me>8,Je=Me%256,Lt.push(Je),Lt.push(Xe);return Lt}function Wr(xe){return A.toByteArray($t(xe))}function Sr(xe,ye,Me,Xe){var Je;for(Je=0;Je=ye.length||Je>=xe.length);++Je)ye[Je+Me]=xe[Je];return Je}function Br(xe,ye){return xe instanceof ye||xe!=null&&xe.constructor!=null&&xe.constructor.name!=null&&xe.constructor.name===ye.name}function Mt(xe){return xe!==xe}var je=(function(){for(var xe="0123456789abcdef",ye=new Array(256),Me=0;Me<16;++Me)for(var Xe=Me*16,Je=0;Je<16;++Je)ye[Xe+Je]=xe[Me]+xe[Je];return ye})();function $e(xe){return typeof BigInt>"u"?Ee:xe}function Ee(){throw new Error("BigInt not supported")}}),4844:(function(e){e.exports=t;function t(r,o,n,i){return r[0]=o[0]+n[0]*i,r[1]=o[1]+n[1]*i,r[2]=o[2]+n[2]*i,r[3]=o[3]+n[3]*i,r}}),4905:(function(e,t,r){var o=r(5874);e.exports=n;function n(i,a){var s=o(a),f=[];return f=f.concat(s(i)),f=f.concat(s(null)),f}}),4935:(function(e,t,r){e.exports=g;var o=r(2762),n=r(8116),i=r(4359),a=r(1879).Q,s=window||process.global||{},f=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var c=3;function p(x,A,M,_){this.gl=x,this.shader=A,this.buffer=M,this.vao=_,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var d=p.prototype,T=[0,0];d.bind=function(x,A,M,_){this.vao.bind(),this.shader.bind();var w=this.shader.uniforms;w.model=x,w.view=A,w.projection=M,w.pixelScale=_,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},d.unbind=function(){this.vao.unbind()},d.update=function(x,A,M,_,w){var m=[];function u(U,j,Z,re,fe,le){var ce=[Z.style,Z.weight,Z.variant,Z.family].join("_"),V=f[ce];V||(V=f[ce]={});var ee=V[j];ee||(ee=V[j]=l(j,{triangles:!0,font:Z.family,fontStyle:Z.style,fontWeight:Z.weight,fontVariant:Z.variant,textAlign:"center",textBaseline:"middle",lineSpacing:fe,styletags:le}));for(var ne=(re||12)/12,K=ee.positions,ue=ee.cells,te=0,H=ue.length;te=0;--ie){var ve=K[ae[ie]];m.push(ne*ve[0],-ne*ve[1],U)}}for(var v=[0,0,0],y=[0,0,0],I=[0,0,0],L=[0,0,0],z=1.25,F={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},N=0;N<3;++N){I[N]=m.length/c|0,u(.5*(x[0][N]+x[1][N]),A[N],M[N],12,z,F),L[N]=(m.length/c|0)-I[N],v[N]=m.length/c|0;for(var B=0;B<_[N].length;++B)if(_[N][B].text){var R={family:_[N][B].font||w[N].family,style:w[N].fontStyle||w[N].style,weight:w[N].fontWeight||w[N].weight,variant:w[N].fontVariant||w[N].variant};u(_[N][B].x,_[N][B].text,R,_[N][B].fontSize||12,z,F)}y[N]=(m.length/c|0)-v[N]}this.buffer.update(m),this.tickOffset=v,this.tickCount=y,this.labelOffset=I,this.labelCount=L},d.drawTicks=function(x,A,M,_,w,m,u,v){this.tickCount[x]&&(this.shader.uniforms.axis=m,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=A,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=v,this.vao.draw(this.gl.TRIANGLES,this.tickCount[x],this.tickOffset[x]))},d.drawLabel=function(x,A,M,_,w,m,u,v){this.labelCount[x]&&(this.shader.uniforms.axis=m,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=A,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=v,this.vao.draw(this.gl.TRIANGLES,this.labelCount[x],this.labelOffset[x]))},d.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function l(x,A){try{return i(x,A)}catch(M){return console.warn('error vectorizing text:"'+x+'" error:',M),{cells:[],positions:[]}}}function g(x,A,M,_,w,m){var u=o(x),v=n(x,[{buffer:u,size:3}]),y=a(x);y.attributes.position.location=0;var I=new p(x,y,u,v);return I.update(A,M,_,w,m),I}}),5023:(function(e,t,r){var o=r(2478);e.exports=c;function n(p,d,T,l,g,x,A){this.cells=p,this.neighbor=d,this.flags=l,this.constraint=T,this.active=g,this.next=x,this.boundary=A}var i=n.prototype;function a(p,d){return p[0]-d[0]||p[1]-d[1]||p[2]-d[2]}i.locate=(function(){var p=[0,0,0];return function(d,T,l){var g=d,x=T,A=l;return T0||A.length>0;){for(;x.length>0;){var u=x.pop();if(M[u]!==-g){M[u]=g,_[u];for(var v=0;v<3;++v){var y=m[3*u+v];y>=0&&M[y]===0&&(w[3*u+v]?A.push(y):(x.push(y),M[y]=g))}}}var I=A;A=x,x=I,A.length=0,g=-g}var L=f(_,M,d);return T?L.concat(l.boundary):L}}),5033:(function(e){e.exports=t;function t(r,o,n){var i=o||0,a=n||1;return[[r[12]+r[0],r[13]+r[1],r[14]+r[2],r[15]+r[3]],[r[12]-r[0],r[13]-r[1],r[14]-r[2],r[15]-r[3]],[r[12]+r[4],r[13]+r[5],r[14]+r[6],r[15]+r[7]],[r[12]-r[4],r[13]-r[5],r[14]-r[6],r[15]-r[7]],[i*r[12]+r[8],i*r[13]+r[9],i*r[14]+r[10],i*r[15]+r[11]],[a*r[12]-r[8],a*r[13]-r[9],a*r[14]-r[10],a*r[15]-r[11]]]}}),5085:(function(e,t,r){e.exports=g;var o=r(3250)[3],n=r(4209),i=r(3352),a=r(2478);function s(){return!0}function f(x){return function(A,M){var _=x[A];return _?!!_.queryPoint(M,s):!1}}function c(x){for(var A={},M=0;M0&&A[_]===M[0])w=x[_-1];else return 1;for(var m=1;w;){var u=w.key,v=o(M,u[0],u[1]);if(u[0][0]0)m=-1,w=w.right;else return 0;else if(v>0)w=w.left;else if(v<0)m=1,w=w.right;else return 0}return m}}function d(x){return 1}function T(x){return function(M){return x(M[0],M[1])?0:1}}function l(x,A){return function(_){return x(_[0],_[1])?0:A(_)}}function g(x){for(var A=x.length,M=[],_=[],w=0;w"u"?r(606):WeakMap,a=new i,s=0;function f(A,M,_,w,m,u,v){this.id=A,this.src=M,this.type=_,this.shader=w,this.count=u,this.programs=[],this.cache=v}f.prototype.dispose=function(){if(--this.count===0){for(var A=this.cache,M=A.gl,_=this.programs,w=0,m=_.length;w0&&(f=1/Math.sqrt(f),r[0]=n*f,r[1]=i*f,r[2]=a*f,r[3]=s*f),r}}),5202:(function(e,t,r){var o=r(1944),n=r(8210);e.exports=s,e.exports.positive=f,e.exports.negative=c;function i(p,d){var T=n(o(p,d),[d[d.length-1]]);return T[T.length-1]}function a(p,d,T,l){var g=l-d,x=-d/g;x<0?x=0:x>1&&(x=1);for(var A=1-x,M=p.length,_=new Array(M),w=0;w0||g>0&&_<0){var w=a(x,_,A,g);T.push(w),l.push(w.slice())}_<0?l.push(A.slice()):_>0?T.push(A.slice()):(T.push(A.slice()),l.push(A.slice())),g=_}return{positive:T,negative:l}}function f(p,d){for(var T=[],l=i(p[p.length-1],d),g=p[p.length-1],x=p[0],A=0;A0||l>0&&M<0)&&T.push(a(g,M,x,l)),M>=0&&T.push(x.slice()),l=M}return T}function c(p,d){for(var T=[],l=i(p[p.length-1],d),g=p[p.length-1],x=p[0],A=0;A0||l>0&&M<0)&&T.push(a(g,M,x,l)),M<=0&&T.push(x.slice()),l=M}return T}}),5219:(function(e){e.exports=function(t){for(var r=t.length,o,n=0;n13)&&o!==32&&o!==133&&o!==160&&o!==5760&&o!==6158&&(o<8192||o>8205)&&o!==8232&&o!==8233&&o!==8239&&o!==8287&&o!==8288&&o!==12288&&o!==65279)return!1;return!0}}),5250:(function(e){e.exports=r;var t=+(Math.pow(2,27)+1);function r(o,n,i){var a=o*n,s=t*o,f=s-o,c=s-f,p=o-c,d=t*n,T=d-n,l=d-T,g=n-l,x=a-c*l,A=x-p*l,M=A-c*g,_=p*g-M;return i?(i[0]=_,i[1]=a,i):[_,a]}}),5298:(function(e,t){var r={"float64,2,1,0":function(){return function(p,d,T,l,g){var x=p[0],A=p[1],M=p[2],_=T[0],w=T[1],m=T[2];l|=0;var u=0,v=0,y=0,I=m,L=w-M*m,z=_-A*w;for(y=0;y0;){B<64?(_=B,B=0):(_=64,B-=64);for(var R=p[1]|0;R>0;){R<64?(w=R,R=0):(w=64,R-=64),l=F+B*u+R*v,A=N+B*I+R*L;var U=0,j=0,Z=0,re=y,fe=u-m*y,le=v-_*u,ce=z,V=I-m*z,ee=L-_*I;for(Z=0;Z0;){L<64?(_=L,L=0):(_=64,L-=64);for(var z=p[0]|0;z>0;){z<64?(M=z,z=0):(M=64,z-=64),l=y+L*m+z*w,A=I+L*v+z*u;var F=0,N=0,B=m,R=w-_*m,U=v,j=u-_*v;for(N=0;N0;){N<64?(w=N,N=0):(w=64,N-=64);for(var B=p[0]|0;B>0;){B<64?(M=B,B=0):(M=64,B-=64);for(var R=p[1]|0;R>0;){R<64?(_=R,R=0):(_=64,R-=64),l=z+N*v+B*m+R*u,A=F+N*L+B*y+R*I;var U=0,j=0,Z=0,re=v,fe=m-w*v,le=u-M*m,ce=L,V=y-w*L,ee=I-M*y;for(Z=0;Z<_;++Z){for(j=0;j=0}})(),i.removeTriangle=function(f,c,p){var d=this.stars;a(d[f],c,p),a(d[c],p,f),a(d[p],f,c)},i.addTriangle=function(f,c,p){var d=this.stars;d[f].push(c,p),d[c].push(p,f),d[p].push(f,c)},i.opposite=function(f,c){for(var p=this.stars[c],d=1,T=p.length;d0;){var l=p.pop();f[l]=!1;for(var g=s[l],d=0;d0){for(var ce=0;ce<24;++ce)L.push(L[L.length-12]);B+=2,re=!0}continue e}R[0][y]=Math.min(R[0][y],fe[y],le[y]),R[1][y]=Math.max(R[1][y],fe[y],le[y])}var V,ee;Array.isArray(j[0])?(V=j.length>v-1?j[v-1]:j.length>0?j[j.length-1]:[0,0,0,1],ee=j.length>v?j[v]:j.length>0?j[j.length-1]:[0,0,0,1]):V=ee=j,V.length===3&&(V=[V[0],V[1],V[2],1]),ee.length===3&&(ee=[ee[0],ee[1],ee[2],1]),!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0);var ne;Array.isArray(Z)?ne=Z.length>v-1?Z[v-1]:Z.length>0?Z[Z.length-1]:[0,0,0,1]:ne=Z;var K=N;if(N+=x(fe,le),re){for(y=0;y<2;++y)L.push(fe[0],fe[1],fe[2],le[0],le[1],le[2],K,ne,V[0],V[1],V[2],V[3]);B+=2,re=!1}L.push(fe[0],fe[1],fe[2],le[0],le[1],le[2],K,ne,V[0],V[1],V[2],V[3],fe[0],fe[1],fe[2],le[0],le[1],le[2],K,-ne,V[0],V[1],V[2],V[3],le[0],le[1],le[2],fe[0],fe[1],fe[2],N,-ne,ee[0],ee[1],ee[2],ee[3],le[0],le[1],le[2],fe[0],fe[1],fe[2],N,ne,ee[0],ee[1],ee[2],ee[3]),B+=4}}if(this.buffer.update(L),z.push(N),F.push(U[U.length-1].slice()),this.bounds=R,this.vertexCount=B,this.points=F,this.arcLength=z,"dashes"in u){var ue=u.dashes,te=ue.slice();for(te.unshift(0),v=1;vr[n][0]&&(n=i);return on?[[n],[o]]:[[o]]}}),5771:(function(e,t,r){var o=r(8507),n=r(3788),i=r(2419);e.exports=a;function a(s){s.sort(n);for(var f=s.length,c=0,p=0;p0){var l=s[c-1];if(o(d,l)===0&&i(l)!==T){c-=1;continue}}s[c++]=d}}return s.length=c,s}}),5838:(function(e,t,r){e.exports=n;var o=r(7842);function n(i){for(var a=new Array(i.length),s=0;s0)continue;Ne=Le.slice(0,1).join("")}return te(Ne),re+=Ne.length,R=R.slice(Ne.length),R.length}while(!0)}function it(){return/[^a-fA-F0-9]/.test(N)?(te(R.join("")),F=f,L):(R.push(N),B=N,L+1)}function st(){return N==="."||/[eE]/.test(N)?(R.push(N),F=x,B=N,L+1):N==="x"&&R.length===1&&R[0]==="0"?(F=u,R.push(N),B=N,L+1):/[^\d]/.test(N)?(te(R.join("")),F=f,L):(R.push(N),B=N,L+1)}function nt(){return N==="f"&&(R.push(N),B=N,L+=1),/[eE]/.test(N)||(N==="-"||N==="+")&&/[eE]/.test(B)?(R.push(N),B=N,L+1):/[^\d]/.test(N)?(te(R.join("")),F=f,L):(R.push(N),B=N,L+1)}function Qe(){if(/[^\d\w_]/.test(N)){var Le=R.join("");return ue[Le]?F=_:K[Le]?F=M:F=A,te(R.join("")),F=f,L}return R.push(N),B=N,L+1}}}),5878:(function(e,t,r){e.exports=a;var o=r(3250),n=r(2014);function i(s,f,c){var p=Math.abs(o(s,f,c)),d=Math.sqrt(Math.pow(f[0]-c[0],2)+Math.pow(f[1]-c[1],2));return p/d}function a(s,f,c){for(var p=f.length,d=s.length,T=new Array(p),l=new Array(p),g=new Array(p),x=new Array(p),A=0;A>1:(ce>>1)-1}function I(ce){for(var V=v(ce);;){var ee=V,ne=2*ce+1,K=2*(ce+1),ue=ce;if(ne0;){var ee=y(ce);if(ee>=0){var ne=v(ee);if(V0){var ce=B[0];return u(0,j-1),j-=1,I(0),ce}return-1}function F(ce,V){var ee=B[ce];return g[ee]===V?ce:(g[ee]=-1/0,L(ce),z(),g[ee]=V,j+=1,L(j-1))}function N(ce){if(!x[ce]){x[ce]=!0;var V=T[ce],ee=l[ce];T[ee]>=0&&(T[ee]=V),l[V]>=0&&(l[V]=ee),R[V]>=0&&F(R[V],m(V)),R[ee]>=0&&F(R[ee],m(ee))}}for(var B=[],R=new Array(p),A=0;A>1;A>=0;--A)I(A);for(;;){var Z=z();if(Z<0||g[Z]>c)break;N(Z)}for(var re=[],A=0;A=0&&ee>=0&&V!==ee){var ne=R[V],K=R[ee];ne!==K&&le.push([ne,K])}}),n.unique(n.normalize(le)),{positions:re,edges:le}}}),5911:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=n[0],c=n[1],p=n[2];return r[0]=a*p-s*c,r[1]=s*f-i*p,r[2]=i*c-a*f,r}}),5964:(function(e){e.exports=function(t){return!t&&t!==0?"":t.toString()}}),5995:(function(e,t,r){e.exports=i;var o=r(7642),n=r(6037);function i(a,s){return o(s).filter(function(f){for(var c=new Array(f.length),p=0;p2&&v[1]>2&&w(u.pick(-1,-1).lo(1,1).hi(v[0]-2,v[1]-2),m.pick(-1,-1,0).lo(1,1).hi(v[0]-2,v[1]-2),m.pick(-1,-1,1).lo(1,1).hi(v[0]-2,v[1]-2)),v[1]>2&&(_(u.pick(0,-1).lo(1).hi(v[1]-2),m.pick(0,-1,1).lo(1).hi(v[1]-2)),M(m.pick(0,-1,0).lo(1).hi(v[1]-2))),v[1]>2&&(_(u.pick(v[0]-1,-1).lo(1).hi(v[1]-2),m.pick(v[0]-1,-1,1).lo(1).hi(v[1]-2)),M(m.pick(v[0]-1,-1,0).lo(1).hi(v[1]-2))),v[0]>2&&(_(u.pick(-1,0).lo(1).hi(v[0]-2),m.pick(-1,0,0).lo(1).hi(v[0]-2)),M(m.pick(-1,0,1).lo(1).hi(v[0]-2))),v[0]>2&&(_(u.pick(-1,v[1]-1).lo(1).hi(v[0]-2),m.pick(-1,v[1]-1,0).lo(1).hi(v[0]-2)),M(m.pick(-1,v[1]-1,1).lo(1).hi(v[0]-2))),m.set(0,0,0,0),m.set(0,0,1,0),m.set(v[0]-1,0,0,0),m.set(v[0]-1,0,1,0),m.set(0,v[1]-1,0,0),m.set(0,v[1]-1,1,0),m.set(v[0]-1,v[1]-1,0,0),m.set(v[0]-1,v[1]-1,1,0),m}}function x(A){var M=A.join(),v=p[M];if(v)return v;for(var _=A.length,w=[d,T],m=1;m<=_;++m)w.push(l(m));var u=g,v=u.apply(void 0,w);return p[M]=v,v}e.exports=function(M,_,w){if(Array.isArray(w)||(typeof w=="string"?w=o(_.dimension,w):w=o(_.dimension,"clamp")),_.size===0)return M;if(_.dimension===0)return M.set(0),M;var m=x(w);return m(M,_)}}),6204:(function(e){e.exports=t;function t(r){var o,n,i,a=r.length,s=0;for(o=0;op&&(p=o.length(L)),y&&!v){var z=2*o.distance(M,I)/(o.length(_)+o.length(L));z?(m=Math.min(m,z),u=!1):u=!0}u||(M=I,_=L),w.push(L)}var F=[d,l,x],N=[T,g,A];a&&(a[0]=F,a[1]=N),p===0&&(p=1);var B=1/p;isFinite(m)||(m=1),c.vectorScale=m;var R=i.coneSize||(v?1:.5);i.absoluteConeSize&&(R=i.absoluteConeSize*B),c.coneScale=R;for(var y=0,U=0;yre&&(N|=1<re){N|=1<c[L][1])&&(ue=L);for(var te=-1,L=0;L<3;++L){var H=ue^1<c[ae][0]&&(ae=H)}}var ie=x;ie[0]=ie[1]=ie[2]=0,ie[o.log2(te^ue)]=ue&te,ie[o.log2(ue^ae)]=ue&ae;var ve=ae^7;ve===N||ve===K?(ve=te^7,ie[o.log2(ae^ve)]=ve&ae):ie[o.log2(te^ve)]=ve&te;for(var Ae=A,Ce=N,U=0;U<3;++U)Ce&1<=0&&(c=s.length-f-1);var p=Math.pow(10,c),d=Math.round(i*a*p),T=d+"";if(T.indexOf("e")>=0)return T;var l=d/p,g=d%p;d<0?(l=-Math.ceil(l)|0,g=-g|0):(l=Math.floor(l)|0,g=g|0);var x=""+l;if(d<0&&(x="-"+x),c){for(var A=""+g;A.length=i[0][f];--p)c.push({x:p*a[f],text:r(a[f],p)});s.push(c)}return s}function n(i,a){for(var s=0;s<3;++s){if(i[s].length!==a[s].length)return!1;for(var f=0;fM+1)throw new Error(x+" map requires nshades to be at least size "+g.length);Array.isArray(c.alpha)?c.alpha.length!==2?_=[1,1]:_=c.alpha.slice():typeof c.alpha=="number"?_=[c.alpha,c.alpha]:_=[1,1],p=g.map(function(I){return Math.round(I.index*M)}),_[0]=Math.min(Math.max(_[0],0),1),_[1]=Math.min(Math.max(_[1],0),1);var m=g.map(function(I,L){var z=g[L].index,F=g[L].rgb.slice();return F.length===4&&F[3]>=0&&F[3]<=1||(F[3]=_[0]+(_[1]-_[0])*z),F}),u=[];for(w=0;w0&&(s=1/Math.sqrt(s),r[0]=o[0]*s,r[1]=o[1]*s,r[2]=o[2]*s),r}}),3545:(function(e,t,r){e.exports=s;var o=r(8105),n=o("lop&&T[w+c]>M;--_,w-=g){for(var m=w,u=w+g,d=0;d>>1,M=2*f,_=A,w=T[M*A+c];g=I?(_=y,w=I):d>=z?(_=u,w=d):(_=L,w=z):I>=z?(_=y,w=I):z>=d?(_=u,w=d):(_=L,w=z);for(var B=M*(x-1),R=M*_,F=0;Fthis.buffer.length){n.free(this.buffer);for(var x=this.buffer=n.mallocUint8(a(g*l*4)),A=0;A_|0},vertex:function(x,A,M,_,w,m,u,d,y,I,L,z,F){var N=(u<<0)+(d<<1)+(y<<2)+(I<<3)|0;if(!(N===0||N===15))switch(N){case 0:L.push([x-.5,A-.5]);break;case 1:L.push([x-.25-.25*(_+M-2*F)/(M-_),A-.25-.25*(w+M-2*F)/(M-w)]);break;case 2:L.push([x-.75-.25*(-_-M+2*F)/(_-M),A-.25-.25*(m+_-2*F)/(_-m)]);break;case 3:L.push([x-.5,A-.5-.5*(w+M+m+_-4*F)/(M-w+_-m)]);break;case 4:L.push([x-.25-.25*(m+w-2*F)/(w-m),A-.75-.25*(-w-M+2*F)/(w-M)]);break;case 5:L.push([x-.5-.5*(_+M+m+w-4*F)/(M-_+w-m),A-.5]);break;case 6:L.push([x-.5-.25*(-_-M+m+w)/(_-M+w-m),A-.5-.25*(-w-M+m+_)/(w-M+_-m)]);break;case 7:L.push([x-.75-.25*(m+w-2*F)/(w-m),A-.75-.25*(m+_-2*F)/(_-m)]);break;case 8:L.push([x-.75-.25*(-m-w+2*F)/(m-w),A-.75-.25*(-m-_+2*F)/(m-_)]);break;case 9:L.push([x-.5-.25*(_+M+-m-w)/(M-_+m-w),A-.5-.25*(w+M+-m-_)/(M-w+m-_)]);break;case 10:L.push([x-.5-.5*(-_-M+-m-w+4*F)/(_-M+m-w),A-.5]);break;case 11:L.push([x-.25-.25*(-m-w+2*F)/(m-w),A-.75-.25*(w+M-2*F)/(M-w)]);break;case 12:L.push([x-.5,A-.5-.5*(-w-M+-m-_+4*F)/(w-M+m-_)]);break;case 13:L.push([x-.75-.25*(_+M-2*F)/(M-_),A-.25-.25*(-m-_+2*F)/(m-_)]);break;case 14:L.push([x-.25-.25*(-_-M+2*F)/(_-M),A-.25-.25*(-w-M+2*F)/(w-M)]);break;case 15:L.push([x-.5,A-.5]);break}},cell:function(x,A,M,_,w,m,u,d,y){w?d.push([x,A]):d.push([A,x])}});return function(g,x){var A=[],M=[];return l(g,A,M,x),{positions:A,cells:M}}}};function a(p,v){var T=p.length+"d",l=i[T];if(l)return l(o,p,v)}function s(p,v){for(var T=n(p,v),l=T.length,g=new Array(l),x=new Array(l),A=0;A>1,T=-7,l=n?a-1:0,g=n?-1:1,x=r[o+l];for(l+=g,s=x&(1<<-T)-1,x>>=-T,T+=c;T>0;s=s*256+r[o+l],l+=g,T-=8);for(f=s&(1<<-T)-1,s>>=-T,T+=i;T>0;f=f*256+r[o+l],l+=g,T-=8);if(s===0)s=1-v;else{if(s===p)return f?NaN:(x?-1:1)*(1/0);f=f+Math.pow(2,i),s=s-v}return(x?-1:1)*f*Math.pow(2,s-i)},t.write=function(r,o,n,i,a,s){var f,c,p,v=s*8-a-1,T=(1<>1,g=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:s-1,A=i?1:-1,M=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(c=isNaN(o)?1:0,f=T):(f=Math.floor(Math.log(o)/Math.LN2),o*(p=Math.pow(2,-f))<1&&(f--,p*=2),f+l>=1?o+=g/p:o+=g*Math.pow(2,1-l),o*p>=2&&(f++,p/=2),f+l>=T?(c=0,f=T):f+l>=1?(c=(o*p-1)*Math.pow(2,a),f=f+l):(c=o*Math.pow(2,l-1)*Math.pow(2,a),f=0));a>=8;r[n+x]=c&255,x+=A,c/=256,a-=8);for(f=f<0;r[n+x]=f&255,x+=A,f/=256,v-=8);r[n+x-A]|=M*128}}),3788:(function(e,t,r){var o=r(8507),n=r(2419);e.exports=i;function i(a,s){return o(a,s)||n(a)-n(s)}}),3837:(function(e,t,r){e.exports=L;var o=r(4935),n=r(501),i=r(5304),a=r(6429),s=r(6444),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,p=DataView;function v(z){return c.isView(z)&&!(z instanceof p)}function T(z){return Array.isArray(z)||v(z)}function l(z,F){return z[0]=F[0],z[1]=F[1],z[2]=F[2],z}function g(z){this.gl=z,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=i(z)}var x=g.prototype;x.update=function(z){z=z||{};function F($,ue,te){if(te in z){var H=z[te],ae=this[te],ie;($?T(H)&&T(H[0]):T(H))?this[te]=ie=[ue(H[0]),ue(H[1]),ue(H[2])]:this[te]=ie=[ue(H),ue(H),ue(H)];for(var de=0;de<3;++de)if(ie[de]!==ae[de])return!0}return!1}var N=F.bind(this,!1,Number),B=F.bind(this,!1,Boolean),R=F.bind(this,!1,String),U=F.bind(this,!0,function($){if(T($)){if($.length===3)return[+$[0],+$[1],+$[2],1];if($.length===4)return[+$[0],+$[1],+$[2],+$[3]]}return[0,0,0,1]}),j,Z=!1,re=!1;if("bounds"in z)for(var fe=z.bounds,le=0;le<2;++le)for(var ce=0;ce<3;++ce)fe[le][ce]!==this.bounds[le][ce]&&(re=!0),this.bounds[le][ce]=fe[le][ce];if("ticks"in z){j=z.ticks,Z=!0,this.autoTicks=!1;for(var le=0;le<3;++le)this.tickSpacing[le]=0}else N("tickSpacing")&&(this.autoTicks=!0,re=!0);if(this._firstInit&&("ticks"in z||"tickSpacing"in z||(this.autoTicks=!0),re=!0,Z=!0,this._firstInit=!1),re&&this.autoTicks&&(j=s.create(this.bounds,this.tickSpacing),Z=!0),Z){for(var le=0;le<3;++le)j[le].sort(function(ue,te){return ue.x-te.x});s.equal(j,this.ticks)?Z=!1:this.ticks=j}B("tickEnable"),R("tickFont")&&(Z=!0),R("tickFontStyle")&&(Z=!0),R("tickFontWeight")&&(Z=!0),R("tickFontVariant")&&(Z=!0),N("tickSize"),N("tickAngle"),N("tickPad"),U("tickColor");var V=R("labels");R("labelFont")&&(V=!0),R("labelFontStyle")&&(V=!0),R("labelFontWeight")&&(V=!0),R("labelFontVariant")&&(V=!0),B("labelEnable"),N("labelSize"),N("labelPad"),U("labelColor"),B("lineEnable"),B("lineMirror"),N("lineWidth"),U("lineColor"),B("lineTickEnable"),B("lineTickMirror"),N("lineTickLength"),N("lineTickWidth"),U("lineTickColor"),B("gridEnable"),N("gridWidth"),U("gridColor"),B("zeroEnable"),U("zeroLineColor"),N("zeroLineWidth"),B("backgroundEnable"),U("backgroundColor");var ee=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],ne=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(V||Z)&&this._text.update(this.bounds,this.labels,ee,this.ticks,ne):this._text=o(this.gl,this.bounds,this.labels,ee,this.ticks,ne),this._lines&&Z&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=n(this.gl,this.bounds,this.ticks))};function A(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var M=[new A,new A,new A];function _(z,F,N,B,R){for(var U=z.primalOffset,j=z.primalMinor,Z=z.mirrorOffset,re=z.mirrorMinor,fe=B[F],le=0;le<3;++le)if(F!==le){var ce=U,V=Z,ee=j,ne=re;fe&1<0?(ee[le]=-1,ne[le]=0):(ee[le]=0,ne[le]=1)}}var w=[0,0,0],m={model:f,view:f,projection:f,_ortho:!1};x.isOpaque=function(){return!0},x.isTransparent=function(){return!1},x.drawTransparent=function(z){};var u=0,d=[0,0,0],y=[0,0,0],I=[0,0,0];x.draw=function(z){z=z||m;for(var te=this.gl,F=z.model||f,N=z.view||f,B=z.projection||f,R=this.bounds,U=z._ortho||!1,j=a(F,N,B,R,U),Z=j.cubeEdges,re=j.axis,fe=N[12],le=N[13],ce=N[14],V=N[15],ee=U?2:1,ne=ee*this.pixelRatio*(B[3]*fe+B[7]*le+B[11]*ce+B[15]*V)/te.drawingBufferHeight,$=0;$<3;++$)this.lastCubeProps.cubeEdges[$]=Z[$],this.lastCubeProps.axis[$]=re[$];for(var ue=M,$=0;$<3;++$)_(M[$],$,this.bounds,Z,re);for(var te=this.gl,H=w,$=0;$<3;++$)this.backgroundEnable[$]?H[$]=re[$]:H[$]=0;this._background.draw(F,N,B,R,H,this.backgroundColor),this._lines.bind(F,N,B,this);for(var $=0;$<3;++$){var ae=[0,0,0];re[$]>0?ae[$]=R[1][$]:ae[$]=R[0][$];for(var ie=0;ie<2;++ie){var de=($+1+ie)%3,Se=($+1+(ie^1))%3;this.gridEnable[de]&&this._lines.drawGrid(de,Se,this.bounds,ae,this.gridColor[de],this.gridWidth[de]*this.pixelRatio)}for(var ie=0;ie<2;++ie){var de=($+1+ie)%3,Se=($+1+(ie^1))%3;this.zeroEnable[Se]&&Math.min(R[0][Se],R[1][Se])<=0&&Math.max(R[0][Se],R[1][Se])>=0&&this._lines.drawZero(de,Se,this.bounds,ae,this.zeroLineColor[Se],this.zeroLineWidth[Se]*this.pixelRatio)}}for(var $=0;$<3;++$){this.lineEnable[$]&&this._lines.drawAxisLine($,this.bounds,ue[$].primalOffset,this.lineColor[$],this.lineWidth[$]*this.pixelRatio),this.lineMirror[$]&&this._lines.drawAxisLine($,this.bounds,ue[$].mirrorOffset,this.lineColor[$],this.lineWidth[$]*this.pixelRatio);for(var Le=l(d,ue[$].primalMinor),Fe=l(y,ue[$].mirrorMinor),ze=this.lineTickLength,ie=0;ie<3;++ie){var Ye=ne/F[5*ie];Le[ie]*=ze[ie]*Ye,Fe[ie]*=ze[ie]*Ye}this.lineTickEnable[$]&&this._lines.drawAxisTicks($,ue[$].primalOffset,Le,this.lineTickColor[$],this.lineTickWidth[$]*this.pixelRatio),this.lineTickMirror[$]&&this._lines.drawAxisTicks($,ue[$].mirrorOffset,Fe,this.lineTickColor[$],this.lineTickWidth[$]*this.pixelRatio)}this._lines.unbind(),this._text.bind(F,N,B,this.pixelRatio);var st,ct=.5,at,et;function Pe(nt){et=[0,0,0],et[nt]=1}function Ae(nt,Ft,Nt){var Qt=(nt+1)%3,ar=(nt+2)%3,kr=Ft[Qt],Er=Ft[ar],$r=Nt[Qt],Sr=Nt[ar];if(kr>0&&Sr>0){Pe(Qt);return}else if(kr>0&&Sr<0){Pe(Qt);return}else if(kr<0&&Sr>0){Pe(Qt);return}else if(kr<0&&Sr<0){Pe(Qt);return}else if(Er>0&&$r>0){Pe(ar);return}else if(Er>0&&$r<0){Pe(ar);return}else if(Er<0&&$r>0){Pe(ar);return}else if(Er<0&&$r<0){Pe(ar);return}}for(var $=0;$<3;++$){for(var pe=ue[$].primalMinor,Ne=ue[$].mirrorMinor,ut=l(I,ue[$].primalOffset),ie=0;ie<3;++ie)this.lineTickEnable[$]&&(ut[ie]+=ne*pe[ie]*Math.max(this.lineTickLength[ie],0)/F[5*ie]);var dt=[0,0,0];if(dt[$]=1,this.tickEnable[$]){this.tickAngle[$]===-3600?(this.tickAngle[$]=0,this.tickAlign[$]="auto"):this.tickAlign[$]=-1,at=1,st=[this.tickAlign[$],ct,at],st[0]==="auto"?st[0]=u:st[0]=parseInt(""+st[0]),et=[0,0,0],Ae($,pe,Ne);for(var ie=0;ie<3;++ie)ut[ie]+=ne*pe[ie]*this.tickPad[ie]/F[5*ie];this._text.drawTicks($,this.tickSize[$],this.tickAngle[$],ut,this.tickColor[$],dt,et,st)}if(this.labelEnable[$]){at=0,et=[0,0,0],this.labels[$].length>4&&(Pe($),at=1),st=[this.labelAlign[$],ct,at],st[0]==="auto"?st[0]=u:st[0]=parseInt(""+st[0]);for(var ie=0;ie<3;++ie)ut[ie]+=ne*pe[ie]*this.labelPad[ie]/F[5*ie];ut[$]+=.5*(R[0][$]+R[1][$]),this._text.drawLabel($,this.labelSize[$],this.labelAngle[$],ut,this.labelColor[$],[0,0,0],et,st)}}this._text.unbind()},x.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function L(z,F){var N=new g(z);return N.update(F),N}}),3840:(function(e){e.exports=M;var t=0,r=1;function o(_,w,m,u,d,y){this._color=_,this.key=w,this.value=m,this.left=u,this.right=d,this._count=y}function n(_){return new o(_._color,_.key,_.value,_.left,_.right,_._count)}function i(_,w){return new o(_,w.key,w.value,w.left,w.right,w._count)}function a(_){_._count=1+(_.left?_.left._count:0)+(_.right?_.right._count:0)}function s(_,w){this._compare=_,this.root=w}var f=s.prototype;Object.defineProperty(f,"keys",{get:function(){var _=[];return this.forEach(function(w,m){_.push(w)}),_}}),Object.defineProperty(f,"values",{get:function(){var _=[];return this.forEach(function(w,m){_.push(m)}),_}}),Object.defineProperty(f,"length",{get:function(){return this.root?this.root._count:0}}),f.insert=function(_,w){for(var m=this._compare,u=this.root,d=[],y=[];u;){var I=m(_,u.key);d.push(u),y.push(I),I<=0?u=u.left:u=u.right}d.push(new o(t,_,w,null,null,1));for(var L=d.length-2;L>=0;--L){var u=d[L];y[L]<=0?d[L]=new o(u._color,u.key,u.value,d[L+1],u.right,u._count+1):d[L]=new o(u._color,u.key,u.value,u.left,d[L+1],u._count+1)}for(var L=d.length-1;L>1;--L){var z=d[L-1],u=d[L];if(z._color===r||u._color===r)break;var F=d[L-2];if(F.left===z)if(z.left===u){var N=F.right;if(N&&N._color===t)z._color=r,F.right=i(r,N),F._color=t,L-=1;else{if(F._color=t,F.left=z.right,z._color=r,z.right=F,d[L-2]=z,d[L-1]=u,a(F),a(z),L>=3){var B=d[L-3];B.left===F?B.left=z:B.right=z}break}}else{var N=F.right;if(N&&N._color===t)z._color=r,F.right=i(r,N),F._color=t,L-=1;else{if(z.right=u.left,F._color=t,F.left=u.right,u._color=r,u.left=z,u.right=F,d[L-2]=u,d[L-1]=z,a(F),a(z),a(u),L>=3){var B=d[L-3];B.left===F?B.left=u:B.right=u}break}}else if(z.right===u){var N=F.left;if(N&&N._color===t)z._color=r,F.left=i(r,N),F._color=t,L-=1;else{if(F._color=t,F.right=z.left,z._color=r,z.left=F,d[L-2]=z,d[L-1]=u,a(F),a(z),L>=3){var B=d[L-3];B.right===F?B.right=z:B.left=z}break}}else{var N=F.left;if(N&&N._color===t)z._color=r,F.left=i(r,N),F._color=t,L-=1;else{if(z.left=u.right,F._color=t,F.right=u.left,u._color=r,u.right=z,u.left=F,d[L-2]=u,d[L-1]=z,a(F),a(z),a(u),L>=3){var B=d[L-3];B.right===F?B.right=u:B.left=u}break}}}return d[0]._color=r,new s(m,d[0])};function c(_,w){if(w.left){var m=c(_,w.left);if(m)return m}var m=_(w.key,w.value);if(m)return m;if(w.right)return c(_,w.right)}function p(_,w,m,u){var d=w(_,u.key);if(d<=0){if(u.left){var y=p(_,w,m,u.left);if(y)return y}var y=m(u.key,u.value);if(y)return y}if(u.right)return p(_,w,m,u.right)}function v(_,w,m,u,d){var y=m(_,d.key),I=m(w,d.key),L;if(y<=0&&(d.left&&(L=v(_,w,m,u,d.left),L)||I>0&&(L=u(d.key,d.value),L)))return L;if(I>0&&d.right)return v(_,w,m,u,d.right)}f.forEach=function(w,m,u){if(this.root)switch(arguments.length){case 1:return c(w,this.root);case 2:return p(m,this._compare,w,this.root);case 3:return this._compare(m,u)>=0?void 0:v(m,u,this._compare,w,this.root)}},Object.defineProperty(f,"begin",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.left;return new T(this,_)}}),Object.defineProperty(f,"end",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.right;return new T(this,_)}}),f.at=function(_){if(_<0)return new T(this,[]);for(var w=this.root,m=[];;){if(m.push(w),w.left){if(_=w.right._count)break;w=w.right}else break}return new T(this,[])},f.ge=function(_){for(var w=this._compare,m=this.root,u=[],d=0;m;){var y=w(_,m.key);u.push(m),y<=0&&(d=u.length),y<=0?m=m.left:m=m.right}return u.length=d,new T(this,u)},f.gt=function(_){for(var w=this._compare,m=this.root,u=[],d=0;m;){var y=w(_,m.key);u.push(m),y<0&&(d=u.length),y<0?m=m.left:m=m.right}return u.length=d,new T(this,u)},f.lt=function(_){for(var w=this._compare,m=this.root,u=[],d=0;m;){var y=w(_,m.key);u.push(m),y>0&&(d=u.length),y<=0?m=m.left:m=m.right}return u.length=d,new T(this,u)},f.le=function(_){for(var w=this._compare,m=this.root,u=[],d=0;m;){var y=w(_,m.key);u.push(m),y>=0&&(d=u.length),y<0?m=m.left:m=m.right}return u.length=d,new T(this,u)},f.find=function(_){for(var w=this._compare,m=this.root,u=[];m;){var d=w(_,m.key);if(u.push(m),d===0)return new T(this,u);d<=0?m=m.left:m=m.right}return new T(this,[])},f.remove=function(_){var w=this.find(_);return w?w.remove():this},f.get=function(_){for(var w=this._compare,m=this.root;m;){var u=w(_,m.key);if(u===0)return m.value;u<=0?m=m.left:m=m.right}};function T(_,w){this.tree=_,this._stack=w}var l=T.prototype;Object.defineProperty(l,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(l,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),l.clone=function(){return new T(this.tree,this._stack.slice())};function g(_,w){_.key=w.key,_.value=w.value,_.left=w.left,_.right=w.right,_._color=w._color,_._count=w._count}function x(_){for(var w,m,u,d,y=_.length-1;y>=0;--y){if(w=_[y],y===0){w._color=r;return}if(m=_[y-1],m.left===w){if(u=m.right,u.right&&u.right._color===t){if(u=m.right=n(u),d=u.right=n(u.right),m.right=u.left,u.left=m,u.right=d,u._color=m._color,w._color=r,m._color=r,d._color=r,a(m),a(u),y>1){var I=_[y-2];I.left===m?I.left=u:I.right=u}_[y-1]=u;return}else if(u.left&&u.left._color===t){if(u=m.right=n(u),d=u.left=n(u.left),m.right=d.left,u.left=d.right,d.left=m,d.right=u,d._color=m._color,m._color=r,u._color=r,w._color=r,a(m),a(u),a(d),y>1){var I=_[y-2];I.left===m?I.left=d:I.right=d}_[y-1]=d;return}if(u._color===r)if(m._color===t){m._color=r,m.right=i(t,u);return}else{m.right=i(t,u);continue}else{if(u=n(u),m.right=u.left,u.left=m,u._color=m._color,m._color=t,a(m),a(u),y>1){var I=_[y-2];I.left===m?I.left=u:I.right=u}_[y-1]=u,_[y]=m,y+1<_.length?_[y+1]=w:_.push(w),y=y+2}}else{if(u=m.left,u.left&&u.left._color===t){if(u=m.left=n(u),d=u.left=n(u.left),m.left=u.right,u.right=m,u.left=d,u._color=m._color,w._color=r,m._color=r,d._color=r,a(m),a(u),y>1){var I=_[y-2];I.right===m?I.right=u:I.left=u}_[y-1]=u;return}else if(u.right&&u.right._color===t){if(u=m.left=n(u),d=u.right=n(u.right),m.left=d.right,u.right=d.left,d.right=m,d.left=u,d._color=m._color,m._color=r,u._color=r,w._color=r,a(m),a(u),a(d),y>1){var I=_[y-2];I.right===m?I.right=d:I.left=d}_[y-1]=d;return}if(u._color===r)if(m._color===t){m._color=r,m.left=i(t,u);return}else{m.left=i(t,u);continue}else{if(u=n(u),m.left=u.right,u.right=m,u._color=m._color,m._color=t,a(m),a(u),y>1){var I=_[y-2];I.right===m?I.right=u:I.left=u}_[y-1]=u,_[y]=m,y+1<_.length?_[y+1]=w:_.push(w),y=y+2}}}}l.remove=function(){var _=this._stack;if(_.length===0)return this.tree;var w=new Array(_.length),m=_[_.length-1];w[w.length-1]=new o(m._color,m.key,m.value,m.left,m.right,m._count);for(var u=_.length-2;u>=0;--u){var m=_[u];m.left===_[u+1]?w[u]=new o(m._color,m.key,m.value,w[u+1],m.right,m._count):w[u]=new o(m._color,m.key,m.value,m.left,w[u+1],m._count)}if(m=w[w.length-1],m.left&&m.right){var d=w.length;for(m=m.left;m.right;)w.push(m),m=m.right;var y=w[d-1];w.push(new o(m._color,y.key,y.value,m.left,m.right,m._count)),w[d-1].key=m.key,w[d-1].value=m.value;for(var u=w.length-2;u>=d;--u)m=w[u],w[u]=new o(m._color,m.key,m.value,m.left,w[u+1],m._count);w[d-1].left=w[d]}if(m=w[w.length-1],m._color===t){var I=w[w.length-2];I.left===m?I.left=null:I.right===m&&(I.right=null),w.pop();for(var u=0;u0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var _=0,w=this._stack;if(w.length===0){var m=this.tree.root;return m?m._count:0}else w[w.length-1].left&&(_=w[w.length-1].left._count);for(var u=w.length-2;u>=0;--u)w[u+1]===w[u].right&&(++_,w[u].left&&(_+=w[u].left._count));return _},enumerable:!0}),l.next=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.right)for(w=w.right;w;)_.push(w),w=w.left;else for(_.pop();_.length>0&&_[_.length-1].right===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].right)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].left===_[w])return!0;return!1}}),l.update=function(_){var w=this._stack;if(w.length===0)throw new Error("Can't update empty node!");var m=new Array(w.length),u=w[w.length-1];m[m.length-1]=new o(u._color,u.key,_,u.left,u.right,u._count);for(var d=w.length-2;d>=0;--d)u=w[d],u.left===w[d+1]?m[d]=new o(u._color,u.key,u.value,m[d+1],u.right,u._count):m[d]=new o(u._color,u.key,u.value,u.left,m[d+1],u._count);return new s(this.tree._compare,m[0])},l.prev=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.left)for(w=w.left;w;)_.push(w),w=w.right;else for(_.pop();_.length>0&&_[_.length-1].left===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].left)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].right===_[w])return!0;return!1}});function A(_,w){return _w?1:0}function M(_){return new s(_||A,null)}}),3865:(function(e,t,r){var o=r(869);e.exports=n;function n(i,a){return o(i[0].mul(a[1]).add(a[0].mul(i[1])),i[1].mul(a[1]))}}),3952:(function(e,t,r){e.exports=i;var o=r(3250);function n(a,s){for(var f=new Array(s+1),c=0;c20?52:f+32}}),4040:(function(e){e.exports=t;function t(r,o,n,i,a,s,f){var c=1/(o-n),p=1/(i-a),v=1/(s-f);return r[0]=-2*c,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*p,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*v,r[11]=0,r[12]=(o+n)*c,r[13]=(a+i)*p,r[14]=(f+s)*v,r[15]=1,r}}),4041:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=n[0],c=n[1],p=n[2],v=n[3],T=v*i+c*s-p*a,l=v*a+p*i-f*s,g=v*s+f*a-c*i,x=-f*i-c*a-p*s;return r[0]=T*v+x*-f+l*-p-g*-c,r[1]=l*v+x*-c+g*-f-T*-p,r[2]=g*v+x*-p+T*-c-l*-f,r[3]=o[3],r}}),4081:(function(e){e.exports=t;function t(r,o,n,i,a,s,f,c,p,v){var T=o+s+v;if(l>0){var l=Math.sqrt(T+1);r[0]=.5*(f-p)/l,r[1]=.5*(c-i)/l,r[2]=.5*(n-s)/l,r[3]=.5*l}else{var g=Math.max(o,s,v),l=Math.sqrt(2*g-T+1);o>=g?(r[0]=.5*l,r[1]=.5*(a+n)/l,r[2]=.5*(c+i)/l,r[3]=.5*(f-p)/l):s>=g?(r[0]=.5*(n+a)/l,r[1]=.5*l,r[2]=.5*(p+f)/l,r[3]=.5*(c-i)/l):(r[0]=.5*(i+c)/l,r[1]=.5*(f+p)/l,r[2]=.5*l,r[3]=.5*(n-a)/l)}return r}}),4100:(function(e,t,r){var o=r(4437),n=r(3837),i=r(5445),a=r(4449),s=r(3589),f=r(2260),c=r(7169),p=r(351),v=r(4772),T=r(4040),l=r(799),g=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:w,createCamera:o};function x(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function A(u,d){var y=null;try{y=u.getContext("webgl",d),y||(y=u.getContext("experimental-webgl",d))}catch{return null}return y}function M(u){var d=Math.round(Math.log(Math.abs(u))/Math.log(10));if(d<0){var y=Math.round(Math.pow(10,-d));return Math.ceil(u*y)/y}else if(d>0){var y=Math.round(Math.pow(10,d));return Math.ceil(u/y)*y}return Math.ceil(u)}function _(u){return typeof u=="boolean"?u:!0}function w(u){u=u||{},u.camera=u.camera||{};var d=u.canvas;if(!d)if(d=document.createElement("canvas"),u.container){var y=u.container;y.appendChild(d)}else document.body.appendChild(d);var I=u.gl;if(I||(u.glOptions&&(g=!!u.glOptions.preserveDrawingBuffer),I=A(d,u.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:g})),!I)throw new Error("webgl not supported");var L=u.bounds||[[-10,-10,-10],[10,10,10]],z=new x,F=f(I,I.drawingBufferWidth,I.drawingBufferHeight,{preferFloat:!g}),N=l(I),B=u.cameraObject&&u.cameraObject._ortho===!0||u.camera.projection&&u.camera.projection.type==="orthographic"||!1,R={eye:u.camera.eye||[2,0,0],center:u.camera.center||[0,0,0],up:u.camera.up||[0,1,0],zoomMin:u.camera.zoomMax||.1,zoomMax:u.camera.zoomMin||100,mode:u.camera.mode||"turntable",_ortho:B},U=u.axes||{},j=n(I,U);j.enable=!U.disable;var Z=u.spikes||{},re=a(I,Z),fe=[],le=[],ce=[],V=[],ee=!0,te=!0,ne=new Array(16),$=new Array(16),ue={view:null,projection:ne,model:$,_ortho:!1},te=!0,H=[I.drawingBufferWidth,I.drawingBufferHeight],ae=u.cameraObject||o(d,R),ie={gl:I,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:d,selection:z,camera:ae,axes:j,axesPixels:null,spikes:re,bounds:L,objects:fe,shape:H,aspect:u.aspectRatio||[1,1,1],pickRadius:u.pickRadius||10,zNear:u.zNear||.01,zFar:u.zFar||1e3,fovy:u.fovy||Math.PI/4,clearColor:u.clearColor||[0,0,0,0],autoResize:_(u.autoResize),autoBounds:_(u.autoBounds),autoScale:!!u.autoScale,autoCenter:_(u.autoCenter),clipToBounds:_(u.clipToBounds),snapToData:!!u.snapToData,onselect:u.onselect||null,onrender:u.onrender||null,onclick:u.onclick||null,cameraParams:ue,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(et){this.aspect[0]=et.x,this.aspect[1]=et.y,this.aspect[2]=et.z,te=!0},setBounds:function(et,Pe){this.bounds[0][et]=Pe.min,this.bounds[1][et]=Pe.max},setClearColor:function(et){this.clearColor=et},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},de=[I.drawingBufferWidth/ie.pixelRatio|0,I.drawingBufferHeight/ie.pixelRatio|0];function Se(){if(!ie._stopped&&ie.autoResize){var et=d.parentNode,Pe=1,Ae=1;et&&et!==document.body?(Pe=et.clientWidth,Ae=et.clientHeight):(Pe=window.innerWidth,Ae=window.innerHeight);var pe=Math.ceil(Pe*ie.pixelRatio)|0,Ne=Math.ceil(Ae*ie.pixelRatio)|0;if(pe!==d.width||Ne!==d.height){d.width=pe,d.height=Ne;var ut=d.style;ut.position=ut.position||"absolute",ut.left="0px",ut.top="0px",ut.width=Pe+"px",ut.height=Ae+"px",ee=!0}}}ie.autoResize&&Se(),window.addEventListener("resize",Se);function Le(){for(var et=fe.length,Pe=V.length,Ae=0;Ae0&&ce[Pe-1]===0;)ce.pop(),V.pop().dispose()}ie.update=function(et){ie._stopped||(ee=!0,te=!0)},ie.add=function(et){ie._stopped||(et.axes=j,fe.push(et),le.push(-1),ee=!0,te=!0,Le())},ie.remove=function(et){if(!ie._stopped){var Pe=fe.indexOf(et);Pe<0||(fe.splice(Pe,1),le.pop(),ee=!0,te=!0,Le())}},ie.dispose=function(){if(!ie._stopped&&(ie._stopped=!0,window.removeEventListener("resize",Se),d.removeEventListener("webglcontextlost",Fe),ie.mouseListener.enabled=!1,!ie.contextLost)){j.dispose(),re.dispose();for(var et=0;etz.distance)continue;for(var Nt=0;Ntv;){var m=l[w-2],u=l[w-1];if(ml[T+1]:!0}function c(v,T,l,g){v*=2;var x=g[v];return x>1,_=M-g,w=M+g,m=x,u=_,d=M,y=w,I=A,L=v+1,z=T-1,F=0;f(m,u,l)&&(F=m,m=u,u=F),f(y,I,l)&&(F=y,y=I,I=F),f(m,d,l)&&(F=m,m=d,d=F),f(u,d,l)&&(F=u,u=d,d=F),f(m,y,l)&&(F=m,m=y,y=F),f(d,y,l)&&(F=d,d=y,y=F),f(u,I,l)&&(F=u,u=I,I=F),f(u,d,l)&&(F=u,u=d,d=F),f(y,I,l)&&(F=y,y=I,I=F);for(var N=l[2*u],B=l[2*u+1],R=l[2*y],U=l[2*y+1],j=2*m,Z=2*d,re=2*I,fe=2*x,le=2*M,ce=2*A,V=0;V<2;++V){var ee=l[j+V],ne=l[Z+V],$=l[re+V];l[fe+V]=ee,l[le+V]=ne,l[ce+V]=$}i(_,v,l),i(w,T,l);for(var ue=L;ue<=z;++ue)if(c(ue,N,B,l))ue!==L&&n(ue,L,l),++L;else if(!c(ue,R,U,l))for(;;)if(c(z,R,U,l)){c(z,N,B,l)?(a(ue,L,z,l),++L,--z):(n(ue,z,l),--z);break}else{if(--z0)if(x[0]!==M[1][0])A=g,g=g.right;else{var u=p(g.right,x);if(u)return u;g=g.left}else{if(x[0]!==M[1][0])return g;var u=p(g.right,x);if(u)return u;g=g.left}}return A}f.castUp=function(g){var x=o.le(this.coordinates,g[0]);if(x<0)return-1;this.slabs[x];var A=p(this.slabs[x],g),M=-1;if(A&&(M=A.value),this.coordinates[x]===g[0]){var _=null;if(A&&(_=A.key),x>0){var w=p(this.slabs[x-1],g);w&&(_?a(w.key,_)>0&&(_=w.key,M=w.value):(M=w.value,_=w.key))}var m=this.horizontal[x];if(m.length>0){var u=o.ge(m,g[1],c);if(u=m.length)return M;d=m[u]}}if(d.start)if(_){var y=i(_[0],_[1],[g[0],d.y]);_[0][0]>_[1][0]&&(y=-y),y>0&&(M=d.index)}else M=d.index;else d.y!==g[1]&&(M=d.index)}}}return M};function v(g,x,A,M){this.y=g,this.index=x,this.start=A,this.closed=M}function T(g,x,A,M){this.x=g,this.segment=x,this.create=A,this.index=M}function l(g){for(var x=g.length,A=2*x,M=new Array(A),_=0;_Math.abs(u))l.rotate(I,0,0,-m*d*Math.PI*_.rotateSpeed/window.innerWidth);else if(!_._ortho){var L=-_.zoomSpeed*y*u/window.innerHeight*(I-l.lastT())/20;l.pan(I,0,0,x*(Math.exp(L)-1))}}},!0)},_.enableMouseListeners(),_}}),4449:(function(e,t,r){var o=r(2762),n=r(8116),i=r(1493);e.exports=T;var a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,g,x,A){this.gl=l,this.buffer=g,this.vao=x,this.shader=A,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var f=s.prototype,c=[0,0,0],p=[0,0,0],v=[0,0];f.isTransparent=function(){return!1},f.drawTransparent=function(l){},f.draw=function(l){var g=this.gl,x=this.vao,A=this.shader;x.bind(),A.bind();var M=l.model||a,_=l.view||a,w=l.projection||a,m;this.axes&&(m=this.axes.lastCubeProps.axis);for(var u=c,d=p,y=0;y<3;++y)m&&m[y]<0?(u[y]=this.bounds[0][y],d[y]=this.bounds[1][y]):(u[y]=this.bounds[1][y],d[y]=this.bounds[0][y]);v[0]=g.drawingBufferWidth,v[1]=g.drawingBufferHeight,A.uniforms.model=M,A.uniforms.view=_,A.uniforms.projection=w,A.uniforms.coordinates=[this.position,u,d],A.uniforms.colors=this.colors,A.uniforms.screenShape=v;for(var y=0;y<3;++y)A.uniforms.lineWidth=this.lineWidth[y]*this.pixelRatio,this.enabled[y]&&(x.draw(g.TRIANGLES,6,6*y),this.drawSides[y]&&x.draw(g.TRIANGLES,12,18+12*y));x.unbind()},f.update=function(l){l&&("bounds"in l&&(this.bounds=l.bounds),"position"in l&&(this.position=l.position),"lineWidth"in l&&(this.lineWidth=l.lineWidth),"colors"in l&&(this.colors=l.colors),"enabled"in l&&(this.enabled=l.enabled),"drawSides"in l&&(this.drawSides=l.drawSides))},f.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function T(l,g){var x=[];function A(u,d,y,I,L,z){var F=[u,d,y,0,0,0,1];F[I+3]=1,F[I]=L,x.push.apply(x,F),F[6]=-1,x.push.apply(x,F),F[I]=z,x.push.apply(x,F),x.push.apply(x,F),F[6]=1,x.push.apply(x,F),F[I]=L,x.push.apply(x,F)}A(0,0,0,0,0,1),A(0,0,0,1,0,1),A(0,0,0,2,0,1),A(1,0,0,1,-1,1),A(1,0,0,2,-1,1),A(0,1,0,0,-1,1),A(0,1,0,2,-1,1),A(0,0,1,0,-1,1),A(0,0,1,1,-1,1);var M=o(l,x),_=n(l,[{type:l.FLOAT,buffer:M,size:3,offset:0,stride:28},{type:l.FLOAT,buffer:M,size:3,offset:12,stride:28},{type:l.FLOAT,buffer:M,size:1,offset:24,stride:28}]),w=i(l);w.attributes.position.location=0,w.attributes.color.location=1,w.attributes.weight.location=2;var m=new s(l,M,_,w);return m.update(g),m}}),4494:(function(e){e.exports=t;function t(r,o){return r[0]=1/o[0],r[1]=1/o[1],r[2]=1/o[2],r[3]=1/o[3],r}}),4505:(function(e,t,r){e.exports=r(5847)}),4578:(function(e){e.exports=t;function t(r,o,n,i,a){return r[0]=o,r[1]=n,r[2]=i,r[3]=a,r}}),4623:(function(e){"use restrict";e.exports=t;function t(r){this.roots=new Array(r),this.ranks=new Array(r);for(var o=0;o0)return 1<=0)return 1<=0;--l)f[l]=c*o[l]+p*n[l]+v*i[l]+T*a[l];return f}return c*o+p*n+v*i[l]+T*a}function r(o,n,i,a,s,f){var c=s-1,p=s*s,v=c*c,T=(1+2*s)*v,l=s*v,g=p*(3-2*s),x=p*c;if(o.length){f||(f=new Array(o.length));for(var A=o.length-1;A>=0;--A)f[A]=T*o[A]+l*n[A]+g*i[A]+x*a[A];return f}return T*o+l*n+g*i+x*a}e.exports=r,e.exports.derivative=t}),4772:(function(e){e.exports=t;function t(r,o,n,i,a){var s=1/Math.tan(o/2),f=1/(i-a);return r[0]=s/n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(a+i)*f,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*a*i*f,r[15]=0,r}}),4793:(function(e,t,r){function o(xe,ye){if(!(xe instanceof ye))throw new TypeError("Cannot call a class as a function")}function n(xe,ye){for(var Ee=0;Eew)throw new RangeError('The value "'+xe+'" is invalid for option "size"');var ye=new Uint8Array(xe);return Object.setPrototypeOf(ye,d.prototype),ye}function d(xe,ye,Ee){if(typeof xe=="number"){if(typeof ye=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return z(xe)}return y(xe,ye,Ee)}d.poolSize=8192;function y(xe,ye,Ee){if(typeof xe=="string")return F(xe,ye);if(ArrayBuffer.isView(xe))return B(xe);if(xe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+x(xe));if(Ur(xe,ArrayBuffer)||xe&&Ur(xe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ur(xe,SharedArrayBuffer)||xe&&Ur(xe.buffer,SharedArrayBuffer)))return R(xe,ye,Ee);if(typeof xe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Xe=xe.valueOf&&xe.valueOf();if(Xe!=null&&Xe!==xe)return d.from(Xe,ye,Ee);var Qe=U(xe);if(Qe)return Qe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof xe[Symbol.toPrimitive]=="function")return d.from(xe[Symbol.toPrimitive]("string"),ye,Ee);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+x(xe))}d.from=function(xe,ye,Ee){return y(xe,ye,Ee)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function I(xe){if(typeof xe!="number")throw new TypeError('"size" argument must be of type number');if(xe<0)throw new RangeError('The value "'+xe+'" is invalid for option "size"')}function L(xe,ye,Ee){return I(xe),xe<=0?u(xe):ye!==void 0?typeof Ee=="string"?u(xe).fill(ye,Ee):u(xe).fill(ye):u(xe)}d.alloc=function(xe,ye,Ee){return L(xe,ye,Ee)};function z(xe){return I(xe),u(xe<0?0:j(xe)|0)}d.allocUnsafe=function(xe){return z(xe)},d.allocUnsafeSlow=function(xe){return z(xe)};function F(xe,ye){if((typeof ye!="string"||ye==="")&&(ye="utf8"),!d.isEncoding(ye))throw new TypeError("Unknown encoding: "+ye);var Ee=Z(xe,ye)|0,Xe=u(Ee),Qe=Xe.write(xe,ye);return Qe!==Ee&&(Xe=Xe.slice(0,Qe)),Xe}function N(xe){for(var ye=xe.length<0?0:j(xe.length)|0,Ee=u(ye),Xe=0;Xe=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return xe|0}d.isBuffer=function(ye){return ye!=null&&ye._isBuffer===!0&&ye!==d.prototype},d.compare=function(ye,Ee){if(Ur(ye,Uint8Array)&&(ye=d.from(ye,ye.offset,ye.byteLength)),Ur(Ee,Uint8Array)&&(Ee=d.from(Ee,Ee.offset,Ee.byteLength)),!d.isBuffer(ye)||!d.isBuffer(Ee))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ye===Ee)return 0;for(var Xe=ye.length,Qe=Ee.length,Lt=0,Ct=Math.min(Xe,Qe);LtQe.length?(d.isBuffer(Ct)||(Ct=d.from(Ct)),Ct.copy(Qe,Lt)):Uint8Array.prototype.set.call(Qe,Ct,Lt);else if(d.isBuffer(Ct))Ct.copy(Qe,Lt);else throw new TypeError('"list" argument must be an Array of Buffers');Lt+=Ct.length}return Qe};function Z(xe,ye){if(d.isBuffer(xe))return xe.length;if(ArrayBuffer.isView(xe)||Ur(xe,ArrayBuffer))return xe.byteLength;if(typeof xe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+x(xe));var Ee=xe.length,Xe=arguments.length>2&&arguments[2]===!0;if(!Xe&&Ee===0)return 0;for(var Qe=!1;;)switch(ye){case"ascii":case"latin1":case"binary":return Ee;case"utf8":case"utf-8":return ar(xe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ee*2;case"hex":return Ee>>>1;case"base64":return $r(xe).length;default:if(Qe)return Xe?-1:ar(xe).length;ye=(""+ye).toLowerCase(),Qe=!0}}d.byteLength=Z;function re(xe,ye,Ee){var Xe=!1;if((ye===void 0||ye<0)&&(ye=0),ye>this.length||((Ee===void 0||Ee>this.length)&&(Ee=this.length),Ee<=0)||(Ee>>>=0,ye>>>=0,Ee<=ye))return"";for(xe||(xe="utf8");;)switch(xe){case"hex":return Le(this,ye,Ee);case"utf8":case"utf-8":return H(this,ye,Ee);case"ascii":return de(this,ye,Ee);case"latin1":case"binary":return Se(this,ye,Ee);case"base64":return te(this,ye,Ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fe(this,ye,Ee);default:if(Xe)throw new TypeError("Unknown encoding: "+xe);xe=(xe+"").toLowerCase(),Xe=!0}}d.prototype._isBuffer=!0;function fe(xe,ye,Ee){var Xe=xe[ye];xe[ye]=xe[Ee],xe[Ee]=Xe}d.prototype.swap16=function(){var ye=this.length;if(ye%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Ee=0;EeEe&&(ye+=" ... "),""},_&&(d.prototype[_]=d.prototype.inspect),d.prototype.compare=function(ye,Ee,Xe,Qe,Lt){if(Ur(ye,Uint8Array)&&(ye=d.from(ye,ye.offset,ye.byteLength)),!d.isBuffer(ye))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+x(ye));if(Ee===void 0&&(Ee=0),Xe===void 0&&(Xe=ye?ye.length:0),Qe===void 0&&(Qe=0),Lt===void 0&&(Lt=this.length),Ee<0||Xe>ye.length||Qe<0||Lt>this.length)throw new RangeError("out of range index");if(Qe>=Lt&&Ee>=Xe)return 0;if(Qe>=Lt)return-1;if(Ee>=Xe)return 1;if(Ee>>>=0,Xe>>>=0,Qe>>>=0,Lt>>>=0,this===ye)return 0;for(var Ct=Lt-Qe,Ot=Xe-Ee,Kt=Math.min(Ct,Ot),xr=this.slice(Qe,Lt),mr=ye.slice(Ee,Xe),vr=0;vr2147483647?Ee=2147483647:Ee<-2147483648&&(Ee=-2147483648),Ee=+Ee,Mt(Ee)&&(Ee=Qe?0:xe.length-1),Ee<0&&(Ee=xe.length+Ee),Ee>=xe.length){if(Qe)return-1;Ee=xe.length-1}else if(Ee<0)if(Qe)Ee=0;else return-1;if(typeof ye=="string"&&(ye=d.from(ye,Xe)),d.isBuffer(ye))return ye.length===0?-1:ce(xe,ye,Ee,Xe,Qe);if(typeof ye=="number")return ye=ye&255,typeof Uint8Array.prototype.indexOf=="function"?Qe?Uint8Array.prototype.indexOf.call(xe,ye,Ee):Uint8Array.prototype.lastIndexOf.call(xe,ye,Ee):ce(xe,[ye],Ee,Xe,Qe);throw new TypeError("val must be string, number or Buffer")}function ce(xe,ye,Ee,Xe,Qe){var Lt=1,Ct=xe.length,Ot=ye.length;if(Xe!==void 0&&(Xe=String(Xe).toLowerCase(),Xe==="ucs2"||Xe==="ucs-2"||Xe==="utf16le"||Xe==="utf-16le")){if(xe.length<2||ye.length<2)return-1;Lt=2,Ct/=2,Ot/=2,Ee/=2}function Kt(kn,$n){return Lt===1?kn[$n]:kn.readUInt16BE($n*Lt)}var xr;if(Qe){var mr=-1;for(xr=Ee;xrCt&&(Ee=Ct-Ot),xr=Ee;xr>=0;xr--){for(var vr=!0,Nr=0;NrQe&&(Xe=Qe)):Xe=Qe;var Lt=ye.length;Xe>Lt/2&&(Xe=Lt/2);var Ct;for(Ct=0;Ct>>0,isFinite(Xe)?(Xe=Xe>>>0,Qe===void 0&&(Qe="utf8")):(Qe=Xe,Xe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Lt=this.length-Ee;if((Xe===void 0||Xe>Lt)&&(Xe=Lt),ye.length>0&&(Xe<0||Ee<0)||Ee>this.length)throw new RangeError("Attempt to write outside buffer bounds");Qe||(Qe="utf8");for(var Ct=!1;;)switch(Qe){case"hex":return V(this,ye,Ee,Xe);case"utf8":case"utf-8":return ee(this,ye,Ee,Xe);case"ascii":case"latin1":case"binary":return ne(this,ye,Ee,Xe);case"base64":return $(this,ye,Ee,Xe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,ye,Ee,Xe);default:if(Ct)throw new TypeError("Unknown encoding: "+Qe);Qe=(""+Qe).toLowerCase(),Ct=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function te(xe,ye,Ee){return ye===0&&Ee===xe.length?A.fromByteArray(xe):A.fromByteArray(xe.slice(ye,Ee))}function H(xe,ye,Ee){Ee=Math.min(xe.length,Ee);for(var Xe=[],Qe=ye;Qe239?4:Lt>223?3:Lt>191?2:1;if(Qe+Ot<=Ee){var Kt=void 0,xr=void 0,mr=void 0,vr=void 0;switch(Ot){case 1:Lt<128&&(Ct=Lt);break;case 2:Kt=xe[Qe+1],(Kt&192)===128&&(vr=(Lt&31)<<6|Kt&63,vr>127&&(Ct=vr));break;case 3:Kt=xe[Qe+1],xr=xe[Qe+2],(Kt&192)===128&&(xr&192)===128&&(vr=(Lt&15)<<12|(Kt&63)<<6|xr&63,vr>2047&&(vr<55296||vr>57343)&&(Ct=vr));break;case 4:Kt=xe[Qe+1],xr=xe[Qe+2],mr=xe[Qe+3],(Kt&192)===128&&(xr&192)===128&&(mr&192)===128&&(vr=(Lt&15)<<18|(Kt&63)<<12|(xr&63)<<6|mr&63,vr>65535&&vr<1114112&&(Ct=vr))}}Ct===null?(Ct=65533,Ot=1):Ct>65535&&(Ct-=65536,Xe.push(Ct>>>10&1023|55296),Ct=56320|Ct&1023),Xe.push(Ct),Qe+=Ot}return ie(Xe)}var ae=4096;function ie(xe){var ye=xe.length;if(ye<=ae)return String.fromCharCode.apply(String,xe);for(var Ee="",Xe=0;XeXe)&&(Ee=Xe);for(var Qe="",Lt=ye;LtXe&&(ye=Xe),Ee<0?(Ee+=Xe,Ee<0&&(Ee=0)):Ee>Xe&&(Ee=Xe),EeEe)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(ye,Ee,Xe){ye=ye>>>0,Ee=Ee>>>0,Xe||ze(ye,Ee,this.length);for(var Qe=this[ye],Lt=1,Ct=0;++Ct>>0,Ee=Ee>>>0,Xe||ze(ye,Ee,this.length);for(var Qe=this[ye+--Ee],Lt=1;Ee>0&&(Lt*=256);)Qe+=this[ye+--Ee]*Lt;return Qe},d.prototype.readUint8=d.prototype.readUInt8=function(ye,Ee){return ye=ye>>>0,Ee||ze(ye,1,this.length),this[ye]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(ye,Ee){return ye=ye>>>0,Ee||ze(ye,2,this.length),this[ye]|this[ye+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(ye,Ee){return ye=ye>>>0,Ee||ze(ye,2,this.length),this[ye]<<8|this[ye+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(ye,Ee){return ye=ye>>>0,Ee||ze(ye,4,this.length),(this[ye]|this[ye+1]<<8|this[ye+2]<<16)+this[ye+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(ye,Ee){return ye=ye>>>0,Ee||ze(ye,4,this.length),this[ye]*16777216+(this[ye+1]<<16|this[ye+2]<<8|this[ye+3])},d.prototype.readBigUInt64LE=Je(function(ye){ye=ye>>>0,nt(ye,"offset");var Ee=this[ye],Xe=this[ye+7];(Ee===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Qe=Ee+this[++ye]*Math.pow(2,8)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,24),Lt=this[++ye]+this[++ye]*Math.pow(2,8)+this[++ye]*Math.pow(2,16)+Xe*Math.pow(2,24);return BigInt(Qe)+(BigInt(Lt)<>>0,nt(ye,"offset");var Ee=this[ye],Xe=this[ye+7];(Ee===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Qe=Ee*Math.pow(2,24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+this[++ye],Lt=this[++ye]*Math.pow(2,24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+Xe;return(BigInt(Qe)<>>0,Ee=Ee>>>0,Xe||ze(ye,Ee,this.length);for(var Qe=this[ye],Lt=1,Ct=0;++Ct=Lt&&(Qe-=Math.pow(2,8*Ee)),Qe},d.prototype.readIntBE=function(ye,Ee,Xe){ye=ye>>>0,Ee=Ee>>>0,Xe||ze(ye,Ee,this.length);for(var Qe=Ee,Lt=1,Ct=this[ye+--Qe];Qe>0&&(Lt*=256);)Ct+=this[ye+--Qe]*Lt;return Lt*=128,Ct>=Lt&&(Ct-=Math.pow(2,8*Ee)),Ct},d.prototype.readInt8=function(ye,Ee){return ye=ye>>>0,Ee||ze(ye,1,this.length),this[ye]&128?(255-this[ye]+1)*-1:this[ye]},d.prototype.readInt16LE=function(ye,Ee){ye=ye>>>0,Ee||ze(ye,2,this.length);var Xe=this[ye]|this[ye+1]<<8;return Xe&32768?Xe|4294901760:Xe},d.prototype.readInt16BE=function(ye,Ee){ye=ye>>>0,Ee||ze(ye,2,this.length);var Xe=this[ye+1]|this[ye]<<8;return Xe&32768?Xe|4294901760:Xe},d.prototype.readInt32LE=function(ye,Ee){return ye=ye>>>0,Ee||ze(ye,4,this.length),this[ye]|this[ye+1]<<8|this[ye+2]<<16|this[ye+3]<<24},d.prototype.readInt32BE=function(ye,Ee){return ye=ye>>>0,Ee||ze(ye,4,this.length),this[ye]<<24|this[ye+1]<<16|this[ye+2]<<8|this[ye+3]},d.prototype.readBigInt64LE=Je(function(ye){ye=ye>>>0,nt(ye,"offset");var Ee=this[ye],Xe=this[ye+7];(Ee===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Qe=this[ye+4]+this[ye+5]*Math.pow(2,8)+this[ye+6]*Math.pow(2,16)+(Xe<<24);return(BigInt(Qe)<>>0,nt(ye,"offset");var Ee=this[ye],Xe=this[ye+7];(Ee===void 0||Xe===void 0)&&Ft(ye,this.length-8);var Qe=(Ee<<24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+this[++ye];return(BigInt(Qe)<>>0,Ee||ze(ye,4,this.length),M.read(this,ye,!0,23,4)},d.prototype.readFloatBE=function(ye,Ee){return ye=ye>>>0,Ee||ze(ye,4,this.length),M.read(this,ye,!1,23,4)},d.prototype.readDoubleLE=function(ye,Ee){return ye=ye>>>0,Ee||ze(ye,8,this.length),M.read(this,ye,!0,52,8)},d.prototype.readDoubleBE=function(ye,Ee){return ye=ye>>>0,Ee||ze(ye,8,this.length),M.read(this,ye,!1,52,8)};function Ye(xe,ye,Ee,Xe,Qe,Lt){if(!d.isBuffer(xe))throw new TypeError('"buffer" argument must be a Buffer instance');if(ye>Qe||yexe.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(ye,Ee,Xe,Qe){if(ye=+ye,Ee=Ee>>>0,Xe=Xe>>>0,!Qe){var Lt=Math.pow(2,8*Xe)-1;Ye(this,ye,Ee,Xe,Lt,0)}var Ct=1,Ot=0;for(this[Ee]=ye&255;++Ot>>0,Xe=Xe>>>0,!Qe){var Lt=Math.pow(2,8*Xe)-1;Ye(this,ye,Ee,Xe,Lt,0)}var Ct=Xe-1,Ot=1;for(this[Ee+Ct]=ye&255;--Ct>=0&&(Ot*=256);)this[Ee+Ct]=ye/Ot&255;return Ee+Xe},d.prototype.writeUint8=d.prototype.writeUInt8=function(ye,Ee,Xe){return ye=+ye,Ee=Ee>>>0,Xe||Ye(this,ye,Ee,1,255,0),this[Ee]=ye&255,Ee+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(ye,Ee,Xe){return ye=+ye,Ee=Ee>>>0,Xe||Ye(this,ye,Ee,2,65535,0),this[Ee]=ye&255,this[Ee+1]=ye>>>8,Ee+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(ye,Ee,Xe){return ye=+ye,Ee=Ee>>>0,Xe||Ye(this,ye,Ee,2,65535,0),this[Ee]=ye>>>8,this[Ee+1]=ye&255,Ee+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(ye,Ee,Xe){return ye=+ye,Ee=Ee>>>0,Xe||Ye(this,ye,Ee,4,4294967295,0),this[Ee+3]=ye>>>24,this[Ee+2]=ye>>>16,this[Ee+1]=ye>>>8,this[Ee]=ye&255,Ee+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(ye,Ee,Xe){return ye=+ye,Ee=Ee>>>0,Xe||Ye(this,ye,Ee,4,4294967295,0),this[Ee]=ye>>>24,this[Ee+1]=ye>>>16,this[Ee+2]=ye>>>8,this[Ee+3]=ye&255,Ee+4};function st(xe,ye,Ee,Xe,Qe){dt(ye,Xe,Qe,xe,Ee,7);var Lt=Number(ye&BigInt(4294967295));xe[Ee++]=Lt,Lt=Lt>>8,xe[Ee++]=Lt,Lt=Lt>>8,xe[Ee++]=Lt,Lt=Lt>>8,xe[Ee++]=Lt;var Ct=Number(ye>>BigInt(32)&BigInt(4294967295));return xe[Ee++]=Ct,Ct=Ct>>8,xe[Ee++]=Ct,Ct=Ct>>8,xe[Ee++]=Ct,Ct=Ct>>8,xe[Ee++]=Ct,Ee}function ct(xe,ye,Ee,Xe,Qe){dt(ye,Xe,Qe,xe,Ee,7);var Lt=Number(ye&BigInt(4294967295));xe[Ee+7]=Lt,Lt=Lt>>8,xe[Ee+6]=Lt,Lt=Lt>>8,xe[Ee+5]=Lt,Lt=Lt>>8,xe[Ee+4]=Lt;var Ct=Number(ye>>BigInt(32)&BigInt(4294967295));return xe[Ee+3]=Ct,Ct=Ct>>8,xe[Ee+2]=Ct,Ct=Ct>>8,xe[Ee+1]=Ct,Ct=Ct>>8,xe[Ee]=Ct,Ee+8}d.prototype.writeBigUInt64LE=Je(function(ye){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return st(this,ye,Ee,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=Je(function(ye){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ct(this,ye,Ee,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(ye,Ee,Xe,Qe){if(ye=+ye,Ee=Ee>>>0,!Qe){var Lt=Math.pow(2,8*Xe-1);Ye(this,ye,Ee,Xe,Lt-1,-Lt)}var Ct=0,Ot=1,Kt=0;for(this[Ee]=ye&255;++Ct>0)-Kt&255;return Ee+Xe},d.prototype.writeIntBE=function(ye,Ee,Xe,Qe){if(ye=+ye,Ee=Ee>>>0,!Qe){var Lt=Math.pow(2,8*Xe-1);Ye(this,ye,Ee,Xe,Lt-1,-Lt)}var Ct=Xe-1,Ot=1,Kt=0;for(this[Ee+Ct]=ye&255;--Ct>=0&&(Ot*=256);)ye<0&&Kt===0&&this[Ee+Ct+1]!==0&&(Kt=1),this[Ee+Ct]=(ye/Ot>>0)-Kt&255;return Ee+Xe},d.prototype.writeInt8=function(ye,Ee,Xe){return ye=+ye,Ee=Ee>>>0,Xe||Ye(this,ye,Ee,1,127,-128),ye<0&&(ye=255+ye+1),this[Ee]=ye&255,Ee+1},d.prototype.writeInt16LE=function(ye,Ee,Xe){return ye=+ye,Ee=Ee>>>0,Xe||Ye(this,ye,Ee,2,32767,-32768),this[Ee]=ye&255,this[Ee+1]=ye>>>8,Ee+2},d.prototype.writeInt16BE=function(ye,Ee,Xe){return ye=+ye,Ee=Ee>>>0,Xe||Ye(this,ye,Ee,2,32767,-32768),this[Ee]=ye>>>8,this[Ee+1]=ye&255,Ee+2},d.prototype.writeInt32LE=function(ye,Ee,Xe){return ye=+ye,Ee=Ee>>>0,Xe||Ye(this,ye,Ee,4,2147483647,-2147483648),this[Ee]=ye&255,this[Ee+1]=ye>>>8,this[Ee+2]=ye>>>16,this[Ee+3]=ye>>>24,Ee+4},d.prototype.writeInt32BE=function(ye,Ee,Xe){return ye=+ye,Ee=Ee>>>0,Xe||Ye(this,ye,Ee,4,2147483647,-2147483648),ye<0&&(ye=4294967295+ye+1),this[Ee]=ye>>>24,this[Ee+1]=ye>>>16,this[Ee+2]=ye>>>8,this[Ee+3]=ye&255,Ee+4},d.prototype.writeBigInt64LE=Je(function(ye){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return st(this,ye,Ee,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=Je(function(ye){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return ct(this,ye,Ee,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function at(xe,ye,Ee,Xe,Qe,Lt){if(Ee+Xe>xe.length)throw new RangeError("Index out of range");if(Ee<0)throw new RangeError("Index out of range")}function et(xe,ye,Ee,Xe,Qe){return ye=+ye,Ee=Ee>>>0,Qe||at(xe,ye,Ee,4),M.write(xe,ye,Ee,Xe,23,4),Ee+4}d.prototype.writeFloatLE=function(ye,Ee,Xe){return et(this,ye,Ee,!0,Xe)},d.prototype.writeFloatBE=function(ye,Ee,Xe){return et(this,ye,Ee,!1,Xe)};function Pe(xe,ye,Ee,Xe,Qe){return ye=+ye,Ee=Ee>>>0,Qe||at(xe,ye,Ee,8),M.write(xe,ye,Ee,Xe,52,8),Ee+8}d.prototype.writeDoubleLE=function(ye,Ee,Xe){return Pe(this,ye,Ee,!0,Xe)},d.prototype.writeDoubleBE=function(ye,Ee,Xe){return Pe(this,ye,Ee,!1,Xe)},d.prototype.copy=function(ye,Ee,Xe,Qe){if(!d.isBuffer(ye))throw new TypeError("argument should be a Buffer");if(Xe||(Xe=0),!Qe&&Qe!==0&&(Qe=this.length),Ee>=ye.length&&(Ee=ye.length),Ee||(Ee=0),Qe>0&&Qe=this.length)throw new RangeError("Index out of range");if(Qe<0)throw new RangeError("sourceEnd out of bounds");Qe>this.length&&(Qe=this.length),ye.length-Ee>>0,Xe=Xe===void 0?this.length:Xe>>>0,ye||(ye=0);var Ct;if(typeof ye=="number")for(Ct=Ee;CtMath.pow(2,32)?Qe=Ne(String(Ee)):typeof Ee=="bigint"&&(Qe=String(Ee),(Ee>Math.pow(BigInt(2),BigInt(32))||Ee<-Math.pow(BigInt(2),BigInt(32)))&&(Qe=Ne(Qe)),Qe+="n"),Xe+=" It must be ".concat(ye,". Received ").concat(Qe),Xe},RangeError);function Ne(xe){for(var ye="",Ee=xe.length,Xe=xe[0]==="-"?1:0;Ee>=Xe+4;Ee-=3)ye="_".concat(xe.slice(Ee-3,Ee)).concat(ye);return"".concat(xe.slice(0,Ee)).concat(ye)}function ut(xe,ye,Ee){nt(ye,"offset"),(xe[ye]===void 0||xe[ye+Ee]===void 0)&&Ft(ye,xe.length-(Ee+1))}function dt(xe,ye,Ee,Xe,Qe,Lt){if(xe>Ee||xe= 0".concat(Ct," and < 2").concat(Ct," ** ").concat((Lt+1)*8).concat(Ct):Ot=">= -(2".concat(Ct," ** ").concat((Lt+1)*8-1).concat(Ct,") and < 2 ** ")+"".concat((Lt+1)*8-1).concat(Ct),new Ae.ERR_OUT_OF_RANGE("value",Ot,xe)}ut(Xe,Qe,Lt)}function nt(xe,ye){if(typeof xe!="number")throw new Ae.ERR_INVALID_ARG_TYPE(ye,"number",xe)}function Ft(xe,ye,Ee){throw Math.floor(xe)!==xe?(nt(xe,Ee),new Ae.ERR_OUT_OF_RANGE("offset","an integer",xe)):ye<0?new Ae.ERR_BUFFER_OUT_OF_BOUNDS:new Ae.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(ye),xe)}var Nt=/[^+/0-9A-Za-z-_]/g;function Qt(xe){if(xe=xe.split("=")[0],xe=xe.trim().replace(Nt,""),xe.length<2)return"";for(;xe.length%4!==0;)xe=xe+"=";return xe}function ar(xe,ye){ye=ye||1/0;for(var Ee,Xe=xe.length,Qe=null,Lt=[],Ct=0;Ct55295&&Ee<57344){if(!Qe){if(Ee>56319){(ye-=3)>-1&&Lt.push(239,191,189);continue}else if(Ct+1===Xe){(ye-=3)>-1&&Lt.push(239,191,189);continue}Qe=Ee;continue}if(Ee<56320){(ye-=3)>-1&&Lt.push(239,191,189),Qe=Ee;continue}Ee=(Qe-55296<<10|Ee-56320)+65536}else Qe&&(ye-=3)>-1&&Lt.push(239,191,189);if(Qe=null,Ee<128){if((ye-=1)<0)break;Lt.push(Ee)}else if(Ee<2048){if((ye-=2)<0)break;Lt.push(Ee>>6|192,Ee&63|128)}else if(Ee<65536){if((ye-=3)<0)break;Lt.push(Ee>>12|224,Ee>>6&63|128,Ee&63|128)}else if(Ee<1114112){if((ye-=4)<0)break;Lt.push(Ee>>18|240,Ee>>12&63|128,Ee>>6&63|128,Ee&63|128)}else throw new Error("Invalid code point")}return Lt}function kr(xe){for(var ye=[],Ee=0;Ee>8,Qe=Ee%256,Lt.push(Qe),Lt.push(Xe);return Lt}function $r(xe){return A.toByteArray(Qt(xe))}function Sr(xe,ye,Ee,Xe){var Qe;for(Qe=0;Qe=ye.length||Qe>=xe.length);++Qe)ye[Qe+Ee]=xe[Qe];return Qe}function Ur(xe,ye){return xe instanceof ye||xe!=null&&xe.constructor!=null&&xe.constructor.name!=null&&xe.constructor.name===ye.name}function Mt(xe){return xe!==xe}var je=(function(){for(var xe="0123456789abcdef",ye=new Array(256),Ee=0;Ee<16;++Ee)for(var Xe=Ee*16,Qe=0;Qe<16;++Qe)ye[Xe+Qe]=xe[Ee]+xe[Qe];return ye})();function Je(xe){return typeof BigInt>"u"?ke:xe}function ke(){throw new Error("BigInt not supported")}}),4844:(function(e){e.exports=t;function t(r,o,n,i){return r[0]=o[0]+n[0]*i,r[1]=o[1]+n[1]*i,r[2]=o[2]+n[2]*i,r[3]=o[3]+n[3]*i,r}}),4905:(function(e,t,r){var o=r(5874);e.exports=n;function n(i,a){var s=o(a),f=[];return f=f.concat(s(i)),f=f.concat(s(null)),f}}),4935:(function(e,t,r){e.exports=g;var o=r(2762),n=r(8116),i=r(4359),a=r(1879).Q,s=window||process.global||{},f=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var c=3;function p(x,A,M,_){this.gl=x,this.shader=A,this.buffer=M,this.vao=_,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var v=p.prototype,T=[0,0];v.bind=function(x,A,M,_){this.vao.bind(),this.shader.bind();var w=this.shader.uniforms;w.model=x,w.view=A,w.projection=M,w.pixelScale=_,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},v.unbind=function(){this.vao.unbind()},v.update=function(x,A,M,_,w){var m=[];function u(U,j,Z,re,fe,le){var ce=[Z.style,Z.weight,Z.variant,Z.family].join("_"),V=f[ce];V||(V=f[ce]={});var ee=V[j];ee||(ee=V[j]=l(j,{triangles:!0,font:Z.family,fontStyle:Z.style,fontWeight:Z.weight,fontVariant:Z.variant,textAlign:"center",textBaseline:"middle",lineSpacing:fe,styletags:le}));for(var ne=(re||12)/12,$=ee.positions,ue=ee.cells,te=0,H=ue.length;te=0;--ie){var de=$[ae[ie]];m.push(ne*de[0],-ne*de[1],U)}}for(var d=[0,0,0],y=[0,0,0],I=[0,0,0],L=[0,0,0],z=1.25,F={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},N=0;N<3;++N){I[N]=m.length/c|0,u(.5*(x[0][N]+x[1][N]),A[N],M[N],12,z,F),L[N]=(m.length/c|0)-I[N],d[N]=m.length/c|0;for(var B=0;B<_[N].length;++B)if(_[N][B].text){var R={family:_[N][B].font||w[N].family,style:w[N].fontStyle||w[N].style,weight:w[N].fontWeight||w[N].weight,variant:w[N].fontVariant||w[N].variant};u(_[N][B].x,_[N][B].text,R,_[N][B].fontSize||12,z,F)}y[N]=(m.length/c|0)-d[N]}this.buffer.update(m),this.tickOffset=d,this.tickCount=y,this.labelOffset=I,this.labelCount=L},v.drawTicks=function(x,A,M,_,w,m,u,d){this.tickCount[x]&&(this.shader.uniforms.axis=m,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=A,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=d,this.vao.draw(this.gl.TRIANGLES,this.tickCount[x],this.tickOffset[x]))},v.drawLabel=function(x,A,M,_,w,m,u,d){this.labelCount[x]&&(this.shader.uniforms.axis=m,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=A,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=d,this.vao.draw(this.gl.TRIANGLES,this.labelCount[x],this.labelOffset[x]))},v.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function l(x,A){try{return i(x,A)}catch(M){return console.warn('error vectorizing text:"'+x+'" error:',M),{cells:[],positions:[]}}}function g(x,A,M,_,w,m){var u=o(x),d=n(x,[{buffer:u,size:3}]),y=a(x);y.attributes.position.location=0;var I=new p(x,y,u,d);return I.update(A,M,_,w,m),I}}),5023:(function(e,t,r){var o=r(2478);e.exports=c;function n(p,v,T,l,g,x,A){this.cells=p,this.neighbor=v,this.flags=l,this.constraint=T,this.active=g,this.next=x,this.boundary=A}var i=n.prototype;function a(p,v){return p[0]-v[0]||p[1]-v[1]||p[2]-v[2]}i.locate=(function(){var p=[0,0,0];return function(v,T,l){var g=v,x=T,A=l;return T0||A.length>0;){for(;x.length>0;){var u=x.pop();if(M[u]!==-g){M[u]=g,_[u];for(var d=0;d<3;++d){var y=m[3*u+d];y>=0&&M[y]===0&&(w[3*u+d]?A.push(y):(x.push(y),M[y]=g))}}}var I=A;A=x,x=I,A.length=0,g=-g}var L=f(_,M,v);return T?L.concat(l.boundary):L}}),5033:(function(e){e.exports=t;function t(r,o,n){var i=o||0,a=n||1;return[[r[12]+r[0],r[13]+r[1],r[14]+r[2],r[15]+r[3]],[r[12]-r[0],r[13]-r[1],r[14]-r[2],r[15]-r[3]],[r[12]+r[4],r[13]+r[5],r[14]+r[6],r[15]+r[7]],[r[12]-r[4],r[13]-r[5],r[14]-r[6],r[15]-r[7]],[i*r[12]+r[8],i*r[13]+r[9],i*r[14]+r[10],i*r[15]+r[11]],[a*r[12]-r[8],a*r[13]-r[9],a*r[14]-r[10],a*r[15]-r[11]]]}}),5085:(function(e,t,r){e.exports=g;var o=r(3250)[3],n=r(4209),i=r(3352),a=r(2478);function s(){return!0}function f(x){return function(A,M){var _=x[A];return _?!!_.queryPoint(M,s):!1}}function c(x){for(var A={},M=0;M0&&A[_]===M[0])w=x[_-1];else return 1;for(var m=1;w;){var u=w.key,d=o(M,u[0],u[1]);if(u[0][0]0)m=-1,w=w.right;else return 0;else if(d>0)w=w.left;else if(d<0)m=1,w=w.right;else return 0}return m}}function v(x){return 1}function T(x){return function(M){return x(M[0],M[1])?0:1}}function l(x,A){return function(_){return x(_[0],_[1])?0:A(_)}}function g(x){for(var A=x.length,M=[],_=[],w=0;w"u"?r(606):WeakMap,a=new i,s=0;function f(A,M,_,w,m,u,d){this.id=A,this.src=M,this.type=_,this.shader=w,this.count=u,this.programs=[],this.cache=d}f.prototype.dispose=function(){if(--this.count===0){for(var A=this.cache,M=A.gl,_=this.programs,w=0,m=_.length;w0&&(f=1/Math.sqrt(f),r[0]=n*f,r[1]=i*f,r[2]=a*f,r[3]=s*f),r}}),5202:(function(e,t,r){var o=r(1944),n=r(8210);e.exports=s,e.exports.positive=f,e.exports.negative=c;function i(p,v){var T=n(o(p,v),[v[v.length-1]]);return T[T.length-1]}function a(p,v,T,l){var g=l-v,x=-v/g;x<0?x=0:x>1&&(x=1);for(var A=1-x,M=p.length,_=new Array(M),w=0;w0||g>0&&_<0){var w=a(x,_,A,g);T.push(w),l.push(w.slice())}_<0?l.push(A.slice()):_>0?T.push(A.slice()):(T.push(A.slice()),l.push(A.slice())),g=_}return{positive:T,negative:l}}function f(p,v){for(var T=[],l=i(p[p.length-1],v),g=p[p.length-1],x=p[0],A=0;A0||l>0&&M<0)&&T.push(a(g,M,x,l)),M>=0&&T.push(x.slice()),l=M}return T}function c(p,v){for(var T=[],l=i(p[p.length-1],v),g=p[p.length-1],x=p[0],A=0;A0||l>0&&M<0)&&T.push(a(g,M,x,l)),M<=0&&T.push(x.slice()),l=M}return T}}),5219:(function(e){e.exports=function(t){for(var r=t.length,o,n=0;n13)&&o!==32&&o!==133&&o!==160&&o!==5760&&o!==6158&&(o<8192||o>8205)&&o!==8232&&o!==8233&&o!==8239&&o!==8287&&o!==8288&&o!==12288&&o!==65279)return!1;return!0}}),5250:(function(e){e.exports=r;var t=+(Math.pow(2,27)+1);function r(o,n,i){var a=o*n,s=t*o,f=s-o,c=s-f,p=o-c,v=t*n,T=v-n,l=v-T,g=n-l,x=a-c*l,A=x-p*l,M=A-c*g,_=p*g-M;return i?(i[0]=_,i[1]=a,i):[_,a]}}),5298:(function(e,t){var r={"float64,2,1,0":function(){return function(p,v,T,l,g){var x=p[0],A=p[1],M=p[2],_=T[0],w=T[1],m=T[2];l|=0;var u=0,d=0,y=0,I=m,L=w-M*m,z=_-A*w;for(y=0;y0;){B<64?(_=B,B=0):(_=64,B-=64);for(var R=p[1]|0;R>0;){R<64?(w=R,R=0):(w=64,R-=64),l=F+B*u+R*d,A=N+B*I+R*L;var U=0,j=0,Z=0,re=y,fe=u-m*y,le=d-_*u,ce=z,V=I-m*z,ee=L-_*I;for(Z=0;Z0;){L<64?(_=L,L=0):(_=64,L-=64);for(var z=p[0]|0;z>0;){z<64?(M=z,z=0):(M=64,z-=64),l=y+L*m+z*w,A=I+L*d+z*u;var F=0,N=0,B=m,R=w-_*m,U=d,j=u-_*d;for(N=0;N0;){N<64?(w=N,N=0):(w=64,N-=64);for(var B=p[0]|0;B>0;){B<64?(M=B,B=0):(M=64,B-=64);for(var R=p[1]|0;R>0;){R<64?(_=R,R=0):(_=64,R-=64),l=z+N*d+B*m+R*u,A=F+N*L+B*y+R*I;var U=0,j=0,Z=0,re=d,fe=m-w*d,le=u-M*m,ce=L,V=y-w*L,ee=I-M*y;for(Z=0;Z<_;++Z){for(j=0;j=0}})(),i.removeTriangle=function(f,c,p){var v=this.stars;a(v[f],c,p),a(v[c],p,f),a(v[p],f,c)},i.addTriangle=function(f,c,p){var v=this.stars;v[f].push(c,p),v[c].push(p,f),v[p].push(f,c)},i.opposite=function(f,c){for(var p=this.stars[c],v=1,T=p.length;v0;){var l=p.pop();f[l]=!1;for(var g=s[l],v=0;v0){for(var ce=0;ce<24;++ce)L.push(L[L.length-12]);B+=2,re=!0}continue e}R[0][y]=Math.min(R[0][y],fe[y],le[y]),R[1][y]=Math.max(R[1][y],fe[y],le[y])}var V,ee;Array.isArray(j[0])?(V=j.length>d-1?j[d-1]:j.length>0?j[j.length-1]:[0,0,0,1],ee=j.length>d?j[d]:j.length>0?j[j.length-1]:[0,0,0,1]):V=ee=j,V.length===3&&(V=[V[0],V[1],V[2],1]),ee.length===3&&(ee=[ee[0],ee[1],ee[2],1]),!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0);var ne;Array.isArray(Z)?ne=Z.length>d-1?Z[d-1]:Z.length>0?Z[Z.length-1]:[0,0,0,1]:ne=Z;var $=N;if(N+=x(fe,le),re){for(y=0;y<2;++y)L.push(fe[0],fe[1],fe[2],le[0],le[1],le[2],$,ne,V[0],V[1],V[2],V[3]);B+=2,re=!1}L.push(fe[0],fe[1],fe[2],le[0],le[1],le[2],$,ne,V[0],V[1],V[2],V[3],fe[0],fe[1],fe[2],le[0],le[1],le[2],$,-ne,V[0],V[1],V[2],V[3],le[0],le[1],le[2],fe[0],fe[1],fe[2],N,-ne,ee[0],ee[1],ee[2],ee[3],le[0],le[1],le[2],fe[0],fe[1],fe[2],N,ne,ee[0],ee[1],ee[2],ee[3]),B+=4}}if(this.buffer.update(L),z.push(N),F.push(U[U.length-1].slice()),this.bounds=R,this.vertexCount=B,this.points=F,this.arcLength=z,"dashes"in u){var ue=u.dashes,te=ue.slice();for(te.unshift(0),d=1;dr[n][0]&&(n=i);return on?[[n],[o]]:[[o]]}}),5771:(function(e,t,r){var o=r(8507),n=r(3788),i=r(2419);e.exports=a;function a(s){s.sort(n);for(var f=s.length,c=0,p=0;p0){var l=s[c-1];if(o(v,l)===0&&i(l)!==T){c-=1;continue}}s[c++]=v}}return s.length=c,s}}),5838:(function(e,t,r){e.exports=n;var o=r(7842);function n(i){for(var a=new Array(i.length),s=0;s0)continue;Ne=Pe.slice(0,1).join("")}return te(Ne),re+=Ne.length,R=R.slice(Ne.length),R.length}while(!0)}function st(){return/[^a-fA-F0-9]/.test(N)?(te(R.join("")),F=f,L):(R.push(N),B=N,L+1)}function ct(){return N==="."||/[eE]/.test(N)?(R.push(N),F=x,B=N,L+1):N==="x"&&R.length===1&&R[0]==="0"?(F=u,R.push(N),B=N,L+1):/[^\d]/.test(N)?(te(R.join("")),F=f,L):(R.push(N),B=N,L+1)}function at(){return N==="f"&&(R.push(N),B=N,L+=1),/[eE]/.test(N)||(N==="-"||N==="+")&&/[eE]/.test(B)?(R.push(N),B=N,L+1):/[^\d]/.test(N)?(te(R.join("")),F=f,L):(R.push(N),B=N,L+1)}function et(){if(/[^\d\w_]/.test(N)){var Pe=R.join("");return ue[Pe]?F=_:$[Pe]?F=M:F=A,te(R.join("")),F=f,L}return R.push(N),B=N,L+1}}}),5878:(function(e,t,r){e.exports=a;var o=r(3250),n=r(2014);function i(s,f,c){var p=Math.abs(o(s,f,c)),v=Math.sqrt(Math.pow(f[0]-c[0],2)+Math.pow(f[1]-c[1],2));return p/v}function a(s,f,c){for(var p=f.length,v=s.length,T=new Array(p),l=new Array(p),g=new Array(p),x=new Array(p),A=0;A>1:(ce>>1)-1}function I(ce){for(var V=d(ce);;){var ee=V,ne=2*ce+1,$=2*(ce+1),ue=ce;if(ne0;){var ee=y(ce);if(ee>=0){var ne=d(ee);if(V0){var ce=B[0];return u(0,j-1),j-=1,I(0),ce}return-1}function F(ce,V){var ee=B[ce];return g[ee]===V?ce:(g[ee]=-1/0,L(ce),z(),g[ee]=V,j+=1,L(j-1))}function N(ce){if(!x[ce]){x[ce]=!0;var V=T[ce],ee=l[ce];T[ee]>=0&&(T[ee]=V),l[V]>=0&&(l[V]=ee),R[V]>=0&&F(R[V],m(V)),R[ee]>=0&&F(R[ee],m(ee))}}for(var B=[],R=new Array(p),A=0;A>1;A>=0;--A)I(A);for(;;){var Z=z();if(Z<0||g[Z]>c)break;N(Z)}for(var re=[],A=0;A=0&&ee>=0&&V!==ee){var ne=R[V],$=R[ee];ne!==$&&le.push([ne,$])}}),n.unique(n.normalize(le)),{positions:re,edges:le}}}),5911:(function(e){e.exports=t;function t(r,o,n){var i=o[0],a=o[1],s=o[2],f=n[0],c=n[1],p=n[2];return r[0]=a*p-s*c,r[1]=s*f-i*p,r[2]=i*c-a*f,r}}),5964:(function(e){e.exports=function(t){return!t&&t!==0?"":t.toString()}}),5995:(function(e,t,r){e.exports=i;var o=r(7642),n=r(6037);function i(a,s){return o(s).filter(function(f){for(var c=new Array(f.length),p=0;p2&&d[1]>2&&w(u.pick(-1,-1).lo(1,1).hi(d[0]-2,d[1]-2),m.pick(-1,-1,0).lo(1,1).hi(d[0]-2,d[1]-2),m.pick(-1,-1,1).lo(1,1).hi(d[0]-2,d[1]-2)),d[1]>2&&(_(u.pick(0,-1).lo(1).hi(d[1]-2),m.pick(0,-1,1).lo(1).hi(d[1]-2)),M(m.pick(0,-1,0).lo(1).hi(d[1]-2))),d[1]>2&&(_(u.pick(d[0]-1,-1).lo(1).hi(d[1]-2),m.pick(d[0]-1,-1,1).lo(1).hi(d[1]-2)),M(m.pick(d[0]-1,-1,0).lo(1).hi(d[1]-2))),d[0]>2&&(_(u.pick(-1,0).lo(1).hi(d[0]-2),m.pick(-1,0,0).lo(1).hi(d[0]-2)),M(m.pick(-1,0,1).lo(1).hi(d[0]-2))),d[0]>2&&(_(u.pick(-1,d[1]-1).lo(1).hi(d[0]-2),m.pick(-1,d[1]-1,0).lo(1).hi(d[0]-2)),M(m.pick(-1,d[1]-1,1).lo(1).hi(d[0]-2))),m.set(0,0,0,0),m.set(0,0,1,0),m.set(d[0]-1,0,0,0),m.set(d[0]-1,0,1,0),m.set(0,d[1]-1,0,0),m.set(0,d[1]-1,1,0),m.set(d[0]-1,d[1]-1,0,0),m.set(d[0]-1,d[1]-1,1,0),m}}function x(A){var M=A.join(),d=p[M];if(d)return d;for(var _=A.length,w=[v,T],m=1;m<=_;++m)w.push(l(m));var u=g,d=u.apply(void 0,w);return p[M]=d,d}e.exports=function(M,_,w){if(Array.isArray(w)||(typeof w=="string"?w=o(_.dimension,w):w=o(_.dimension,"clamp")),_.size===0)return M;if(_.dimension===0)return M.set(0),M;var m=x(w);return m(M,_)}}),6204:(function(e){e.exports=t;function t(r){var o,n,i,a=r.length,s=0;for(o=0;op&&(p=o.length(L)),y&&!d){var z=2*o.distance(M,I)/(o.length(_)+o.length(L));z?(m=Math.min(m,z),u=!1):u=!0}u||(M=I,_=L),w.push(L)}var F=[v,l,x],N=[T,g,A];a&&(a[0]=F,a[1]=N),p===0&&(p=1);var B=1/p;isFinite(m)||(m=1),c.vectorScale=m;var R=i.coneSize||(d?1:.5);i.absoluteConeSize&&(R=i.absoluteConeSize*B),c.coneScale=R;for(var y=0,U=0;yre&&(N|=1<re){N|=1<c[L][1])&&(ue=L);for(var te=-1,L=0;L<3;++L){var H=ue^1<c[ae][0]&&(ae=H)}}var ie=x;ie[0]=ie[1]=ie[2]=0,ie[o.log2(te^ue)]=ue&te,ie[o.log2(ue^ae)]=ue&ae;var de=ae^7;de===N||de===$?(de=te^7,ie[o.log2(ae^de)]=de&ae):ie[o.log2(te^de)]=de&te;for(var Se=A,Le=N,U=0;U<3;++U)Le&1<=0&&(c=s.length-f-1);var p=Math.pow(10,c),v=Math.round(i*a*p),T=v+"";if(T.indexOf("e")>=0)return T;var l=v/p,g=v%p;v<0?(l=-Math.ceil(l)|0,g=-g|0):(l=Math.floor(l)|0,g=g|0);var x=""+l;if(v<0&&(x="-"+x),c){for(var A=""+g;A.length=i[0][f];--p)c.push({x:p*a[f],text:r(a[f],p)});s.push(c)}return s}function n(i,a){for(var s=0;s<3;++s){if(i[s].length!==a[s].length)return!1;for(var f=0;fM+1)throw new Error(x+" map requires nshades to be at least size "+g.length);Array.isArray(c.alpha)?c.alpha.length!==2?_=[1,1]:_=c.alpha.slice():typeof c.alpha=="number"?_=[c.alpha,c.alpha]:_=[1,1],p=g.map(function(I){return Math.round(I.index*M)}),_[0]=Math.min(Math.max(_[0],0),1),_[1]=Math.min(Math.max(_[1],0),1);var m=g.map(function(I,L){var z=g[L].index,F=g[L].rgb.slice();return F.length===4&&F[3]>=0&&F[3]<=1||(F[3]=_[0]+(_[1]-_[0])*z),F}),u=[];for(w=0;w0?R:U},s.min=function(R,U){return R.cmp(U)<0?R:U},s.prototype._init=function(R,U,j){if(typeof R=="number")return this._initNumber(R,U,j);if(typeof R=="object")return this._initArray(R,U,j);U==="hex"&&(U=16),i(U===(U|0)&&U>=2&&U<=36),R=R.toString().replace(/\s+/g,"");var Z=0;R[0]==="-"&&(Z++,this.negative=1),Z=0;Z-=3)fe=R[Z]|R[Z-1]<<8|R[Z-2]<<16,this.words[re]|=fe<>>26-le&67108863,le+=24,le>=26&&(le-=26,re++);else if(j==="le")for(Z=0,re=0;Z>>26-le&67108863,le+=24,le>=26&&(le-=26,re++);return this.strip()};function c(B,R){var U=B.charCodeAt(R);return U>=65&&U<=70?U-55:U>=97&&U<=102?U-87:U-48&15}function p(B,R,U){var j=c(B,U);return U-1>=R&&(j|=c(B,U-1)<<4),j}s.prototype._parseHex=function(R,U,j){this.length=Math.ceil((R.length-U)/6),this.words=new Array(this.length);for(var Z=0;Z=U;Z-=2)le=p(R,U,Z)<=18?(re-=18,fe+=1,this.words[fe]|=le>>>26):re+=8;else{var ce=R.length-U;for(Z=ce%2===0?U+1:U;Z=18?(re-=18,fe+=1,this.words[fe]|=le>>>26):re+=8}this.strip()};function d(B,R,U,j){for(var Z=0,re=Math.min(B.length,U),fe=R;fe=49?Z+=le-49+10:le>=17?Z+=le-17+10:Z+=le}return Z}s.prototype._parseBase=function(R,U,j){this.words=[0],this.length=1;for(var Z=0,re=1;re<=67108863;re*=U)Z++;Z--,re=re/U|0;for(var fe=R.length-j,le=fe%Z,ce=Math.min(fe,fe-le)+j,V=0,ee=j;ee1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var T=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(R,U){R=R||10,U=U|0||1;var j;if(R===16||R==="hex"){j="";for(var Z=0,re=0,fe=0;fe>>24-Z&16777215,re!==0||fe!==this.length-1?j=T[6-ce.length]+ce+j:j=ce+j,Z+=2,Z>=26&&(Z-=26,fe--)}for(re!==0&&(j=re.toString(16)+j);j.length%U!==0;)j="0"+j;return this.negative!==0&&(j="-"+j),j}if(R===(R|0)&&R>=2&&R<=36){var V=l[R],ee=g[R];j="";var ne=this.clone();for(ne.negative=0;!ne.isZero();){var K=ne.modn(ee).toString(R);ne=ne.idivn(ee),ne.isZero()?j=K+j:j=T[V-K.length]+K+j}for(this.isZero()&&(j="0"+j);j.length%U!==0;)j="0"+j;return this.negative!==0&&(j="-"+j),j}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var R=this.words[0];return this.length===2?R+=this.words[1]*67108864:this.length===3&&this.words[2]===1?R+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-R:R},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(R,U){return i(typeof f<"u"),this.toArrayLike(f,R,U)},s.prototype.toArray=function(R,U){return this.toArrayLike(Array,R,U)},s.prototype.toArrayLike=function(R,U,j){var Z=this.byteLength(),re=j||Math.max(1,Z);i(Z<=re,"byte array longer than desired length"),i(re>0,"Requested array length <= 0"),this.strip();var fe=U==="le",le=new R(re),ce,V,ee=this.clone();if(fe){for(V=0;!ee.isZero();V++)ce=ee.andln(255),ee.iushrn(8),le[V]=ce;for(;V=4096&&(j+=13,U>>>=13),U>=64&&(j+=7,U>>>=7),U>=8&&(j+=4,U>>>=4),U>=2&&(j+=2,U>>>=2),j+U},s.prototype._zeroBits=function(R){if(R===0)return 26;var U=R,j=0;return(U&8191)===0&&(j+=13,U>>>=13),(U&127)===0&&(j+=7,U>>>=7),(U&15)===0&&(j+=4,U>>>=4),(U&3)===0&&(j+=2,U>>>=2),(U&1)===0&&j++,j},s.prototype.bitLength=function(){var R=this.words[this.length-1],U=this._countBits(R);return(this.length-1)*26+U};function x(B){for(var R=new Array(B.bitLength()),U=0;U>>Z}return R}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var R=0,U=0;UR.length?this.clone().ior(R):R.clone().ior(this)},s.prototype.uor=function(R){return this.length>R.length?this.clone().iuor(R):R.clone().iuor(this)},s.prototype.iuand=function(R){var U;this.length>R.length?U=R:U=this;for(var j=0;jR.length?this.clone().iand(R):R.clone().iand(this)},s.prototype.uand=function(R){return this.length>R.length?this.clone().iuand(R):R.clone().iuand(this)},s.prototype.iuxor=function(R){var U,j;this.length>R.length?(U=this,j=R):(U=R,j=this);for(var Z=0;ZR.length?this.clone().ixor(R):R.clone().ixor(this)},s.prototype.uxor=function(R){return this.length>R.length?this.clone().iuxor(R):R.clone().iuxor(this)},s.prototype.inotn=function(R){i(typeof R=="number"&&R>=0);var U=Math.ceil(R/26)|0,j=R%26;this._expand(U),j>0&&U--;for(var Z=0;Z0&&(this.words[Z]=~this.words[Z]&67108863>>26-j),this.strip()},s.prototype.notn=function(R){return this.clone().inotn(R)},s.prototype.setn=function(R,U){i(typeof R=="number"&&R>=0);var j=R/26|0,Z=R%26;return this._expand(j+1),U?this.words[j]=this.words[j]|1<R.length?(j=this,Z=R):(j=R,Z=this);for(var re=0,fe=0;fe>>26;for(;re!==0&&fe>>26;if(this.length=j.length,re!==0)this.words[this.length]=re,this.length++;else if(j!==this)for(;feR.length?this.clone().iadd(R):R.clone().iadd(this)},s.prototype.isub=function(R){if(R.negative!==0){R.negative=0;var U=this.iadd(R);return R.negative=1,U._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(R),this.negative=1,this._normSign();var j=this.cmp(R);if(j===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,re;j>0?(Z=this,re=R):(Z=R,re=this);for(var fe=0,le=0;le>26,this.words[le]=U&67108863;for(;fe!==0&&le>26,this.words[le]=U&67108863;if(fe===0&&le>>26,ne=ce&67108863,K=Math.min(V,R.length-1),ue=Math.max(0,V-B.length+1);ue<=K;ue++){var te=V-ue|0;Z=B.words[te]|0,re=R.words[ue]|0,fe=Z*re+ne,ee+=fe/67108864|0,ne=fe&67108863}U.words[V]=ne|0,ce=ee|0}return ce!==0?U.words[V]=ce|0:U.length--,U.strip()}var M=function(R,U,j){var Z=R.words,re=U.words,fe=j.words,le=0,ce,V,ee,ne=Z[0]|0,K=ne&8191,ue=ne>>>13,te=Z[1]|0,H=te&8191,ae=te>>>13,ie=Z[2]|0,ve=ie&8191,Ae=ie>>>13,Ce=Z[3]|0,Fe=Ce&8191,ze=Ce>>>13,Ye=Z[4]|0,it=Ye&8191,st=Ye>>>13,nt=Z[5]|0,Qe=nt&8191,Le=nt>>>13,Te=Z[6]|0,pe=Te&8191,Ne=Te>>>13,ot=Z[7]|0,ft=ot&8191,rt=ot>>>13,Ft=Z[8]|0,Nt=Ft&8191,$t=Ft>>>13,rr=Z[9]|0,Er=rr&8191,Mr=rr>>>13,Wr=re[0]|0,Sr=Wr&8191,Br=Wr>>>13,Mt=re[1]|0,je=Mt&8191,$e=Mt>>>13,Ee=re[2]|0,xe=Ee&8191,ye=Ee>>>13,Me=re[3]|0,Xe=Me&8191,Je=Me>>>13,Lt=re[4]|0,Ct=Lt&8191,Ot=Lt>>>13,Wt=re[5]|0,_r=Wt&8191,pr=Wt>>>13,hr=re[6]|0,Fr=hr&8191,En=hr>>>13,Kn=re[7]|0,qn=Kn&8191,ta=Kn>>>13,ra=re[8]|0,Nn=ra&8191,ka=ra>>>13,qa=re[9]|0,ir=qa&8191,qt=qa>>>13;j.negative=R.negative^U.negative,j.length=19,ce=Math.imul(K,Sr),V=Math.imul(K,Br),V=V+Math.imul(ue,Sr)|0,ee=Math.imul(ue,Br);var ar=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(ar>>>26)|0,ar&=67108863,ce=Math.imul(H,Sr),V=Math.imul(H,Br),V=V+Math.imul(ae,Sr)|0,ee=Math.imul(ae,Br),ce=ce+Math.imul(K,je)|0,V=V+Math.imul(K,$e)|0,V=V+Math.imul(ue,je)|0,ee=ee+Math.imul(ue,$e)|0;var lr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(lr>>>26)|0,lr&=67108863,ce=Math.imul(ve,Sr),V=Math.imul(ve,Br),V=V+Math.imul(Ae,Sr)|0,ee=Math.imul(Ae,Br),ce=ce+Math.imul(H,je)|0,V=V+Math.imul(H,$e)|0,V=V+Math.imul(ae,je)|0,ee=ee+Math.imul(ae,$e)|0,ce=ce+Math.imul(K,xe)|0,V=V+Math.imul(K,ye)|0,V=V+Math.imul(ue,xe)|0,ee=ee+Math.imul(ue,ye)|0;var Vr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,ce=Math.imul(Fe,Sr),V=Math.imul(Fe,Br),V=V+Math.imul(ze,Sr)|0,ee=Math.imul(ze,Br),ce=ce+Math.imul(ve,je)|0,V=V+Math.imul(ve,$e)|0,V=V+Math.imul(Ae,je)|0,ee=ee+Math.imul(Ae,$e)|0,ce=ce+Math.imul(H,xe)|0,V=V+Math.imul(H,ye)|0,V=V+Math.imul(ae,xe)|0,ee=ee+Math.imul(ae,ye)|0,ce=ce+Math.imul(K,Xe)|0,V=V+Math.imul(K,Je)|0,V=V+Math.imul(ue,Xe)|0,ee=ee+Math.imul(ue,Je)|0;var sn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(sn>>>26)|0,sn&=67108863,ce=Math.imul(it,Sr),V=Math.imul(it,Br),V=V+Math.imul(st,Sr)|0,ee=Math.imul(st,Br),ce=ce+Math.imul(Fe,je)|0,V=V+Math.imul(Fe,$e)|0,V=V+Math.imul(ze,je)|0,ee=ee+Math.imul(ze,$e)|0,ce=ce+Math.imul(ve,xe)|0,V=V+Math.imul(ve,ye)|0,V=V+Math.imul(Ae,xe)|0,ee=ee+Math.imul(Ae,ye)|0,ce=ce+Math.imul(H,Xe)|0,V=V+Math.imul(H,Je)|0,V=V+Math.imul(ae,Xe)|0,ee=ee+Math.imul(ae,Je)|0,ce=ce+Math.imul(K,Ct)|0,V=V+Math.imul(K,Ot)|0,V=V+Math.imul(ue,Ct)|0,ee=ee+Math.imul(ue,Ot)|0;var mn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(mn>>>26)|0,mn&=67108863,ce=Math.imul(Qe,Sr),V=Math.imul(Qe,Br),V=V+Math.imul(Le,Sr)|0,ee=Math.imul(Le,Br),ce=ce+Math.imul(it,je)|0,V=V+Math.imul(it,$e)|0,V=V+Math.imul(st,je)|0,ee=ee+Math.imul(st,$e)|0,ce=ce+Math.imul(Fe,xe)|0,V=V+Math.imul(Fe,ye)|0,V=V+Math.imul(ze,xe)|0,ee=ee+Math.imul(ze,ye)|0,ce=ce+Math.imul(ve,Xe)|0,V=V+Math.imul(ve,Je)|0,V=V+Math.imul(Ae,Xe)|0,ee=ee+Math.imul(Ae,Je)|0,ce=ce+Math.imul(H,Ct)|0,V=V+Math.imul(H,Ot)|0,V=V+Math.imul(ae,Ct)|0,ee=ee+Math.imul(ae,Ot)|0,ce=ce+Math.imul(K,_r)|0,V=V+Math.imul(K,pr)|0,V=V+Math.imul(ue,_r)|0,ee=ee+Math.imul(ue,pr)|0;var wn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(wn>>>26)|0,wn&=67108863,ce=Math.imul(pe,Sr),V=Math.imul(pe,Br),V=V+Math.imul(Ne,Sr)|0,ee=Math.imul(Ne,Br),ce=ce+Math.imul(Qe,je)|0,V=V+Math.imul(Qe,$e)|0,V=V+Math.imul(Le,je)|0,ee=ee+Math.imul(Le,$e)|0,ce=ce+Math.imul(it,xe)|0,V=V+Math.imul(it,ye)|0,V=V+Math.imul(st,xe)|0,ee=ee+Math.imul(st,ye)|0,ce=ce+Math.imul(Fe,Xe)|0,V=V+Math.imul(Fe,Je)|0,V=V+Math.imul(ze,Xe)|0,ee=ee+Math.imul(ze,Je)|0,ce=ce+Math.imul(ve,Ct)|0,V=V+Math.imul(ve,Ot)|0,V=V+Math.imul(Ae,Ct)|0,ee=ee+Math.imul(Ae,Ot)|0,ce=ce+Math.imul(H,_r)|0,V=V+Math.imul(H,pr)|0,V=V+Math.imul(ae,_r)|0,ee=ee+Math.imul(ae,pr)|0,ce=ce+Math.imul(K,Fr)|0,V=V+Math.imul(K,En)|0,V=V+Math.imul(ue,Fr)|0,ee=ee+Math.imul(ue,En)|0;var Jn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,ce=Math.imul(ft,Sr),V=Math.imul(ft,Br),V=V+Math.imul(rt,Sr)|0,ee=Math.imul(rt,Br),ce=ce+Math.imul(pe,je)|0,V=V+Math.imul(pe,$e)|0,V=V+Math.imul(Ne,je)|0,ee=ee+Math.imul(Ne,$e)|0,ce=ce+Math.imul(Qe,xe)|0,V=V+Math.imul(Qe,ye)|0,V=V+Math.imul(Le,xe)|0,ee=ee+Math.imul(Le,ye)|0,ce=ce+Math.imul(it,Xe)|0,V=V+Math.imul(it,Je)|0,V=V+Math.imul(st,Xe)|0,ee=ee+Math.imul(st,Je)|0,ce=ce+Math.imul(Fe,Ct)|0,V=V+Math.imul(Fe,Ot)|0,V=V+Math.imul(ze,Ct)|0,ee=ee+Math.imul(ze,Ot)|0,ce=ce+Math.imul(ve,_r)|0,V=V+Math.imul(ve,pr)|0,V=V+Math.imul(Ae,_r)|0,ee=ee+Math.imul(Ae,pr)|0,ce=ce+Math.imul(H,Fr)|0,V=V+Math.imul(H,En)|0,V=V+Math.imul(ae,Fr)|0,ee=ee+Math.imul(ae,En)|0,ce=ce+Math.imul(K,qn)|0,V=V+Math.imul(K,ta)|0,V=V+Math.imul(ue,qn)|0,ee=ee+Math.imul(ue,ta)|0;var pa=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(pa>>>26)|0,pa&=67108863,ce=Math.imul(Nt,Sr),V=Math.imul(Nt,Br),V=V+Math.imul($t,Sr)|0,ee=Math.imul($t,Br),ce=ce+Math.imul(ft,je)|0,V=V+Math.imul(ft,$e)|0,V=V+Math.imul(rt,je)|0,ee=ee+Math.imul(rt,$e)|0,ce=ce+Math.imul(pe,xe)|0,V=V+Math.imul(pe,ye)|0,V=V+Math.imul(Ne,xe)|0,ee=ee+Math.imul(Ne,ye)|0,ce=ce+Math.imul(Qe,Xe)|0,V=V+Math.imul(Qe,Je)|0,V=V+Math.imul(Le,Xe)|0,ee=ee+Math.imul(Le,Je)|0,ce=ce+Math.imul(it,Ct)|0,V=V+Math.imul(it,Ot)|0,V=V+Math.imul(st,Ct)|0,ee=ee+Math.imul(st,Ot)|0,ce=ce+Math.imul(Fe,_r)|0,V=V+Math.imul(Fe,pr)|0,V=V+Math.imul(ze,_r)|0,ee=ee+Math.imul(ze,pr)|0,ce=ce+Math.imul(ve,Fr)|0,V=V+Math.imul(ve,En)|0,V=V+Math.imul(Ae,Fr)|0,ee=ee+Math.imul(Ae,En)|0,ce=ce+Math.imul(H,qn)|0,V=V+Math.imul(H,ta)|0,V=V+Math.imul(ae,qn)|0,ee=ee+Math.imul(ae,ta)|0,ce=ce+Math.imul(K,Nn)|0,V=V+Math.imul(K,ka)|0,V=V+Math.imul(ue,Nn)|0,ee=ee+Math.imul(ue,ka)|0;var ha=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(ha>>>26)|0,ha&=67108863,ce=Math.imul(Er,Sr),V=Math.imul(Er,Br),V=V+Math.imul(Mr,Sr)|0,ee=Math.imul(Mr,Br),ce=ce+Math.imul(Nt,je)|0,V=V+Math.imul(Nt,$e)|0,V=V+Math.imul($t,je)|0,ee=ee+Math.imul($t,$e)|0,ce=ce+Math.imul(ft,xe)|0,V=V+Math.imul(ft,ye)|0,V=V+Math.imul(rt,xe)|0,ee=ee+Math.imul(rt,ye)|0,ce=ce+Math.imul(pe,Xe)|0,V=V+Math.imul(pe,Je)|0,V=V+Math.imul(Ne,Xe)|0,ee=ee+Math.imul(Ne,Je)|0,ce=ce+Math.imul(Qe,Ct)|0,V=V+Math.imul(Qe,Ot)|0,V=V+Math.imul(Le,Ct)|0,ee=ee+Math.imul(Le,Ot)|0,ce=ce+Math.imul(it,_r)|0,V=V+Math.imul(it,pr)|0,V=V+Math.imul(st,_r)|0,ee=ee+Math.imul(st,pr)|0,ce=ce+Math.imul(Fe,Fr)|0,V=V+Math.imul(Fe,En)|0,V=V+Math.imul(ze,Fr)|0,ee=ee+Math.imul(ze,En)|0,ce=ce+Math.imul(ve,qn)|0,V=V+Math.imul(ve,ta)|0,V=V+Math.imul(Ae,qn)|0,ee=ee+Math.imul(Ae,ta)|0,ce=ce+Math.imul(H,Nn)|0,V=V+Math.imul(H,ka)|0,V=V+Math.imul(ae,Nn)|0,ee=ee+Math.imul(ae,ka)|0,ce=ce+Math.imul(K,ir)|0,V=V+Math.imul(K,qt)|0,V=V+Math.imul(ue,ir)|0,ee=ee+Math.imul(ue,qt)|0;var _a=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(_a>>>26)|0,_a&=67108863,ce=Math.imul(Er,je),V=Math.imul(Er,$e),V=V+Math.imul(Mr,je)|0,ee=Math.imul(Mr,$e),ce=ce+Math.imul(Nt,xe)|0,V=V+Math.imul(Nt,ye)|0,V=V+Math.imul($t,xe)|0,ee=ee+Math.imul($t,ye)|0,ce=ce+Math.imul(ft,Xe)|0,V=V+Math.imul(ft,Je)|0,V=V+Math.imul(rt,Xe)|0,ee=ee+Math.imul(rt,Je)|0,ce=ce+Math.imul(pe,Ct)|0,V=V+Math.imul(pe,Ot)|0,V=V+Math.imul(Ne,Ct)|0,ee=ee+Math.imul(Ne,Ot)|0,ce=ce+Math.imul(Qe,_r)|0,V=V+Math.imul(Qe,pr)|0,V=V+Math.imul(Le,_r)|0,ee=ee+Math.imul(Le,pr)|0,ce=ce+Math.imul(it,Fr)|0,V=V+Math.imul(it,En)|0,V=V+Math.imul(st,Fr)|0,ee=ee+Math.imul(st,En)|0,ce=ce+Math.imul(Fe,qn)|0,V=V+Math.imul(Fe,ta)|0,V=V+Math.imul(ze,qn)|0,ee=ee+Math.imul(ze,ta)|0,ce=ce+Math.imul(ve,Nn)|0,V=V+Math.imul(ve,ka)|0,V=V+Math.imul(Ae,Nn)|0,ee=ee+Math.imul(Ae,ka)|0,ce=ce+Math.imul(H,ir)|0,V=V+Math.imul(H,qt)|0,V=V+Math.imul(ae,ir)|0,ee=ee+Math.imul(ae,qt)|0;var Ca=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,ce=Math.imul(Er,xe),V=Math.imul(Er,ye),V=V+Math.imul(Mr,xe)|0,ee=Math.imul(Mr,ye),ce=ce+Math.imul(Nt,Xe)|0,V=V+Math.imul(Nt,Je)|0,V=V+Math.imul($t,Xe)|0,ee=ee+Math.imul($t,Je)|0,ce=ce+Math.imul(ft,Ct)|0,V=V+Math.imul(ft,Ot)|0,V=V+Math.imul(rt,Ct)|0,ee=ee+Math.imul(rt,Ot)|0,ce=ce+Math.imul(pe,_r)|0,V=V+Math.imul(pe,pr)|0,V=V+Math.imul(Ne,_r)|0,ee=ee+Math.imul(Ne,pr)|0,ce=ce+Math.imul(Qe,Fr)|0,V=V+Math.imul(Qe,En)|0,V=V+Math.imul(Le,Fr)|0,ee=ee+Math.imul(Le,En)|0,ce=ce+Math.imul(it,qn)|0,V=V+Math.imul(it,ta)|0,V=V+Math.imul(st,qn)|0,ee=ee+Math.imul(st,ta)|0,ce=ce+Math.imul(Fe,Nn)|0,V=V+Math.imul(Fe,ka)|0,V=V+Math.imul(ze,Nn)|0,ee=ee+Math.imul(ze,ka)|0,ce=ce+Math.imul(ve,ir)|0,V=V+Math.imul(ve,qt)|0,V=V+Math.imul(Ae,ir)|0,ee=ee+Math.imul(Ae,qt)|0;var Vn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,ce=Math.imul(Er,Xe),V=Math.imul(Er,Je),V=V+Math.imul(Mr,Xe)|0,ee=Math.imul(Mr,Je),ce=ce+Math.imul(Nt,Ct)|0,V=V+Math.imul(Nt,Ot)|0,V=V+Math.imul($t,Ct)|0,ee=ee+Math.imul($t,Ot)|0,ce=ce+Math.imul(ft,_r)|0,V=V+Math.imul(ft,pr)|0,V=V+Math.imul(rt,_r)|0,ee=ee+Math.imul(rt,pr)|0,ce=ce+Math.imul(pe,Fr)|0,V=V+Math.imul(pe,En)|0,V=V+Math.imul(Ne,Fr)|0,ee=ee+Math.imul(Ne,En)|0,ce=ce+Math.imul(Qe,qn)|0,V=V+Math.imul(Qe,ta)|0,V=V+Math.imul(Le,qn)|0,ee=ee+Math.imul(Le,ta)|0,ce=ce+Math.imul(it,Nn)|0,V=V+Math.imul(it,ka)|0,V=V+Math.imul(st,Nn)|0,ee=ee+Math.imul(st,ka)|0,ce=ce+Math.imul(Fe,ir)|0,V=V+Math.imul(Fe,qt)|0,V=V+Math.imul(ze,ir)|0,ee=ee+Math.imul(ze,qt)|0;var yi=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(yi>>>26)|0,yi&=67108863,ce=Math.imul(Er,Ct),V=Math.imul(Er,Ot),V=V+Math.imul(Mr,Ct)|0,ee=Math.imul(Mr,Ot),ce=ce+Math.imul(Nt,_r)|0,V=V+Math.imul(Nt,pr)|0,V=V+Math.imul($t,_r)|0,ee=ee+Math.imul($t,pr)|0,ce=ce+Math.imul(ft,Fr)|0,V=V+Math.imul(ft,En)|0,V=V+Math.imul(rt,Fr)|0,ee=ee+Math.imul(rt,En)|0,ce=ce+Math.imul(pe,qn)|0,V=V+Math.imul(pe,ta)|0,V=V+Math.imul(Ne,qn)|0,ee=ee+Math.imul(Ne,ta)|0,ce=ce+Math.imul(Qe,Nn)|0,V=V+Math.imul(Qe,ka)|0,V=V+Math.imul(Le,Nn)|0,ee=ee+Math.imul(Le,ka)|0,ce=ce+Math.imul(it,ir)|0,V=V+Math.imul(it,qt)|0,V=V+Math.imul(st,ir)|0,ee=ee+Math.imul(st,qt)|0;var Ci=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,ce=Math.imul(Er,_r),V=Math.imul(Er,pr),V=V+Math.imul(Mr,_r)|0,ee=Math.imul(Mr,pr),ce=ce+Math.imul(Nt,Fr)|0,V=V+Math.imul(Nt,En)|0,V=V+Math.imul($t,Fr)|0,ee=ee+Math.imul($t,En)|0,ce=ce+Math.imul(ft,qn)|0,V=V+Math.imul(ft,ta)|0,V=V+Math.imul(rt,qn)|0,ee=ee+Math.imul(rt,ta)|0,ce=ce+Math.imul(pe,Nn)|0,V=V+Math.imul(pe,ka)|0,V=V+Math.imul(Ne,Nn)|0,ee=ee+Math.imul(Ne,ka)|0,ce=ce+Math.imul(Qe,ir)|0,V=V+Math.imul(Qe,qt)|0,V=V+Math.imul(Le,ir)|0,ee=ee+Math.imul(Le,qt)|0;var Dt=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,ce=Math.imul(Er,Fr),V=Math.imul(Er,En),V=V+Math.imul(Mr,Fr)|0,ee=Math.imul(Mr,En),ce=ce+Math.imul(Nt,qn)|0,V=V+Math.imul(Nt,ta)|0,V=V+Math.imul($t,qn)|0,ee=ee+Math.imul($t,ta)|0,ce=ce+Math.imul(ft,Nn)|0,V=V+Math.imul(ft,ka)|0,V=V+Math.imul(rt,Nn)|0,ee=ee+Math.imul(rt,ka)|0,ce=ce+Math.imul(pe,ir)|0,V=V+Math.imul(pe,qt)|0,V=V+Math.imul(Ne,ir)|0,ee=ee+Math.imul(Ne,qt)|0;var yt=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(yt>>>26)|0,yt&=67108863,ce=Math.imul(Er,qn),V=Math.imul(Er,ta),V=V+Math.imul(Mr,qn)|0,ee=Math.imul(Mr,ta),ce=ce+Math.imul(Nt,Nn)|0,V=V+Math.imul(Nt,ka)|0,V=V+Math.imul($t,Nn)|0,ee=ee+Math.imul($t,ka)|0,ce=ce+Math.imul(ft,ir)|0,V=V+Math.imul(ft,qt)|0,V=V+Math.imul(rt,ir)|0,ee=ee+Math.imul(rt,qt)|0;var kr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(kr>>>26)|0,kr&=67108863,ce=Math.imul(Er,Nn),V=Math.imul(Er,ka),V=V+Math.imul(Mr,Nn)|0,ee=Math.imul(Mr,ka),ce=ce+Math.imul(Nt,ir)|0,V=V+Math.imul(Nt,qt)|0,V=V+Math.imul($t,ir)|0,ee=ee+Math.imul($t,qt)|0;var Nr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,ce=Math.imul(Er,ir),V=Math.imul(Er,qt),V=V+Math.imul(Mr,ir)|0,ee=Math.imul(Mr,qt);var jr=(le+ce|0)+((V&8191)<<13)|0;return le=(ee+(V>>>13)|0)+(jr>>>26)|0,jr&=67108863,fe[0]=ar,fe[1]=lr,fe[2]=Vr,fe[3]=sn,fe[4]=mn,fe[5]=wn,fe[6]=Jn,fe[7]=pa,fe[8]=ha,fe[9]=_a,fe[10]=Ca,fe[11]=Vn,fe[12]=yi,fe[13]=Ci,fe[14]=Dt,fe[15]=yt,fe[16]=kr,fe[17]=Nr,fe[18]=jr,le!==0&&(fe[19]=le,j.length++),j};Math.imul||(M=A);function _(B,R,U){U.negative=R.negative^B.negative,U.length=B.length+R.length;for(var j=0,Z=0,re=0;re>>26)|0,Z+=fe>>>26,fe&=67108863}U.words[re]=le,j=fe,fe=Z}return j!==0?U.words[re]=j:U.length--,U.strip()}function w(B,R,U){var j=new m;return j.mulp(B,R,U)}s.prototype.mulTo=function(R,U){var j,Z=this.length+R.length;return this.length===10&&R.length===10?j=M(this,R,U):Z<63?j=A(this,R,U):Z<1024?j=_(this,R,U):j=w(this,R,U),j};function m(B,R){this.x=B,this.y=R}m.prototype.makeRBT=function(R){for(var U=new Array(R),j=s.prototype._countBits(R)-1,Z=0;Z>=1;return Z},m.prototype.permute=function(R,U,j,Z,re,fe){for(var le=0;le>>1)re++;return 1<>>13,j[2*fe+1]=re&8191,re=re>>>13;for(fe=2*U;fe>=26,U+=Z/67108864|0,U+=re>>>26,this.words[j]=re&67108863}return U!==0&&(this.words[j]=U,this.length++),this},s.prototype.muln=function(R){return this.clone().imuln(R)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(R){var U=x(R);if(U.length===0)return new s(1);for(var j=this,Z=0;Z=0);var U=R%26,j=(R-U)/26,Z=67108863>>>26-U<<26-U,re;if(U!==0){var fe=0;for(re=0;re>>26-U}fe&&(this.words[re]=fe,this.length++)}if(j!==0){for(re=this.length-1;re>=0;re--)this.words[re+j]=this.words[re];for(re=0;re=0);var Z;U?Z=(U-U%26)/26:Z=0;var re=R%26,fe=Math.min((R-re)/26,this.length),le=67108863^67108863>>>re<fe)for(this.length-=fe,V=0;V=0&&(ee!==0||V>=Z);V--){var ne=this.words[V]|0;this.words[V]=ee<<26-re|ne>>>re,ee=ne&le}return ce&&ee!==0&&(ce.words[ce.length++]=ee),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(R,U,j){return i(this.negative===0),this.iushrn(R,U,j)},s.prototype.shln=function(R){return this.clone().ishln(R)},s.prototype.ushln=function(R){return this.clone().iushln(R)},s.prototype.shrn=function(R){return this.clone().ishrn(R)},s.prototype.ushrn=function(R){return this.clone().iushrn(R)},s.prototype.testn=function(R){i(typeof R=="number"&&R>=0);var U=R%26,j=(R-U)/26,Z=1<=0);var U=R%26,j=(R-U)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=j)return this;if(U!==0&&j++,this.length=Math.min(j,this.length),U!==0){var Z=67108863^67108863>>>U<=67108864;U++)this.words[U]-=67108864,U===this.length-1?this.words[U+1]=1:this.words[U+1]++;return this.length=Math.max(this.length,U+1),this},s.prototype.isubn=function(R){if(i(typeof R=="number"),i(R<67108864),R<0)return this.iaddn(-R);if(this.negative!==0)return this.negative=0,this.iaddn(R),this.negative=1,this;if(this.words[0]-=R,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var U=0;U>26)-(ce/67108864|0),this.words[re+j]=fe&67108863}for(;re>26,this.words[re+j]=fe&67108863;if(le===0)return this.strip();for(i(le===-1),le=0,re=0;re>26,this.words[re]=fe&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(R,U){var j=this.length-R.length,Z=this.clone(),re=R,fe=re.words[re.length-1]|0,le=this._countBits(fe);j=26-le,j!==0&&(re=re.ushln(j),Z.iushln(j),fe=re.words[re.length-1]|0);var ce=Z.length-re.length,V;if(U!=="mod"){V=new s(null),V.length=ce+1,V.words=new Array(V.length);for(var ee=0;ee=0;K--){var ue=(Z.words[re.length+K]|0)*67108864+(Z.words[re.length+K-1]|0);for(ue=Math.min(ue/fe|0,67108863),Z._ishlnsubmul(re,ue,K);Z.negative!==0;)ue--,Z.negative=0,Z._ishlnsubmul(re,1,K),Z.isZero()||(Z.negative^=1);V&&(V.words[K]=ue)}return V&&V.strip(),Z.strip(),U!=="div"&&j!==0&&Z.iushrn(j),{div:V||null,mod:Z}},s.prototype.divmod=function(R,U,j){if(i(!R.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var Z,re,fe;return this.negative!==0&&R.negative===0?(fe=this.neg().divmod(R,U),U!=="mod"&&(Z=fe.div.neg()),U!=="div"&&(re=fe.mod.neg(),j&&re.negative!==0&&re.iadd(R)),{div:Z,mod:re}):this.negative===0&&R.negative!==0?(fe=this.divmod(R.neg(),U),U!=="mod"&&(Z=fe.div.neg()),{div:Z,mod:fe.mod}):(this.negative&R.negative)!==0?(fe=this.neg().divmod(R.neg(),U),U!=="div"&&(re=fe.mod.neg(),j&&re.negative!==0&&re.isub(R)),{div:fe.div,mod:re}):R.length>this.length||this.cmp(R)<0?{div:new s(0),mod:this}:R.length===1?U==="div"?{div:this.divn(R.words[0]),mod:null}:U==="mod"?{div:null,mod:new s(this.modn(R.words[0]))}:{div:this.divn(R.words[0]),mod:new s(this.modn(R.words[0]))}:this._wordDiv(R,U)},s.prototype.div=function(R){return this.divmod(R,"div",!1).div},s.prototype.mod=function(R){return this.divmod(R,"mod",!1).mod},s.prototype.umod=function(R){return this.divmod(R,"mod",!0).mod},s.prototype.divRound=function(R){var U=this.divmod(R);if(U.mod.isZero())return U.div;var j=U.div.negative!==0?U.mod.isub(R):U.mod,Z=R.ushrn(1),re=R.andln(1),fe=j.cmp(Z);return fe<0||re===1&&fe===0?U.div:U.div.negative!==0?U.div.isubn(1):U.div.iaddn(1)},s.prototype.modn=function(R){i(R<=67108863);for(var U=(1<<26)%R,j=0,Z=this.length-1;Z>=0;Z--)j=(U*j+(this.words[Z]|0))%R;return j},s.prototype.idivn=function(R){i(R<=67108863);for(var U=0,j=this.length-1;j>=0;j--){var Z=(this.words[j]|0)+U*67108864;this.words[j]=Z/R|0,U=Z%R}return this.strip()},s.prototype.divn=function(R){return this.clone().idivn(R)},s.prototype.egcd=function(R){i(R.negative===0),i(!R.isZero());var U=this,j=R.clone();U.negative!==0?U=U.umod(R):U=U.clone();for(var Z=new s(1),re=new s(0),fe=new s(0),le=new s(1),ce=0;U.isEven()&&j.isEven();)U.iushrn(1),j.iushrn(1),++ce;for(var V=j.clone(),ee=U.clone();!U.isZero();){for(var ne=0,K=1;(U.words[0]&K)===0&&ne<26;++ne,K<<=1);if(ne>0)for(U.iushrn(ne);ne-- >0;)(Z.isOdd()||re.isOdd())&&(Z.iadd(V),re.isub(ee)),Z.iushrn(1),re.iushrn(1);for(var ue=0,te=1;(j.words[0]&te)===0&&ue<26;++ue,te<<=1);if(ue>0)for(j.iushrn(ue);ue-- >0;)(fe.isOdd()||le.isOdd())&&(fe.iadd(V),le.isub(ee)),fe.iushrn(1),le.iushrn(1);U.cmp(j)>=0?(U.isub(j),Z.isub(fe),re.isub(le)):(j.isub(U),fe.isub(Z),le.isub(re))}return{a:fe,b:le,gcd:j.iushln(ce)}},s.prototype._invmp=function(R){i(R.negative===0),i(!R.isZero());var U=this,j=R.clone();U.negative!==0?U=U.umod(R):U=U.clone();for(var Z=new s(1),re=new s(0),fe=j.clone();U.cmpn(1)>0&&j.cmpn(1)>0;){for(var le=0,ce=1;(U.words[0]&ce)===0&&le<26;++le,ce<<=1);if(le>0)for(U.iushrn(le);le-- >0;)Z.isOdd()&&Z.iadd(fe),Z.iushrn(1);for(var V=0,ee=1;(j.words[0]&ee)===0&&V<26;++V,ee<<=1);if(V>0)for(j.iushrn(V);V-- >0;)re.isOdd()&&re.iadd(fe),re.iushrn(1);U.cmp(j)>=0?(U.isub(j),Z.isub(re)):(j.isub(U),re.isub(Z))}var ne;return U.cmpn(1)===0?ne=Z:ne=re,ne.cmpn(0)<0&&ne.iadd(R),ne},s.prototype.gcd=function(R){if(this.isZero())return R.abs();if(R.isZero())return this.abs();var U=this.clone(),j=R.clone();U.negative=0,j.negative=0;for(var Z=0;U.isEven()&&j.isEven();Z++)U.iushrn(1),j.iushrn(1);do{for(;U.isEven();)U.iushrn(1);for(;j.isEven();)j.iushrn(1);var re=U.cmp(j);if(re<0){var fe=U;U=j,j=fe}else if(re===0||j.cmpn(1)===0)break;U.isub(j)}while(!0);return j.iushln(Z)},s.prototype.invm=function(R){return this.egcd(R).a.umod(R)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(R){return this.words[0]&R},s.prototype.bincn=function(R){i(typeof R=="number");var U=R%26,j=(R-U)/26,Z=1<>>26,le&=67108863,this.words[fe]=le}return re!==0&&(this.words[fe]=re,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(R){var U=R<0;if(this.negative!==0&&!U)return-1;if(this.negative===0&&U)return 1;this.strip();var j;if(this.length>1)j=1;else{U&&(R=-R),i(R<=67108863,"Number is too big");var Z=this.words[0]|0;j=Z===R?0:ZR.length)return 1;if(this.length=0;j--){var Z=this.words[j]|0,re=R.words[j]|0;if(Z!==re){Zre&&(U=1);break}}return U},s.prototype.gtn=function(R){return this.cmpn(R)===1},s.prototype.gt=function(R){return this.cmp(R)===1},s.prototype.gten=function(R){return this.cmpn(R)>=0},s.prototype.gte=function(R){return this.cmp(R)>=0},s.prototype.ltn=function(R){return this.cmpn(R)===-1},s.prototype.lt=function(R){return this.cmp(R)===-1},s.prototype.lten=function(R){return this.cmpn(R)<=0},s.prototype.lte=function(R){return this.cmp(R)<=0},s.prototype.eqn=function(R){return this.cmpn(R)===0},s.prototype.eq=function(R){return this.cmp(R)===0},s.red=function(R){return new F(R)},s.prototype.toRed=function(R){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),R.convertTo(this)._forceRed(R)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(R){return this.red=R,this},s.prototype.forceRed=function(R){return i(!this.red,"Already a number in reduction context"),this._forceRed(R)},s.prototype.redAdd=function(R){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,R)},s.prototype.redIAdd=function(R){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,R)},s.prototype.redSub=function(R){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,R)},s.prototype.redISub=function(R){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,R)},s.prototype.redShl=function(R){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,R)},s.prototype.redMul=function(R){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,R),this.red.mul(this,R)},s.prototype.redIMul=function(R){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,R),this.red.imul(this,R)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(R){return i(this.red&&!R.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,R)};var u={k256:null,p224:null,p192:null,p25519:null};function v(B,R){this.name=B,this.p=new s(R,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}v.prototype._tmp=function(){var R=new s(null);return R.words=new Array(Math.ceil(this.n/13)),R},v.prototype.ireduce=function(R){var U=R,j;do this.split(U,this.tmp),U=this.imulK(U),U=U.iadd(this.tmp),j=U.bitLength();while(j>this.n);var Z=j0?U.isub(this.p):U.strip!==void 0?U.strip():U._strip(),U},v.prototype.split=function(R,U){R.iushrn(this.n,0,U)},v.prototype.imulK=function(R){return R.imul(this.k)};function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(y,v),y.prototype.split=function(R,U){for(var j=4194303,Z=Math.min(R.length,9),re=0;re>>22,fe=le}fe>>>=22,R.words[re-10]=fe,fe===0&&R.length>10?R.length-=10:R.length-=9},y.prototype.imulK=function(R){R.words[R.length]=0,R.words[R.length+1]=0,R.length+=2;for(var U=0,j=0;j>>=26,R.words[j]=re,U=Z}return U!==0&&(R.words[R.length++]=U),R},s._prime=function(R){if(u[R])return u[R];var U;if(R==="k256")U=new y;else if(R==="p224")U=new I;else if(R==="p192")U=new L;else if(R==="p25519")U=new z;else throw new Error("Unknown prime "+R);return u[R]=U,U};function F(B){if(typeof B=="string"){var R=s._prime(B);this.m=R.p,this.prime=R}else i(B.gtn(1),"modulus must be greater than 1"),this.m=B,this.prime=null}F.prototype._verify1=function(R){i(R.negative===0,"red works only with positives"),i(R.red,"red works only with red numbers")},F.prototype._verify2=function(R,U){i((R.negative|U.negative)===0,"red works only with positives"),i(R.red&&R.red===U.red,"red works only with red numbers")},F.prototype.imod=function(R){return this.prime?this.prime.ireduce(R)._forceRed(this):R.umod(this.m)._forceRed(this)},F.prototype.neg=function(R){return R.isZero()?R.clone():this.m.sub(R)._forceRed(this)},F.prototype.add=function(R,U){this._verify2(R,U);var j=R.add(U);return j.cmp(this.m)>=0&&j.isub(this.m),j._forceRed(this)},F.prototype.iadd=function(R,U){this._verify2(R,U);var j=R.iadd(U);return j.cmp(this.m)>=0&&j.isub(this.m),j},F.prototype.sub=function(R,U){this._verify2(R,U);var j=R.sub(U);return j.cmpn(0)<0&&j.iadd(this.m),j._forceRed(this)},F.prototype.isub=function(R,U){this._verify2(R,U);var j=R.isub(U);return j.cmpn(0)<0&&j.iadd(this.m),j},F.prototype.shl=function(R,U){return this._verify1(R),this.imod(R.ushln(U))},F.prototype.imul=function(R,U){return this._verify2(R,U),this.imod(R.imul(U))},F.prototype.mul=function(R,U){return this._verify2(R,U),this.imod(R.mul(U))},F.prototype.isqr=function(R){return this.imul(R,R.clone())},F.prototype.sqr=function(R){return this.mul(R,R)},F.prototype.sqrt=function(R){if(R.isZero())return R.clone();var U=this.m.andln(3);if(i(U%2===1),U===3){var j=this.m.add(new s(1)).iushrn(2);return this.pow(R,j)}for(var Z=this.m.subn(1),re=0;!Z.isZero()&&Z.andln(1)===0;)re++,Z.iushrn(1);i(!Z.isZero());var fe=new s(1).toRed(this),le=fe.redNeg(),ce=this.m.subn(1).iushrn(1),V=this.m.bitLength();for(V=new s(2*V*V).toRed(this);this.pow(V,ce).cmp(le)!==0;)V.redIAdd(le);for(var ee=this.pow(V,Z),ne=this.pow(R,Z.addn(1).iushrn(1)),K=this.pow(R,Z),ue=re;K.cmp(fe)!==0;){for(var te=K,H=0;te.cmp(fe)!==0;H++)te=te.redSqr();i(H=0;re--){for(var ee=U.words[re],ne=V-1;ne>=0;ne--){var K=ee>>ne&1;if(fe!==Z[0]&&(fe=this.sqr(fe)),K===0&&le===0){ce=0;continue}le<<=1,le|=K,ce++,!(ce!==j&&(re!==0||ne!==0))&&(fe=this.mul(fe,Z[le]),ce=0,le=0)}V=26}return fe},F.prototype.convertTo=function(R){var U=R.umod(this.m);return U===R?U.clone():U},F.prototype.convertFrom=function(R){var U=R.clone();return U.red=null,U},s.mont=function(R){return new N(R)};function N(B){F.call(this,B),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(N,F),N.prototype.convertTo=function(R){return this.imod(R.ushln(this.shift))},N.prototype.convertFrom=function(R){var U=this.imod(R.mul(this.rinv));return U.red=null,U},N.prototype.imul=function(R,U){if(R.isZero()||U.isZero())return R.words[0]=0,R.length=1,R;var j=R.imul(U),Z=j.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),re=j.isub(Z).iushrn(this.shift),fe=re;return re.cmp(this.m)>=0?fe=re.isub(this.m):re.cmpn(0)<0&&(fe=re.iadd(this.m)),fe._forceRed(this)},N.prototype.mul=function(R,U){if(R.isZero()||U.isZero())return new s(0)._forceRed(this);var j=R.mul(U),Z=j.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),re=j.isub(Z).iushrn(this.shift),fe=re;return re.cmp(this.m)>=0?fe=re.isub(this.m):re.cmpn(0)<0&&(fe=re.iadd(this.m)),fe._forceRed(this)},N.prototype.invm=function(R){var U=this.imod(R._invmp(this.m).mul(this.r2));return U._forceRed(this)}})(e,this)}),6860:(function(e){e.exports=t;function t(r,o,n){return r[0]=o[0]-n[0],r[1]=o[1]-n[1],r[2]=o[2]-n[2],r[3]=o[3]-n[3],r}}),6864:(function(e){e.exports=t;function t(){var r=new Float32Array(16);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}}),6867:(function(e,t,r){e.exports=l;var o=r(1888),n=r(855),i=r(7150);function a(g,x){for(var A=0;A>>1;if(!(m<=0)){var u,v=o.mallocDouble(2*m*_),y=o.mallocInt32(_);if(_=s(g,m,v,y),_>0){if(m===1&&M)n.init(_),u=n.sweepComplete(m,A,0,_,v,y,0,_,v,y);else{var I=o.mallocDouble(2*m*w),L=o.mallocInt32(w);w=s(x,m,I,L),w>0&&(n.init(_+w),m===1?u=n.sweepBipartite(m,A,0,_,v,y,0,w,I,L):u=i(m,A,M,_,v,y,w,I,L),o.free(I),o.free(L))}o.free(v),o.free(y)}return u}}}var c;function p(g,x){c.push([g,x])}function d(g){return c=[],f(g,g,p,!0),c}function T(g,x){return c=[],f(g,x,p,!1),c}function l(g,x,A){switch(arguments.length){case 1:return d(g);case 2:return typeof x=="function"?f(g,g,x,!0):T(g,x);case 3:return f(g,x,A,!1);default:throw new Error("box-intersect: Invalid arguments")}}}),6894:(function(e){e.exports=t;function t(r,o,n,i){var a=n[1],s=n[2],f=o[1]-a,c=o[2]-s,p=Math.sin(i),d=Math.cos(i);return r[0]=o[0],r[1]=a+f*d-c*p,r[2]=s+f*p+c*d,r}}),7004:(function(e){e.exports=t;function t(r){for(var o=r.length,n=r[r.length-1],i=o,a=o-2;a>=0;--a){var s=n,f=r[a];n=s+f;var c=n-s,p=f-c;p&&(r[--i]=n,n=p)}for(var d=0,a=i;a=p0)&&!(p1>=hi)"),x=p("lo===p0"),A=p("lo0;){ee-=1;var ue=ee*m,te=y[ue],H=y[ue+1],ae=y[ue+2],ie=y[ue+3],ve=y[ue+4],Ae=y[ue+5],Ce=ee*u,Fe=I[Ce],ze=I[Ce+1],Ye=Ae&1,it=!!(Ae&16),st=re,nt=fe,Qe=ce,Le=V;if(Ye&&(st=ce,nt=V,Qe=re,Le=fe),!(Ae&2&&(ae=A(R,te,H,ae,st,nt,ze),H>=ae))&&!(Ae&4&&(H=M(R,te,H,ae,st,nt,Fe),H>=ae))){var Te=ae-H,pe=ve-ie;if(it){if(R*Te*(Te+pe)"u"?r(1538):WeakMap,n=r(2762),i=r(8116),a=new o;function s(f){var c=a.get(f),p=c&&(c._triangleBuffer.handle||c._triangleBuffer.buffer);if(!p||!f.isBuffer(p)){var d=n(f,new Float32Array([-1,-1,-1,4,4,-1]));c=i(f,[{buffer:d,type:f.FLOAT,size:2}]),c._triangleBuffer=d,a.set(f,c)}c.bind(),f.drawArrays(f.TRIANGLES,0,3),c.unbind()}e.exports=s}),7182:(function(e,t,r){var o={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)};o.create();var n=o.create();e.exports=function(a,s,f,c,p,d){return o.identity(a),o.fromRotationTranslation(a,d,s),a[3]=p[0],a[7]=p[1],a[11]=p[2],a[15]=p[3],o.identity(n),c[2]!==0&&(n[9]=c[2],o.multiply(a,a,n)),c[1]!==0&&(n[9]=0,n[8]=c[1],o.multiply(a,a,n)),c[0]!==0&&(n[8]=0,n[4]=c[0],o.multiply(a,a,n)),o.scale(a,a,f),a}}),7201:(function(e,t,r){var o=1e-6,n=1e-6,i=r(9405),a=r(2762),s=r(8116),f=r(7766),c=r(8406),p=r(6760),d=r(7608),T=r(9618),l=r(6729),g=r(7765),x=r(1888),A=r(840),M=r(7626),_=A.meshShader,w=A.wireShader,m=A.pointShader,u=A.pickShader,v=A.pointPickShader,y=A.contourShader,I=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function L(ce,V,ee,ne,K,ue,te,H,ae,ie,ve,Ae,Ce,Fe,ze,Ye,it,st,nt,Qe,Le,Te,pe,Ne,ot,ft,rt){this.gl=ce,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=V,this.dirty=!0,this.triShader=ee,this.lineShader=ne,this.pointShader=K,this.pickShader=ue,this.pointPickShader=te,this.contourShader=H,this.trianglePositions=ae,this.triangleColors=ve,this.triangleNormals=Ce,this.triangleUVs=Ae,this.triangleIds=ie,this.triangleVAO=Fe,this.triangleCount=0,this.lineWidth=1,this.edgePositions=ze,this.edgeColors=it,this.edgeUVs=st,this.edgeIds=Ye,this.edgeVAO=nt,this.edgeCount=0,this.pointPositions=Qe,this.pointColors=Te,this.pointUVs=pe,this.pointSizes=Ne,this.pointIds=Le,this.pointVAO=ot,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=ft,this.contourVAO=rt,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=I,this._view=I,this._projection=I,this._resolution=[1,1]}var z=L.prototype;z.isOpaque=function(){return!this.hasAlpha},z.isTransparent=function(){return this.hasAlpha},z.pickSlots=1,z.setPickBase=function(ce){this.pickId=ce};function F(ce,V){if(!V||!V.length)return 1;for(var ee=0;eece&&ee>0){var ne=(V[ee][0]-ce)/(V[ee][0]-V[ee-1][0]);return V[ee][1]*(1-ne)+ne*V[ee-1][1]}}return 1}function N(ce,V){for(var ee=l({colormap:ce,nshades:256,format:"rgba"}),ne=new Uint8Array(256*4),K=0;K<256;++K){for(var ue=ee[K],te=0;te<3;++te)ne[4*K+te]=ue[te];V?ne[4*K+3]=255*F(K/255,V):ne[4*K+3]=255*ue[3]}return T(ne,[256,256,4],[4,0,1])}function B(ce){for(var V=ce.length,ee=new Array(V),ne=0;ne0){var Ce=this.triShader;Ce.bind(),Ce.uniforms=H,this.triangleVAO.bind(),V.drawArrays(V.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Ce=this.lineShader;Ce.bind(),Ce.uniforms=H,this.edgeVAO.bind(),V.lineWidth(this.lineWidth*this.pixelRatio),V.drawArrays(V.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Ce=this.pointShader;Ce.bind(),Ce.uniforms=H,this.pointVAO.bind(),V.drawArrays(V.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Ce=this.contourShader;Ce.bind(),Ce.uniforms=H,this.contourVAO.bind(),V.drawArrays(V.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(ce){ce=ce||{};for(var V=this.gl,ee=ce.model||I,ne=ce.view||I,K=ce.projection||I,ue=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],te=0;te<3;++te)ue[0][te]=Math.max(ue[0][te],this.clipBounds[0][te]),ue[1][te]=Math.min(ue[1][te],this.clipBounds[1][te]);this._model=[].slice.call(ee),this._view=[].slice.call(ne),this._projection=[].slice.call(K),this._resolution=[V.drawingBufferWidth,V.drawingBufferHeight];var H={model:ee,view:ne,projection:K,clipBounds:ue,pickId:this.pickId/255},ae=this.pickShader;if(ae.bind(),ae.uniforms=H,this.triangleCount>0&&(this.triangleVAO.bind(),V.drawArrays(V.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),V.lineWidth(this.lineWidth*this.pixelRatio),V.drawArrays(V.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var ae=this.pointPickShader;ae.bind(),ae.uniforms=H,this.pointVAO.bind(),V.drawArrays(V.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.pick=function(ce){if(!ce||ce.id!==this.pickId)return null;for(var V=ce.value[0]+256*ce.value[1]+65536*ce.value[2],ee=this.cells[V],ne=this.positions,K=new Array(ee.length),ue=0;ueMath.max(_,w)?m[2]=1:_>Math.max(M,w)?m[0]=1:m[1]=1;for(var u=0,v=0,y=0;y<3;++y)u+=A[y]*A[y],v+=m[y]*A[y];for(var y=0;y<3;++y)m[y]-=v/u*A[y];return s(m,m),m}function T(A,M,_,w,m,u,v,y){this.center=o(_),this.up=o(w),this.right=o(m),this.radius=o([u]),this.angle=o([v,y]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(A,M),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var I=0;I<16;++I)this.computedMatrix[I]=.5;this.recalcMatrix(0)}var l=T.prototype;l.setDistanceLimits=function(A,M){A>0?A=Math.log(A):A=-1/0,M>0?M=Math.log(M):M=1/0,M=Math.max(M,A),this.radius.bounds[0][0]=A,this.radius.bounds[1][0]=M},l.getDistanceLimits=function(A){var M=this.radius.bounds[0];return A?(A[0]=Math.exp(M[0][0]),A[1]=Math.exp(M[1][0]),A):[Math.exp(M[0][0]),Math.exp(M[1][0])]},l.recalcMatrix=function(A){this.center.curve(A),this.up.curve(A),this.right.curve(A),this.radius.curve(A),this.angle.curve(A);for(var M=this.computedUp,_=this.computedRight,w=0,m=0,u=0;u<3;++u)m+=M[u]*_[u],w+=M[u]*M[u];for(var v=Math.sqrt(w),y=0,u=0;u<3;++u)_[u]-=M[u]*m/w,y+=_[u]*_[u],M[u]/=v;for(var I=Math.sqrt(y),u=0;u<3;++u)_[u]/=I;var L=this.computedToward;a(L,M,_),s(L,L);for(var z=Math.exp(this.computedRadius[0]),F=this.computedAngle[0],N=this.computedAngle[1],B=Math.cos(F),R=Math.sin(F),U=Math.cos(N),j=Math.sin(N),Z=this.computedCenter,re=B*U,fe=R*U,le=j,ce=-B*j,V=-R*j,ee=U,ne=this.computedEye,K=this.computedMatrix,u=0;u<3;++u){var ue=re*_[u]+fe*L[u]+le*M[u];K[4*u+1]=ce*_[u]+V*L[u]+ee*M[u],K[4*u+2]=ue,K[4*u+3]=0}var te=K[1],H=K[5],ae=K[9],ie=K[2],ve=K[6],Ae=K[10],Ce=H*Ae-ae*ve,Fe=ae*ie-te*Ae,ze=te*ve-H*ie,Ye=c(Ce,Fe,ze);Ce/=Ye,Fe/=Ye,ze/=Ye,K[0]=Ce,K[4]=Fe,K[8]=ze;for(var u=0;u<3;++u)ne[u]=Z[u]+K[2+4*u]*z;for(var u=0;u<3;++u){for(var y=0,it=0;it<3;++it)y+=K[u+4*it]*ne[it];K[12+u]=-y}K[15]=1},l.getMatrix=function(A,M){this.recalcMatrix(A);var _=this.computedMatrix;if(M){for(var w=0;w<16;++w)M[w]=_[w];return M}return _};var g=[0,0,0];l.rotate=function(A,M,_,w){if(this.angle.move(A,M,_),w){this.recalcMatrix(A);var m=this.computedMatrix;g[0]=m[2],g[1]=m[6],g[2]=m[10];for(var u=this.computedUp,v=this.computedRight,y=this.computedToward,I=0;I<3;++I)m[4*I]=u[I],m[4*I+1]=v[I],m[4*I+2]=y[I];i(m,m,w,g);for(var I=0;I<3;++I)u[I]=m[4*I],v[I]=m[4*I+1];this.up.set(A,u[0],u[1],u[2]),this.right.set(A,v[0],v[1],v[2])}},l.pan=function(A,M,_,w){M=M||0,_=_||0,w=w||0,this.recalcMatrix(A);var m=this.computedMatrix;Math.exp(this.computedRadius[0]);var u=m[1],v=m[5],y=m[9],I=c(u,v,y);u/=I,v/=I,y/=I;var L=m[0],z=m[4],F=m[8],N=L*u+z*v+F*y;L-=u*N,z-=v*N,F-=y*N;var B=c(L,z,F);L/=B,z/=B,F/=B;var R=L*M+u*_,U=z*M+v*_,j=F*M+y*_;this.center.move(A,R,U,j);var Z=Math.exp(this.computedRadius[0]);Z=Math.max(1e-4,Z+w),this.radius.set(A,Math.log(Z))},l.translate=function(A,M,_,w){this.center.move(A,M||0,_||0,w||0)},l.setMatrix=function(A,M,_,w){var m=1;typeof _=="number"&&(m=_|0),(m<0||m>3)&&(m=1);var u=(m+2)%3;M||(this.recalcMatrix(A),M=this.computedMatrix);var v=M[m],y=M[m+4],I=M[m+8];if(w){var z=Math.abs(v),F=Math.abs(y),N=Math.abs(I),B=Math.max(z,F,N);z===B?(v=v<0?-1:1,y=I=0):N===B?(I=I<0?-1:1,v=y=0):(y=y<0?-1:1,v=I=0)}else{var L=c(v,y,I);v/=L,y/=L,I/=L}var R=M[u],U=M[u+4],j=M[u+8],Z=R*v+U*y+j*I;R-=v*Z,U-=y*Z,j-=I*Z;var re=c(R,U,j);R/=re,U/=re,j/=re;var fe=y*j-I*U,le=I*R-v*j,ce=v*U-y*R,V=c(fe,le,ce);fe/=V,le/=V,ce/=V,this.center.jump(A,Le,Te,pe),this.radius.idle(A),this.up.jump(A,v,y,I),this.right.jump(A,R,U,j);var ee,ne;if(m===2){var K=M[1],ue=M[5],te=M[9],H=K*R+ue*U+te*j,ae=K*fe+ue*le+te*ce;Ce<0?ee=-Math.PI/2:ee=Math.PI/2,ne=Math.atan2(ae,H)}else{var ie=M[2],ve=M[6],Ae=M[10],Ce=ie*v+ve*y+Ae*I,Fe=ie*R+ve*U+Ae*j,ze=ie*fe+ve*le+Ae*ce;ee=Math.asin(p(Ce)),ne=Math.atan2(ze,Fe)}this.angle.jump(A,ne,ee),this.recalcMatrix(A);var Ye=M[2],it=M[6],st=M[10],nt=this.computedMatrix;n(nt,M);var Qe=nt[15],Le=nt[12]/Qe,Te=nt[13]/Qe,pe=nt[14]/Qe,Ne=Math.exp(this.computedRadius[0]);this.center.jump(A,Le-Ye*Ne,Te-it*Ne,pe-st*Ne)},l.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},l.idle=function(A){this.center.idle(A),this.up.idle(A),this.right.idle(A),this.radius.idle(A),this.angle.idle(A)},l.flush=function(A){this.center.flush(A),this.up.flush(A),this.right.flush(A),this.radius.flush(A),this.angle.flush(A)},l.setDistance=function(A,M){M>0&&this.radius.set(A,Math.log(M))},l.lookAt=function(A,M,_,w){this.recalcMatrix(A),M=M||this.computedEye,_=_||this.computedCenter,w=w||this.computedUp;var m=w[0],u=w[1],v=w[2],y=c(m,u,v);if(!(y<1e-6)){m/=y,u/=y,v/=y;var I=M[0]-_[0],L=M[1]-_[1],z=M[2]-_[2],F=c(I,L,z);if(!(F<1e-6)){I/=F,L/=F,z/=F;var N=this.computedRight,B=N[0],R=N[1],U=N[2],j=m*B+u*R+v*U;B-=j*m,R-=j*u,U-=j*v;var Z=c(B,R,U);if(!(Z<.01&&(B=u*z-v*L,R=v*I-m*z,U=m*L-u*I,Z=c(B,R,U),Z<1e-6))){B/=Z,R/=Z,U/=Z,this.up.set(A,m,u,v),this.right.set(A,B,R,U),this.center.set(A,_[0],_[1],_[2]),this.radius.set(A,Math.log(F));var re=u*U-v*R,fe=v*B-m*U,le=m*R-u*B,ce=c(re,fe,le);re/=ce,fe/=ce,le/=ce;var V=m*I+u*L+v*z,ee=B*I+R*L+U*z,ne=re*I+fe*L+le*z,K=Math.asin(p(V)),ue=Math.atan2(ne,ee),te=this.angle._state,H=te[te.length-1],ae=te[te.length-2];H=H%(2*Math.PI);var ie=Math.abs(H+2*Math.PI-ue),ve=Math.abs(H-ue),Ae=Math.abs(H-2*Math.PI-ue);ie0?R:U},s.min=function(R,U){return R.cmp(U)<0?R:U},s.prototype._init=function(R,U,j){if(typeof R=="number")return this._initNumber(R,U,j);if(typeof R=="object")return this._initArray(R,U,j);U==="hex"&&(U=16),i(U===(U|0)&&U>=2&&U<=36),R=R.toString().replace(/\s+/g,"");var Z=0;R[0]==="-"&&(Z++,this.negative=1),Z=0;Z-=3)fe=R[Z]|R[Z-1]<<8|R[Z-2]<<16,this.words[re]|=fe<>>26-le&67108863,le+=24,le>=26&&(le-=26,re++);else if(j==="le")for(Z=0,re=0;Z>>26-le&67108863,le+=24,le>=26&&(le-=26,re++);return this.strip()};function c(B,R){var U=B.charCodeAt(R);return U>=65&&U<=70?U-55:U>=97&&U<=102?U-87:U-48&15}function p(B,R,U){var j=c(B,U);return U-1>=R&&(j|=c(B,U-1)<<4),j}s.prototype._parseHex=function(R,U,j){this.length=Math.ceil((R.length-U)/6),this.words=new Array(this.length);for(var Z=0;Z=U;Z-=2)le=p(R,U,Z)<=18?(re-=18,fe+=1,this.words[fe]|=le>>>26):re+=8;else{var ce=R.length-U;for(Z=ce%2===0?U+1:U;Z=18?(re-=18,fe+=1,this.words[fe]|=le>>>26):re+=8}this.strip()};function v(B,R,U,j){for(var Z=0,re=Math.min(B.length,U),fe=R;fe=49?Z+=le-49+10:le>=17?Z+=le-17+10:Z+=le}return Z}s.prototype._parseBase=function(R,U,j){this.words=[0],this.length=1;for(var Z=0,re=1;re<=67108863;re*=U)Z++;Z--,re=re/U|0;for(var fe=R.length-j,le=fe%Z,ce=Math.min(fe,fe-le)+j,V=0,ee=j;ee1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var T=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(R,U){R=R||10,U=U|0||1;var j;if(R===16||R==="hex"){j="";for(var Z=0,re=0,fe=0;fe>>24-Z&16777215,re!==0||fe!==this.length-1?j=T[6-ce.length]+ce+j:j=ce+j,Z+=2,Z>=26&&(Z-=26,fe--)}for(re!==0&&(j=re.toString(16)+j);j.length%U!==0;)j="0"+j;return this.negative!==0&&(j="-"+j),j}if(R===(R|0)&&R>=2&&R<=36){var V=l[R],ee=g[R];j="";var ne=this.clone();for(ne.negative=0;!ne.isZero();){var $=ne.modn(ee).toString(R);ne=ne.idivn(ee),ne.isZero()?j=$+j:j=T[V-$.length]+$+j}for(this.isZero()&&(j="0"+j);j.length%U!==0;)j="0"+j;return this.negative!==0&&(j="-"+j),j}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var R=this.words[0];return this.length===2?R+=this.words[1]*67108864:this.length===3&&this.words[2]===1?R+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-R:R},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(R,U){return i(typeof f<"u"),this.toArrayLike(f,R,U)},s.prototype.toArray=function(R,U){return this.toArrayLike(Array,R,U)},s.prototype.toArrayLike=function(R,U,j){var Z=this.byteLength(),re=j||Math.max(1,Z);i(Z<=re,"byte array longer than desired length"),i(re>0,"Requested array length <= 0"),this.strip();var fe=U==="le",le=new R(re),ce,V,ee=this.clone();if(fe){for(V=0;!ee.isZero();V++)ce=ee.andln(255),ee.iushrn(8),le[V]=ce;for(;V=4096&&(j+=13,U>>>=13),U>=64&&(j+=7,U>>>=7),U>=8&&(j+=4,U>>>=4),U>=2&&(j+=2,U>>>=2),j+U},s.prototype._zeroBits=function(R){if(R===0)return 26;var U=R,j=0;return(U&8191)===0&&(j+=13,U>>>=13),(U&127)===0&&(j+=7,U>>>=7),(U&15)===0&&(j+=4,U>>>=4),(U&3)===0&&(j+=2,U>>>=2),(U&1)===0&&j++,j},s.prototype.bitLength=function(){var R=this.words[this.length-1],U=this._countBits(R);return(this.length-1)*26+U};function x(B){for(var R=new Array(B.bitLength()),U=0;U>>Z}return R}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var R=0,U=0;UR.length?this.clone().ior(R):R.clone().ior(this)},s.prototype.uor=function(R){return this.length>R.length?this.clone().iuor(R):R.clone().iuor(this)},s.prototype.iuand=function(R){var U;this.length>R.length?U=R:U=this;for(var j=0;jR.length?this.clone().iand(R):R.clone().iand(this)},s.prototype.uand=function(R){return this.length>R.length?this.clone().iuand(R):R.clone().iuand(this)},s.prototype.iuxor=function(R){var U,j;this.length>R.length?(U=this,j=R):(U=R,j=this);for(var Z=0;ZR.length?this.clone().ixor(R):R.clone().ixor(this)},s.prototype.uxor=function(R){return this.length>R.length?this.clone().iuxor(R):R.clone().iuxor(this)},s.prototype.inotn=function(R){i(typeof R=="number"&&R>=0);var U=Math.ceil(R/26)|0,j=R%26;this._expand(U),j>0&&U--;for(var Z=0;Z0&&(this.words[Z]=~this.words[Z]&67108863>>26-j),this.strip()},s.prototype.notn=function(R){return this.clone().inotn(R)},s.prototype.setn=function(R,U){i(typeof R=="number"&&R>=0);var j=R/26|0,Z=R%26;return this._expand(j+1),U?this.words[j]=this.words[j]|1<R.length?(j=this,Z=R):(j=R,Z=this);for(var re=0,fe=0;fe>>26;for(;re!==0&&fe>>26;if(this.length=j.length,re!==0)this.words[this.length]=re,this.length++;else if(j!==this)for(;feR.length?this.clone().iadd(R):R.clone().iadd(this)},s.prototype.isub=function(R){if(R.negative!==0){R.negative=0;var U=this.iadd(R);return R.negative=1,U._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(R),this.negative=1,this._normSign();var j=this.cmp(R);if(j===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,re;j>0?(Z=this,re=R):(Z=R,re=this);for(var fe=0,le=0;le>26,this.words[le]=U&67108863;for(;fe!==0&&le>26,this.words[le]=U&67108863;if(fe===0&&le>>26,ne=ce&67108863,$=Math.min(V,R.length-1),ue=Math.max(0,V-B.length+1);ue<=$;ue++){var te=V-ue|0;Z=B.words[te]|0,re=R.words[ue]|0,fe=Z*re+ne,ee+=fe/67108864|0,ne=fe&67108863}U.words[V]=ne|0,ce=ee|0}return ce!==0?U.words[V]=ce|0:U.length--,U.strip()}var M=function(R,U,j){var Z=R.words,re=U.words,fe=j.words,le=0,ce,V,ee,ne=Z[0]|0,$=ne&8191,ue=ne>>>13,te=Z[1]|0,H=te&8191,ae=te>>>13,ie=Z[2]|0,de=ie&8191,Se=ie>>>13,Le=Z[3]|0,Fe=Le&8191,ze=Le>>>13,Ye=Z[4]|0,st=Ye&8191,ct=Ye>>>13,at=Z[5]|0,et=at&8191,Pe=at>>>13,Ae=Z[6]|0,pe=Ae&8191,Ne=Ae>>>13,ut=Z[7]|0,dt=ut&8191,nt=ut>>>13,Ft=Z[8]|0,Nt=Ft&8191,Qt=Ft>>>13,ar=Z[9]|0,kr=ar&8191,Er=ar>>>13,$r=re[0]|0,Sr=$r&8191,Ur=$r>>>13,Mt=re[1]|0,je=Mt&8191,Je=Mt>>>13,ke=re[2]|0,xe=ke&8191,ye=ke>>>13,Ee=re[3]|0,Xe=Ee&8191,Qe=Ee>>>13,Lt=re[4]|0,Ct=Lt&8191,Ot=Lt>>>13,Kt=re[5]|0,xr=Kt&8191,mr=Kt>>>13,vr=re[6]|0,Nr=vr&8191,kn=vr>>>13,$n=re[7]|0,Vn=$n&8191,ra=$n>>>13,na=re[8]|0,Un=na&8191,ka=na>>>13,Va=re[9]|0,sr=Va&8191,Vt=Va>>>13;j.negative=R.negative^U.negative,j.length=19,ce=Math.imul($,Sr),V=Math.imul($,Ur),V=V+Math.imul(ue,Sr)|0,ee=Math.imul(ue,Ur);var or=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(or>>>26)|0,or&=67108863,ce=Math.imul(H,Sr),V=Math.imul(H,Ur),V=V+Math.imul(ae,Sr)|0,ee=Math.imul(ae,Ur),ce=ce+Math.imul($,je)|0,V=V+Math.imul($,Je)|0,V=V+Math.imul(ue,je)|0,ee=ee+Math.imul(ue,Je)|0;var ur=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(ur>>>26)|0,ur&=67108863,ce=Math.imul(de,Sr),V=Math.imul(de,Ur),V=V+Math.imul(Se,Sr)|0,ee=Math.imul(Se,Ur),ce=ce+Math.imul(H,je)|0,V=V+Math.imul(H,Je)|0,V=V+Math.imul(ae,je)|0,ee=ee+Math.imul(ae,Je)|0,ce=ce+Math.imul($,xe)|0,V=V+Math.imul($,ye)|0,V=V+Math.imul(ue,xe)|0,ee=ee+Math.imul(ue,ye)|0;var Gr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,ce=Math.imul(Fe,Sr),V=Math.imul(Fe,Ur),V=V+Math.imul(ze,Sr)|0,ee=Math.imul(ze,Ur),ce=ce+Math.imul(de,je)|0,V=V+Math.imul(de,Je)|0,V=V+Math.imul(Se,je)|0,ee=ee+Math.imul(Se,Je)|0,ce=ce+Math.imul(H,xe)|0,V=V+Math.imul(H,ye)|0,V=V+Math.imul(ae,xe)|0,ee=ee+Math.imul(ae,ye)|0,ce=ce+Math.imul($,Xe)|0,V=V+Math.imul($,Qe)|0,V=V+Math.imul(ue,Xe)|0,ee=ee+Math.imul(ue,Qe)|0;var ln=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(ln>>>26)|0,ln&=67108863,ce=Math.imul(st,Sr),V=Math.imul(st,Ur),V=V+Math.imul(ct,Sr)|0,ee=Math.imul(ct,Ur),ce=ce+Math.imul(Fe,je)|0,V=V+Math.imul(Fe,Je)|0,V=V+Math.imul(ze,je)|0,ee=ee+Math.imul(ze,Je)|0,ce=ce+Math.imul(de,xe)|0,V=V+Math.imul(de,ye)|0,V=V+Math.imul(Se,xe)|0,ee=ee+Math.imul(Se,ye)|0,ce=ce+Math.imul(H,Xe)|0,V=V+Math.imul(H,Qe)|0,V=V+Math.imul(ae,Xe)|0,ee=ee+Math.imul(ae,Qe)|0,ce=ce+Math.imul($,Ct)|0,V=V+Math.imul($,Ot)|0,V=V+Math.imul(ue,Ct)|0,ee=ee+Math.imul(ue,Ot)|0;var gn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(gn>>>26)|0,gn&=67108863,ce=Math.imul(et,Sr),V=Math.imul(et,Ur),V=V+Math.imul(Pe,Sr)|0,ee=Math.imul(Pe,Ur),ce=ce+Math.imul(st,je)|0,V=V+Math.imul(st,Je)|0,V=V+Math.imul(ct,je)|0,ee=ee+Math.imul(ct,Je)|0,ce=ce+Math.imul(Fe,xe)|0,V=V+Math.imul(Fe,ye)|0,V=V+Math.imul(ze,xe)|0,ee=ee+Math.imul(ze,ye)|0,ce=ce+Math.imul(de,Xe)|0,V=V+Math.imul(de,Qe)|0,V=V+Math.imul(Se,Xe)|0,ee=ee+Math.imul(Se,Qe)|0,ce=ce+Math.imul(H,Ct)|0,V=V+Math.imul(H,Ot)|0,V=V+Math.imul(ae,Ct)|0,ee=ee+Math.imul(ae,Ot)|0,ce=ce+Math.imul($,xr)|0,V=V+Math.imul($,mr)|0,V=V+Math.imul(ue,xr)|0,ee=ee+Math.imul(ue,mr)|0;var An=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(An>>>26)|0,An&=67108863,ce=Math.imul(pe,Sr),V=Math.imul(pe,Ur),V=V+Math.imul(Ne,Sr)|0,ee=Math.imul(Ne,Ur),ce=ce+Math.imul(et,je)|0,V=V+Math.imul(et,Je)|0,V=V+Math.imul(Pe,je)|0,ee=ee+Math.imul(Pe,Je)|0,ce=ce+Math.imul(st,xe)|0,V=V+Math.imul(st,ye)|0,V=V+Math.imul(ct,xe)|0,ee=ee+Math.imul(ct,ye)|0,ce=ce+Math.imul(Fe,Xe)|0,V=V+Math.imul(Fe,Qe)|0,V=V+Math.imul(ze,Xe)|0,ee=ee+Math.imul(ze,Qe)|0,ce=ce+Math.imul(de,Ct)|0,V=V+Math.imul(de,Ot)|0,V=V+Math.imul(Se,Ct)|0,ee=ee+Math.imul(Se,Ot)|0,ce=ce+Math.imul(H,xr)|0,V=V+Math.imul(H,mr)|0,V=V+Math.imul(ae,xr)|0,ee=ee+Math.imul(ae,mr)|0,ce=ce+Math.imul($,Nr)|0,V=V+Math.imul($,kn)|0,V=V+Math.imul(ue,Nr)|0,ee=ee+Math.imul(ue,kn)|0;var Qn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,ce=Math.imul(dt,Sr),V=Math.imul(dt,Ur),V=V+Math.imul(nt,Sr)|0,ee=Math.imul(nt,Ur),ce=ce+Math.imul(pe,je)|0,V=V+Math.imul(pe,Je)|0,V=V+Math.imul(Ne,je)|0,ee=ee+Math.imul(Ne,Je)|0,ce=ce+Math.imul(et,xe)|0,V=V+Math.imul(et,ye)|0,V=V+Math.imul(Pe,xe)|0,ee=ee+Math.imul(Pe,ye)|0,ce=ce+Math.imul(st,Xe)|0,V=V+Math.imul(st,Qe)|0,V=V+Math.imul(ct,Xe)|0,ee=ee+Math.imul(ct,Qe)|0,ce=ce+Math.imul(Fe,Ct)|0,V=V+Math.imul(Fe,Ot)|0,V=V+Math.imul(ze,Ct)|0,ee=ee+Math.imul(ze,Ot)|0,ce=ce+Math.imul(de,xr)|0,V=V+Math.imul(de,mr)|0,V=V+Math.imul(Se,xr)|0,ee=ee+Math.imul(Se,mr)|0,ce=ce+Math.imul(H,Nr)|0,V=V+Math.imul(H,kn)|0,V=V+Math.imul(ae,Nr)|0,ee=ee+Math.imul(ae,kn)|0,ce=ce+Math.imul($,Vn)|0,V=V+Math.imul($,ra)|0,V=V+Math.imul(ue,Vn)|0,ee=ee+Math.imul(ue,ra)|0;var pa=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(pa>>>26)|0,pa&=67108863,ce=Math.imul(Nt,Sr),V=Math.imul(Nt,Ur),V=V+Math.imul(Qt,Sr)|0,ee=Math.imul(Qt,Ur),ce=ce+Math.imul(dt,je)|0,V=V+Math.imul(dt,Je)|0,V=V+Math.imul(nt,je)|0,ee=ee+Math.imul(nt,Je)|0,ce=ce+Math.imul(pe,xe)|0,V=V+Math.imul(pe,ye)|0,V=V+Math.imul(Ne,xe)|0,ee=ee+Math.imul(Ne,ye)|0,ce=ce+Math.imul(et,Xe)|0,V=V+Math.imul(et,Qe)|0,V=V+Math.imul(Pe,Xe)|0,ee=ee+Math.imul(Pe,Qe)|0,ce=ce+Math.imul(st,Ct)|0,V=V+Math.imul(st,Ot)|0,V=V+Math.imul(ct,Ct)|0,ee=ee+Math.imul(ct,Ot)|0,ce=ce+Math.imul(Fe,xr)|0,V=V+Math.imul(Fe,mr)|0,V=V+Math.imul(ze,xr)|0,ee=ee+Math.imul(ze,mr)|0,ce=ce+Math.imul(de,Nr)|0,V=V+Math.imul(de,kn)|0,V=V+Math.imul(Se,Nr)|0,ee=ee+Math.imul(Se,kn)|0,ce=ce+Math.imul(H,Vn)|0,V=V+Math.imul(H,ra)|0,V=V+Math.imul(ae,Vn)|0,ee=ee+Math.imul(ae,ra)|0,ce=ce+Math.imul($,Un)|0,V=V+Math.imul($,ka)|0,V=V+Math.imul(ue,Un)|0,ee=ee+Math.imul(ue,ka)|0;var ha=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(ha>>>26)|0,ha&=67108863,ce=Math.imul(kr,Sr),V=Math.imul(kr,Ur),V=V+Math.imul(Er,Sr)|0,ee=Math.imul(Er,Ur),ce=ce+Math.imul(Nt,je)|0,V=V+Math.imul(Nt,Je)|0,V=V+Math.imul(Qt,je)|0,ee=ee+Math.imul(Qt,Je)|0,ce=ce+Math.imul(dt,xe)|0,V=V+Math.imul(dt,ye)|0,V=V+Math.imul(nt,xe)|0,ee=ee+Math.imul(nt,ye)|0,ce=ce+Math.imul(pe,Xe)|0,V=V+Math.imul(pe,Qe)|0,V=V+Math.imul(Ne,Xe)|0,ee=ee+Math.imul(Ne,Qe)|0,ce=ce+Math.imul(et,Ct)|0,V=V+Math.imul(et,Ot)|0,V=V+Math.imul(Pe,Ct)|0,ee=ee+Math.imul(Pe,Ot)|0,ce=ce+Math.imul(st,xr)|0,V=V+Math.imul(st,mr)|0,V=V+Math.imul(ct,xr)|0,ee=ee+Math.imul(ct,mr)|0,ce=ce+Math.imul(Fe,Nr)|0,V=V+Math.imul(Fe,kn)|0,V=V+Math.imul(ze,Nr)|0,ee=ee+Math.imul(ze,kn)|0,ce=ce+Math.imul(de,Vn)|0,V=V+Math.imul(de,ra)|0,V=V+Math.imul(Se,Vn)|0,ee=ee+Math.imul(Se,ra)|0,ce=ce+Math.imul(H,Un)|0,V=V+Math.imul(H,ka)|0,V=V+Math.imul(ae,Un)|0,ee=ee+Math.imul(ae,ka)|0,ce=ce+Math.imul($,sr)|0,V=V+Math.imul($,Vt)|0,V=V+Math.imul(ue,sr)|0,ee=ee+Math.imul(ue,Vt)|0;var _a=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(_a>>>26)|0,_a&=67108863,ce=Math.imul(kr,je),V=Math.imul(kr,Je),V=V+Math.imul(Er,je)|0,ee=Math.imul(Er,Je),ce=ce+Math.imul(Nt,xe)|0,V=V+Math.imul(Nt,ye)|0,V=V+Math.imul(Qt,xe)|0,ee=ee+Math.imul(Qt,ye)|0,ce=ce+Math.imul(dt,Xe)|0,V=V+Math.imul(dt,Qe)|0,V=V+Math.imul(nt,Xe)|0,ee=ee+Math.imul(nt,Qe)|0,ce=ce+Math.imul(pe,Ct)|0,V=V+Math.imul(pe,Ot)|0,V=V+Math.imul(Ne,Ct)|0,ee=ee+Math.imul(Ne,Ot)|0,ce=ce+Math.imul(et,xr)|0,V=V+Math.imul(et,mr)|0,V=V+Math.imul(Pe,xr)|0,ee=ee+Math.imul(Pe,mr)|0,ce=ce+Math.imul(st,Nr)|0,V=V+Math.imul(st,kn)|0,V=V+Math.imul(ct,Nr)|0,ee=ee+Math.imul(ct,kn)|0,ce=ce+Math.imul(Fe,Vn)|0,V=V+Math.imul(Fe,ra)|0,V=V+Math.imul(ze,Vn)|0,ee=ee+Math.imul(ze,ra)|0,ce=ce+Math.imul(de,Un)|0,V=V+Math.imul(de,ka)|0,V=V+Math.imul(Se,Un)|0,ee=ee+Math.imul(Se,ka)|0,ce=ce+Math.imul(H,sr)|0,V=V+Math.imul(H,Vt)|0,V=V+Math.imul(ae,sr)|0,ee=ee+Math.imul(ae,Vt)|0;var Ca=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,ce=Math.imul(kr,xe),V=Math.imul(kr,ye),V=V+Math.imul(Er,xe)|0,ee=Math.imul(Er,ye),ce=ce+Math.imul(Nt,Xe)|0,V=V+Math.imul(Nt,Qe)|0,V=V+Math.imul(Qt,Xe)|0,ee=ee+Math.imul(Qt,Qe)|0,ce=ce+Math.imul(dt,Ct)|0,V=V+Math.imul(dt,Ot)|0,V=V+Math.imul(nt,Ct)|0,ee=ee+Math.imul(nt,Ot)|0,ce=ce+Math.imul(pe,xr)|0,V=V+Math.imul(pe,mr)|0,V=V+Math.imul(Ne,xr)|0,ee=ee+Math.imul(Ne,mr)|0,ce=ce+Math.imul(et,Nr)|0,V=V+Math.imul(et,kn)|0,V=V+Math.imul(Pe,Nr)|0,ee=ee+Math.imul(Pe,kn)|0,ce=ce+Math.imul(st,Vn)|0,V=V+Math.imul(st,ra)|0,V=V+Math.imul(ct,Vn)|0,ee=ee+Math.imul(ct,ra)|0,ce=ce+Math.imul(Fe,Un)|0,V=V+Math.imul(Fe,ka)|0,V=V+Math.imul(ze,Un)|0,ee=ee+Math.imul(ze,ka)|0,ce=ce+Math.imul(de,sr)|0,V=V+Math.imul(de,Vt)|0,V=V+Math.imul(Se,sr)|0,ee=ee+Math.imul(Se,Vt)|0;var Hn=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Hn>>>26)|0,Hn&=67108863,ce=Math.imul(kr,Xe),V=Math.imul(kr,Qe),V=V+Math.imul(Er,Xe)|0,ee=Math.imul(Er,Qe),ce=ce+Math.imul(Nt,Ct)|0,V=V+Math.imul(Nt,Ot)|0,V=V+Math.imul(Qt,Ct)|0,ee=ee+Math.imul(Qt,Ot)|0,ce=ce+Math.imul(dt,xr)|0,V=V+Math.imul(dt,mr)|0,V=V+Math.imul(nt,xr)|0,ee=ee+Math.imul(nt,mr)|0,ce=ce+Math.imul(pe,Nr)|0,V=V+Math.imul(pe,kn)|0,V=V+Math.imul(Ne,Nr)|0,ee=ee+Math.imul(Ne,kn)|0,ce=ce+Math.imul(et,Vn)|0,V=V+Math.imul(et,ra)|0,V=V+Math.imul(Pe,Vn)|0,ee=ee+Math.imul(Pe,ra)|0,ce=ce+Math.imul(st,Un)|0,V=V+Math.imul(st,ka)|0,V=V+Math.imul(ct,Un)|0,ee=ee+Math.imul(ct,ka)|0,ce=ce+Math.imul(Fe,sr)|0,V=V+Math.imul(Fe,Vt)|0,V=V+Math.imul(ze,sr)|0,ee=ee+Math.imul(ze,Vt)|0;var pi=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(pi>>>26)|0,pi&=67108863,ce=Math.imul(kr,Ct),V=Math.imul(kr,Ot),V=V+Math.imul(Er,Ct)|0,ee=Math.imul(Er,Ot),ce=ce+Math.imul(Nt,xr)|0,V=V+Math.imul(Nt,mr)|0,V=V+Math.imul(Qt,xr)|0,ee=ee+Math.imul(Qt,mr)|0,ce=ce+Math.imul(dt,Nr)|0,V=V+Math.imul(dt,kn)|0,V=V+Math.imul(nt,Nr)|0,ee=ee+Math.imul(nt,kn)|0,ce=ce+Math.imul(pe,Vn)|0,V=V+Math.imul(pe,ra)|0,V=V+Math.imul(Ne,Vn)|0,ee=ee+Math.imul(Ne,ra)|0,ce=ce+Math.imul(et,Un)|0,V=V+Math.imul(et,ka)|0,V=V+Math.imul(Pe,Un)|0,ee=ee+Math.imul(Pe,ka)|0,ce=ce+Math.imul(st,sr)|0,V=V+Math.imul(st,Vt)|0,V=V+Math.imul(ct,sr)|0,ee=ee+Math.imul(ct,Vt)|0;var Si=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Si>>>26)|0,Si&=67108863,ce=Math.imul(kr,xr),V=Math.imul(kr,mr),V=V+Math.imul(Er,xr)|0,ee=Math.imul(Er,mr),ce=ce+Math.imul(Nt,Nr)|0,V=V+Math.imul(Nt,kn)|0,V=V+Math.imul(Qt,Nr)|0,ee=ee+Math.imul(Qt,kn)|0,ce=ce+Math.imul(dt,Vn)|0,V=V+Math.imul(dt,ra)|0,V=V+Math.imul(nt,Vn)|0,ee=ee+Math.imul(nt,ra)|0,ce=ce+Math.imul(pe,Un)|0,V=V+Math.imul(pe,ka)|0,V=V+Math.imul(Ne,Un)|0,ee=ee+Math.imul(Ne,ka)|0,ce=ce+Math.imul(et,sr)|0,V=V+Math.imul(et,Vt)|0,V=V+Math.imul(Pe,sr)|0,ee=ee+Math.imul(Pe,Vt)|0;var Dt=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,ce=Math.imul(kr,Nr),V=Math.imul(kr,kn),V=V+Math.imul(Er,Nr)|0,ee=Math.imul(Er,kn),ce=ce+Math.imul(Nt,Vn)|0,V=V+Math.imul(Nt,ra)|0,V=V+Math.imul(Qt,Vn)|0,ee=ee+Math.imul(Qt,ra)|0,ce=ce+Math.imul(dt,Un)|0,V=V+Math.imul(dt,ka)|0,V=V+Math.imul(nt,Un)|0,ee=ee+Math.imul(nt,ka)|0,ce=ce+Math.imul(pe,sr)|0,V=V+Math.imul(pe,Vt)|0,V=V+Math.imul(Ne,sr)|0,ee=ee+Math.imul(Ne,Vt)|0;var xt=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(xt>>>26)|0,xt&=67108863,ce=Math.imul(kr,Vn),V=Math.imul(kr,ra),V=V+Math.imul(Er,Vn)|0,ee=Math.imul(Er,ra),ce=ce+Math.imul(Nt,Un)|0,V=V+Math.imul(Nt,ka)|0,V=V+Math.imul(Qt,Un)|0,ee=ee+Math.imul(Qt,ka)|0,ce=ce+Math.imul(dt,sr)|0,V=V+Math.imul(dt,Vt)|0,V=V+Math.imul(nt,sr)|0,ee=ee+Math.imul(nt,Vt)|0;var Cr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,ce=Math.imul(kr,Un),V=Math.imul(kr,ka),V=V+Math.imul(Er,Un)|0,ee=Math.imul(Er,ka),ce=ce+Math.imul(Nt,sr)|0,V=V+Math.imul(Nt,Vt)|0,V=V+Math.imul(Qt,sr)|0,ee=ee+Math.imul(Qt,Vt)|0;var jr=(le+ce|0)+((V&8191)<<13)|0;le=(ee+(V>>>13)|0)+(jr>>>26)|0,jr&=67108863,ce=Math.imul(kr,sr),V=Math.imul(kr,Vt),V=V+Math.imul(Er,sr)|0,ee=Math.imul(Er,Vt);var Vr=(le+ce|0)+((V&8191)<<13)|0;return le=(ee+(V>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,fe[0]=or,fe[1]=ur,fe[2]=Gr,fe[3]=ln,fe[4]=gn,fe[5]=An,fe[6]=Qn,fe[7]=pa,fe[8]=ha,fe[9]=_a,fe[10]=Ca,fe[11]=Hn,fe[12]=pi,fe[13]=Si,fe[14]=Dt,fe[15]=xt,fe[16]=Cr,fe[17]=jr,fe[18]=Vr,le!==0&&(fe[19]=le,j.length++),j};Math.imul||(M=A);function _(B,R,U){U.negative=R.negative^B.negative,U.length=B.length+R.length;for(var j=0,Z=0,re=0;re>>26)|0,Z+=fe>>>26,fe&=67108863}U.words[re]=le,j=fe,fe=Z}return j!==0?U.words[re]=j:U.length--,U.strip()}function w(B,R,U){var j=new m;return j.mulp(B,R,U)}s.prototype.mulTo=function(R,U){var j,Z=this.length+R.length;return this.length===10&&R.length===10?j=M(this,R,U):Z<63?j=A(this,R,U):Z<1024?j=_(this,R,U):j=w(this,R,U),j};function m(B,R){this.x=B,this.y=R}m.prototype.makeRBT=function(R){for(var U=new Array(R),j=s.prototype._countBits(R)-1,Z=0;Z>=1;return Z},m.prototype.permute=function(R,U,j,Z,re,fe){for(var le=0;le>>1)re++;return 1<>>13,j[2*fe+1]=re&8191,re=re>>>13;for(fe=2*U;fe>=26,U+=Z/67108864|0,U+=re>>>26,this.words[j]=re&67108863}return U!==0&&(this.words[j]=U,this.length++),this},s.prototype.muln=function(R){return this.clone().imuln(R)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(R){var U=x(R);if(U.length===0)return new s(1);for(var j=this,Z=0;Z=0);var U=R%26,j=(R-U)/26,Z=67108863>>>26-U<<26-U,re;if(U!==0){var fe=0;for(re=0;re>>26-U}fe&&(this.words[re]=fe,this.length++)}if(j!==0){for(re=this.length-1;re>=0;re--)this.words[re+j]=this.words[re];for(re=0;re=0);var Z;U?Z=(U-U%26)/26:Z=0;var re=R%26,fe=Math.min((R-re)/26,this.length),le=67108863^67108863>>>re<fe)for(this.length-=fe,V=0;V=0&&(ee!==0||V>=Z);V--){var ne=this.words[V]|0;this.words[V]=ee<<26-re|ne>>>re,ee=ne&le}return ce&&ee!==0&&(ce.words[ce.length++]=ee),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(R,U,j){return i(this.negative===0),this.iushrn(R,U,j)},s.prototype.shln=function(R){return this.clone().ishln(R)},s.prototype.ushln=function(R){return this.clone().iushln(R)},s.prototype.shrn=function(R){return this.clone().ishrn(R)},s.prototype.ushrn=function(R){return this.clone().iushrn(R)},s.prototype.testn=function(R){i(typeof R=="number"&&R>=0);var U=R%26,j=(R-U)/26,Z=1<=0);var U=R%26,j=(R-U)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=j)return this;if(U!==0&&j++,this.length=Math.min(j,this.length),U!==0){var Z=67108863^67108863>>>U<=67108864;U++)this.words[U]-=67108864,U===this.length-1?this.words[U+1]=1:this.words[U+1]++;return this.length=Math.max(this.length,U+1),this},s.prototype.isubn=function(R){if(i(typeof R=="number"),i(R<67108864),R<0)return this.iaddn(-R);if(this.negative!==0)return this.negative=0,this.iaddn(R),this.negative=1,this;if(this.words[0]-=R,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var U=0;U>26)-(ce/67108864|0),this.words[re+j]=fe&67108863}for(;re>26,this.words[re+j]=fe&67108863;if(le===0)return this.strip();for(i(le===-1),le=0,re=0;re>26,this.words[re]=fe&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(R,U){var j=this.length-R.length,Z=this.clone(),re=R,fe=re.words[re.length-1]|0,le=this._countBits(fe);j=26-le,j!==0&&(re=re.ushln(j),Z.iushln(j),fe=re.words[re.length-1]|0);var ce=Z.length-re.length,V;if(U!=="mod"){V=new s(null),V.length=ce+1,V.words=new Array(V.length);for(var ee=0;ee=0;$--){var ue=(Z.words[re.length+$]|0)*67108864+(Z.words[re.length+$-1]|0);for(ue=Math.min(ue/fe|0,67108863),Z._ishlnsubmul(re,ue,$);Z.negative!==0;)ue--,Z.negative=0,Z._ishlnsubmul(re,1,$),Z.isZero()||(Z.negative^=1);V&&(V.words[$]=ue)}return V&&V.strip(),Z.strip(),U!=="div"&&j!==0&&Z.iushrn(j),{div:V||null,mod:Z}},s.prototype.divmod=function(R,U,j){if(i(!R.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var Z,re,fe;return this.negative!==0&&R.negative===0?(fe=this.neg().divmod(R,U),U!=="mod"&&(Z=fe.div.neg()),U!=="div"&&(re=fe.mod.neg(),j&&re.negative!==0&&re.iadd(R)),{div:Z,mod:re}):this.negative===0&&R.negative!==0?(fe=this.divmod(R.neg(),U),U!=="mod"&&(Z=fe.div.neg()),{div:Z,mod:fe.mod}):(this.negative&R.negative)!==0?(fe=this.neg().divmod(R.neg(),U),U!=="div"&&(re=fe.mod.neg(),j&&re.negative!==0&&re.isub(R)),{div:fe.div,mod:re}):R.length>this.length||this.cmp(R)<0?{div:new s(0),mod:this}:R.length===1?U==="div"?{div:this.divn(R.words[0]),mod:null}:U==="mod"?{div:null,mod:new s(this.modn(R.words[0]))}:{div:this.divn(R.words[0]),mod:new s(this.modn(R.words[0]))}:this._wordDiv(R,U)},s.prototype.div=function(R){return this.divmod(R,"div",!1).div},s.prototype.mod=function(R){return this.divmod(R,"mod",!1).mod},s.prototype.umod=function(R){return this.divmod(R,"mod",!0).mod},s.prototype.divRound=function(R){var U=this.divmod(R);if(U.mod.isZero())return U.div;var j=U.div.negative!==0?U.mod.isub(R):U.mod,Z=R.ushrn(1),re=R.andln(1),fe=j.cmp(Z);return fe<0||re===1&&fe===0?U.div:U.div.negative!==0?U.div.isubn(1):U.div.iaddn(1)},s.prototype.modn=function(R){i(R<=67108863);for(var U=(1<<26)%R,j=0,Z=this.length-1;Z>=0;Z--)j=(U*j+(this.words[Z]|0))%R;return j},s.prototype.idivn=function(R){i(R<=67108863);for(var U=0,j=this.length-1;j>=0;j--){var Z=(this.words[j]|0)+U*67108864;this.words[j]=Z/R|0,U=Z%R}return this.strip()},s.prototype.divn=function(R){return this.clone().idivn(R)},s.prototype.egcd=function(R){i(R.negative===0),i(!R.isZero());var U=this,j=R.clone();U.negative!==0?U=U.umod(R):U=U.clone();for(var Z=new s(1),re=new s(0),fe=new s(0),le=new s(1),ce=0;U.isEven()&&j.isEven();)U.iushrn(1),j.iushrn(1),++ce;for(var V=j.clone(),ee=U.clone();!U.isZero();){for(var ne=0,$=1;(U.words[0]&$)===0&&ne<26;++ne,$<<=1);if(ne>0)for(U.iushrn(ne);ne-- >0;)(Z.isOdd()||re.isOdd())&&(Z.iadd(V),re.isub(ee)),Z.iushrn(1),re.iushrn(1);for(var ue=0,te=1;(j.words[0]&te)===0&&ue<26;++ue,te<<=1);if(ue>0)for(j.iushrn(ue);ue-- >0;)(fe.isOdd()||le.isOdd())&&(fe.iadd(V),le.isub(ee)),fe.iushrn(1),le.iushrn(1);U.cmp(j)>=0?(U.isub(j),Z.isub(fe),re.isub(le)):(j.isub(U),fe.isub(Z),le.isub(re))}return{a:fe,b:le,gcd:j.iushln(ce)}},s.prototype._invmp=function(R){i(R.negative===0),i(!R.isZero());var U=this,j=R.clone();U.negative!==0?U=U.umod(R):U=U.clone();for(var Z=new s(1),re=new s(0),fe=j.clone();U.cmpn(1)>0&&j.cmpn(1)>0;){for(var le=0,ce=1;(U.words[0]&ce)===0&&le<26;++le,ce<<=1);if(le>0)for(U.iushrn(le);le-- >0;)Z.isOdd()&&Z.iadd(fe),Z.iushrn(1);for(var V=0,ee=1;(j.words[0]&ee)===0&&V<26;++V,ee<<=1);if(V>0)for(j.iushrn(V);V-- >0;)re.isOdd()&&re.iadd(fe),re.iushrn(1);U.cmp(j)>=0?(U.isub(j),Z.isub(re)):(j.isub(U),re.isub(Z))}var ne;return U.cmpn(1)===0?ne=Z:ne=re,ne.cmpn(0)<0&&ne.iadd(R),ne},s.prototype.gcd=function(R){if(this.isZero())return R.abs();if(R.isZero())return this.abs();var U=this.clone(),j=R.clone();U.negative=0,j.negative=0;for(var Z=0;U.isEven()&&j.isEven();Z++)U.iushrn(1),j.iushrn(1);do{for(;U.isEven();)U.iushrn(1);for(;j.isEven();)j.iushrn(1);var re=U.cmp(j);if(re<0){var fe=U;U=j,j=fe}else if(re===0||j.cmpn(1)===0)break;U.isub(j)}while(!0);return j.iushln(Z)},s.prototype.invm=function(R){return this.egcd(R).a.umod(R)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(R){return this.words[0]&R},s.prototype.bincn=function(R){i(typeof R=="number");var U=R%26,j=(R-U)/26,Z=1<>>26,le&=67108863,this.words[fe]=le}return re!==0&&(this.words[fe]=re,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(R){var U=R<0;if(this.negative!==0&&!U)return-1;if(this.negative===0&&U)return 1;this.strip();var j;if(this.length>1)j=1;else{U&&(R=-R),i(R<=67108863,"Number is too big");var Z=this.words[0]|0;j=Z===R?0:ZR.length)return 1;if(this.length=0;j--){var Z=this.words[j]|0,re=R.words[j]|0;if(Z!==re){Zre&&(U=1);break}}return U},s.prototype.gtn=function(R){return this.cmpn(R)===1},s.prototype.gt=function(R){return this.cmp(R)===1},s.prototype.gten=function(R){return this.cmpn(R)>=0},s.prototype.gte=function(R){return this.cmp(R)>=0},s.prototype.ltn=function(R){return this.cmpn(R)===-1},s.prototype.lt=function(R){return this.cmp(R)===-1},s.prototype.lten=function(R){return this.cmpn(R)<=0},s.prototype.lte=function(R){return this.cmp(R)<=0},s.prototype.eqn=function(R){return this.cmpn(R)===0},s.prototype.eq=function(R){return this.cmp(R)===0},s.red=function(R){return new F(R)},s.prototype.toRed=function(R){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),R.convertTo(this)._forceRed(R)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(R){return this.red=R,this},s.prototype.forceRed=function(R){return i(!this.red,"Already a number in reduction context"),this._forceRed(R)},s.prototype.redAdd=function(R){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,R)},s.prototype.redIAdd=function(R){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,R)},s.prototype.redSub=function(R){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,R)},s.prototype.redISub=function(R){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,R)},s.prototype.redShl=function(R){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,R)},s.prototype.redMul=function(R){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,R),this.red.mul(this,R)},s.prototype.redIMul=function(R){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,R),this.red.imul(this,R)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(R){return i(this.red&&!R.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,R)};var u={k256:null,p224:null,p192:null,p25519:null};function d(B,R){this.name=B,this.p=new s(R,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}d.prototype._tmp=function(){var R=new s(null);return R.words=new Array(Math.ceil(this.n/13)),R},d.prototype.ireduce=function(R){var U=R,j;do this.split(U,this.tmp),U=this.imulK(U),U=U.iadd(this.tmp),j=U.bitLength();while(j>this.n);var Z=j0?U.isub(this.p):U.strip!==void 0?U.strip():U._strip(),U},d.prototype.split=function(R,U){R.iushrn(this.n,0,U)},d.prototype.imulK=function(R){return R.imul(this.k)};function y(){d.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(y,d),y.prototype.split=function(R,U){for(var j=4194303,Z=Math.min(R.length,9),re=0;re>>22,fe=le}fe>>>=22,R.words[re-10]=fe,fe===0&&R.length>10?R.length-=10:R.length-=9},y.prototype.imulK=function(R){R.words[R.length]=0,R.words[R.length+1]=0,R.length+=2;for(var U=0,j=0;j>>=26,R.words[j]=re,U=Z}return U!==0&&(R.words[R.length++]=U),R},s._prime=function(R){if(u[R])return u[R];var U;if(R==="k256")U=new y;else if(R==="p224")U=new I;else if(R==="p192")U=new L;else if(R==="p25519")U=new z;else throw new Error("Unknown prime "+R);return u[R]=U,U};function F(B){if(typeof B=="string"){var R=s._prime(B);this.m=R.p,this.prime=R}else i(B.gtn(1),"modulus must be greater than 1"),this.m=B,this.prime=null}F.prototype._verify1=function(R){i(R.negative===0,"red works only with positives"),i(R.red,"red works only with red numbers")},F.prototype._verify2=function(R,U){i((R.negative|U.negative)===0,"red works only with positives"),i(R.red&&R.red===U.red,"red works only with red numbers")},F.prototype.imod=function(R){return this.prime?this.prime.ireduce(R)._forceRed(this):R.umod(this.m)._forceRed(this)},F.prototype.neg=function(R){return R.isZero()?R.clone():this.m.sub(R)._forceRed(this)},F.prototype.add=function(R,U){this._verify2(R,U);var j=R.add(U);return j.cmp(this.m)>=0&&j.isub(this.m),j._forceRed(this)},F.prototype.iadd=function(R,U){this._verify2(R,U);var j=R.iadd(U);return j.cmp(this.m)>=0&&j.isub(this.m),j},F.prototype.sub=function(R,U){this._verify2(R,U);var j=R.sub(U);return j.cmpn(0)<0&&j.iadd(this.m),j._forceRed(this)},F.prototype.isub=function(R,U){this._verify2(R,U);var j=R.isub(U);return j.cmpn(0)<0&&j.iadd(this.m),j},F.prototype.shl=function(R,U){return this._verify1(R),this.imod(R.ushln(U))},F.prototype.imul=function(R,U){return this._verify2(R,U),this.imod(R.imul(U))},F.prototype.mul=function(R,U){return this._verify2(R,U),this.imod(R.mul(U))},F.prototype.isqr=function(R){return this.imul(R,R.clone())},F.prototype.sqr=function(R){return this.mul(R,R)},F.prototype.sqrt=function(R){if(R.isZero())return R.clone();var U=this.m.andln(3);if(i(U%2===1),U===3){var j=this.m.add(new s(1)).iushrn(2);return this.pow(R,j)}for(var Z=this.m.subn(1),re=0;!Z.isZero()&&Z.andln(1)===0;)re++,Z.iushrn(1);i(!Z.isZero());var fe=new s(1).toRed(this),le=fe.redNeg(),ce=this.m.subn(1).iushrn(1),V=this.m.bitLength();for(V=new s(2*V*V).toRed(this);this.pow(V,ce).cmp(le)!==0;)V.redIAdd(le);for(var ee=this.pow(V,Z),ne=this.pow(R,Z.addn(1).iushrn(1)),$=this.pow(R,Z),ue=re;$.cmp(fe)!==0;){for(var te=$,H=0;te.cmp(fe)!==0;H++)te=te.redSqr();i(H=0;re--){for(var ee=U.words[re],ne=V-1;ne>=0;ne--){var $=ee>>ne&1;if(fe!==Z[0]&&(fe=this.sqr(fe)),$===0&&le===0){ce=0;continue}le<<=1,le|=$,ce++,!(ce!==j&&(re!==0||ne!==0))&&(fe=this.mul(fe,Z[le]),ce=0,le=0)}V=26}return fe},F.prototype.convertTo=function(R){var U=R.umod(this.m);return U===R?U.clone():U},F.prototype.convertFrom=function(R){var U=R.clone();return U.red=null,U},s.mont=function(R){return new N(R)};function N(B){F.call(this,B),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(N,F),N.prototype.convertTo=function(R){return this.imod(R.ushln(this.shift))},N.prototype.convertFrom=function(R){var U=this.imod(R.mul(this.rinv));return U.red=null,U},N.prototype.imul=function(R,U){if(R.isZero()||U.isZero())return R.words[0]=0,R.length=1,R;var j=R.imul(U),Z=j.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),re=j.isub(Z).iushrn(this.shift),fe=re;return re.cmp(this.m)>=0?fe=re.isub(this.m):re.cmpn(0)<0&&(fe=re.iadd(this.m)),fe._forceRed(this)},N.prototype.mul=function(R,U){if(R.isZero()||U.isZero())return new s(0)._forceRed(this);var j=R.mul(U),Z=j.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),re=j.isub(Z).iushrn(this.shift),fe=re;return re.cmp(this.m)>=0?fe=re.isub(this.m):re.cmpn(0)<0&&(fe=re.iadd(this.m)),fe._forceRed(this)},N.prototype.invm=function(R){var U=this.imod(R._invmp(this.m).mul(this.r2));return U._forceRed(this)}})(e,this)}),6860:(function(e){e.exports=t;function t(r,o,n){return r[0]=o[0]-n[0],r[1]=o[1]-n[1],r[2]=o[2]-n[2],r[3]=o[3]-n[3],r}}),6864:(function(e){e.exports=t;function t(){var r=new Float32Array(16);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}}),6867:(function(e,t,r){e.exports=l;var o=r(1888),n=r(855),i=r(7150);function a(g,x){for(var A=0;A>>1;if(!(m<=0)){var u,d=o.mallocDouble(2*m*_),y=o.mallocInt32(_);if(_=s(g,m,d,y),_>0){if(m===1&&M)n.init(_),u=n.sweepComplete(m,A,0,_,d,y,0,_,d,y);else{var I=o.mallocDouble(2*m*w),L=o.mallocInt32(w);w=s(x,m,I,L),w>0&&(n.init(_+w),m===1?u=n.sweepBipartite(m,A,0,_,d,y,0,w,I,L):u=i(m,A,M,_,d,y,w,I,L),o.free(I),o.free(L))}o.free(d),o.free(y)}return u}}}var c;function p(g,x){c.push([g,x])}function v(g){return c=[],f(g,g,p,!0),c}function T(g,x){return c=[],f(g,x,p,!1),c}function l(g,x,A){switch(arguments.length){case 1:return v(g);case 2:return typeof x=="function"?f(g,g,x,!0):T(g,x);case 3:return f(g,x,A,!1);default:throw new Error("box-intersect: Invalid arguments")}}}),6894:(function(e){e.exports=t;function t(r,o,n,i){var a=n[1],s=n[2],f=o[1]-a,c=o[2]-s,p=Math.sin(i),v=Math.cos(i);return r[0]=o[0],r[1]=a+f*v-c*p,r[2]=s+f*p+c*v,r}}),7004:(function(e){e.exports=t;function t(r){for(var o=r.length,n=r[r.length-1],i=o,a=o-2;a>=0;--a){var s=n,f=r[a];n=s+f;var c=n-s,p=f-c;p&&(r[--i]=n,n=p)}for(var v=0,a=i;a=p0)&&!(p1>=hi)"),x=p("lo===p0"),A=p("lo0;){ee-=1;var ue=ee*m,te=y[ue],H=y[ue+1],ae=y[ue+2],ie=y[ue+3],de=y[ue+4],Se=y[ue+5],Le=ee*u,Fe=I[Le],ze=I[Le+1],Ye=Se&1,st=!!(Se&16),ct=re,at=fe,et=ce,Pe=V;if(Ye&&(ct=ce,at=V,et=re,Pe=fe),!(Se&2&&(ae=A(R,te,H,ae,ct,at,ze),H>=ae))&&!(Se&4&&(H=M(R,te,H,ae,ct,at,Fe),H>=ae))){var Ae=ae-H,pe=de-ie;if(st){if(R*Ae*(Ae+pe)"u"?r(1538):WeakMap,n=r(2762),i=r(8116),a=new o;function s(f){var c=a.get(f),p=c&&(c._triangleBuffer.handle||c._triangleBuffer.buffer);if(!p||!f.isBuffer(p)){var v=n(f,new Float32Array([-1,-1,-1,4,4,-1]));c=i(f,[{buffer:v,type:f.FLOAT,size:2}]),c._triangleBuffer=v,a.set(f,c)}c.bind(),f.drawArrays(f.TRIANGLES,0,3),c.unbind()}e.exports=s}),7182:(function(e,t,r){var o={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)};o.create();var n=o.create();e.exports=function(a,s,f,c,p,v){return o.identity(a),o.fromRotationTranslation(a,v,s),a[3]=p[0],a[7]=p[1],a[11]=p[2],a[15]=p[3],o.identity(n),c[2]!==0&&(n[9]=c[2],o.multiply(a,a,n)),c[1]!==0&&(n[9]=0,n[8]=c[1],o.multiply(a,a,n)),c[0]!==0&&(n[8]=0,n[4]=c[0],o.multiply(a,a,n)),o.scale(a,a,f),a}}),7201:(function(e,t,r){var o=1e-6,n=1e-6,i=r(9405),a=r(2762),s=r(8116),f=r(7766),c=r(8406),p=r(6760),v=r(7608),T=r(9618),l=r(6729),g=r(7765),x=r(1888),A=r(840),M=r(7626),_=A.meshShader,w=A.wireShader,m=A.pointShader,u=A.pickShader,d=A.pointPickShader,y=A.contourShader,I=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function L(ce,V,ee,ne,$,ue,te,H,ae,ie,de,Se,Le,Fe,ze,Ye,st,ct,at,et,Pe,Ae,pe,Ne,ut,dt,nt){this.gl=ce,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=V,this.dirty=!0,this.triShader=ee,this.lineShader=ne,this.pointShader=$,this.pickShader=ue,this.pointPickShader=te,this.contourShader=H,this.trianglePositions=ae,this.triangleColors=de,this.triangleNormals=Le,this.triangleUVs=Se,this.triangleIds=ie,this.triangleVAO=Fe,this.triangleCount=0,this.lineWidth=1,this.edgePositions=ze,this.edgeColors=st,this.edgeUVs=ct,this.edgeIds=Ye,this.edgeVAO=at,this.edgeCount=0,this.pointPositions=et,this.pointColors=Ae,this.pointUVs=pe,this.pointSizes=Ne,this.pointIds=Pe,this.pointVAO=ut,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=dt,this.contourVAO=nt,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=I,this._view=I,this._projection=I,this._resolution=[1,1]}var z=L.prototype;z.isOpaque=function(){return!this.hasAlpha},z.isTransparent=function(){return this.hasAlpha},z.pickSlots=1,z.setPickBase=function(ce){this.pickId=ce};function F(ce,V){if(!V||!V.length)return 1;for(var ee=0;eece&&ee>0){var ne=(V[ee][0]-ce)/(V[ee][0]-V[ee-1][0]);return V[ee][1]*(1-ne)+ne*V[ee-1][1]}}return 1}function N(ce,V){for(var ee=l({colormap:ce,nshades:256,format:"rgba"}),ne=new Uint8Array(256*4),$=0;$<256;++$){for(var ue=ee[$],te=0;te<3;++te)ne[4*$+te]=ue[te];V?ne[4*$+3]=255*F($/255,V):ne[4*$+3]=255*ue[3]}return T(ne,[256,256,4],[4,0,1])}function B(ce){for(var V=ce.length,ee=new Array(V),ne=0;ne0){var Le=this.triShader;Le.bind(),Le.uniforms=H,this.triangleVAO.bind(),V.drawArrays(V.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Le=this.lineShader;Le.bind(),Le.uniforms=H,this.edgeVAO.bind(),V.lineWidth(this.lineWidth*this.pixelRatio),V.drawArrays(V.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Le=this.pointShader;Le.bind(),Le.uniforms=H,this.pointVAO.bind(),V.drawArrays(V.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Le=this.contourShader;Le.bind(),Le.uniforms=H,this.contourVAO.bind(),V.drawArrays(V.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(ce){ce=ce||{};for(var V=this.gl,ee=ce.model||I,ne=ce.view||I,$=ce.projection||I,ue=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],te=0;te<3;++te)ue[0][te]=Math.max(ue[0][te],this.clipBounds[0][te]),ue[1][te]=Math.min(ue[1][te],this.clipBounds[1][te]);this._model=[].slice.call(ee),this._view=[].slice.call(ne),this._projection=[].slice.call($),this._resolution=[V.drawingBufferWidth,V.drawingBufferHeight];var H={model:ee,view:ne,projection:$,clipBounds:ue,pickId:this.pickId/255},ae=this.pickShader;if(ae.bind(),ae.uniforms=H,this.triangleCount>0&&(this.triangleVAO.bind(),V.drawArrays(V.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),V.lineWidth(this.lineWidth*this.pixelRatio),V.drawArrays(V.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var ae=this.pointPickShader;ae.bind(),ae.uniforms=H,this.pointVAO.bind(),V.drawArrays(V.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.pick=function(ce){if(!ce||ce.id!==this.pickId)return null;for(var V=ce.value[0]+256*ce.value[1]+65536*ce.value[2],ee=this.cells[V],ne=this.positions,$=new Array(ee.length),ue=0;ueMath.max(_,w)?m[2]=1:_>Math.max(M,w)?m[0]=1:m[1]=1;for(var u=0,d=0,y=0;y<3;++y)u+=A[y]*A[y],d+=m[y]*A[y];for(var y=0;y<3;++y)m[y]-=d/u*A[y];return s(m,m),m}function T(A,M,_,w,m,u,d,y){this.center=o(_),this.up=o(w),this.right=o(m),this.radius=o([u]),this.angle=o([d,y]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(A,M),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var I=0;I<16;++I)this.computedMatrix[I]=.5;this.recalcMatrix(0)}var l=T.prototype;l.setDistanceLimits=function(A,M){A>0?A=Math.log(A):A=-1/0,M>0?M=Math.log(M):M=1/0,M=Math.max(M,A),this.radius.bounds[0][0]=A,this.radius.bounds[1][0]=M},l.getDistanceLimits=function(A){var M=this.radius.bounds[0];return A?(A[0]=Math.exp(M[0][0]),A[1]=Math.exp(M[1][0]),A):[Math.exp(M[0][0]),Math.exp(M[1][0])]},l.recalcMatrix=function(A){this.center.curve(A),this.up.curve(A),this.right.curve(A),this.radius.curve(A),this.angle.curve(A);for(var M=this.computedUp,_=this.computedRight,w=0,m=0,u=0;u<3;++u)m+=M[u]*_[u],w+=M[u]*M[u];for(var d=Math.sqrt(w),y=0,u=0;u<3;++u)_[u]-=M[u]*m/w,y+=_[u]*_[u],M[u]/=d;for(var I=Math.sqrt(y),u=0;u<3;++u)_[u]/=I;var L=this.computedToward;a(L,M,_),s(L,L);for(var z=Math.exp(this.computedRadius[0]),F=this.computedAngle[0],N=this.computedAngle[1],B=Math.cos(F),R=Math.sin(F),U=Math.cos(N),j=Math.sin(N),Z=this.computedCenter,re=B*U,fe=R*U,le=j,ce=-B*j,V=-R*j,ee=U,ne=this.computedEye,$=this.computedMatrix,u=0;u<3;++u){var ue=re*_[u]+fe*L[u]+le*M[u];$[4*u+1]=ce*_[u]+V*L[u]+ee*M[u],$[4*u+2]=ue,$[4*u+3]=0}var te=$[1],H=$[5],ae=$[9],ie=$[2],de=$[6],Se=$[10],Le=H*Se-ae*de,Fe=ae*ie-te*Se,ze=te*de-H*ie,Ye=c(Le,Fe,ze);Le/=Ye,Fe/=Ye,ze/=Ye,$[0]=Le,$[4]=Fe,$[8]=ze;for(var u=0;u<3;++u)ne[u]=Z[u]+$[2+4*u]*z;for(var u=0;u<3;++u){for(var y=0,st=0;st<3;++st)y+=$[u+4*st]*ne[st];$[12+u]=-y}$[15]=1},l.getMatrix=function(A,M){this.recalcMatrix(A);var _=this.computedMatrix;if(M){for(var w=0;w<16;++w)M[w]=_[w];return M}return _};var g=[0,0,0];l.rotate=function(A,M,_,w){if(this.angle.move(A,M,_),w){this.recalcMatrix(A);var m=this.computedMatrix;g[0]=m[2],g[1]=m[6],g[2]=m[10];for(var u=this.computedUp,d=this.computedRight,y=this.computedToward,I=0;I<3;++I)m[4*I]=u[I],m[4*I+1]=d[I],m[4*I+2]=y[I];i(m,m,w,g);for(var I=0;I<3;++I)u[I]=m[4*I],d[I]=m[4*I+1];this.up.set(A,u[0],u[1],u[2]),this.right.set(A,d[0],d[1],d[2])}},l.pan=function(A,M,_,w){M=M||0,_=_||0,w=w||0,this.recalcMatrix(A);var m=this.computedMatrix;Math.exp(this.computedRadius[0]);var u=m[1],d=m[5],y=m[9],I=c(u,d,y);u/=I,d/=I,y/=I;var L=m[0],z=m[4],F=m[8],N=L*u+z*d+F*y;L-=u*N,z-=d*N,F-=y*N;var B=c(L,z,F);L/=B,z/=B,F/=B;var R=L*M+u*_,U=z*M+d*_,j=F*M+y*_;this.center.move(A,R,U,j);var Z=Math.exp(this.computedRadius[0]);Z=Math.max(1e-4,Z+w),this.radius.set(A,Math.log(Z))},l.translate=function(A,M,_,w){this.center.move(A,M||0,_||0,w||0)},l.setMatrix=function(A,M,_,w){var m=1;typeof _=="number"&&(m=_|0),(m<0||m>3)&&(m=1);var u=(m+2)%3;M||(this.recalcMatrix(A),M=this.computedMatrix);var d=M[m],y=M[m+4],I=M[m+8];if(w){var z=Math.abs(d),F=Math.abs(y),N=Math.abs(I),B=Math.max(z,F,N);z===B?(d=d<0?-1:1,y=I=0):N===B?(I=I<0?-1:1,d=y=0):(y=y<0?-1:1,d=I=0)}else{var L=c(d,y,I);d/=L,y/=L,I/=L}var R=M[u],U=M[u+4],j=M[u+8],Z=R*d+U*y+j*I;R-=d*Z,U-=y*Z,j-=I*Z;var re=c(R,U,j);R/=re,U/=re,j/=re;var fe=y*j-I*U,le=I*R-d*j,ce=d*U-y*R,V=c(fe,le,ce);fe/=V,le/=V,ce/=V,this.center.jump(A,Pe,Ae,pe),this.radius.idle(A),this.up.jump(A,d,y,I),this.right.jump(A,R,U,j);var ee,ne;if(m===2){var $=M[1],ue=M[5],te=M[9],H=$*R+ue*U+te*j,ae=$*fe+ue*le+te*ce;Le<0?ee=-Math.PI/2:ee=Math.PI/2,ne=Math.atan2(ae,H)}else{var ie=M[2],de=M[6],Se=M[10],Le=ie*d+de*y+Se*I,Fe=ie*R+de*U+Se*j,ze=ie*fe+de*le+Se*ce;ee=Math.asin(p(Le)),ne=Math.atan2(ze,Fe)}this.angle.jump(A,ne,ee),this.recalcMatrix(A);var Ye=M[2],st=M[6],ct=M[10],at=this.computedMatrix;n(at,M);var et=at[15],Pe=at[12]/et,Ae=at[13]/et,pe=at[14]/et,Ne=Math.exp(this.computedRadius[0]);this.center.jump(A,Pe-Ye*Ne,Ae-st*Ne,pe-ct*Ne)},l.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},l.idle=function(A){this.center.idle(A),this.up.idle(A),this.right.idle(A),this.radius.idle(A),this.angle.idle(A)},l.flush=function(A){this.center.flush(A),this.up.flush(A),this.right.flush(A),this.radius.flush(A),this.angle.flush(A)},l.setDistance=function(A,M){M>0&&this.radius.set(A,Math.log(M))},l.lookAt=function(A,M,_,w){this.recalcMatrix(A),M=M||this.computedEye,_=_||this.computedCenter,w=w||this.computedUp;var m=w[0],u=w[1],d=w[2],y=c(m,u,d);if(!(y<1e-6)){m/=y,u/=y,d/=y;var I=M[0]-_[0],L=M[1]-_[1],z=M[2]-_[2],F=c(I,L,z);if(!(F<1e-6)){I/=F,L/=F,z/=F;var N=this.computedRight,B=N[0],R=N[1],U=N[2],j=m*B+u*R+d*U;B-=j*m,R-=j*u,U-=j*d;var Z=c(B,R,U);if(!(Z<.01&&(B=u*z-d*L,R=d*I-m*z,U=m*L-u*I,Z=c(B,R,U),Z<1e-6))){B/=Z,R/=Z,U/=Z,this.up.set(A,m,u,d),this.right.set(A,B,R,U),this.center.set(A,_[0],_[1],_[2]),this.radius.set(A,Math.log(F));var re=u*U-d*R,fe=d*B-m*U,le=m*R-u*B,ce=c(re,fe,le);re/=ce,fe/=ce,le/=ce;var V=m*I+u*L+d*z,ee=B*I+R*L+U*z,ne=re*I+fe*L+le*z,$=Math.asin(p(V)),ue=Math.atan2(ne,ee),te=this.angle._state,H=te[te.length-1],ae=te[te.length-2];H=H%(2*Math.PI);var ie=Math.abs(H+2*Math.PI-ue),de=Math.abs(H-ue),Se=Math.abs(H-2*Math.PI-ue);ie0)throw new Error("Invalid string. Length must be a multiple of 4");var M=x.indexOf("=");M===-1&&(M=A);var _=M===A?0:4-M%4;return[M,_]}function c(x){var A=f(x),M=A[0],_=A[1];return(M+_)*3/4-_}function p(x,A,M){return(A+M)*3/4-M}function d(x){var A,M=f(x),_=M[0],w=M[1],m=new n(p(x,_,w)),u=0,v=w>0?_-4:_,y;for(y=0;y>16&255,m[u++]=A>>8&255,m[u++]=A&255;return w===2&&(A=o[x.charCodeAt(y)]<<2|o[x.charCodeAt(y+1)]>>4,m[u++]=A&255),w===1&&(A=o[x.charCodeAt(y)]<<10|o[x.charCodeAt(y+1)]<<4|o[x.charCodeAt(y+2)]>>2,m[u++]=A>>8&255,m[u++]=A&255),m}function T(x){return r[x>>18&63]+r[x>>12&63]+r[x>>6&63]+r[x&63]}function l(x,A,M){for(var _,w=[],m=A;mv?v:u+m));return _===1?(A=x[M-1],w.push(r[A>>2]+r[A<<4&63]+"==")):_===2&&(A=(x[M-2]<<8)+x[M-1],w.push(r[A>>10]+r[A>>4&63]+r[A<<2&63]+"=")),w.join("")}}),7518:(function(e,t,r){var o=r(1433);function n(s,f,c,p,d,T){this.location=s,this.dimension=f,this.a=c,this.b=p,this.c=d,this.d=T}n.prototype.bind=function(s){switch(this.dimension){case 1:s.vertexAttrib1f(this.location,this.a);break;case 2:s.vertexAttrib2f(this.location,this.a,this.b);break;case 3:s.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:s.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d);break}};function i(s,f,c){this.gl=s,this._ext=f,this.handle=c,this._attribs=[],this._useElements=!1,this._elementsType=s.UNSIGNED_SHORT}i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var s=0;s1.0001)return null;y+=v[M]}return Math.abs(y-1)>.001?null:[_,f(p,v),v]}}),7636:(function(e){e.exports=t;function t(r,o){o=o||1;var n=Math.random()*2*Math.PI,i=Math.random()*2-1,a=Math.sqrt(1-i*i)*o;return r[0]=Math.cos(n)*a,r[1]=Math.sin(n)*a,r[2]=i*o,r}}),7640:(function(e,t,r){var o=r(1888);function n(d){return d==="uint32"?[o.mallocUint32,o.freeUint32]:null}var i={"uint32,1,0":function(d,T){return function(g,x,A,M,_,w,m,u,v,y,I){var L,z,F,N=g*_+M,B,R=d(u),U,j,Z,re;for(L=g+1;L<=x;++L){for(z=L,N+=_,F=N,U=0,j=N,B=0;Bg;){U=0,j=F-_;t:for(B=0;Bre)break t;j+=y,U+=I}for(U=F,j=F-_,B=0;B>1,R=B-z,U=B+z,j=F,Z=R,re=B,fe=U,le=N,ce=x+1,V=A-1,ee=!0,ne,K,ue,te,H,ae,ie,ve,Ae,Ce=0,Fe=0,ze=0,Ye,it,st,nt,Qe,Le,Te,pe,Ne,ot,ft,rt,Ft,Nt,$t,rr,Er=v,Mr=T(Er),Wr=T(Er);it=w*j,st=w*Z,rr=_;e:for(Ye=0;Ye0){K=j,j=Z,Z=K;break e}if(ze<0)break e;rr+=I}it=w*fe,st=w*le,rr=_;e:for(Ye=0;Ye0){K=fe,fe=le,le=K;break e}if(ze<0)break e;rr+=I}it=w*j,st=w*re,rr=_;e:for(Ye=0;Ye0){K=j,j=re,re=K;break e}if(ze<0)break e;rr+=I}it=w*Z,st=w*re,rr=_;e:for(Ye=0;Ye0){K=Z,Z=re,re=K;break e}if(ze<0)break e;rr+=I}it=w*j,st=w*fe,rr=_;e:for(Ye=0;Ye0){K=j,j=fe,fe=K;break e}if(ze<0)break e;rr+=I}it=w*re,st=w*fe,rr=_;e:for(Ye=0;Ye0){K=re,re=fe,fe=K;break e}if(ze<0)break e;rr+=I}it=w*Z,st=w*le,rr=_;e:for(Ye=0;Ye0){K=Z,Z=le,le=K;break e}if(ze<0)break e;rr+=I}it=w*Z,st=w*re,rr=_;e:for(Ye=0;Ye0){K=Z,Z=re,re=K;break e}if(ze<0)break e;rr+=I}it=w*fe,st=w*le,rr=_;e:for(Ye=0;Ye0){K=fe,fe=le,le=K;break e}if(ze<0)break e;rr+=I}for(it=w*j,st=w*Z,nt=w*re,Qe=w*fe,Le=w*le,Te=w*F,pe=w*B,Ne=w*N,$t=0,rr=_,Ye=0;Ye0)V--;else if(ze<0){for(it=w*ae,st=w*ce,nt=w*V,rr=_,Ye=0;Ye0)for(;;){ie=_+V*w,$t=0;e:for(Ye=0;Ye0){if(--VN){e:for(;;){for(ie=_+ce*w,$t=0,rr=_,Ye=0;Ye1&&g?A(l,g[0],g[1]):A(l)}var c={"uint32,1,0":function(d,T){return function(l){var g=l.data,x=l.offset|0,A=l.shape,M=l.stride,_=M[0]|0,w=A[0]|0,m=M[1]|0,u=A[1]|0,v=m,y=m,I=1;w<=32?d(0,w-1,g,x,_,m,w,u,v,y,I):T(0,w-1,g,x,_,m,w,u,v,y,I)}}};function p(d,T){var l=[T,d].join(","),g=c[l],x=a(d,T),A=f(d,T,x);return g(x,A)}e.exports=p}),7642:(function(e,t,r){var o=r(8954),n=r(1682);e.exports=f;function i(c,p){this.point=c,this.index=p}function a(c,p){for(var d=c.point,T=p.point,l=d.length,g=0;g=2)return!1;F[B]=R}return!0}):z=z.filter(function(F){for(var N=0;N<=T;++N){var B=v[F[N]];if(B<0)return!1;F[N]=B}return!0}),T&1)for(var x=0;x",U="",j=R.length,Z=U.length,re=F[0]===g||F[0]===M,fe=0,le=-Z;fe>-1&&(fe=N.indexOf(R,fe),!(fe===-1||(le=N.indexOf(U,fe+j),le===-1)||le<=fe));){for(var ce=fe;ce=le)B[ce]=null,N=N.substr(0,ce)+" "+N.substr(ce+1);else if(B[ce]!==null){var V=B[ce].indexOf(F[0]);V===-1?B[ce]+=F:re&&(B[ce]=B[ce].substr(0,V+1)+(1+parseInt(B[ce][V+1]))+B[ce].substr(V+2))}var ee=fe+j,ne=N.substr(ee,le-ee),K=ne.indexOf(R);K!==-1?fe=K:fe=le+Z}return B}function m(z,F,N){for(var B=F.textAlign||"start",R=F.textBaseline||"alphabetic",U=[1<<30,1<<30],j=[0,0],Z=z.length,re=0;re/g,` -`):N=N.replace(/\/g," ");var j="",Z=[];for(H=0;H-1?parseInt(pe[1+ft]):0,Nt=rt>-1?parseInt(Ne[1+rt]):0;Ft!==Nt&&(ot=ot.replace(ze(),"?px "),ve*=Math.pow(.75,Nt-Ft),ot=ot.replace("?px ",ze())),ie+=.25*V*(Nt-Ft)}if(U.superscripts===!0){var $t=pe.indexOf(g),rr=Ne.indexOf(g),Er=$t>-1?parseInt(pe[1+$t]):0,Mr=rr>-1?parseInt(Ne[1+rr]):0;Er!==Mr&&(ot=ot.replace(ze(),"?px "),ve*=Math.pow(.75,Mr-Er),ot=ot.replace("?px ",ze())),ie-=.25*V*(Mr-Er)}if(U.bolds===!0){var Wr=pe.indexOf(p)>-1,Sr=Ne.indexOf(p)>-1;!Wr&&Sr&&(Br?ot=ot.replace("italic ","italic bold "):ot="bold "+ot),Wr&&!Sr&&(ot=ot.replace("bold ",""))}if(U.italics===!0){var Br=pe.indexOf(T)>-1,Mt=Ne.indexOf(T)>-1;!Br&&Mt&&(ot="italic "+ot),Br&&!Mt&&(ot=ot.replace("italic ",""))}F.font=ot}for(te=0;te0&&(R=B.size),B.lineSpacing&&B.lineSpacing>0&&(U=B.lineSpacing),B.styletags&&B.styletags.breaklines&&(j.breaklines=!!B.styletags.breaklines),B.styletags&&B.styletags.bolds&&(j.bolds=!!B.styletags.bolds),B.styletags&&B.styletags.italics&&(j.italics=!!B.styletags.italics),B.styletags&&B.styletags.subscripts&&(j.subscripts=!!B.styletags.subscripts),B.styletags&&B.styletags.superscripts&&(j.superscripts=!!B.styletags.superscripts)),N.font=[B.fontStyle,B.fontVariant,B.fontWeight,R+"px",B.font].filter(function(re){return re}).join(" "),N.textAlign="start",N.textBaseline="alphabetic",N.direction="ltr";var Z=u(F,N,z,R,U,j);return I(Z,B,R)}}),7721:(function(e,t,r){var o=r(5716);e.exports=n;function n(i){return o(i[0])*o(i[1])}}),7765:(function(e,t,r){e.exports=l;var o=r(9618),n=r(1888),i=r(446),a=r(1570);function s(g){for(var x=g.length,A=0,M=0;M"u"&&(M=s(g));var _=g.length;if(_===0||M<1)return{cells:[],vertexIds:[],vertexWeights:[]};var w=f(x,+A),m=c(g,M),u=p(m,x,w,+A),v=d(m,x.length|0),y=a(M)(g,m.data,v,w),I=T(m),L=[].slice.call(u.data,0,u.shape[0]);return n.free(w),n.free(m.data),n.free(u.data),n.free(v),{cells:y,vertexIds:I,vertexWeights:L}}}),7766:(function(e,t,r){var o=r(9618),n=r(5298),i=r(1888);e.exports=u;var a=null,s=null,f=null;function c(v){a=[v.LINEAR,v.NEAREST_MIPMAP_LINEAR,v.LINEAR_MIPMAP_NEAREST,v.LINEAR_MIPMAP_NEAREST],s=[v.NEAREST,v.LINEAR,v.NEAREST_MIPMAP_NEAREST,v.NEAREST_MIPMAP_LINEAR,v.LINEAR_MIPMAP_NEAREST,v.LINEAR_MIPMAP_LINEAR],f=[v.REPEAT,v.CLAMP_TO_EDGE,v.MIRRORED_REPEAT]}function p(v){return typeof HTMLCanvasElement<"u"&&v instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&v instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&v instanceof HTMLVideoElement||typeof ImageData<"u"&&v instanceof ImageData}var d=function(v,y){n.muls(v,y,255)};function T(v,y,I){var L=v.gl,z=L.getParameter(L.MAX_TEXTURE_SIZE);if(y<0||y>z||I<0||I>z)throw new Error("gl-texture2d: Invalid texture size");return v._shape=[y,I],v.bind(),L.texImage2D(L.TEXTURE_2D,0,v.format,y,I,0,v.format,v.type,null),v._mipLevels=[0],v}function l(v,y,I,L,z,F){this.gl=v,this.handle=y,this.format=z,this.type=F,this._shape=[I,L],this._mipLevels=[0],this._magFilter=v.NEAREST,this._minFilter=v.NEAREST,this._wrapS=v.CLAMP_TO_EDGE,this._wrapT=v.CLAMP_TO_EDGE,this._anisoSamples=1;var N=this,B=[this._wrapS,this._wrapT];Object.defineProperties(B,[{get:function(){return N._wrapS},set:function(U){return N.wrapS=U}},{get:function(){return N._wrapT},set:function(U){return N.wrapT=U}}]),this._wrapVector=B;var R=[this._shape[0],this._shape[1]];Object.defineProperties(R,[{get:function(){return N._shape[0]},set:function(U){return N.width=U}},{get:function(){return N._shape[1]},set:function(U){return N.height=U}}]),this._shapeVector=R}var g=l.prototype;Object.defineProperties(g,{minFilter:{get:function(){return this._minFilter},set:function(v){this.bind();var y=this.gl;if(this.type===y.FLOAT&&a.indexOf(v)>=0&&(y.getExtension("OES_texture_float_linear")||(v=y.NEAREST)),s.indexOf(v)<0)throw new Error("gl-texture2d: Unknown filter mode "+v);return y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,v),this._minFilter=v}},magFilter:{get:function(){return this._magFilter},set:function(v){this.bind();var y=this.gl;if(this.type===y.FLOAT&&a.indexOf(v)>=0&&(y.getExtension("OES_texture_float_linear")||(v=y.NEAREST)),s.indexOf(v)<0)throw new Error("gl-texture2d: Unknown filter mode "+v);return y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,v),this._magFilter=v}},mipSamples:{get:function(){return this._anisoSamples},set:function(v){var y=this._anisoSamples;if(this._anisoSamples=Math.max(v,1)|0,y!==this._anisoSamples){var I=this.gl.getExtension("EXT_texture_filter_anisotropic");I&&this.gl.texParameterf(this.gl.TEXTURE_2D,I.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(v){if(this.bind(),f.indexOf(v)<0)throw new Error("gl-texture2d: Unknown wrap mode "+v);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,v),this._wrapS=v}},wrapT:{get:function(){return this._wrapT},set:function(v){if(this.bind(),f.indexOf(v)<0)throw new Error("gl-texture2d: Unknown wrap mode "+v);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,v),this._wrapT=v}},wrap:{get:function(){return this._wrapVector},set:function(v){if(Array.isArray(v)||(v=[v,v]),v.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var y=0;y<2;++y)if(f.indexOf(v[y])<0)throw new Error("gl-texture2d: Unknown wrap mode "+v);this._wrapS=v[0],this._wrapT=v[1];var I=this.gl;return this.bind(),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,this._wrapS),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,this._wrapT),v}},shape:{get:function(){return this._shapeVector},set:function(v){if(!Array.isArray(v))v=[v|0,v|0];else if(v.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,v[0]|0,v[1]|0),[v[0]|0,v[1]|0]}},width:{get:function(){return this._shape[0]},set:function(v){return v=v|0,T(this,v,this._shape[1]),v}},height:{get:function(){return this._shape[1]},set:function(v){return v=v|0,T(this,this._shape[0],v),v}}}),g.bind=function(v){var y=this.gl;return v!==void 0&&y.activeTexture(y.TEXTURE0+(v|0)),y.bindTexture(y.TEXTURE_2D,this.handle),v!==void 0?v|0:y.getParameter(y.ACTIVE_TEXTURE)-y.TEXTURE0},g.dispose=function(){this.gl.deleteTexture(this.handle)},g.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var v=Math.min(this._shape[0],this._shape[1]),y=0;v>0;++y,v>>>=1)this._mipLevels.indexOf(y)<0&&this._mipLevels.push(y)},g.setPixels=function(v,y,I,L){var z=this.gl;this.bind(),Array.isArray(y)?(L=I,I=y[1]|0,y=y[0]|0):(y=y||0,I=I||0),L=L||0;var F=p(v)?v:v.raw;if(F){var N=this._mipLevels.indexOf(L)<0;N?(z.texImage2D(z.TEXTURE_2D,0,this.format,this.format,this.type,F),this._mipLevels.push(L)):z.texSubImage2D(z.TEXTURE_2D,L,y,I,this.format,this.type,F)}else if(v.shape&&v.stride&&v.data){if(v.shape.length<2||y+v.shape[1]>this._shape[1]>>>L||I+v.shape[0]>this._shape[0]>>>L||y<0||I<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");A(z,y,I,L,this.format,this.type,this._mipLevels,v)}else throw new Error("gl-texture2d: Unsupported data type")};function x(v,y){return v.length===3?y[2]===1&&y[1]===v[0]*v[2]&&y[0]===v[2]:y[0]===1&&y[1]===v[0]}function A(v,y,I,L,z,F,N,B){var R=B.dtype,U=B.shape.slice();if(U.length<2||U.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var j=0,Z=0,re=x(U,B.stride.slice());if(R==="float32"?j=v.FLOAT:R==="float64"?(j=v.FLOAT,re=!1,R="float32"):R==="uint8"?j=v.UNSIGNED_BYTE:(j=v.UNSIGNED_BYTE,re=!1,R="uint8"),U.length===2)Z=v.LUMINANCE,U=[U[0],U[1],1],B=o(B.data,U,[B.stride[0],B.stride[1],1],B.offset);else if(U.length===3){if(U[2]===1)Z=v.ALPHA;else if(U[2]===2)Z=v.LUMINANCE_ALPHA;else if(U[2]===3)Z=v.RGB;else if(U[2]===4)Z=v.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");U[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((Z===v.LUMINANCE||Z===v.ALPHA)&&(z===v.LUMINANCE||z===v.ALPHA)&&(Z=z),Z!==z)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var fe=B.size,le=N.indexOf(L)<0;if(le&&N.push(L),j===F&&re)B.offset===0&&B.data.length===fe?le?v.texImage2D(v.TEXTURE_2D,L,z,U[0],U[1],0,z,F,B.data):v.texSubImage2D(v.TEXTURE_2D,L,y,I,U[0],U[1],z,F,B.data):le?v.texImage2D(v.TEXTURE_2D,L,z,U[0],U[1],0,z,F,B.data.subarray(B.offset,B.offset+fe)):v.texSubImage2D(v.TEXTURE_2D,L,y,I,U[0],U[1],z,F,B.data.subarray(B.offset,B.offset+fe));else{var ce;F===v.FLOAT?ce=i.mallocFloat32(fe):ce=i.mallocUint8(fe);var V=o(ce,U,[U[2],U[2]*U[0],1]);j===v.FLOAT&&F===v.UNSIGNED_BYTE?d(V,B):n.assign(V,B),le?v.texImage2D(v.TEXTURE_2D,L,z,U[0],U[1],0,z,F,ce.subarray(0,fe)):v.texSubImage2D(v.TEXTURE_2D,L,y,I,U[0],U[1],z,F,ce.subarray(0,fe)),F===v.FLOAT?i.freeFloat32(ce):i.freeUint8(ce)}}function M(v){var y=v.createTexture();return v.bindTexture(v.TEXTURE_2D,y),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.NEAREST),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.NEAREST),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),y}function _(v,y,I,L,z){var F=v.getParameter(v.MAX_TEXTURE_SIZE);if(y<0||y>F||I<0||I>F)throw new Error("gl-texture2d: Invalid texture shape");if(z===v.FLOAT&&!v.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var N=M(v);return v.texImage2D(v.TEXTURE_2D,0,L,y,I,0,L,z,null),new l(v,N,y,I,L,z)}function w(v,y,I,L,z,F){var N=M(v);return v.texImage2D(v.TEXTURE_2D,0,z,z,F,y),new l(v,N,I,L,z,F)}function m(v,y){var I=y.dtype,L=y.shape.slice(),z=v.getParameter(v.MAX_TEXTURE_SIZE);if(L[0]<0||L[0]>z||L[1]<0||L[1]>z)throw new Error("gl-texture2d: Invalid texture size");var F=x(L,y.stride.slice()),N=0;I==="float32"?N=v.FLOAT:I==="float64"?(N=v.FLOAT,F=!1,I="float32"):I==="uint8"?N=v.UNSIGNED_BYTE:(N=v.UNSIGNED_BYTE,F=!1,I="uint8");var B=0;if(L.length===2)B=v.LUMINANCE,L=[L[0],L[1],1],y=o(y.data,L,[y.stride[0],y.stride[1],1],y.offset);else if(L.length===3)if(L[2]===1)B=v.ALPHA;else if(L[2]===2)B=v.LUMINANCE_ALPHA;else if(L[2]===3)B=v.RGB;else if(L[2]===4)B=v.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");N===v.FLOAT&&!v.getExtension("OES_texture_float")&&(N=v.UNSIGNED_BYTE,F=!1);var R,U,j=y.size;if(F)y.offset===0&&y.data.length===j?R=y.data:R=y.data.subarray(y.offset,y.offset+j);else{var Z=[L[2],L[2]*L[0],1];U=i.malloc(j,I);var re=o(U,L,Z,0);(I==="float32"||I==="float64")&&N===v.UNSIGNED_BYTE?d(re,y):n.assign(re,y),R=U.subarray(0,j)}var fe=M(v);return v.texImage2D(v.TEXTURE_2D,0,B,L[0],L[1],0,B,N,R),F||i.free(U),new l(v,fe,L[0],L[1],B,N)}function u(v){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(a||c(v),typeof arguments[1]=="number")return _(v,arguments[1],arguments[2],arguments[3]||v.RGBA,arguments[4]||v.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return _(v,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||v.RGBA,arguments[3]||v.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var y=arguments[1],I=p(y)?y:y.raw;if(I)return w(v,I,y.width|0,y.height|0,arguments[2]||v.RGBA,arguments[3]||v.UNSIGNED_BYTE);if(y.shape&&y.data&&y.stride)return m(v,y)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}}),7790:(function(){}),7815:(function(e,t,r){var o=r(2931),n=r(9970),i=["xyz","xzy","yxz","yzx","zxy","zyx"],a=function(x,A,M,_){for(var w=x.points,m=x.velocities,u=x.divergences,v=[],y=[],I=[],L=[],z=[],F=[],N=0,B=0,R=n.create(),U=n.create(),j=8,Z=0;Z0)for(var ce=0;ceA)return _-1}return _},c=function(x,A,M){return xM?M:x},p=function(x,A,M){var _=A.vectors,w=A.meshgrid,m=x[0],u=x[1],v=x[2],y=w[0].length,I=w[1].length,L=w[2].length,z=f(w[0],m),F=f(w[1],u),N=f(w[2],v),B=z+1,R=F+1,U=N+1;if(z=c(z,0,y-1),B=c(B,0,y-1),F=c(F,0,I-1),R=c(R,0,I-1),N=c(N,0,L-1),U=c(U,0,L-1),z<0||F<0||N<0||B>y-1||R>I-1||U>L-1)return o.create();var j=w[0][z],Z=w[0][B],re=w[1][F],fe=w[1][R],le=w[2][N],ce=w[2][U],V=(m-j)/(Z-j),ee=(u-re)/(fe-re),ne=(v-le)/(ce-le);isFinite(V)||(V=.5),isFinite(ee)||(ee=.5),isFinite(ne)||(ne=.5);var K,ue,te,H,ae,ie;switch(M.reversedX&&(z=y-1-z,B=y-1-B),M.reversedY&&(F=I-1-F,R=I-1-R),M.reversedZ&&(N=L-1-N,U=L-1-U),M.filled){case 5:ae=N,ie=U,te=F*L,H=R*L,K=z*L*I,ue=B*L*I;break;case 4:ae=N,ie=U,K=z*L,ue=B*L,te=F*L*y,H=R*L*y;break;case 3:te=F,H=R,ae=N*I,ie=U*I,K=z*I*L,ue=B*I*L;break;case 2:te=F,H=R,K=z*I,ue=B*I,ae=N*I*y,ie=U*I*y;break;case 1:K=z,ue=B,ae=N*y,ie=U*y,te=F*y*L,H=R*y*L;break;default:K=z,ue=B,te=F*y,H=R*y,ae=N*y*I,ie=U*y*I;break}var ve=_[K+te+ae],Ae=_[K+te+ie],Ce=_[K+H+ae],Fe=_[K+H+ie],ze=_[ue+te+ae],Ye=_[ue+te+ie],it=_[ue+H+ae],st=_[ue+H+ie],nt=o.create(),Qe=o.create(),Le=o.create(),Te=o.create();o.lerp(nt,ve,ze,V),o.lerp(Qe,Ae,Ye,V),o.lerp(Le,Ce,it,V),o.lerp(Te,Fe,st,V);var pe=o.create(),Ne=o.create();o.lerp(pe,nt,Le,ee),o.lerp(Ne,Qe,Te,ee);var ot=o.create();return o.lerp(ot,pe,Ne,ne),ot},d=function(x){var A=1/0;x.sort(function(m,u){return m-u});for(var M=x.length,_=1;_B||stR||ntU)},Z=o.distance(A[0],A[1]),re=10*Z/_,fe=re*re,le=1,ce=0,V=M.length;V>1&&(le=T(M));for(var ee=0;eece&&(ce=ve),ae.push(ve),L.push({points:K,velocities:ue,divergences:ae});for(var Ae=0;Ae<_*100&&K.length<_&&j(ne);){Ae++;var Ce=o.clone(te),Fe=o.squaredLength(Ce);if(Fe===0)break;if(Fe>fe&&o.scale(Ce,Ce,re/Math.sqrt(Fe)),o.add(Ce,Ce,ne),te=y(Ce),o.squaredDistance(H,Ce)-fe>-1e-4*fe){K.push(Ce),H=Ce,ue.push(te);var ie=I(Ce,te),ve=o.length(ie);isFinite(ve)&&ve>ce&&(ce=ve),ae.push(ve)}ne=Ce}}var ze=s(L,x.colormap,ce,le);return m?ze.tubeScale=m:(ce===0&&(ce=1),ze.tubeScale=w*.5*le/ce),ze};var l=r(6740),g=r(6405).createMesh;e.exports.createTubeMesh=function(x,A){return g(x,A,{shaders:l,traceType:"streamtube"})}}),7827:(function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]}),7842:(function(e,t,r){var o=r(6330),n=r(1533),i=r(2651),a=r(6768),s=r(869),f=r(8697);e.exports=c;function c(p,d){if(o(p))return d?f(p,c(d)):[p[0].clone(),p[1].clone()];var T=0,l,g;if(n(p))l=p.clone();else if(typeof p=="string")l=a(p);else{if(p===0)return[i(0),i(1)];if(p===Math.floor(p))l=i(p);else{for(;p!==Math.floor(p);)p=p*Math.pow(2,256),T-=256;l=i(p)}}if(o(d))l.mul(d[1]),g=d[0].clone();else if(n(d))g=d.clone();else if(typeof d=="string")g=a(d);else if(!d)g=i(1);else if(d===Math.floor(d))g=i(d);else{for(;d!==Math.floor(d);)d=d*Math.pow(2,256),T+=256;g=i(d)}return T>0?l=l.ushln(T):T<0&&(g=g.ushln(-T)),s(l,g)}}),7894:(function(e){e.exports=t;function t(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}}),7932:(function(e,t,r){var o=r(620);e.exports=o.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])}),7960:(function(e){e.exports=t;function t(r,o){var n=o[0]-r[0],i=o[1]-r[1],a=o[2]-r[2],s=o[3]-r[3];return n*n+i*i+a*a+s*s}}),8105:(function(e){e.exports=r;var t={"lo===p0":o,"lo=p0)&&!(p1>=hi)":c};function r(p){return t[p]}function o(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+u];if(I===A)if(m===y)m+=1,w+=M;else{for(var L=0;M>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function n(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+u];if(IL;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function i(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+v];if(I<=A)if(m===y)m+=1,w+=M;else{for(var L=0;M>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function a(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+v];if(I<=A)if(m===y)m+=1,w+=M;else{for(var L=0;M>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function s(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+u],L=g[_+v];if(I<=A&&A<=L)if(m===y)m+=1,w+=M;else{for(var z=0;M>z;++z){var F=g[_+z];g[_+z]=g[w],g[w++]=F}var N=x[y];x[y]=x[m],x[m++]=N}}return m}function f(p,d,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=d,v=p+d,y=T;l>y;++y,_+=M){var I=g[_+u],L=g[_+v];if(Iz;++z){var F=g[_+z];g[_+z]=g[w],g[w++]=F}var N=x[y];x[y]=x[m],x[m++]=N}}return m}function c(p,d,T,l,g,x,A,M){for(var _=2*p,w=_*T,m=w,u=T,v=d,y=p+d,I=T;l>I;++I,w+=_){var L=g[w+v],z=g[w+y];if(!(L>=A)&&!(M>=z))if(u===I)u+=1,m+=_;else{for(var F=0;_>F;++F){var N=g[w+F];g[w+F]=g[m],g[m++]=N}var B=x[I];x[I]=x[u],x[u++]=B}}return u}}),8107:(function(e){e.exports=t;function t(r,o,n){return r[0]=Math.min(o[0],n[0]),r[1]=Math.min(o[1],n[1]),r[2]=Math.min(o[2],n[2]),r}}),8116:(function(e,t,r){var o=r(7518),n=r(870);function i(s){this.bindVertexArrayOES=s.bindVertexArray.bind(s),this.createVertexArrayOES=s.createVertexArray.bind(s),this.deleteVertexArrayOES=s.deleteVertexArray.bind(s)}function a(s,f,c,p){var d=s.createVertexArray?new i(s):s.getExtension("OES_vertex_array_object"),T;return d?T=o(s,d):T=n(s),T.update(f,c,p),T}e.exports=a}),8192:(function(e,t,r){e.exports=a;var o=r(2825),n=r(3536),i=r(244);function a(s,f){var c=o(s[0],s[1],s[2]),p=o(f[0],f[1],f[2]);n(c,c),n(p,p);var d=i(c,p);return d>1?0:Math.acos(d)}}),8210:(function(e){e.exports=r;function t(o,n){var i=o+n,a=i-o,s=i-a,f=n-a,c=o-s,p=c+f;return p?[p,i]:[i]}function r(o,n){var i=o.length|0,a=n.length|0;if(i===1&&a===1)return t(o[0],n[0]);var s=i+a,f=new Array(s),c=0,p=0,d=0,T=Math.abs,l=o[p],g=T(l),x=n[d],A=T(x),M,_;g=a?(M=l,p+=1,pc)for(var I=f[l],L=1/Math.sqrt(m*v),y=0;y<3;++y){var z=(y+1)%3,F=(y+2)%3;I[y]+=L*(u[z]*w[F]-u[F]*w[z])}}for(var p=0;pc)for(var L=1/Math.sqrt(N),y=0;y<3;++y)I[y]*=L;else for(var y=0;y<3;++y)I[y]=0}return f},t.faceNormals=function(n,i,a){for(var s=n.length,f=new Array(s),c=a===void 0?o:a,p=0;pc?M=1/Math.sqrt(M):M=0;for(var l=0;l<3;++l)A[l]*=M;f[p]=A}return f}}),8418:(function(e,t,r){var o=r(5219),n=r(2762),i=r(8116),a=r(1888),s=r(6760),f=r(1283),c=r(9366),p=r(5964),d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=ArrayBuffer,l=DataView;function g(K){return T.isView(K)&&!(K instanceof l)}function x(K){return Array.isArray(K)||g(K)}e.exports=ne;function A(K,ue){var te=K[0],H=K[1],ae=K[2],ie=K[3];return K[0]=ue[0]*te+ue[4]*H+ue[8]*ae+ue[12]*ie,K[1]=ue[1]*te+ue[5]*H+ue[9]*ae+ue[13]*ie,K[2]=ue[2]*te+ue[6]*H+ue[10]*ae+ue[14]*ie,K[3]=ue[3]*te+ue[7]*H+ue[11]*ae+ue[15]*ie,K}function M(K,ue,te,H){return A(H,H),A(H,H),A(H,H)}function _(K,ue){this.index=K,this.dataCoordinate=this.position=ue}function w(K){return K===!0||K>1?1:K}function m(K,ue,te,H,ae,ie,ve,Ae,Ce,Fe,ze,Ye){this.gl=K,this.pixelRatio=1,this.shader=ue,this.orthoShader=te,this.projectShader=H,this.pointBuffer=ae,this.colorBuffer=ie,this.glyphBuffer=ve,this.idBuffer=Ae,this.vao=Ce,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Fe,this.pickOrthoShader=ze,this.pickProjectShader=Ye,this.points=[],this._selectResult=new _(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var u=m.prototype;u.pickSlots=1,u.setPickBase=function(K){this.pickId=K},u.isTransparent=function(){if(this.hasAlpha)return!0;for(var K=0;K<3;++K)if(this.axesProject[K]&&this.projectHasAlpha)return!0;return!1},u.isOpaque=function(){if(!this.hasAlpha)return!0;for(var K=0;K<3;++K)if(this.axesProject[K]&&!this.projectHasAlpha)return!0;return!1};var v=[0,0],y=[0,0,0],I=[0,0,0],L=[0,0,0,1],z=[0,0,0,1],F=d.slice(),N=[0,0,0],B=[[0,0,0],[0,0,0]];function R(K){return K[0]=K[1]=K[2]=0,K}function U(K,ue){return K[0]=ue[0],K[1]=ue[1],K[2]=ue[2],K[3]=1,K}function j(K,ue,te,H){return K[0]=ue[0],K[1]=ue[1],K[2]=ue[2],K[te]=H,K}function Z(K){for(var ue=B,te=0;te<2;++te)for(var H=0;H<3;++H)ue[te][H]=Math.max(Math.min(K[te][H],1e8),-1e8);return ue}function re(K,ue,te,H){var ae=ue.axesProject,ie=ue.gl,ve=K.uniforms,Ae=te.model||d,Ce=te.view||d,Fe=te.projection||d,ze=ue.axesBounds,Ye=Z(ue.clipBounds),it;ue.axes&&ue.axes.lastCubeProps?it=ue.axes.lastCubeProps.axis:it=[1,1,1],v[0]=2/ie.drawingBufferWidth,v[1]=2/ie.drawingBufferHeight,K.bind(),ve.view=Ce,ve.projection=Fe,ve.screenSize=v,ve.highlightId=ue.highlightId,ve.highlightScale=ue.highlightScale,ve.clipBounds=Ye,ve.pickGroup=ue.pickId/255,ve.pixelRatio=H;for(var st=0;st<3;++st)if(ae[st]){ve.scale=ue.projectScale[st],ve.opacity=ue.projectOpacity[st];for(var nt=F,Qe=0;Qe<16;++Qe)nt[Qe]=0;for(var Qe=0;Qe<4;++Qe)nt[5*Qe]=1;nt[5*st]=0,it[st]<0?nt[12+st]=ze[0][st]:nt[12+st]=ze[1][st],s(nt,Ae,nt),ve.model=nt;var Le=(st+1)%3,Te=(st+2)%3,pe=R(y),Ne=R(I);pe[Le]=1,Ne[Te]=1;var ot=M(Fe,Ce,Ae,U(L,pe)),ft=M(Fe,Ce,Ae,U(z,Ne));if(Math.abs(ot[1])>Math.abs(ft[1])){var rt=ot;ot=ft,ft=rt,rt=pe,pe=Ne,Ne=rt;var Ft=Le;Le=Te,Te=Ft}ot[0]<0&&(pe[Le]=-1),ft[1]>0&&(Ne[Te]=-1);for(var Nt=0,$t=0,Qe=0;Qe<4;++Qe)Nt+=Math.pow(Ae[4*Le+Qe],2),$t+=Math.pow(Ae[4*Te+Qe],2);pe[Le]/=Math.sqrt(Nt),Ne[Te]/=Math.sqrt($t),ve.axes[0]=pe,ve.axes[1]=Ne,ve.fragClipBounds[0]=j(N,Ye[0],st,-1e8),ve.fragClipBounds[1]=j(N,Ye[1],st,1e8),ue.vao.bind(),ue.vao.draw(ie.TRIANGLES,ue.vertexCount),ue.lineWidth>0&&(ie.lineWidth(ue.lineWidth*H),ue.vao.draw(ie.LINES,ue.lineVertexCount,ue.vertexCount)),ue.vao.unbind()}}var fe=[-1e8,-1e8,-1e8],le=[1e8,1e8,1e8],ce=[fe,le];function V(K,ue,te,H,ae,ie,ve){var Ae=te.gl;if((ie===te.projectHasAlpha||ve)&&re(ue,te,H,ae),ie===te.hasAlpha||ve){K.bind();var Ce=K.uniforms;Ce.model=H.model||d,Ce.view=H.view||d,Ce.projection=H.projection||d,v[0]=2/Ae.drawingBufferWidth,v[1]=2/Ae.drawingBufferHeight,Ce.screenSize=v,Ce.highlightId=te.highlightId,Ce.highlightScale=te.highlightScale,Ce.fragClipBounds=ce,Ce.clipBounds=te.axes.bounds,Ce.opacity=te.opacity,Ce.pickGroup=te.pickId/255,Ce.pixelRatio=ae,te.vao.bind(),te.vao.draw(Ae.TRIANGLES,te.vertexCount),te.lineWidth>0&&(Ae.lineWidth(te.lineWidth*ae),te.vao.draw(Ae.LINES,te.lineVertexCount,te.vertexCount)),te.vao.unbind()}}u.draw=function(K){var ue=this.useOrtho?this.orthoShader:this.shader;V(ue,this.projectShader,this,K,this.pixelRatio,!1,!1)},u.drawTransparent=function(K){var ue=this.useOrtho?this.orthoShader:this.shader;V(ue,this.projectShader,this,K,this.pixelRatio,!0,!1)},u.drawPick=function(K){var ue=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;V(ue,this.pickProjectShader,this,K,1,!0,!0)},u.pick=function(K){if(!K||K.id!==this.pickId)return null;var ue=K.value[2]+(K.value[1]<<8)+(K.value[0]<<16);if(ue>=this.pointCount||ue<0)return null;var te=this.points[ue],H=this._selectResult;H.index=ue;for(var ae=0;ae<3;++ae)H.position[ae]=H.dataCoordinate[ae]=te[ae];return H},u.highlight=function(K){if(!K)this.highlightId=[1,1,1,1];else{var ue=K.index,te=ue&255,H=ue>>8&255,ae=ue>>16&255;this.highlightId=[te/255,H/255,ae/255,0]}};function ee(K,ue,te,H){var ae;x(K)?ue0){var Br=0,Mt=Te,je=[0,0,0,1],$e=[0,0,0,1],Ee=x(it)&&x(it[0]),xe=x(Qe)&&x(Qe[0]);e:for(var H=0;H0?1-$t[0][0]:Ot<0?1+$t[1][0]:1,Wt*=Wt>0?1-$t[0][1]:Wt<0?1+$t[1][1]:1;for(var _r=[Ot,Wt],Kn=Ft.cells||[],qn=Ft.positions||[],ft=0;ft=a?(M=l,p+=1,p0?1:0}}),8648:(function(e,t,r){e.exports=r(783)}),8692:(function(e){e.exports=t;function t(r,o,n,i){var a=n[0],s=n[1],f=o[0]-a,c=o[1]-s,p=Math.sin(i),d=Math.cos(i);return r[0]=a+f*d-c*p,r[1]=s+f*p+c*d,r[2]=o[2],r}}),8697:(function(e,t,r){var o=r(869);e.exports=n;function n(i,a){return o(i[0].mul(a[1]),i[1].mul(a[0]))}}),8731:(function(e,t,r){e.exports=c;var o=r(8866);function n(p,d,T,l,g,x){this._gl=p,this._wrapper=d,this._index=T,this._locations=l,this._dimension=g,this._constFunc=x}var i=n.prototype;i.pointer=function(d,T,l,g){var x=this,A=x._gl,M=x._locations[x._index];A.vertexAttribPointer(M,x._dimension,d||A.FLOAT,!!T,l||0,g||0),A.enableVertexAttribArray(M)},i.set=function(p,d,T,l){return this._constFunc(this._locations[this._index],p,d,T,l)},Object.defineProperty(i,"location",{get:function(){return this._locations[this._index]},set:function(p){return p!==this._locations[this._index]&&(this._locations[this._index]=p|0,this._wrapper.program=null),p|0}});var a=[function(p,d,T){return T.length===void 0?p.vertexAttrib1f(d,T):p.vertexAttrib1fv(d,T)},function(p,d,T,l){return T.length===void 0?p.vertexAttrib2f(d,T,l):p.vertexAttrib2fv(d,T)},function(p,d,T,l,g){return T.length===void 0?p.vertexAttrib3f(d,T,l,g):p.vertexAttrib3fv(d,T)},function(p,d,T,l,g,x){return T.length===void 0?p.vertexAttrib4f(d,T,l,g,x):p.vertexAttrib4fv(d,T)}];function s(p,d,T,l,g,x,A){var M=a[g],_=new n(p,d,T,l,g,M);Object.defineProperty(x,A,{set:function(w){return p.disableVertexAttribArray(l[T]),M(p,l[T],w),w},get:function(){return _},enumerable:!0})}function f(p,d,T,l,g,x,A){for(var M=new Array(g),_=new Array(g),w=0;w=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);s(p,d,m[0],l,u,g,_)}else if(w.indexOf("mat")>=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);f(p,d,m,l,u,g,_)}else throw new o("","Unknown data type for attribute "+_+": "+w);break}}return g}}),8828:(function(e,t){"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var a=i>>r-1;return(i^a)-a},t.min=function(i,a){return a^(i^a)&-(i65535)<<4,i>>>=a,s=(i>255)<<3,i>>>=s,a|=s,s=(i>15)<<2,i>>>=s,a|=s,s=(i>3)<<1,i>>>=s,a|=s,a|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var a=32;return i&=-i,i&&a--,i&65535&&(a-=16),i&16711935&&(a-=8),i&252645135&&(a-=4),i&858993459&&(a-=2),i&1431655765&&(a-=1),a}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var n=new Array(256);(function(i){for(var a=0;a<256;++a){var s=a,f=a,c=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--c;i[a]=f<>>8&255]<<16|n[i>>>16&255]<<8|n[i>>>24&255]},t.interleave2=function(i,a){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,i|a<<1},t.deinterleave2=function(i,a){return i=i>>>a&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,a,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,i|=a<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,a){return i=i>>>a&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var a=i|i-1;return a+1|(~a&-~a)-1>>>o(i)+1}}),8866:(function(e){function t(r,o,n){this.shortMessage=o||"",this.longMessage=n||"",this.rawError=r||"",this.message="gl-shader: "+(o||r||"")+(n?` -`+n:""),this.stack=new Error().stack}t.prototype=new Error,t.prototype.name="GLError",t.prototype.constructor=t,e.exports=t}),8902:(function(e,t,r){var o=r(2478),n=r(3250)[3],i=0,a=1,s=2;e.exports=A;function f(M,_,w,m,u){this.a=M,this.b=_,this.idx=w,this.lowerIds=m,this.upperIds=u}function c(M,_,w,m){this.a=M,this.b=_,this.type=w,this.idx=m}function p(M,_){var w=M.a[0]-_.a[0]||M.a[1]-_.a[1]||M.type-_.type;return w||M.type!==i&&(w=n(M.a,M.b,_.b),w)?w:M.idx-_.idx}function d(M,_){return n(M.a,M.b,_)}function T(M,_,w,m,u){for(var v=o.lt(_,m,d),y=o.gt(_,m,d),I=v;I1&&n(w[z[N-2]],w[z[N-1]],m)>0;)M.push([z[N-1],z[N-2],u]),N-=1;z.length=N,z.push(u);for(var F=L.upperIds,N=F.length;N>1&&n(w[F[N-2]],w[F[N-1]],m)<0;)M.push([F[N-2],F[N-1],u]),N-=1;F.length=N,F.push(u)}}function l(M,_){var w;return M.a[0]<_.a[0]?w=n(M.a,M.b,_.a):w=n(_.b,_.a,M.a),w||(_.b[0]L[0]&&u.push(new c(L,I,s,v),new c(I,L,a,v))}u.sort(p);for(var z=u[0].a[0]-(1+Math.abs(u[0].a[0]))*Math.pow(2,-52),F=[new f([z,1],[z,0],-1,[],[])],N=[],v=0,B=u.length;v0;){g=m.pop();for(var u=g.adjacent,v=0;v<=A;++v){var y=u[v];if(!(!y.boundary||y.lastVisited<=-M)){for(var I=y.vertices,L=0;L<=A;++L){var z=I[L];z<0?_[L]=x:_[L]=w[z]}var F=this.orient();if(F>0)return y;y.lastVisited=-M,F===0&&m.push(y)}}}return null},T.walk=function(g,x){var A=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,m=x?this.interior.length*Math.random()|0:this.interior.length-1,u=this.interior[m];e:for(;!u.boundary;){for(var v=u.vertices,y=u.adjacent,I=0;I<=M;++I)w[I]=_[v[I]];u.lastVisited=A;for(var I=0;I<=M;++I){var L=y[I];if(!(L.lastVisited>=A)){var z=w[I];w[I]=g;var F=this.orient();if(w[I]=z,F<0){u=L;continue e}else L.boundary?L.lastVisited=-A:L.lastVisited=A}}return}return u},T.addPeaks=function(g,x){var A=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,m=this.interior,u=this.simplices,v=[x];x.lastVisited=A,x.vertices[x.vertices.indexOf(-1)]=A,x.boundary=!1,m.push(x);for(var y=[];v.length>0;){var x=v.pop(),I=x.vertices,L=x.adjacent,z=I.indexOf(A);if(!(z<0)){for(var F=0;F<=M;++F)if(F!==z){var N=L[F];if(!(!N.boundary||N.lastVisited>=A)){var B=N.vertices;if(N.lastVisited!==-A){for(var R=0,U=0;U<=M;++U)B[U]<0?(R=U,w[U]=g):w[U]=_[B[U]];var j=this.orient();if(j>0){B[R]=A,N.boundary=!1,m.push(N),v.push(N),N.lastVisited=A;continue}else N.lastVisited=-A}var Z=N.adjacent,re=I.slice(),fe=L.slice(),le=new i(re,fe,!0);u.push(le);var ce=Z.indexOf(x);if(!(ce<0)){Z[ce]=le,fe[z]=N,re[F]=-1,fe[F]=x,L[F]=le,le.flip();for(var U=0;U<=M;++U){var V=re[U];if(!(V<0||V===A)){for(var ee=new Array(M-1),ne=0,K=0;K<=M;++K){var ue=re[K];ue<0||K===U||(ee[ne++]=ue)}y.push(new a(ee,le,U))}}}}}}}y.sort(s);for(var F=0;F+1=0?m[v++]=u[I]:y=I&1;if(y===(g&1)){var L=m[0];m[0]=m[1],m[1]=L}x.push(m)}}return x};function l(g,x){var A=g.length;if(A===0)throw new Error("Must have at least d+1 points");var M=g[0].length;if(A<=M)throw new Error("Must input at least d+1 points");var _=g.slice(0,M+1),w=o.apply(void 0,_);if(w===0)throw new Error("Input not in general position");for(var m=new Array(M+1),u=0;u<=M;++u)m[u]=u;w<0&&(m[0]=1,m[1]=0);for(var v=new i(m,new Array(M+1),!1),y=v.adjacent,I=new Array(M+2),u=0;u<=M;++u){for(var L=m.slice(),z=0;z<=M;++z)z===u&&(L[z]=-1);var F=L[0];L[0]=L[1],L[1]=F;var N=new i(L,new Array(M+1),!0);y[u]=N,I[u]=N}I[M+1]=v;for(var u=0;u<=M;++u)for(var L=y[u].vertices,B=y[u].adjacent,z=0;z<=M;++z){var R=L[z];if(R<0){B[z]=v;continue}for(var U=0;U<=M;++U)y[U].vertices.indexOf(R)<0&&(B[z]=y[U])}for(var j=new d(M,_,I),Z=!!x,u=M+1;u=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(w){this.pickId=w};function g(w){for(var m=p({colormap:w,nshades:256,format:"rgba"}),u=new Uint8Array(256*4),v=0;v<256;++v){for(var y=m[v],I=0;I<3;++I)u[4*v+I]=y[I];u[4*v+3]=y[3]*255}return c(u,[256,256,4],[4,0,1])}function x(w){for(var m=w.length,u=new Array(m),v=0;v0){var U=this.triShader;U.bind(),U.uniforms=z,this.triangleVAO.bind(),m.drawArrays(m.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(w){w=w||{};for(var m=this.gl,u=w.model||d,v=w.view||d,y=w.projection||d,I=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],L=0;L<3;++L)I[0][L]=Math.max(I[0][L],this.clipBounds[0][L]),I[1][L]=Math.min(I[1][L],this.clipBounds[1][L]);this._model=[].slice.call(u),this._view=[].slice.call(v),this._projection=[].slice.call(y),this._resolution=[m.drawingBufferWidth,m.drawingBufferHeight];var z={model:u,view:v,projection:y,clipBounds:I,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},F=this.pickShader;F.bind(),F.uniforms=z,this.triangleCount>0&&(this.triangleVAO.bind(),m.drawArrays(m.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(w){if(!w||w.id!==this.pickId)return null;var m=w.value[0]+256*w.value[1]+65536*w.value[2],u=this.cells[m],v=this.positions[u[1]].slice(0,3),y={position:v,dataCoordinate:v,index:Math.floor(u[1]/48)};return this.traceType==="cone"?y.index=Math.floor(u[1]/48):this.traceType==="streamtube"&&(y.intensity=this.intensity[u[1]],y.velocity=this.vectors[u[1]].slice(0,3),y.divergence=this.vectors[u[1]][3],y.index=m),y},l.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function A(w,m){var u=o(w,m.meshShader.vertex,m.meshShader.fragment,null,m.meshShader.attributes);return u.attributes.position.location=0,u.attributes.color.location=2,u.attributes.uv.location=3,u.attributes.vector.location=4,u}function M(w,m){var u=o(w,m.pickShader.vertex,m.pickShader.fragment,null,m.pickShader.attributes);return u.attributes.position.location=0,u.attributes.id.location=1,u.attributes.vector.location=4,u}function _(w,m,u){var v=u.shaders;arguments.length===1&&(m=w,w=m.gl);var y=A(w,v),I=M(w,v),L=a(w,c(new Uint8Array([255,255,255,255]),[1,1,4]));L.generateMipmap(),L.minFilter=w.LINEAR_MIPMAP_LINEAR,L.magFilter=w.LINEAR;var z=n(w),F=n(w),N=n(w),B=n(w),R=n(w),U=i(w,[{buffer:z,type:w.FLOAT,size:4},{buffer:R,type:w.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:N,type:w.FLOAT,size:4},{buffer:B,type:w.FLOAT,size:2},{buffer:F,type:w.FLOAT,size:4}]),j=new T(w,L,y,I,z,F,R,N,B,U,u.traceType||"cone");return j.update(m),j}e.exports=_}),9127:(function(e,t,r){e.exports=i;var o=r(6204),n=r(5771);function i(a){return n(o(a))}}),9131:(function(e,t,r){var o=r(5177),n=r(9288);e.exports=i;function i(a,s){return s=s||1,a[0]=Math.random(),a[1]=Math.random(),a[2]=Math.random(),a[3]=Math.random(),o(a,a),n(a,a,s),a}}),9165:(function(e,t,r){e.exports=T;var o=r(2762),n=r(8116),i=r(3436),a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,g,x,A){this.gl=l,this.shader=A,this.buffer=g,this.vao=x,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var f=s.prototype;f.isOpaque=function(){return!this.hasAlpha},f.isTransparent=function(){return this.hasAlpha},f.drawTransparent=f.draw=function(l){var g=this.gl,x=this.shader.uniforms;this.shader.bind();var A=x.view=l.view||a,M=x.projection=l.projection||a;x.model=l.model||a,x.clipBounds=this.clipBounds,x.opacity=this.opacity;var _=A[12],w=A[13],m=A[14],u=A[15],v=l._ortho||!1,y=v?2:1,I=y*this.pixelRatio*(M[3]*_+M[7]*w+M[11]*m+M[15]*u)/g.drawingBufferHeight;this.vao.bind();for(var L=0;L<3;++L)g.lineWidth(this.lineWidth[L]*this.pixelRatio),x.capSize=this.capSize[L]*I,this.lineCount[L]&&g.drawArrays(g.LINES,this.lineOffset[L],this.lineCount[L]);this.vao.unbind()};function c(l,g){for(var x=0;x<3;++x)l[0][x]=Math.min(l[0][x],g[x]),l[1][x]=Math.max(l[1][x],g[x])}var p=(function(){for(var l=new Array(3),g=0;g<3;++g){for(var x=[],A=1;A<=2;++A)for(var M=-1;M<=1;M+=2){var _=(A+g)%3,w=[0,0,0];w[_]=M,x.push(w)}l[g]=x}return l})();function d(l,g,x,A){for(var M=p[A],_=0;_0){var z=v.slice();z[m]+=I[1][m],M.push(v[0],v[1],v[2],L[0],L[1],L[2],L[3],0,0,0,z[0],z[1],z[2],L[0],L[1],L[2],L[3],0,0,0),c(this.bounds,z),w+=2+d(M,z,L,m)}}}this.lineCount[m]=w-this.lineOffset[m]}this.buffer.update(M)}},f.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function T(l){var g=l.gl,x=o(g),A=n(g,[{buffer:x,type:g.FLOAT,size:3,offset:0,stride:40},{buffer:x,type:g.FLOAT,size:4,offset:12,stride:40},{buffer:x,type:g.FLOAT,size:3,offset:28,stride:40}]),M=i(g);M.attributes.position.location=0,M.attributes.color.location=1,M.attributes.offset.location=2;var _=new s(g,x,A,M);return _.update(l),_}}),9215:(function(e,t,r){e.exports=c;var o=r(4769),n=r(2478);function i(p,d,T){return Math.min(d,Math.max(p,T))}function a(p,d,T){this.dimension=p.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var l=0;l=T-1)for(var w=x.length-1,u=p-d[T-1],m=0;m=T-1){var _=x.length-1;p-d[T-1];for(var w=0;w=0;--T)if(p[--d])return!1;return!0},s.jump=function(p){var d=this.lastT(),T=this.dimension;if(!(p0;--m)l.push(i(M[m-1],_[m-1],arguments[m])),g.push(0)}},s.push=function(p){var d=this.lastT(),T=this.dimension;if(!(p1e-6?1/A:0;this._time.push(p);for(var u=T;u>0;--u){var v=i(_[u-1],w[u-1],arguments[u]);l.push(v),g.push((v-l[x++])*m)}}},s.set=function(p){var d=this.dimension;if(!(p0;--M)T.push(i(x[M-1],A[M-1],arguments[M])),l.push(0)}},s.move=function(p){var d=this.lastT(),T=this.dimension;if(!(p<=d||arguments.length!==T+1)){var l=this._state,g=this._velocity,x=l.length-this.dimension,A=this.bounds,M=A[0],_=A[1],w=p-d,m=w>1e-6?1/w:0;this._time.push(p);for(var u=T;u>0;--u){var v=arguments[u];l.push(i(M[u-1],_[u-1],l[x++]+v)),g.push(v*m)}}},s.idle=function(p){var d=this.lastT();if(!(p=0;--m)l.push(i(M[m],_[m],l[x]+w*g[x])),g.push(0),x+=1}};function f(p){for(var d=new Array(p),T=0;T1&&a.indexOf("Macintosh")!==-1&&a.indexOf("Safari")!==-1&&(s=!0),s}}),9226:(function(e){e.exports=t;function t(r,o){return r[0]=Math.ceil(o[0]),r[1]=Math.ceil(o[1]),r[2]=Math.ceil(o[2]),r}}),9265:(function(e){e.exports=t;function t(r,o){return r[0]===o[0]&&r[1]===o[1]&&r[2]===o[2]}}),9288:(function(e){e.exports=t;function t(r,o,n){return r[0]=o[0]*n,r[1]=o[1]*n,r[2]=o[2]*n,r[3]=o[3]*n,r}}),9346:(function(e){var t=new Float64Array(4),r=new Float64Array(4),o=new Float64Array(4);function n(i,a,s,f,c){t.length=d?(u=1,y=d+2*g+A):(u=-g/d,y=g*u+A)):(u=0,x>=0?(v=0,y=A):-x>=l?(v=1,y=l+2*x+A):(v=-x/l,y=x*v+A));else if(v<0)v=0,g>=0?(u=0,y=A):-g>=d?(u=1,y=d+2*g+A):(u=-g/d,y=g*u+A);else{var I=1/m;u*=I,v*=I,y=u*(d*u+T*v+2*g)+v*(T*u+l*v+2*x)+A}else{var L,z,F,N;u<0?(L=T+g,z=l+x,z>L?(F=z-L,N=d-2*T+l,F>=N?(u=1,v=0,y=d+2*g+A):(u=F/N,v=1-u,y=u*(d*u+T*v+2*g)+v*(T*u+l*v+2*x)+A)):(u=0,z<=0?(v=1,y=l+2*x+A):x>=0?(v=0,y=A):(v=-x/l,y=x*v+A))):v<0?(L=T+x,z=d+g,z>L?(F=z-L,N=d-2*T+l,F>=N?(v=1,u=0,y=l+2*x+A):(v=F/N,u=1-v,y=u*(d*u+T*v+2*g)+v*(T*u+l*v+2*x)+A)):(v=0,z<=0?(u=1,y=d+2*g+A):g>=0?(u=0,y=A):(u=-g/d,y=g*u+A))):(F=l+x-T-g,F<=0?(u=0,v=1,y=l+2*x+A):(N=d-2*T+l,F>=N?(u=1,v=0,y=d+2*g+A):(u=F/N,v=1-u,y=u*(d*u+T*v+2*g)+v*(T*u+l*v+2*x)+A)))}for(var B=1-u-v,p=0;px)for(l=x;lg)for(l=g;l=0){for(var B=N.type.charAt(N.type.length-1)|0,R=new Array(B),U=0;U=0;)j+=1;z[F]=j}var Z=new Array(x.length);function re(){_.program=a.program(w,_._vref,_._fref,L,z);for(var fe=0;fete&&ae>0){var ie=(H[ae][0]-te)/(H[ae][0]-H[ae-1][0]);return H[ae][1]*(1-ie)+ie*H[ae-1][1]}}return 1}var U=[0,0,0],j={showSurface:!1,showContour:!1,projections:[y.slice(),y.slice(),y.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function Z(te,H){var ae,ie,ve,Ae=H.axes&&H.axes.lastCubeProps.axis||U,Ce=H.showSurface,Fe=H.showContour;for(ae=0;ae<3;++ae)for(Ce=Ce||H.surfaceProject[ae],ie=0;ie<3;++ie)Fe=Fe||H.contourProject[ae][ie];for(ae=0;ae<3;++ae){var ze=j.projections[ae];for(ie=0;ie<16;++ie)ze[ie]=0;for(ie=0;ie<4;++ie)ze[5*ie]=1;ze[5*ae]=0,ze[12+ae]=H.axesBounds[+(Ae[ae]>0)][ae],l(ze,te.model,ze);var Ye=j.clipBounds[ae];for(ve=0;ve<2;++ve)for(ie=0;ie<3;++ie)Ye[ve][ie]=te.clipBounds[ve][ie];Ye[0][ae]=-1e8,Ye[1][ae]=1e8}return j.showSurface=Ce,j.showContour=Fe,j}var re={model:y,view:y,projection:y,inverseModel:y.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},fe=y.slice(),le=[1,0,0,0,1,0,0,0,1];function ce(te,H){te=te||{};var ae=this.gl;ae.disable(ae.CULL_FACE),this._colorMap.bind(0);var ie=re;ie.model=te.model||y,ie.view=te.view||y,ie.projection=te.projection||y,ie.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],ie.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],ie.objectOffset=this.objectOffset,ie.contourColor=this.contourColor[0],ie.inverseModel=g(ie.inverseModel,ie.model);for(var ve=0;ve<2;++ve)for(var Ae=ie.clipBounds[ve],Ce=0;Ce<3;++Ce)Ae[Ce]=Math.min(Math.max(this.clipBounds[ve][Ce],-1e8),1e8);ie.kambient=this.ambientLight,ie.kdiffuse=this.diffuseLight,ie.kspecular=this.specularLight,ie.roughness=this.roughness,ie.fresnel=this.fresnel,ie.opacity=this.opacity,ie.height=0,ie.permutation=le,ie.vertexColor=this.vertexColor;var Fe=fe;for(l(Fe,ie.view,ie.model),l(Fe,ie.projection,Fe),g(Fe,Fe),ve=0;ve<3;++ve)ie.eyePosition[ve]=Fe[12+ve]/Fe[15];var ze=Fe[15];for(ve=0;ve<3;++ve)ze+=this.lightPosition[ve]*Fe[4*ve+3];for(ve=0;ve<3;++ve){var Ye=Fe[12+ve];for(Ce=0;Ce<3;++Ce)Ye+=Fe[4*Ce+ve]*this.lightPosition[Ce];ie.lightPosition[ve]=Ye/ze}var it=Z(ie,this);if(it.showSurface){for(this._shader.bind(),this._shader.uniforms=ie,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(ae.TRIANGLES,this._vertexCount),ve=0;ve<3;++ve)!this.surfaceProject[ve]||!this.vertexCount||(this._shader.uniforms.model=it.projections[ve],this._shader.uniforms.clipBounds=it.clipBounds[ve],this._vao.draw(ae.TRIANGLES,this._vertexCount));this._vao.unbind()}if(it.showContour){var st=this._contourShader;ie.kambient=1,ie.kdiffuse=0,ie.kspecular=0,ie.opacity=1,st.bind(),st.uniforms=ie;var nt=this._contourVAO;for(nt.bind(),ve=0;ve<3;++ve)for(st.uniforms.permutation=L[ve],ae.lineWidth(this.contourWidth[ve]*this.pixelRatio),Ce=0;Ce>4)/16)/255,ve=Math.floor(ie),Ae=ie-ve,Ce=H[1]*(te.value[1]+(te.value[2]&15)/16)/255,Fe=Math.floor(Ce),ze=Ce-Fe;ve+=1,Fe+=1;var Ye=ae.position;Ye[0]=Ye[1]=Ye[2]=0;for(var it=0;it<2;++it)for(var st=it?Ae:1-Ae,nt=0;nt<2;++nt)for(var Qe=nt?ze:1-ze,Le=ve+it,Te=Fe+nt,pe=st*Qe,Ne=0;Ne<3;++Ne)Ye[Ne]+=this._field[Ne].get(Le,Te)*pe;for(var ot=this._pickResult.level,ft=0;ft<3;++ft)if(ot[ft]=x.le(this.contourLevels[ft],Ye[ft]),ot[ft]<0)this.contourLevels[ft].length>0&&(ot[ft]=0);else if(ot[ft]Math.abs(Ft-Ye[ft])&&(ot[ft]+=1)}for(ae.index[0]=Ae<.5?ve:ve+1,ae.index[1]=ze<.5?Fe:Fe+1,ae.uv[0]=ie/H[0],ae.uv[1]=Ce/H[1],Ne=0;Ne<3;++Ne)ae.dataCoordinate[Ne]=this._field[Ne].get(ae.index[0],ae.index[1]);return ae},B.padField=function(te,H){var ae=H.shape.slice(),ie=te.shape.slice();c.assign(te.lo(1,1).hi(ae[0],ae[1]),H),c.assign(te.lo(1).hi(ae[0],1),H.hi(ae[0],1)),c.assign(te.lo(1,ie[1]-1).hi(ae[0],1),H.lo(0,ae[1]-1).hi(ae[0],1)),c.assign(te.lo(0,1).hi(1,ae[1]),H.hi(1)),c.assign(te.lo(ie[0]-1,1).hi(1,ae[1]),H.lo(ae[0]-1)),te.set(0,0,H.get(0,0)),te.set(0,ie[1]-1,H.get(0,ae[1]-1)),te.set(ie[0]-1,0,H.get(ae[0]-1,0)),te.set(ie[0]-1,ie[1]-1,H.get(ae[0]-1,ae[1]-1))};function ee(te,H){return Array.isArray(te)?[H(te[0]),H(te[1]),H(te[2])]:[H(te),H(te),H(te)]}function ne(te){return Array.isArray(te)?te.length===3?[te[0],te[1],te[2],1]:[te[0],te[1],te[2],te[3]]:[0,0,0,1]}function K(te){if(Array.isArray(te)){if(Array.isArray(te))return[ne(te[0]),ne(te[1]),ne(te[2])];var H=ne(te);return[H.slice(),H.slice(),H.slice()]}}B.update=function(te){te=te||{},this.objectOffset=te.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in te&&(this.contourWidth=ee(te.contourWidth,Number)),"showContour"in te&&(this.showContour=ee(te.showContour,Boolean)),"showSurface"in te&&(this.showSurface=!!te.showSurface),"contourTint"in te&&(this.contourTint=ee(te.contourTint,Boolean)),"contourColor"in te&&(this.contourColor=K(te.contourColor)),"contourProject"in te&&(this.contourProject=ee(te.contourProject,function(Ca){return ee(Ca,Boolean)})),"surfaceProject"in te&&(this.surfaceProject=te.surfaceProject),"dynamicColor"in te&&(this.dynamicColor=K(te.dynamicColor)),"dynamicTint"in te&&(this.dynamicTint=ee(te.dynamicTint,Number)),"dynamicWidth"in te&&(this.dynamicWidth=ee(te.dynamicWidth,Number)),"opacity"in te&&(this.opacity=te.opacity),"opacityscale"in te&&(this.opacityscale=te.opacityscale),"colorBounds"in te&&(this.colorBounds=te.colorBounds),"vertexColor"in te&&(this.vertexColor=te.vertexColor?1:0),"colormap"in te&&this._colorMap.setPixels(this.genColormap(te.colormap,this.opacityscale));var H=te.field||te.coords&&te.coords[2]||null,ae=!1;if(H||(this._field[2].shape[0]||this._field[2].shape[2]?H=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):H=this._field[2].hi(0,0)),"field"in te||"coords"in te){var ie=(H.shape[0]+2)*(H.shape[1]+2);ie>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(o.nextPow2(ie))),this._field[2]=d(this._field[2].data,[H.shape[0]+2,H.shape[1]+2]),this.padField(this._field[2],H),this.shape=H.shape.slice();for(var ve=this.shape,Ae=0;Ae<2;++Ae)this._field[2].size>this._field[Ae].data.length&&(s.freeFloat(this._field[Ae].data),this._field[Ae].data=s.mallocFloat(this._field[2].size)),this._field[Ae]=d(this._field[Ae].data,[ve[0]+2,ve[1]+2]);if(te.coords){var Ce=te.coords;if(!Array.isArray(Ce)||Ce.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Ae=0;Ae<2;++Ae){var Fe=Ce[Ae];for(nt=0;nt<2;++nt)if(Fe.shape[nt]!==ve[nt])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Ae],Fe)}}else if(te.ticks){var ze=te.ticks;if(!Array.isArray(ze)||ze.length!==2)throw new Error("gl-surface: invalid ticks");for(Ae=0;Ae<2;++Ae){var Ye=ze[Ae];if((Array.isArray(Ye)||Ye.length)&&(Ye=d(Ye)),Ye.shape[0]!==ve[Ae])throw new Error("gl-surface: invalid tick length");var it=d(Ye.data,ve);it.stride[Ae]=Ye.stride[0],it.stride[Ae^1]=0,this.padField(this._field[Ae],it)}}else{for(Ae=0;Ae<2;++Ae){var st=[0,0];st[Ae]=1,this._field[Ae]=d(this._field[Ae].data,[ve[0]+2,ve[1]+2],st,0)}this._field[0].set(0,0,0);for(var nt=0;nt0){for(var ha=0;ha<5;++ha)pr.pop();Ee-=1}continue e}}}Kn.push(Ee)}this._contourOffsets[hr]=En,this._contourCounts[hr]=Kn}var _a=s.mallocFloat(pr.length);for(Ae=0;Ae=0&&(m=_|0,w+=v*m,u-=m),new x(this.data,u,v,w)},A.step=function(_){var w=this.shape[0],m=this.stride[0],u=this.offset,v=0,y=Math.ceil;return typeof _=="number"&&(v=_|0,v<0?(u+=m*(w-1),w=y(-w/v)):w=y(w/v),m*=v),new x(this.data,w,m,u)},A.transpose=function(_){_=_===void 0?0:_|0;var w=this.shape,m=this.stride;return new x(this.data,w[_],m[_],this.offset)},A.pick=function(_){var w=[],m=[],u=this.offset;typeof _=="number"&&_>=0?u=u+this.stride[0]*_|0:(w.push(this.shape[0]),m.push(this.stride[0]));var v=l[w.length+1];return v(this.data,w,m,u)},function(_,w,m,u){return new x(_,w[0],m[0],u)}},2:function(T,l,g){function x(M,_,w,m,u,v){this.data=M,this.shape=[_,w],this.stride=[m,u],this.offset=v|0}var A=x.prototype;return A.dtype=T,A.dimension=2,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(A,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),A.set=function(_,w,m){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w,m):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]=m},A.get=function(_,w){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]},A.index=function(_,w){return this.offset+this.stride[0]*_+this.stride[1]*w},A.hi=function(_,w){return new x(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,this.stride[0],this.stride[1],this.offset)},A.lo=function(_,w){var m=this.offset,u=0,v=this.shape[0],y=this.shape[1],I=this.stride[0],L=this.stride[1];return typeof _=="number"&&_>=0&&(u=_|0,m+=I*u,v-=u),typeof w=="number"&&w>=0&&(u=w|0,m+=L*u,y-=u),new x(this.data,v,y,I,L,m)},A.step=function(_,w){var m=this.shape[0],u=this.shape[1],v=this.stride[0],y=this.stride[1],I=this.offset,L=0,z=Math.ceil;return typeof _=="number"&&(L=_|0,L<0?(I+=v*(m-1),m=z(-m/L)):m=z(m/L),v*=L),typeof w=="number"&&(L=w|0,L<0?(I+=y*(u-1),u=z(-u/L)):u=z(u/L),y*=L),new x(this.data,m,u,v,y,I)},A.transpose=function(_,w){_=_===void 0?0:_|0,w=w===void 0?1:w|0;var m=this.shape,u=this.stride;return new x(this.data,m[_],m[w],u[_],u[w],this.offset)},A.pick=function(_,w){var m=[],u=[],v=this.offset;typeof _=="number"&&_>=0?v=v+this.stride[0]*_|0:(m.push(this.shape[0]),u.push(this.stride[0])),typeof w=="number"&&w>=0?v=v+this.stride[1]*w|0:(m.push(this.shape[1]),u.push(this.stride[1]));var y=l[m.length+1];return y(this.data,m,u,v)},function(_,w,m,u){return new x(_,w[0],w[1],m[0],m[1],u)}},3:function(T,l,g){function x(M,_,w,m,u,v,y,I){this.data=M,this.shape=[_,w,m],this.stride=[u,v,y],this.offset=I|0}var A=x.prototype;return A.dtype=T,A.dimension=3,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(A,"order",{get:function(){var _=Math.abs(this.stride[0]),w=Math.abs(this.stride[1]),m=Math.abs(this.stride[2]);return _>w?w>m?[2,1,0]:_>m?[1,2,0]:[1,0,2]:_>m?[2,0,1]:m>w?[0,1,2]:[0,2,1]}}),A.set=function(_,w,m,u){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m,u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m]=u},A.get=function(_,w,m){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m]},A.index=function(_,w,m){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m},A.hi=function(_,w,m){return new x(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof m!="number"||m<0?this.shape[2]:m|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},A.lo=function(_,w,m){var u=this.offset,v=0,y=this.shape[0],I=this.shape[1],L=this.shape[2],z=this.stride[0],F=this.stride[1],N=this.stride[2];return typeof _=="number"&&_>=0&&(v=_|0,u+=z*v,y-=v),typeof w=="number"&&w>=0&&(v=w|0,u+=F*v,I-=v),typeof m=="number"&&m>=0&&(v=m|0,u+=N*v,L-=v),new x(this.data,y,I,L,z,F,N,u)},A.step=function(_,w,m){var u=this.shape[0],v=this.shape[1],y=this.shape[2],I=this.stride[0],L=this.stride[1],z=this.stride[2],F=this.offset,N=0,B=Math.ceil;return typeof _=="number"&&(N=_|0,N<0?(F+=I*(u-1),u=B(-u/N)):u=B(u/N),I*=N),typeof w=="number"&&(N=w|0,N<0?(F+=L*(v-1),v=B(-v/N)):v=B(v/N),L*=N),typeof m=="number"&&(N=m|0,N<0?(F+=z*(y-1),y=B(-y/N)):y=B(y/N),z*=N),new x(this.data,u,v,y,I,L,z,F)},A.transpose=function(_,w,m){_=_===void 0?0:_|0,w=w===void 0?1:w|0,m=m===void 0?2:m|0;var u=this.shape,v=this.stride;return new x(this.data,u[_],u[w],u[m],v[_],v[w],v[m],this.offset)},A.pick=function(_,w,m){var u=[],v=[],y=this.offset;typeof _=="number"&&_>=0?y=y+this.stride[0]*_|0:(u.push(this.shape[0]),v.push(this.stride[0])),typeof w=="number"&&w>=0?y=y+this.stride[1]*w|0:(u.push(this.shape[1]),v.push(this.stride[1])),typeof m=="number"&&m>=0?y=y+this.stride[2]*m|0:(u.push(this.shape[2]),v.push(this.stride[2]));var I=l[u.length+1];return I(this.data,u,v,y)},function(_,w,m,u){return new x(_,w[0],w[1],w[2],m[0],m[1],m[2],u)}},4:function(T,l,g){function x(M,_,w,m,u,v,y,I,L,z){this.data=M,this.shape=[_,w,m,u],this.stride=[v,y,I,L],this.offset=z|0}var A=x.prototype;return A.dtype=T,A.dimension=4,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(A,"order",{get:g}),A.set=function(_,w,m,u,v){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u,v):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u]=v},A.get=function(_,w,m,u){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u]},A.index=function(_,w,m,u){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u},A.hi=function(_,w,m,u){return new x(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof m!="number"||m<0?this.shape[2]:m|0,typeof u!="number"||u<0?this.shape[3]:u|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},A.lo=function(_,w,m,u){var v=this.offset,y=0,I=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],N=this.stride[0],B=this.stride[1],R=this.stride[2],U=this.stride[3];return typeof _=="number"&&_>=0&&(y=_|0,v+=N*y,I-=y),typeof w=="number"&&w>=0&&(y=w|0,v+=B*y,L-=y),typeof m=="number"&&m>=0&&(y=m|0,v+=R*y,z-=y),typeof u=="number"&&u>=0&&(y=u|0,v+=U*y,F-=y),new x(this.data,I,L,z,F,N,B,R,U,v)},A.step=function(_,w,m,u){var v=this.shape[0],y=this.shape[1],I=this.shape[2],L=this.shape[3],z=this.stride[0],F=this.stride[1],N=this.stride[2],B=this.stride[3],R=this.offset,U=0,j=Math.ceil;return typeof _=="number"&&(U=_|0,U<0?(R+=z*(v-1),v=j(-v/U)):v=j(v/U),z*=U),typeof w=="number"&&(U=w|0,U<0?(R+=F*(y-1),y=j(-y/U)):y=j(y/U),F*=U),typeof m=="number"&&(U=m|0,U<0?(R+=N*(I-1),I=j(-I/U)):I=j(I/U),N*=U),typeof u=="number"&&(U=u|0,U<0?(R+=B*(L-1),L=j(-L/U)):L=j(L/U),B*=U),new x(this.data,v,y,I,L,z,F,N,B,R)},A.transpose=function(_,w,m,u){_=_===void 0?0:_|0,w=w===void 0?1:w|0,m=m===void 0?2:m|0,u=u===void 0?3:u|0;var v=this.shape,y=this.stride;return new x(this.data,v[_],v[w],v[m],v[u],y[_],y[w],y[m],y[u],this.offset)},A.pick=function(_,w,m,u){var v=[],y=[],I=this.offset;typeof _=="number"&&_>=0?I=I+this.stride[0]*_|0:(v.push(this.shape[0]),y.push(this.stride[0])),typeof w=="number"&&w>=0?I=I+this.stride[1]*w|0:(v.push(this.shape[1]),y.push(this.stride[1])),typeof m=="number"&&m>=0?I=I+this.stride[2]*m|0:(v.push(this.shape[2]),y.push(this.stride[2])),typeof u=="number"&&u>=0?I=I+this.stride[3]*u|0:(v.push(this.shape[3]),y.push(this.stride[3]));var L=l[v.length+1];return L(this.data,v,y,I)},function(_,w,m,u){return new x(_,w[0],w[1],w[2],w[3],m[0],m[1],m[2],m[3],u)}},5:function(l,g,x){function A(_,w,m,u,v,y,I,L,z,F,N,B){this.data=_,this.shape=[w,m,u,v,y],this.stride=[I,L,z,F,N],this.offset=B|0}var M=A.prototype;return M.dtype=l,M.dimension=5,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(M,"order",{get:x}),M.set=function(w,m,u,v,y,I){return l==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*v+this.stride[4]*y,I):this.data[this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*v+this.stride[4]*y]=I},M.get=function(w,m,u,v,y){return l==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*v+this.stride[4]*y):this.data[this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*v+this.stride[4]*y]},M.index=function(w,m,u,v,y){return this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*v+this.stride[4]*y},M.hi=function(w,m,u,v,y){return new A(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof m!="number"||m<0?this.shape[1]:m|0,typeof u!="number"||u<0?this.shape[2]:u|0,typeof v!="number"||v<0?this.shape[3]:v|0,typeof y!="number"||y<0?this.shape[4]:y|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},M.lo=function(w,m,u,v,y){var I=this.offset,L=0,z=this.shape[0],F=this.shape[1],N=this.shape[2],B=this.shape[3],R=this.shape[4],U=this.stride[0],j=this.stride[1],Z=this.stride[2],re=this.stride[3],fe=this.stride[4];return typeof w=="number"&&w>=0&&(L=w|0,I+=U*L,z-=L),typeof m=="number"&&m>=0&&(L=m|0,I+=j*L,F-=L),typeof u=="number"&&u>=0&&(L=u|0,I+=Z*L,N-=L),typeof v=="number"&&v>=0&&(L=v|0,I+=re*L,B-=L),typeof y=="number"&&y>=0&&(L=y|0,I+=fe*L,R-=L),new A(this.data,z,F,N,B,R,U,j,Z,re,fe,I)},M.step=function(w,m,u,v,y){var I=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],N=this.shape[4],B=this.stride[0],R=this.stride[1],U=this.stride[2],j=this.stride[3],Z=this.stride[4],re=this.offset,fe=0,le=Math.ceil;return typeof w=="number"&&(fe=w|0,fe<0?(re+=B*(I-1),I=le(-I/fe)):I=le(I/fe),B*=fe),typeof m=="number"&&(fe=m|0,fe<0?(re+=R*(L-1),L=le(-L/fe)):L=le(L/fe),R*=fe),typeof u=="number"&&(fe=u|0,fe<0?(re+=U*(z-1),z=le(-z/fe)):z=le(z/fe),U*=fe),typeof v=="number"&&(fe=v|0,fe<0?(re+=j*(F-1),F=le(-F/fe)):F=le(F/fe),j*=fe),typeof y=="number"&&(fe=y|0,fe<0?(re+=Z*(N-1),N=le(-N/fe)):N=le(N/fe),Z*=fe),new A(this.data,I,L,z,F,N,B,R,U,j,Z,re)},M.transpose=function(w,m,u,v,y){w=w===void 0?0:w|0,m=m===void 0?1:m|0,u=u===void 0?2:u|0,v=v===void 0?3:v|0,y=y===void 0?4:y|0;var I=this.shape,L=this.stride;return new A(this.data,I[w],I[m],I[u],I[v],I[y],L[w],L[m],L[u],L[v],L[y],this.offset)},M.pick=function(w,m,u,v,y){var I=[],L=[],z=this.offset;typeof w=="number"&&w>=0?z=z+this.stride[0]*w|0:(I.push(this.shape[0]),L.push(this.stride[0])),typeof m=="number"&&m>=0?z=z+this.stride[1]*m|0:(I.push(this.shape[1]),L.push(this.stride[1])),typeof u=="number"&&u>=0?z=z+this.stride[2]*u|0:(I.push(this.shape[2]),L.push(this.stride[2])),typeof v=="number"&&v>=0?z=z+this.stride[3]*v|0:(I.push(this.shape[3]),L.push(this.stride[3])),typeof y=="number"&&y>=0?z=z+this.stride[4]*y|0:(I.push(this.shape[4]),L.push(this.stride[4]));var F=g[I.length+1];return F(this.data,I,L,z)},function(w,m,u,v){return new A(w,m[0],m[1],m[2],m[3],m[4],u[0],u[1],u[2],u[3],u[4],v)}}};function f(T,l){var g=l===-1?"T":String(l),x=s[g];return l===-1?x(T):l===0?x(T,p[T][0]):x(T,p[T],a)}function c(T){if(o(T))return"buffer";if(n)switch(Object.prototype.toString.call(T)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(T)?"array":"generic"}var p={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function d(T,l,g,x){if(T===void 0){var u=p.array[0];return u([])}else typeof T=="number"&&(T=[T]);l===void 0&&(l=[T.length]);var A=l.length;if(g===void 0){g=new Array(A);for(var M=A-1,_=1;M>=0;--M)g[M]=_,_*=l[M]}if(x===void 0){x=0;for(var M=0;M1e-6?(g[0]=A/m,g[1]=M/m,g[2]=_/m,g[3]=w/m):(g[0]=g[1]=g[2]=0,g[3]=1)}function d(g,x,A){this.radius=o([A]),this.center=o(x),this.rotation=o(g),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var T=d.prototype;T.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},T.recalcMatrix=function(g){this.radius.curve(g),this.center.curve(g),this.rotation.curve(g);var x=this.computedRotation;p(x,x);var A=this.computedMatrix;i(A,x);var M=this.computedCenter,_=this.computedEye,w=this.computedUp,m=Math.exp(this.computedRadius[0]);_[0]=M[0]+m*A[2],_[1]=M[1]+m*A[6],_[2]=M[2]+m*A[10],w[0]=A[1],w[1]=A[5],w[2]=A[9];for(var u=0;u<3;++u){for(var v=0,y=0;y<3;++y)v+=A[u+4*y]*_[y];A[12+u]=-v}},T.getMatrix=function(g,x){this.recalcMatrix(g);var A=this.computedMatrix;if(x){for(var M=0;M<16;++M)x[M]=A[M];return x}return A},T.idle=function(g){this.center.idle(g),this.radius.idle(g),this.rotation.idle(g)},T.flush=function(g){this.center.flush(g),this.radius.flush(g),this.rotation.flush(g)},T.pan=function(g,x,A,M){x=x||0,A=A||0,M=M||0,this.recalcMatrix(g);var _=this.computedMatrix,w=_[1],m=_[5],u=_[9],v=f(w,m,u);w/=v,m/=v,u/=v;var y=_[0],I=_[4],L=_[8],z=y*w+I*m+L*u;y-=w*z,I-=m*z,L-=u*z;var F=f(y,I,L);y/=F,I/=F,L/=F,_[2],_[6],_[10];var N=y*x+w*A,B=I*x+m*A,R=L*x+u*A;this.center.move(g,N,B,R);var U=Math.exp(this.computedRadius[0]);U=Math.max(1e-4,U+M),this.radius.set(g,Math.log(U))},T.rotate=function(g,x,A,M){this.recalcMatrix(g),x=x||0,A=A||0;var _=this.computedMatrix,w=_[0],m=_[4],u=_[8],v=_[1],y=_[5],I=_[9],L=_[2],z=_[6],F=_[10],N=x*w+A*v,B=x*m+A*y,R=x*u+A*I,U=-(z*R-F*B),j=-(F*N-L*R),Z=-(L*B-z*N),re=Math.sqrt(Math.max(0,1-Math.pow(U,2)-Math.pow(j,2)-Math.pow(Z,2))),fe=c(U,j,Z,re);fe>1e-6?(U/=fe,j/=fe,Z/=fe,re/=fe):(U=j=Z=0,re=1);var le=this.computedRotation,ce=le[0],V=le[1],ee=le[2],ne=le[3],K=ce*re+ne*U+V*Z-ee*j,ue=V*re+ne*j+ee*U-ce*Z,te=ee*re+ne*Z+ce*j-V*U,H=ne*re-ce*U-V*j-ee*Z;if(M){U=L,j=z,Z=F;var ae=Math.sin(M)/f(U,j,Z);U*=ae,j*=ae,Z*=ae,re=Math.cos(x),K=K*re+H*U+ue*Z-te*j,ue=ue*re+H*j+te*U-K*Z,te=te*re+H*Z+K*j-ue*U,H=H*re-K*U-ue*j-te*Z}var ie=c(K,ue,te,H);ie>1e-6?(K/=ie,ue/=ie,te/=ie,H/=ie):(K=ue=te=0,H=1),this.rotation.set(g,K,ue,te,H)},T.lookAt=function(g,x,A,M){this.recalcMatrix(g),A=A||this.computedCenter,x=x||this.computedEye,M=M||this.computedUp;var _=this.computedMatrix;n(_,x,A,M);var w=this.computedRotation;s(w,_[0],_[1],_[2],_[4],_[5],_[6],_[8],_[9],_[10]),p(w,w),this.rotation.set(g,w[0],w[1],w[2],w[3]);for(var m=0,u=0;u<3;++u)m+=Math.pow(A[u]-x[u],2);this.radius.set(g,.5*Math.log(Math.max(m,1e-6))),this.center.set(g,A[0],A[1],A[2])},T.translate=function(g,x,A,M){this.center.move(g,x||0,A||0,M||0)},T.setMatrix=function(g,x){var A=this.computedRotation;s(A,x[0],x[1],x[2],x[4],x[5],x[6],x[8],x[9],x[10]),p(A,A),this.rotation.set(g,A[0],A[1],A[2],A[3]);var M=this.computedMatrix;a(M,x);var _=M[15];if(Math.abs(_)>1e-6){var w=M[12]/_,m=M[13]/_,u=M[14]/_;this.recalcMatrix(g);var v=Math.exp(this.computedRadius[0]);this.center.set(g,w-M[2]*v,m-M[6]*v,u-M[10]*v),this.radius.idle(g)}else this.center.idle(g),this.radius.idle(g)},T.setDistance=function(g,x){x>0&&this.radius.set(g,Math.log(x))},T.setDistanceLimits=function(g,x){g>0?g=Math.log(g):g=-1/0,x>0?x=Math.log(x):x=1/0,x=Math.max(x,g),this.radius.bounds[0][0]=g,this.radius.bounds[1][0]=x},T.getDistanceLimits=function(g){var x=this.radius.bounds;return g?(g[0]=Math.exp(x[0][0]),g[1]=Math.exp(x[1][0]),g):[Math.exp(x[0][0]),Math.exp(x[1][0])]},T.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},T.fromJSON=function(g){var x=this.lastT(),A=g.center;A&&this.center.set(x,A[0],A[1],A[2]);var M=g.rotation;M&&this.rotation.set(x,M[0],M[1],M[2],M[3]);var _=g.distance;_&&_>0&&this.radius.set(x,Math.log(_)),this.setDistanceLimits(g.zoomMin,g.zoomMax)};function l(g){g=g||{};var x=g.center||[0,0,0],A=g.rotation||[0,0,0,1],M=g.radius||1;x=[].slice.call(x,0,3),A=[].slice.call(A,0,4),p(A,A);var _=new d(A,x,Math.log(M));return _.setDistanceLimits(g.zoomMin,g.zoomMax),("eye"in g||"up"in g)&&_.lookAt(0,g.eye,g.center,g.up),_}}),9994:(function(e,t,r){var o=r(9618),n=r(8277);e.exports=function(a,s){for(var f=[],c=a,p=1;Array.isArray(c);)f.push(c.length),p*=c.length,c=c[0];return f.length===0?o():(s||(s=o(new Float64Array(p),f)),n(s,a),s)}})},b={};function S(e){var t=b[e];if(t!==void 0)return t.exports;var r=b[e]={id:e,loaded:!1,exports:{}};return h[e].call(r.exports,r,r.exports,S),r.loaded=!0,r.exports}(function(){S.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})()})(),(function(){S.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}})();var E=S(1964);G.exports=E})()}}),Dk=Ge({"node_modules/color-name/index.js"($,G){G.exports={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]}}}),sP=Ge({"node_modules/color-normalize/node_modules/color-parse/index.js"($,G){var h=Dk();G.exports=S;var b={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function S(E){var e,t=[],r=1,o;if(typeof E=="string")if(E=E.toLowerCase(),h[E])t=h[E].slice(),o="rgb";else if(E==="transparent")r=0,o="rgb",t=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(E)){var n=E.slice(1),i=n.length,a=i<=4;r=1,a?(t=[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16)],i===4&&(r=parseInt(n[3]+n[3],16)/255)):(t=[parseInt(n[0]+n[1],16),parseInt(n[2]+n[3],16),parseInt(n[4]+n[5],16)],i===8&&(r=parseInt(n[6]+n[7],16)/255)),t[0]||(t[0]=0),t[1]||(t[1]=0),t[2]||(t[2]=0),o="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(E)){var s=e[1],f=s==="rgb",n=s.replace(/a$/,"");o=n;var i=n==="cmyk"?4:n==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,T){if(/%$/.test(d))return T===i?parseFloat(d)/100:n==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(n[T]==="h"){if(/deg$/.test(d))return parseFloat(d);if(b[d]!==void 0)return b[d]}return parseFloat(d)}),s===n&&t.push(1),r=f||t[i]===void 0?1:t[i],t=t.slice(0,i)}else E.length>10&&/[0-9](?:\s|\/)/.test(E)&&(t=E.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),o=E.match(/([a-z])/ig).join("").toLowerCase());else isNaN(E)?Array.isArray(E)||E.length?(t=[E[0],E[1],E[2]],o="rgb",r=E.length===4?E[3]:1):E instanceof Object&&(E.r!=null||E.red!=null||E.R!=null?(o="rgb",t=[E.r||E.red||E.R||0,E.g||E.green||E.G||0,E.b||E.blue||E.B||0]):(o="hsl",t=[E.h||E.hue||E.H||0,E.s||E.saturation||E.S||0,E.l||E.lightness||E.L||E.b||E.brightness]),r=E.a||E.alpha||E.opacity||1,E.opacity!=null&&(r/=100)):(o="rgb",t=[E>>>16,(E&65280)>>>8,E&255]);return{space:o,values:t,alpha:r}}}}),lP=Ge({"node_modules/color-normalize/node_modules/color-rgba/index.js"($,G){var h=sP();G.exports=function(E){Array.isArray(E)&&E.raw&&(E=String.raw.apply(null,arguments));var e,t=h(E);if(!t.space)return[];var r=[0,0,0],o=t.space[0]==="h"?[360,100,100]:[255,255,255];return e=Array(3),e[0]=Math.min(Math.max(t.values[0],r[0]),o[0]),e[1]=Math.min(Math.max(t.values[1],r[1]),o[1]),e[2]=Math.min(Math.max(t.values[2],r[2]),o[2]),t.space[0]==="h"&&(e=b(e)),e.push(Math.min(Math.max(t.alpha,0),1)),e};function b(S){var E=S[0]/360,e=S[1]/100,t=S[2]/100,r,o,n,i,a,s=0;if(e===0)return a=t*255,[a,a,a];for(o=t<.5?t*(1+e):t+e-t*e,r=2*t-o,i=[0,0,0];s<3;)n=E+1/3*-(s-1),n<0?n++:n>1&&n--,a=6*n<1?r+(o-r)*6*n:2*n<1?o:3*n<2?r+(o-r)*(2/3-n)*6:r,i[s++]=a*255;return i}}}),HA=Ge({"node_modules/clamp/index.js"($,G){G.exports=h;function h(b,S,E){return SE?E:b:bS?S:b}}}),iE=Ge({"node_modules/dtype/index.js"($,G){G.exports=function(h){switch(h){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),L_=Ge({"node_modules/color-normalize/index.js"($,G){var h=lP(),b=HA(),S=iE();G.exports=function(t,r){(r==="float"||!r)&&(r="array"),r==="uint"&&(r="uint8"),r==="uint_clamped"&&(r="uint8_clamped");var o=S(r),n=new o(4),i=r!=="uint8"&&r!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=h(t),t[0]/=255,t[1]/=255,t[2]/=255),E(t)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]!=null?t[3]:255,i&&(n[0]/=255,n[1]/=255,n[2]/=255,n[3]/=255),n):(i?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]!=null?t[3]:1):(n[0]=b(Math.floor(t[0]*255),0,255),n[1]=b(Math.floor(t[1]*255),0,255),n[2]=b(Math.floor(t[2]*255),0,255),n[3]=t[3]==null?255:b(Math.floor(t[3]*255),0,255)),n)};function E(e){return!!(e instanceof Uint8Array||e instanceof Uint8ClampedArray||Array.isArray(e)&&(e[0]>1||e[0]===0)&&(e[1]>1||e[1]===0)&&(e[2]>1||e[2]===0)&&(!e[3]||e[3]>1))}}}),jy=Ge({"src/lib/str2rgbarray.js"($,G){var h=L_();function b(S){return S?h(S):[0,0,0,1]}G.exports=b}}),qy=Ge({"src/lib/gl_format_color.js"($,G){var h=Ga(),b=ks(),S=L_(),E=Ac(),e=rh().defaultLine,t=ro().isArrayOrTypedArray,r=S(e),o=1;function n(c,p){var d=c;return d[3]*=p,d}function i(c){if(h(c))return r;var p=S(c);return p.length?p:r}function a(c){return h(c)?c:o}function s(c,p,d){var T=c.color;T&&T._inputArray&&(T=T._inputArray);var l=t(T),g=t(p),x=E.extractOpts(c),A=[],M,_,w,m,u;if(x.colorscale!==void 0?M=E.makeColorScaleFuncFromTrace(c):M=i,l?_=function(y,I){return y[I]===void 0?r:S(M(y[I]))}:_=i,g?w=function(y,I){return y[I]===void 0?o:a(y[I])}:w=a,l||g)for(var v=0;v0){var d=o.c2l(c);o._lowerLogErrorBound||(o._lowerLogErrorBound=d),o._lowerErrorBound=Math.min(o._lowerLogErrorBound,d)}}else i[a]=[-s[0]*r,s[1]*r]}return i}function S(e){for(var t=0;t-1?-1:I.indexOf("right")>-1?1:0}function x(I){return I==null?0:I.indexOf("top")>-1?-1:I.indexOf("bottom")>-1?1:0}function A(I){var L=0,z=0,F=[L,z];if(Array.isArray(I))for(var N=0;N=0){var Z=T(U.position,U.delaunayColor,U.delaunayAxis);Z.opacity=I.opacity,this.delaunayMesh?this.delaunayMesh.update(Z):(Z.gl=L,this.delaunayMesh=E(Z),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},d.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function y(I,L){var z=new p(I,L.uid);return z.update(L),z}G.exports=y}}),Ok=Ge({"src/traces/scatter3d/attributes.js"($,G){var h=jc(),b=Fs(),S=Ru(),E=hc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=nu(),n=zk(),i=oE(),a=Qi().extendFlat,s=Uc().overrideAll,f=Cp(),c=h.line,p=h.marker,d=p.line,T=a({width:c.width,dash:{valType:"enumerated",values:f(n),dflt:"solid"}},S("line"));function l(x){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var g=G.exports=s({x:h.x,y:h.y,z:{valType:"data_array"},text:a({},h.text,{}),texttemplate:t(),texttemplatefallback:r({editType:"calc"}),hovertext:a({},h.hovertext,{}),hovertemplate:e(),hovertemplatefallback:r(),xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z"),mode:a({},h.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:l(),y:l(),z:l()},connectgaps:h.connectgaps,line:T,marker:a({symbol:{valType:"enumerated",values:f(i),dflt:"circle",arrayOk:!0},size:a({},p.size,{dflt:8}),sizeref:p.sizeref,sizemin:p.sizemin,sizemode:p.sizemode,opacity:a({},p.opacity,{arrayOk:!1}),colorbar:p.colorbar,line:a({width:a({},d.width,{arrayOk:!1})},S("marker.line"))},S("marker")),textposition:a({},h.textposition,{dflt:"top center"}),textfont:b({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:o.opacity,hoverinfo:a({},o.hoverinfo)},"calc","nested");g.x.editType=g.y.editType=g.z.editType="calc+clearAxisTypes"}}),fP=Ge({"src/traces/scatter3d/defaults.js"($,G){var h=Io(),b=yn(),S=ou(),E=Gv(),e=Fp(),t=ep(),r=Ok();G.exports=function(i,a,s,f){function c(M,_){return b.coerce(i,a,r,M,_)}var p=o(i,a,c,f);if(!p){a.visible=!1;return}c("text"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),c("xhoverformat"),c("yhoverformat"),c("zhoverformat"),c("mode"),S.hasMarkers(a)&&E(i,a,s,f,c,{noSelect:!0,noAngle:!0}),S.hasLines(a)&&(c("connectgaps"),e(i,a,s,f,c)),S.hasText(a)&&(c("texttemplate"),c("texttemplatefallback"),t(i,a,f,c,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var d=(a.line||{}).color,T=(a.marker||{}).color;c("surfaceaxis")>=0&&c("surfacecolor",d||T);for(var l=["x","y","z"],g=0;g<3;++g){var x="projection."+l[g];c(x+".show")&&(c(x+".opacity"),c(x+".scale"))}var A=h.getComponentMethod("errorbars","supplyDefaults");A(i,a,d||T||s,{axis:"z"}),A(i,a,d||T||s,{axis:"y",inherit:"z"}),A(i,a,d||T||s,{axis:"x",inherit:"z"})};function o(n,i,a,s){var f=0,c=a("x"),p=a("y"),d=a("z"),T=h.getComponentMethod("calendars","handleTraceDefaults");return T(n,i,["x","y","z"],s),c&&p&&d&&(f=Math.min(c.length,p.length,d.length),i._length=i._xlength=i._ylength=i._zlength=f),f}}}),hP=Ge({"src/traces/scatter3d/calc.js"($,G){var h=s0(),b=tp();G.exports=function(E,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return h(t,e),b(E,e),t}}}),vP=Ge({"node_modules/get-canvas-context/index.js"($,G){G.exports=h;function h(b,S){if(typeof b!="string")throw new TypeError("must specify type string");if(S=S||{},typeof document>"u"&&!S.canvas)return null;var E=S.canvas||document.createElement("canvas");typeof S.width=="number"&&(E.width=S.width),typeof S.height=="number"&&(E.height=S.height);var e=S,t;try{var r=[b];b.indexOf("webgl")===0&&r.push("experimental-"+b);for(var o=0;o/g," "));i[a]=p,s.tickmode=f}}r.ticks=i;for(var a=0;a<3;++a){.5*(t.glplot.bounds[0][a]+t.glplot.bounds[1][a]);for(var d=0;d<2;++d)r.bounds[d][a]=t.glplot.bounds[d][a]}t.contourLevels=E(i)}}}),yP=Ge({"src/plots/gl3d/scene.js"($,G){var h=sd().gl_plot3d,b=h.createCamera,S=h.createScene,E=dP(),e=Hw(),t=Io(),r=yn(),o=r.preserveDrawingBuffer(),n=Ss(),i=qf(),a=jy(),s=Fk(),f=lg(),c=pP(),p=mP(),d=gP(),T=Rp().applyAutorangeOptions,l,g,x=!1;function A(z,F){var N=document.createElement("div"),B=z.container;this.graphDiv=z.graphDiv;var R=document.createElementNS("http://www.w3.org/2000/svg","svg");R.style.position="absolute",R.style.top=R.style.left="0px",R.style.width=R.style.height="100%",R.style["z-index"]=20,R.style["pointer-events"]="none",N.appendChild(R),this.svgContainer=R,N.id=z.id,N.style.position="absolute",N.style.top=N.style.left="0px",N.style.width=N.style.height="100%",B.appendChild(N),this.fullLayout=F,this.id=z.id||"scene",this.fullSceneLayout=F[this.id],this.plotArgs=[[],{},{}],this.axesOptions=c(F,F[this.id]),this.spikeOptions=p(F[this.id]),this.container=N,this.staticMode=!!z.staticPlot,this.pixelRatio=this.pixelRatio||z.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=t.getComponentMethod("annotations3d","convert"),this.drawAnnotations=t.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var M=A.prototype;M.prepareOptions=function(){var z=this,F={canvas:z.canvas,gl:z.gl,glOptions:{preserveDrawingBuffer:o,premultipliedAlpha:!0,antialias:!0},container:z.container,axes:z.axesOptions,spikes:z.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:z.camera,pixelRatio:z.pixelRatio};if(z.staticMode){if(!g&&(l=document.createElement("canvas"),g=E({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!g))throw new Error("error creating static canvas/context for image server");F.gl=g,F.canvas=l}return F};var _=!0;M.tryCreatePlot=function(){var z=this,F=z.prepareOptions(),N=!0;try{z.glplot=S(F)}catch{if(z.staticMode||!_||o)N=!1;else{r.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{o=F.glOptions.preserveDrawingBuffer=!0,z.glplot=S(F)}catch{o=F.glOptions.preserveDrawingBuffer=!1,N=!1}}}return _=!1,N},M.initializeGLCamera=function(){var z=this,F=z.fullSceneLayout.camera,N=F.projection.type==="orthographic";z.camera=b(z.container,{center:[F.center.x,F.center.y,F.center.z],eye:[F.eye.x,F.eye.y,F.eye.z],up:[F.up.x,F.up.y,F.up.z],_ortho:N,zoomMin:.01,zoomMax:100,mode:"orbit"})},M.initializeGLPlot=function(){var z=this;z.initializeGLCamera();var F=z.tryCreatePlot();if(!F)return s(z);z.traces={},z.make4thDimension();var N=z.graphDiv,B=N.layout,R=function(){var j={};return z.isCameraChanged(B)&&(j[z.id+".camera"]=z.getCamera()),z.isAspectChanged(B)&&(j[z.id+".aspectratio"]=z.glplot.getAspectratio(),B[z.id].aspectmode!=="manual"&&(z.fullSceneLayout.aspectmode=B[z.id].aspectmode=j[z.id+".aspectmode"]="manual")),j},U=function(j){if(j.fullSceneLayout.dragmode!==!1){var Z=R();j.saveLayout(B),j.graphDiv.emit("plotly_relayout",Z)}};return z.glplot.canvas&&(z.glplot.canvas.addEventListener("mouseup",function(){U(z)}),z.glplot.canvas.addEventListener("touchstart",function(){x=!0}),z.glplot.canvas.addEventListener("wheel",function(j){if(N._context._scrollZoom.gl3d){if(z.camera._ortho){var Z=j.deltaX>j.deltaY?1.1:.9090909090909091,re=z.glplot.getAspectratio();z.glplot.setAspectratio({x:Z*re.x,y:Z*re.y,z:Z*re.z})}U(z)}},e?{passive:!1}:!1),z.glplot.canvas.addEventListener("mousemove",function(){if(z.fullSceneLayout.dragmode!==!1&&z.camera.mouseListener.buttons!==0){var j=R();z.graphDiv.emit("plotly_relayouting",j)}}),z.staticMode||z.glplot.canvas.addEventListener("webglcontextlost",function(j){N&&N.emit&&N.emit("plotly_webglcontextlost",{event:j,layer:z.id})},!1)),z.glplot.oncontextloss=function(){z.recoverContext()},z.glplot.onrender=function(){z.render()},!0},M.render=function(){var z=this,F=z.graphDiv,N,B=z.svgContainer,R=z.container.getBoundingClientRect();F._fullLayout._calcInverseTransform(F);var U=F._fullLayout._invScaleX,j=F._fullLayout._invScaleY,Z=R.width*U,re=R.height*j;B.setAttributeNS(null,"viewBox","0 0 "+Z+" "+re),B.setAttributeNS(null,"width",Z),B.setAttributeNS(null,"height",re),d(z),z.glplot.axes.update(z.axesOptions);for(var fe=Object.keys(z.traces),le=null,ce=z.glplot.selection,V=0;V")):N.type==="isosurface"||N.type==="volume"?(te.valueLabel=n.hoverLabelText(z._mockAxis,z._mockAxis.d2l(ce.traceCoordinate[3]),N.valuehoverformat),Ae.push("value: "+te.valueLabel),ce.textLabel&&Ae.push(ce.textLabel),ve=Ae.join("
")):ve=ce.textLabel;var Ce={x:ce.traceCoordinate[0],y:ce.traceCoordinate[1],z:ce.traceCoordinate[2],data:K._input,fullData:K,curveNumber:K.index,pointNumber:ue};i.appendArrayPointValue(Ce,K,ue),N._module.eventData&&(Ce=K._module.eventData(Ce,ce,K,{},ue));var Fe={points:[Ce]};if(z.fullSceneLayout.hovermode){var ze=[];i.loneHover({trace:K,x:(.5+.5*ne[0]/ne[3])*Z,y:(.5-.5*ne[1]/ne[3])*re,xLabel:te.xLabel,yLabel:te.yLabel,zLabel:te.zLabel,text:ve,name:le.name,color:i.castHoverOption(K,ue,"bgcolor")||le.color,borderColor:i.castHoverOption(K,ue,"bordercolor"),fontFamily:i.castHoverOption(K,ue,"font.family"),fontSize:i.castHoverOption(K,ue,"font.size"),fontColor:i.castHoverOption(K,ue,"font.color"),nameLength:i.castHoverOption(K,ue,"namelength"),textAlign:i.castHoverOption(K,ue,"align"),hovertemplate:r.castOption(K,ue,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Ce,te),eventData:[Ce]},{container:B,gd:F,inOut_bbox:ze}),Ce.bbox=ze[0]}ce.distance<5&&(ce.buttons||x)?F.emit("plotly_click",Fe):F.emit("plotly_hover",Fe),this.oldEventData=Fe}else i.loneUnhover(B),this.oldEventData&&F.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;z.drawAnnotations(z)},M.recoverContext=function(){var z=this;z.glplot.dispose();var F=function(){if(z.glplot.gl.isContextLost()){requestAnimationFrame(F);return}if(!z.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}z.plot.apply(z,z.plotArgs)};requestAnimationFrame(F)};var w=["xaxis","yaxis","zaxis"];function m(z,F,N){for(var B=z.fullSceneLayout,R=0;R<3;R++){var U=w[R],j=U.charAt(0),Z=B[U],re=F[j],fe=F[j+"calendar"],le=F["_"+j+"length"];if(!r.isArrayOrTypedArray(re))N[0][R]=Math.min(N[0][R],0),N[1][R]=Math.max(N[1][R],le-1);else for(var ce,V=0;V<(le||re.length);V++)if(r.isArrayOrTypedArray(re[V]))for(var ee=0;eeK[1][j])K[0][j]=-1,K[1][j]=1;else{var Ye=K[1][j]-K[0][j];K[0][j]-=Ye/32,K[1][j]+=Ye/32}if(te=[K[0][j],K[1][j]],te=T(te,re),K[0][j]=te[0],K[1][j]=te[1],re.isReversed()){var it=K[0][j];K[0][j]=K[1][j],K[1][j]=it}}else te=re.range,K[0][j]=re.r2l(te[0]),K[1][j]=re.r2l(te[1]);K[0][j]===K[1][j]&&(K[0][j]-=1,K[1][j]+=1),re.range=[K[0][j],K[1][j]],re.limitRange(),B.glplot.setBounds(j,{min:re.range[0]*ee[j],max:re.range[1]*ee[j]})}var st,nt=le.aspectmode;if(nt==="cube")st=[1,1,1];else if(nt==="manual"){var Qe=le.aspectratio;st=[Qe.x,Qe.y,Qe.z]}else if(nt==="auto"||nt==="data"){var Le=[1,1,1];for(j=0;j<3;++j){re=le[w[j]],fe=re.type;var Te=ue[fe];Le[j]=Math.pow(Te.acc,1/Te.count)/ee[j]}nt==="data"||Math.max.apply(null,Le)/Math.min.apply(null,Le)<=4?st=Le:st=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");le.aspectratio.x=ce.aspectratio.x=st[0],le.aspectratio.y=ce.aspectratio.y=st[1],le.aspectratio.z=ce.aspectratio.z=st[2],B.glplot.setAspectratio(le.aspectratio),B.viewInitial.aspectratio||(B.viewInitial.aspectratio={x:le.aspectratio.x,y:le.aspectratio.y,z:le.aspectratio.z}),B.viewInitial.aspectmode||(B.viewInitial.aspectmode=le.aspectmode);var pe=le.domain||null,Ne=F._size||null;if(pe&&Ne){var ot=B.container.style;ot.position="absolute",ot.left=Ne.l+pe.x[0]*Ne.w+"px",ot.top=Ne.t+(1-pe.y[1])*Ne.h+"px",ot.width=Ne.w*(pe.x[1]-pe.x[0])+"px",ot.height=Ne.h*(pe.y[1]-pe.y[0])+"px"}B.glplot.redraw()}},M.destroy=function(){var z=this;z.glplot&&(z.camera.mouseListener.enabled=!1,z.container.removeEventListener("wheel",z.camera.wheelListener),z.camera=null,z.glplot.dispose(),z.container.parentNode.removeChild(z.container),z.glplot=null)};function v(z){return[[z.eye.x,z.eye.y,z.eye.z],[z.center.x,z.center.y,z.center.z],[z.up.x,z.up.y,z.up.z]]}function y(z){return{up:{x:z.up[0],y:z.up[1],z:z.up[2]},center:{x:z.center[0],y:z.center[1],z:z.center[2]},eye:{x:z.eye[0],y:z.eye[1],z:z.eye[2]},projection:{type:z._ortho===!0?"orthographic":"perspective"}}}M.getCamera=function(){var z=this;return z.camera.view.recalcMatrix(z.camera.view.lastT()),y(z.camera)},M.setViewport=function(z){var F=this,N=z.camera;F.camera.lookAt.apply(this,v(N)),F.glplot.setAspectratio(z.aspectratio);var B=N.projection.type==="orthographic",R=F.camera._ortho;B!==R&&(F.glplot.redraw(),F.glplot.clearRGBA(),F.glplot.dispose(),F.initializeGLPlot())},M.isCameraChanged=function(z){var F=this,N=F.getCamera(),B=r.nestedProperty(z,F.id+".camera"),R=B.get();function U(fe,le,ce,V){var ee=["up","center","eye"],ne=["x","y","z"];return le[ee[ce]]&&fe[ee[ce]][ne[V]]===le[ee[ce]][ne[V]]}var j=!1;if(R===void 0)j=!0;else{for(var Z=0;Z<3;Z++)for(var re=0;re<3;re++)if(!U(N,R,Z,re)){j=!0;break}(!R.projection||N.projection&&N.projection.type!==R.projection.type)&&(j=!0)}return j},M.isAspectChanged=function(z){var F=this,N=F.glplot.getAspectratio(),B=r.nestedProperty(z,F.id+".aspectratio"),R=B.get();return R===void 0||R.x!==N.x||R.y!==N.y||R.z!==N.z},M.saveLayout=function(z){var F=this,N=F.fullLayout,B,R,U,j,Z,re,fe=F.isCameraChanged(z),le=F.isAspectChanged(z),ce=fe||le;if(ce){var V={};if(fe&&(B=F.getCamera(),R=r.nestedProperty(z,F.id+".camera"),U=R.get(),V[F.id+".camera"]=U),le&&(j=F.glplot.getAspectratio(),Z=r.nestedProperty(z,F.id+".aspectratio"),re=Z.get(),V[F.id+".aspectratio"]=re),t.call("_storeDirectGUIEdit",z,N._preGUI,V),fe){R.set(B);var ee=r.nestedProperty(N,F.id+".camera");ee.set(B)}if(le){Z.set(j);var ne=r.nestedProperty(N,F.id+".aspectratio");ne.set(j),F.glplot.redraw()}}return ce},M.updateFx=function(z,F){var N=this,B=N.camera;if(B)if(z==="orbit")B.mode="orbit",B.keyBindingMode="rotate";else if(z==="turntable"){B.up=[0,0,1],B.mode="turntable",B.keyBindingMode="rotate";var R=N.graphDiv,U=R._fullLayout,j=N.fullSceneLayout.camera,Z=j.up.x,re=j.up.y,fe=j.up.z;if(fe/Math.sqrt(Z*Z+re*re+fe*fe)<.999){var le=N.id+".camera.up",ce={x:0,y:0,z:1},V={};V[le]=ce;var ee=R.layout;t.call("_storeDirectGUIEdit",ee,U._preGUI,V),j.up=ce,r.nestedProperty(ee,le).set(ce)}}else B.keyBindingMode=z;N.fullSceneLayout.hovermode=F};function I(z,F,N){for(var B=0,R=N-1;B0)for(var Z=255/j,re=0;re<3;++re)z[U+re]=Math.min(Z*z[U+re],255)}}M.toImage=function(z){var F=this;z||(z="png"),F.staticMode&&F.container.appendChild(l),F.glplot.redraw();var N=F.glplot.gl,B=N.drawingBufferWidth,R=N.drawingBufferHeight;N.bindFramebuffer(N.FRAMEBUFFER,null);var U=new Uint8Array(B*R*4);N.readPixels(0,0,B,R,N.RGBA,N.UNSIGNED_BYTE,U),I(U,B,R),L(U,B,R);var j=document.createElement("canvas");j.width=B,j.height=R;var Z=j.getContext("2d",{willReadFrequently:!0}),re=Z.createImageData(B,R);re.data.set(U),Z.putImageData(re,0,0);var fe;switch(z){case"jpeg":fe=j.toDataURL("image/jpeg");break;case"webp":fe=j.toDataURL("image/webp");break;default:fe=j.toDataURL("image/png")}return F.staticMode&&F.container.removeChild(l),fe},M.setConvert=function(){for(var z=this,F=0;F<3;F++){var N=z.fullSceneLayout[w[F]];n.setConvert(N,z.fullLayout),N.setScale=r.noop}},M.make4thDimension=function(){var z=this,F=z.graphDiv,N=F._fullLayout;z._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},n.setConvert(z._mockAxis,N)},G.exports=A}}),_P=Ge({"src/plots/gl3d/layout/attributes.js"($,G){G.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),Bk=Ge({"src/plots/gl3d/layout/axis_attributes.js"($,G){var h=So(),b=tv(),S=Qi().extendFlat,E=Uc().overrideAll;G.exports=E({visible:b.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:h.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:b.color,categoryorder:b.categoryorder,categoryarray:b.categoryarray,title:{text:b.title.text,font:b.title.font},type:S({},b.type,{values:["-","linear","log","date","category"]}),autotypenumbers:b.autotypenumbers,autorange:b.autorange,autorangeoptions:{minallowed:b.autorangeoptions.minallowed,maxallowed:b.autorangeoptions.maxallowed,clipmin:b.autorangeoptions.clipmin,clipmax:b.autorangeoptions.clipmax,include:b.autorangeoptions.include,editType:"plot"},rangemode:b.rangemode,minallowed:b.minallowed,maxallowed:b.maxallowed,range:S({},b.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:b.minor.tickmode,nticks:b.nticks,tick0:b.tick0,dtick:b.dtick,tickvals:b.tickvals,ticktext:b.ticktext,ticks:b.ticks,mirror:b.mirror,ticklen:b.ticklen,tickwidth:b.tickwidth,tickcolor:b.tickcolor,showticklabels:b.showticklabels,labelalias:b.labelalias,tickfont:b.tickfont,tickangle:b.tickangle,tickprefix:b.tickprefix,showtickprefix:b.showtickprefix,ticksuffix:b.ticksuffix,showticksuffix:b.showticksuffix,showexponent:b.showexponent,exponentformat:b.exponentformat,minexponent:b.minexponent,separatethousands:b.separatethousands,tickformat:b.tickformat,tickformatstops:b.tickformatstops,hoverformat:b.hoverformat,showline:b.showline,linecolor:b.linecolor,linewidth:b.linewidth,showgrid:b.showgrid,gridcolor:S({},b.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:b.gridwidth,zeroline:b.zeroline,zerolinecolor:b.zerolinecolor,zerolinewidth:b.zerolinewidth},"plot","from-root")}}),Nk=Ge({"src/plots/gl3d/layout/layout_attributes.js"($,G){var h=Bk(),b=Sc().attributes,S=Qi().extendFlat,E=yn().counterRegex;function e(t,r,o){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:o,editType:"camera"},editType:"camera"}}G.exports={_arrayAttrRegexps:[E("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:S(e(0,0,1),{}),center:S(e(0,0,0),{}),eye:S(e(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:b({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:h,yaxis:h,zaxis:h,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),xP=Ge({"src/plots/gl3d/layout/axis_defaults.js"($,G){var h=ks().mix,b=yn(),S=mu(),E=Bk(),e=zv(),t=Np(),r=["xaxis","yaxis","zaxis"],o=13600/187;G.exports=function(i,a,s){var f,c;function p(l,g){return b.coerce(f,c,E,l,g)}for(var d=0;d1;function p(d){if(!c){var T=h.validate(a[d],t[d]);if(T)return a[d]}}E(a,s,f,{type:o,attributes:t,handleDefaults:n,fullLayout:s,font:s.font,fullData:f,getDfltFromLayout:p,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function n(i,a,s,f){for(var c=s("bgcolor"),p=b.combine(c,f.paper_bgcolor),d=["up","center","eye"],T=0;T.999)&&(M="turntable")}else M="turntable";s("dragmode",M),s("hovermode",f.getDfltFromLayout("hovermode"))}}}),P_=Ge({"src/plots/gl3d/index.js"($){var G=Uc().overrideAll,h=Ju(),b=yP(),S=Iv().getSubplotData,E=yn(),e=Ad(),t="gl3d",r="scene";$.name=t,$.attr=r,$.idRoot=r,$.idRegex=$.attrRegex=E.counterRegex("scene"),$.attributes=_P(),$.layoutAttributes=Nk(),$.baseLayoutAttrOverrides=G({hoverlabel:h.hoverlabel},"plot","nested"),$.supplyLayoutDefaults=bP(),$.plot=function(n){for(var i=n._fullLayout,a=n._fullData,s=i._subplots[t],f=0;f0){I=f[L];break}return I}function T(v,y){if(!(v<1||y<1)){for(var I=p(v),L=p(y),z=1,F=0;FA;)L--,L/=d(L),L++,L1?z:1};function M(v,y,I){var L=I[8]+I[2]*y[0]+I[5]*y[1];return v[0]=(I[6]+I[0]*y[0]+I[3]*y[1])/L,v[1]=(I[7]+I[1]*y[0]+I[4]*y[1])/L,v}function _(v,y,I){return w(v,y,M,I),v}function w(v,y,I,L){for(var z=[0,0],F=v.shape[0],N=v.shape[1],B=0;B0&&this.contourStart[L]!==null&&this.contourEnd[L]!==null&&this.contourEnd[L]>this.contourStart[L]))for(y[L]=!0,z=this.contourStart[L];zre&&(this.minValues[U]=re),this.maxValues[U]f&&(o.isomin=null,o.isomax=null);var c=a("x"),p=a("y"),d=a("z"),T=a("value");if(!c||!c.length||!p||!p.length||!d||!d.length||!T||!T.length){o.visible=!1;return}var l=b.getComponentMethod("calendars","handleTraceDefaults");l(r,o,["x","y","z"],i),a("valuehoverformat"),["x","y","z"].forEach(function(M){a(M+"hoverformat");var _="caps."+M,w=a(_+".show");w&&a(_+".fill");var m="slices."+M,u=a(m+".show");u&&(a(m+".fill"),a(m+".locations"))});var g=a("spaceframe.show");g&&a("spaceframe.fill");var x=a("surface.show");x&&(a("surface.count"),a("surface.fill"),a("surface.pattern"));var A=a("contour.show");A&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(M){a(M)}),E(r,o,i,a,{prefix:"",cLetter:"c"}),o._length=null}G.exports={supplyDefaults:e,supplyIsoDefaults:t}}}),lE=Ge({"src/traces/streamtube/calc.js"($,G){var h=yn(),b=pv();function S(r,o){o._len=Math.min(o.u.length,o.v.length,o.w.length,o.x.length,o.y.length,o.z.length),o._u=t(o.u,o._len),o._v=t(o.v,o._len),o._w=t(o.w,o._len),o._x=t(o.x,o._len),o._y=t(o.y,o._len),o._z=t(o.z,o._len);var n=E(o);o._gridFill=n.fill,o._Xs=n.Xs,o._Ys=n.Ys,o._Zs=n.Zs,o._len=n.len;var i=0,a,s,f;o.starts&&(a=t(o.starts.x||[]),s=t(o.starts.y||[]),f=t(o.starts.z||[]),i=Math.min(a.length,s.length,f.length)),o._startsX=a||[],o._startsY=s||[],o._startsZ=f||[];var c=0,p=1/0,d;for(d=0;d1&&(u=o[a-1],y=n[a-1],L=i[a-1]),s=0;su?"-":"+")+"x"),A=A.replace("y",(v>y?"-":"+")+"y"),A=A.replace("z",(I>L?"-":"+")+"z");var B=function(){a=0,z=[],F=[],N=[]};(!a||a0;p--){var d=Math.min(c[p],c[p-1]),T=Math.max(c[p],c[p-1]);if(T>d&&d-1}function ae(Mt,je){return Mt===null?je:Mt}function ie(Mt,je,$e){fe();var Ee=[je],xe=[$e];if(K>=1)Ee=[je],xe=[$e];else if(K>0){var ye=te(je,$e);Ee=ye.xyzv,xe=ye.abc}for(var Me=0;Me-1?$e[Je]:re(Lt,Ct,Ot);_r>-1?Xe[Je]=_r:Xe[Je]=ce(Lt,Ct,Ot,ae(Mt,Wt))}V(Xe[0],Xe[1],Xe[2])}}function ve(Mt,je,$e){var Ee=function(xe,ye,Me){ie(Mt,[je[xe],je[ye],je[Me]],[$e[xe],$e[ye],$e[Me]])};Ee(0,1,2),Ee(2,3,0)}function Ae(Mt,je,$e){var Ee=function(xe,ye,Me){ie(Mt,[je[xe],je[ye],je[Me]],[$e[xe],$e[ye],$e[Me]])};Ee(0,1,2),Ee(3,0,1),Ee(2,3,0),Ee(1,2,3)}function Ce(Mt,je,$e,Ee){var xe=Mt[3];xe<$e&&(xe=$e),xe>Ee&&(xe=Ee);for(var ye=(Mt[3]-xe)/(Mt[3]-je[3]+1e-9),Me=[],Xe=0;Xe<4;Xe++)Me[Xe]=(1-ye)*Mt[Xe]+ye*je[Xe];return Me}function Fe(Mt,je,$e){return Mt>=je&&Mt<=$e}function ze(Mt){var je=.001*(B-N);return Mt>=N-je&&Mt<=B+je}function Ye(Mt){for(var je=[],$e=0;$e<4;$e++){var Ee=Mt[$e];je.push([f._x[Ee],f._y[Ee],f._z[Ee],f._value[Ee]])}return je}var it=3;function st(Mt,je,$e,Ee,xe,ye){ye||(ye=1),$e=[-1,-1,-1];var Me=!1,Xe=[Fe(je[0][3],Ee,xe),Fe(je[1][3],Ee,xe),Fe(je[2][3],Ee,xe)];if(!Xe[0]&&!Xe[1]&&!Xe[2])return!1;var Je=function(Ct,Ot,Wt){return ze(Ot[0][3])&&ze(Ot[1][3])&&ze(Ot[2][3])?(ie(Ct,Ot,Wt),!0):yeXe?[z,ye]:[ye,F];$t(je,Je[0],Je[1])}}var Lt=[[Math.min(N,F),Math.max(N,F)],[Math.min(z,B),Math.max(z,B)]];["x","y","z"].forEach(function(Ct){for(var Ot=[],Wt=0;Wt0&&(Kn.push(ra.id),Ct==="x"?qn.push([ra.distRatio,0,0]):Ct==="y"?qn.push([0,ra.distRatio,0]):qn.push([0,0,ra.distRatio]))}else Ct==="x"?En=Wr(1,u-1):Ct==="y"?En=Wr(1,v-1):En=Wr(1,y-1);Kn.length>0&&(Ct==="x"?Ot[_r]=rr(Mt,Kn,pr,hr,qn,Ot[_r]):Ct==="y"?Ot[_r]=Er(Mt,Kn,pr,hr,qn,Ot[_r]):Ot[_r]=Mr(Mt,Kn,pr,hr,qn,Ot[_r]),_r++),En.length>0&&(Ct==="x"?Ot[_r]=ot(Mt,En,pr,hr,Ot[_r]):Ct==="y"?Ot[_r]=ft(Mt,En,pr,hr,Ot[_r]):Ot[_r]=rt(Mt,En,pr,hr,Ot[_r]),_r++)}var Nn=f.caps[Ct];Nn.show&&Nn.fill&&(ue(Nn.fill),Ct==="x"?Ot[_r]=ot(Mt,[0,u-1],pr,hr,Ot[_r]):Ct==="y"?Ot[_r]=ft(Mt,[0,v-1],pr,hr,Ot[_r]):Ot[_r]=rt(Mt,[0,y-1],pr,hr,Ot[_r]),_r++)}}),x===0&&le(),f._meshX=R,f._meshY=U,f._meshZ=j,f._meshIntensity=Z,f._Xs=_,f._Ys=w,f._Zs=m}return Br(),f}function s(f,c){var p=f.glplot.gl,d=h({gl:p}),T=new o(f,d,c.uid);return d._trace=T,T.update(c),f.glplot.add(d),T}G.exports={findNearestOnAxis:r,generateIsoMeshes:a,createIsosurfaceTrace:s}}}),kP=Ge({"src/traces/isosurface/index.js"($,G){G.exports={attributes:sE(),supplyDefaults:jk().supplyDefaults,calc:qk(),colorbar:{min:"cmin",max:"cmax"},plot:uE().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:P_(),categories:["gl3d","showLegend"],meta:{}}}}),CP=Ge({"lib/isosurface.js"($,G){G.exports=kP()}}),Vk=Ge({"src/traces/volume/attributes.js"($,G){var h=Ru(),b=sE(),S=GA(),E=nu(),e=Qi().extendFlat,t=Uc().overrideAll,r=G.exports=t(e({x:b.x,y:b.y,z:b.z,value:b.value,isomin:b.isomin,isomax:b.isomax,surface:b.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:b.slices,caps:b.caps,text:b.text,hovertext:b.hovertext,xhoverformat:b.xhoverformat,yhoverformat:b.yhoverformat,zhoverformat:b.zhoverformat,valuehoverformat:b.valuehoverformat,hovertemplate:b.hovertemplate,hovertemplatefallback:b.hovertemplatefallback},h("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:b.colorbar,opacity:b.opacity,opacityscale:S.opacityscale,lightposition:b.lightposition,lighting:b.lighting,flatshading:b.flatshading,contour:b.contour,hoverinfo:e({},E.hoverinfo),showlegend:e({},E.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}}),LP=Ge({"src/traces/volume/defaults.js"($,G){var h=yn(),b=Vk(),S=jk().supplyIsoDefaults,E=Uk().opacityscaleDefaults;G.exports=function(t,r,o,n){function i(a,s){return h.coerce(t,r,b,a,s)}S(t,r,o,n,i),E(t,r,n,i)}}}),PP=Ge({"src/traces/volume/convert.js"($,G){var h=sd().gl_mesh3d,b=qy().parseColorScale,S=yn().isArrayOrTypedArray,E=jy(),e=Ac().extractOpts,t=F3(),r=uE().findNearestOnAxis,o=uE().generateIsoMeshes;function n(s,f,c){this.scene=s,this.uid=c,this.mesh=f,this.name="",this.data=null,this.showContour=!1}var i=n.prototype;i.handlePick=function(s){if(s.object===this.mesh){var f=s.data.index,c=this.data._meshX[f],p=this.data._meshY[f],d=this.data._meshZ[f],T=this.data._Ys.length,l=this.data._Zs.length,g=r(c,this.data._Xs).id,x=r(p,this.data._Ys).id,A=r(d,this.data._Zs).id,M=s.index=A+l*x+l*T*g;s.traceCoordinate=[this.data._meshX[M],this.data._meshY[M],this.data._meshZ[M],this.data._value[M]];var _=this.data.hovertext||this.data.text;return S(_)&&_[M]!==void 0?s.textLabel=_[M]:_&&(s.textLabel=_),!0}},i.update=function(s){var f=this.scene,c=f.fullSceneLayout;this.data=o(s);function p(x,A,M,_){return A.map(function(w){return x.d2l(w,0,_)*M})}var d=t(p(c.xaxis,s._meshX,f.dataScale[0],s.xcalendar),p(c.yaxis,s._meshY,f.dataScale[1],s.ycalendar),p(c.zaxis,s._meshZ,f.dataScale[2],s.zcalendar)),T=t(s._meshI,s._meshJ,s._meshK),l={positions:d,cells:T,lightPosition:[s.lightposition.x,s.lightposition.y,s.lightposition.z],ambient:s.lighting.ambient,diffuse:s.lighting.diffuse,specular:s.lighting.specular,roughness:s.lighting.roughness,fresnel:s.lighting.fresnel,vertexNormalsEpsilon:s.lighting.vertexnormalsepsilon,faceNormalsEpsilon:s.lighting.facenormalsepsilon,opacity:s.opacity,opacityscale:s.opacityscale,contourEnable:s.contour.show,contourColor:E(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},g=e(s);l.vertexIntensity=s._meshIntensity,l.vertexIntensityBounds=[g.min,g.max],l.colormap=b(s),this.mesh.update(l)},i.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function a(s,f){var c=s.glplot.gl,p=h({gl:c}),d=new n(s,p,f.uid);return p._trace=d,d.update(f),s.glplot.add(p),d}G.exports=a}}),RP=Ge({"src/traces/volume/index.js"($,G){G.exports={attributes:Vk(),supplyDefaults:LP(),calc:qk(),colorbar:{min:"cmin",max:"cmax"},plot:PP(),moduleType:"trace",name:"volume",basePlotModule:P_(),categories:["gl3d","showLegend"],meta:{}}}}),IP=Ge({"lib/volume.js"($,G){G.exports=RP()}}),DP=Ge({"src/traces/mesh3d/defaults.js"($,G){var h=Io(),b=yn(),S=dh(),E=O3();G.exports=function(t,r,o,n){function i(p,d){return b.coerce(t,r,E,p,d)}function a(p){var d=p.map(function(T){var l=i(T);return l&&b.isArrayOrTypedArray(l)?l:null});return d.every(function(T){return T&&T.length===d[0].length})&&d}var s=a(["x","y","z"]);if(!s){r.visible=!1;return}if(a(["i","j","k"]),r.i&&(!r.j||!r.k)||r.j&&(!r.k||!r.i)||r.k&&(!r.i||!r.j)){r.visible=!1;return}var f=h.getComponentMethod("calendars","handleTraceDefaults");f(t,r,["x","y","z"],n),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(p){i(p)});var c=i("contour.show");c&&(i("contour.color"),i("contour.width")),"intensity"in t?(i("intensity"),i("intensitymode"),S(t,r,n,i,{prefix:"",cLetter:"c"})):(r.showscale=!1,"facecolor"in t?i("facecolor"):"vertexcolor"in t?i("vertexcolor"):i("color",o)),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),r._length=null}}}),zP=Ge({"src/traces/mesh3d/calc.js"($,G){var h=pv();G.exports=function(S,E){E.intensity&&h(S,E,{vals:E.intensity,containerStr:"",cLetter:"c"})}}}),OP=Ge({"src/traces/mesh3d/convert.js"($,G){var h=sd().gl_mesh3d,b=sd().delaunay_triangulate,S=sd().alpha_shape,E=sd().convex_hull,e=qy().parseColorScale,t=yn().isArrayOrTypedArray,r=jy(),o=Ac().extractOpts,n=F3();function i(l,g,x){this.scene=l,this.uid=x,this.mesh=g,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var a=i.prototype;a.handlePick=function(l){if(l.object===this.mesh){var g=l.index=l.data.index;l.data._cellCenter?l.traceCoordinate=l.data.dataCoordinate:l.traceCoordinate=[this.data.x[g],this.data.y[g],this.data.z[g]];var x=this.data.hovertext||this.data.text;return t(x)&&x[g]!==void 0?l.textLabel=x[g]:x&&(l.textLabel=x),!0}};function s(l){for(var g=[],x=l.length,A=0;A=g-.5)return!1;return!0}a.update=function(l){var g=this.scene,x=g.fullSceneLayout;this.data=l;var A=l.x.length,M=n(f(x.xaxis,l.x,g.dataScale[0],l.xcalendar),f(x.yaxis,l.y,g.dataScale[1],l.ycalendar),f(x.zaxis,l.z,g.dataScale[2],l.zcalendar)),_;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!d(l.i,A)||!d(l.j,A)||!d(l.k,A))return;_=n(c(l.i),c(l.j),c(l.k))}else l.alphahull===0?_=E(M):l.alphahull>0?_=S(l.alphahull,M):_=p(l.delaunayaxis,M);var w={positions:M,cells:_,lightPosition:[l.lightposition.x,l.lightposition.y,l.lightposition.z],ambient:l.lighting.ambient,diffuse:l.lighting.diffuse,specular:l.lighting.specular,roughness:l.lighting.roughness,fresnel:l.lighting.fresnel,vertexNormalsEpsilon:l.lighting.vertexnormalsepsilon,faceNormalsEpsilon:l.lighting.facenormalsepsilon,opacity:l.opacity,contourEnable:l.contour.show,contourColor:r(l.contour.color).slice(0,3),contourWidth:l.contour.width,useFacetNormals:l.flatshading};if(l.intensity){var m=o(l);this.color="#fff";var u=l.intensitymode;w[u+"Intensity"]=l.intensity,w[u+"IntensityBounds"]=[m.min,m.max],w.colormap=e(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],w.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],w.cellColors=s(l.facecolor)):(this.color=l.color,w.meshColor=r(l.color));this.mesh.update(w)},a.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function T(l,g){var x=l.glplot.gl,A=h({gl:x}),M=new i(l,A,g.uid);return A._trace=M,M.update(g),l.glplot.add(A),M}G.exports=T}}),FP=Ge({"src/traces/mesh3d/index.js"($,G){G.exports={attributes:O3(),supplyDefaults:DP(),calc:zP(),colorbar:{min:"cmin",max:"cmax"},plot:OP(),moduleType:"trace",name:"mesh3d",basePlotModule:P_(),categories:["gl3d","showLegend"],meta:{}}}}),BP=Ge({"lib/mesh3d.js"($,G){G.exports=FP()}}),Hk=Ge({"src/traces/cone/attributes.js"($,G){var h=Ru(),b=hc().axisHoverFormat,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=O3(),t=nu(),r=Qi().extendFlat,o={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:S({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:E({editType:"calc"}),uhoverformat:b("u",1),vhoverformat:b("v",1),whoverformat:b("w",1),xhoverformat:b("x"),yhoverformat:b("y"),zhoverformat:b("z"),showlegend:r({},t.showlegend,{dflt:!1})};r(o,h("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var n=["opacity","lightposition","lighting"];n.forEach(function(i){o[i]=e[i]}),o.hoverinfo=r({},t.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),G.exports=o}}),NP=Ge({"src/traces/cone/defaults.js"($,G){var h=yn(),b=dh(),S=Hk();G.exports=function(e,t,r,o){function n(T,l){return h.coerce(e,t,S,T,l)}var i=n("u"),a=n("v"),s=n("w"),f=n("x"),c=n("y"),p=n("z");if(!i||!i.length||!a||!a.length||!s||!s.length||!f||!f.length||!c||!c.length||!p||!p.length){t.visible=!1;return}var d=n("sizemode");n("sizeref",d==="raw"?1:.5),n("anchor"),n("lighting.ambient"),n("lighting.diffuse"),n("lighting.specular"),n("lighting.roughness"),n("lighting.fresnel"),n("lightposition.x"),n("lightposition.y"),n("lightposition.z"),b(e,t,o,n,{prefix:"",cLetter:"c"}),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback"),n("uhoverformat"),n("vhoverformat"),n("whoverformat"),n("xhoverformat"),n("yhoverformat"),n("zhoverformat"),t._length=null}}}),UP=Ge({"src/traces/cone/calc.js"($,G){var h=pv();G.exports=function(S,E){for(var e=E.u,t=E.v,r=E.w,o=Math.min(E.x.length,E.y.length,E.z.length,e.length,t.length,r.length),n=-1/0,i=1/0,a=0;a2?d=c.slice(1,p-1):p===2?d=[(c[0]+c[1])/2]:d=c,d}function a(c){var p=c.length;return p===1?[.5,.5]:[c[1]-c[0],c[p-1]-c[p-2]]}function s(c,p){var d=c.fullSceneLayout,T=c.dataScale,l=p._len,g={};function x(ce,V){var ee=d[V],ne=T[r[V]];return S.simpleMap(ce,function(K){return ee.d2l(K)*ne})}if(g.vectors=t(x(p._u,"xaxis"),x(p._v,"yaxis"),x(p._w,"zaxis"),l),!l)return{positions:[],cells:[]};var A=x(p._Xs,"xaxis"),M=x(p._Ys,"yaxis"),_=x(p._Zs,"zaxis");g.meshgrid=[A,M,_],g.gridFill=p._gridFill;var w=p._slen;if(w)g.startingPositions=t(x(p._startsX,"xaxis"),x(p._startsY,"yaxis"),x(p._startsZ,"zaxis"));else{for(var m=M[0],u=i(A),v=i(_),y=new Array(u.length*v.length),I=0,L=0;Lm&&(m=I[0]),I[1]u&&(u=I[1])}function y(I){switch(I.type){case"GeometryCollection":I.geometries.forEach(y);break;case"Point":v(I.coordinates);break;case"MultiPoint":I.coordinates.forEach(v);break}}x.arcs.forEach(function(I){for(var L=-1,z=I.length,F;++Lm&&(m=F[0]),F[1]u&&(u=F[1])});for(M in x.objects)y(x.objects[M]);return[_,w,m,u]}function e(x,A){for(var M,_=x.length,w=_-A;w<--_;)M=x[w],x[w++]=x[_],x[_]=M}function t(x,A){return typeof A=="string"&&(A=x.objects[A]),A.type==="GeometryCollection"?{type:"FeatureCollection",features:A.geometries.map(function(M){return r(x,M)})}:r(x,A)}function r(x,A){var M=A.id,_=A.bbox,w=A.properties==null?{}:A.properties,m=o(x,A);return M==null&&_==null?{type:"Feature",properties:w,geometry:m}:_==null?{type:"Feature",id:M,properties:w,geometry:m}:{type:"Feature",id:M,bbox:_,properties:w,geometry:m}}function o(x,A){var M=S(x.transform),_=x.arcs;function w(L,z){z.length&&z.pop();for(var F=_[L<0?~L:L],N=0,B=F.length;N1)_=s(x,A,M);else for(w=0,_=new Array(m=x.arcs.length);w1)for(var z=1,F=v(I[0]),N,B;zF&&(B=I[0],I[0]=I[z],I[z]=B,F=N);return I}).filter(function(y){return y.length>0})}}function d(x,A){for(var M=0,_=x.length;M<_;){var w=M+_>>>1;x[w]=2))throw new Error("n must be ≥2");y=x.bbox||E(x);var M=y[0],_=y[1],w=y[2],m=y[3],u;A={scale:[w-M?(w-M)/(u-1):1,m-_?(m-_)/(u-1):1],translate:[M,_]}}else y=x.bbox;var v=l(A),y,I,L=x.objects,z={};function F(R){return v(R)}function N(R){var U;switch(R.type){case"GeometryCollection":U={type:"GeometryCollection",geometries:R.geometries.map(N)};break;case"Point":U={type:"Point",coordinates:F(R.coordinates)};break;case"MultiPoint":U={type:"MultiPoint",coordinates:R.coordinates.map(F)};break;default:return R}return R.id!=null&&(U.id=R.id),R.bbox!=null&&(U.bbox=R.bbox),R.properties!=null&&(U.properties=R.properties),U}function B(R){var U=0,j=1,Z=R.length,re,fe=new Array(Z);for(fe[0]=v(R[0],0);++U0&&(E.push(e),e=[])}return e.length>0&&E.push(e),E},$.makeLine=function(h){return h.length===1?{type:"LineString",coordinates:h[0]}:{type:"MultiLineString",coordinates:h}},$.makePolygon=function(h){if(h.length===1)return{type:"Polygon",coordinates:h};for(var b=new Array(h.length),S=0;Se(N,z)),F)}function r(L,z,F={}){for(const B of L){if(B.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(B[B.length-1].length!==B[0].length)throw new Error("First and last Position are not equivalent.");for(let R=0;Rr(N,z)),F)}function n(L,z,F={}){if(L.length<2)throw new Error("coordinates must be an array of two or more positions");return S({type:"LineString",coordinates:L},z,F)}function i(L,z,F={}){return a(L.map(N=>n(N,z)),F)}function a(L,z={}){const F={type:"FeatureCollection"};return z.id&&(F.id=z.id),z.bbox&&(F.bbox=z.bbox),F.features=L,F}function s(L,z,F={}){return S({type:"MultiLineString",coordinates:L},z,F)}function f(L,z,F={}){return S({type:"MultiPoint",coordinates:L},z,F)}function c(L,z,F={}){return S({type:"MultiPolygon",coordinates:L},z,F)}function p(L,z,F={}){return S({type:"GeometryCollection",geometries:L},z,F)}function d(L,z=0){if(z&&!(z>=0))throw new Error("precision must be a positive number");const F=Math.pow(10,z||0);return Math.round(L*F)/F}function T(L,z="kilometers"){const F=h[z];if(!F)throw new Error(z+" units is invalid");return L*F}function l(L,z="kilometers"){const F=h[z];if(!F)throw new Error(z+" units is invalid");return L/F}function g(L,z){return M(l(L,z))}function x(L){let z=L%360;return z<0&&(z+=360),z}function A(L){return L=L%360,L>180?L-360:L<-180?L+360:L}function M(L){return L%(2*Math.PI)*180/Math.PI}function _(L){return L%360*Math.PI/180}function w(L,z="kilometers",F="kilometers"){if(!(L>=0))throw new Error("length must be a positive number");return T(l(L,z),F)}function m(L,z="meters",F="kilometers"){if(!(L>=0))throw new Error("area must be a positive number");const N=b[z];if(!N)throw new Error("invalid original units");const B=b[F];if(!B)throw new Error("invalid final units");return L/N*B}function u(L){return!isNaN(L)&&L!==null&&!Array.isArray(L)}function v(L){return L!==null&&typeof L=="object"&&!Array.isArray(L)}function y(L){if(!L)throw new Error("bbox is required");if(!Array.isArray(L))throw new Error("bbox must be an Array");if(L.length!==4&&L.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");L.forEach(z=>{if(!u(z))throw new Error("bbox must only contain numbers")})}function I(L){if(!L)throw new Error("id is required");if(["string","number"].indexOf(typeof L)===-1)throw new Error("id must be a number or a string")}$.areaFactors=b,$.azimuthToBearing=A,$.bearingToAzimuth=x,$.convertArea=m,$.convertLength=w,$.degreesToRadians=_,$.earthRadius=G,$.factors=h,$.feature=S,$.featureCollection=a,$.geometry=E,$.geometryCollection=p,$.isNumber=u,$.isObject=v,$.lengthToDegrees=g,$.lengthToRadians=l,$.lineString=n,$.lineStrings=i,$.multiLineString=s,$.multiPoint=f,$.multiPolygon=c,$.point=e,$.points=t,$.polygon=r,$.polygons=o,$.radiansToDegrees=M,$.radiansToLength=T,$.round=d,$.validateBBox=y,$.validateId=I}}),vE=Ge({"node_modules/@turf/meta/dist/cjs/index.cjs"($){Object.defineProperty($,"__esModule",{value:!0});var G=hE();function h(l,g,x){if(l!==null)for(var A,M,_,w,m,u,v,y=0,I=0,L,z=l.type,F=z==="FeatureCollection",N=z==="Feature",B=F?l.features.length:1,R=0;Ru||F>v||N>y){m=I,u=A,v=F,y=N,_=0;return}var B=G.lineString.call(void 0,[m,I],x.properties);if(g(B,A,M,N,_)===!1)return!1;_++,m=I})===!1)return!1}}})}function f(l,g,x){var A=x,M=!1;return s(l,function(_,w,m,u,v){M===!1&&x===void 0?A=_:A=g(A,_,w,m,u,v),M=!0}),A}function c(l,g){if(!l)throw new Error("geojson is required");i(l,function(x,A,M){if(x.geometry!==null){var _=x.geometry.type,w=x.geometry.coordinates;switch(_){case"LineString":if(g(x,A,M,0,0)===!1)return!1;break;case"Polygon":for(var m=0;mi+S(a),0)}function S(n){let i=0,a;switch(n.type){case"Polygon":return E(n.coordinates);case"MultiPolygon":for(a=0;a0){i+=Math.abs(r(n[0]));for(let a=1;a=i?(s+2)%i:s+2],d=f[0]*t,T=c[1]*t,l=p[0]*t;a+=(l-d)*Math.sin(T),s++}return a*e}var o=b;$.area=b,$.default=o}}),JP=Ge({"node_modules/@turf/centroid/dist/cjs/index.cjs"($){Object.defineProperty($,"__esModule",{value:!0});var G=hE(),h=vE();function b(E,e={}){let t=0,r=0,o=0;return h.coordEach.call(void 0,E,function(n){t+=n[0],r+=n[1],o++},!0),G.point.call(void 0,[t/o,r/o],e.properties)}var S=b;$.centroid=b,$.default=S}}),QP=Ge({"node_modules/@turf/bbox/dist/cjs/index.cjs"($){Object.defineProperty($,"__esModule",{value:!0});var G=vE();function h(S,E={}){if(S.bbox!=null&&E.recompute!==!0)return S.bbox;const e=[1/0,1/0,-1/0,-1/0];return G.coordEach.call(void 0,S,t=>{e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]0&&z[F+1][0]<0)return F;return null}switch(w==="RUS"||w==="FJI"?u=function(z){var F;if(L(z)===null)F=z;else for(F=new Array(z.length),I=0;IF?N[B++]=[z[I][0]+360,z[I][1]]:I===F?(N[B++]=z[I],N[B++]=[z[I][0],-90]):N[B++]=z[I];var R=i.tester(N);R.pts.pop(),m.push(R)}:u=function(z){m.push(i.tester(z))},M.type){case"MultiPolygon":for(v=0;v<_.length;v++)for(y=0;y<_[v].length;y++)u(_[v][y]);break;case"Polygon":for(v=0;v<_.length;v++)u(_[v]);break}return m}function d(A){var M=A.geojson,_=window.PlotlyGeoAssets||{},w=typeof M=="string"?_[M]:M;return o(w)?w:(r.error("Oops ... something went wrong when fetching "+M),!1)}function T(A){var M=A[0].trace,_=d(M);if(!_)return!1;var w={},m=[],u;for(u=0;u0?R.properties.ct=l(R):R.properties.ct=[NaN,NaN],N.fIn=z,N.fOut=R,m.push(R)}else r.log(["Location",N.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete w[F]}switch(_.type){case"FeatureCollection":var I=_.features;for(u=0;um&&(m=y,_=v)}else _=M;return E(_).geometry.coordinates}function g(A){var M=window.PlotlyGeoAssets||{},_=[];function w(I){return new Promise(function(L,z){h.json(I,function(F,N){if(F){delete M[I];var B=F.status===404?'GeoJSON at URL "'+I+'" does not exist.':"Unexpected error while fetching from "+I;return z(new Error(B))}return M[I]=N,L(N)})})}function m(I){return new Promise(function(L,z){var F=0,N=setInterval(function(){if(M[I]&&M[I]!=="pending")return clearInterval(N),L(M[I]);if(F>100)return clearInterval(N),z("Unexpected error while fetching from "+I);F++},50)})}for(var u=0;u")}}}),tR=Ge({"src/traces/scattergeo/event_data.js"($,G){G.exports=function(b,S,E,e,t){b.lon=S.lon,b.lat=S.lat,b.location=S.loc?S.loc:null;var r=e[t];return r.fIn&&r.fIn.properties&&(b.properties=r.fIn.properties),b}}}),rR=Ge({"src/traces/scattergeo/select.js"($,G){var h=ou(),b=hi().BADNUM;G.exports=function(E,e){var t=E.cd,r=E.xaxis,o=E.yaxis,n=[],i=t[0].trace,a,s,f,c,p,d=!h.hasMarkers(i)&&!h.hasText(i);if(d)return[];if(e===!1)for(p=0;pK?1:ne>=K?0:NaN}function S(ne){return ne.length===1&&(ne=E(ne)),{left:function(K,ue,te,H){for(te==null&&(te=0),H==null&&(H=K.length);te>>1;ne(K[ae],ue)<0?te=ae+1:H=ae}return te},right:function(K,ue,te,H){for(te==null&&(te=0),H==null&&(H=K.length);te>>1;ne(K[ae],ue)>0?H=ae:te=ae+1}return te}}}function E(ne){return function(K,ue){return b(ne(K),ue)}}var e=S(b),t=e.right,r=e.left;function o(ne,K){K==null&&(K=n);for(var ue=0,te=ne.length-1,H=ne[0],ae=new Array(te<0?0:te);uene?1:K>=ne?0:NaN}function s(ne){return ne===null?NaN:+ne}function f(ne,K){var ue=ne.length,te=0,H=-1,ae=0,ie,ve,Ae=0;if(K==null)for(;++H1)return Ae/(te-1)}function c(ne,K){var ue=f(ne,K);return ue&&Math.sqrt(ue)}function p(ne,K){var ue=ne.length,te=-1,H,ae,ie;if(K==null){for(;++te=H)for(ae=ie=H;++teH&&(ae=H),ie=H)for(ae=ie=H;++teH&&(ae=H),ie0)return[ne];if((te=K0)for(ne=Math.ceil(ne/ve),K=Math.floor(K/ve),ie=new Array(ae=Math.ceil(K-ne+1));++H=0?(ae>=M?10:ae>=_?5:ae>=w?2:1)*Math.pow(10,H):-Math.pow(10,-H)/(ae>=M?10:ae>=_?5:ae>=w?2:1)}function v(ne,K,ue){var te=Math.abs(K-ne)/Math.max(0,ue),H=Math.pow(10,Math.floor(Math.log(te)/Math.LN10)),ae=te/H;return ae>=M?H*=10:ae>=_?H*=5:ae>=w&&(H*=2),Kze;)Ye.pop(),--it;var st=new Array(it+1),nt;for(ae=0;ae<=it;++ae)nt=st[ae]=[],nt.x0=ae>0?Ye[ae-1]:Fe,nt.x1=ae=1)return+ue(ne[te-1],te-1,ne);var te,H=(te-1)*K,ae=Math.floor(H),ie=+ue(ne[ae],ae,ne),ve=+ue(ne[ae+1],ae+1,ne);return ie+(ve-ie)*(H-ae)}}function z(ne,K,ue){return ne=l.call(ne,s).sort(b),Math.ceil((ue-K)/(2*(L(ne,.75)-L(ne,.25))*Math.pow(ne.length,-1/3)))}function F(ne,K,ue){return Math.ceil((ue-K)/(3.5*c(ne)*Math.pow(ne.length,-1/3)))}function N(ne,K){var ue=ne.length,te=-1,H,ae;if(K==null){for(;++te=H)for(ae=H;++teae&&(ae=H)}else for(;++te=H)for(ae=H;++teae&&(ae=H);return ae}function B(ne,K){var ue=ne.length,te=ue,H=-1,ae,ie=0;if(K==null)for(;++H=0;)for(ie=ne[K],ue=ie.length;--ue>=0;)ae[--H]=ie[ue];return ae}function j(ne,K){var ue=ne.length,te=-1,H,ae;if(K==null){for(;++te=H)for(ae=H;++teH&&(ae=H)}else for(;++te=H)for(ae=H;++teH&&(ae=H);return ae}function Z(ne,K){for(var ue=K.length,te=new Array(ue);ue--;)te[ue]=ne[K[ue]];return te}function re(ne,K){if(ue=ne.length){var ue,te=0,H=0,ae,ie=ne[H];for(K==null&&(K=b);++te0?1:ur<0?-1:0},m=Math.sqrt,u=Math.tan;function v(ur){return ur>1?0:ur<-1?n:Math.acos(ur)}function y(ur){return ur>1?i:ur<-1?-i:Math.asin(ur)}function I(ur){return(ur=_(ur/2))*ur}function L(){}function z(ur,Pr){ur&&N.hasOwnProperty(ur.type)&&N[ur.type](ur,Pr)}var F={Feature:function(ur,Pr){z(ur.geometry,Pr)},FeatureCollection:function(ur,Pr){for(var dn=ur.features,nn=-1,On=dn.length;++nn=0?1:-1,On=nn*dn,Ta=l(Pr),xa=_(Pr),ri=V*xa,fi=ce*Ta+ri*l(On),Ni=ri*nn*_(On);j.add(T(Ni,fi)),le=ur,ce=Ta,V=xa}function H(ur){return Z.reset(),U(ur,ee),Z*2}function ae(ur){return[T(ur[1],ur[0]),y(ur[2])]}function ie(ur){var Pr=ur[0],dn=ur[1],nn=l(dn);return[nn*l(Pr),nn*_(Pr),_(dn)]}function ve(ur,Pr){return ur[0]*Pr[0]+ur[1]*Pr[1]+ur[2]*Pr[2]}function Ae(ur,Pr){return[ur[1]*Pr[2]-ur[2]*Pr[1],ur[2]*Pr[0]-ur[0]*Pr[2],ur[0]*Pr[1]-ur[1]*Pr[0]]}function Ce(ur,Pr){ur[0]+=Pr[0],ur[1]+=Pr[1],ur[2]+=Pr[2]}function Fe(ur,Pr){return[ur[0]*Pr,ur[1]*Pr,ur[2]*Pr]}function ze(ur){var Pr=m(ur[0]*ur[0]+ur[1]*ur[1]+ur[2]*ur[2]);ur[0]/=Pr,ur[1]/=Pr,ur[2]/=Pr}var Ye,it,st,nt,Qe,Le,Te,pe,Ne=S(),ot,ft,rt={point:Ft,lineStart:$t,lineEnd:rr,polygonStart:function(){rt.point=Er,rt.lineStart=Mr,rt.lineEnd=Wr,Ne.reset(),ee.polygonStart()},polygonEnd:function(){ee.polygonEnd(),rt.point=Ft,rt.lineStart=$t,rt.lineEnd=rr,j<0?(Ye=-(st=180),it=-(nt=90)):Ne>r?nt=90:Ne<-r&&(it=-90),ft[0]=Ye,ft[1]=st},sphere:function(){Ye=-(st=180),it=-(nt=90)}};function Ft(ur,Pr){ot.push(ft=[Ye=ur,st=ur]),Prnt&&(nt=Pr)}function Nt(ur,Pr){var dn=ie([ur*c,Pr*c]);if(pe){var nn=Ae(pe,dn),On=[nn[1],-nn[0],0],Ta=Ae(On,nn);ze(Ta),Ta=ae(Ta);var xa=ur-Qe,ri=xa>0?1:-1,fi=Ta[0]*f*ri,Ni,Va=p(xa)>180;Va^(ri*Qent&&(nt=Ni)):(fi=(fi+360)%360-180,Va^(ri*Qent&&(nt=Pr))),Va?urSr(Ye,st)&&(st=ur):Sr(ur,st)>Sr(Ye,st)&&(Ye=ur):st>=Ye?(urst&&(st=ur)):ur>Qe?Sr(Ye,ur)>Sr(Ye,st)&&(st=ur):Sr(ur,st)>Sr(Ye,st)&&(Ye=ur)}else ot.push(ft=[Ye=ur,st=ur]);Prnt&&(nt=Pr),pe=dn,Qe=ur}function $t(){rt.point=Nt}function rr(){ft[0]=Ye,ft[1]=st,rt.point=Ft,pe=null}function Er(ur,Pr){if(pe){var dn=ur-Qe;Ne.add(p(dn)>180?dn+(dn>0?360:-360):dn)}else Le=ur,Te=Pr;ee.point(ur,Pr),Nt(ur,Pr)}function Mr(){ee.lineStart()}function Wr(){Er(Le,Te),ee.lineEnd(),p(Ne)>r&&(Ye=-(st=180)),ft[0]=Ye,ft[1]=st,pe=null}function Sr(ur,Pr){return(Pr-=ur)<0?Pr+360:Pr}function Br(ur,Pr){return ur[0]-Pr[0]}function Mt(ur,Pr){return ur[0]<=ur[1]?ur[0]<=Pr&&Pr<=ur[1]:PrSr(nn[0],nn[1])&&(nn[1]=On[1]),Sr(On[0],nn[1])>Sr(nn[0],nn[1])&&(nn[0]=On[0])):Ta.push(nn=On);for(xa=-1/0,dn=Ta.length-1,Pr=0,nn=Ta[dn];Pr<=dn;nn=On,++Pr)On=Ta[Pr],(ri=Sr(nn[1],On[0]))>xa&&(xa=ri,Ye=On[0],st=nn[1])}return ot=ft=null,Ye===1/0||it===1/0?[[NaN,NaN],[NaN,NaN]]:[[Ye,it],[st,nt]]}var $e,Ee,xe,ye,Me,Xe,Je,Lt,Ct,Ot,Wt,_r,pr,hr,Fr,En,Kn={sphere:L,point:qn,lineStart:ra,lineEnd:qa,polygonStart:function(){Kn.lineStart=ir,Kn.lineEnd=qt},polygonEnd:function(){Kn.lineStart=ra,Kn.lineEnd=qa}};function qn(ur,Pr){ur*=c,Pr*=c;var dn=l(Pr);ta(dn*l(ur),dn*_(ur),_(Pr))}function ta(ur,Pr,dn){++$e,xe+=(ur-xe)/$e,ye+=(Pr-ye)/$e,Me+=(dn-Me)/$e}function ra(){Kn.point=Nn}function Nn(ur,Pr){ur*=c,Pr*=c;var dn=l(Pr);hr=dn*l(ur),Fr=dn*_(ur),En=_(Pr),Kn.point=ka,ta(hr,Fr,En)}function ka(ur,Pr){ur*=c,Pr*=c;var dn=l(Pr),nn=dn*l(ur),On=dn*_(ur),Ta=_(Pr),xa=T(m((xa=Fr*Ta-En*On)*xa+(xa=En*nn-hr*Ta)*xa+(xa=hr*On-Fr*nn)*xa),hr*nn+Fr*On+En*Ta);Ee+=xa,Xe+=xa*(hr+(hr=nn)),Je+=xa*(Fr+(Fr=On)),Lt+=xa*(En+(En=Ta)),ta(hr,Fr,En)}function qa(){Kn.point=qn}function ir(){Kn.point=ar}function qt(){lr(_r,pr),Kn.point=qn}function ar(ur,Pr){_r=ur,pr=Pr,ur*=c,Pr*=c,Kn.point=lr;var dn=l(Pr);hr=dn*l(ur),Fr=dn*_(ur),En=_(Pr),ta(hr,Fr,En)}function lr(ur,Pr){ur*=c,Pr*=c;var dn=l(Pr),nn=dn*l(ur),On=dn*_(ur),Ta=_(Pr),xa=Fr*Ta-En*On,ri=En*nn-hr*Ta,fi=hr*On-Fr*nn,Ni=m(xa*xa+ri*ri+fi*fi),Va=y(Ni),Ai=Ni&&-Va/Ni;Ct+=Ai*xa,Ot+=Ai*ri,Wt+=Ai*fi,Ee+=Va,Xe+=Va*(hr+(hr=nn)),Je+=Va*(Fr+(Fr=On)),Lt+=Va*(En+(En=Ta)),ta(hr,Fr,En)}function Vr(ur){$e=Ee=xe=ye=Me=Xe=Je=Lt=Ct=Ot=Wt=0,U(ur,Kn);var Pr=Ct,dn=Ot,nn=Wt,On=Pr*Pr+dn*dn+nn*nn;return Onn?ur+Math.round(-ur/s)*s:ur,Pr]}wn.invert=wn;function Jn(ur,Pr,dn){return(ur%=s)?Pr||dn?mn(ha(ur),_a(Pr,dn)):ha(ur):Pr||dn?_a(Pr,dn):wn}function pa(ur){return function(Pr,dn){return Pr+=ur,[Pr>n?Pr-s:Pr<-n?Pr+s:Pr,dn]}}function ha(ur){var Pr=pa(ur);return Pr.invert=pa(-ur),Pr}function _a(ur,Pr){var dn=l(ur),nn=_(ur),On=l(Pr),Ta=_(Pr);function xa(ri,fi){var Ni=l(fi),Va=l(ri)*Ni,Ai=_(ri)*Ni,ei=_(fi),Na=ei*dn+Va*nn;return[T(Ai*On-Na*Ta,Va*dn-ei*nn),y(Na*On+Ai*Ta)]}return xa.invert=function(ri,fi){var Ni=l(fi),Va=l(ri)*Ni,Ai=_(ri)*Ni,ei=_(fi),Na=ei*On-Ai*Ta;return[T(Ai*On+ei*Ta,Va*dn+Na*nn),y(Na*dn-Va*nn)]},xa}function Ca(ur){ur=Jn(ur[0]*c,ur[1]*c,ur.length>2?ur[2]*c:0);function Pr(dn){return dn=ur(dn[0]*c,dn[1]*c),dn[0]*=f,dn[1]*=f,dn}return Pr.invert=function(dn){return dn=ur.invert(dn[0]*c,dn[1]*c),dn[0]*=f,dn[1]*=f,dn},Pr}function Vn(ur,Pr,dn,nn,On,Ta){if(dn){var xa=l(Pr),ri=_(Pr),fi=nn*dn;On==null?(On=Pr+nn*s,Ta=Pr-fi/2):(On=yi(xa,On),Ta=yi(xa,Ta),(nn>0?OnTa)&&(On+=nn*s));for(var Ni,Va=On;nn>0?Va>Ta:Va1&&ur.push(ur.pop().concat(ur.shift()))},result:function(){var dn=ur;return ur=[],Pr=null,dn}}}function yt(ur,Pr){return p(ur[0]-Pr[0])=0;--ri)On.point((Ai=Va[ri])[0],Ai[1]);else nn(ei.x,ei.p.x,-1,On);ei=ei.p}ei=ei.o,Va=ei.z,Na=!Na}while(!ei.v);On.lineEnd()}}}function jr(ur){if(Pr=ur.length){for(var Pr,dn=0,nn=ur[0],On;++dn=0?1:-1,Ml=Xl*Al,Yl=Ml>n,rl=jo*is;if(Ir.add(T(rl*Xl*_(Ml),Fo*Us+rl*l(Ml))),xa+=Yl?Al+Xl*s:Al,Yl^Na>=dn^Ki>=dn){var Su=Ae(ie(ei),ie(Vo));ze(Su);var wu=Ae(Ta,Su);ze(wu);var ql=(Yl^Al>=0?-1:1)*y(wu[2]);(nn>ql||nn===ql&&(Su[0]||Su[1]))&&(ri+=Yl^Al>=0?1:-1)}}return(xa<-r||xa0){for(fi||(On.polygonStart(),fi=!0),On.lineStart(),Us=0;Us1&&Ri&2&&is.push(is.pop().concat(is.shift())),Va.push(is.filter(At))}}return ei}}function At(ur){return ur.length>1}function or(ur,Pr){return((ur=ur.x)[0]<0?ur[1]-i-r:i-ur[1])-((Pr=Pr.x)[0]<0?Pr[1]-i-r:i-Pr[1])}var Dr=$r(function(){return!0},un,jn,[-n,-i]);function un(ur){var Pr=NaN,dn=NaN,nn=NaN,On;return{lineStart:function(){ur.lineStart(),On=1},point:function(Ta,xa){var ri=Ta>0?n:-n,fi=p(Ta-Pr);p(fi-n)0?i:-i),ur.point(nn,dn),ur.lineEnd(),ur.lineStart(),ur.point(ri,dn),ur.point(Ta,dn),On=0):nn!==ri&&fi>=n&&(p(Pr-nn)r?d((_(Pr)*(Ta=l(nn))*_(dn)-_(nn)*(On=l(Pr))*_(ur))/(On*Ta*xa)):(Pr+nn)/2}function jn(ur,Pr,dn,nn){var On;if(ur==null)On=dn*i,nn.point(-n,On),nn.point(0,On),nn.point(n,On),nn.point(n,0),nn.point(n,-On),nn.point(0,-On),nn.point(-n,-On),nn.point(-n,0),nn.point(-n,On);else if(p(ur[0]-Pr[0])>r){var Ta=ur[0]0,On=p(Pr)>r;function Ta(Va,Ai,ei,Na){Vn(Na,ur,dn,ei,Va,Ai)}function xa(Va,Ai){return l(Va)*l(Ai)>Pr}function ri(Va){var Ai,ei,Na,Zi,jo;return{lineStart:function(){Zi=Na=!1,jo=1},point:function(Fo,Yo){var Vo=[Fo,Yo],Ki,Ri=xa(Fo,Yo),is=nn?Ri?0:Ni(Fo,Yo):Ri?Ni(Fo+(Fo<0?n:-n),Yo):0;if(!Ai&&(Zi=Na=Ri)&&Va.lineStart(),Ri!==Na&&(Ki=fi(Ai,Vo),(!Ki||yt(Ai,Ki)||yt(Vo,Ki))&&(Vo[2]=1)),Ri!==Na)jo=0,Ri?(Va.lineStart(),Ki=fi(Vo,Ai),Va.point(Ki[0],Ki[1])):(Ki=fi(Ai,Vo),Va.point(Ki[0],Ki[1],2),Va.lineEnd()),Ai=Ki;else if(On&&Ai&&nn^Ri){var Us;!(is&ei)&&(Us=fi(Vo,Ai,!0))&&(jo=0,nn?(Va.lineStart(),Va.point(Us[0][0],Us[0][1]),Va.point(Us[1][0],Us[1][1]),Va.lineEnd()):(Va.point(Us[1][0],Us[1][1]),Va.lineEnd(),Va.lineStart(),Va.point(Us[0][0],Us[0][1],3)))}Ri&&(!Ai||!yt(Ai,Vo))&&Va.point(Vo[0],Vo[1]),Ai=Vo,Na=Ri,ei=is},lineEnd:function(){Na&&Va.lineEnd(),Ai=null},clean:function(){return jo|(Zi&&Na)<<1}}}function fi(Va,Ai,ei){var Na=ie(Va),Zi=ie(Ai),jo=[1,0,0],Fo=Ae(Na,Zi),Yo=ve(Fo,Fo),Vo=Fo[0],Ki=Yo-Vo*Vo;if(!Ki)return!ei&&Va;var Ri=Pr*Yo/Ki,is=-Pr*Vo/Ki,Us=Ae(jo,Fo),Al=Fe(jo,Ri),Xl=Fe(Fo,is);Ce(Al,Xl);var Ml=Us,Yl=ve(Al,Ml),rl=ve(Ml,Ml),Su=Yl*Yl-rl*(ve(Al,Al)-1);if(!(Su<0)){var wu=m(Su),ql=Fe(Ml,(-Yl-wu)/rl);if(Ce(ql,Al),ql=ae(ql),!ei)return ql;var bo=Va[0],xs=Ai[0],zl=Va[1],pl=Ai[1],dc;xs0^ql[1]<(p(ql[0]-bo)n^(bo<=ql[0]&&ql[0]<=xs)){var mc=Fe(Ml,(-Yl+wu)/rl);return Ce(mc,Al),[ql,ae(mc)]}}}function Ni(Va,Ai){var ei=nn?ur:n-ur,Na=0;return Va<-ei?Na|=1:Va>ei&&(Na|=2),Ai<-ei?Na|=4:Ai>ei&&(Na|=8),Na}return $r(xa,ri,Ta,nn?[0,-ur]:[-n,ur-n])}function cn(ur,Pr,dn,nn,On,Ta){var xa=ur[0],ri=ur[1],fi=Pr[0],Ni=Pr[1],Va=0,Ai=1,ei=fi-xa,Na=Ni-ri,Zi;if(Zi=dn-xa,!(!ei&&Zi>0)){if(Zi/=ei,ei<0){if(Zi0){if(Zi>Ai)return;Zi>Va&&(Va=Zi)}if(Zi=On-xa,!(!ei&&Zi<0)){if(Zi/=ei,ei<0){if(Zi>Ai)return;Zi>Va&&(Va=Zi)}else if(ei>0){if(Zi0)){if(Zi/=Na,Na<0){if(Zi0){if(Zi>Ai)return;Zi>Va&&(Va=Zi)}if(Zi=Ta-ri,!(!Na&&Zi<0)){if(Zi/=Na,Na<0){if(Zi>Ai)return;Zi>Va&&(Va=Zi)}else if(Na>0){if(Zi0&&(ur[0]=xa+Va*ei,ur[1]=ri+Va*Na),Ai<1&&(Pr[0]=xa+Ai*ei,Pr[1]=ri+Ai*Na),!0}}}}}var In=1e9,xi=-In;function Ea(ur,Pr,dn,nn){function On(Ni,Va){return ur<=Ni&&Ni<=dn&&Pr<=Va&&Va<=nn}function Ta(Ni,Va,Ai,ei){var Na=0,Zi=0;if(Ni==null||(Na=xa(Ni,Ai))!==(Zi=xa(Va,Ai))||fi(Ni,Va)<0^Ai>0)do ei.point(Na===0||Na===3?ur:dn,Na>1?nn:Pr);while((Na=(Na+Ai+4)%4)!==Zi);else ei.point(Va[0],Va[1])}function xa(Ni,Va){return p(Ni[0]-ur)0?0:3:p(Ni[0]-dn)0?2:1:p(Ni[1]-Pr)0?1:0:Va>0?3:2}function ri(Ni,Va){return fi(Ni.x,Va.x)}function fi(Ni,Va){var Ai=xa(Ni,1),ei=xa(Va,1);return Ai!==ei?Ai-ei:Ai===0?Va[1]-Ni[1]:Ai===1?Ni[0]-Va[0]:Ai===2?Ni[1]-Va[1]:Va[0]-Ni[0]}return function(Ni){var Va=Ni,Ai=Dt(),ei,Na,Zi,jo,Fo,Yo,Vo,Ki,Ri,is,Us,Al={point:Xl,lineStart:Su,lineEnd:wu,polygonStart:Yl,polygonEnd:rl};function Xl(bo,xs){On(bo,xs)&&Va.point(bo,xs)}function Ml(){for(var bo=0,xs=0,zl=Na.length;xsnn&&(Mf-Gf)*(nn-mc)>(Mu-mc)*(ur-Gf)&&++bo:Mu<=nn&&(Mf-Gf)*(nn-mc)<(Mu-mc)*(ur-Gf)&&--bo;return bo}function Yl(){Va=Ai,ei=[],Na=[],Us=!0}function rl(){var bo=Ml(),xs=Us&&bo,zl=(ei=b.merge(ei)).length;(xs||zl)&&(Ni.polygonStart(),xs&&(Ni.lineStart(),Ta(null,null,1,Ni),Ni.lineEnd()),zl&&Nr(ei,ri,bo,Ta,Ni),Ni.polygonEnd()),Va=Ni,ei=Na=Zi=null}function Su(){Al.point=ql,Na&&Na.push(Zi=[]),is=!0,Ri=!1,Vo=Ki=NaN}function wu(){ei&&(ql(jo,Fo),Yo&&Ri&&Ai.rejoin(),ei.push(Ai.result())),Al.point=Xl,Ri&&Va.lineEnd()}function ql(bo,xs){var zl=On(bo,xs);if(Na&&Zi.push([bo,xs]),is)jo=bo,Fo=xs,Yo=zl,is=!1,zl&&(Va.lineStart(),Va.point(bo,xs));else if(zl&&Ri)Va.point(bo,xs);else{var pl=[Vo=Math.max(xi,Math.min(In,Vo)),Ki=Math.max(xi,Math.min(In,Ki))],dc=[bo=Math.max(xi,Math.min(In,bo)),xs=Math.max(xi,Math.min(In,xs))];cn(pl,dc,ur,Pr,dn,nn)?(Ri||(Va.lineStart(),Va.point(pl[0],pl[1])),Va.point(dc[0],dc[1]),zl||Va.lineEnd(),Us=!1):zl&&(Va.lineStart(),Va.point(bo,xs),Us=!1)}Vo=bo,Ki=xs,Ri=zl}return Al}}function Pi(){var ur=0,Pr=0,dn=960,nn=500,On,Ta,xa;return xa={stream:function(ri){return On&&Ta===ri?On:On=Ea(ur,Pr,dn,nn)(Ta=ri)},extent:function(ri){return arguments.length?(ur=+ri[0][0],Pr=+ri[0][1],dn=+ri[1][0],nn=+ri[1][1],On=Ta=null,xa):[[ur,Pr],[dn,nn]]}}}var Xi=S(),uo,so,Eo,vi={sphere:L,point:L,lineStart:ns,lineEnd:L,polygonStart:L,polygonEnd:L};function ns(){vi.point=Ys,vi.lineEnd=Xo}function Xo(){vi.point=vi.lineEnd=L}function Ys(ur,Pr){ur*=c,Pr*=c,uo=ur,so=_(Pr),Eo=l(Pr),vi.point=vs}function vs(ur,Pr){ur*=c,Pr*=c;var dn=_(Pr),nn=l(Pr),On=p(ur-uo),Ta=l(On),xa=_(On),ri=nn*xa,fi=Eo*dn-so*nn*Ta,Ni=so*dn+Eo*nn*Ta;Xi.add(T(m(ri*ri+fi*fi),Ni)),uo=ur,so=dn,Eo=nn}function es(ur){return Xi.reset(),U(ur,vi),+Xi}var qo=[null,null],Zs={type:"LineString",coordinates:qo};function Hs(ur,Pr){return qo[0]=ur,qo[1]=Pr,es(Zs)}var sl={Feature:function(ur,Pr){return Ko(ur.geometry,Pr)},FeatureCollection:function(ur,Pr){for(var dn=ur.features,nn=-1,On=dn.length;++nn0&&(On=Hs(ur[Ta],ur[Ta-1]),On>0&&dn<=On&&nn<=On&&(dn+nn-On)*(1-Math.pow((dn-nn)/On,2))r}).map(ei)).concat(b.range(g(Ta/Ni)*Ni,On,Ni).filter(function(Ki){return p(Ki%Ai)>r}).map(Na))}return Yo.lines=function(){return Vo().map(function(Ki){return{type:"LineString",coordinates:Ki}})},Yo.outline=function(){return{type:"Polygon",coordinates:[Zi(nn).concat(jo(xa).slice(1),Zi(dn).reverse().slice(1),jo(ri).reverse().slice(1))]}},Yo.extent=function(Ki){return arguments.length?Yo.extentMajor(Ki).extentMinor(Ki):Yo.extentMinor()},Yo.extentMajor=function(Ki){return arguments.length?(nn=+Ki[0][0],dn=+Ki[1][0],ri=+Ki[0][1],xa=+Ki[1][1],nn>dn&&(Ki=nn,nn=dn,dn=Ki),ri>xa&&(Ki=ri,ri=xa,xa=Ki),Yo.precision(Fo)):[[nn,ri],[dn,xa]]},Yo.extentMinor=function(Ki){return arguments.length?(Pr=+Ki[0][0],ur=+Ki[1][0],Ta=+Ki[0][1],On=+Ki[1][1],Pr>ur&&(Ki=Pr,Pr=ur,ur=Ki),Ta>On&&(Ki=Ta,Ta=On,On=Ki),Yo.precision(Fo)):[[Pr,Ta],[ur,On]]},Yo.step=function(Ki){return arguments.length?Yo.stepMajor(Ki).stepMinor(Ki):Yo.stepMinor()},Yo.stepMajor=function(Ki){return arguments.length?(Va=+Ki[0],Ai=+Ki[1],Yo):[Va,Ai]},Yo.stepMinor=function(Ki){return arguments.length?(fi=+Ki[0],Ni=+Ki[1],Yo):[fi,Ni]},Yo.precision=function(Ki){return arguments.length?(Fo=+Ki,ei=pi(Ta,On,90),Na=no(Pr,ur,Fo),Zi=pi(ri,xa,90),jo=no(nn,dn,Fo),Yo):Fo},Yo.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Ds(){return Cl()()}function No(ur,Pr){var dn=ur[0]*c,nn=ur[1]*c,On=Pr[0]*c,Ta=Pr[1]*c,xa=l(nn),ri=_(nn),fi=l(Ta),Ni=_(Ta),Va=xa*l(dn),Ai=xa*_(dn),ei=fi*l(On),Na=fi*_(On),Zi=2*y(m(I(Ta-nn)+xa*fi*I(On-dn))),jo=_(Zi),Fo=Zi?function(Yo){var Vo=_(Yo*=Zi)/jo,Ki=_(Zi-Yo)/jo,Ri=Ki*Va+Vo*ei,is=Ki*Ai+Vo*Na,Us=Ki*ri+Vo*Ni;return[T(is,Ri)*f,T(Us,m(Ri*Ri+is*is))*f]}:function(){return[dn*f,nn*f]};return Fo.distance=Zi,Fo}function Il(ur){return ur}var Ws=S(),ul=S(),xu,eo,_s,as,Hl={point:L,lineStart:L,lineEnd:L,polygonStart:function(){Hl.lineStart=Gl,Hl.lineEnd=fu},polygonEnd:function(){Hl.lineStart=Hl.lineEnd=Hl.point=L,Ws.add(p(ul)),ul.reset()},result:function(){var ur=Ws/2;return Ws.reset(),ur}};function Gl(){Hl.point=Do}function Do(ur,Pr){Hl.point=su,xu=_s=ur,eo=as=Pr}function su(ur,Pr){ul.add(as*ur-_s*Pr),_s=ur,as=Pr}function fu(){su(xu,eo)}var Bs=1/0,wl=Bs,Bl=-Bs,jl=Bl,Hu={point:uf,lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var ur=[[Bs,wl],[Bl,jl]];return Bl=jl=-(wl=Bs=1/0),ur}};function uf(ur,Pr){urBl&&(Bl=ur),Prjl&&(jl=Pr)}var qc=0,Qc=0,Lh=0,yh=0,Tl=0,Lc=0,Ph=0,nc=0,Gu=0,ac,ef,Kl,Xu,Gs={point:Dl,lineStart:wf,lineEnd:lu,polygonStart:function(){Gs.lineStart=bv,Gs.lineEnd=Ns},polygonEnd:function(){Gs.point=Dl,Gs.lineStart=wf,Gs.lineEnd=lu},result:function(){var ur=Gu?[Ph/Gu,nc/Gu]:Lc?[yh/Lc,Tl/Lc]:Lh?[qc/Lh,Qc/Lh]:[NaN,NaN];return qc=Qc=Lh=yh=Tl=Lc=Ph=nc=Gu=0,ur}};function Dl(ur,Pr){qc+=ur,Qc+=Pr,++Lh}function wf(){Gs.point=yc}function yc(ur,Pr){Gs.point=If,Dl(Kl=ur,Xu=Pr)}function If(ur,Pr){var dn=ur-Kl,nn=Pr-Xu,On=m(dn*dn+nn*nn);yh+=On*(Kl+ur)/2,Tl+=On*(Xu+Pr)/2,Lc+=On,Dl(Kl=ur,Xu=Pr)}function lu(){Gs.point=Dl}function bv(){Gs.point=Bv}function Ns(){dl(ac,ef)}function Bv(ur,Pr){Gs.point=dl,Dl(ac=Kl=ur,ef=Xu=Pr)}function dl(ur,Pr){var dn=ur-Kl,nn=Pr-Xu,On=m(dn*dn+nn*nn);yh+=On*(Kl+ur)/2,Tl+=On*(Xu+Pr)/2,Lc+=On,On=Xu*ur-Kl*Pr,Ph+=On*(Kl+ur),nc+=On*(Xu+Pr),Gu+=On*3,Dl(Kl=ur,Xu=Pr)}function Bo(ur){this._context=ur}Bo.prototype={_radius:4.5,pointRadius:function(ur){return this._radius=ur,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(ur,Pr){switch(this._point){case 0:{this._context.moveTo(ur,Pr),this._point=1;break}case 1:{this._context.lineTo(ur,Pr);break}default:{this._context.moveTo(ur+this._radius,Pr),this._context.arc(ur,Pr,this._radius,0,s);break}}},result:L};var Kf=S(),tf,Iu,Rh,Df,ih,Yu={point:L,lineStart:function(){Yu.point=sv},lineEnd:function(){tf&&Uh(Iu,Rh),Yu.point=L},polygonStart:function(){tf=!0},polygonEnd:function(){tf=null},result:function(){var ur=+Kf;return Kf.reset(),ur}};function sv(ur,Pr){Yu.point=Uh,Iu=Df=ur,Rh=ih=Pr}function Uh(ur,Pr){Df-=ur,ih-=Pr,Kf.add(m(Df*Df+ih*ih)),Df=ur,ih=Pr}function oh(){this._string=[]}oh.prototype={_radius:4.5,_circle:zf(4.5),pointRadius:function(ur){return(ur=+ur)!==this._radius&&(this._radius=ur,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(ur,Pr){switch(this._point){case 0:{this._string.push("M",ur,",",Pr),this._point=1;break}case 1:{this._string.push("L",ur,",",Pr);break}default:{this._circle==null&&(this._circle=zf(this._radius)),this._string.push("M",ur,",",Pr,this._circle);break}}},result:function(){if(this._string.length){var ur=this._string.join("");return this._string=[],ur}else return null}};function zf(ur){return"m0,"+ur+"a"+ur+","+ur+" 0 1,1 0,"+-2*ur+"a"+ur+","+ur+" 0 1,1 0,"+2*ur+"z"}function Ih(ur,Pr){var dn=4.5,nn,On;function Ta(xa){return xa&&(typeof dn=="function"&&On.pointRadius(+dn.apply(this,arguments)),U(xa,nn(On))),On.result()}return Ta.area=function(xa){return U(xa,nn(Hl)),Hl.result()},Ta.measure=function(xa){return U(xa,nn(Yu)),Yu.result()},Ta.bounds=function(xa){return U(xa,nn(Hu)),Hu.result()},Ta.centroid=function(xa){return U(xa,nn(Gs)),Gs.result()},Ta.projection=function(xa){return arguments.length?(nn=xa==null?(ur=null,Il):(ur=xa).stream,Ta):ur},Ta.context=function(xa){return arguments.length?(On=xa==null?(Pr=null,new oh):new Bo(Pr=xa),typeof dn!="function"&&On.pointRadius(dn),Ta):Pr},Ta.pointRadius=function(xa){return arguments.length?(dn=typeof xa=="function"?xa:(On.pointRadius(+xa),+xa),Ta):dn},Ta.projection(ur).context(Pr)}function Dh(ur){return{stream:rf(ur)}}function rf(ur){return function(Pr){var dn=new jh;for(var nn in ur)dn[nn]=ur[nn];return dn.stream=Pr,dn}}function jh(){}jh.prototype={constructor:jh,point:function(ur,Pr){this.stream.point(ur,Pr)},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 Tf(ur,Pr,dn){var nn=ur.clipExtent&&ur.clipExtent();return ur.scale(150).translate([0,0]),nn!=null&&ur.clipExtent(null),U(dn,ur.stream(Hu)),Pr(Hu.result()),nn!=null&&ur.clipExtent(nn),ur}function cf(ur,Pr,dn){return Tf(ur,function(nn){var On=Pr[1][0]-Pr[0][0],Ta=Pr[1][1]-Pr[0][1],xa=Math.min(On/(nn[1][0]-nn[0][0]),Ta/(nn[1][1]-nn[0][1])),ri=+Pr[0][0]+(On-xa*(nn[1][0]+nn[0][0]))/2,fi=+Pr[0][1]+(Ta-xa*(nn[1][1]+nn[0][1]))/2;ur.scale(150*xa).translate([ri,fi])},dn)}function Zu(ur,Pr,dn){return cf(ur,[[0,0],Pr],dn)}function Hf(ur,Pr,dn){return Tf(ur,function(nn){var On=+Pr,Ta=On/(nn[1][0]-nn[0][0]),xa=(On-Ta*(nn[1][0]+nn[0][0]))/2,ri=-Ta*nn[0][1];ur.scale(150*Ta).translate([xa,ri])},dn)}function zh(ur,Pr,dn){return Tf(ur,function(nn){var On=+Pr,Ta=On/(nn[1][1]-nn[0][1]),xa=-Ta*nn[0][0],ri=(On-Ta*(nn[1][1]+nn[0][1]))/2;ur.scale(150*Ta).translate([xa,ri])},dn)}var Nl=16,_h=l(30*c);function wv(ur,Pr){return+Pr?sh(ur,Pr):qh(ur)}function qh(ur){return rf({point:function(Pr,dn){Pr=ur(Pr,dn),this.stream.point(Pr[0],Pr[1])}})}function sh(ur,Pr){function dn(nn,On,Ta,xa,ri,fi,Ni,Va,Ai,ei,Na,Zi,jo,Fo){var Yo=Ni-nn,Vo=Va-On,Ki=Yo*Yo+Vo*Vo;if(Ki>4*Pr&&jo--){var Ri=xa+ei,is=ri+Na,Us=fi+Zi,Al=m(Ri*Ri+is*is+Us*Us),Xl=y(Us/=Al),Ml=p(p(Us)-1)Pr||p((Yo*wu+Vo*ql)/Ki-.5)>.3||xa*ei+ri*Na+fi*Zi<_h)&&(dn(nn,On,Ta,xa,ri,fi,rl,Su,Ml,Ri/=Al,is/=Al,Us,jo,Fo),Fo.point(rl,Su),dn(rl,Su,Ml,Ri,is,Us,Ni,Va,Ai,ei,Na,Zi,jo,Fo))}}return function(nn){var On,Ta,xa,ri,fi,Ni,Va,Ai,ei,Na,Zi,jo,Fo={point:Yo,lineStart:Vo,lineEnd:Ri,polygonStart:function(){nn.polygonStart(),Fo.lineStart=is},polygonEnd:function(){nn.polygonEnd(),Fo.lineStart=Vo}};function Yo(Xl,Ml){Xl=ur(Xl,Ml),nn.point(Xl[0],Xl[1])}function Vo(){Ai=NaN,Fo.point=Ki,nn.lineStart()}function Ki(Xl,Ml){var Yl=ie([Xl,Ml]),rl=ur(Xl,Ml);dn(Ai,ei,Va,Na,Zi,jo,Ai=rl[0],ei=rl[1],Va=Xl,Na=Yl[0],Zi=Yl[1],jo=Yl[2],Nl,nn),nn.point(Ai,ei)}function Ri(){Fo.point=Yo,nn.lineEnd()}function is(){Vo(),Fo.point=Us,Fo.lineEnd=Al}function Us(Xl,Ml){Ki(On=Xl,Ml),Ta=Ai,xa=ei,ri=Na,fi=Zi,Ni=jo,Fo.point=Ki}function Al(){dn(Ai,ei,Va,Na,Zi,jo,Ta,xa,On,ri,fi,Ni,Nl,nn),Fo.lineEnd=Ri,Ri()}return Fo}}var Vh=rf({point:function(ur,Pr){this.stream.point(ur*c,Pr*c)}});function Pc(ur){return rf({point:function(Pr,dn){var nn=ur(Pr,dn);return this.stream.point(nn[0],nn[1])}})}function Hh(ur,Pr,dn,nn,On){function Ta(xa,ri){return xa*=nn,ri*=On,[Pr+ur*xa,dn-ur*ri]}return Ta.invert=function(xa,ri){return[(xa-Pr)/ur*nn,(dn-ri)/ur*On]},Ta}function yu(ur,Pr,dn,nn,On,Ta){var xa=l(Ta),ri=_(Ta),fi=xa*ur,Ni=ri*ur,Va=xa/ur,Ai=ri/ur,ei=(ri*dn-xa*Pr)/ur,Na=(ri*Pr+xa*dn)/ur;function Zi(jo,Fo){return jo*=nn,Fo*=On,[fi*jo-Ni*Fo+Pr,dn-Ni*jo-fi*Fo]}return Zi.invert=function(jo,Fo){return[nn*(Va*jo-Ai*Fo+ei),On*(Na-Ai*jo-Va*Fo)]},Zi}function Rc(ur){return Of(function(){return ur})()}function Of(ur){var Pr,dn=150,nn=480,On=250,Ta=0,xa=0,ri=0,fi=0,Ni=0,Va,Ai=0,ei=1,Na=1,Zi=null,jo=Dr,Fo=null,Yo,Vo,Ki,Ri=Il,is=.5,Us,Al,Xl,Ml,Yl;function rl(bo){return Xl(bo[0]*c,bo[1]*c)}function Su(bo){return bo=Xl.invert(bo[0],bo[1]),bo&&[bo[0]*f,bo[1]*f]}rl.stream=function(bo){return Ml&&Yl===bo?Ml:Ml=Vh(Pc(Va)(jo(Us(Ri(Yl=bo)))))},rl.preclip=function(bo){return arguments.length?(jo=bo,Zi=void 0,ql()):jo},rl.postclip=function(bo){return arguments.length?(Ri=bo,Fo=Yo=Vo=Ki=null,ql()):Ri},rl.clipAngle=function(bo){return arguments.length?(jo=+bo?Un(Zi=bo*c):(Zi=null,Dr),ql()):Zi*f},rl.clipExtent=function(bo){return arguments.length?(Ri=bo==null?(Fo=Yo=Vo=Ki=null,Il):Ea(Fo=+bo[0][0],Yo=+bo[0][1],Vo=+bo[1][0],Ki=+bo[1][1]),ql()):Fo==null?null:[[Fo,Yo],[Vo,Ki]]},rl.scale=function(bo){return arguments.length?(dn=+bo,wu()):dn},rl.translate=function(bo){return arguments.length?(nn=+bo[0],On=+bo[1],wu()):[nn,On]},rl.center=function(bo){return arguments.length?(Ta=bo[0]%360*c,xa=bo[1]%360*c,wu()):[Ta*f,xa*f]},rl.rotate=function(bo){return arguments.length?(ri=bo[0]%360*c,fi=bo[1]%360*c,Ni=bo.length>2?bo[2]%360*c:0,wu()):[ri*f,fi*f,Ni*f]},rl.angle=function(bo){return arguments.length?(Ai=bo%360*c,wu()):Ai*f},rl.reflectX=function(bo){return arguments.length?(ei=bo?-1:1,wu()):ei<0},rl.reflectY=function(bo){return arguments.length?(Na=bo?-1:1,wu()):Na<0},rl.precision=function(bo){return arguments.length?(Us=wv(Al,is=bo*bo),ql()):m(is)},rl.fitExtent=function(bo,xs){return cf(rl,bo,xs)},rl.fitSize=function(bo,xs){return Zu(rl,bo,xs)},rl.fitWidth=function(bo,xs){return Hf(rl,bo,xs)},rl.fitHeight=function(bo,xs){return zh(rl,bo,xs)};function wu(){var bo=yu(dn,0,0,ei,Na,Ai).apply(null,Pr(Ta,xa)),xs=(Ai?yu:Hh)(dn,nn-bo[0],On-bo[1],ei,Na,Ai);return Va=Jn(ri,fi,Ni),Al=mn(Pr,xs),Xl=mn(Va,Al),Us=wv(Al,is),ql()}function ql(){return Ml=Yl=null,rl}return function(){return Pr=ur.apply(this,arguments),rl.invert=Pr.invert&&Su,wu()}}function $l(ur){var Pr=0,dn=n/3,nn=Of(ur),On=nn(Pr,dn);return On.parallels=function(Ta){return arguments.length?nn(Pr=Ta[0]*c,dn=Ta[1]*c):[Pr*f,dn*f]},On}function Af(ur){var Pr=l(ur);function dn(nn,On){return[nn*Pr,_(On)/Pr]}return dn.invert=function(nn,On){return[nn/Pr,y(On*Pr)]},dn}function vc(ur,Pr){var dn=_(ur),nn=(dn+_(Pr))/2;if(p(nn)=.12&&Fo<.234&&jo>=-.425&&jo<-.214?On:Fo>=.166&&Fo<.234&&jo>=-.214&&jo<-.115?xa:dn).invert(ei)},Va.stream=function(ei){return ur&&Pr===ei?ur:ur=$f([dn.stream(Pr=ei),On.stream(ei),xa.stream(ei)])},Va.precision=function(ei){return arguments.length?(dn.precision(ei),On.precision(ei),xa.precision(ei),Ai()):dn.precision()},Va.scale=function(ei){return arguments.length?(dn.scale(ei),On.scale(ei*.35),xa.scale(ei),Va.translate(dn.translate())):dn.scale()},Va.translate=function(ei){if(!arguments.length)return dn.translate();var Na=dn.scale(),Zi=+ei[0],jo=+ei[1];return nn=dn.translate(ei).clipExtent([[Zi-.455*Na,jo-.238*Na],[Zi+.455*Na,jo+.238*Na]]).stream(Ni),Ta=On.translate([Zi-.307*Na,jo+.201*Na]).clipExtent([[Zi-.425*Na+r,jo+.12*Na+r],[Zi-.214*Na-r,jo+.234*Na-r]]).stream(Ni),ri=xa.translate([Zi-.205*Na,jo+.212*Na]).clipExtent([[Zi-.214*Na+r,jo+.166*Na+r],[Zi-.115*Na-r,jo+.234*Na-r]]).stream(Ni),Ai()},Va.fitExtent=function(ei,Na){return cf(Va,ei,Na)},Va.fitSize=function(ei,Na){return Zu(Va,ei,Na)},Va.fitWidth=function(ei,Na){return Hf(Va,ei,Na)},Va.fitHeight=function(ei,Na){return zh(Va,ei,Na)};function Ai(){return ur=Pr=null,Va}return Va.scale(1070)}function Ff(ur){return function(Pr,dn){var nn=l(Pr),On=l(dn),Ta=ur(nn*On);return[Ta*On*_(Pr),Ta*_(dn)]}}function xh(ur){return function(Pr,dn){var nn=m(Pr*Pr+dn*dn),On=ur(nn),Ta=_(On),xa=l(On);return[T(Pr*Ta,nn*xa),y(nn&&dn*Ta/nn)]}}var Tv=Ff(function(ur){return m(2/(1+ur))});Tv.invert=xh(function(ur){return 2*y(ur/2)});function Zv(){return Rc(Tv).scale(124.75).clipAngle(180-.001)}var Jf=Ff(function(ur){return(ur=v(ur))&&ur/_(ur)});Jf.invert=xh(function(ur){return ur});function bh(){return Rc(Jf).scale(79.4188).clipAngle(180-.001)}function Vc(ur,Pr){return[ur,A(u((i+Pr)/2))]}Vc.invert=function(ur,Pr){return[ur,2*d(x(Pr))-i]};function wh(){return ic(Vc).scale(961/s)}function ic(ur){var Pr=Rc(ur),dn=Pr.center,nn=Pr.scale,On=Pr.translate,Ta=Pr.clipExtent,xa=null,ri,fi,Ni;Pr.scale=function(Ai){return arguments.length?(nn(Ai),Va()):nn()},Pr.translate=function(Ai){return arguments.length?(On(Ai),Va()):On()},Pr.center=function(Ai){return arguments.length?(dn(Ai),Va()):dn()},Pr.clipExtent=function(Ai){return arguments.length?(Ai==null?xa=ri=fi=Ni=null:(xa=+Ai[0][0],ri=+Ai[0][1],fi=+Ai[1][0],Ni=+Ai[1][1]),Va()):xa==null?null:[[xa,ri],[fi,Ni]]};function Va(){var Ai=n*nn(),ei=Pr(Ca(Pr.rotate()).invert([0,0]));return Ta(xa==null?[[ei[0]-Ai,ei[1]-Ai],[ei[0]+Ai,ei[1]+Ai]]:ur===Vc?[[Math.max(ei[0]-Ai,xa),ri],[Math.min(ei[0]+Ai,fi),Ni]]:[[xa,Math.max(ei[1]-Ai,ri)],[fi,Math.min(ei[1]+Ai,Ni)]])}return Va()}function Qf(ur){return u((i+ur)/2)}function Gh(ur,Pr){var dn=l(ur),nn=ur===Pr?_(ur):A(dn/l(Pr))/A(Qf(Pr)/Qf(ur)),On=dn*M(Qf(ur),nn)/nn;if(!nn)return Vc;function Ta(xa,ri){On>0?ri<-i+r&&(ri=-i+r):ri>i-r&&(ri=i-r);var fi=On/M(Qf(ri),nn);return[fi*_(nn*xa),On-fi*l(nn*xa)]}return Ta.invert=function(xa,ri){var fi=On-ri,Ni=w(nn)*m(xa*xa+fi*fi),Va=T(xa,p(fi))*w(fi);return fi*nn<0&&(Va-=n*w(xa)*w(fi)),[Va/nn,2*d(M(On/Ni,1/nn))-i]},Ta}function eh(){return $l(Gh).scale(109.5).parallels([30,30])}function tu(ur,Pr){return[ur,Pr]}tu.invert=tu;function Dc(){return Rc(tu).scale(152.63)}function nf(ur,Pr){var dn=l(ur),nn=ur===Pr?_(ur):(dn-l(Pr))/(Pr-ur),On=dn/nn+ur;if(p(nn)r&&--nn>0);return[ur/(.8707+(Ta=dn*dn)*(-.131979+Ta*(-.013791+Ta*Ta*Ta*(.003971-.001529*Ta)))),dn]};function vf(){return Rc(Sf).scale(175.295)}function bu(ur,Pr){return[l(Pr)*_(ur),_(Pr)]}bu.invert=xh(y);function _c(){return Rc(bu).scale(249.5).clipAngle(90+r)}function hu(ur,Pr){var dn=l(Pr),nn=1+l(ur)*dn;return[dn*_(ur)/nn,_(Pr)/nn]}hu.invert=xh(function(ur){return 2*d(ur)});function Nf(){return Rc(hu).scale(250).clipAngle(142)}function df(ur,Pr){return[A(u((i+Pr)/2)),-ur]}df.invert=function(ur,Pr){return[-Pr,2*d(x(ur))-i]};function Fh(){var ur=ic(df),Pr=ur.center,dn=ur.rotate;return ur.center=function(nn){return arguments.length?Pr([-nn[1],nn[0]]):(nn=Pr(),[nn[1],-nn[0]])},ur.rotate=function(nn){return arguments.length?dn([nn[0],nn[1],nn.length>2?nn[2]+90:90]):(nn=dn(),[nn[0],nn[1],nn[2]-90])},dn([0,0,90]).scale(159.155)}h.geoAlbers=uu,h.geoAlbersUsa=ff,h.geoArea=H,h.geoAzimuthalEqualArea=Zv,h.geoAzimuthalEqualAreaRaw=Tv,h.geoAzimuthalEquidistant=bh,h.geoAzimuthalEquidistantRaw=Jf,h.geoBounds=je,h.geoCentroid=Vr,h.geoCircle=Ci,h.geoClipAntimeridian=Dr,h.geoClipCircle=Un,h.geoClipExtent=Pi,h.geoClipRectangle=Ea,h.geoConicConformal=eh,h.geoConicConformalRaw=Gh,h.geoConicEqualArea=Ic,h.geoConicEqualAreaRaw=vc,h.geoConicEquidistant=Oh,h.geoConicEquidistantRaw=nf,h.geoContains=Cs,h.geoDistance=Hs,h.geoEqualEarth=Av,h.geoEqualEarthRaw=ch,h.geoEquirectangular=Dc,h.geoEquirectangularRaw=tu,h.geoGnomonic=Xh,h.geoGnomonicRaw=lc,h.geoGraticule=Cl,h.geoGraticule10=Ds,h.geoIdentity=Gc,h.geoInterpolate=No,h.geoLength=es,h.geoMercator=wh,h.geoMercatorRaw=Vc,h.geoNaturalEarth1=vf,h.geoNaturalEarth1Raw=Sf,h.geoOrthographic=_c,h.geoOrthographicRaw=bu,h.geoPath=Ih,h.geoProjection=Rc,h.geoProjectionMutator=Of,h.geoRotation=Ca,h.geoStereographic=Nf,h.geoStereographicRaw=hu,h.geoStream=U,h.geoTransform=Dh,h.geoTransverseMercator=Fh,h.geoTransverseMercatorRaw=df,Object.defineProperty(h,"__esModule",{value:!0})})}}),nR=Ge({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($,Wk(),YA()):b(h.d3=h.d3||{},h.d3,h.d3)})($,function(h,b,S){var E=Math.abs,e=Math.atan,t=Math.atan2,r=Math.cos,o=Math.exp,n=Math.floor,i=Math.log,a=Math.max,s=Math.min,f=Math.pow,c=Math.round,p=Math.sign||function(Ze){return Ze>0?1:Ze<0?-1:0},d=Math.sin,T=Math.tan,l=1e-6,g=1e-12,x=Math.PI,A=x/2,M=x/4,_=Math.SQRT1_2,w=F(2),m=F(x),u=x*2,v=180/x,y=x/180;function I(Ze){return Ze?Ze/Math.sin(Ze):1}function L(Ze){return Ze>1?A:Ze<-1?-A:Math.asin(Ze)}function z(Ze){return Ze>1?0:Ze<-1?x:Math.acos(Ze)}function F(Ze){return Ze>0?Math.sqrt(Ze):0}function N(Ze){return Ze=o(2*Ze),(Ze-1)/(Ze+1)}function B(Ze){return(o(Ze)-o(-Ze))/2}function R(Ze){return(o(Ze)+o(-Ze))/2}function U(Ze){return i(Ze+F(Ze*Ze+1))}function j(Ze){return i(Ze+F(Ze*Ze-1))}function Z(Ze){var et=T(Ze/2),ht=2*i(r(Ze/2))/(et*et);function _t(zt,Et){var Ut=r(zt),mr=r(Et),Tr=d(Et),Lr=mr*Ut,Gr=-((1-Lr?i((1+Lr)/2)/(1-Lr):-.5)+ht/(1+Lr));return[Gr*mr*d(zt),Gr*Tr]}return _t.invert=function(zt,Et){var Ut=F(zt*zt+Et*Et),mr=-Ze/2,Tr=50,Lr;if(!Ut)return[0,0];do{var Gr=mr/2,on=r(Gr),Mn=d(Gr),Pn=Mn/on,Yn=-i(E(on));mr-=Lr=(2/Pn*Yn-ht*Pn-Ut)/(-Yn/(Mn*Mn)+1-ht/(2*on*on))*(on<0?.7:1)}while(E(Lr)>l&&--Tr>0);var wa=d(mr);return[t(zt*wa,Ut*r(mr)),L(Et*wa/Ut)]},_t}function re(){var Ze=A,et=b.geoProjectionMutator(Z),ht=et(Ze);return ht.radius=function(_t){return arguments.length?et(Ze=_t*y):Ze*v},ht.scale(179.976).clipAngle(147)}function fe(Ze,et){var ht=r(et),_t=I(z(ht*r(Ze/=2)));return[2*ht*d(Ze)*_t,d(et)*_t]}fe.invert=function(Ze,et){if(!(Ze*Ze+4*et*et>x*x+l)){var ht=Ze,_t=et,zt=25;do{var Et=d(ht),Ut=d(ht/2),mr=r(ht/2),Tr=d(_t),Lr=r(_t),Gr=d(2*_t),on=Tr*Tr,Mn=Lr*Lr,Pn=Ut*Ut,Yn=1-Mn*mr*mr,wa=Yn?z(Lr*mr)*F(ni=1/Yn):ni=0,ni,Ka=2*wa*Lr*Ut-Ze,ii=wa*Tr-et,$i=ni*(Mn*Pn+wa*Lr*mr*on),Ao=ni*(.5*Et*Gr-wa*2*Tr*Ut),mo=ni*.25*(Gr*Ut-wa*Tr*Mn*Et),$o=ni*(on*mr+wa*Pn*Lr),Js=Ao*mo-$o*$i;if(!Js)break;var Qs=(ii*Ao-Ka*$o)/Js,Ls=(Ka*mo-ii*$i)/Js;ht-=Qs,_t-=Ls}while((E(Qs)>l||E(Ls)>l)&&--zt>0);return[ht,_t]}};function le(){return b.geoProjection(fe).scale(152.63)}function ce(Ze){var et=d(Ze),ht=r(Ze),_t=Ze>=0?1:-1,zt=T(_t*Ze),Et=(1+et-ht)/2;function Ut(mr,Tr){var Lr=r(Tr),Gr=r(mr/=2);return[(1+Lr)*d(mr),(_t*Tr>-t(Gr,zt)-.001?0:-_t*10)+Et+d(Tr)*ht-(1+Lr)*et*Gr]}return Ut.invert=function(mr,Tr){var Lr=0,Gr=0,on=50;do{var Mn=r(Lr),Pn=d(Lr),Yn=r(Gr),wa=d(Gr),ni=1+Yn,Ka=ni*Pn-mr,ii=Et+wa*ht-ni*et*Mn-Tr,$i=ni*Mn/2,Ao=-Pn*wa,mo=et*ni*Pn/2,$o=ht*Yn+et*Mn*wa,Js=Ao*mo-$o*$i,Qs=(ii*Ao-Ka*$o)/Js/2,Ls=(Ka*mo-ii*$i)/Js;E(Ls)>2&&(Ls/=2),Lr-=Qs,Gr-=Ls}while((E(Qs)>l||E(Ls)>l)&&--on>0);return _t*Gr>-t(r(Lr),zt)-.001?[Lr*2,Gr]:null},Ut}function V(){var Ze=20*y,et=Ze>=0?1:-1,ht=T(et*Ze),_t=b.geoProjectionMutator(ce),zt=_t(Ze),Et=zt.stream;return zt.parallel=function(Ut){return arguments.length?(ht=T((et=(Ze=Ut*y)>=0?1:-1)*Ze),_t(Ze)):Ze*v},zt.stream=function(Ut){var mr=zt.rotate(),Tr=Et(Ut),Lr=(zt.rotate([0,0]),Et(Ut)),Gr=zt.precision();return zt.rotate(mr),Tr.sphere=function(){Lr.polygonStart(),Lr.lineStart();for(var on=et*-180;et*on<180;on+=et*90)Lr.point(on,et*90);if(Ze)for(;et*(on-=3*et*Gr)>=-180;)Lr.point(on,et*-t(r(on*y/2),ht)*v);Lr.lineEnd(),Lr.polygonEnd()},Tr},zt.scale(218.695).center([0,28.0974])}function ee(Ze,et){var ht=T(et/2),_t=F(1-ht*ht),zt=1+_t*r(Ze/=2),Et=d(Ze)*_t/zt,Ut=ht/zt,mr=Et*Et,Tr=Ut*Ut;return[4/3*Et*(3+mr-3*Tr),4/3*Ut*(3+3*mr-Tr)]}ee.invert=function(Ze,et){if(Ze*=3/8,et*=3/8,!Ze&&E(et)>1)return null;var ht=Ze*Ze,_t=et*et,zt=1+ht+_t,Et=F((zt-F(zt*zt-4*et*et))/2),Ut=L(Et)/3,mr=Et?j(E(et/Et))/3:U(E(Ze))/3,Tr=r(Ut),Lr=R(mr),Gr=Lr*Lr-Tr*Tr;return[p(Ze)*2*t(B(mr)*Tr,.25-Gr),p(et)*2*t(Lr*d(Ut),.25+Gr)]};function ne(){return b.geoProjection(ee).scale(66.1603)}var K=F(8),ue=i(1+w);function te(Ze,et){var ht=E(et);return htg&&--_t>0);return[Ze/(r(ht)*(K-1/d(ht))),p(et)*ht]};function H(){return b.geoProjection(te).scale(112.314)}function ae(Ze){var et=2*x/Ze;function ht(_t,zt){var Et=b.geoAzimuthalEquidistantRaw(_t,zt);if(E(_t)>A){var Ut=t(Et[1],Et[0]),mr=F(Et[0]*Et[0]+Et[1]*Et[1]),Tr=et*c((Ut-A)/et)+A,Lr=t(d(Ut-=Tr),2-r(Ut));Ut=Tr+L(x/mr*d(Lr))-Lr,Et[0]=mr*r(Ut),Et[1]=mr*d(Ut)}return Et}return ht.invert=function(_t,zt){var Et=F(_t*_t+zt*zt);if(Et>A){var Ut=t(zt,_t),mr=et*c((Ut-A)/et)+A,Tr=Ut>mr?-1:1,Lr=Et*r(mr-Ut),Gr=1/T(Tr*z((Lr-x)/F(x*(x-2*Lr)+Et*Et)));Ut=mr+2*e((Gr+Tr*F(Gr*Gr-3))/3),_t=Et*r(Ut),zt=Et*d(Ut)}return b.geoAzimuthalEquidistantRaw.invert(_t,zt)},ht}function ie(){var Ze=5,et=b.geoProjectionMutator(ae),ht=et(Ze),_t=ht.stream,zt=.01,Et=-r(zt*y),Ut=d(zt*y);return ht.lobes=function(mr){return arguments.length?et(Ze=+mr):Ze},ht.stream=function(mr){var Tr=ht.rotate(),Lr=_t(mr),Gr=(ht.rotate([0,0]),_t(mr));return ht.rotate(Tr),Lr.sphere=function(){Gr.polygonStart(),Gr.lineStart();for(var on=0,Mn=360/Ze,Pn=2*x/Ze,Yn=90-180/Ze,wa=A;on0&&E(zt)>l);return _t<0?NaN:ht}function ze(Ze,et,ht){return et===void 0&&(et=40),ht===void 0&&(ht=g),function(_t,zt,Et,Ut){var mr,Tr,Lr;Et=Et===void 0?0:+Et,Ut=Ut===void 0?0:+Ut;for(var Gr=0;Grmr){Et-=Tr/=2,Ut-=Lr/=2;continue}mr=Yn;var wa=(Et>0?-1:1)*ht,ni=(Ut>0?-1:1)*ht,Ka=Ze(Et+wa,Ut),ii=Ze(Et,Ut+ni),$i=(Ka[0]-on[0])/wa,Ao=(Ka[1]-on[1])/wa,mo=(ii[0]-on[0])/ni,$o=(ii[1]-on[1])/ni,Js=$o*$i-Ao*mo,Qs=(E(Js)<.5?.5:1)/Js;if(Tr=(Pn*mo-Mn*$o)*Qs,Lr=(Mn*Ao-Pn*$i)*Qs,Et+=Tr,Ut+=Lr,E(Tr)0&&(mr[1]*=1+Tr/1.5*mr[0]*mr[0]),mr}return _t.invert=ze(_t),_t}function it(){return b.geoProjection(Ye()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function st(Ze,et){var ht=Ze*d(et),_t=30,zt;do et-=zt=(et+d(et)-ht)/(1+r(et));while(E(zt)>l&&--_t>0);return et/2}function nt(Ze,et,ht){function _t(zt,Et){return[Ze*zt*r(Et=st(ht,Et)),et*d(Et)]}return _t.invert=function(zt,Et){return Et=L(Et/et),[zt/(Ze*r(Et)),L((2*Et+d(2*Et))/ht)]},_t}var Qe=nt(w/A,w,x);function Le(){return b.geoProjection(Qe).scale(169.529)}var Te=2.00276,pe=1.11072;function Ne(Ze,et){var ht=st(x,et);return[Te*Ze/(1/r(et)+pe/r(ht)),(et+w*d(ht))/Te]}Ne.invert=function(Ze,et){var ht=Te*et,_t=et<0?-M:M,zt=25,Et,Ut;do Ut=ht-w*d(_t),_t-=Et=(d(2*_t)+2*_t-x*d(Ut))/(2*r(2*_t)+2+x*r(Ut)*w*r(_t));while(E(Et)>l&&--zt>0);return Ut=ht-w*d(_t),[Ze*(1/r(Ut)+pe/r(_t))/Te,Ut]};function ot(){return b.geoProjection(Ne).scale(160.857)}function ft(Ze){var et=0,ht=b.geoProjectionMutator(Ze),_t=ht(et);return _t.parallel=function(zt){return arguments.length?ht(et=zt*y):et*v},_t}function rt(Ze,et){return[Ze*r(et),et]}rt.invert=function(Ze,et){return[Ze/r(et),et]};function Ft(){return b.geoProjection(rt).scale(152.63)}function Nt(Ze){if(!Ze)return rt;var et=1/T(Ze);function ht(_t,zt){var Et=et+Ze-zt,Ut=Et&&_t*r(zt)/Et;return[Et*d(Ut),et-Et*r(Ut)]}return ht.invert=function(_t,zt){var Et=F(_t*_t+(zt=et-zt)*zt),Ut=et+Ze-Et;return[Et/r(Ut)*t(_t,zt),Ut]},ht}function $t(){return ft(Nt).scale(123.082).center([0,26.1441]).parallel(45)}function rr(Ze){function et(ht,_t){var zt=A-_t,Et=zt&&ht*Ze*d(zt)/zt;return[zt*d(Et)/Ze,A-zt*r(Et)]}return et.invert=function(ht,_t){var zt=ht*Ze,Et=A-_t,Ut=F(zt*zt+Et*Et),mr=t(zt,Et);return[(Ut?Ut/d(Ut):1)*mr/Ze,A-Ut]},et}function Er(){var Ze=.5,et=b.geoProjectionMutator(rr),ht=et(Ze);return ht.fraction=function(_t){return arguments.length?et(Ze=+_t):Ze},ht.scale(158.837)}var Mr=nt(1,4/x,x);function Wr(){return b.geoProjection(Mr).scale(152.63)}function Sr(Ze,et,ht,_t,zt,Et){var Ut=r(Et),mr;if(E(Ze)>1||E(Et)>1)mr=z(ht*zt+et*_t*Ut);else{var Tr=d(Ze/2),Lr=d(Et/2);mr=2*L(F(Tr*Tr+et*_t*Lr*Lr))}return E(mr)>l?[mr,t(_t*d(Et),et*zt-ht*_t*Ut)]:[0,0]}function Br(Ze,et,ht){return z((Ze*Ze+et*et-ht*ht)/(2*Ze*et))}function Mt(Ze){return Ze-2*x*n((Ze+x)/(2*x))}function je(Ze,et,ht){for(var _t=[[Ze[0],Ze[1],d(Ze[1]),r(Ze[1])],[et[0],et[1],d(et[1]),r(et[1])],[ht[0],ht[1],d(ht[1]),r(ht[1])]],zt=_t[2],Et,Ut=0;Ut<3;++Ut,zt=Et)Et=_t[Ut],zt.v=Sr(Et[1]-zt[1],zt[3],zt[2],Et[3],Et[2],Et[0]-zt[0]),zt.point=[0,0];var mr=Br(_t[0].v[0],_t[2].v[0],_t[1].v[0]),Tr=Br(_t[0].v[0],_t[1].v[0],_t[2].v[0]),Lr=x-mr;_t[2].point[1]=0,_t[0].point[0]=-(_t[1].point[0]=_t[0].v[0]/2);var Gr=[_t[2].point[0]=_t[0].point[0]+_t[2].v[0]*r(mr),2*(_t[0].point[1]=_t[1].point[1]=_t[2].v[0]*d(mr))];function on(Mn,Pn){var Yn=d(Pn),wa=r(Pn),ni=new Array(3),Ka;for(Ka=0;Ka<3;++Ka){var ii=_t[Ka];if(ni[Ka]=Sr(Pn-ii[1],ii[3],ii[2],wa,Yn,Mn-ii[0]),!ni[Ka][0])return ii.point;ni[Ka][1]=Mt(ni[Ka][1]-ii.v[1])}var $i=Gr.slice();for(Ka=0;Ka<3;++Ka){var Ao=Ka==2?0:Ka+1,mo=Br(_t[Ka].v[0],ni[Ka][0],ni[Ao][0]);ni[Ka][1]<0&&(mo=-mo),Ka?Ka==1?(mo=Tr-mo,$i[0]-=ni[Ka][0]*r(mo),$i[1]-=ni[Ka][0]*d(mo)):(mo=Lr-mo,$i[0]+=ni[Ka][0]*r(mo),$i[1]+=ni[Ka][0]*d(mo)):($i[0]+=ni[Ka][0]*r(mo),$i[1]-=ni[Ka][0]*d(mo))}return $i[0]/=3,$i[1]/=3,$i}return on}function $e(Ze){return Ze[0]*=y,Ze[1]*=y,Ze}function Ee(){return xe([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function xe(Ze,et,ht){var _t=b.geoCentroid({type:"MultiPoint",coordinates:[Ze,et,ht]}),zt=[-_t[0],-_t[1]],Et=b.geoRotation(zt),Ut=je($e(Et(Ze)),$e(Et(et)),$e(Et(ht)));Ut.invert=ze(Ut);var mr=b.geoProjection(Ut).rotate(zt),Tr=mr.center;return delete mr.rotate,mr.center=function(Lr){return arguments.length?Tr(Et(Lr)):Et.invert(Tr())},mr.clipAngle(90)}function ye(Ze,et){var ht=F(1-d(et));return[2/m*Ze*ht,m*(1-ht)]}ye.invert=function(Ze,et){var ht=(ht=et/m-1)*ht;return[ht>0?Ze*F(x/ht)/2:0,L(1-ht)]};function Me(){return b.geoProjection(ye).scale(95.6464).center([0,30])}function Xe(Ze){var et=T(Ze);function ht(_t,zt){return[_t,(_t?_t/d(_t):1)*(d(zt)*r(_t)-et*r(zt))]}return ht.invert=et?function(_t,zt){_t&&(zt*=d(_t)/_t);var Et=r(_t);return[_t,2*t(F(Et*Et+et*et-zt*zt)-Et,et-zt)]}:function(_t,zt){return[_t,L(_t?zt*T(_t)/_t:zt)]},ht}function Je(){return ft(Xe).scale(249.828).clipAngle(90)}var Lt=F(3);function Ct(Ze,et){return[Lt*Ze*(2*r(2*et/3)-1)/m,Lt*m*d(et/3)]}Ct.invert=function(Ze,et){var ht=3*L(et/(Lt*m));return[m*Ze/(Lt*(2*r(2*ht/3)-1)),ht]};function Ot(){return b.geoProjection(Ct).scale(156.19)}function Wt(Ze){var et=r(Ze);function ht(_t,zt){return[_t*et,d(zt)/et]}return ht.invert=function(_t,zt){return[_t/et,L(zt*et)]},ht}function _r(){return ft(Wt).parallel(38.58).scale(195.044)}function pr(Ze){var et=r(Ze);function ht(_t,zt){return[_t*et,(1+et)*T(zt/2)]}return ht.invert=function(_t,zt){return[_t/et,e(zt/(1+et))*2]},ht}function hr(){return ft(pr).scale(124.75)}function Fr(Ze,et){var ht=F(8/(3*x));return[ht*Ze*(1-E(et)/x),ht*et]}Fr.invert=function(Ze,et){var ht=F(8/(3*x)),_t=et/ht;return[Ze/(ht*(1-E(_t)/x)),_t]};function En(){return b.geoProjection(Fr).scale(165.664)}function Kn(Ze,et){var ht=F(4-3*d(E(et)));return[2/F(6*x)*Ze*ht,p(et)*F(2*x/3)*(2-ht)]}Kn.invert=function(Ze,et){var ht=2-E(et)/F(2*x/3);return[Ze*F(6*x)/(2*ht),p(et)*L((4-ht*ht)/3)]};function qn(){return b.geoProjection(Kn).scale(165.664)}function ta(Ze,et){var ht=F(x*(4+x));return[2/ht*Ze*(1+F(1-4*et*et/(x*x))),4/ht*et]}ta.invert=function(Ze,et){var ht=F(x*(4+x))/2;return[Ze*ht/(1+F(1-et*et*(4+x)/(4*x))),et*ht/2]};function ra(){return b.geoProjection(ta).scale(180.739)}function Nn(Ze,et){var ht=(2+A)*d(et);et/=2;for(var _t=0,zt=1/0;_t<10&&E(zt)>l;_t++){var Et=r(et);et-=zt=(et+d(et)*(Et+2)-ht)/(2*Et*(1+Et))}return[2/F(x*(4+x))*Ze*(1+r(et)),2*F(x/(4+x))*d(et)]}Nn.invert=function(Ze,et){var ht=et*F((4+x)/x)/2,_t=L(ht),zt=r(_t);return[Ze/(2/F(x*(4+x))*(1+zt)),L((_t+ht*(zt+2))/(2+A))]};function ka(){return b.geoProjection(Nn).scale(180.739)}function qa(Ze,et){return[Ze*(1+r(et))/F(2+x),2*et/F(2+x)]}qa.invert=function(Ze,et){var ht=F(2+x),_t=et*ht/2;return[ht*Ze/(1+r(_t)),_t]};function ir(){return b.geoProjection(qa).scale(173.044)}function qt(Ze,et){for(var ht=(1+A)*d(et),_t=0,zt=1/0;_t<10&&E(zt)>l;_t++)et-=zt=(et+d(et)-ht)/(1+r(et));return ht=F(2+x),[Ze*(1+r(et))/ht,2*et/ht]}qt.invert=function(Ze,et){var ht=1+A,_t=F(ht/2);return[Ze*2*_t/(1+r(et*=_t)),L((et+d(et))/ht)]};function ar(){return b.geoProjection(qt).scale(173.044)}var lr=3+2*w;function Vr(Ze,et){var ht=d(Ze/=2),_t=r(Ze),zt=F(r(et)),Et=r(et/=2),Ut=d(et)/(Et+w*_t*zt),mr=F(2/(1+Ut*Ut)),Tr=F((w*Et+(_t+ht)*zt)/(w*Et+(_t-ht)*zt));return[lr*(mr*(Tr-1/Tr)-2*i(Tr)),lr*(mr*Ut*(Tr+1/Tr)-2*e(Ut))]}Vr.invert=function(Ze,et){if(!(Et=ee.invert(Ze/1.2,et*1.065)))return null;var ht=Et[0],_t=Et[1],zt=20,Et;Ze/=lr,et/=lr;do{var Ut=ht/2,mr=_t/2,Tr=d(Ut),Lr=r(Ut),Gr=d(mr),on=r(mr),Mn=r(_t),Pn=F(Mn),Yn=Gr/(on+w*Lr*Pn),wa=Yn*Yn,ni=F(2/(1+wa)),Ka=w*on+(Lr+Tr)*Pn,ii=w*on+(Lr-Tr)*Pn,$i=Ka/ii,Ao=F($i),mo=Ao-1/Ao,$o=Ao+1/Ao,Js=ni*mo-2*i(Ao)-Ze,Qs=ni*Yn*$o-2*e(Yn)-et,Ls=Gr&&_*Pn*Tr*wa/Gr,al=(w*Lr*on+Pn)/(2*(on+w*Lr*Pn)*(on+w*Lr*Pn)*Pn),vu=-.5*Yn*ni*ni*ni,ru=vu*Ls,Ps=vu*al,Rs=(Rs=2*on+w*Pn*(Lr-Tr))*Rs*Ao,Cu=(w*Lr*on*Pn+Mn)/Rs,oc=-(w*Tr*Gr)/(Pn*Rs),Oc=mo*ru-2*Cu/Ao+ni*(Cu+Cu/$i),ge=mo*Ps-2*oc/Ao+ni*(oc+oc/$i),Oe=Yn*$o*ru-2*Ls/(1+wa)+ni*$o*Ls+ni*Yn*(Cu-Cu/$i),tt=Yn*$o*Ps-2*al/(1+wa)+ni*$o*al+ni*Yn*(oc-oc/$i),xt=ge*Oe-tt*Oc;if(!xt)break;var St=(Qs*ge-Js*tt)/xt,It=(Js*Oe-Qs*Oc)/xt;ht-=St,_t=a(-A,s(A,_t-It))}while((E(St)>l||E(It)>l)&&--zt>0);return E(E(_t)-A)_t){var on=F(Gr),Mn=t(Lr,Tr),Pn=ht*c(Mn/ht),Yn=Mn-Pn,wa=Ze*r(Yn),ni=(Ze*d(Yn)-Yn*d(wa))/(A-wa),Ka=yt(Yn,ni),ii=(x-Ze)/kr(Ka,wa,x);Tr=on;var $i=50,Ao;do Tr-=Ao=(Ze+kr(Ka,wa,Tr)*ii-on)/(Ka(Tr)*ii);while(E(Ao)>l&&--$i>0);Lr=Yn*d(Tr),Tr_t){var Tr=F(mr),Lr=t(Ut,Et),Gr=ht*c(Lr/ht),on=Lr-Gr;Et=Tr*r(on),Ut=Tr*d(on);for(var Mn=Et-A,Pn=d(Et),Yn=Ut/Pn,wa=Etl||E(Yn)>l)&&--wa>0);return[on,Mn]},Tr}var Ir=jr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function Ur(){return b.geoProjection(Ir).scale(149.995)}var ln=jr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function $r(){return b.geoProjection(ln).scale(153.93)}var At=jr(5/6*x,-.62636,-.0344,0,1.3493,-.05524,0,.045);function or(){return b.geoProjection(At).scale(130.945)}function Dr(Ze,et){var ht=Ze*Ze,_t=et*et;return[Ze*(1-.162388*_t)*(.87-952426e-9*ht*ht),et*(1+_t/12)]}Dr.invert=function(Ze,et){var ht=Ze,_t=et,zt=50,Et;do{var Ut=_t*_t;_t-=Et=(_t*(1+Ut/12)-et)/(1+Ut/4)}while(E(Et)>l&&--zt>0);zt=50,Ze/=1-.162388*Ut;do{var mr=(mr=ht*ht)*mr;ht-=Et=(ht*(.87-952426e-9*mr)-Ze)/(.87-.00476213*mr)}while(E(Et)>l&&--zt>0);return[ht,_t]};function un(){return b.geoProjection(Dr).scale(131.747)}var Rn=jr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function jn(){return b.geoProjection(Rn).scale(131.087)}function Un(Ze){var et=Ze(A,0)[0]-Ze(-A,0)[0];function ht(_t,zt){var Et=_t>0?-.5:.5,Ut=Ze(_t+Et*x,zt);return Ut[0]-=Et*et,Ut}return Ze.invert&&(ht.invert=function(_t,zt){var Et=_t>0?-.5:.5,Ut=Ze.invert(_t+Et*et,zt),mr=Ut[0]-Et*x;return mr<-x?mr+=2*x:mr>x&&(mr-=2*x),Ut[0]=mr,Ut}),ht}function cn(Ze,et){var ht=p(Ze),_t=p(et),zt=r(et),Et=r(Ze)*zt,Ut=d(Ze)*zt,mr=d(_t*et);Ze=E(t(Ut,mr)),et=L(Et),E(Ze-A)>l&&(Ze%=A);var Tr=In(Ze>x/4?A-Ze:Ze,et);return Ze>x/4&&(mr=Tr[0],Tr[0]=-Tr[1],Tr[1]=-mr),Tr[0]*=ht,Tr[1]*=-_t,Tr}cn.invert=function(Ze,et){E(Ze)>1&&(Ze=p(Ze)*2-Ze),E(et)>1&&(et=p(et)*2-et);var ht=p(Ze),_t=p(et),zt=-ht*Ze,Et=-_t*et,Ut=Et/zt<1,mr=xi(Ut?Et:zt,Ut?zt:Et),Tr=mr[0],Lr=mr[1],Gr=r(Lr);return Ut&&(Tr=-A-Tr),[ht*(t(d(Tr)*Gr,-d(Lr))+x),_t*L(r(Tr)*Gr)]};function In(Ze,et){if(et===A)return[0,0];var ht=d(et),_t=ht*ht,zt=_t*_t,Et=1+zt,Ut=1+3*zt,mr=1-zt,Tr=L(1/F(Et)),Lr=mr+_t*Et*Tr,Gr=(1-ht)/Lr,on=F(Gr),Mn=Gr*Et,Pn=F(Mn),Yn=on*mr,wa,ni;if(Ze===0)return[0,-(Yn+_t*Pn)];var Ka=r(et),ii=1/Ka,$i=2*ht*Ka,Ao=(-3*_t+Tr*Ut)*$i,mo=(-Lr*Ka-(1-ht)*Ao)/(Lr*Lr),$o=.5*mo/on,Js=mr*$o-2*_t*on*$i,Qs=_t*Et*mo+Gr*Ut*$i,Ls=-ii*$i,al=-ii*Qs,vu=-2*ii*Js,ru=4*Ze/x,Ps;if(Ze>.222*x||et.175*x){if(wa=(Yn+_t*F(Mn*(1+zt)-Yn*Yn))/(1+zt),Ze>x/4)return[wa,wa];var Rs=wa,Cu=.5*wa;wa=.5*(Cu+Rs),ni=50;do{var oc=F(Mn-wa*wa),Oc=wa*(vu+Ls*oc)+al*L(wa/Pn)-ru;if(!Oc)break;Oc<0?Cu=wa:Rs=wa,wa=.5*(Cu+Rs)}while(E(Rs-Cu)>l&&--ni>0)}else{wa=l,ni=25;do{var ge=wa*wa,Oe=F(Mn-ge),tt=vu+Ls*Oe,xt=wa*tt+al*L(wa/Pn)-ru,St=tt+(al-Ls*ge)/Oe;wa-=Ps=Oe?xt/St:0}while(E(Ps)>l&&--ni>0)}return[wa,-Yn-_t*F(Mn-wa*wa)]}function xi(Ze,et){for(var ht=0,_t=1,zt=.5,Et=50;;){var Ut=zt*zt,mr=F(zt),Tr=L(1/F(1+Ut)),Lr=1-Ut+zt*(1+Ut)*Tr,Gr=(1-mr)/Lr,on=F(Gr),Mn=Gr*(1+Ut),Pn=on*(1-Ut),Yn=Mn-Ze*Ze,wa=F(Yn),ni=et+Pn+zt*wa;if(E(_t-ht)0?ht=zt:_t=zt,zt=.5*(ht+_t)}if(!Et)return null;var Ka=L(mr),ii=r(Ka),$i=1/ii,Ao=2*mr*ii,mo=(-3*zt+Tr*(1+3*Ut))*Ao,$o=(-Lr*ii-(1-mr)*mo)/(Lr*Lr),Js=.5*$o/on,Qs=(1-Ut)*Js-2*zt*on*Ao,Ls=-2*$i*Qs,al=-$i*Ao,vu=-$i*(zt*(1+Ut)*$o+Gr*(1+3*Ut)*Ao);return[x/4*(Ze*(Ls+al*wa)+vu*L(Ze/F(Mn))),Ka]}function Ea(){return b.geoProjection(Un(cn)).scale(239.75)}function Pi(Ze,et,ht){var _t,zt,Et;return Ze?(_t=Xi(Ze,ht),et?(zt=Xi(et,1-ht),Et=zt[1]*zt[1]+ht*_t[0]*_t[0]*zt[0]*zt[0],[[_t[0]*zt[2]/Et,_t[1]*_t[2]*zt[0]*zt[1]/Et],[_t[1]*zt[1]/Et,-_t[0]*_t[2]*zt[0]*zt[2]/Et],[_t[2]*zt[1]*zt[2]/Et,-ht*_t[0]*_t[1]*zt[0]/Et]]):[[_t[0],0],[_t[1],0],[_t[2],0]]):(zt=Xi(et,1-ht),[[0,zt[0]/zt[1]],[1/zt[1],0],[zt[2]/zt[1],0]])}function Xi(Ze,et){var ht,_t,zt,Et,Ut;if(et=1-l)return ht=(1-et)/4,_t=R(Ze),Et=N(Ze),zt=1/_t,Ut=_t*B(Ze),[Et+ht*(Ut-Ze)/(_t*_t),zt-ht*Et*zt*(Ut-Ze),zt+ht*Et*zt*(Ut+Ze),2*e(o(Ze))-A+ht*(Ut-Ze)/_t];var mr=[1,0,0,0,0,0,0,0,0],Tr=[F(et),0,0,0,0,0,0,0,0],Lr=0;for(_t=F(1-et),Ut=1;E(Tr[Lr]/mr[Lr])>l&&Lr<8;)ht=mr[Lr++],Tr[Lr]=(ht-_t)/2,mr[Lr]=(ht+_t)/2,_t=F(ht*_t),Ut*=2;zt=Ut*mr[Lr]*Ze;do Et=Tr[Lr]*d(_t=zt)/mr[Lr],zt=(L(Et)+zt)/2;while(--Lr);return[d(zt),Et=r(zt),Et/r(zt-_t),zt]}function uo(Ze,et,ht){var _t=E(Ze),zt=E(et),Et=B(zt);if(_t){var Ut=1/d(_t),mr=1/(T(_t)*T(_t)),Tr=-(mr+ht*(Et*Et*Ut*Ut)-1+ht),Lr=(ht-1)*mr,Gr=(-Tr+F(Tr*Tr-4*Lr))/2;return[so(e(1/F(Gr)),ht)*p(Ze),so(e(F((Gr/mr-1)/ht)),1-ht)*p(et)]}return[0,so(e(Et),1-ht)*p(et)]}function so(Ze,et){if(!et)return Ze;if(et===1)return i(T(Ze/2+M));for(var ht=1,_t=F(1-et),zt=F(et),Et=0;E(zt)>l;Et++){if(Ze%x){var Ut=e(_t*T(Ze)/ht);Ut<0&&(Ut+=x),Ze+=Ut+~~(Ze/x)*x}else Ze+=Ze;zt=(ht+_t)/2,_t=F(ht*_t),zt=((ht=zt)-_t)/2}return Ze/(f(2,Et)*ht)}function Eo(Ze,et){var ht=(w-1)/(w+1),_t=F(1-ht*ht),zt=so(A,_t*_t),Et=-1,Ut=i(T(x/4+E(et)/2)),mr=o(Et*Ut)/F(ht),Tr=vi(mr*r(Et*Ze),mr*d(Et*Ze)),Lr=uo(Tr[0],Tr[1],_t*_t);return[-Lr[1],(et>=0?1:-1)*(.5*zt-Lr[0])]}function vi(Ze,et){var ht=Ze*Ze,_t=et+1,zt=1-ht-et*et;return[.5*((Ze>=0?A:-A)-t(zt,2*Ze)),-.25*i(zt*zt+4*ht)+.5*i(_t*_t+ht)]}function ns(Ze,et){var ht=et[0]*et[0]+et[1]*et[1];return[(Ze[0]*et[0]+Ze[1]*et[1])/ht,(Ze[1]*et[0]-Ze[0]*et[1])/ht]}Eo.invert=function(Ze,et){var ht=(w-1)/(w+1),_t=F(1-ht*ht),zt=so(A,_t*_t),Et=-1,Ut=Pi(.5*zt-et,-Ze,_t*_t),mr=ns(Ut[0],Ut[1]),Tr=t(mr[1],mr[0])/Et;return[Tr,2*e(o(.5/Et*i(ht*mr[0]*mr[0]+ht*mr[1]*mr[1])))-A]};function Xo(){return b.geoProjection(Un(Eo)).scale(151.496)}function Ys(Ze){var et=d(Ze),ht=r(Ze),_t=vs(Ze);_t.invert=vs(-Ze);function zt(Et,Ut){var mr=_t(Et,Ut);Et=mr[0],Ut=mr[1];var Tr=d(Ut),Lr=r(Ut),Gr=r(Et),on=z(et*Tr+ht*Lr*Gr),Mn=d(on),Pn=E(Mn)>l?on/Mn:1;return[Pn*ht*d(Et),(E(Et)>A?Pn:-Pn)*(et*Lr-ht*Tr*Gr)]}return zt.invert=function(Et,Ut){var mr=F(Et*Et+Ut*Ut),Tr=-d(mr),Lr=r(mr),Gr=mr*Lr,on=-Ut*Tr,Mn=mr*et,Pn=F(Gr*Gr+on*on-Mn*Mn),Yn=t(Gr*Mn+on*Pn,on*Mn-Gr*Pn),wa=(mr>A?-1:1)*t(Et*Tr,mr*r(Yn)*Lr+Ut*d(Yn)*Tr);return _t.invert(wa,Yn)},zt}function vs(Ze){var et=d(Ze),ht=r(Ze);return function(_t,zt){var Et=r(zt),Ut=r(_t)*Et,mr=d(_t)*Et,Tr=d(zt);return[t(mr,Ut*ht-Tr*et),L(Tr*ht+Ut*et)]}}function es(){var Ze=0,et=b.geoProjectionMutator(Ys),ht=et(Ze),_t=ht.rotate,zt=ht.stream,Et=b.geoCircle();return ht.parallel=function(Ut){if(!arguments.length)return Ze*v;var mr=ht.rotate();return et(Ze=Ut*y).rotate(mr)},ht.rotate=function(Ut){return arguments.length?(_t.call(ht,[Ut[0],Ut[1]-Ze*v]),Et.center([-Ut[0],-Ut[1]]),ht):(Ut=_t.call(ht),Ut[1]+=Ze*v,Ut)},ht.stream=function(Ut){return Ut=zt(Ut),Ut.sphere=function(){Ut.polygonStart();var mr=.01,Tr=Et.radius(90-mr)().coordinates[0],Lr=Tr.length-1,Gr=-1,on;for(Ut.lineStart();++Gr=0;)Ut.point((on=Tr[Gr])[0],on[1]);Ut.lineEnd(),Ut.polygonEnd()},Ut},ht.scale(79.4187).parallel(45).clipAngle(180-.001)}var qo=3,Zs=L(1-1/qo)*v,Hs=Wt(0);function sl(Ze){var et=Zs*y,ht=ye(x,et)[0]-ye(-x,et)[0],_t=Hs(0,et)[1],zt=ye(0,et)[1],Et=m-zt,Ut=u/Ze,mr=4/u,Tr=_t+Et*Et*4/u;function Lr(Gr,on){var Mn,Pn=E(on);if(Pn>et){var Yn=s(Ze-1,a(0,n((Gr+x)/Ut)));Gr+=x*(Ze-1)/Ze-Yn*Ut,Mn=ye(Gr,Pn),Mn[0]=Mn[0]*u/ht-u*(Ze-1)/(2*Ze)+Yn*u/Ze,Mn[1]=_t+(Mn[1]-zt)*4*Et/u,on<0&&(Mn[1]=-Mn[1])}else Mn=Hs(Gr,on);return Mn[0]*=mr,Mn[1]/=Tr,Mn}return Lr.invert=function(Gr,on){Gr/=mr,on*=Tr;var Mn=E(on);if(Mn>_t){var Pn=s(Ze-1,a(0,n((Gr+x)/Ut)));Gr=(Gr+x*(Ze-1)/Ze-Pn*Ut)*ht/u;var Yn=ye.invert(Gr,.25*(Mn-_t)*u/Et+zt);return Yn[0]-=x*(Ze-1)/Ze-Pn*Ut,on<0&&(Yn[1]=-Yn[1]),Yn}return Hs.invert(Gr,on)},Lr}function ds(Ze,et){return[Ze,et&1?90-l:Zs]}function Ko(Ze,et){return[Ze,et&1?-90+l:-Zs]}function _o(Ze){return[Ze[0]*(1-l),Ze[1]]}function ps(Ze){var et=[].concat(S.range(-180,180+Ze/2,Ze).map(ds),S.range(180,-180-Ze/2,-Ze).map(Ko));return{type:"Polygon",coordinates:[Ze===180?et.map(_o):et]}}function ll(){var Ze=4,et=b.geoProjectionMutator(sl),ht=et(Ze),_t=ht.stream;return ht.lobes=function(zt){return arguments.length?et(Ze=+zt):Ze},ht.stream=function(zt){var Et=ht.rotate(),Ut=_t(zt),mr=(ht.rotate([0,0]),_t(zt));return ht.rotate(Et),Ut.sphere=function(){b.geoStream(ps(180/Ze),mr)},Ut},ht.scale(239.75)}function kl(Ze){var et=1+Ze,ht=d(1/et),_t=L(ht),zt=2*F(x/(Et=x+4*_t*et)),Et,Ut=.5*zt*(et+F(Ze*(2+Ze))),mr=Ze*Ze,Tr=et*et;function Lr(Gr,on){var Mn=1-d(on),Pn,Yn;if(Mn&&Mn<2){var wa=A-on,ni=25,Ka;do{var ii=d(wa),$i=r(wa),Ao=_t+t(ii,et-$i),mo=1+Tr-2*et*$i;wa-=Ka=(wa-mr*_t-et*ii+mo*Ao-.5*Mn*Et)/(2*et*ii*Ao)}while(E(Ka)>g&&--ni>0);Pn=zt*F(mo),Yn=Gr*Ao/x}else Pn=zt*(Ze+Mn),Yn=Gr*_t/x;return[Pn*d(Yn),Ut-Pn*r(Yn)]}return Lr.invert=function(Gr,on){var Mn=Gr*Gr+(on-=Ut)*on,Pn=(1+Tr-Mn/(zt*zt))/(2*et),Yn=z(Pn),wa=d(Yn),ni=_t+t(wa,et-Pn);return[L(Gr/F(Mn))*x/ni,L(1-2*(Yn-mr*_t-et*wa+(1+Tr-2*et*Pn)*ni)/Et)]},Lr}function Rl(){var Ze=1,et=b.geoProjectionMutator(kl),ht=et(Ze);return ht.ratio=function(_t){return arguments.length?et(Ze=+_t):Ze},ht.scale(167.774).center([0,18.67])}var Cs=.7109889596207567,pi=.0528035274542;function no(Ze,et){return et>-Cs?(Ze=Qe(Ze,et),Ze[1]+=pi,Ze):rt(Ze,et)}no.invert=function(Ze,et){return et>-Cs?Qe.invert(Ze,et-pi):rt.invert(Ze,et)};function Cl(){return b.geoProjection(no).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Ds(Ze,et){return E(et)>Cs?(Ze=Qe(Ze,et),Ze[1]-=et>0?pi:-pi,Ze):rt(Ze,et)}Ds.invert=function(Ze,et){return E(et)>Cs?Qe.invert(Ze,et+(et>0?pi:-pi)):rt.invert(Ze,et)};function No(){return b.geoProjection(Ds).scale(152.63)}function Il(Ze,et,ht,_t){var zt=F(4*x/(2*ht+(1+Ze-et/2)*d(2*ht)+(Ze+et)/2*d(4*ht)+et/2*d(6*ht))),Et=F(_t*d(ht)*F((1+Ze*r(2*ht)+et*r(4*ht))/(1+Ze+et))),Ut=ht*Tr(1);function mr(on){return F(1+Ze*r(2*on)+et*r(4*on))}function Tr(on){var Mn=on*ht;return(2*Mn+(1+Ze-et/2)*d(2*Mn)+(Ze+et)/2*d(4*Mn)+et/2*d(6*Mn))/ht}function Lr(on){return mr(on)*d(on)}var Gr=function(on,Mn){var Pn=ht*Fe(Tr,Ut*d(Mn)/ht,Mn/x);isNaN(Pn)&&(Pn=ht*p(Mn));var Yn=zt*mr(Pn);return[Yn*Et*on/x*r(Pn),Yn/Et*d(Pn)]};return Gr.invert=function(on,Mn){var Pn=Fe(Lr,Mn*Et/zt);return[on*x/(r(Pn)*zt*Et*mr(Pn)),L(ht*Tr(Pn/ht)/Ut)]},ht===0&&(zt=F(_t/x),Gr=function(on,Mn){return[on*zt,d(Mn)/zt]},Gr.invert=function(on,Mn){return[on/zt,L(Mn*zt)]}),Gr}function Ws(){var Ze=1,et=0,ht=45*y,_t=2,zt=b.geoProjectionMutator(Il),Et=zt(Ze,et,ht,_t);return Et.a=function(Ut){return arguments.length?zt(Ze=+Ut,et,ht,_t):Ze},Et.b=function(Ut){return arguments.length?zt(Ze,et=+Ut,ht,_t):et},Et.psiMax=function(Ut){return arguments.length?zt(Ze,et,ht=+Ut*y,_t):ht*v},Et.ratio=function(Ut){return arguments.length?zt(Ze,et,ht,_t=+Ut):_t},Et.scale(180.739)}function ul(Ze,et,ht,_t,zt,Et,Ut,mr,Tr,Lr,Gr){if(Gr.nanEncountered)return NaN;var on,Mn,Pn,Yn,wa,ni,Ka,ii,$i,Ao;if(on=ht-et,Mn=Ze(et+on*.25),Pn=Ze(ht-on*.25),isNaN(Mn)){Gr.nanEncountered=!0;return}if(isNaN(Pn)){Gr.nanEncountered=!0;return}return Yn=on*(_t+4*Mn+zt)/12,wa=on*(zt+4*Pn+Et)/12,ni=Yn+wa,Ao=(ni-Ut)/15,Lr>Tr?(Gr.maxDepthCount++,ni+Ao):Math.abs(Ao)>1;do Tr[ni]>Pn?wa=ni:Yn=ni,ni=Yn+wa>>1;while(ni>Yn);var Ka=Tr[ni+1]-Tr[ni];return Ka&&(Ka=(Pn-Tr[ni+1])/Ka),(ni+1+Ka)/Ut}var on=2*Gr(1)/x*Et/ht,Mn=function(Pn,Yn){var wa=Gr(E(d(Yn))),ni=_t(wa)*Pn;return wa/=on,[ni,Yn>=0?wa:-wa]};return Mn.invert=function(Pn,Yn){var wa;return Yn*=on,E(Yn)<1&&(wa=p(Yn)*L(zt(E(Yn))*Et)),[Pn/_t(E(Yn)),wa]},Mn}function _s(){var Ze=0,et=2.5,ht=1.183136,_t=b.geoProjectionMutator(eo),zt=_t(Ze,et,ht);return zt.alpha=function(Et){return arguments.length?_t(Ze=+Et,et,ht):Ze},zt.k=function(Et){return arguments.length?_t(Ze,et=+Et,ht):et},zt.gamma=function(Et){return arguments.length?_t(Ze,et,ht=+Et):ht},zt.scale(152.63)}function as(Ze,et){return E(Ze[0]-et[0])=0;--Tr)ht=Ze[1][Tr],_t=ht[0][0],zt=ht[0][1],Et=ht[1][1],Ut=ht[2][0],mr=ht[2][1],et.push(Hl([[Ut-l,mr-l],[Ut-l,Et+l],[_t+l,Et+l],[_t+l,zt-l]],30));return{type:"Polygon",coordinates:[S.merge(et)]}}function Do(Ze,et,ht){var _t,zt;function Et(Tr,Lr){for(var Gr=Lr<0?-1:1,on=et[+(Lr<0)],Mn=0,Pn=on.length-1;Mnon[Mn][2][0];++Mn);var Yn=Ze(Tr-on[Mn][1][0],Lr);return Yn[0]+=Ze(on[Mn][1][0],Gr*Lr>Gr*on[Mn][0][1]?on[Mn][0][1]:Lr)[0],Yn}ht?Et.invert=ht(Et):Ze.invert&&(Et.invert=function(Tr,Lr){for(var Gr=zt[+(Lr<0)],on=et[+(Lr<0)],Mn=0,Pn=Gr.length;MnYn&&(wa=Pn,Pn=Yn,Yn=wa),[[on,Pn],[Mn,Yn]]})}),Ut):et.map(function(Lr){return Lr.map(function(Gr){return[[Gr[0][0]*v,Gr[0][1]*v],[Gr[1][0]*v,Gr[1][1]*v],[Gr[2][0]*v,Gr[2][1]*v]]})})},et!=null&&Ut.lobes(et),Ut}var su=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function fu(){return Do(Ne,su).scale(160.857)}var Bs=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function wl(){return Do(Ds,Bs).scale(152.63)}var Bl=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function jl(){return Do(Qe,Bl).scale(169.529)}var Hu=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function uf(){return Do(Qe,Hu).scale(169.529).rotate([20,0])}var qc=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function Qc(){return Do(no,qc,ze).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Lh=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function yh(){return Do(rt,Lh).scale(152.63).rotate([-20,0])}function Tl(Ze,et){return[3/u*Ze*F(x*x/3-et*et),et]}Tl.invert=function(Ze,et){return[u/3*Ze/F(x*x/3-et*et),et]};function Lc(){return b.geoProjection(Tl).scale(158.837)}function Ph(Ze){function et(ht,_t){if(E(E(_t)-A)2)return null;ht/=2,_t/=2;var Et=ht*ht,Ut=_t*_t,mr=2*_t/(1+Et+Ut);return mr=f((1+mr)/(1-mr),1/Ze),[t(2*ht,1-Et-Ut)/Ze,L((mr-1)/(mr+1))]},et}function nc(){var Ze=.5,et=b.geoProjectionMutator(Ph),ht=et(Ze);return ht.spacing=function(_t){return arguments.length?et(Ze=+_t):Ze},ht.scale(124.75)}var Gu=x/w;function ac(Ze,et){return[Ze*(1+F(r(et)))/2,et/(r(et/2)*r(Ze/6))]}ac.invert=function(Ze,et){var ht=E(Ze),_t=E(et),zt=l,Et=A;_tl||E(ni)>l)&&--zt>0);return zt&&[ht,_t]};function Xu(){return b.geoProjection(Kl).scale(139.98)}function Gs(Ze,et){return[d(Ze)/r(et),T(et)*r(Ze)]}Gs.invert=function(Ze,et){var ht=Ze*Ze,_t=et*et,zt=_t+1,Et=ht+zt,Ut=Ze?_*F((Et-F(Et*Et-4*ht))/ht):1/F(zt);return[L(Ze*Ut),p(et)*z(Ut)]};function Dl(){return b.geoProjection(Gs).scale(144.049).clipAngle(90-.001)}function wf(Ze){var et=r(Ze),ht=T(M+Ze/2);function _t(zt,Et){var Ut=Et-Ze,mr=E(Ut)=0;)Gr=Ze[Lr],on=Gr[0]+mr*(Pn=on)-Tr*Mn,Mn=Gr[1]+mr*Mn+Tr*Pn;return on=mr*(Pn=on)-Tr*Mn,Mn=mr*Mn+Tr*Pn,[on,Mn]}return ht.invert=function(_t,zt){var Et=20,Ut=_t,mr=zt;do{for(var Tr=et,Lr=Ze[Tr],Gr=Lr[0],on=Lr[1],Mn=0,Pn=0,Yn;--Tr>=0;)Lr=Ze[Tr],Mn=Gr+Ut*(Yn=Mn)-mr*Pn,Pn=on+Ut*Pn+mr*Yn,Gr=Lr[0]+Ut*(Yn=Gr)-mr*on,on=Lr[1]+Ut*on+mr*Yn;Mn=Gr+Ut*(Yn=Mn)-mr*Pn,Pn=on+Ut*Pn+mr*Yn,Gr=Ut*(Yn=Gr)-mr*on-_t,on=Ut*on+mr*Yn-zt;var wa=Mn*Mn+Pn*Pn,ni,Ka;Ut-=ni=(Gr*Mn+on*Pn)/wa,mr-=Ka=(on*Mn-Gr*Pn)/wa}while(E(ni)+E(Ka)>l*l&&--Et>0);if(Et){var ii=F(Ut*Ut+mr*mr),$i=2*e(ii*.5),Ao=d($i);return[t(Ut*Ao,ii*r($i)),ii?L(mr*Ao/ii):0]}},ht}var Ns=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Bv=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],dl=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Bo=[[.9245,0],[0,0],[.01943,0]],Kf=[[.721316,0],[0,0],[-.00881625,-.00617325]];function tf(){return Yu(Ns,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Iu(){return Yu(Bv,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Rh(){return Yu(dl,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Df(){return Yu(Bo,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function ih(){return Yu(Kf,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Yu(Ze,et){var ht=b.geoProjection(bv(Ze)).rotate(et).clipAngle(90),_t=b.geoRotation(et),zt=ht.center;return delete ht.rotate,ht.center=function(Et){return arguments.length?zt(_t(Et)):_t.invert(zt())},ht}var sv=F(6),Uh=F(7);function oh(Ze,et){var ht=L(7*d(et)/(3*sv));return[sv*Ze*(2*r(2*ht/3)-1)/Uh,9*d(ht/3)/Uh]}oh.invert=function(Ze,et){var ht=3*L(et*Uh/9);return[Ze*Uh/(sv*(2*r(2*ht/3)-1)),L(d(ht)*3*sv/7)]};function zf(){return b.geoProjection(oh).scale(164.859)}function Ih(Ze,et){for(var ht=(1+_)*d(et),_t=et,zt=0,Et;zt<25&&(_t-=Et=(d(_t/2)+d(_t)-ht)/(.5*r(_t/2)+r(_t)),!(E(Et)g&&--_t>0);return Et=ht*ht,Ut=Et*Et,mr=Et*Ut,[Ze/(.84719-.13063*Et+mr*mr*(-.04515+.05494*Et-.02326*Ut+.00331*mr)),ht]};function cf(){return b.geoProjection(Tf).scale(175.295)}function Zu(Ze,et){return[Ze*(1+r(et))/2,2*(et-T(et/2))]}Zu.invert=function(Ze,et){for(var ht=et/2,_t=0,zt=1/0;_t<10&&E(zt)>l;++_t){var Et=r(et/2);et-=zt=(et-T(et/2)-ht)/(1-.5/(Et*Et))}return[2*Ze/(1+r(et)),et]};function Hf(){return b.geoProjection(Zu).scale(152.63)}var zh=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Nl(){return Do(ve(1/0),zh).rotate([20,0]).scale(152.63)}function _h(Ze,et){var ht=d(et),_t=r(et),zt=p(Ze);if(Ze===0||E(et)===A)return[0,et];if(et===0)return[Ze,0];if(E(Ze)===A)return[Ze*_t,A*ht];var Et=x/(2*Ze)-2*Ze/x,Ut=2*et/x,mr=(1-Ut*Ut)/(ht-Ut),Tr=Et*Et,Lr=mr*mr,Gr=1+Tr/Lr,on=1+Lr/Tr,Mn=(Et*ht/mr-Et/2)/Gr,Pn=(Lr*ht/Tr+mr/2)/on,Yn=Mn*Mn+_t*_t/Gr,wa=Pn*Pn-(Lr*ht*ht/Tr+mr*ht-1)/on;return[A*(Mn+F(Yn)*zt),A*(Pn+F(wa<0?0:wa)*p(-et*Et)*zt)]}_h.invert=function(Ze,et){Ze/=A,et/=A;var ht=Ze*Ze,_t=et*et,zt=ht+_t,Et=x*x;return[Ze?(zt-1+F((1-zt)*(1-zt)+4*ht))/(2*Ze)*A:0,Fe(function(Ut){return zt*(x*d(Ut)-2*Ut)*x+4*Ut*Ut*(et-d(Ut))+2*x*Ut-Et*et},0)]};function wv(){return b.geoProjection(_h).scale(127.267)}var qh=1.0148,sh=.23185,Vh=-.14499,Pc=.02406,Hh=qh,yu=5*sh,Rc=7*Vh,Of=9*Pc,$l=1.790857183;function Af(Ze,et){var ht=et*et;return[Ze,et*(qh+ht*ht*(sh+ht*(Vh+Pc*ht)))]}Af.invert=function(Ze,et){et>$l?et=$l:et<-$l&&(et=-$l);var ht=et,_t;do{var zt=ht*ht;ht-=_t=(ht*(qh+zt*zt*(sh+zt*(Vh+Pc*zt)))-et)/(Hh+zt*zt*(yu+zt*(Rc+Of*zt)))}while(E(_t)>l);return[Ze,ht]};function vc(){return b.geoProjection(Af).scale(139.319)}function Ic(Ze,et){if(E(et)l&&--zt>0);return Ut=T(_t),[(E(et)=0;)if(_t=et[mr],ht[0]===_t[0]&&ht[1]===_t[1]){if(Et)return[Et,ht];Et=ht}}}function ic(Ze){for(var et=Ze.length,ht=[],_t=Ze[et-1],zt=0;zt0?[-_t[0],0]:[180-_t[0],180])};var et=eh.map(function(ht){return{face:ht,project:Ze(ht)}});return[-1,0,0,1,0,1,4,5].forEach(function(ht,_t){var zt=et[ht];zt&&(zt.children||(zt.children=[])).push(et[_t])}),Jf(et[0],function(ht,_t){return et[ht<-x/2?_t<0?6:4:ht<0?_t<0?2:0:ht_t^Pn>_t&&ht<(Mn-Lr)*(_t-Gr)/(Pn-Gr)+Lr&&(zt=!zt)}return zt}function lc(Ze,et){var ht=et.stream,_t;if(!ht)throw new Error("invalid projection");switch(Ze&&Ze.type){case"Feature":_t=Gc;break;case"FeatureCollection":_t=Xh;break;default:_t=vf;break}return _t(Ze,ht)}function Xh(Ze,et){return{type:"FeatureCollection",features:Ze.features.map(function(ht){return Gc(ht,et)})}}function Gc(Ze,et){return{type:"Feature",id:Ze.id,properties:Ze.properties,geometry:vf(Ze.geometry,et)}}function Sf(Ze,et){return{type:"GeometryCollection",geometries:Ze.geometries.map(function(ht){return vf(ht,et)})}}function vf(Ze,et){if(!Ze)return null;if(Ze.type==="GeometryCollection")return Sf(Ze,et);var ht;switch(Ze.type){case"Point":ht=hu;break;case"MultiPoint":ht=hu;break;case"LineString":ht=Nf;break;case"MultiLineString":ht=Nf;break;case"Polygon":ht=df;break;case"MultiPolygon":ht=df;break;case"Sphere":ht=df;break;default:return null}return b.geoStream(Ze,et(ht)),ht.result()}var bu=[],_c=[],hu={point:function(Ze,et){bu.push([Ze,et])},result:function(){var Ze=bu.length?bu.length<2?{type:"Point",coordinates:bu[0]}:{type:"MultiPoint",coordinates:bu}:null;return bu=[],Ze}},Nf={lineStart:hf,point:function(Ze,et){bu.push([Ze,et])},lineEnd:function(){bu.length&&(_c.push(bu),bu=[])},result:function(){var Ze=_c.length?_c.length<2?{type:"LineString",coordinates:_c[0]}:{type:"MultiLineString",coordinates:_c}:null;return _c=[],Ze}},df={polygonStart:hf,lineStart:hf,point:function(Ze,et){bu.push([Ze,et])},lineEnd:function(){var Ze=bu.length;if(Ze){do bu.push(bu[0].slice());while(++Ze<4);_c.push(bu),bu=[]}},polygonEnd:hf,result:function(){if(!_c.length)return null;var Ze=[],et=[];return _c.forEach(function(ht){ch(ht)?Ze.push([ht]):et.push(ht)}),et.forEach(function(ht){var _t=ht[0];Ze.some(function(zt){if(Av(zt[0],_t))return zt.push(ht),!0})||Ze.push([ht])}),_c=[],Ze.length?Ze.length>1?{type:"MultiPolygon",coordinates:Ze}:{type:"Polygon",coordinates:Ze[0]}:null}};function Fh(Ze){var et=Ze(A,0)[0]-Ze(-A,0)[0];function ht(_t,zt){var Et=E(_t)0?_t-x:_t+x,zt),mr=(Ut[0]-Ut[1])*_,Tr=(Ut[0]+Ut[1])*_;if(Et)return[mr,Tr];var Lr=et*_,Gr=mr>0^Tr>0?-1:1;return[Gr*mr-p(Tr)*Lr,Gr*Tr-p(mr)*Lr]}return Ze.invert&&(ht.invert=function(_t,zt){var Et=(_t+zt)*_,Ut=(zt-_t)*_,mr=E(Et)<.5*et&&E(Ut)<.5*et;if(!mr){var Tr=et*_,Lr=Et>0^Ut>0?-1:1,Gr=-Lr*_t+(Ut>0?1:-1)*Tr,on=-Lr*zt+(Et>0?1:-1)*Tr;Et=(-Gr-on)*_,Ut=(Gr-on)*_}var Mn=Ze.invert(Et,Ut);return mr||(Mn[0]+=Et>0?x:-x),Mn}),b.geoProjection(ht).rotate([-90,-90,45]).clipAngle(180-.001)}function ur(){return Fh(cn).scale(176.423)}function Pr(){return Fh(Eo).scale(111.48)}function dn(Ze,et){if(!(0<=(et=+et)&&et<=20))throw new Error("invalid digits");function ht(Lr){var Gr=Lr.length,on=2,Mn=new Array(Gr);for(Mn[0]=+Lr[0].toFixed(et),Mn[1]=+Lr[1].toFixed(et);on2||Pn[0]!=Gr[0]||Pn[1]!=Gr[1])&&(on.push(Pn),Gr=Pn)}return on.length===1&&Lr.length>1&&on.push(ht(Lr[Lr.length-1])),on}function Et(Lr){return Lr.map(zt)}function Ut(Lr){if(Lr==null)return Lr;var Gr;switch(Lr.type){case"GeometryCollection":Gr={type:"GeometryCollection",geometries:Lr.geometries.map(Ut)};break;case"Point":Gr={type:"Point",coordinates:ht(Lr.coordinates)};break;case"MultiPoint":Gr={type:Lr.type,coordinates:_t(Lr.coordinates)};break;case"LineString":Gr={type:Lr.type,coordinates:zt(Lr.coordinates)};break;case"MultiLineString":case"Polygon":Gr={type:Lr.type,coordinates:Et(Lr.coordinates)};break;case"MultiPolygon":Gr={type:"MultiPolygon",coordinates:Lr.coordinates.map(Et)};break;default:return Lr}return Lr.bbox!=null&&(Gr.bbox=Lr.bbox),Gr}function mr(Lr){var Gr={type:"Feature",properties:Lr.properties,geometry:Ut(Lr.geometry)};return Lr.id!=null&&(Gr.id=Lr.id),Lr.bbox!=null&&(Gr.bbox=Lr.bbox),Gr}if(Ze!=null)switch(Ze.type){case"Feature":return mr(Ze);case"FeatureCollection":{var Tr={type:"FeatureCollection",features:Ze.features.map(mr)};return Ze.bbox!=null&&(Tr.bbox=Ze.bbox),Tr}default:return Ut(Ze)}return Ze}function nn(Ze){var et=d(Ze);function ht(_t,zt){var Et=et?T(_t*et/2)/et:_t/2;if(!zt)return[2*Et,-Ze];var Ut=2*e(Et*d(zt)),mr=1/T(zt);return[d(Ut)*mr,zt+(1-r(Ut))*mr-Ze]}return ht.invert=function(_t,zt){if(E(zt+=Ze)l&&--mr>0);var Mn=_t*(Lr=T(Ut)),Pn=T(E(zt)0?A:-A)*(Tr+zt*(Gr-Ut)/2+zt*zt*(Gr-2*Tr+Ut)/2)]}xa.invert=function(Ze,et){var ht=et/A,_t=ht*90,zt=s(18,E(_t/5)),Et=a(0,n(zt));do{var Ut=Ta[Et][1],mr=Ta[Et+1][1],Tr=Ta[s(19,Et+2)][1],Lr=Tr-Ut,Gr=Tr-2*mr+Ut,on=2*(E(ht)-mr)/Lr,Mn=Gr/Lr,Pn=on*(1-Mn*on*(1-2*Mn*on));if(Pn>=0||Et===1){_t=(et>=0?5:-5)*(Pn+zt);var Yn=50,wa;do zt=s(18,E(_t)/5),Et=n(zt),Pn=zt-Et,Ut=Ta[Et][1],mr=Ta[Et+1][1],Tr=Ta[s(19,Et+2)][1],_t-=(wa=(et>=0?A:-A)*(mr+Pn*(Tr-Ut)/2+Pn*Pn*(Tr-2*mr+Ut)/2)-et)*v;while(E(wa)>g&&--Yn>0);break}}while(--Et>=0);var ni=Ta[Et][0],Ka=Ta[Et+1][0],ii=Ta[s(19,Et+2)][0];return[Ze/(Ka+Pn*(ii-ni)/2+Pn*Pn*(ii-2*Ka+ni)/2),_t*y]};function ri(){return b.geoProjection(xa).scale(152.63)}function fi(Ze){function et(ht,_t){var zt=r(_t),Et=(Ze-1)/(Ze-zt*r(ht));return[Et*zt*d(ht),Et*d(_t)]}return et.invert=function(ht,_t){var zt=ht*ht+_t*_t,Et=F(zt),Ut=(Ze-F(1-zt*(Ze+1)/(Ze-1)))/((Ze-1)/Et+Et/(Ze-1));return[t(ht*Ut,Et*F(1-Ut*Ut)),Et?L(_t*Ut/Et):0]},et}function Ni(Ze,et){var ht=fi(Ze);if(!et)return ht;var _t=r(et),zt=d(et);function Et(Ut,mr){var Tr=ht(Ut,mr),Lr=Tr[1],Gr=Lr*zt/(Ze-1)+_t;return[Tr[0]*_t/Gr,Lr/Gr]}return Et.invert=function(Ut,mr){var Tr=(Ze-1)/(Ze-1-mr*zt);return ht.invert(Tr*Ut,Tr*mr*_t)},Et}function Va(){var Ze=2,et=0,ht=b.geoProjectionMutator(Ni),_t=ht(Ze,et);return _t.distance=function(zt){return arguments.length?ht(Ze=+zt,et):Ze},_t.tilt=function(zt){return arguments.length?ht(Ze,et=zt*y):et*v},_t.scale(432.147).clipAngle(z(1/Ze)*v-1e-6)}var Ai=1e-4,ei=1e4,Na=-180,Zi=Na+Ai,jo=180,Fo=jo-Ai,Yo=-90,Vo=Yo+Ai,Ki=90,Ri=Ki-Ai;function is(Ze){return Ze.length>0}function Us(Ze){return Math.floor(Ze*ei)/ei}function Al(Ze){return Ze===Yo||Ze===Ki?[0,Ze]:[Na,Us(Ze)]}function Xl(Ze){var et=Ze[0],ht=Ze[1],_t=!1;return et<=Zi?(et=Na,_t=!0):et>=Fo&&(et=jo,_t=!0),ht<=Vo?(ht=Yo,_t=!0):ht>=Ri&&(ht=Ki,_t=!0),_t?[et,ht]:Ze}function Ml(Ze){return Ze.map(Xl)}function Yl(Ze,et,ht){for(var _t=0,zt=Ze.length;_t=Fo||Gr<=Vo||Gr>=Ri){Et[Ut]=Xl(Tr);for(var on=Ut+1;onZi&&PnVo&&Yn=mr)break;ht.push({index:-1,polygon:et,ring:Et=Et.slice(on-1)}),Et[0]=Al(Et[0][1]),Ut=-1,mr=Et.length}}}}function rl(Ze){var et,ht=Ze.length,_t={},zt={},Et,Ut,mr,Tr,Lr;for(et=0;et0?x-mr:mr)*v],Lr=b.geoProjection(Ze(Ut)).rotate(Tr),Gr=b.geoRotation(Tr),on=Lr.center;return delete Lr.rotate,Lr.center=function(Mn){return arguments.length?on(Gr(Mn)):Gr.invert(on())},Lr.clipAngle(90)}function pl(Ze){var et=r(Ze);function ht(_t,zt){var Et=b.geoGnomonicRaw(_t,zt);return Et[0]*=et,Et}return ht.invert=function(_t,zt){return b.geoGnomonicRaw.invert(_t/et,zt)},ht}function dc(){return pc([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function pc(Ze,et){return zl(pl,Ze,et)}function xc(Ze){if(!(Ze*=2))return b.geoAzimuthalEquidistantRaw;var et=-Ze/2,ht=-et,_t=Ze*Ze,zt=T(ht),Et=.5/d(ht);function Ut(mr,Tr){var Lr=z(r(Tr)*r(mr-et)),Gr=z(r(Tr)*r(mr-ht)),on=Tr<0?-1:1;return Lr*=Lr,Gr*=Gr,[(Lr-Gr)/(2*Ze),on*F(4*_t*Gr-(_t-Lr+Gr)*(_t-Lr+Gr))/(2*Ze)]}return Ut.invert=function(mr,Tr){var Lr=Tr*Tr,Gr=r(F(Lr+(Mn=mr+et)*Mn)),on=r(F(Lr+(Mn=mr+ht)*Mn)),Mn,Pn;return[t(Pn=Gr-on,Mn=(Gr+on)*zt),(Tr<0?-1:1)*z(F(Mn*Mn+Pn*Pn)*Et)]},Ut}function Gf(){return mc([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function mc(Ze,et){return zl(xc,Ze,et)}function Mf(Ze,et){if(E(et)l&&--mr>0);return[p(Ze)*(F(zt*zt+4)+zt)*x/4,A*Ut]};function zc(){return b.geoProjection(Xc).scale(127.16)}function Ue(Ze,et,ht,_t,zt){function Et(Ut,mr){var Tr=ht*d(_t*mr),Lr=F(1-Tr*Tr),Gr=F(2/(1+Lr*r(Ut*=zt)));return[Ze*Lr*Gr*d(Ut),et*Tr*Gr]}return Et.invert=function(Ut,mr){var Tr=Ut/Ze,Lr=mr/et,Gr=F(Tr*Tr+Lr*Lr),on=2*L(Gr/2);return[t(Ut*T(on),Ze*Gr)/zt,Gr&&L(mr*d(on)/(et*ht*Gr))/_t]},Et}function P(Ze,et,ht,_t){var zt=x/3;Ze=a(Ze,l),et=a(et,l),Ze=s(Ze,A),et=s(et,x-l),ht=a(ht,0),ht=s(ht,100-l),_t=a(_t,l);var Et=ht/100+1,Ut=_t/100,mr=z(Et*r(zt))/zt,Tr=d(Ze)/d(mr*A),Lr=et/x,Gr=F(Ut*d(Ze/2)/d(et/2)),on=Gr/F(Lr*Tr*mr),Mn=1/(Gr*F(Lr*Tr*mr));return Ue(on,Mn,Tr,mr,Lr)}function oe(){var Ze=65*y,et=60*y,ht=20,_t=200,zt=b.geoProjectionMutator(P),Et=zt(Ze,et,ht,_t);return Et.poleline=function(Ut){return arguments.length?zt(Ze=+Ut*y,et,ht,_t):Ze*v},Et.parallels=function(Ut){return arguments.length?zt(Ze,et=+Ut*y,ht,_t):et*v},Et.inflation=function(Ut){return arguments.length?zt(Ze,et,ht=+Ut,_t):ht},Et.ratio=function(Ut){return arguments.length?zt(Ze,et,ht,_t=+Ut):_t},Et.scale(163.775)}function Se(){return oe().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var ke=4*x+3*F(3),Be=2*F(2*x*F(3)/ke),gt=nt(Be*F(3)/x,Be,ke/6);function kt(){return b.geoProjection(gt).scale(176.84)}function Gt(Ze,et){return[Ze*F(1-3*et*et/(x*x)),et]}Gt.invert=function(Ze,et){return[Ze/F(1-3*et*et/(x*x)),et]};function cr(){return b.geoProjection(Gt).scale(152.63)}function Ar(Ze,et){var ht=r(et),_t=r(Ze)*ht,zt=1-_t,Et=r(Ze=t(d(Ze)*ht,-d(et))),Ut=d(Ze);return ht=F(1-_t*_t),[Ut*ht-Et*zt,-Et*ht-Ut*zt]}Ar.invert=function(Ze,et){var ht=(Ze*Ze+et*et)/-2,_t=F(-ht*(2+ht)),zt=et*ht+Ze*_t,Et=Ze*ht-et*_t,Ut=F(Et*Et+zt*zt);return[t(_t*zt,Ut*(1+ht)),Ut?-L(_t*Et/Ut):0]};function Cr(){return b.geoProjection(Ar).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Qr(Ze,et){var ht=fe(Ze,et);return[(ht[0]+Ze/A)/2,(ht[1]+et)/2]}Qr.invert=function(Ze,et){var ht=Ze,_t=et,zt=25;do{var Et=r(_t),Ut=d(_t),mr=d(2*_t),Tr=Ut*Ut,Lr=Et*Et,Gr=d(ht),on=r(ht/2),Mn=d(ht/2),Pn=Mn*Mn,Yn=1-Lr*on*on,wa=Yn?z(Et*on)*F(ni=1/Yn):ni=0,ni,Ka=.5*(2*wa*Et*Mn+ht/A)-Ze,ii=.5*(wa*Ut+_t)-et,$i=.5*ni*(Lr*Pn+wa*Et*on*Tr)+.5/A,Ao=ni*(Gr*mr/4-wa*Ut*Mn),mo=.125*ni*(mr*Mn-wa*Ut*Lr*Gr),$o=.5*ni*(Tr*on+wa*Pn*Et)+.5,Js=Ao*mo-$o*$i,Qs=(ii*Ao-Ka*$o)/Js,Ls=(Ka*mo-ii*$i)/Js;ht-=Qs,_t-=Ls}while((E(Qs)>l||E(Ls)>l)&&--zt>0);return[ht,_t]};function _n(){return b.geoProjection(Qr).scale(158.837)}h.geoNaturalEarth=b.geoNaturalEarth1,h.geoNaturalEarthRaw=b.geoNaturalEarth1Raw,h.geoAiry=re,h.geoAiryRaw=Z,h.geoAitoff=le,h.geoAitoffRaw=fe,h.geoArmadillo=V,h.geoArmadilloRaw=ce,h.geoAugust=ne,h.geoAugustRaw=ee,h.geoBaker=H,h.geoBakerRaw=te,h.geoBerghaus=ie,h.geoBerghausRaw=ae,h.geoBertin1953=it,h.geoBertin1953Raw=Ye,h.geoBoggs=ot,h.geoBoggsRaw=Ne,h.geoBonne=$t,h.geoBonneRaw=Nt,h.geoBottomley=Er,h.geoBottomleyRaw=rr,h.geoBromley=Wr,h.geoBromleyRaw=Mr,h.geoChamberlin=xe,h.geoChamberlinRaw=je,h.geoChamberlinAfrica=Ee,h.geoCollignon=Me,h.geoCollignonRaw=ye,h.geoCraig=Je,h.geoCraigRaw=Xe,h.geoCraster=Ot,h.geoCrasterRaw=Ct,h.geoCylindricalEqualArea=_r,h.geoCylindricalEqualAreaRaw=Wt,h.geoCylindricalStereographic=hr,h.geoCylindricalStereographicRaw=pr,h.geoEckert1=En,h.geoEckert1Raw=Fr,h.geoEckert2=qn,h.geoEckert2Raw=Kn,h.geoEckert3=ra,h.geoEckert3Raw=ta,h.geoEckert4=ka,h.geoEckert4Raw=Nn,h.geoEckert5=ir,h.geoEckert5Raw=qa,h.geoEckert6=ar,h.geoEckert6Raw=qt,h.geoEisenlohr=sn,h.geoEisenlohrRaw=Vr,h.geoFahey=Jn,h.geoFaheyRaw=wn,h.geoFoucaut=ha,h.geoFoucautRaw=pa,h.geoFoucautSinusoidal=Ca,h.geoFoucautSinusoidalRaw=_a,h.geoGilbert=Ci,h.geoGingery=Nr,h.geoGingeryRaw=Dt,h.geoGinzburg4=Ur,h.geoGinzburg4Raw=Ir,h.geoGinzburg5=$r,h.geoGinzburg5Raw=ln,h.geoGinzburg6=or,h.geoGinzburg6Raw=At,h.geoGinzburg8=un,h.geoGinzburg8Raw=Dr,h.geoGinzburg9=jn,h.geoGinzburg9Raw=Rn,h.geoGringorten=Ea,h.geoGringortenRaw=cn,h.geoGuyou=Xo,h.geoGuyouRaw=Eo,h.geoHammer=Ce,h.geoHammerRaw=ve,h.geoHammerRetroazimuthal=es,h.geoHammerRetroazimuthalRaw=Ys,h.geoHealpix=ll,h.geoHealpixRaw=sl,h.geoHill=Rl,h.geoHillRaw=kl,h.geoHomolosine=No,h.geoHomolosineRaw=Ds,h.geoHufnagel=Ws,h.geoHufnagelRaw=Il,h.geoHyperelliptical=_s,h.geoHyperellipticalRaw=eo,h.geoInterrupt=Do,h.geoInterruptedBoggs=fu,h.geoInterruptedHomolosine=wl,h.geoInterruptedMollweide=jl,h.geoInterruptedMollweideHemispheres=uf,h.geoInterruptedSinuMollweide=Qc,h.geoInterruptedSinusoidal=yh,h.geoKavrayskiy7=Lc,h.geoKavrayskiy7Raw=Tl,h.geoLagrange=nc,h.geoLagrangeRaw=Ph,h.geoLarrivee=ef,h.geoLarriveeRaw=ac,h.geoLaskowski=Xu,h.geoLaskowskiRaw=Kl,h.geoLittrow=Dl,h.geoLittrowRaw=Gs,h.geoLoximuthal=yc,h.geoLoximuthalRaw=wf,h.geoMiller=lu,h.geoMillerRaw=If,h.geoModifiedStereographic=Yu,h.geoModifiedStereographicRaw=bv,h.geoModifiedStereographicAlaska=tf,h.geoModifiedStereographicGs48=Iu,h.geoModifiedStereographicGs50=Rh,h.geoModifiedStereographicMiller=Df,h.geoModifiedStereographicLee=ih,h.geoMollweide=Le,h.geoMollweideRaw=Qe,h.geoMtFlatPolarParabolic=zf,h.geoMtFlatPolarParabolicRaw=oh,h.geoMtFlatPolarQuartic=Dh,h.geoMtFlatPolarQuarticRaw=Ih,h.geoMtFlatPolarSinusoidal=jh,h.geoMtFlatPolarSinusoidalRaw=rf,h.geoNaturalEarth2=cf,h.geoNaturalEarth2Raw=Tf,h.geoNellHammer=Hf,h.geoNellHammerRaw=Zu,h.geoInterruptedQuarticAuthalic=Nl,h.geoNicolosi=wv,h.geoNicolosiRaw=_h,h.geoPatterson=vc,h.geoPattersonRaw=Af,h.geoPolyconic=uu,h.geoPolyconicRaw=Ic,h.geoPolyhedral=Jf,h.geoPolyhedralButterfly=tu,h.geoPolyhedralCollignon=Oh,h.geoPolyhedralWaterman=iu,h.geoProject=lc,h.geoGringortenQuincuncial=ur,h.geoPeirceQuincuncial=Pr,h.geoPierceQuincuncial=Pr,h.geoQuantize=dn,h.geoQuincuncial=Fh,h.geoRectangularPolyconic=On,h.geoRectangularPolyconicRaw=nn,h.geoRobinson=ri,h.geoRobinsonRaw=xa,h.geoSatellite=Va,h.geoSatelliteRaw=Ni,h.geoSinuMollweide=Cl,h.geoSinuMollweideRaw=no,h.geoSinusoidal=Ft,h.geoSinusoidalRaw=rt,h.geoStitch=ql,h.geoTimes=xs,h.geoTimesRaw=bo,h.geoTwoPointAzimuthal=pc,h.geoTwoPointAzimuthalRaw=pl,h.geoTwoPointAzimuthalUsa=dc,h.geoTwoPointEquidistant=mc,h.geoTwoPointEquidistantRaw=xc,h.geoTwoPointEquidistantUsa=Gf,h.geoVanDerGrinten=Mu,h.geoVanDerGrintenRaw=Mf,h.geoVanDerGrinten2=Zo,h.geoVanDerGrinten2Raw=Ef,h.geoVanDerGrinten3=kf,h.geoVanDerGrinten3Raw=ss,h.geoVanDerGrinten4=zc,h.geoVanDerGrinten4Raw=Xc,h.geoWagner=oe,h.geoWagner7=Se,h.geoWagnerRaw=P,h.geoWagner4=kt,h.geoWagner4Raw=gt,h.geoWagner6=cr,h.geoWagner6Raw=Gt,h.geoWiechel=Cr,h.geoWiechelRaw=Ar,h.geoWinkel3=_n,h.geoWinkel3Raw=Qr,Object.defineProperty(h,"__esModule",{value:!0})})}}),aR=Ge({"src/plots/geo/zoom.js"($,G){var h=Za(),b=yn(),S=Io(),E=Math.PI/180,e=180/Math.PI,t={cursor:"pointer"},r={cursor:"auto"};function o(v,y){var I=v.projection,L;return y._isScoped?L=a:y._isClipped?L=f:L=s,L(v,I)}G.exports=o;function n(v,y){return h.behavior.zoom().translate(y.translate()).scale(y.scale())}function i(v,y,I){var L=v.id,z=v.graphDiv,F=z.layout,N=F[L],B=z._fullLayout,R=B[L],U={},j={};function Z(re,fe){U[L+"."+re]=b.nestedProperty(N,re).get(),S.call("_storeDirectGUIEdit",F,B._preGUI,U);var le=b.nestedProperty(R,re);le.get()!==fe&&(le.set(fe),b.nestedProperty(N,re).set(fe),j[L+"."+re]=fe)}I(Z),Z("projection.scale",y.scale()/v.fitScale),Z("fitbounds",!1),z.emit("plotly_relayout",j)}function a(v,y){var I=n(v,y);function L(){h.select(this).style(t)}function z(){y.scale(h.event.scale).translate(h.event.translate),v.render(!0);var B=y.invert(v.midPt);v.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/v.fitScale,"geo.center.lon":B[0],"geo.center.lat":B[1]})}function F(B){var R=y.invert(v.midPt);B("center.lon",R[0]),B("center.lat",R[1])}function N(){h.select(this).style(r),i(v,y,F)}return I.on("zoomstart",L).on("zoom",z).on("zoomend",N),I}function s(v,y){var I=n(v,y),L=2,z,F,N,B,R,U,j,Z,re;function fe(K){return y.invert(K)}function le(K){var ue=fe(K);if(!ue)return!0;var te=y(ue);return Math.abs(te[0]-K[0])>L||Math.abs(te[1]-K[1])>L}function ce(){h.select(this).style(t),z=h.mouse(this),F=y.rotate(),N=y.translate(),B=F,R=fe(z)}function V(){if(U=h.mouse(this),le(z)){I.scale(y.scale()),I.translate(y.translate());return}y.scale(h.event.scale),y.translate([N[0],h.event.translate[1]]),R?fe(U)&&(Z=fe(U),j=[B[0]+(Z[0]-R[0]),F[1],F[2]],y.rotate(j),B=j):(z=U,R=fe(z)),re=!0,v.render(!0);var K=y.rotate(),ue=y.invert(v.midPt);v.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/v.fitScale,"geo.center.lon":ue[0],"geo.center.lat":ue[1],"geo.projection.rotation.lon":-K[0]})}function ee(){h.select(this).style(r),re&&i(v,y,ne)}function ne(K){var ue=y.rotate(),te=y.invert(v.midPt);K("projection.rotation.lon",-ue[0]),K("center.lon",te[0]),K("center.lat",te[1])}return I.on("zoomstart",ce).on("zoom",V).on("zoomend",ee),I}function f(v,y){y.rotate(),y.scale();var I=n(v,y),L=u(I,"zoomstart","zoom","zoomend"),z=0,F=I.on,N;I.on("zoomstart",function(){h.select(this).style(t);var Z=h.mouse(this),re=y.rotate(),fe=re,le=y.translate(),ce=p(re);N=c(y,Z),F.call(I,"zoom",function(){var V=h.mouse(this);if(y.scale(h.event.scale),!N)Z=V,N=c(y,Z);else if(c(y,V)){y.rotate(re).translate(le);var ee=c(y,V),ne=T(N,ee),K=M(d(ce,ne)),ue=l(K,N,fe);(!isFinite(ue[0])||!isFinite(ue[1])||!isFinite(ue[2]))&&(ue=fe),y.rotate(ue),fe=ue}R(L.of(this,arguments))}),B(L.of(this,arguments))}).on("zoomend",function(){h.select(this).style(r),F.call(I,"zoom",null),U(L.of(this,arguments)),i(v,y,j)}).on("zoom.redraw",function(){v.render(!0);var Z=y.rotate();v.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/v.fitScale,"geo.projection.rotation.lon":-Z[0],"geo.projection.rotation.lat":-Z[1]})});function B(Z){z++||Z({type:"zoomstart"})}function R(Z){Z({type:"zoom"})}function U(Z){--z||Z({type:"zoomend"})}function j(Z){var re=y.rotate();Z("projection.rotation.lon",-re[0]),Z("projection.rotation.lat",-re[1])}return h.rebind(I,L,"on")}function c(v,y){var I=v.invert(y);return I&&isFinite(I[0])&&isFinite(I[1])&&_(I)}function p(v){var y=.5*v[0]*E,I=.5*v[1]*E,L=.5*v[2]*E,z=Math.sin(y),F=Math.cos(y),N=Math.sin(I),B=Math.cos(I),R=Math.sin(L),U=Math.cos(L);return[F*B*U+z*N*R,z*B*U-F*N*R,F*N*U+z*B*R,F*B*R-z*N*U]}function d(v,y){var I=v[0],L=v[1],z=v[2],F=v[3],N=y[0],B=y[1],R=y[2],U=y[3];return[I*N-L*B-z*R-F*U,I*B+L*N+z*U-F*R,I*R-L*U+z*N+F*B,I*U+L*R-z*B+F*N]}function T(v,y){if(!(!v||!y)){var I=m(v,y),L=Math.sqrt(w(I,I)),z=.5*Math.acos(Math.max(-1,Math.min(1,w(v,y)))),F=Math.sin(z)/L;return L&&[Math.cos(z),I[2]*F,-I[1]*F,I[0]*F]}}function l(v,y,I){var L=A(y,2,v[0]);L=A(L,1,v[1]),L=A(L,0,v[2]-I[2]);var z=y[0],F=y[1],N=y[2],B=L[0],R=L[1],U=L[2],j=Math.atan2(F,z)*e,Z=Math.sqrt(z*z+F*F),re,fe;Math.abs(R)>Z?(fe=(R>0?90:-90)-j,re=0):(fe=Math.asin(R/Z)*e-j,re=Math.sqrt(Z*Z-R*R));var le=180-fe-2*j,ce=(Math.atan2(U,B)-Math.atan2(N,re))*e,V=(Math.atan2(U,B)-Math.atan2(N,-re))*e,ee=g(I[0],I[1],fe,ce),ne=g(I[0],I[1],le,V);return ee<=ne?[fe,ce,I[2]]:[le,V,I[2]]}function g(v,y,I,L){var z=x(I-v),F=x(L-y);return Math.sqrt(z*z+F*F)}function x(v){return(v%360+540)%360-180}function A(v,y,I){var L=I*E,z=v.slice(),F=y===0?1:0,N=y===2?1:2,B=Math.cos(L),R=Math.sin(L);return z[F]=v[F]*B-v[N]*R,z[N]=v[N]*B+v[F]*R,z}function M(v){return[Math.atan2(2*(v[0]*v[1]+v[2]*v[3]),1-2*(v[1]*v[1]+v[2]*v[2]))*e,Math.asin(Math.max(-1,Math.min(1,2*(v[0]*v[2]-v[3]*v[1]))))*e,Math.atan2(2*(v[0]*v[3]+v[1]*v[2]),1-2*(v[2]*v[2]+v[3]*v[3]))*e]}function _(v){var y=v[0]*E,I=v[1]*E,L=Math.cos(I);return[L*Math.cos(y),L*Math.sin(y),Math.sin(I)]}function w(v,y){for(var I=0,L=0,z=v.length;L0&&R._module.calcGeoJSON(B,L)}if(!z){var U=this.updateProjection(I,L);if(U)return;(!this.viewInitial||this.scope!==F.scope)&&this.saveViewInitial(F)}this.scope=F.scope,this.updateBaseLayers(L,F),this.updateDims(L,F),this.updateFx(L,F),s.generalUpdatePerTraceModule(this.graphDiv,this,I,F);var j=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=j.selectAll(".point"),this.dataPoints.text=j.selectAll("text"),this.dataPaths.line=j.selectAll(".js-line");var Z=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=Z.selectAll("path"),this._render()},m.updateProjection=function(I,L){var z=this.graphDiv,F=L[this.id],N=L._size,B=F.domain,R=F.projection,U=F.lonaxis,j=F.lataxis,Z=U._ax,re=j._ax,fe=this.projection=u(F),le=[[N.l+N.w*B.x[0],N.t+N.h*(1-B.y[1])],[N.l+N.w*B.x[1],N.t+N.h*(1-B.y[0])]],ce=F.center||{},V=R.rotation||{},ee=U.range||[],ne=j.range||[];if(F.fitbounds){Z._length=le[1][0]-le[0][0],re._length=le[1][1]-le[0][1],Z.range=c(z,Z),re.range=c(z,re);var K=(Z.range[0]+Z.range[1])/2,ue=(re.range[0]+re.range[1])/2;if(F._isScoped)ce={lon:K,lat:ue};else if(F._isClipped){ce={lon:K,lat:ue},V={lon:K,lat:ue,roll:V.roll};var te=R.type,H=x.lonaxisSpan[te]/2||180,ae=x.lataxisSpan[te]/2||90;ee=[K-H,K+H],ne=[ue-ae,ue+ae]}else ce={lon:K,lat:ue},V={lon:K,lat:V.lat,roll:V.roll}}fe.center([ce.lon-V.lon,ce.lat-V.lat]).rotate([-V.lon,-V.lat,V.roll]).parallels(R.parallels);var ie=y(ee,ne);fe.fitExtent(le,ie);var ve=this.bounds=fe.getBounds(ie),Ae=this.fitScale=fe.scale(),Ce=fe.translate();if(F.fitbounds){var Fe=fe.getBounds(y(Z.range,re.range)),ze=Math.min((ve[1][0]-ve[0][0])/(Fe[1][0]-Fe[0][0]),(ve[1][1]-ve[0][1])/(Fe[1][1]-Fe[0][1]));isFinite(ze)?fe.scale(ze*Ae):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else fe.scale(R.scale*Ae);var Ye=this.midPt=[(ve[0][0]+ve[1][0])/2,(ve[0][1]+ve[1][1])/2];if(fe.translate([Ce[0]+(Ye[0]-Ce[0]),Ce[1]+(Ye[1]-Ce[1])]).clipExtent(ve),F._isAlbersUsa){var it=fe([ce.lon,ce.lat]),st=fe.translate();fe.translate([st[0]-(it[0]-st[0]),st[1]-(it[1]-st[1])])}},m.updateBaseLayers=function(I,L){var z=this,F=z.topojson,N=z.layers,B=z.basePaths;function R(le){return le==="lonaxis"||le==="lataxis"}function U(le){return!!x.lineLayers[le]}function j(le){return!!x.fillLayers[le]}var Z=this.hasChoropleth?x.layersForChoropleth:x.layers,re=Z.filter(function(le){return U(le)||j(le)?L["show"+le]:R(le)?L[le].showgrid:!0}),fe=z.framework.selectAll(".layer").data(re,String);fe.exit().each(function(le){delete N[le],delete B[le],h.select(this).remove()}),fe.enter().append("g").attr("class",function(le){return"layer "+le}).each(function(le){var ce=N[le]=h.select(this);le==="bg"?z.bgRect=ce.append("rect").style("pointer-events","all"):R(le)?B[le]=ce.append("path").style("fill","none"):le==="backplot"?ce.append("g").classed("choroplethlayer",!0):le==="frontplot"?ce.append("g").classed("scatterlayer",!0):U(le)?B[le]=ce.append("path").style("fill","none").style("stroke-miterlimit",2):j(le)&&(B[le]=ce.append("path").style("stroke","none"))}),fe.order(),fe.each(function(le){var ce=B[le],V=x.layerNameToAdjective[le];le==="frame"?ce.datum(x.sphereSVG):U(le)||j(le)?ce.datum(_(F,F.objects[le])):R(le)&&ce.datum(v(le,L,I)).call(n.stroke,L[le].gridcolor).call(i.dashLine,L[le].griddash,L[le].gridwidth),U(le)?ce.call(n.stroke,L[V+"color"]).call(i.dashLine,"",L[V+"width"]):j(le)&&ce.call(n.fill,L[V+"color"])})},m.updateDims=function(I,L){var z=this.bounds,F=(L.framewidth||0)/2,N=z[0][0]-F,B=z[0][1]-F,R=z[1][0]-N+F,U=z[1][1]-B+F;i.setRect(this.clipRect,N,B,R,U),this.bgRect.call(i.setRect,N,B,R,U).call(n.fill,L.bgcolor),this.xaxis._offset=N,this.xaxis._length=R,this.yaxis._offset=B,this.yaxis._length=U},m.updateFx=function(I,L){var z=this,F=z.graphDiv,N=z.bgRect,B=I.dragmode,R=I.clickmode;if(z.isStatic)return;function U(){var fe=z.viewInitial,le={};for(var ce in fe)le[z.id+"."+ce]=fe[ce];t.call("_guiRelayout",F,le),F.emit("plotly_doubleclick",null)}function j(fe){return z.projection.invert([fe[0]+z.xaxis._offset,fe[1]+z.yaxis._offset])}var Z=function(fe,le){if(le.isRect){var ce=fe.range={};ce[z.id]=[j([le.xmin,le.ymin]),j([le.xmax,le.ymax])]}else{var V=fe.lassoPoints={};V[z.id]=le.map(j)}},re={element:z.bgRect.node(),gd:F,plotinfo:{id:z.id,xaxis:z.xaxis,yaxis:z.yaxis,fillRangeItems:Z},xaxes:[z.xaxis],yaxes:[z.yaxis],subplot:z.id,clickFn:function(fe){fe===2&&T(F)}};B==="pan"?(N.node().onmousedown=null,N.call(g(z,L)),N.on("dblclick.zoom",U),F._context._scrollZoom.geo||N.on("wheel.zoom",null)):(B==="select"||B==="lasso")&&(N.on(".zoom",null),re.prepFn=function(fe,le,ce){d(fe,le,ce,re,B)},p.init(re)),N.on("mousemove",function(){var fe=z.projection.invert(r.getPositionFromD3Event());if(!fe)return p.unhover(F,h.event);z.xaxis.p2c=function(){return fe[0]},z.yaxis.p2c=function(){return fe[1]},a.hover(F,h.event,z.id)}),N.on("mouseout",function(){F._dragging||p.unhover(F,h.event)}),N.on("click",function(){B!=="select"&&B!=="lasso"&&(R.indexOf("select")>-1&&l(h.event,F,[z.xaxis],[z.yaxis],z.id,re),R.indexOf("event")>-1&&a.click(F,h.event))})},m.makeFramework=function(){var I=this,L=I.graphDiv,z=L._fullLayout,F="clip"+z._uid+I.id;I.clipDef=z._clips.append("clipPath").attr("id",F),I.clipRect=I.clipDef.append("rect"),I.framework=h.select(I.container).append("g").attr("class","geo "+I.id).call(i.setClipUrl,F,L),I.project=function(N){var B=I.projection(N);return B?[B[0]-I.xaxis._offset,B[1]-I.yaxis._offset]:[null,null]},I.xaxis={_id:"x",c2p:function(N){return I.project(N)[0]}},I.yaxis={_id:"y",c2p:function(N){return I.project(N)[1]}},I.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(I.mockAxis,z)},m.saveViewInitial=function(I){var L=I.center||{},z=I.projection,F=z.rotation||{};this.viewInitial={fitbounds:I.fitbounds,"projection.scale":z.scale};var N;I._isScoped?N={"center.lon":L.lon,"center.lat":L.lat}:I._isClipped?N={"projection.rotation.lon":F.lon,"projection.rotation.lat":F.lat}:N={"center.lon":L.lon,"center.lat":L.lat,"projection.rotation.lon":F.lon},r.extendFlat(this.viewInitial,N)},m.render=function(I){this._hasMarkerAngles&&I?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},m._render=function(){var I=this.projection,L=I.getPath(),z;function F(B){var R=I(B.lonlat);return R?o(R[0],R[1]):null}function N(B){return I.isLonLatOverEdges(B.lonlat)?"none":null}for(z in this.basePaths)this.basePaths[z].attr("d",L);for(z in this.dataPaths)this.dataPaths[z].attr("d",function(B){return L(B.geojson)});for(z in this.dataPoints)this.dataPoints[z].attr("display",N).attr("transform",F)};function u(I){var L=I.projection,z=L.type,F=x.projNames[z];F="geo"+r.titleCase(F);for(var N=b[F]||e[F],B=N(),R=I._isSatellite?Math.acos(1/L.distance)*180/Math.PI:I._isClipped?x.lonaxisSpan[z]/2:null,U=["center","rotate","parallels","clipExtent"],j=function(fe){return fe?B:[]},Z=0;ZV}else return!1},B.getPath=function(){return S().projection(B)},B.getBounds=function(fe){return B.getPath().bounds(fe)},B.precision(x.precision),I._isSatellite&&B.tilt(L.tilt).distance(L.distance),R&&B.clipAngle(R-x.clipPad),B}function v(I,L,z){var F=1e-6,N=2.5,B=L[I],R=x.scopeDefaults[L.scope],U,j,Z;I==="lonaxis"?(U=R.lonaxisRange,j=R.lataxisRange,Z=function(ue,te){return[ue,te]}):I==="lataxis"&&(U=R.lataxisRange,j=R.lonaxisRange,Z=function(ue,te){return[te,ue]});var re={type:"linear",range:[U[0],U[1]-F],tick0:B.tick0,dtick:B.dtick};f.setConvert(re,z);var fe=f.calcTicks(re);!L.isScoped&&I==="lonaxis"&&fe.pop();for(var le=fe.length,ce=new Array(le),V=0;V0&&N<0&&(N+=360);var U=(N-F)/4;return{type:"Polygon",coordinates:[[[F,B],[F,R],[F+U,R],[F+2*U,R],[F+3*U,R],[N,R],[N,B],[N-U,B],[N-2*U,B],[N-3*U,B],[F,B]]]}}}}),Kk=Ge({"src/plots/geo/layout_attributes.js"($,G){var h=rh(),b=Sc().attributes,S=hv().dash,E=XA(),e=Uc().overrideAll,t=Cp(),r={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:h.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:S},o=G.exports=e({domain:b({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:t(E.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:t(E.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:h.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:E.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:E.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:E.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:E.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:h.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:h.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:h.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:h.background},lonaxis:r,lataxis:r},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}}),oR=Ge({"src/plots/geo/layout_defaults.js"($,G){var h=yn(),b=B0(),S=Iv().getSubplotData,E=XA(),e=Kk(),t=E.axesNames;G.exports=function(n,i,a){b(n,i,a,{type:"geo",attributes:e,handleDefaults:r,fullData:a,partition:"y"})};function r(o,n,i,a){var s=S(a.fullData,"geo",a.id),f=s.map(function(ne){return ne.index}),c=i("resolution"),p=i("scope"),d=E.scopeDefaults[p],T=i("projection.type",d.projType),l=n._isAlbersUsa=T==="albers usa";l&&(p=n.scope="usa");var g=n._isScoped=p!=="world",x=n._isSatellite=T==="satellite",A=n._isConic=T.indexOf("conic")!==-1||T==="albers",M=n._isClipped=!!E.lonaxisSpan[T];if(o.visible===!1){var _=h.extendDeep({},n._template);_.showcoastlines=!1,_.showcountries=!1,_.showframe=!1,_.showlakes=!1,_.showland=!1,_.showocean=!1,_.showrivers=!1,_.showsubunits=!1,_.lonaxis&&(_.lonaxis.showgrid=!1),_.lataxis&&(_.lataxis.showgrid=!1),n._template=_}for(var w=i("visible"),m,u=0;u0&&j<0&&(j+=360);var Z=(U+j)/2,re;if(!l){var fe=g?d.projRotate:[Z,0,0];re=i("projection.rotation.lon",fe[0]),i("projection.rotation.lat",fe[1]),i("projection.rotation.roll",fe[2]),m=i("showcoastlines",!g&&w),m&&(i("coastlinecolor"),i("coastlinewidth")),m=i("showocean",w?void 0:!1),m&&i("oceancolor")}var le,ce;if(l?(le=-96.6,ce=38.7):(le=g?Z:re,ce=(R[0]+R[1])/2),i("center.lon",le),i("center.lat",ce),x&&(i("projection.tilt"),i("projection.distance")),A){var V=d.projParallels||[0,60];i("projection.parallels",V)}i("projection.scale"),m=i("showland",w?void 0:!1),m&&i("landcolor"),m=i("showlakes",w?void 0:!1),m&&i("lakecolor"),m=i("showrivers",w?void 0:!1),m&&(i("rivercolor"),i("riverwidth")),m=i("showcountries",g&&p!=="usa"&&w),m&&(i("countrycolor"),i("countrywidth")),(p==="usa"||p==="north america"&&c===50)&&(i("showsubunits",w),i("subunitcolor"),i("subunitwidth")),g||(m=i("showframe",w),m&&(i("framecolor"),i("framewidth"))),i("bgcolor");var ee=i("fitbounds");ee&&(delete n.projection.scale,g?(delete n.center.lon,delete n.center.lat):M?(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon,delete n.projection.rotation.lat,delete n.lonaxis.range,delete n.lataxis.range):(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon))}}}),$k=Ge({"src/plots/geo/index.js"($,G){var h=Iv().getSubplotCalcData,b=yn().counterRegex,S=iR(),E="geo",e=b(E),t={};t[E]={valType:"subplotid",dflt:E,editType:"calc"};function r(i){for(var a=i._fullLayout,s=i.calcdata,f=a._subplots[E],c=0;c")}}}}),gE=Ge({"src/traces/choropleth/event_data.js"($,G){G.exports=function(b,S,E,e,t){b.location=S.location,b.z=S.z;var r=e[t];return r.fIn&&r.fIn.properties&&(b.properties=r.fIn.properties),b.ct=r.ct,b}}}),yE=Ge({"src/traces/choropleth/select.js"($,G){G.exports=function(b,S){var E=b.cd,e=b.xaxis,t=b.yaxis,r=[],o,n,i,a,s;if(S===!1)for(o=0;o=Math.min(j,Z)&&T<=Math.max(j,Z)?0:1/0}if(L=Math.min(re,fe)&&l<=Math.max(re,fe)?0:1/0}N=Math.sqrt(L*L+z*z),u=x[I]}}}else for(I=x.length-1;I>-1;I--)m=x[I],v=p[m],y=d[m],L=f.c2p(v)-T,z=c.c2p(y)-l,F=Math.sqrt(L*L+z*z),F100},$.isDotSymbol=function(h){return typeof h=="string"?G.DOT_RE.test(h):h>200}}}),hR=Ge({"src/traces/scattergl/defaults.js"($,G){var h=yn(),b=Io(),S=xE(),E=ZA(),e=i0(),t=ou(),r=zp(),o=Op(),n=Gv(),i=Fp(),a=Dv(),s=ep();G.exports=function(c,p,d,T){function l(u,v){return h.coerce(c,p,E,u,v)}var g=c.marker?S.isOpenSymbol(c.marker.symbol):!1,x=t.isBubble(c),A=r(c,p,T,l);if(!A){p.visible=!1;return}o(c,p,T,l),l("xhoverformat"),l("yhoverformat");var M=A>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p>=0?(s=f,a=f-1):i=f+1}return s}function b(r,o,n,i,a){for(var s=a+1;i<=a;){var f=i+a>>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p>0?(s=f,a=f-1):i=f+1}return s}function S(r,o,n,i,a){for(var s=i-1;i<=a;){var f=i+a>>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p<0?(s=f,i=f+1):a=f-1}return s}function E(r,o,n,i,a){for(var s=i-1;i<=a;){var f=i+a>>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p<=0?(s=f,i=f+1):a=f-1}return s}function e(r,o,n,i,a){for(;i<=a;){var s=i+a>>>1,f=r[s],c=n!==void 0?n(f,o):f-o;if(c===0)return s;c<=0?i=s+1:a=s-1}return-1}function t(r,o,n,i,a,s){return typeof n=="function"?s(r,o,n,i===void 0?0:i|0,a===void 0?r.length-1:a|0):s(r,o,void 0,n===void 0?0:n|0,i===void 0?r.length-1:i|0)}G.exports={ge:function(r,o,n,i,a){return t(r,o,n,i,a,h)},gt:function(r,o,n,i,a){return t(r,o,n,i,a,b)},lt:function(r,o,n,i,a){return t(r,o,n,i,a,S)},le:function(r,o,n,i,a){return t(r,o,n,i,a,E)},eq:function(r,o,n,i,a){return t(r,o,n,i,a,e)}}}}),Ig=Ge({"node_modules/pick-by-alias/index.js"($,G){G.exports=function(E,e,t){var r={},o,n;if(typeof e=="string"&&(e=b(e)),Array.isArray(e)){var i={};for(n=0;n1&&(S=arguments),typeof S=="string"?S=S.split(/\s/).map(parseFloat):typeof S=="number"&&(S=[S]),S.length&&typeof S[0]=="number"?S.length===1?E={width:S[0],height:S[0],x:0,y:0}:S.length===2?E={width:S[0],height:S[1],x:0,y:0}:E={x:S[0],y:S[1],width:S[2]-S[0]||0,height:S[3]-S[1]||0}:S&&(S=h(S,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),E={x:S.left||0,y:S.top||0},S.width==null?S.right?E.width=S.right-E.x:E.width=0:E.width=S.width,S.height==null?S.bottom?E.height=S.bottom-E.y:E.height=0:E.height=S.height),E}}}),Yb=Ge({"node_modules/array-bounds/index.js"($,G){G.exports=h;function h(b,S){if(!b||b.length==null)throw Error("Argument should be an array");S==null?S=1:S=Math.floor(S);for(var E=Array(S*2),e=0;et&&(t=b[o]),b[o]>>1,x;p.dtype||(p.dtype="array"),typeof p.dtype=="string"?x=new(n(p.dtype))(g):p.dtype&&(x=p.dtype,Array.isArray(x)&&(x.length=g));for(let L=0;Ld||R>a){for(let ue=0;ueie||Z>ve||re=le||H===ae)return;let Ae=A[te];ae===void 0&&(ae=Ae.length);for(let Le=H;Le=N&&pe<=R&&Ne>=B&&Ne<=U&&ce.push(Te)}let Ce=M[te],Fe=Ce[H*4+0],ze=Ce[H*4+1],Ye=Ce[H*4+2],it=Ce[H*4+3],st=ee(Ce,H+1),nt=ue*.5,Qe=te+1;V(ne,K,nt,Qe,Fe,ze||Ye||it||st),V(ne,K+nt,nt,Qe,ze,Ye||it||st),V(ne+nt,K,nt,Qe,Ye,it||st),V(ne+nt,K+nt,nt,Qe,it,st)}function ee(ne,K){let ue=null,te=0;for(;ue===null;)if(ue=ne[K*4+te],te++,te>ne.length)return null;return ue}return ce}function y(L,z,F,N,B){let R=[];for(let U=0;U1&&(c=1),c<-1&&(c=-1),f*Math.acos(c)},t=function(n,i,a,s,f,c,p,d,T,l,g,x){var A=Math.pow(f,2),M=Math.pow(c,2),_=Math.pow(g,2),w=Math.pow(x,2),m=A*M-A*w-M*_;m<0&&(m=0),m/=A*w+M*_,m=Math.sqrt(m)*(p===d?-1:1);var u=m*f/c*x,v=m*-c/f*g,y=l*u-T*v+(n+a)/2,I=T*u+l*v+(i+s)/2,L=(g-u)/f,z=(x-v)/c,F=(-g-u)/f,N=(-x-v)/c,B=e(1,0,L,z),R=e(L,z,F,N);return d===0&&R>0&&(R-=b),d===1&&R<0&&(R+=b),[y,I,B,R]},r=function(n){var i=n.px,a=n.py,s=n.cx,f=n.cy,c=n.rx,p=n.ry,d=n.xAxisRotation,T=d===void 0?0:d,l=n.largeArcFlag,g=l===void 0?0:l,x=n.sweepFlag,A=x===void 0?0:x,M=[];if(c===0||p===0)return[];var _=Math.sin(T*b/360),w=Math.cos(T*b/360),m=w*(i-s)/2+_*(a-f)/2,u=-_*(i-s)/2+w*(a-f)/2;if(m===0&&u===0)return[];c=Math.abs(c),p=Math.abs(p);var v=Math.pow(m,2)/Math.pow(c,2)+Math.pow(u,2)/Math.pow(p,2);v>1&&(c*=Math.sqrt(v),p*=Math.sqrt(v));var y=t(i,a,s,f,c,p,g,A,_,w,m,u),I=h(y,4),L=I[0],z=I[1],F=I[2],N=I[3],B=Math.abs(N)/(b/4);Math.abs(1-B)<1e-7&&(B=1);var R=Math.max(Math.ceil(B),1);N/=R;for(var U=0;U4?(o=l[l.length-4],n=l[l.length-3]):(o=c,n=p),r.push(l)}return r}function S(e,t,r,o){return["C",e,t,r,o,r,o]}function E(e,t,r,o,n,i){return["C",e/3+2/3*r,t/3+2/3*o,n/3+2/3*r,i/3+2/3*o,n,i]}}}),eC=Ge({"node_modules/is-svg-path/index.js"($,G){G.exports=function(b){return typeof b!="string"?!1:(b=b.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(b)&&/[\dz]$/i.test(b)&&b.length>4))}}}),bR=Ge({"node_modules/svg-path-bounds/index.js"($,G){var h=nm(),b=Qk(),S=xR(),E=eC(),e=Ty();G.exports=t;function t(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(e(E(r),"String is not an SVG path."),r=h(r)),e(Array.isArray(r),"Argument should be a string or an array of path segments."),r=b(r),r=S(r),!r.length)return[0,0,0,0];for(var o=[1/0,1/0,-1/0,-1/0],n=0,i=r.length;no[2]&&(o[2]=a[s+0]),a[s+1]>o[3]&&(o[3]=a[s+1]);return o}}}),wR=Ge({"node_modules/normalize-svg-path/index.js"($,G){var h=Math.PI,b=o(120);G.exports=S;function S(n){for(var i,a=[],s=0,f=0,c=0,p=0,d=null,T=null,l=0,g=0,x=0,A=n.length;x7&&(a.push(M.splice(0,7)),M.unshift("C"));break;case"S":var w=l,m=g;(i=="C"||i=="S")&&(w+=w-s,m+=m-f),M=["C",w,m,M[1],M[2],M[3],M[4]];break;case"T":i=="Q"||i=="T"?(d=l*2-d,T=g*2-T):(d=l,T=g),M=e(l,g,d,T,M[1],M[2]);break;case"Q":d=M[1],T=M[2],M=e(l,g,M[1],M[2],M[3],M[4]);break;case"L":M=E(l,g,M[1],M[2]);break;case"H":M=E(l,g,M[1],g);break;case"V":M=E(l,g,l,M[1]);break;case"Z":M=E(l,g,c,p);break}i=_,l=M[M.length-2],g=M[M.length-1],M.length>4?(s=M[M.length-4],f=M[M.length-3]):(s=l,f=g),a.push(M)}return a}function E(n,i,a,s){return["C",n,i,a,s,a,s]}function e(n,i,a,s,f,c){return["C",n/3+2/3*a,i/3+2/3*s,f/3+2/3*a,c/3+2/3*s,f,c]}function t(n,i,a,s,f,c,p,d,T,l){if(l)y=l[0],I=l[1],u=l[2],v=l[3];else{var g=r(n,i,-f);n=g.x,i=g.y,g=r(d,T,-f),d=g.x,T=g.y;var x=(n-d)/2,A=(i-T)/2,M=x*x/(a*a)+A*A/(s*s);M>1&&(M=Math.sqrt(M),a=M*a,s=M*s);var _=a*a,w=s*s,m=(c==p?-1:1)*Math.sqrt(Math.abs((_*w-_*A*A-w*x*x)/(_*A*A+w*x*x)));m==1/0&&(m=1);var u=m*a*A/s+(n+d)/2,v=m*-s*x/a+(i+T)/2,y=Math.asin(((i-v)/s).toFixed(9)),I=Math.asin(((T-v)/s).toFixed(9));y=nI&&(y=y-h*2),!p&&I>y&&(I=I-h*2)}if(Math.abs(I-y)>b){var L=I,z=d,F=T;I=y+b*(p&&I>y?1:-1),d=u+a*Math.cos(I),T=v+s*Math.sin(I);var N=t(d,T,a,s,f,0,p,z,F,[I,L,u,v])}var B=Math.tan((I-y)/4),R=4/3*a*B,U=4/3*s*B,j=[2*n-(n+R*Math.sin(y)),2*i-(i-U*Math.cos(y)),d+R*Math.sin(I),T-U*Math.cos(I),d,T];if(l)return j;N&&(j=j.concat(N));for(var Z=0;Z0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(d)),r.translate(f*.5,c*.5),r.scale(g,g),i()){var x=new Path2D(a);r.fill(x),d&&r.stroke(x)}else{var A=b(a);S(r,A),r.fill(),d&&r.stroke()}r.setTransform(1,0,0,1,0,0);var M=e(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:p*.5});return M}var n;function i(){if(n!=null)return n;var a=document.createElement("canvas").getContext("2d");if(a.canvas.width=a.canvas.height=1,!window.Path2D)return n=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");a.fillStyle="black",a.fill(s);var f=a.getImageData(0,0,1,1);return n=f&&f.data&&f.data[3]===255}}}),Wb=Ge({"src/traces/scattergl/convert.js"($,G){var h=Ga(),b=SR(),S=L_(),E=Io(),e=yn(),t=e.isArrayOrTypedArray,r=Ms(),o=Lf(),n=qy().formatColor,i=ou(),a=Pp(),s=xE(),f=D_(),c=up().DESELECTDIM,p={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},d=Hv().appendArrayPointValue;function T(N,B){var R,U={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},j=N._context.plotGlPixelRatio;if(B.visible!==!0)return U;if(i.hasText(B)&&(U.text=l(N,B),U.textSel=M(N,B,B.selected),U.textUnsel=M(N,B,B.unselected)),i.hasMarkers(B)&&(U.marker=x(N,B),U.markerSel=A(N,B,B.selected),U.markerUnsel=A(N,B,B.unselected),!B.unselected&&t(B.marker.opacity))){var Z=B.marker.opacity;for(U.markerUnsel.opacity=new Array(Z.length),R=0;R500?"bold":"normal":N}function x(N,B){var R=B._length,U=B.marker,j={},Z,re=t(U.symbol),fe=t(U.angle),le=t(U.color),ce=t(U.line.color),V=t(U.opacity),ee=t(U.size),ne=t(U.line.width),K;if(re||(K=s.isOpenSymbol(U.symbol)),re||le||ce||V||fe){j.symbols=new Array(R),j.angles=new Array(R),j.colors=new Array(R),j.borderColors=new Array(R);var ue=U.symbol,te=U.angle,H=n(U,U.opacity,R),ae=n(U.line,U.opacity,R);if(!t(ae[0])){var ie=ae;for(ae=Array(R),Z=0;Zf.TOO_MANY_POINTS||i.hasMarkers(B)?"rect":"round";if(ce&&B.connectgaps){var ee=Z[0],ne=Z[1];for(re=0;re1?le[re]:le[0]:le,K=t(ce)?ce.length>1?ce[re]:ce[0]:ce,ue=p[ne],te=p[K],H=V?V/.8+1:0,ae=-te*H-te*.5;Z.offset[re]=[ue*H/ee,ae/ee]}}return Z}G.exports={style:T,markerStyle:x,markerSelection:A,linePositions:L,errorBarPositions:z,textPosition:F}}}),tC=Ge({"src/traces/scattergl/scene_update.js"($,G){var h=yn();G.exports=function(S,E){var e=E._scene,t={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},r={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return E._scene||(e=E._scene={},e.init=function(){h.extendFlat(e,r,t)},e.init(),e.update=function(n){var i=h.repeat(n,e.count);if(e.fill2d&&e.fill2d.update(i),e.scatter2d&&e.scatter2d.update(i),e.line2d&&e.line2d.update(i),e.error2d&&e.error2d.update(i.concat(i)),e.select2d&&e.select2d.update(i),e.glText)for(var a=0;a=c,u=w*2,v={},y,I=A.makeCalcdata(g,"x"),L=M.makeCalcdata(g,"y"),z=e(g,A,"x",I),F=e(g,M,"y",L),N=z.vals,B=F.vals;g._x=N,g._y=B,g.xperiodalignment&&(g._origX=I,g._xStarts=z.starts,g._xEnds=z.ends),g.yperiodalignment&&(g._origY=L,g._yStarts=F.starts,g._yEnds=F.ends);var R=new Array(u),U=new Array(w);for(y=0;y1&&b.extendFlat(_.line,a.linePositions(T,g,x)),_.errorX||_.errorY){var w=a.errorBarPositions(T,g,x,A,M);_.errorX&&b.extendFlat(_.errorX,w.x),_.errorY&&b.extendFlat(_.errorY,w.y)}return _.text&&(b.extendFlat(_.text,{positions:x},a.textPosition(T,g,_.text,_.marker)),b.extendFlat(_.textSel,{positions:x},a.textPosition(T,g,_.text,_.markerSel)),b.extendFlat(_.textUnsel,{positions:x},a.textPosition(T,g,_.text,_.markerUnsel))),_}}}),rC=Ge({"src/traces/scattergl/edit_style.js"($,G){var h=yn(),b=So(),S=up().DESELECTDIM;function E(e){var t=e[0],r=t.trace,o=t.t,n=o._scene,i=o.index,a=n.selectBatch[i],s=n.unselectBatch[i],f=n.textOptions[i],c=n.textSelectedOptions[i]||{},p=n.textUnselectedOptions[i]||{},d=h.extendFlat({},f),T,l;if(a.length||s.length){var g=c.color,x=p.color,A=f.color,M=h.isArrayOrTypedArray(A);for(d.color=new Array(r._length),T=0;T>>24,r=(E&16711680)>>>16,o=(E&65280)>>>8,n=E&255;return e===!1?[t,r,o,n]:[t/255,r/255,o/255,n/255]}}}),xv=Ge({"node_modules/object-assign/index.js"($,G){var h=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;function E(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function e(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var r={},o=0;o<10;o++)r["_"+String.fromCharCode(o)]=o;var n=Object.getOwnPropertyNames(r).map(function(a){return r[a]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(a){i[a]=a}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}G.exports=e()?Object.assign:function(t,r){for(var o,n=E(t),i,a=1;av.length)&&(y=v.length);for(var I=0,L=new Array(y);I0)throw new Error("Invalid string. Length must be a multiple of 4");var M=x.indexOf("=");M===-1&&(M=A);var _=M===A?0:4-M%4;return[M,_]}function c(x){var A=f(x),M=A[0],_=A[1];return(M+_)*3/4-_}function p(x,A,M){return(A+M)*3/4-M}function v(x){var A,M=f(x),_=M[0],w=M[1],m=new n(p(x,_,w)),u=0,d=w>0?_-4:_,y;for(y=0;y>16&255,m[u++]=A>>8&255,m[u++]=A&255;return w===2&&(A=o[x.charCodeAt(y)]<<2|o[x.charCodeAt(y+1)]>>4,m[u++]=A&255),w===1&&(A=o[x.charCodeAt(y)]<<10|o[x.charCodeAt(y+1)]<<4|o[x.charCodeAt(y+2)]>>2,m[u++]=A>>8&255,m[u++]=A&255),m}function T(x){return r[x>>18&63]+r[x>>12&63]+r[x>>6&63]+r[x&63]}function l(x,A,M){for(var _,w=[],m=A;md?d:u+m));return _===1?(A=x[M-1],w.push(r[A>>2]+r[A<<4&63]+"==")):_===2&&(A=(x[M-2]<<8)+x[M-1],w.push(r[A>>10]+r[A>>4&63]+r[A<<2&63]+"=")),w.join("")}}),7518:(function(e,t,r){var o=r(1433);function n(s,f,c,p,v,T){this.location=s,this.dimension=f,this.a=c,this.b=p,this.c=v,this.d=T}n.prototype.bind=function(s){switch(this.dimension){case 1:s.vertexAttrib1f(this.location,this.a);break;case 2:s.vertexAttrib2f(this.location,this.a,this.b);break;case 3:s.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:s.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d);break}};function i(s,f,c){this.gl=s,this._ext=f,this.handle=c,this._attribs=[],this._useElements=!1,this._elementsType=s.UNSIGNED_SHORT}i.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var s=0;s1.0001)return null;y+=d[M]}return Math.abs(y-1)>.001?null:[_,f(p,d),d]}}),7636:(function(e){e.exports=t;function t(r,o){o=o||1;var n=Math.random()*2*Math.PI,i=Math.random()*2-1,a=Math.sqrt(1-i*i)*o;return r[0]=Math.cos(n)*a,r[1]=Math.sin(n)*a,r[2]=i*o,r}}),7640:(function(e,t,r){var o=r(1888);function n(v){return v==="uint32"?[o.mallocUint32,o.freeUint32]:null}var i={"uint32,1,0":function(v,T){return function(g,x,A,M,_,w,m,u,d,y,I){var L,z,F,N=g*_+M,B,R=v(u),U,j,Z,re;for(L=g+1;L<=x;++L){for(z=L,N+=_,F=N,U=0,j=N,B=0;Bg;){U=0,j=F-_;t:for(B=0;Bre)break t;j+=y,U+=I}for(U=F,j=F-_,B=0;B>1,R=B-z,U=B+z,j=F,Z=R,re=B,fe=U,le=N,ce=x+1,V=A-1,ee=!0,ne,$,ue,te,H,ae,ie,de,Se,Le=0,Fe=0,ze=0,Ye,st,ct,at,et,Pe,Ae,pe,Ne,ut,dt,nt,Ft,Nt,Qt,ar,kr=d,Er=T(kr),$r=T(kr);st=w*j,ct=w*Z,ar=_;e:for(Ye=0;Ye0){$=j,j=Z,Z=$;break e}if(ze<0)break e;ar+=I}st=w*fe,ct=w*le,ar=_;e:for(Ye=0;Ye0){$=fe,fe=le,le=$;break e}if(ze<0)break e;ar+=I}st=w*j,ct=w*re,ar=_;e:for(Ye=0;Ye0){$=j,j=re,re=$;break e}if(ze<0)break e;ar+=I}st=w*Z,ct=w*re,ar=_;e:for(Ye=0;Ye0){$=Z,Z=re,re=$;break e}if(ze<0)break e;ar+=I}st=w*j,ct=w*fe,ar=_;e:for(Ye=0;Ye0){$=j,j=fe,fe=$;break e}if(ze<0)break e;ar+=I}st=w*re,ct=w*fe,ar=_;e:for(Ye=0;Ye0){$=re,re=fe,fe=$;break e}if(ze<0)break e;ar+=I}st=w*Z,ct=w*le,ar=_;e:for(Ye=0;Ye0){$=Z,Z=le,le=$;break e}if(ze<0)break e;ar+=I}st=w*Z,ct=w*re,ar=_;e:for(Ye=0;Ye0){$=Z,Z=re,re=$;break e}if(ze<0)break e;ar+=I}st=w*fe,ct=w*le,ar=_;e:for(Ye=0;Ye0){$=fe,fe=le,le=$;break e}if(ze<0)break e;ar+=I}for(st=w*j,ct=w*Z,at=w*re,et=w*fe,Pe=w*le,Ae=w*F,pe=w*B,Ne=w*N,Qt=0,ar=_,Ye=0;Ye0)V--;else if(ze<0){for(st=w*ae,ct=w*ce,at=w*V,ar=_,Ye=0;Ye0)for(;;){ie=_+V*w,Qt=0;e:for(Ye=0;Ye0){if(--VN){e:for(;;){for(ie=_+ce*w,Qt=0,ar=_,Ye=0;Ye1&&g?A(l,g[0],g[1]):A(l)}var c={"uint32,1,0":function(v,T){return function(l){var g=l.data,x=l.offset|0,A=l.shape,M=l.stride,_=M[0]|0,w=A[0]|0,m=M[1]|0,u=A[1]|0,d=m,y=m,I=1;w<=32?v(0,w-1,g,x,_,m,w,u,d,y,I):T(0,w-1,g,x,_,m,w,u,d,y,I)}}};function p(v,T){var l=[T,v].join(","),g=c[l],x=a(v,T),A=f(v,T,x);return g(x,A)}e.exports=p}),7642:(function(e,t,r){var o=r(8954),n=r(1682);e.exports=f;function i(c,p){this.point=c,this.index=p}function a(c,p){for(var v=c.point,T=p.point,l=v.length,g=0;g=2)return!1;F[B]=R}return!0}):z=z.filter(function(F){for(var N=0;N<=T;++N){var B=d[F[N]];if(B<0)return!1;F[N]=B}return!0}),T&1)for(var x=0;x",U="",j=R.length,Z=U.length,re=F[0]===g||F[0]===M,fe=0,le=-Z;fe>-1&&(fe=N.indexOf(R,fe),!(fe===-1||(le=N.indexOf(U,fe+j),le===-1)||le<=fe));){for(var ce=fe;ce=le)B[ce]=null,N=N.substr(0,ce)+" "+N.substr(ce+1);else if(B[ce]!==null){var V=B[ce].indexOf(F[0]);V===-1?B[ce]+=F:re&&(B[ce]=B[ce].substr(0,V+1)+(1+parseInt(B[ce][V+1]))+B[ce].substr(V+2))}var ee=fe+j,ne=N.substr(ee,le-ee),$=ne.indexOf(R);$!==-1?fe=$:fe=le+Z}return B}function m(z,F,N){for(var B=F.textAlign||"start",R=F.textBaseline||"alphabetic",U=[1<<30,1<<30],j=[0,0],Z=z.length,re=0;re/g,` +`):N=N.replace(/\/g," ");var j="",Z=[];for(H=0;H-1?parseInt(pe[1+dt]):0,Nt=nt>-1?parseInt(Ne[1+nt]):0;Ft!==Nt&&(ut=ut.replace(ze(),"?px "),de*=Math.pow(.75,Nt-Ft),ut=ut.replace("?px ",ze())),ie+=.25*V*(Nt-Ft)}if(U.superscripts===!0){var Qt=pe.indexOf(g),ar=Ne.indexOf(g),kr=Qt>-1?parseInt(pe[1+Qt]):0,Er=ar>-1?parseInt(Ne[1+ar]):0;kr!==Er&&(ut=ut.replace(ze(),"?px "),de*=Math.pow(.75,Er-kr),ut=ut.replace("?px ",ze())),ie-=.25*V*(Er-kr)}if(U.bolds===!0){var $r=pe.indexOf(p)>-1,Sr=Ne.indexOf(p)>-1;!$r&&Sr&&(Ur?ut=ut.replace("italic ","italic bold "):ut="bold "+ut),$r&&!Sr&&(ut=ut.replace("bold ",""))}if(U.italics===!0){var Ur=pe.indexOf(T)>-1,Mt=Ne.indexOf(T)>-1;!Ur&&Mt&&(ut="italic "+ut),Ur&&!Mt&&(ut=ut.replace("italic ",""))}F.font=ut}for(te=0;te0&&(R=B.size),B.lineSpacing&&B.lineSpacing>0&&(U=B.lineSpacing),B.styletags&&B.styletags.breaklines&&(j.breaklines=!!B.styletags.breaklines),B.styletags&&B.styletags.bolds&&(j.bolds=!!B.styletags.bolds),B.styletags&&B.styletags.italics&&(j.italics=!!B.styletags.italics),B.styletags&&B.styletags.subscripts&&(j.subscripts=!!B.styletags.subscripts),B.styletags&&B.styletags.superscripts&&(j.superscripts=!!B.styletags.superscripts)),N.font=[B.fontStyle,B.fontVariant,B.fontWeight,R+"px",B.font].filter(function(re){return re}).join(" "),N.textAlign="start",N.textBaseline="alphabetic",N.direction="ltr";var Z=u(F,N,z,R,U,j);return I(Z,B,R)}}),7721:(function(e,t,r){var o=r(5716);e.exports=n;function n(i){return o(i[0])*o(i[1])}}),7765:(function(e,t,r){e.exports=l;var o=r(9618),n=r(1888),i=r(446),a=r(1570);function s(g){for(var x=g.length,A=0,M=0;M"u"&&(M=s(g));var _=g.length;if(_===0||M<1)return{cells:[],vertexIds:[],vertexWeights:[]};var w=f(x,+A),m=c(g,M),u=p(m,x,w,+A),d=v(m,x.length|0),y=a(M)(g,m.data,d,w),I=T(m),L=[].slice.call(u.data,0,u.shape[0]);return n.free(w),n.free(m.data),n.free(u.data),n.free(d),{cells:y,vertexIds:I,vertexWeights:L}}}),7766:(function(e,t,r){var o=r(9618),n=r(5298),i=r(1888);e.exports=u;var a=null,s=null,f=null;function c(d){a=[d.LINEAR,d.NEAREST_MIPMAP_LINEAR,d.LINEAR_MIPMAP_NEAREST,d.LINEAR_MIPMAP_NEAREST],s=[d.NEAREST,d.LINEAR,d.NEAREST_MIPMAP_NEAREST,d.NEAREST_MIPMAP_LINEAR,d.LINEAR_MIPMAP_NEAREST,d.LINEAR_MIPMAP_LINEAR],f=[d.REPEAT,d.CLAMP_TO_EDGE,d.MIRRORED_REPEAT]}function p(d){return typeof HTMLCanvasElement<"u"&&d instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&d instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&d instanceof HTMLVideoElement||typeof ImageData<"u"&&d instanceof ImageData}var v=function(d,y){n.muls(d,y,255)};function T(d,y,I){var L=d.gl,z=L.getParameter(L.MAX_TEXTURE_SIZE);if(y<0||y>z||I<0||I>z)throw new Error("gl-texture2d: Invalid texture size");return d._shape=[y,I],d.bind(),L.texImage2D(L.TEXTURE_2D,0,d.format,y,I,0,d.format,d.type,null),d._mipLevels=[0],d}function l(d,y,I,L,z,F){this.gl=d,this.handle=y,this.format=z,this.type=F,this._shape=[I,L],this._mipLevels=[0],this._magFilter=d.NEAREST,this._minFilter=d.NEAREST,this._wrapS=d.CLAMP_TO_EDGE,this._wrapT=d.CLAMP_TO_EDGE,this._anisoSamples=1;var N=this,B=[this._wrapS,this._wrapT];Object.defineProperties(B,[{get:function(){return N._wrapS},set:function(U){return N.wrapS=U}},{get:function(){return N._wrapT},set:function(U){return N.wrapT=U}}]),this._wrapVector=B;var R=[this._shape[0],this._shape[1]];Object.defineProperties(R,[{get:function(){return N._shape[0]},set:function(U){return N.width=U}},{get:function(){return N._shape[1]},set:function(U){return N.height=U}}]),this._shapeVector=R}var g=l.prototype;Object.defineProperties(g,{minFilter:{get:function(){return this._minFilter},set:function(d){this.bind();var y=this.gl;if(this.type===y.FLOAT&&a.indexOf(d)>=0&&(y.getExtension("OES_texture_float_linear")||(d=y.NEAREST)),s.indexOf(d)<0)throw new Error("gl-texture2d: Unknown filter mode "+d);return y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,d),this._minFilter=d}},magFilter:{get:function(){return this._magFilter},set:function(d){this.bind();var y=this.gl;if(this.type===y.FLOAT&&a.indexOf(d)>=0&&(y.getExtension("OES_texture_float_linear")||(d=y.NEAREST)),s.indexOf(d)<0)throw new Error("gl-texture2d: Unknown filter mode "+d);return y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,d),this._magFilter=d}},mipSamples:{get:function(){return this._anisoSamples},set:function(d){var y=this._anisoSamples;if(this._anisoSamples=Math.max(d,1)|0,y!==this._anisoSamples){var I=this.gl.getExtension("EXT_texture_filter_anisotropic");I&&this.gl.texParameterf(this.gl.TEXTURE_2D,I.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(d){if(this.bind(),f.indexOf(d)<0)throw new Error("gl-texture2d: Unknown wrap mode "+d);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,d),this._wrapS=d}},wrapT:{get:function(){return this._wrapT},set:function(d){if(this.bind(),f.indexOf(d)<0)throw new Error("gl-texture2d: Unknown wrap mode "+d);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,d),this._wrapT=d}},wrap:{get:function(){return this._wrapVector},set:function(d){if(Array.isArray(d)||(d=[d,d]),d.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var y=0;y<2;++y)if(f.indexOf(d[y])<0)throw new Error("gl-texture2d: Unknown wrap mode "+d);this._wrapS=d[0],this._wrapT=d[1];var I=this.gl;return this.bind(),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,this._wrapS),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,this._wrapT),d}},shape:{get:function(){return this._shapeVector},set:function(d){if(!Array.isArray(d))d=[d|0,d|0];else if(d.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,d[0]|0,d[1]|0),[d[0]|0,d[1]|0]}},width:{get:function(){return this._shape[0]},set:function(d){return d=d|0,T(this,d,this._shape[1]),d}},height:{get:function(){return this._shape[1]},set:function(d){return d=d|0,T(this,this._shape[0],d),d}}}),g.bind=function(d){var y=this.gl;return d!==void 0&&y.activeTexture(y.TEXTURE0+(d|0)),y.bindTexture(y.TEXTURE_2D,this.handle),d!==void 0?d|0:y.getParameter(y.ACTIVE_TEXTURE)-y.TEXTURE0},g.dispose=function(){this.gl.deleteTexture(this.handle)},g.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var d=Math.min(this._shape[0],this._shape[1]),y=0;d>0;++y,d>>>=1)this._mipLevels.indexOf(y)<0&&this._mipLevels.push(y)},g.setPixels=function(d,y,I,L){var z=this.gl;this.bind(),Array.isArray(y)?(L=I,I=y[1]|0,y=y[0]|0):(y=y||0,I=I||0),L=L||0;var F=p(d)?d:d.raw;if(F){var N=this._mipLevels.indexOf(L)<0;N?(z.texImage2D(z.TEXTURE_2D,0,this.format,this.format,this.type,F),this._mipLevels.push(L)):z.texSubImage2D(z.TEXTURE_2D,L,y,I,this.format,this.type,F)}else if(d.shape&&d.stride&&d.data){if(d.shape.length<2||y+d.shape[1]>this._shape[1]>>>L||I+d.shape[0]>this._shape[0]>>>L||y<0||I<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");A(z,y,I,L,this.format,this.type,this._mipLevels,d)}else throw new Error("gl-texture2d: Unsupported data type")};function x(d,y){return d.length===3?y[2]===1&&y[1]===d[0]*d[2]&&y[0]===d[2]:y[0]===1&&y[1]===d[0]}function A(d,y,I,L,z,F,N,B){var R=B.dtype,U=B.shape.slice();if(U.length<2||U.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var j=0,Z=0,re=x(U,B.stride.slice());if(R==="float32"?j=d.FLOAT:R==="float64"?(j=d.FLOAT,re=!1,R="float32"):R==="uint8"?j=d.UNSIGNED_BYTE:(j=d.UNSIGNED_BYTE,re=!1,R="uint8"),U.length===2)Z=d.LUMINANCE,U=[U[0],U[1],1],B=o(B.data,U,[B.stride[0],B.stride[1],1],B.offset);else if(U.length===3){if(U[2]===1)Z=d.ALPHA;else if(U[2]===2)Z=d.LUMINANCE_ALPHA;else if(U[2]===3)Z=d.RGB;else if(U[2]===4)Z=d.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");U[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((Z===d.LUMINANCE||Z===d.ALPHA)&&(z===d.LUMINANCE||z===d.ALPHA)&&(Z=z),Z!==z)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var fe=B.size,le=N.indexOf(L)<0;if(le&&N.push(L),j===F&&re)B.offset===0&&B.data.length===fe?le?d.texImage2D(d.TEXTURE_2D,L,z,U[0],U[1],0,z,F,B.data):d.texSubImage2D(d.TEXTURE_2D,L,y,I,U[0],U[1],z,F,B.data):le?d.texImage2D(d.TEXTURE_2D,L,z,U[0],U[1],0,z,F,B.data.subarray(B.offset,B.offset+fe)):d.texSubImage2D(d.TEXTURE_2D,L,y,I,U[0],U[1],z,F,B.data.subarray(B.offset,B.offset+fe));else{var ce;F===d.FLOAT?ce=i.mallocFloat32(fe):ce=i.mallocUint8(fe);var V=o(ce,U,[U[2],U[2]*U[0],1]);j===d.FLOAT&&F===d.UNSIGNED_BYTE?v(V,B):n.assign(V,B),le?d.texImage2D(d.TEXTURE_2D,L,z,U[0],U[1],0,z,F,ce.subarray(0,fe)):d.texSubImage2D(d.TEXTURE_2D,L,y,I,U[0],U[1],z,F,ce.subarray(0,fe)),F===d.FLOAT?i.freeFloat32(ce):i.freeUint8(ce)}}function M(d){var y=d.createTexture();return d.bindTexture(d.TEXTURE_2D,y),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),y}function _(d,y,I,L,z){var F=d.getParameter(d.MAX_TEXTURE_SIZE);if(y<0||y>F||I<0||I>F)throw new Error("gl-texture2d: Invalid texture shape");if(z===d.FLOAT&&!d.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var N=M(d);return d.texImage2D(d.TEXTURE_2D,0,L,y,I,0,L,z,null),new l(d,N,y,I,L,z)}function w(d,y,I,L,z,F){var N=M(d);return d.texImage2D(d.TEXTURE_2D,0,z,z,F,y),new l(d,N,I,L,z,F)}function m(d,y){var I=y.dtype,L=y.shape.slice(),z=d.getParameter(d.MAX_TEXTURE_SIZE);if(L[0]<0||L[0]>z||L[1]<0||L[1]>z)throw new Error("gl-texture2d: Invalid texture size");var F=x(L,y.stride.slice()),N=0;I==="float32"?N=d.FLOAT:I==="float64"?(N=d.FLOAT,F=!1,I="float32"):I==="uint8"?N=d.UNSIGNED_BYTE:(N=d.UNSIGNED_BYTE,F=!1,I="uint8");var B=0;if(L.length===2)B=d.LUMINANCE,L=[L[0],L[1],1],y=o(y.data,L,[y.stride[0],y.stride[1],1],y.offset);else if(L.length===3)if(L[2]===1)B=d.ALPHA;else if(L[2]===2)B=d.LUMINANCE_ALPHA;else if(L[2]===3)B=d.RGB;else if(L[2]===4)B=d.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");N===d.FLOAT&&!d.getExtension("OES_texture_float")&&(N=d.UNSIGNED_BYTE,F=!1);var R,U,j=y.size;if(F)y.offset===0&&y.data.length===j?R=y.data:R=y.data.subarray(y.offset,y.offset+j);else{var Z=[L[2],L[2]*L[0],1];U=i.malloc(j,I);var re=o(U,L,Z,0);(I==="float32"||I==="float64")&&N===d.UNSIGNED_BYTE?v(re,y):n.assign(re,y),R=U.subarray(0,j)}var fe=M(d);return d.texImage2D(d.TEXTURE_2D,0,B,L[0],L[1],0,B,N,R),F||i.free(U),new l(d,fe,L[0],L[1],B,N)}function u(d){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(a||c(d),typeof arguments[1]=="number")return _(d,arguments[1],arguments[2],arguments[3]||d.RGBA,arguments[4]||d.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return _(d,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||d.RGBA,arguments[3]||d.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var y=arguments[1],I=p(y)?y:y.raw;if(I)return w(d,I,y.width|0,y.height|0,arguments[2]||d.RGBA,arguments[3]||d.UNSIGNED_BYTE);if(y.shape&&y.data&&y.stride)return m(d,y)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}}),7790:(function(){}),7815:(function(e,t,r){var o=r(2931),n=r(9970),i=["xyz","xzy","yxz","yzx","zxy","zyx"],a=function(x,A,M,_){for(var w=x.points,m=x.velocities,u=x.divergences,d=[],y=[],I=[],L=[],z=[],F=[],N=0,B=0,R=n.create(),U=n.create(),j=8,Z=0;Z0)for(var ce=0;ceA)return _-1}return _},c=function(x,A,M){return xM?M:x},p=function(x,A,M){var _=A.vectors,w=A.meshgrid,m=x[0],u=x[1],d=x[2],y=w[0].length,I=w[1].length,L=w[2].length,z=f(w[0],m),F=f(w[1],u),N=f(w[2],d),B=z+1,R=F+1,U=N+1;if(z=c(z,0,y-1),B=c(B,0,y-1),F=c(F,0,I-1),R=c(R,0,I-1),N=c(N,0,L-1),U=c(U,0,L-1),z<0||F<0||N<0||B>y-1||R>I-1||U>L-1)return o.create();var j=w[0][z],Z=w[0][B],re=w[1][F],fe=w[1][R],le=w[2][N],ce=w[2][U],V=(m-j)/(Z-j),ee=(u-re)/(fe-re),ne=(d-le)/(ce-le);isFinite(V)||(V=.5),isFinite(ee)||(ee=.5),isFinite(ne)||(ne=.5);var $,ue,te,H,ae,ie;switch(M.reversedX&&(z=y-1-z,B=y-1-B),M.reversedY&&(F=I-1-F,R=I-1-R),M.reversedZ&&(N=L-1-N,U=L-1-U),M.filled){case 5:ae=N,ie=U,te=F*L,H=R*L,$=z*L*I,ue=B*L*I;break;case 4:ae=N,ie=U,$=z*L,ue=B*L,te=F*L*y,H=R*L*y;break;case 3:te=F,H=R,ae=N*I,ie=U*I,$=z*I*L,ue=B*I*L;break;case 2:te=F,H=R,$=z*I,ue=B*I,ae=N*I*y,ie=U*I*y;break;case 1:$=z,ue=B,ae=N*y,ie=U*y,te=F*y*L,H=R*y*L;break;default:$=z,ue=B,te=F*y,H=R*y,ae=N*y*I,ie=U*y*I;break}var de=_[$+te+ae],Se=_[$+te+ie],Le=_[$+H+ae],Fe=_[$+H+ie],ze=_[ue+te+ae],Ye=_[ue+te+ie],st=_[ue+H+ae],ct=_[ue+H+ie],at=o.create(),et=o.create(),Pe=o.create(),Ae=o.create();o.lerp(at,de,ze,V),o.lerp(et,Se,Ye,V),o.lerp(Pe,Le,st,V),o.lerp(Ae,Fe,ct,V);var pe=o.create(),Ne=o.create();o.lerp(pe,at,Pe,ee),o.lerp(Ne,et,Ae,ee);var ut=o.create();return o.lerp(ut,pe,Ne,ne),ut},v=function(x){var A=1/0;x.sort(function(m,u){return m-u});for(var M=x.length,_=1;_B||ctR||atU)},Z=o.distance(A[0],A[1]),re=10*Z/_,fe=re*re,le=1,ce=0,V=M.length;V>1&&(le=T(M));for(var ee=0;eece&&(ce=de),ae.push(de),L.push({points:$,velocities:ue,divergences:ae});for(var Se=0;Se<_*100&&$.length<_&&j(ne);){Se++;var Le=o.clone(te),Fe=o.squaredLength(Le);if(Fe===0)break;if(Fe>fe&&o.scale(Le,Le,re/Math.sqrt(Fe)),o.add(Le,Le,ne),te=y(Le),o.squaredDistance(H,Le)-fe>-1e-4*fe){$.push(Le),H=Le,ue.push(te);var ie=I(Le,te),de=o.length(ie);isFinite(de)&&de>ce&&(ce=de),ae.push(de)}ne=Le}}var ze=s(L,x.colormap,ce,le);return m?ze.tubeScale=m:(ce===0&&(ce=1),ze.tubeScale=w*.5*le/ce),ze};var l=r(6740),g=r(6405).createMesh;e.exports.createTubeMesh=function(x,A){return g(x,A,{shaders:l,traceType:"streamtube"})}}),7827:(function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]}),7842:(function(e,t,r){var o=r(6330),n=r(1533),i=r(2651),a=r(6768),s=r(869),f=r(8697);e.exports=c;function c(p,v){if(o(p))return v?f(p,c(v)):[p[0].clone(),p[1].clone()];var T=0,l,g;if(n(p))l=p.clone();else if(typeof p=="string")l=a(p);else{if(p===0)return[i(0),i(1)];if(p===Math.floor(p))l=i(p);else{for(;p!==Math.floor(p);)p=p*Math.pow(2,256),T-=256;l=i(p)}}if(o(v))l.mul(v[1]),g=v[0].clone();else if(n(v))g=v.clone();else if(typeof v=="string")g=a(v);else if(!v)g=i(1);else if(v===Math.floor(v))g=i(v);else{for(;v!==Math.floor(v);)v=v*Math.pow(2,256),T+=256;g=i(v)}return T>0?l=l.ushln(T):T<0&&(g=g.ushln(-T)),s(l,g)}}),7894:(function(e){e.exports=t;function t(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}}),7932:(function(e,t,r){var o=r(620);e.exports=o.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])}),7960:(function(e){e.exports=t;function t(r,o){var n=o[0]-r[0],i=o[1]-r[1],a=o[2]-r[2],s=o[3]-r[3];return n*n+i*i+a*a+s*s}}),8105:(function(e){e.exports=r;var t={"lo===p0":o,"lo=p0)&&!(p1>=hi)":c};function r(p){return t[p]}function o(p,v,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=v,d=p+v,y=T;l>y;++y,_+=M){var I=g[_+u];if(I===A)if(m===y)m+=1,w+=M;else{for(var L=0;M>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function n(p,v,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=v,d=p+v,y=T;l>y;++y,_+=M){var I=g[_+u];if(IL;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function i(p,v,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=v,d=p+v,y=T;l>y;++y,_+=M){var I=g[_+d];if(I<=A)if(m===y)m+=1,w+=M;else{for(var L=0;M>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function a(p,v,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=v,d=p+v,y=T;l>y;++y,_+=M){var I=g[_+d];if(I<=A)if(m===y)m+=1,w+=M;else{for(var L=0;M>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var F=x[y];x[y]=x[m],x[m++]=F}}return m}function s(p,v,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=v,d=p+v,y=T;l>y;++y,_+=M){var I=g[_+u],L=g[_+d];if(I<=A&&A<=L)if(m===y)m+=1,w+=M;else{for(var z=0;M>z;++z){var F=g[_+z];g[_+z]=g[w],g[w++]=F}var N=x[y];x[y]=x[m],x[m++]=N}}return m}function f(p,v,T,l,g,x,A){for(var M=2*p,_=M*T,w=_,m=T,u=v,d=p+v,y=T;l>y;++y,_+=M){var I=g[_+u],L=g[_+d];if(Iz;++z){var F=g[_+z];g[_+z]=g[w],g[w++]=F}var N=x[y];x[y]=x[m],x[m++]=N}}return m}function c(p,v,T,l,g,x,A,M){for(var _=2*p,w=_*T,m=w,u=T,d=v,y=p+v,I=T;l>I;++I,w+=_){var L=g[w+d],z=g[w+y];if(!(L>=A)&&!(M>=z))if(u===I)u+=1,m+=_;else{for(var F=0;_>F;++F){var N=g[w+F];g[w+F]=g[m],g[m++]=N}var B=x[I];x[I]=x[u],x[u++]=B}}return u}}),8107:(function(e){e.exports=t;function t(r,o,n){return r[0]=Math.min(o[0],n[0]),r[1]=Math.min(o[1],n[1]),r[2]=Math.min(o[2],n[2]),r}}),8116:(function(e,t,r){var o=r(7518),n=r(870);function i(s){this.bindVertexArrayOES=s.bindVertexArray.bind(s),this.createVertexArrayOES=s.createVertexArray.bind(s),this.deleteVertexArrayOES=s.deleteVertexArray.bind(s)}function a(s,f,c,p){var v=s.createVertexArray?new i(s):s.getExtension("OES_vertex_array_object"),T;return v?T=o(s,v):T=n(s),T.update(f,c,p),T}e.exports=a}),8192:(function(e,t,r){e.exports=a;var o=r(2825),n=r(3536),i=r(244);function a(s,f){var c=o(s[0],s[1],s[2]),p=o(f[0],f[1],f[2]);n(c,c),n(p,p);var v=i(c,p);return v>1?0:Math.acos(v)}}),8210:(function(e){e.exports=r;function t(o,n){var i=o+n,a=i-o,s=i-a,f=n-a,c=o-s,p=c+f;return p?[p,i]:[i]}function r(o,n){var i=o.length|0,a=n.length|0;if(i===1&&a===1)return t(o[0],n[0]);var s=i+a,f=new Array(s),c=0,p=0,v=0,T=Math.abs,l=o[p],g=T(l),x=n[v],A=T(x),M,_;g=a?(M=l,p+=1,pc)for(var I=f[l],L=1/Math.sqrt(m*d),y=0;y<3;++y){var z=(y+1)%3,F=(y+2)%3;I[y]+=L*(u[z]*w[F]-u[F]*w[z])}}for(var p=0;pc)for(var L=1/Math.sqrt(N),y=0;y<3;++y)I[y]*=L;else for(var y=0;y<3;++y)I[y]=0}return f},t.faceNormals=function(n,i,a){for(var s=n.length,f=new Array(s),c=a===void 0?o:a,p=0;pc?M=1/Math.sqrt(M):M=0;for(var l=0;l<3;++l)A[l]*=M;f[p]=A}return f}}),8418:(function(e,t,r){var o=r(5219),n=r(2762),i=r(8116),a=r(1888),s=r(6760),f=r(1283),c=r(9366),p=r(5964),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=ArrayBuffer,l=DataView;function g($){return T.isView($)&&!($ instanceof l)}function x($){return Array.isArray($)||g($)}e.exports=ne;function A($,ue){var te=$[0],H=$[1],ae=$[2],ie=$[3];return $[0]=ue[0]*te+ue[4]*H+ue[8]*ae+ue[12]*ie,$[1]=ue[1]*te+ue[5]*H+ue[9]*ae+ue[13]*ie,$[2]=ue[2]*te+ue[6]*H+ue[10]*ae+ue[14]*ie,$[3]=ue[3]*te+ue[7]*H+ue[11]*ae+ue[15]*ie,$}function M($,ue,te,H){return A(H,H),A(H,H),A(H,H)}function _($,ue){this.index=$,this.dataCoordinate=this.position=ue}function w($){return $===!0||$>1?1:$}function m($,ue,te,H,ae,ie,de,Se,Le,Fe,ze,Ye){this.gl=$,this.pixelRatio=1,this.shader=ue,this.orthoShader=te,this.projectShader=H,this.pointBuffer=ae,this.colorBuffer=ie,this.glyphBuffer=de,this.idBuffer=Se,this.vao=Le,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Fe,this.pickOrthoShader=ze,this.pickProjectShader=Ye,this.points=[],this._selectResult=new _(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var u=m.prototype;u.pickSlots=1,u.setPickBase=function($){this.pickId=$},u.isTransparent=function(){if(this.hasAlpha)return!0;for(var $=0;$<3;++$)if(this.axesProject[$]&&this.projectHasAlpha)return!0;return!1},u.isOpaque=function(){if(!this.hasAlpha)return!0;for(var $=0;$<3;++$)if(this.axesProject[$]&&!this.projectHasAlpha)return!0;return!1};var d=[0,0],y=[0,0,0],I=[0,0,0],L=[0,0,0,1],z=[0,0,0,1],F=v.slice(),N=[0,0,0],B=[[0,0,0],[0,0,0]];function R($){return $[0]=$[1]=$[2]=0,$}function U($,ue){return $[0]=ue[0],$[1]=ue[1],$[2]=ue[2],$[3]=1,$}function j($,ue,te,H){return $[0]=ue[0],$[1]=ue[1],$[2]=ue[2],$[te]=H,$}function Z($){for(var ue=B,te=0;te<2;++te)for(var H=0;H<3;++H)ue[te][H]=Math.max(Math.min($[te][H],1e8),-1e8);return ue}function re($,ue,te,H){var ae=ue.axesProject,ie=ue.gl,de=$.uniforms,Se=te.model||v,Le=te.view||v,Fe=te.projection||v,ze=ue.axesBounds,Ye=Z(ue.clipBounds),st;ue.axes&&ue.axes.lastCubeProps?st=ue.axes.lastCubeProps.axis:st=[1,1,1],d[0]=2/ie.drawingBufferWidth,d[1]=2/ie.drawingBufferHeight,$.bind(),de.view=Le,de.projection=Fe,de.screenSize=d,de.highlightId=ue.highlightId,de.highlightScale=ue.highlightScale,de.clipBounds=Ye,de.pickGroup=ue.pickId/255,de.pixelRatio=H;for(var ct=0;ct<3;++ct)if(ae[ct]){de.scale=ue.projectScale[ct],de.opacity=ue.projectOpacity[ct];for(var at=F,et=0;et<16;++et)at[et]=0;for(var et=0;et<4;++et)at[5*et]=1;at[5*ct]=0,st[ct]<0?at[12+ct]=ze[0][ct]:at[12+ct]=ze[1][ct],s(at,Se,at),de.model=at;var Pe=(ct+1)%3,Ae=(ct+2)%3,pe=R(y),Ne=R(I);pe[Pe]=1,Ne[Ae]=1;var ut=M(Fe,Le,Se,U(L,pe)),dt=M(Fe,Le,Se,U(z,Ne));if(Math.abs(ut[1])>Math.abs(dt[1])){var nt=ut;ut=dt,dt=nt,nt=pe,pe=Ne,Ne=nt;var Ft=Pe;Pe=Ae,Ae=Ft}ut[0]<0&&(pe[Pe]=-1),dt[1]>0&&(Ne[Ae]=-1);for(var Nt=0,Qt=0,et=0;et<4;++et)Nt+=Math.pow(Se[4*Pe+et],2),Qt+=Math.pow(Se[4*Ae+et],2);pe[Pe]/=Math.sqrt(Nt),Ne[Ae]/=Math.sqrt(Qt),de.axes[0]=pe,de.axes[1]=Ne,de.fragClipBounds[0]=j(N,Ye[0],ct,-1e8),de.fragClipBounds[1]=j(N,Ye[1],ct,1e8),ue.vao.bind(),ue.vao.draw(ie.TRIANGLES,ue.vertexCount),ue.lineWidth>0&&(ie.lineWidth(ue.lineWidth*H),ue.vao.draw(ie.LINES,ue.lineVertexCount,ue.vertexCount)),ue.vao.unbind()}}var fe=[-1e8,-1e8,-1e8],le=[1e8,1e8,1e8],ce=[fe,le];function V($,ue,te,H,ae,ie,de){var Se=te.gl;if((ie===te.projectHasAlpha||de)&&re(ue,te,H,ae),ie===te.hasAlpha||de){$.bind();var Le=$.uniforms;Le.model=H.model||v,Le.view=H.view||v,Le.projection=H.projection||v,d[0]=2/Se.drawingBufferWidth,d[1]=2/Se.drawingBufferHeight,Le.screenSize=d,Le.highlightId=te.highlightId,Le.highlightScale=te.highlightScale,Le.fragClipBounds=ce,Le.clipBounds=te.axes.bounds,Le.opacity=te.opacity,Le.pickGroup=te.pickId/255,Le.pixelRatio=ae,te.vao.bind(),te.vao.draw(Se.TRIANGLES,te.vertexCount),te.lineWidth>0&&(Se.lineWidth(te.lineWidth*ae),te.vao.draw(Se.LINES,te.lineVertexCount,te.vertexCount)),te.vao.unbind()}}u.draw=function($){var ue=this.useOrtho?this.orthoShader:this.shader;V(ue,this.projectShader,this,$,this.pixelRatio,!1,!1)},u.drawTransparent=function($){var ue=this.useOrtho?this.orthoShader:this.shader;V(ue,this.projectShader,this,$,this.pixelRatio,!0,!1)},u.drawPick=function($){var ue=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;V(ue,this.pickProjectShader,this,$,1,!0,!0)},u.pick=function($){if(!$||$.id!==this.pickId)return null;var ue=$.value[2]+($.value[1]<<8)+($.value[0]<<16);if(ue>=this.pointCount||ue<0)return null;var te=this.points[ue],H=this._selectResult;H.index=ue;for(var ae=0;ae<3;++ae)H.position[ae]=H.dataCoordinate[ae]=te[ae];return H},u.highlight=function($){if(!$)this.highlightId=[1,1,1,1];else{var ue=$.index,te=ue&255,H=ue>>8&255,ae=ue>>16&255;this.highlightId=[te/255,H/255,ae/255,0]}};function ee($,ue,te,H){var ae;x($)?ue<$.length?ae=$[ue]:ae=void 0:ae=$,ae=p(ae);var ie=!0;o(ae)&&(ae="▼",ie=!1),te||(te={});var de=te.family;x(de)&&(de=de[ue]),de||(de="normal");var Se=te.weight;x(Se)&&(Se=Se[ue]),Se||(Se="normal");var Le=te.style;x(Le)&&(Le=Le[ue]),Le||(Le="normal");var Fe=te.variant;x(Fe)&&(Fe=Fe[ue]),Fe||(Fe="normal");var ze=c(ae,{family:de,weight:Se,style:Le,variant:Fe},H),ze=c(ae,te,H);return{mesh:ze[0],lines:ze[1],bounds:ze[2],visible:ie}}u.update=function($){if($=$||{},"perspective"in $&&(this.useOrtho=!$.perspective),"orthographic"in $&&(this.useOrtho=!!$.orthographic),"lineWidth"in $&&(this.lineWidth=$.lineWidth),"project"in $)if(x($.project))this.axesProject=$.project;else{var ue=!!$.project;this.axesProject=[ue,ue,ue]}if("projectScale"in $)if(x($.projectScale))this.projectScale=$.projectScale.slice();else{var te=+$.projectScale;this.projectScale=[te,te,te]}if(this.projectHasAlpha=!1,"projectOpacity"in $){if(x($.projectOpacity))this.projectOpacity=$.projectOpacity.slice();else{var te=+$.projectOpacity;this.projectOpacity=[te,te,te]}for(var H=0;H<3;++H)this.projectOpacity[H]=w(this.projectOpacity[H]),this.projectOpacity[H]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in $&&(this.opacity=w($.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var ae=$.position,ie={family:$.font||"normal",style:$.fontStyle||"normal",weight:$.fontWeight||"normal",variant:$.fontVariant||"normal"},de=$.alignment||[0,0],Se,Le;if(de.length===2)Se=de[0],Le=de[1];else{Se=[],Le=[];for(var H=0;H0){var Ur=0,Mt=Ae,je=[0,0,0,1],Je=[0,0,0,1],ke=x(st)&&x(st[0]),xe=x(et)&&x(et[0]);e:for(var H=0;H0?1-Qt[0][0]:Ot<0?1+Qt[1][0]:1,Kt*=Kt>0?1-Qt[0][1]:Kt<0?1+Qt[1][1]:1;for(var xr=[Ot,Kt],$n=Ft.cells||[],Vn=Ft.positions||[],dt=0;dt<$n.length;++dt)for(var mr=$n[dt],vr=0;vr<3;++vr){for(var Nr=0;Nr<3;++Nr)kr[3*Ur+Nr]=ut[Nr];for(var Nr=0;Nr<4;++Nr)Er[4*Ur+Nr]=je[Nr];Sr[Ur]=Pe;var kn=Vn[mr[vr]];$r[2*Ur]=Xe*(Lt*kn[0]-Ct*kn[1]+xr[0]),$r[2*Ur+1]=Xe*(Ct*kn[0]+Lt*kn[1]+xr[1]),Ur+=1}for(var $n=Nt.edges,Vn=Nt.positions,dt=0;dt<$n.length;++dt)for(var mr=$n[dt],vr=0;vr<2;++vr){for(var Nr=0;Nr<3;++Nr)kr[3*Mt+Nr]=ut[Nr];for(var Nr=0;Nr<4;++Nr)Er[4*Mt+Nr]=Je[Nr];Sr[Mt]=Pe;var kn=Vn[mr[vr]];$r[2*Mt]=Xe*(Lt*kn[0]-Ct*kn[1]+xr[0]),$r[2*Mt+1]=Xe*(Ct*kn[0]+Lt*kn[1]+xr[1]),Mt+=1}}}this.bounds=[Fe,ze],this.points=ae,this.pointCount=ae.length,this.vertexCount=Ae,this.lineVertexCount=pe,this.pointBuffer.update(kr),this.colorBuffer.update(Er),this.glyphBuffer.update($r),this.idBuffer.update(Sr),a.free(kr),a.free(Er),a.free($r),a.free(Sr)},u.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()};function ne($){var ue=$.gl,te=f.createPerspective(ue),H=f.createOrtho(ue),ae=f.createProject(ue),ie=f.createPickPerspective(ue),de=f.createPickOrtho(ue),Se=f.createPickProject(ue),Le=n(ue),Fe=n(ue),ze=n(ue),Ye=n(ue),st=i(ue,[{buffer:Le,size:3,type:ue.FLOAT},{buffer:Fe,size:4,type:ue.FLOAT},{buffer:ze,size:2,type:ue.FLOAT},{buffer:Ye,size:4,type:ue.UNSIGNED_BYTE,normalized:!0}]),ct=new m(ue,te,H,ae,Le,Fe,ze,Ye,st,ie,de,Se);return ct.update($),ct}}),8489:(function(e){e.exports=t;function t(r,o,n,i){return r[0]=o[0]+n[0]*i,r[1]=o[1]+n[1]*i,r[2]=o[2]+n[2]*i,r}}),8507:(function(e){e.exports=o;var t=Math.min;function r(n,i){return n-i}function o(n,i){var a=n.length,s=n.length-i.length;if(s)return s;switch(a){case 0:return 0;case 1:return n[0]-i[0];case 2:return n[0]+n[1]-i[0]-i[1]||t(n[0],n[1])-t(i[0],i[1]);case 3:var f=n[0]+n[1],c=i[0]+i[1];if(s=f+n[2]-(c+i[2]),s)return s;var p=t(n[0],n[1]),v=t(i[0],i[1]);return t(p,n[2])-t(v,i[2])||t(p+n[2],f)-t(v+i[2],c);case 4:var T=n[0],l=n[1],g=n[2],x=n[3],A=i[0],M=i[1],_=i[2],w=i[3];return T+l+g+x-(A+M+_+w)||t(T,l,g,x)-t(A,M,_,w,A)||t(T+l,T+g,T+x,l+g,l+x,g+x)-t(A+M,A+_,A+w,M+_,M+w,_+w)||t(T+l+g,T+l+x,T+g+x,l+g+x)-t(A+M+_,A+M+w,A+_+w,M+_+w);default:for(var m=n.slice().sort(r),u=i.slice().sort(r),d=0;d=a?(M=l,p+=1,p0?1:0}}),8648:(function(e,t,r){e.exports=r(783)}),8692:(function(e){e.exports=t;function t(r,o,n,i){var a=n[0],s=n[1],f=o[0]-a,c=o[1]-s,p=Math.sin(i),v=Math.cos(i);return r[0]=a+f*v-c*p,r[1]=s+f*p+c*v,r[2]=o[2],r}}),8697:(function(e,t,r){var o=r(869);e.exports=n;function n(i,a){return o(i[0].mul(a[1]),i[1].mul(a[0]))}}),8731:(function(e,t,r){e.exports=c;var o=r(8866);function n(p,v,T,l,g,x){this._gl=p,this._wrapper=v,this._index=T,this._locations=l,this._dimension=g,this._constFunc=x}var i=n.prototype;i.pointer=function(v,T,l,g){var x=this,A=x._gl,M=x._locations[x._index];A.vertexAttribPointer(M,x._dimension,v||A.FLOAT,!!T,l||0,g||0),A.enableVertexAttribArray(M)},i.set=function(p,v,T,l){return this._constFunc(this._locations[this._index],p,v,T,l)},Object.defineProperty(i,"location",{get:function(){return this._locations[this._index]},set:function(p){return p!==this._locations[this._index]&&(this._locations[this._index]=p|0,this._wrapper.program=null),p|0}});var a=[function(p,v,T){return T.length===void 0?p.vertexAttrib1f(v,T):p.vertexAttrib1fv(v,T)},function(p,v,T,l){return T.length===void 0?p.vertexAttrib2f(v,T,l):p.vertexAttrib2fv(v,T)},function(p,v,T,l,g){return T.length===void 0?p.vertexAttrib3f(v,T,l,g):p.vertexAttrib3fv(v,T)},function(p,v,T,l,g,x){return T.length===void 0?p.vertexAttrib4f(v,T,l,g,x):p.vertexAttrib4fv(v,T)}];function s(p,v,T,l,g,x,A){var M=a[g],_=new n(p,v,T,l,g,M);Object.defineProperty(x,A,{set:function(w){return p.disableVertexAttribArray(l[T]),M(p,l[T],w),w},get:function(){return _},enumerable:!0})}function f(p,v,T,l,g,x,A){for(var M=new Array(g),_=new Array(g),w=0;w=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);s(p,v,m[0],l,u,g,_)}else if(w.indexOf("mat")>=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);f(p,v,m,l,u,g,_)}else throw new o("","Unknown data type for attribute "+_+": "+w);break}}return g}}),8828:(function(e,t){"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var a=i>>r-1;return(i^a)-a},t.min=function(i,a){return a^(i^a)&-(i65535)<<4,i>>>=a,s=(i>255)<<3,i>>>=s,a|=s,s=(i>15)<<2,i>>>=s,a|=s,s=(i>3)<<1,i>>>=s,a|=s,a|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var a=32;return i&=-i,i&&a--,i&65535&&(a-=16),i&16711935&&(a-=8),i&252645135&&(a-=4),i&858993459&&(a-=2),i&1431655765&&(a-=1),a}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var n=new Array(256);(function(i){for(var a=0;a<256;++a){var s=a,f=a,c=7;for(s>>>=1;s;s>>>=1)f<<=1,f|=s&1,--c;i[a]=f<>>8&255]<<16|n[i>>>16&255]<<8|n[i>>>24&255]},t.interleave2=function(i,a){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,a&=65535,a=(a|a<<8)&16711935,a=(a|a<<4)&252645135,a=(a|a<<2)&858993459,a=(a|a<<1)&1431655765,i|a<<1},t.deinterleave2=function(i,a){return i=i>>>a&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,a,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,a&=1023,a=(a|a<<16)&4278190335,a=(a|a<<8)&251719695,a=(a|a<<4)&3272356035,a=(a|a<<2)&1227133513,i|=a<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,a){return i=i>>>a&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var a=i|i-1;return a+1|(~a&-~a)-1>>>o(i)+1}}),8866:(function(e){function t(r,o,n){this.shortMessage=o||"",this.longMessage=n||"",this.rawError=r||"",this.message="gl-shader: "+(o||r||"")+(n?` +`+n:""),this.stack=new Error().stack}t.prototype=new Error,t.prototype.name="GLError",t.prototype.constructor=t,e.exports=t}),8902:(function(e,t,r){var o=r(2478),n=r(3250)[3],i=0,a=1,s=2;e.exports=A;function f(M,_,w,m,u){this.a=M,this.b=_,this.idx=w,this.lowerIds=m,this.upperIds=u}function c(M,_,w,m){this.a=M,this.b=_,this.type=w,this.idx=m}function p(M,_){var w=M.a[0]-_.a[0]||M.a[1]-_.a[1]||M.type-_.type;return w||M.type!==i&&(w=n(M.a,M.b,_.b),w)?w:M.idx-_.idx}function v(M,_){return n(M.a,M.b,_)}function T(M,_,w,m,u){for(var d=o.lt(_,m,v),y=o.gt(_,m,v),I=d;I1&&n(w[z[N-2]],w[z[N-1]],m)>0;)M.push([z[N-1],z[N-2],u]),N-=1;z.length=N,z.push(u);for(var F=L.upperIds,N=F.length;N>1&&n(w[F[N-2]],w[F[N-1]],m)<0;)M.push([F[N-2],F[N-1],u]),N-=1;F.length=N,F.push(u)}}function l(M,_){var w;return M.a[0]<_.a[0]?w=n(M.a,M.b,_.a):w=n(_.b,_.a,M.a),w||(_.b[0]L[0]&&u.push(new c(L,I,s,d),new c(I,L,a,d))}u.sort(p);for(var z=u[0].a[0]-(1+Math.abs(u[0].a[0]))*Math.pow(2,-52),F=[new f([z,1],[z,0],-1,[],[])],N=[],d=0,B=u.length;d0;){g=m.pop();for(var u=g.adjacent,d=0;d<=A;++d){var y=u[d];if(!(!y.boundary||y.lastVisited<=-M)){for(var I=y.vertices,L=0;L<=A;++L){var z=I[L];z<0?_[L]=x:_[L]=w[z]}var F=this.orient();if(F>0)return y;y.lastVisited=-M,F===0&&m.push(y)}}}return null},T.walk=function(g,x){var A=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,m=x?this.interior.length*Math.random()|0:this.interior.length-1,u=this.interior[m];e:for(;!u.boundary;){for(var d=u.vertices,y=u.adjacent,I=0;I<=M;++I)w[I]=_[d[I]];u.lastVisited=A;for(var I=0;I<=M;++I){var L=y[I];if(!(L.lastVisited>=A)){var z=w[I];w[I]=g;var F=this.orient();if(w[I]=z,F<0){u=L;continue e}else L.boundary?L.lastVisited=-A:L.lastVisited=A}}return}return u},T.addPeaks=function(g,x){var A=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,m=this.interior,u=this.simplices,d=[x];x.lastVisited=A,x.vertices[x.vertices.indexOf(-1)]=A,x.boundary=!1,m.push(x);for(var y=[];d.length>0;){var x=d.pop(),I=x.vertices,L=x.adjacent,z=I.indexOf(A);if(!(z<0)){for(var F=0;F<=M;++F)if(F!==z){var N=L[F];if(!(!N.boundary||N.lastVisited>=A)){var B=N.vertices;if(N.lastVisited!==-A){for(var R=0,U=0;U<=M;++U)B[U]<0?(R=U,w[U]=g):w[U]=_[B[U]];var j=this.orient();if(j>0){B[R]=A,N.boundary=!1,m.push(N),d.push(N),N.lastVisited=A;continue}else N.lastVisited=-A}var Z=N.adjacent,re=I.slice(),fe=L.slice(),le=new i(re,fe,!0);u.push(le);var ce=Z.indexOf(x);if(!(ce<0)){Z[ce]=le,fe[z]=N,re[F]=-1,fe[F]=x,L[F]=le,le.flip();for(var U=0;U<=M;++U){var V=re[U];if(!(V<0||V===A)){for(var ee=new Array(M-1),ne=0,$=0;$<=M;++$){var ue=re[$];ue<0||$===U||(ee[ne++]=ue)}y.push(new a(ee,le,U))}}}}}}}y.sort(s);for(var F=0;F+1=0?m[d++]=u[I]:y=I&1;if(y===(g&1)){var L=m[0];m[0]=m[1],m[1]=L}x.push(m)}}return x};function l(g,x){var A=g.length;if(A===0)throw new Error("Must have at least d+1 points");var M=g[0].length;if(A<=M)throw new Error("Must input at least d+1 points");var _=g.slice(0,M+1),w=o.apply(void 0,_);if(w===0)throw new Error("Input not in general position");for(var m=new Array(M+1),u=0;u<=M;++u)m[u]=u;w<0&&(m[0]=1,m[1]=0);for(var d=new i(m,new Array(M+1),!1),y=d.adjacent,I=new Array(M+2),u=0;u<=M;++u){for(var L=m.slice(),z=0;z<=M;++z)z===u&&(L[z]=-1);var F=L[0];L[0]=L[1],L[1]=F;var N=new i(L,new Array(M+1),!0);y[u]=N,I[u]=N}I[M+1]=d;for(var u=0;u<=M;++u)for(var L=y[u].vertices,B=y[u].adjacent,z=0;z<=M;++z){var R=L[z];if(R<0){B[z]=d;continue}for(var U=0;U<=M;++U)y[U].vertices.indexOf(R)<0&&(B[z]=y[U])}for(var j=new v(M,_,I),Z=!!x,u=M+1;u=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(w){this.pickId=w};function g(w){for(var m=p({colormap:w,nshades:256,format:"rgba"}),u=new Uint8Array(256*4),d=0;d<256;++d){for(var y=m[d],I=0;I<3;++I)u[4*d+I]=y[I];u[4*d+3]=y[3]*255}return c(u,[256,256,4],[4,0,1])}function x(w){for(var m=w.length,u=new Array(m),d=0;d0){var U=this.triShader;U.bind(),U.uniforms=z,this.triangleVAO.bind(),m.drawArrays(m.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(w){w=w||{};for(var m=this.gl,u=w.model||v,d=w.view||v,y=w.projection||v,I=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],L=0;L<3;++L)I[0][L]=Math.max(I[0][L],this.clipBounds[0][L]),I[1][L]=Math.min(I[1][L],this.clipBounds[1][L]);this._model=[].slice.call(u),this._view=[].slice.call(d),this._projection=[].slice.call(y),this._resolution=[m.drawingBufferWidth,m.drawingBufferHeight];var z={model:u,view:d,projection:y,clipBounds:I,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},F=this.pickShader;F.bind(),F.uniforms=z,this.triangleCount>0&&(this.triangleVAO.bind(),m.drawArrays(m.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(w){if(!w||w.id!==this.pickId)return null;var m=w.value[0]+256*w.value[1]+65536*w.value[2],u=this.cells[m],d=this.positions[u[1]].slice(0,3),y={position:d,dataCoordinate:d,index:Math.floor(u[1]/48)};return this.traceType==="cone"?y.index=Math.floor(u[1]/48):this.traceType==="streamtube"&&(y.intensity=this.intensity[u[1]],y.velocity=this.vectors[u[1]].slice(0,3),y.divergence=this.vectors[u[1]][3],y.index=m),y},l.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function A(w,m){var u=o(w,m.meshShader.vertex,m.meshShader.fragment,null,m.meshShader.attributes);return u.attributes.position.location=0,u.attributes.color.location=2,u.attributes.uv.location=3,u.attributes.vector.location=4,u}function M(w,m){var u=o(w,m.pickShader.vertex,m.pickShader.fragment,null,m.pickShader.attributes);return u.attributes.position.location=0,u.attributes.id.location=1,u.attributes.vector.location=4,u}function _(w,m,u){var d=u.shaders;arguments.length===1&&(m=w,w=m.gl);var y=A(w,d),I=M(w,d),L=a(w,c(new Uint8Array([255,255,255,255]),[1,1,4]));L.generateMipmap(),L.minFilter=w.LINEAR_MIPMAP_LINEAR,L.magFilter=w.LINEAR;var z=n(w),F=n(w),N=n(w),B=n(w),R=n(w),U=i(w,[{buffer:z,type:w.FLOAT,size:4},{buffer:R,type:w.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:N,type:w.FLOAT,size:4},{buffer:B,type:w.FLOAT,size:2},{buffer:F,type:w.FLOAT,size:4}]),j=new T(w,L,y,I,z,F,R,N,B,U,u.traceType||"cone");return j.update(m),j}e.exports=_}),9127:(function(e,t,r){e.exports=i;var o=r(6204),n=r(5771);function i(a){return n(o(a))}}),9131:(function(e,t,r){var o=r(5177),n=r(9288);e.exports=i;function i(a,s){return s=s||1,a[0]=Math.random(),a[1]=Math.random(),a[2]=Math.random(),a[3]=Math.random(),o(a,a),n(a,a,s),a}}),9165:(function(e,t,r){e.exports=T;var o=r(2762),n=r(8116),i=r(3436),a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,g,x,A){this.gl=l,this.shader=A,this.buffer=g,this.vao=x,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var f=s.prototype;f.isOpaque=function(){return!this.hasAlpha},f.isTransparent=function(){return this.hasAlpha},f.drawTransparent=f.draw=function(l){var g=this.gl,x=this.shader.uniforms;this.shader.bind();var A=x.view=l.view||a,M=x.projection=l.projection||a;x.model=l.model||a,x.clipBounds=this.clipBounds,x.opacity=this.opacity;var _=A[12],w=A[13],m=A[14],u=A[15],d=l._ortho||!1,y=d?2:1,I=y*this.pixelRatio*(M[3]*_+M[7]*w+M[11]*m+M[15]*u)/g.drawingBufferHeight;this.vao.bind();for(var L=0;L<3;++L)g.lineWidth(this.lineWidth[L]*this.pixelRatio),x.capSize=this.capSize[L]*I,this.lineCount[L]&&g.drawArrays(g.LINES,this.lineOffset[L],this.lineCount[L]);this.vao.unbind()};function c(l,g){for(var x=0;x<3;++x)l[0][x]=Math.min(l[0][x],g[x]),l[1][x]=Math.max(l[1][x],g[x])}var p=(function(){for(var l=new Array(3),g=0;g<3;++g){for(var x=[],A=1;A<=2;++A)for(var M=-1;M<=1;M+=2){var _=(A+g)%3,w=[0,0,0];w[_]=M,x.push(w)}l[g]=x}return l})();function v(l,g,x,A){for(var M=p[A],_=0;_0){var z=d.slice();z[m]+=I[1][m],M.push(d[0],d[1],d[2],L[0],L[1],L[2],L[3],0,0,0,z[0],z[1],z[2],L[0],L[1],L[2],L[3],0,0,0),c(this.bounds,z),w+=2+v(M,z,L,m)}}}this.lineCount[m]=w-this.lineOffset[m]}this.buffer.update(M)}},f.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function T(l){var g=l.gl,x=o(g),A=n(g,[{buffer:x,type:g.FLOAT,size:3,offset:0,stride:40},{buffer:x,type:g.FLOAT,size:4,offset:12,stride:40},{buffer:x,type:g.FLOAT,size:3,offset:28,stride:40}]),M=i(g);M.attributes.position.location=0,M.attributes.color.location=1,M.attributes.offset.location=2;var _=new s(g,x,A,M);return _.update(l),_}}),9215:(function(e,t,r){e.exports=c;var o=r(4769),n=r(2478);function i(p,v,T){return Math.min(v,Math.max(p,T))}function a(p,v,T){this.dimension=p.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var l=0;l=T-1)for(var w=x.length-1,u=p-v[T-1],m=0;m=T-1){var _=x.length-1;p-v[T-1];for(var w=0;w=0;--T)if(p[--v])return!1;return!0},s.jump=function(p){var v=this.lastT(),T=this.dimension;if(!(p0;--m)l.push(i(M[m-1],_[m-1],arguments[m])),g.push(0)}},s.push=function(p){var v=this.lastT(),T=this.dimension;if(!(p1e-6?1/A:0;this._time.push(p);for(var u=T;u>0;--u){var d=i(_[u-1],w[u-1],arguments[u]);l.push(d),g.push((d-l[x++])*m)}}},s.set=function(p){var v=this.dimension;if(!(p0;--M)T.push(i(x[M-1],A[M-1],arguments[M])),l.push(0)}},s.move=function(p){var v=this.lastT(),T=this.dimension;if(!(p<=v||arguments.length!==T+1)){var l=this._state,g=this._velocity,x=l.length-this.dimension,A=this.bounds,M=A[0],_=A[1],w=p-v,m=w>1e-6?1/w:0;this._time.push(p);for(var u=T;u>0;--u){var d=arguments[u];l.push(i(M[u-1],_[u-1],l[x++]+d)),g.push(d*m)}}},s.idle=function(p){var v=this.lastT();if(!(p=0;--m)l.push(i(M[m],_[m],l[x]+w*g[x])),g.push(0),x+=1}};function f(p){for(var v=new Array(p),T=0;T1&&a.indexOf("Macintosh")!==-1&&a.indexOf("Safari")!==-1&&(s=!0),s}}),9226:(function(e){e.exports=t;function t(r,o){return r[0]=Math.ceil(o[0]),r[1]=Math.ceil(o[1]),r[2]=Math.ceil(o[2]),r}}),9265:(function(e){e.exports=t;function t(r,o){return r[0]===o[0]&&r[1]===o[1]&&r[2]===o[2]}}),9288:(function(e){e.exports=t;function t(r,o,n){return r[0]=o[0]*n,r[1]=o[1]*n,r[2]=o[2]*n,r[3]=o[3]*n,r}}),9346:(function(e){var t=new Float64Array(4),r=new Float64Array(4),o=new Float64Array(4);function n(i,a,s,f,c){t.length=v?(u=1,y=v+2*g+A):(u=-g/v,y=g*u+A)):(u=0,x>=0?(d=0,y=A):-x>=l?(d=1,y=l+2*x+A):(d=-x/l,y=x*d+A));else if(d<0)d=0,g>=0?(u=0,y=A):-g>=v?(u=1,y=v+2*g+A):(u=-g/v,y=g*u+A);else{var I=1/m;u*=I,d*=I,y=u*(v*u+T*d+2*g)+d*(T*u+l*d+2*x)+A}else{var L,z,F,N;u<0?(L=T+g,z=l+x,z>L?(F=z-L,N=v-2*T+l,F>=N?(u=1,d=0,y=v+2*g+A):(u=F/N,d=1-u,y=u*(v*u+T*d+2*g)+d*(T*u+l*d+2*x)+A)):(u=0,z<=0?(d=1,y=l+2*x+A):x>=0?(d=0,y=A):(d=-x/l,y=x*d+A))):d<0?(L=T+x,z=v+g,z>L?(F=z-L,N=v-2*T+l,F>=N?(d=1,u=0,y=l+2*x+A):(d=F/N,u=1-d,y=u*(v*u+T*d+2*g)+d*(T*u+l*d+2*x)+A)):(d=0,z<=0?(u=1,y=v+2*g+A):g>=0?(u=0,y=A):(u=-g/v,y=g*u+A))):(F=l+x-T-g,F<=0?(u=0,d=1,y=l+2*x+A):(N=v-2*T+l,F>=N?(u=1,d=0,y=v+2*g+A):(u=F/N,d=1-u,y=u*(v*u+T*d+2*g)+d*(T*u+l*d+2*x)+A)))}for(var B=1-u-d,p=0;px)for(l=x;lg)for(l=g;l=0){for(var B=N.type.charAt(N.type.length-1)|0,R=new Array(B),U=0;U=0;)j+=1;z[F]=j}var Z=new Array(x.length);function re(){_.program=a.program(w,_._vref,_._fref,L,z);for(var fe=0;fete&&ae>0){var ie=(H[ae][0]-te)/(H[ae][0]-H[ae-1][0]);return H[ae][1]*(1-ie)+ie*H[ae-1][1]}}return 1}var U=[0,0,0],j={showSurface:!1,showContour:!1,projections:[y.slice(),y.slice(),y.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function Z(te,H){var ae,ie,de,Se=H.axes&&H.axes.lastCubeProps.axis||U,Le=H.showSurface,Fe=H.showContour;for(ae=0;ae<3;++ae)for(Le=Le||H.surfaceProject[ae],ie=0;ie<3;++ie)Fe=Fe||H.contourProject[ae][ie];for(ae=0;ae<3;++ae){var ze=j.projections[ae];for(ie=0;ie<16;++ie)ze[ie]=0;for(ie=0;ie<4;++ie)ze[5*ie]=1;ze[5*ae]=0,ze[12+ae]=H.axesBounds[+(Se[ae]>0)][ae],l(ze,te.model,ze);var Ye=j.clipBounds[ae];for(de=0;de<2;++de)for(ie=0;ie<3;++ie)Ye[de][ie]=te.clipBounds[de][ie];Ye[0][ae]=-1e8,Ye[1][ae]=1e8}return j.showSurface=Le,j.showContour=Fe,j}var re={model:y,view:y,projection:y,inverseModel:y.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},fe=y.slice(),le=[1,0,0,0,1,0,0,0,1];function ce(te,H){te=te||{};var ae=this.gl;ae.disable(ae.CULL_FACE),this._colorMap.bind(0);var ie=re;ie.model=te.model||y,ie.view=te.view||y,ie.projection=te.projection||y,ie.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],ie.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],ie.objectOffset=this.objectOffset,ie.contourColor=this.contourColor[0],ie.inverseModel=g(ie.inverseModel,ie.model);for(var de=0;de<2;++de)for(var Se=ie.clipBounds[de],Le=0;Le<3;++Le)Se[Le]=Math.min(Math.max(this.clipBounds[de][Le],-1e8),1e8);ie.kambient=this.ambientLight,ie.kdiffuse=this.diffuseLight,ie.kspecular=this.specularLight,ie.roughness=this.roughness,ie.fresnel=this.fresnel,ie.opacity=this.opacity,ie.height=0,ie.permutation=le,ie.vertexColor=this.vertexColor;var Fe=fe;for(l(Fe,ie.view,ie.model),l(Fe,ie.projection,Fe),g(Fe,Fe),de=0;de<3;++de)ie.eyePosition[de]=Fe[12+de]/Fe[15];var ze=Fe[15];for(de=0;de<3;++de)ze+=this.lightPosition[de]*Fe[4*de+3];for(de=0;de<3;++de){var Ye=Fe[12+de];for(Le=0;Le<3;++Le)Ye+=Fe[4*Le+de]*this.lightPosition[Le];ie.lightPosition[de]=Ye/ze}var st=Z(ie,this);if(st.showSurface){for(this._shader.bind(),this._shader.uniforms=ie,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(ae.TRIANGLES,this._vertexCount),de=0;de<3;++de)!this.surfaceProject[de]||!this.vertexCount||(this._shader.uniforms.model=st.projections[de],this._shader.uniforms.clipBounds=st.clipBounds[de],this._vao.draw(ae.TRIANGLES,this._vertexCount));this._vao.unbind()}if(st.showContour){var ct=this._contourShader;ie.kambient=1,ie.kdiffuse=0,ie.kspecular=0,ie.opacity=1,ct.bind(),ct.uniforms=ie;var at=this._contourVAO;for(at.bind(),de=0;de<3;++de)for(ct.uniforms.permutation=L[de],ae.lineWidth(this.contourWidth[de]*this.pixelRatio),Le=0;Le>4)/16)/255,de=Math.floor(ie),Se=ie-de,Le=H[1]*(te.value[1]+(te.value[2]&15)/16)/255,Fe=Math.floor(Le),ze=Le-Fe;de+=1,Fe+=1;var Ye=ae.position;Ye[0]=Ye[1]=Ye[2]=0;for(var st=0;st<2;++st)for(var ct=st?Se:1-Se,at=0;at<2;++at)for(var et=at?ze:1-ze,Pe=de+st,Ae=Fe+at,pe=ct*et,Ne=0;Ne<3;++Ne)Ye[Ne]+=this._field[Ne].get(Pe,Ae)*pe;for(var ut=this._pickResult.level,dt=0;dt<3;++dt)if(ut[dt]=x.le(this.contourLevels[dt],Ye[dt]),ut[dt]<0)this.contourLevels[dt].length>0&&(ut[dt]=0);else if(ut[dt]Math.abs(Ft-Ye[dt])&&(ut[dt]+=1)}for(ae.index[0]=Se<.5?de:de+1,ae.index[1]=ze<.5?Fe:Fe+1,ae.uv[0]=ie/H[0],ae.uv[1]=Le/H[1],Ne=0;Ne<3;++Ne)ae.dataCoordinate[Ne]=this._field[Ne].get(ae.index[0],ae.index[1]);return ae},B.padField=function(te,H){var ae=H.shape.slice(),ie=te.shape.slice();c.assign(te.lo(1,1).hi(ae[0],ae[1]),H),c.assign(te.lo(1).hi(ae[0],1),H.hi(ae[0],1)),c.assign(te.lo(1,ie[1]-1).hi(ae[0],1),H.lo(0,ae[1]-1).hi(ae[0],1)),c.assign(te.lo(0,1).hi(1,ae[1]),H.hi(1)),c.assign(te.lo(ie[0]-1,1).hi(1,ae[1]),H.lo(ae[0]-1)),te.set(0,0,H.get(0,0)),te.set(0,ie[1]-1,H.get(0,ae[1]-1)),te.set(ie[0]-1,0,H.get(ae[0]-1,0)),te.set(ie[0]-1,ie[1]-1,H.get(ae[0]-1,ae[1]-1))};function ee(te,H){return Array.isArray(te)?[H(te[0]),H(te[1]),H(te[2])]:[H(te),H(te),H(te)]}function ne(te){return Array.isArray(te)?te.length===3?[te[0],te[1],te[2],1]:[te[0],te[1],te[2],te[3]]:[0,0,0,1]}function $(te){if(Array.isArray(te)){if(Array.isArray(te))return[ne(te[0]),ne(te[1]),ne(te[2])];var H=ne(te);return[H.slice(),H.slice(),H.slice()]}}B.update=function(te){te=te||{},this.objectOffset=te.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in te&&(this.contourWidth=ee(te.contourWidth,Number)),"showContour"in te&&(this.showContour=ee(te.showContour,Boolean)),"showSurface"in te&&(this.showSurface=!!te.showSurface),"contourTint"in te&&(this.contourTint=ee(te.contourTint,Boolean)),"contourColor"in te&&(this.contourColor=$(te.contourColor)),"contourProject"in te&&(this.contourProject=ee(te.contourProject,function(Ca){return ee(Ca,Boolean)})),"surfaceProject"in te&&(this.surfaceProject=te.surfaceProject),"dynamicColor"in te&&(this.dynamicColor=$(te.dynamicColor)),"dynamicTint"in te&&(this.dynamicTint=ee(te.dynamicTint,Number)),"dynamicWidth"in te&&(this.dynamicWidth=ee(te.dynamicWidth,Number)),"opacity"in te&&(this.opacity=te.opacity),"opacityscale"in te&&(this.opacityscale=te.opacityscale),"colorBounds"in te&&(this.colorBounds=te.colorBounds),"vertexColor"in te&&(this.vertexColor=te.vertexColor?1:0),"colormap"in te&&this._colorMap.setPixels(this.genColormap(te.colormap,this.opacityscale));var H=te.field||te.coords&&te.coords[2]||null,ae=!1;if(H||(this._field[2].shape[0]||this._field[2].shape[2]?H=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):H=this._field[2].hi(0,0)),"field"in te||"coords"in te){var ie=(H.shape[0]+2)*(H.shape[1]+2);ie>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(o.nextPow2(ie))),this._field[2]=v(this._field[2].data,[H.shape[0]+2,H.shape[1]+2]),this.padField(this._field[2],H),this.shape=H.shape.slice();for(var de=this.shape,Se=0;Se<2;++Se)this._field[2].size>this._field[Se].data.length&&(s.freeFloat(this._field[Se].data),this._field[Se].data=s.mallocFloat(this._field[2].size)),this._field[Se]=v(this._field[Se].data,[de[0]+2,de[1]+2]);if(te.coords){var Le=te.coords;if(!Array.isArray(Le)||Le.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Se=0;Se<2;++Se){var Fe=Le[Se];for(at=0;at<2;++at)if(Fe.shape[at]!==de[at])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Se],Fe)}}else if(te.ticks){var ze=te.ticks;if(!Array.isArray(ze)||ze.length!==2)throw new Error("gl-surface: invalid ticks");for(Se=0;Se<2;++Se){var Ye=ze[Se];if((Array.isArray(Ye)||Ye.length)&&(Ye=v(Ye)),Ye.shape[0]!==de[Se])throw new Error("gl-surface: invalid tick length");var st=v(Ye.data,de);st.stride[Se]=Ye.stride[0],st.stride[Se^1]=0,this.padField(this._field[Se],st)}}else{for(Se=0;Se<2;++Se){var ct=[0,0];ct[Se]=1,this._field[Se]=v(this._field[Se].data,[de[0]+2,de[1]+2],ct,0)}this._field[0].set(0,0,0);for(var at=0;at0){for(var ha=0;ha<5;++ha)mr.pop();ke-=1}continue e}}}$n.push(ke)}this._contourOffsets[vr]=kn,this._contourCounts[vr]=$n}var _a=s.mallocFloat(mr.length);for(Se=0;Se=0&&(m=_|0,w+=d*m,u-=m),new x(this.data,u,d,w)},A.step=function(_){var w=this.shape[0],m=this.stride[0],u=this.offset,d=0,y=Math.ceil;return typeof _=="number"&&(d=_|0,d<0?(u+=m*(w-1),w=y(-w/d)):w=y(w/d),m*=d),new x(this.data,w,m,u)},A.transpose=function(_){_=_===void 0?0:_|0;var w=this.shape,m=this.stride;return new x(this.data,w[_],m[_],this.offset)},A.pick=function(_){var w=[],m=[],u=this.offset;typeof _=="number"&&_>=0?u=u+this.stride[0]*_|0:(w.push(this.shape[0]),m.push(this.stride[0]));var d=l[w.length+1];return d(this.data,w,m,u)},function(_,w,m,u){return new x(_,w[0],m[0],u)}},2:function(T,l,g){function x(M,_,w,m,u,d){this.data=M,this.shape=[_,w],this.stride=[m,u],this.offset=d|0}var A=x.prototype;return A.dtype=T,A.dimension=2,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(A,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),A.set=function(_,w,m){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w,m):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]=m},A.get=function(_,w){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]},A.index=function(_,w){return this.offset+this.stride[0]*_+this.stride[1]*w},A.hi=function(_,w){return new x(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,this.stride[0],this.stride[1],this.offset)},A.lo=function(_,w){var m=this.offset,u=0,d=this.shape[0],y=this.shape[1],I=this.stride[0],L=this.stride[1];return typeof _=="number"&&_>=0&&(u=_|0,m+=I*u,d-=u),typeof w=="number"&&w>=0&&(u=w|0,m+=L*u,y-=u),new x(this.data,d,y,I,L,m)},A.step=function(_,w){var m=this.shape[0],u=this.shape[1],d=this.stride[0],y=this.stride[1],I=this.offset,L=0,z=Math.ceil;return typeof _=="number"&&(L=_|0,L<0?(I+=d*(m-1),m=z(-m/L)):m=z(m/L),d*=L),typeof w=="number"&&(L=w|0,L<0?(I+=y*(u-1),u=z(-u/L)):u=z(u/L),y*=L),new x(this.data,m,u,d,y,I)},A.transpose=function(_,w){_=_===void 0?0:_|0,w=w===void 0?1:w|0;var m=this.shape,u=this.stride;return new x(this.data,m[_],m[w],u[_],u[w],this.offset)},A.pick=function(_,w){var m=[],u=[],d=this.offset;typeof _=="number"&&_>=0?d=d+this.stride[0]*_|0:(m.push(this.shape[0]),u.push(this.stride[0])),typeof w=="number"&&w>=0?d=d+this.stride[1]*w|0:(m.push(this.shape[1]),u.push(this.stride[1]));var y=l[m.length+1];return y(this.data,m,u,d)},function(_,w,m,u){return new x(_,w[0],w[1],m[0],m[1],u)}},3:function(T,l,g){function x(M,_,w,m,u,d,y,I){this.data=M,this.shape=[_,w,m],this.stride=[u,d,y],this.offset=I|0}var A=x.prototype;return A.dtype=T,A.dimension=3,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(A,"order",{get:function(){var _=Math.abs(this.stride[0]),w=Math.abs(this.stride[1]),m=Math.abs(this.stride[2]);return _>w?w>m?[2,1,0]:_>m?[1,2,0]:[1,0,2]:_>m?[2,0,1]:m>w?[0,1,2]:[0,2,1]}}),A.set=function(_,w,m,u){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m,u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m]=u},A.get=function(_,w,m){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m]},A.index=function(_,w,m){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m},A.hi=function(_,w,m){return new x(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof m!="number"||m<0?this.shape[2]:m|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},A.lo=function(_,w,m){var u=this.offset,d=0,y=this.shape[0],I=this.shape[1],L=this.shape[2],z=this.stride[0],F=this.stride[1],N=this.stride[2];return typeof _=="number"&&_>=0&&(d=_|0,u+=z*d,y-=d),typeof w=="number"&&w>=0&&(d=w|0,u+=F*d,I-=d),typeof m=="number"&&m>=0&&(d=m|0,u+=N*d,L-=d),new x(this.data,y,I,L,z,F,N,u)},A.step=function(_,w,m){var u=this.shape[0],d=this.shape[1],y=this.shape[2],I=this.stride[0],L=this.stride[1],z=this.stride[2],F=this.offset,N=0,B=Math.ceil;return typeof _=="number"&&(N=_|0,N<0?(F+=I*(u-1),u=B(-u/N)):u=B(u/N),I*=N),typeof w=="number"&&(N=w|0,N<0?(F+=L*(d-1),d=B(-d/N)):d=B(d/N),L*=N),typeof m=="number"&&(N=m|0,N<0?(F+=z*(y-1),y=B(-y/N)):y=B(y/N),z*=N),new x(this.data,u,d,y,I,L,z,F)},A.transpose=function(_,w,m){_=_===void 0?0:_|0,w=w===void 0?1:w|0,m=m===void 0?2:m|0;var u=this.shape,d=this.stride;return new x(this.data,u[_],u[w],u[m],d[_],d[w],d[m],this.offset)},A.pick=function(_,w,m){var u=[],d=[],y=this.offset;typeof _=="number"&&_>=0?y=y+this.stride[0]*_|0:(u.push(this.shape[0]),d.push(this.stride[0])),typeof w=="number"&&w>=0?y=y+this.stride[1]*w|0:(u.push(this.shape[1]),d.push(this.stride[1])),typeof m=="number"&&m>=0?y=y+this.stride[2]*m|0:(u.push(this.shape[2]),d.push(this.stride[2]));var I=l[u.length+1];return I(this.data,u,d,y)},function(_,w,m,u){return new x(_,w[0],w[1],w[2],m[0],m[1],m[2],u)}},4:function(T,l,g){function x(M,_,w,m,u,d,y,I,L,z){this.data=M,this.shape=[_,w,m,u],this.stride=[d,y,I,L],this.offset=z|0}var A=x.prototype;return A.dtype=T,A.dimension=4,Object.defineProperty(A,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(A,"order",{get:g}),A.set=function(_,w,m,u,d){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u,d):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u]=d},A.get=function(_,w,m,u){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u]},A.index=function(_,w,m,u){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u},A.hi=function(_,w,m,u){return new x(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof m!="number"||m<0?this.shape[2]:m|0,typeof u!="number"||u<0?this.shape[3]:u|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},A.lo=function(_,w,m,u){var d=this.offset,y=0,I=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],N=this.stride[0],B=this.stride[1],R=this.stride[2],U=this.stride[3];return typeof _=="number"&&_>=0&&(y=_|0,d+=N*y,I-=y),typeof w=="number"&&w>=0&&(y=w|0,d+=B*y,L-=y),typeof m=="number"&&m>=0&&(y=m|0,d+=R*y,z-=y),typeof u=="number"&&u>=0&&(y=u|0,d+=U*y,F-=y),new x(this.data,I,L,z,F,N,B,R,U,d)},A.step=function(_,w,m,u){var d=this.shape[0],y=this.shape[1],I=this.shape[2],L=this.shape[3],z=this.stride[0],F=this.stride[1],N=this.stride[2],B=this.stride[3],R=this.offset,U=0,j=Math.ceil;return typeof _=="number"&&(U=_|0,U<0?(R+=z*(d-1),d=j(-d/U)):d=j(d/U),z*=U),typeof w=="number"&&(U=w|0,U<0?(R+=F*(y-1),y=j(-y/U)):y=j(y/U),F*=U),typeof m=="number"&&(U=m|0,U<0?(R+=N*(I-1),I=j(-I/U)):I=j(I/U),N*=U),typeof u=="number"&&(U=u|0,U<0?(R+=B*(L-1),L=j(-L/U)):L=j(L/U),B*=U),new x(this.data,d,y,I,L,z,F,N,B,R)},A.transpose=function(_,w,m,u){_=_===void 0?0:_|0,w=w===void 0?1:w|0,m=m===void 0?2:m|0,u=u===void 0?3:u|0;var d=this.shape,y=this.stride;return new x(this.data,d[_],d[w],d[m],d[u],y[_],y[w],y[m],y[u],this.offset)},A.pick=function(_,w,m,u){var d=[],y=[],I=this.offset;typeof _=="number"&&_>=0?I=I+this.stride[0]*_|0:(d.push(this.shape[0]),y.push(this.stride[0])),typeof w=="number"&&w>=0?I=I+this.stride[1]*w|0:(d.push(this.shape[1]),y.push(this.stride[1])),typeof m=="number"&&m>=0?I=I+this.stride[2]*m|0:(d.push(this.shape[2]),y.push(this.stride[2])),typeof u=="number"&&u>=0?I=I+this.stride[3]*u|0:(d.push(this.shape[3]),y.push(this.stride[3]));var L=l[d.length+1];return L(this.data,d,y,I)},function(_,w,m,u){return new x(_,w[0],w[1],w[2],w[3],m[0],m[1],m[2],m[3],u)}},5:function(l,g,x){function A(_,w,m,u,d,y,I,L,z,F,N,B){this.data=_,this.shape=[w,m,u,d,y],this.stride=[I,L,z,F,N],this.offset=B|0}var M=A.prototype;return M.dtype=l,M.dimension=5,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(M,"order",{get:x}),M.set=function(w,m,u,d,y,I){return l==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*d+this.stride[4]*y,I):this.data[this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*d+this.stride[4]*y]=I},M.get=function(w,m,u,d,y){return l==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*d+this.stride[4]*y):this.data[this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*d+this.stride[4]*y]},M.index=function(w,m,u,d,y){return this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*d+this.stride[4]*y},M.hi=function(w,m,u,d,y){return new A(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof m!="number"||m<0?this.shape[1]:m|0,typeof u!="number"||u<0?this.shape[2]:u|0,typeof d!="number"||d<0?this.shape[3]:d|0,typeof y!="number"||y<0?this.shape[4]:y|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},M.lo=function(w,m,u,d,y){var I=this.offset,L=0,z=this.shape[0],F=this.shape[1],N=this.shape[2],B=this.shape[3],R=this.shape[4],U=this.stride[0],j=this.stride[1],Z=this.stride[2],re=this.stride[3],fe=this.stride[4];return typeof w=="number"&&w>=0&&(L=w|0,I+=U*L,z-=L),typeof m=="number"&&m>=0&&(L=m|0,I+=j*L,F-=L),typeof u=="number"&&u>=0&&(L=u|0,I+=Z*L,N-=L),typeof d=="number"&&d>=0&&(L=d|0,I+=re*L,B-=L),typeof y=="number"&&y>=0&&(L=y|0,I+=fe*L,R-=L),new A(this.data,z,F,N,B,R,U,j,Z,re,fe,I)},M.step=function(w,m,u,d,y){var I=this.shape[0],L=this.shape[1],z=this.shape[2],F=this.shape[3],N=this.shape[4],B=this.stride[0],R=this.stride[1],U=this.stride[2],j=this.stride[3],Z=this.stride[4],re=this.offset,fe=0,le=Math.ceil;return typeof w=="number"&&(fe=w|0,fe<0?(re+=B*(I-1),I=le(-I/fe)):I=le(I/fe),B*=fe),typeof m=="number"&&(fe=m|0,fe<0?(re+=R*(L-1),L=le(-L/fe)):L=le(L/fe),R*=fe),typeof u=="number"&&(fe=u|0,fe<0?(re+=U*(z-1),z=le(-z/fe)):z=le(z/fe),U*=fe),typeof d=="number"&&(fe=d|0,fe<0?(re+=j*(F-1),F=le(-F/fe)):F=le(F/fe),j*=fe),typeof y=="number"&&(fe=y|0,fe<0?(re+=Z*(N-1),N=le(-N/fe)):N=le(N/fe),Z*=fe),new A(this.data,I,L,z,F,N,B,R,U,j,Z,re)},M.transpose=function(w,m,u,d,y){w=w===void 0?0:w|0,m=m===void 0?1:m|0,u=u===void 0?2:u|0,d=d===void 0?3:d|0,y=y===void 0?4:y|0;var I=this.shape,L=this.stride;return new A(this.data,I[w],I[m],I[u],I[d],I[y],L[w],L[m],L[u],L[d],L[y],this.offset)},M.pick=function(w,m,u,d,y){var I=[],L=[],z=this.offset;typeof w=="number"&&w>=0?z=z+this.stride[0]*w|0:(I.push(this.shape[0]),L.push(this.stride[0])),typeof m=="number"&&m>=0?z=z+this.stride[1]*m|0:(I.push(this.shape[1]),L.push(this.stride[1])),typeof u=="number"&&u>=0?z=z+this.stride[2]*u|0:(I.push(this.shape[2]),L.push(this.stride[2])),typeof d=="number"&&d>=0?z=z+this.stride[3]*d|0:(I.push(this.shape[3]),L.push(this.stride[3])),typeof y=="number"&&y>=0?z=z+this.stride[4]*y|0:(I.push(this.shape[4]),L.push(this.stride[4]));var F=g[I.length+1];return F(this.data,I,L,z)},function(w,m,u,d){return new A(w,m[0],m[1],m[2],m[3],m[4],u[0],u[1],u[2],u[3],u[4],d)}}};function f(T,l){var g=l===-1?"T":String(l),x=s[g];return l===-1?x(T):l===0?x(T,p[T][0]):x(T,p[T],a)}function c(T){if(o(T))return"buffer";if(n)switch(Object.prototype.toString.call(T)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(T)?"array":"generic"}var p={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function v(T,l,g,x){if(T===void 0){var u=p.array[0];return u([])}else typeof T=="number"&&(T=[T]);l===void 0&&(l=[T.length]);var A=l.length;if(g===void 0){g=new Array(A);for(var M=A-1,_=1;M>=0;--M)g[M]=_,_*=l[M]}if(x===void 0){x=0;for(var M=0;M1e-6?(g[0]=A/m,g[1]=M/m,g[2]=_/m,g[3]=w/m):(g[0]=g[1]=g[2]=0,g[3]=1)}function v(g,x,A){this.radius=o([A]),this.center=o(x),this.rotation=o(g),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var T=v.prototype;T.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},T.recalcMatrix=function(g){this.radius.curve(g),this.center.curve(g),this.rotation.curve(g);var x=this.computedRotation;p(x,x);var A=this.computedMatrix;i(A,x);var M=this.computedCenter,_=this.computedEye,w=this.computedUp,m=Math.exp(this.computedRadius[0]);_[0]=M[0]+m*A[2],_[1]=M[1]+m*A[6],_[2]=M[2]+m*A[10],w[0]=A[1],w[1]=A[5],w[2]=A[9];for(var u=0;u<3;++u){for(var d=0,y=0;y<3;++y)d+=A[u+4*y]*_[y];A[12+u]=-d}},T.getMatrix=function(g,x){this.recalcMatrix(g);var A=this.computedMatrix;if(x){for(var M=0;M<16;++M)x[M]=A[M];return x}return A},T.idle=function(g){this.center.idle(g),this.radius.idle(g),this.rotation.idle(g)},T.flush=function(g){this.center.flush(g),this.radius.flush(g),this.rotation.flush(g)},T.pan=function(g,x,A,M){x=x||0,A=A||0,M=M||0,this.recalcMatrix(g);var _=this.computedMatrix,w=_[1],m=_[5],u=_[9],d=f(w,m,u);w/=d,m/=d,u/=d;var y=_[0],I=_[4],L=_[8],z=y*w+I*m+L*u;y-=w*z,I-=m*z,L-=u*z;var F=f(y,I,L);y/=F,I/=F,L/=F,_[2],_[6],_[10];var N=y*x+w*A,B=I*x+m*A,R=L*x+u*A;this.center.move(g,N,B,R);var U=Math.exp(this.computedRadius[0]);U=Math.max(1e-4,U+M),this.radius.set(g,Math.log(U))},T.rotate=function(g,x,A,M){this.recalcMatrix(g),x=x||0,A=A||0;var _=this.computedMatrix,w=_[0],m=_[4],u=_[8],d=_[1],y=_[5],I=_[9],L=_[2],z=_[6],F=_[10],N=x*w+A*d,B=x*m+A*y,R=x*u+A*I,U=-(z*R-F*B),j=-(F*N-L*R),Z=-(L*B-z*N),re=Math.sqrt(Math.max(0,1-Math.pow(U,2)-Math.pow(j,2)-Math.pow(Z,2))),fe=c(U,j,Z,re);fe>1e-6?(U/=fe,j/=fe,Z/=fe,re/=fe):(U=j=Z=0,re=1);var le=this.computedRotation,ce=le[0],V=le[1],ee=le[2],ne=le[3],$=ce*re+ne*U+V*Z-ee*j,ue=V*re+ne*j+ee*U-ce*Z,te=ee*re+ne*Z+ce*j-V*U,H=ne*re-ce*U-V*j-ee*Z;if(M){U=L,j=z,Z=F;var ae=Math.sin(M)/f(U,j,Z);U*=ae,j*=ae,Z*=ae,re=Math.cos(x),$=$*re+H*U+ue*Z-te*j,ue=ue*re+H*j+te*U-$*Z,te=te*re+H*Z+$*j-ue*U,H=H*re-$*U-ue*j-te*Z}var ie=c($,ue,te,H);ie>1e-6?($/=ie,ue/=ie,te/=ie,H/=ie):($=ue=te=0,H=1),this.rotation.set(g,$,ue,te,H)},T.lookAt=function(g,x,A,M){this.recalcMatrix(g),A=A||this.computedCenter,x=x||this.computedEye,M=M||this.computedUp;var _=this.computedMatrix;n(_,x,A,M);var w=this.computedRotation;s(w,_[0],_[1],_[2],_[4],_[5],_[6],_[8],_[9],_[10]),p(w,w),this.rotation.set(g,w[0],w[1],w[2],w[3]);for(var m=0,u=0;u<3;++u)m+=Math.pow(A[u]-x[u],2);this.radius.set(g,.5*Math.log(Math.max(m,1e-6))),this.center.set(g,A[0],A[1],A[2])},T.translate=function(g,x,A,M){this.center.move(g,x||0,A||0,M||0)},T.setMatrix=function(g,x){var A=this.computedRotation;s(A,x[0],x[1],x[2],x[4],x[5],x[6],x[8],x[9],x[10]),p(A,A),this.rotation.set(g,A[0],A[1],A[2],A[3]);var M=this.computedMatrix;a(M,x);var _=M[15];if(Math.abs(_)>1e-6){var w=M[12]/_,m=M[13]/_,u=M[14]/_;this.recalcMatrix(g);var d=Math.exp(this.computedRadius[0]);this.center.set(g,w-M[2]*d,m-M[6]*d,u-M[10]*d),this.radius.idle(g)}else this.center.idle(g),this.radius.idle(g)},T.setDistance=function(g,x){x>0&&this.radius.set(g,Math.log(x))},T.setDistanceLimits=function(g,x){g>0?g=Math.log(g):g=-1/0,x>0?x=Math.log(x):x=1/0,x=Math.max(x,g),this.radius.bounds[0][0]=g,this.radius.bounds[1][0]=x},T.getDistanceLimits=function(g){var x=this.radius.bounds;return g?(g[0]=Math.exp(x[0][0]),g[1]=Math.exp(x[1][0]),g):[Math.exp(x[0][0]),Math.exp(x[1][0])]},T.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},T.fromJSON=function(g){var x=this.lastT(),A=g.center;A&&this.center.set(x,A[0],A[1],A[2]);var M=g.rotation;M&&this.rotation.set(x,M[0],M[1],M[2],M[3]);var _=g.distance;_&&_>0&&this.radius.set(x,Math.log(_)),this.setDistanceLimits(g.zoomMin,g.zoomMax)};function l(g){g=g||{};var x=g.center||[0,0,0],A=g.rotation||[0,0,0,1],M=g.radius||1;x=[].slice.call(x,0,3),A=[].slice.call(A,0,4),p(A,A);var _=new v(A,x,Math.log(M));return _.setDistanceLimits(g.zoomMin,g.zoomMax),("eye"in g||"up"in g)&&_.lookAt(0,g.eye,g.center,g.up),_}}),9994:(function(e,t,r){var o=r(9618),n=r(8277);e.exports=function(a,s){for(var f=[],c=a,p=1;Array.isArray(c);)f.push(c.length),p*=c.length,c=c[0];return f.length===0?o():(s||(s=o(new Float64Array(p),f)),n(s,a),s)}})},b={};function S(e){var t=b[e];if(t!==void 0)return t.exports;var r=b[e]={id:e,loaded:!1,exports:{}};return h[e].call(r.exports,r,r.exports,S),r.loaded=!0,r.exports}(function(){S.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})()})(),(function(){S.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}})();var E=S(1964);G.exports=E})()}}),mC=Ge({"node_modules/color-name/index.js"(K,G){G.exports={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]}}}),RR=Ge({"node_modules/color-normalize/node_modules/color-parse/index.js"(K,G){var h=mC();G.exports=S;var b={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function S(E){var e,t=[],r=1,o;if(typeof E=="string")if(E=E.toLowerCase(),h[E])t=h[E].slice(),o="rgb";else if(E==="transparent")r=0,o="rgb",t=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(E)){var n=E.slice(1),i=n.length,a=i<=4;r=1,a?(t=[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16)],i===4&&(r=parseInt(n[3]+n[3],16)/255)):(t=[parseInt(n[0]+n[1],16),parseInt(n[2]+n[3],16),parseInt(n[4]+n[5],16)],i===8&&(r=parseInt(n[6]+n[7],16)/255)),t[0]||(t[0]=0),t[1]||(t[1]=0),t[2]||(t[2]=0),o="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(E)){var s=e[1],f=s==="rgb",n=s.replace(/a$/,"");o=n;var i=n==="cmyk"?4:n==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(v,T){if(/%$/.test(v))return T===i?parseFloat(v)/100:n==="rgb"?parseFloat(v)*255/100:parseFloat(v);if(n[T]==="h"){if(/deg$/.test(v))return parseFloat(v);if(b[v]!==void 0)return b[v]}return parseFloat(v)}),s===n&&t.push(1),r=f||t[i]===void 0?1:t[i],t=t.slice(0,i)}else E.length>10&&/[0-9](?:\s|\/)/.test(E)&&(t=E.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),o=E.match(/([a-z])/ig).join("").toLowerCase());else isNaN(E)?Array.isArray(E)||E.length?(t=[E[0],E[1],E[2]],o="rgb",r=E.length===4?E[3]:1):E instanceof Object&&(E.r!=null||E.red!=null||E.R!=null?(o="rgb",t=[E.r||E.red||E.R||0,E.g||E.green||E.G||0,E.b||E.blue||E.B||0]):(o="hsl",t=[E.h||E.hue||E.H||0,E.s||E.saturation||E.S||0,E.l||E.lightness||E.L||E.b||E.brightness]),r=E.a||E.alpha||E.opacity||1,E.opacity!=null&&(r/=100)):(o="rgb",t=[E>>>16,(E&65280)>>>8,E&255]);return{space:o,values:t,alpha:r}}}}),IR=Ge({"node_modules/color-normalize/node_modules/color-rgba/index.js"(K,G){var h=RR();G.exports=function(E){Array.isArray(E)&&E.raw&&(E=String.raw.apply(null,arguments));var e,t=h(E);if(!t.space)return[];var r=[0,0,0],o=t.space[0]==="h"?[360,100,100]:[255,255,255];return e=Array(3),e[0]=Math.min(Math.max(t.values[0],r[0]),o[0]),e[1]=Math.min(Math.max(t.values[1],r[1]),o[1]),e[2]=Math.min(Math.max(t.values[2],r[2]),o[2]),t.space[0]==="h"&&(e=b(e)),e.push(Math.min(Math.max(t.alpha,0),1)),e};function b(S){var E=S[0]/360,e=S[1]/100,t=S[2]/100,r,o,n,i,a,s=0;if(e===0)return a=t*255,[a,a,a];for(o=t<.5?t*(1+e):t+e-t*e,r=2*t-o,i=[0,0,0];s<3;)n=E+1/3*-(s-1),n<0?n++:n>1&&n--,a=6*n<1?r+(o-r)*6*n:2*n<1?o:3*n<2?r+(o-r)*(2/3-n)*6:r,i[s++]=a*255;return i}}}),QA=Ge({"node_modules/clamp/index.js"(K,G){G.exports=h;function h(b,S,E){return SE?E:b:bS?S:b}}}),TE=Ge({"node_modules/dtype/index.js"(K,G){G.exports=function(h){switch(h){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),D_=Ge({"node_modules/color-normalize/index.js"(K,G){var h=IR(),b=QA(),S=TE();G.exports=function(t,r){(r==="float"||!r)&&(r="array"),r==="uint"&&(r="uint8"),r==="uint_clamped"&&(r="uint8_clamped");var o=S(r),n=new o(4),i=r!=="uint8"&&r!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=h(t),t[0]/=255,t[1]/=255,t[2]/=255),E(t)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]!=null?t[3]:255,i&&(n[0]/=255,n[1]/=255,n[2]/=255,n[3]/=255),n):(i?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]!=null?t[3]:1):(n[0]=b(Math.floor(t[0]*255),0,255),n[1]=b(Math.floor(t[1]*255),0,255),n[2]=b(Math.floor(t[2]*255),0,255),n[3]=t[3]==null?255:b(Math.floor(t[3]*255),0,255)),n)};function E(e){return!!(e instanceof Uint8Array||e instanceof Uint8ClampedArray||Array.isArray(e)&&(e[0]>1||e[0]===0)&&(e[1]>1||e[1]===0)&&(e[2]>1||e[2]===0)&&(!e[3]||e[3]>1))}}}),Gy=Ge({"src/lib/str2rgbarray.js"(K,G){var h=D_();function b(S){return S?h(S):[0,0,0,1]}G.exports=b}}),Xy=Ge({"src/lib/gl_format_color.js"(K,G){var h=Ei(),b=Rs(),S=D_(),E=kc(),e=Xf().defaultLine,t=ws().isArrayOrTypedArray,r=S(e),o=1;function n(c,p){var v=c;return v[3]*=p,v}function i(c){if(h(c))return r;var p=S(c);return p.length?p:r}function a(c){return h(c)?c:o}function s(c,p,v){var T=c.color;T&&T._inputArray&&(T=T._inputArray);var l=t(T),g=t(p),x=E.extractOpts(c),A=[],M,_,w,m,u;if(x.colorscale!==void 0?M=E.makeColorScaleFuncFromTrace(c):M=i,l?_=function(y,I){return y[I]===void 0?r:S(M(y[I]))}:_=i,g?w=function(y,I){return y[I]===void 0?o:a(y[I])}:w=a,l||g)for(var d=0;d0){var v=o.c2l(c);o._lowerLogErrorBound||(o._lowerLogErrorBound=v),o._lowerErrorBound=Math.min(o._lowerLogErrorBound,v)}}else i[a]=[-s[0]*r,s[1]*r]}return i}function S(e){for(var t=0;t-1?-1:I.indexOf("right")>-1?1:0}function x(I){return I==null?0:I.indexOf("top")>-1?-1:I.indexOf("bottom")>-1?1:0}function A(I){var L=0,z=0,F=[L,z];if(Array.isArray(I))for(var N=0;N=0){var Z=T(U.position,U.delaunayColor,U.delaunayAxis);Z.opacity=I.opacity,this.delaunayMesh?this.delaunayMesh.update(Z):(Z.gl=L,this.delaunayMesh=E(Z),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},v.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function y(I,L){var z=new p(I,L.uid);return z.update(L),z}G.exports=y}}),yC=Ge({"src/traces/scatter3d/attributes.js"(K,G){var h=Gc(),b=Us(),S=zu(),E=mc().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=Sl(),o=Jl(),n=gC(),i=AE(),a=Ji().extendFlat,s=Hc().overrideAll,f=Op(),c=h.line,p=h.marker,v=p.line,T=a({width:c.width,dash:{valType:"enumerated",values:f(n),dflt:"solid"}},S("line"));function l(x){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var g=G.exports=s({x:h.x,y:h.y,z:{valType:"data_array"},text:a({},h.text,{}),texttemplate:t(),texttemplatefallback:r({editType:"calc"}),hovertext:a({},h.hovertext,{}),hovertemplate:e(),hovertemplatefallback:r(),xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z"),mode:a({},h.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:l(),y:l(),z:l()},connectgaps:h.connectgaps,line:T,marker:a({symbol:{valType:"enumerated",values:f(i),dflt:"circle",arrayOk:!0},size:a({},p.size,{dflt:8}),sizeref:p.sizeref,sizemin:p.sizemin,sizemode:p.sizemode,opacity:a({},p.opacity,{arrayOk:!1}),colorbar:p.colorbar,line:a({width:a({},v.width,{arrayOk:!1})},S("marker.line"))},S("marker")),textposition:a({},h.textposition,{dflt:"top center"}),textfont:b({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:o.opacity,hoverinfo:a({},o.hoverinfo)},"calc","nested");g.x.editType=g.y.editType=g.z.editType="calc+clearAxisTypes"}}),OR=Ge({"src/traces/scatter3d/defaults.js"(K,G){var h=Ro(),b=_n(),S=uu(),E=Jd(),e=Hp(),t=op(),r=yC();G.exports=function(i,a,s,f){function c(M,_){return b.coerce(i,a,r,M,_)}var p=o(i,a,c,f);if(!p){a.visible=!1;return}c("text"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),c("xhoverformat"),c("yhoverformat"),c("zhoverformat"),c("mode"),S.hasMarkers(a)&&E(i,a,s,f,c,{noSelect:!0,noAngle:!0}),S.hasLines(a)&&(c("connectgaps"),e(i,a,s,f,c)),S.hasText(a)&&(c("texttemplate"),c("texttemplatefallback"),t(i,a,f,c,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var v=(a.line||{}).color,T=(a.marker||{}).color;c("surfaceaxis")>=0&&c("surfacecolor",v||T);for(var l=["x","y","z"],g=0;g<3;++g){var x="projection."+l[g];c(x+".show")&&(c(x+".opacity"),c(x+".scale"))}var A=h.getComponentMethod("errorbars","supplyDefaults");A(i,a,v||T||s,{axis:"z"}),A(i,a,v||T||s,{axis:"y",inherit:"z"}),A(i,a,v||T||s,{axis:"x",inherit:"z"})};function o(n,i,a,s){var f=0,c=a("x"),p=a("y"),v=a("z"),T=h.getComponentMethod("calendars","handleTraceDefaults");return T(n,i,["x","y","z"],s),c&&p&&v&&(f=Math.min(c.length,p.length,v.length),i._length=i._xlength=i._ylength=i._zlength=f),f}}}),FR=Ge({"src/traces/scatter3d/calc.js"(K,G){var h=h0(),b=sp();G.exports=function(E,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return h(t,e),b(E,e),t}}}),BR=Ge({"node_modules/get-canvas-context/index.js"(K,G){G.exports=h;function h(b,S){if(typeof b!="string")throw new TypeError("must specify type string");if(S=S||{},typeof document>"u"&&!S.canvas)return null;var E=S.canvas||document.createElement("canvas");typeof S.width=="number"&&(E.width=S.width),typeof S.height=="number"&&(E.height=S.height);var e=S,t;try{var r=[b];b.indexOf("webgl")===0&&r.push("experimental-"+b);for(var o=0;o/g," "));i[a]=p,s.tickmode=f}}r.ticks=i;for(var a=0;a<3;++a){.5*(t.glplot.bounds[0][a]+t.glplot.bounds[1][a]);for(var v=0;v<2;++v)r.bounds[v][a]=t.glplot.bounds[v][a]}t.contourLevels=E(i)}}}),VR=Ge({"src/plots/gl3d/scene.js"(K,G){var h=dv().gl_plot3d,b=h.createCamera,S=h.createScene,E=NR(),e=Ww(),t=Ro(),r=_n(),o=r.preserveDrawingBuffer(),n=Ts(),i=Yf(),a=Gy(),s=_C(),f=fg(),c=UR(),p=jR(),v=qR(),T=Np().applyAutorangeOptions,l,g,x=!1;function A(z,F){var N=document.createElement("div"),B=z.container;this.graphDiv=z.graphDiv;var R=document.createElementNS("http://www.w3.org/2000/svg","svg");R.style.position="absolute",R.style.top=R.style.left="0px",R.style.width=R.style.height="100%",R.style["z-index"]=20,R.style["pointer-events"]="none",N.appendChild(R),this.svgContainer=R,N.id=z.id,N.style.position="absolute",N.style.top=N.style.left="0px",N.style.width=N.style.height="100%",B.appendChild(N),this.fullLayout=F,this.id=z.id||"scene",this.fullSceneLayout=F[this.id],this.plotArgs=[[],{},{}],this.axesOptions=c(F,F[this.id]),this.spikeOptions=p(F[this.id]),this.container=N,this.staticMode=!!z.staticPlot,this.pixelRatio=this.pixelRatio||z.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=t.getComponentMethod("annotations3d","convert"),this.drawAnnotations=t.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var M=A.prototype;M.prepareOptions=function(){var z=this,F={canvas:z.canvas,gl:z.gl,glOptions:{preserveDrawingBuffer:o,premultipliedAlpha:!0,antialias:!0},container:z.container,axes:z.axesOptions,spikes:z.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:z.camera,pixelRatio:z.pixelRatio};if(z.staticMode){if(!g&&(l=document.createElement("canvas"),g=E({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!g))throw new Error("error creating static canvas/context for image server");F.gl=g,F.canvas=l}return F};var _=!0;M.tryCreatePlot=function(){var z=this,F=z.prepareOptions(),N=!0;try{z.glplot=S(F)}catch{if(z.staticMode||!_||o)N=!1;else{r.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{o=F.glOptions.preserveDrawingBuffer=!0,z.glplot=S(F)}catch{o=F.glOptions.preserveDrawingBuffer=!1,N=!1}}}return _=!1,N},M.initializeGLCamera=function(){var z=this,F=z.fullSceneLayout.camera,N=F.projection.type==="orthographic";z.camera=b(z.container,{center:[F.center.x,F.center.y,F.center.z],eye:[F.eye.x,F.eye.y,F.eye.z],up:[F.up.x,F.up.y,F.up.z],_ortho:N,zoomMin:.01,zoomMax:100,mode:"orbit"})},M.initializeGLPlot=function(){var z=this;z.initializeGLCamera();var F=z.tryCreatePlot();if(!F)return s(z);z.traces={},z.make4thDimension();var N=z.graphDiv,B=N.layout,R=function(){var j={};return z.isCameraChanged(B)&&(j[z.id+".camera"]=z.getCamera()),z.isAspectChanged(B)&&(j[z.id+".aspectratio"]=z.glplot.getAspectratio(),B[z.id].aspectmode!=="manual"&&(z.fullSceneLayout.aspectmode=B[z.id].aspectmode=j[z.id+".aspectmode"]="manual")),j},U=function(j){if(j.fullSceneLayout.dragmode!==!1){var Z=R();j.saveLayout(B),j.graphDiv.emit("plotly_relayout",Z)}};return z.glplot.canvas&&(z.glplot.canvas.addEventListener("mouseup",function(){U(z)}),z.glplot.canvas.addEventListener("touchstart",function(){x=!0}),z.glplot.canvas.addEventListener("wheel",function(j){if(N._context._scrollZoom.gl3d){if(z.camera._ortho){var Z=j.deltaX>j.deltaY?1.1:.9090909090909091,re=z.glplot.getAspectratio();z.glplot.setAspectratio({x:Z*re.x,y:Z*re.y,z:Z*re.z})}U(z)}},e?{passive:!1}:!1),z.glplot.canvas.addEventListener("mousemove",function(){if(z.fullSceneLayout.dragmode!==!1&&z.camera.mouseListener.buttons!==0){var j=R();z.graphDiv.emit("plotly_relayouting",j)}}),z.staticMode||z.glplot.canvas.addEventListener("webglcontextlost",function(j){N&&N.emit&&N.emit("plotly_webglcontextlost",{event:j,layer:z.id})},!1)),z.glplot.oncontextloss=function(){z.recoverContext()},z.glplot.onrender=function(){z.render()},!0},M.render=function(){var z=this,F=z.graphDiv,N,B=z.svgContainer,R=z.container.getBoundingClientRect();F._fullLayout._calcInverseTransform(F);var U=F._fullLayout._invScaleX,j=F._fullLayout._invScaleY,Z=R.width*U,re=R.height*j;B.setAttributeNS(null,"viewBox","0 0 "+Z+" "+re),B.setAttributeNS(null,"width",Z),B.setAttributeNS(null,"height",re),v(z),z.glplot.axes.update(z.axesOptions);for(var fe=Object.keys(z.traces),le=null,ce=z.glplot.selection,V=0;V")):N.type==="isosurface"||N.type==="volume"?(te.valueLabel=n.hoverLabelText(z._mockAxis,z._mockAxis.d2l(ce.traceCoordinate[3]),N.valuehoverformat),Se.push("value: "+te.valueLabel),ce.textLabel&&Se.push(ce.textLabel),de=Se.join("
")):de=ce.textLabel;var Le={x:ce.traceCoordinate[0],y:ce.traceCoordinate[1],z:ce.traceCoordinate[2],data:$._input,fullData:$,curveNumber:$.index,pointNumber:ue};i.appendArrayPointValue(Le,$,ue),N._module.eventData&&(Le=$._module.eventData(Le,ce,$,{},ue));var Fe={points:[Le]};if(z.fullSceneLayout.hovermode){var ze=[];i.loneHover({trace:$,x:(.5+.5*ne[0]/ne[3])*Z,y:(.5-.5*ne[1]/ne[3])*re,xLabel:te.xLabel,yLabel:te.yLabel,zLabel:te.zLabel,text:de,name:le.name,color:i.castHoverOption($,ue,"bgcolor")||le.color,borderColor:i.castHoverOption($,ue,"bordercolor"),fontFamily:i.castHoverOption($,ue,"font.family"),fontSize:i.castHoverOption($,ue,"font.size"),fontColor:i.castHoverOption($,ue,"font.color"),nameLength:i.castHoverOption($,ue,"namelength"),textAlign:i.castHoverOption($,ue,"align"),hovertemplate:r.castOption($,ue,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Le,te),eventData:[Le]},{container:B,gd:F,inOut_bbox:ze}),Le.bbox=ze[0]}ce.distance<5&&(ce.buttons||x)?F.emit("plotly_click",Fe):F.emit("plotly_hover",Fe),this.oldEventData=Fe}else i.loneUnhover(B),this.oldEventData&&F.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;z.drawAnnotations(z)},M.recoverContext=function(){var z=this;z.glplot.dispose();var F=function(){if(z.glplot.gl.isContextLost()){requestAnimationFrame(F);return}if(!z.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}z.plot.apply(z,z.plotArgs)};requestAnimationFrame(F)};var w=["xaxis","yaxis","zaxis"];function m(z,F,N){for(var B=z.fullSceneLayout,R=0;R<3;R++){var U=w[R],j=U.charAt(0),Z=B[U],re=F[j],fe=F[j+"calendar"],le=F["_"+j+"length"];if(!r.isArrayOrTypedArray(re))N[0][R]=Math.min(N[0][R],0),N[1][R]=Math.max(N[1][R],le-1);else for(var ce,V=0;V<(le||re.length);V++)if(r.isArrayOrTypedArray(re[V]))for(var ee=0;ee$[1][j])$[0][j]=-1,$[1][j]=1;else{var Ye=$[1][j]-$[0][j];$[0][j]-=Ye/32,$[1][j]+=Ye/32}if(te=[$[0][j],$[1][j]],te=T(te,re),$[0][j]=te[0],$[1][j]=te[1],re.isReversed()){var st=$[0][j];$[0][j]=$[1][j],$[1][j]=st}}else te=re.range,$[0][j]=re.r2l(te[0]),$[1][j]=re.r2l(te[1]);$[0][j]===$[1][j]&&($[0][j]-=1,$[1][j]+=1),re.range=[$[0][j],$[1][j]],re.limitRange(),B.glplot.setBounds(j,{min:re.range[0]*ee[j],max:re.range[1]*ee[j]})}var ct,at=le.aspectmode;if(at==="cube")ct=[1,1,1];else if(at==="manual"){var et=le.aspectratio;ct=[et.x,et.y,et.z]}else if(at==="auto"||at==="data"){var Pe=[1,1,1];for(j=0;j<3;++j){re=le[w[j]],fe=re.type;var Ae=ue[fe];Pe[j]=Math.pow(Ae.acc,1/Ae.count)/ee[j]}at==="data"||Math.max.apply(null,Pe)/Math.min.apply(null,Pe)<=4?ct=Pe:ct=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");le.aspectratio.x=ce.aspectratio.x=ct[0],le.aspectratio.y=ce.aspectratio.y=ct[1],le.aspectratio.z=ce.aspectratio.z=ct[2],B.glplot.setAspectratio(le.aspectratio),B.viewInitial.aspectratio||(B.viewInitial.aspectratio={x:le.aspectratio.x,y:le.aspectratio.y,z:le.aspectratio.z}),B.viewInitial.aspectmode||(B.viewInitial.aspectmode=le.aspectmode);var pe=le.domain||null,Ne=F._size||null;if(pe&&Ne){var ut=B.container.style;ut.position="absolute",ut.left=Ne.l+pe.x[0]*Ne.w+"px",ut.top=Ne.t+(1-pe.y[1])*Ne.h+"px",ut.width=Ne.w*(pe.x[1]-pe.x[0])+"px",ut.height=Ne.h*(pe.y[1]-pe.y[0])+"px"}B.glplot.redraw()}},M.destroy=function(){var z=this;z.glplot&&(z.camera.mouseListener.enabled=!1,z.container.removeEventListener("wheel",z.camera.wheelListener),z.camera=null,z.glplot.dispose(),z.container.parentNode.removeChild(z.container),z.glplot=null)};function d(z){return[[z.eye.x,z.eye.y,z.eye.z],[z.center.x,z.center.y,z.center.z],[z.up.x,z.up.y,z.up.z]]}function y(z){return{up:{x:z.up[0],y:z.up[1],z:z.up[2]},center:{x:z.center[0],y:z.center[1],z:z.center[2]},eye:{x:z.eye[0],y:z.eye[1],z:z.eye[2]},projection:{type:z._ortho===!0?"orthographic":"perspective"}}}M.getCamera=function(){var z=this;return z.camera.view.recalcMatrix(z.camera.view.lastT()),y(z.camera)},M.setViewport=function(z){var F=this,N=z.camera;F.camera.lookAt.apply(this,d(N)),F.glplot.setAspectratio(z.aspectratio);var B=N.projection.type==="orthographic",R=F.camera._ortho;B!==R&&(F.glplot.redraw(),F.glplot.clearRGBA(),F.glplot.dispose(),F.initializeGLPlot())},M.isCameraChanged=function(z){var F=this,N=F.getCamera(),B=r.nestedProperty(z,F.id+".camera"),R=B.get();function U(fe,le,ce,V){var ee=["up","center","eye"],ne=["x","y","z"];return le[ee[ce]]&&fe[ee[ce]][ne[V]]===le[ee[ce]][ne[V]]}var j=!1;if(R===void 0)j=!0;else{for(var Z=0;Z<3;Z++)for(var re=0;re<3;re++)if(!U(N,R,Z,re)){j=!0;break}(!R.projection||N.projection&&N.projection.type!==R.projection.type)&&(j=!0)}return j},M.isAspectChanged=function(z){var F=this,N=F.glplot.getAspectratio(),B=r.nestedProperty(z,F.id+".aspectratio"),R=B.get();return R===void 0||R.x!==N.x||R.y!==N.y||R.z!==N.z},M.saveLayout=function(z){var F=this,N=F.fullLayout,B,R,U,j,Z,re,fe=F.isCameraChanged(z),le=F.isAspectChanged(z),ce=fe||le;if(ce){var V={};if(fe&&(B=F.getCamera(),R=r.nestedProperty(z,F.id+".camera"),U=R.get(),V[F.id+".camera"]=U),le&&(j=F.glplot.getAspectratio(),Z=r.nestedProperty(z,F.id+".aspectratio"),re=Z.get(),V[F.id+".aspectratio"]=re),t.call("_storeDirectGUIEdit",z,N._preGUI,V),fe){R.set(B);var ee=r.nestedProperty(N,F.id+".camera");ee.set(B)}if(le){Z.set(j);var ne=r.nestedProperty(N,F.id+".aspectratio");ne.set(j),F.glplot.redraw()}}return ce},M.updateFx=function(z,F){var N=this,B=N.camera;if(B)if(z==="orbit")B.mode="orbit",B.keyBindingMode="rotate";else if(z==="turntable"){B.up=[0,0,1],B.mode="turntable",B.keyBindingMode="rotate";var R=N.graphDiv,U=R._fullLayout,j=N.fullSceneLayout.camera,Z=j.up.x,re=j.up.y,fe=j.up.z;if(fe/Math.sqrt(Z*Z+re*re+fe*fe)<.999){var le=N.id+".camera.up",ce={x:0,y:0,z:1},V={};V[le]=ce;var ee=R.layout;t.call("_storeDirectGUIEdit",ee,U._preGUI,V),j.up=ce,r.nestedProperty(ee,le).set(ce)}}else B.keyBindingMode=z;N.fullSceneLayout.hovermode=F};function I(z,F,N){for(var B=0,R=N-1;B0)for(var Z=255/j,re=0;re<3;++re)z[U+re]=Math.min(Z*z[U+re],255)}}M.toImage=function(z){var F=this;z||(z="png"),F.staticMode&&F.container.appendChild(l),F.glplot.redraw();var N=F.glplot.gl,B=N.drawingBufferWidth,R=N.drawingBufferHeight;N.bindFramebuffer(N.FRAMEBUFFER,null);var U=new Uint8Array(B*R*4);N.readPixels(0,0,B,R,N.RGBA,N.UNSIGNED_BYTE,U),I(U,B,R),L(U,B,R);var j=document.createElement("canvas");j.width=B,j.height=R;var Z=j.getContext("2d",{willReadFrequently:!0}),re=Z.createImageData(B,R);re.data.set(U),Z.putImageData(re,0,0);var fe;switch(z){case"jpeg":fe=j.toDataURL("image/jpeg");break;case"webp":fe=j.toDataURL("image/webp");break;default:fe=j.toDataURL("image/png")}return F.staticMode&&F.container.removeChild(l),fe},M.setConvert=function(){for(var z=this,F=0;F<3;F++){var N=z.fullSceneLayout[w[F]];n.setConvert(N,z.fullLayout),N.setScale=r.noop}},M.make4thDimension=function(){var z=this,F=z.graphDiv,N=F._fullLayout;z._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},n.setConvert(z._mockAxis,N)},G.exports=A}}),HR=Ge({"src/plots/gl3d/layout/attributes.js"(K,G){G.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),xC=Ge({"src/plots/gl3d/layout/axis_attributes.js"(K,G){var h=go(),b=id(),S=Ji().extendFlat,E=Hc().overrideAll;G.exports=E({visible:b.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:h.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:b.color,categoryorder:b.categoryorder,categoryarray:b.categoryarray,title:{text:b.title.text,font:b.title.font},type:S({},b.type,{values:["-","linear","log","date","category"]}),autotypenumbers:b.autotypenumbers,autorange:b.autorange,autorangeoptions:{minallowed:b.autorangeoptions.minallowed,maxallowed:b.autorangeoptions.maxallowed,clipmin:b.autorangeoptions.clipmin,clipmax:b.autorangeoptions.clipmax,include:b.autorangeoptions.include,editType:"plot"},rangemode:b.rangemode,minallowed:b.minallowed,maxallowed:b.maxallowed,range:S({},b.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:b.minor.tickmode,nticks:b.nticks,tick0:b.tick0,dtick:b.dtick,tickvals:b.tickvals,ticktext:b.ticktext,ticks:b.ticks,mirror:b.mirror,ticklen:b.ticklen,tickwidth:b.tickwidth,tickcolor:b.tickcolor,showticklabels:b.showticklabels,labelalias:b.labelalias,tickfont:b.tickfont,tickangle:b.tickangle,tickprefix:b.tickprefix,showtickprefix:b.showtickprefix,ticksuffix:b.ticksuffix,showticksuffix:b.showticksuffix,showexponent:b.showexponent,exponentformat:b.exponentformat,minexponent:b.minexponent,separatethousands:b.separatethousands,tickformat:b.tickformat,tickformatstops:b.tickformatstops,hoverformat:b.hoverformat,showline:b.showline,linecolor:b.linecolor,linewidth:b.linewidth,showgrid:b.showgrid,gridcolor:S({},b.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:b.gridwidth,zeroline:b.zeroline,zerolinecolor:b.zerolinecolor,zerolinewidth:b.zerolinewidth},"plot","from-root")}}),bC=Ge({"src/plots/gl3d/layout/layout_attributes.js"(K,G){var h=xC(),b=Cc().attributes,S=Ji().extendFlat,E=_n().counterRegex;function e(t,r,o){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:o,editType:"camera"},editType:"camera"}}G.exports={_arrayAttrRegexps:[E("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:S(e(0,0,1),{}),center:S(e(0,0,0),{}),eye:S(e(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:b({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:h,yaxis:h,zaxis:h,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),GR=Ge({"src/plots/gl3d/layout/axis_defaults.js"(K,G){var h=Rs().mix,b=_n(),S=_u(),E=xC(),e=Ud(),t=Xp(),r=["xaxis","yaxis","zaxis"],o=13600/187;G.exports=function(i,a,s){var f,c;function p(l,g){return b.coerce(f,c,E,l,g)}for(var v=0;v1;function p(v){if(!c){var T=h.validate(a[v],t[v]);if(T)return a[v]}}E(a,s,f,{type:o,attributes:t,handleDefaults:n,fullLayout:s,font:s.font,fullData:f,getDfltFromLayout:p,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function n(i,a,s,f){for(var c=s("bgcolor"),p=b.combine(c,f.paper_bgcolor),v=["up","center","eye"],T=0;T.999)&&(M="turntable")}else M="turntable";s("dragmode",M),s("hovermode",f.getDfltFromLayout("hovermode"))}}}),z_=Ge({"src/plots/gl3d/index.js"(K){var G=Hc().overrideAll,h=cc(),b=VR(),S=Bd().getSubplotData,E=_n(),e=Lv(),t="gl3d",r="scene";K.name=t,K.attr=r,K.idRoot=r,K.idRegex=K.attrRegex=E.counterRegex("scene"),K.attributes=HR(),K.layoutAttributes=bC(),K.baseLayoutAttrOverrides=G({hoverlabel:h.hoverlabel},"plot","nested"),K.supplyLayoutDefaults=XR(),K.plot=function(n){for(var i=n._fullLayout,a=n._fullData,s=i._subplots[t],f=0;f0){I=f[L];break}return I}function T(d,y){if(!(d<1||y<1)){for(var I=p(d),L=p(y),z=1,F=0;FA;)L--,L/=v(L),L++,L1?z:1};function M(d,y,I){var L=I[8]+I[2]*y[0]+I[5]*y[1];return d[0]=(I[6]+I[0]*y[0]+I[3]*y[1])/L,d[1]=(I[7]+I[1]*y[0]+I[4]*y[1])/L,d}function _(d,y,I){return w(d,y,M,I),d}function w(d,y,I,L){for(var z=[0,0],F=d.shape[0],N=d.shape[1],B=0;B0&&this.contourStart[L]!==null&&this.contourEnd[L]!==null&&this.contourEnd[L]>this.contourStart[L]))for(y[L]=!0,z=this.contourStart[L];zre&&(this.minValues[U]=re),this.maxValues[U]f&&(o.isomin=null,o.isomax=null);var c=a("x"),p=a("y"),v=a("z"),T=a("value");if(!c||!c.length||!p||!p.length||!v||!v.length||!T||!T.length){o.visible=!1;return}var l=b.getComponentMethod("calendars","handleTraceDefaults");l(r,o,["x","y","z"],i),a("valuehoverformat"),["x","y","z"].forEach(function(M){a(M+"hoverformat");var _="caps."+M,w=a(_+".show");w&&a(_+".fill");var m="slices."+M,u=a(m+".show");u&&(a(m+".fill"),a(m+".locations"))});var g=a("spaceframe.show");g&&a("spaceframe.fill");var x=a("surface.show");x&&(a("surface.count"),a("surface.fill"),a("surface.pattern"));var A=a("contour.show");A&&(a("contour.color"),a("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(M){a(M)}),E(r,o,i,a,{prefix:"",cLetter:"c"}),o._length=null}G.exports={supplyDefaults:e,supplyIsoDefaults:t}}}),ME=Ge({"src/traces/streamtube/calc.js"(K,G){var h=_n(),b=_d();function S(r,o){o._len=Math.min(o.u.length,o.v.length,o.w.length,o.x.length,o.y.length,o.z.length),o._u=t(o.u,o._len),o._v=t(o.v,o._len),o._w=t(o.w,o._len),o._x=t(o.x,o._len),o._y=t(o.y,o._len),o._z=t(o.z,o._len);var n=E(o);o._gridFill=n.fill,o._Xs=n.Xs,o._Ys=n.Ys,o._Zs=n.Zs,o._len=n.len;var i=0,a,s,f;o.starts&&(a=t(o.starts.x||[]),s=t(o.starts.y||[]),f=t(o.starts.z||[]),i=Math.min(a.length,s.length,f.length)),o._startsX=a||[],o._startsY=s||[],o._startsZ=f||[];var c=0,p=1/0,v;for(v=0;v1&&(u=o[a-1],y=n[a-1],L=i[a-1]),s=0;su?"-":"+")+"x"),A=A.replace("y",(d>y?"-":"+")+"y"),A=A.replace("z",(I>L?"-":"+")+"z");var B=function(){a=0,z=[],F=[],N=[]};(!a||a0;p--){var v=Math.min(c[p],c[p-1]),T=Math.max(c[p],c[p-1]);if(T>v&&v-1}function ae(Mt,je){return Mt===null?je:Mt}function ie(Mt,je,Je){fe();var ke=[je],xe=[Je];if($>=1)ke=[je],xe=[Je];else if($>0){var ye=te(je,Je);ke=ye.xyzv,xe=ye.abc}for(var Ee=0;Ee-1?Je[Qe]:re(Lt,Ct,Ot);xr>-1?Xe[Qe]=xr:Xe[Qe]=ce(Lt,Ct,Ot,ae(Mt,Kt))}V(Xe[0],Xe[1],Xe[2])}}function de(Mt,je,Je){var ke=function(xe,ye,Ee){ie(Mt,[je[xe],je[ye],je[Ee]],[Je[xe],Je[ye],Je[Ee]])};ke(0,1,2),ke(2,3,0)}function Se(Mt,je,Je){var ke=function(xe,ye,Ee){ie(Mt,[je[xe],je[ye],je[Ee]],[Je[xe],Je[ye],Je[Ee]])};ke(0,1,2),ke(3,0,1),ke(2,3,0),ke(1,2,3)}function Le(Mt,je,Je,ke){var xe=Mt[3];xeke&&(xe=ke);for(var ye=(Mt[3]-xe)/(Mt[3]-je[3]+1e-9),Ee=[],Xe=0;Xe<4;Xe++)Ee[Xe]=(1-ye)*Mt[Xe]+ye*je[Xe];return Ee}function Fe(Mt,je,Je){return Mt>=je&&Mt<=Je}function ze(Mt){var je=.001*(B-N);return Mt>=N-je&&Mt<=B+je}function Ye(Mt){for(var je=[],Je=0;Je<4;Je++){var ke=Mt[Je];je.push([f._x[ke],f._y[ke],f._z[ke],f._value[ke]])}return je}var st=3;function ct(Mt,je,Je,ke,xe,ye){ye||(ye=1),Je=[-1,-1,-1];var Ee=!1,Xe=[Fe(je[0][3],ke,xe),Fe(je[1][3],ke,xe),Fe(je[2][3],ke,xe)];if(!Xe[0]&&!Xe[1]&&!Xe[2])return!1;var Qe=function(Ct,Ot,Kt){return ze(Ot[0][3])&&ze(Ot[1][3])&&ze(Ot[2][3])?(ie(Ct,Ot,Kt),!0):yeXe?[z,ye]:[ye,F];Qt(je,Qe[0],Qe[1])}}var Lt=[[Math.min(N,F),Math.max(N,F)],[Math.min(z,B),Math.max(z,B)]];["x","y","z"].forEach(function(Ct){for(var Ot=[],Kt=0;Kt0&&($n.push(na.id),Ct==="x"?Vn.push([na.distRatio,0,0]):Ct==="y"?Vn.push([0,na.distRatio,0]):Vn.push([0,0,na.distRatio]))}else Ct==="x"?kn=$r(1,u-1):Ct==="y"?kn=$r(1,d-1):kn=$r(1,y-1);$n.length>0&&(Ct==="x"?Ot[xr]=ar(Mt,$n,mr,vr,Vn,Ot[xr]):Ct==="y"?Ot[xr]=kr(Mt,$n,mr,vr,Vn,Ot[xr]):Ot[xr]=Er(Mt,$n,mr,vr,Vn,Ot[xr]),xr++),kn.length>0&&(Ct==="x"?Ot[xr]=ut(Mt,kn,mr,vr,Ot[xr]):Ct==="y"?Ot[xr]=dt(Mt,kn,mr,vr,Ot[xr]):Ot[xr]=nt(Mt,kn,mr,vr,Ot[xr]),xr++)}var Un=f.caps[Ct];Un.show&&Un.fill&&(ue(Un.fill),Ct==="x"?Ot[xr]=ut(Mt,[0,u-1],mr,vr,Ot[xr]):Ct==="y"?Ot[xr]=dt(Mt,[0,d-1],mr,vr,Ot[xr]):Ot[xr]=nt(Mt,[0,y-1],mr,vr,Ot[xr]),xr++)}}),x===0&&le(),f._meshX=R,f._meshY=U,f._meshZ=j,f._meshIntensity=Z,f._Xs=_,f._Ys=w,f._Zs=m}return Ur(),f}function s(f,c){var p=f.glplot.gl,v=h({gl:p}),T=new o(f,v,c.uid);return v._trace=T,T.update(c),f.glplot.add(v),T}G.exports={findNearestOnAxis:r,generateIsoMeshes:a,createIsosurfaceTrace:s}}}),QR=Ge({"src/traces/isosurface/index.js"(K,G){G.exports={attributes:SE(),supplyDefaults:TC().supplyDefaults,calc:AC(),colorbar:{min:"cmin",max:"cmax"},plot:EE().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:z_(),categories:["gl3d","showLegend"],meta:{}}}}),eI=Ge({"lib/isosurface.js"(K,G){G.exports=QR()}}),SC=Ge({"src/traces/volume/attributes.js"(K,G){var h=zu(),b=SE(),S=eS(),E=Jl(),e=Ji().extendFlat,t=Hc().overrideAll,r=G.exports=t(e({x:b.x,y:b.y,z:b.z,value:b.value,isomin:b.isomin,isomax:b.isomax,surface:b.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:b.slices,caps:b.caps,text:b.text,hovertext:b.hovertext,xhoverformat:b.xhoverformat,yhoverformat:b.yhoverformat,zhoverformat:b.zhoverformat,valuehoverformat:b.valuehoverformat,hovertemplate:b.hovertemplate,hovertemplatefallback:b.hovertemplatefallback},h("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:b.colorbar,opacity:b.opacity,opacityscale:S.opacityscale,lightposition:b.lightposition,lighting:b.lighting,flatshading:b.flatshading,contour:b.contour,hoverinfo:e({},E.hoverinfo),showlegend:e({},E.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}}),tI=Ge({"src/traces/volume/defaults.js"(K,G){var h=_n(),b=SC(),S=TC().supplyIsoDefaults,E=wC().opacityscaleDefaults;G.exports=function(t,r,o,n){function i(a,s){return h.coerce(t,r,b,a,s)}S(t,r,o,n,i),E(t,r,n,i)}}}),rI=Ge({"src/traces/volume/convert.js"(K,G){var h=dv().gl_mesh3d,b=Xy().parseColorScale,S=_n().isArrayOrTypedArray,E=Gy(),e=kc().extractOpts,t=q3(),r=EE().findNearestOnAxis,o=EE().generateIsoMeshes;function n(s,f,c){this.scene=s,this.uid=c,this.mesh=f,this.name="",this.data=null,this.showContour=!1}var i=n.prototype;i.handlePick=function(s){if(s.object===this.mesh){var f=s.data.index,c=this.data._meshX[f],p=this.data._meshY[f],v=this.data._meshZ[f],T=this.data._Ys.length,l=this.data._Zs.length,g=r(c,this.data._Xs).id,x=r(p,this.data._Ys).id,A=r(v,this.data._Zs).id,M=s.index=A+l*x+l*T*g;s.traceCoordinate=[this.data._meshX[M],this.data._meshY[M],this.data._meshZ[M],this.data._value[M]];var _=this.data.hovertext||this.data.text;return S(_)&&_[M]!==void 0?s.textLabel=_[M]:_&&(s.textLabel=_),!0}},i.update=function(s){var f=this.scene,c=f.fullSceneLayout;this.data=o(s);function p(x,A,M,_){return A.map(function(w){return x.d2l(w,0,_)*M})}var v=t(p(c.xaxis,s._meshX,f.dataScale[0],s.xcalendar),p(c.yaxis,s._meshY,f.dataScale[1],s.ycalendar),p(c.zaxis,s._meshZ,f.dataScale[2],s.zcalendar)),T=t(s._meshI,s._meshJ,s._meshK),l={positions:v,cells:T,lightPosition:[s.lightposition.x,s.lightposition.y,s.lightposition.z],ambient:s.lighting.ambient,diffuse:s.lighting.diffuse,specular:s.lighting.specular,roughness:s.lighting.roughness,fresnel:s.lighting.fresnel,vertexNormalsEpsilon:s.lighting.vertexnormalsepsilon,faceNormalsEpsilon:s.lighting.facenormalsepsilon,opacity:s.opacity,opacityscale:s.opacityscale,contourEnable:s.contour.show,contourColor:E(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},g=e(s);l.vertexIntensity=s._meshIntensity,l.vertexIntensityBounds=[g.min,g.max],l.colormap=b(s),this.mesh.update(l)},i.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function a(s,f){var c=s.glplot.gl,p=h({gl:c}),v=new n(s,p,f.uid);return p._trace=v,v.update(f),s.glplot.add(p),v}G.exports=a}}),nI=Ge({"src/traces/volume/index.js"(K,G){G.exports={attributes:SC(),supplyDefaults:tI(),calc:AC(),colorbar:{min:"cmin",max:"cmax"},plot:rI(),moduleType:"trace",name:"volume",basePlotModule:z_(),categories:["gl3d","showLegend"],meta:{}}}}),aI=Ge({"lib/volume.js"(K,G){G.exports=nI()}}),iI=Ge({"src/traces/mesh3d/defaults.js"(K,G){var h=Ro(),b=_n(),S=yh(),E=j3();G.exports=function(t,r,o,n){function i(p,v){return b.coerce(t,r,E,p,v)}function a(p){var v=p.map(function(T){var l=i(T);return l&&b.isArrayOrTypedArray(l)?l:null});return v.every(function(T){return T&&T.length===v[0].length})&&v}var s=a(["x","y","z"]);if(!s){r.visible=!1;return}if(a(["i","j","k"]),r.i&&(!r.j||!r.k)||r.j&&(!r.k||!r.i)||r.k&&(!r.i||!r.j)){r.visible=!1;return}var f=h.getComponentMethod("calendars","handleTraceDefaults");f(t,r,["x","y","z"],n),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(p){i(p)});var c=i("contour.show");c&&(i("contour.color"),i("contour.width")),"intensity"in t?(i("intensity"),i("intensitymode"),S(t,r,n,i,{prefix:"",cLetter:"c"})):(r.showscale=!1,"facecolor"in t?i("facecolor"):"vertexcolor"in t?i("vertexcolor"):i("color",o)),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),r._length=null}}}),oI=Ge({"src/traces/mesh3d/calc.js"(K,G){var h=_d();G.exports=function(S,E){E.intensity&&h(S,E,{vals:E.intensity,containerStr:"",cLetter:"c"})}}}),sI=Ge({"src/traces/mesh3d/convert.js"(K,G){var h=dv().gl_mesh3d,b=dv().delaunay_triangulate,S=dv().alpha_shape,E=dv().convex_hull,e=Xy().parseColorScale,t=_n().isArrayOrTypedArray,r=Gy(),o=kc().extractOpts,n=q3();function i(l,g,x){this.scene=l,this.uid=x,this.mesh=g,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var a=i.prototype;a.handlePick=function(l){if(l.object===this.mesh){var g=l.index=l.data.index;l.data._cellCenter?l.traceCoordinate=l.data.dataCoordinate:l.traceCoordinate=[this.data.x[g],this.data.y[g],this.data.z[g]];var x=this.data.hovertext||this.data.text;return t(x)&&x[g]!==void 0?l.textLabel=x[g]:x&&(l.textLabel=x),!0}};function s(l){for(var g=[],x=l.length,A=0;A=g-.5)return!1;return!0}a.update=function(l){var g=this.scene,x=g.fullSceneLayout;this.data=l;var A=l.x.length,M=n(f(x.xaxis,l.x,g.dataScale[0],l.xcalendar),f(x.yaxis,l.y,g.dataScale[1],l.ycalendar),f(x.zaxis,l.z,g.dataScale[2],l.zcalendar)),_;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!v(l.i,A)||!v(l.j,A)||!v(l.k,A))return;_=n(c(l.i),c(l.j),c(l.k))}else l.alphahull===0?_=E(M):l.alphahull>0?_=S(l.alphahull,M):_=p(l.delaunayaxis,M);var w={positions:M,cells:_,lightPosition:[l.lightposition.x,l.lightposition.y,l.lightposition.z],ambient:l.lighting.ambient,diffuse:l.lighting.diffuse,specular:l.lighting.specular,roughness:l.lighting.roughness,fresnel:l.lighting.fresnel,vertexNormalsEpsilon:l.lighting.vertexnormalsepsilon,faceNormalsEpsilon:l.lighting.facenormalsepsilon,opacity:l.opacity,contourEnable:l.contour.show,contourColor:r(l.contour.color).slice(0,3),contourWidth:l.contour.width,useFacetNormals:l.flatshading};if(l.intensity){var m=o(l);this.color="#fff";var u=l.intensitymode;w[u+"Intensity"]=l.intensity,w[u+"IntensityBounds"]=[m.min,m.max],w.colormap=e(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],w.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],w.cellColors=s(l.facecolor)):(this.color=l.color,w.meshColor=r(l.color));this.mesh.update(w)},a.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function T(l,g){var x=l.glplot.gl,A=h({gl:x}),M=new i(l,A,g.uid);return A._trace=M,M.update(g),l.glplot.add(A),M}G.exports=T}}),lI=Ge({"src/traces/mesh3d/index.js"(K,G){G.exports={attributes:j3(),supplyDefaults:iI(),calc:oI(),colorbar:{min:"cmin",max:"cmax"},plot:sI(),moduleType:"trace",name:"mesh3d",basePlotModule:z_(),categories:["gl3d","showLegend"],meta:{}}}}),uI=Ge({"lib/mesh3d.js"(K,G){G.exports=lI()}}),MC=Ge({"src/traces/cone/attributes.js"(K,G){var h=zu(),b=mc().axisHoverFormat,{hovertemplateAttrs:S,templatefallbackAttrs:E}=Sl(),e=j3(),t=Jl(),r=Ji().extendFlat,o={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:S({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:E({editType:"calc"}),uhoverformat:b("u",1),vhoverformat:b("v",1),whoverformat:b("w",1),xhoverformat:b("x"),yhoverformat:b("y"),zhoverformat:b("z"),showlegend:r({},t.showlegend,{dflt:!1})};r(o,h("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var n=["opacity","lightposition","lighting"];n.forEach(function(i){o[i]=e[i]}),o.hoverinfo=r({},t.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),G.exports=o}}),cI=Ge({"src/traces/cone/defaults.js"(K,G){var h=_n(),b=yh(),S=MC();G.exports=function(e,t,r,o){function n(T,l){return h.coerce(e,t,S,T,l)}var i=n("u"),a=n("v"),s=n("w"),f=n("x"),c=n("y"),p=n("z");if(!i||!i.length||!a||!a.length||!s||!s.length||!f||!f.length||!c||!c.length||!p||!p.length){t.visible=!1;return}var v=n("sizemode");n("sizeref",v==="raw"?1:.5),n("anchor"),n("lighting.ambient"),n("lighting.diffuse"),n("lighting.specular"),n("lighting.roughness"),n("lighting.fresnel"),n("lightposition.x"),n("lightposition.y"),n("lightposition.z"),b(e,t,o,n,{prefix:"",cLetter:"c"}),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback"),n("uhoverformat"),n("vhoverformat"),n("whoverformat"),n("xhoverformat"),n("yhoverformat"),n("zhoverformat"),t._length=null}}}),fI=Ge({"src/traces/cone/calc.js"(K,G){var h=_d();G.exports=function(S,E){for(var e=E.u,t=E.v,r=E.w,o=Math.min(E.x.length,E.y.length,E.z.length,e.length,t.length,r.length),n=-1/0,i=1/0,a=0;a2?v=c.slice(1,p-1):p===2?v=[(c[0]+c[1])/2]:v=c,v}function a(c){var p=c.length;return p===1?[.5,.5]:[c[1]-c[0],c[p-1]-c[p-2]]}function s(c,p){var v=c.fullSceneLayout,T=c.dataScale,l=p._len,g={};function x(ce,V){var ee=v[V],ne=T[r[V]];return S.simpleMap(ce,function($){return ee.d2l($)*ne})}if(g.vectors=t(x(p._u,"xaxis"),x(p._v,"yaxis"),x(p._w,"zaxis"),l),!l)return{positions:[],cells:[]};var A=x(p._Xs,"xaxis"),M=x(p._Ys,"yaxis"),_=x(p._Zs,"zaxis");g.meshgrid=[A,M,_],g.gridFill=p._gridFill;var w=p._slen;if(w)g.startingPositions=t(x(p._startsX,"xaxis"),x(p._startsY,"yaxis"),x(p._startsZ,"zaxis"));else{for(var m=M[0],u=i(A),d=i(_),y=new Array(u.length*d.length),I=0,L=0;Lm&&(m=I[0]),I[1]u&&(u=I[1])}function y(I){switch(I.type){case"GeometryCollection":I.geometries.forEach(y);break;case"Point":d(I.coordinates);break;case"MultiPoint":I.coordinates.forEach(d);break}}x.arcs.forEach(function(I){for(var L=-1,z=I.length,F;++Lm&&(m=F[0]),F[1]u&&(u=F[1])});for(M in x.objects)y(x.objects[M]);return[_,w,m,u]}function e(x,A){for(var M,_=x.length,w=_-A;w<--_;)M=x[w],x[w++]=x[_],x[_]=M}function t(x,A){return typeof A=="string"&&(A=x.objects[A]),A.type==="GeometryCollection"?{type:"FeatureCollection",features:A.geometries.map(function(M){return r(x,M)})}:r(x,A)}function r(x,A){var M=A.id,_=A.bbox,w=A.properties==null?{}:A.properties,m=o(x,A);return M==null&&_==null?{type:"Feature",properties:w,geometry:m}:_==null?{type:"Feature",id:M,properties:w,geometry:m}:{type:"Feature",id:M,bbox:_,properties:w,geometry:m}}function o(x,A){var M=S(x.transform),_=x.arcs;function w(L,z){z.length&&z.pop();for(var F=_[L<0?~L:L],N=0,B=F.length;N1)_=s(x,A,M);else for(w=0,_=new Array(m=x.arcs.length);w1)for(var z=1,F=d(I[0]),N,B;zF&&(B=I[0],I[0]=I[z],I[z]=B,F=N);return I}).filter(function(y){return y.length>0})}}function v(x,A){for(var M=0,_=x.length;M<_;){var w=M+_>>>1;x[w]=2))throw new Error("n must be ≥2");y=x.bbox||E(x);var M=y[0],_=y[1],w=y[2],m=y[3],u;A={scale:[w-M?(w-M)/(u-1):1,m-_?(m-_)/(u-1):1],translate:[M,_]}}else y=x.bbox;var d=l(A),y,I,L=x.objects,z={};function F(R){return d(R)}function N(R){var U;switch(R.type){case"GeometryCollection":U={type:"GeometryCollection",geometries:R.geometries.map(N)};break;case"Point":U={type:"Point",coordinates:F(R.coordinates)};break;case"MultiPoint":U={type:"MultiPoint",coordinates:R.coordinates.map(F)};break;default:return R}return R.id!=null&&(U.id=R.id),R.bbox!=null&&(U.bbox=R.bbox),R.properties!=null&&(U.properties=R.properties),U}function B(R){var U=0,j=1,Z=R.length,re,fe=new Array(Z);for(fe[0]=d(R[0],0);++U0&&(E.push(e),e=[])}return e.length>0&&E.push(e),E},K.makeLine=function(h){return h.length===1?{type:"LineString",coordinates:h[0]}:{type:"MultiLineString",coordinates:h}},K.makePolygon=function(h){if(h.length===1)return{type:"Polygon",coordinates:h};for(var b=new Array(h.length),S=0;Se(N,z)),F)}function r(L,z,F={}){for(const B of L){if(B.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(B[B.length-1].length!==B[0].length)throw new Error("First and last Position are not equivalent.");for(let R=0;Rr(N,z)),F)}function n(L,z,F={}){if(L.length<2)throw new Error("coordinates must be an array of two or more positions");return S({type:"LineString",coordinates:L},z,F)}function i(L,z,F={}){return a(L.map(N=>n(N,z)),F)}function a(L,z={}){const F={type:"FeatureCollection"};return z.id&&(F.id=z.id),z.bbox&&(F.bbox=z.bbox),F.features=L,F}function s(L,z,F={}){return S({type:"MultiLineString",coordinates:L},z,F)}function f(L,z,F={}){return S({type:"MultiPoint",coordinates:L},z,F)}function c(L,z,F={}){return S({type:"MultiPolygon",coordinates:L},z,F)}function p(L,z,F={}){return S({type:"GeometryCollection",geometries:L},z,F)}function v(L,z=0){if(z&&!(z>=0))throw new Error("precision must be a positive number");const F=Math.pow(10,z||0);return Math.round(L*F)/F}function T(L,z="kilometers"){const F=h[z];if(!F)throw new Error(z+" units is invalid");return L*F}function l(L,z="kilometers"){const F=h[z];if(!F)throw new Error(z+" units is invalid");return L/F}function g(L,z){return M(l(L,z))}function x(L){let z=L%360;return z<0&&(z+=360),z}function A(L){return L=L%360,L>180?L-360:L<-180?L+360:L}function M(L){return L%(2*Math.PI)*180/Math.PI}function _(L){return L%360*Math.PI/180}function w(L,z="kilometers",F="kilometers"){if(!(L>=0))throw new Error("length must be a positive number");return T(l(L,z),F)}function m(L,z="meters",F="kilometers"){if(!(L>=0))throw new Error("area must be a positive number");const N=b[z];if(!N)throw new Error("invalid original units");const B=b[F];if(!B)throw new Error("invalid final units");return L/N*B}function u(L){return!isNaN(L)&&L!==null&&!Array.isArray(L)}function d(L){return L!==null&&typeof L=="object"&&!Array.isArray(L)}function y(L){if(!L)throw new Error("bbox is required");if(!Array.isArray(L))throw new Error("bbox must be an Array");if(L.length!==4&&L.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");L.forEach(z=>{if(!u(z))throw new Error("bbox must only contain numbers")})}function I(L){if(!L)throw new Error("id is required");if(["string","number"].indexOf(typeof L)===-1)throw new Error("id must be a number or a string")}K.areaFactors=b,K.azimuthToBearing=A,K.bearingToAzimuth=x,K.convertArea=m,K.convertLength=w,K.degreesToRadians=_,K.earthRadius=G,K.factors=h,K.feature=S,K.featureCollection=a,K.geometry=E,K.geometryCollection=p,K.isNumber=u,K.isObject=d,K.lengthToDegrees=g,K.lengthToRadians=l,K.lineString=n,K.lineStrings=i,K.multiLineString=s,K.multiPoint=f,K.multiPolygon=c,K.point=e,K.points=t,K.polygon=r,K.polygons=o,K.radiansToDegrees=M,K.radiansToLength=T,K.round=v,K.validateBBox=y,K.validateId=I}}),PE=Ge({"node_modules/@turf/meta/dist/cjs/index.cjs"(K){Object.defineProperty(K,"__esModule",{value:!0});var G=LE();function h(l,g,x){if(l!==null)for(var A,M,_,w,m,u,d,y=0,I=0,L,z=l.type,F=z==="FeatureCollection",N=z==="Feature",B=F?l.features.length:1,R=0;Ru||F>d||N>y){m=I,u=A,d=F,y=N,_=0;return}var B=G.lineString.call(void 0,[m,I],x.properties);if(g(B,A,M,N,_)===!1)return!1;_++,m=I})===!1)return!1}}})}function f(l,g,x){var A=x,M=!1;return s(l,function(_,w,m,u,d){M===!1&&x===void 0?A=_:A=g(A,_,w,m,u,d),M=!0}),A}function c(l,g){if(!l)throw new Error("geojson is required");i(l,function(x,A,M){if(x.geometry!==null){var _=x.geometry.type,w=x.geometry.coordinates;switch(_){case"LineString":if(g(x,A,M,0,0)===!1)return!1;break;case"Polygon":for(var m=0;mi+S(a),0)}function S(n){let i=0,a;switch(n.type){case"Polygon":return E(n.coordinates);case"MultiPolygon":for(a=0;a0){i+=Math.abs(r(n[0]));for(let a=1;a=i?(s+2)%i:s+2],v=f[0]*t,T=c[1]*t,l=p[0]*t;a+=(l-v)*Math.sin(T),s++}return a*e}var o=b;K.area=b,K.default=o}}),TI=Ge({"node_modules/@turf/centroid/dist/cjs/index.cjs"(K){Object.defineProperty(K,"__esModule",{value:!0});var G=LE(),h=PE();function b(E,e={}){let t=0,r=0,o=0;return h.coordEach.call(void 0,E,function(n){t+=n[0],r+=n[1],o++},!0),G.point.call(void 0,[t/o,r/o],e.properties)}var S=b;K.centroid=b,K.default=S}}),AI=Ge({"node_modules/@turf/bbox/dist/cjs/index.cjs"(K){Object.defineProperty(K,"__esModule",{value:!0});var G=PE();function h(S,E={}){if(S.bbox!=null&&E.recompute!==!0)return S.bbox;const e=[1/0,1/0,-1/0,-1/0];return G.coordEach.call(void 0,S,t=>{e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]0&&z[F+1][0]<0)return F;return null}switch(w==="RUS"||w==="FJI"?u=function(z){var F;if(L(z)===null)F=z;else for(F=new Array(z.length),I=0;IF?N[B++]=[z[I][0]+360,z[I][1]]:I===F?(N[B++]=z[I],N[B++]=[z[I][0],-90]):N[B++]=z[I];var R=i.tester(N);R.pts.pop(),m.push(R)}:u=function(z){m.push(i.tester(z))},M.type){case"MultiPolygon":for(d=0;d<_.length;d++)for(y=0;y<_[d].length;y++)u(_[d][y]);break;case"Polygon":for(d=0;d<_.length;d++)u(_[d]);break}return m}function v(A){var M=A.geojson,_=window.PlotlyGeoAssets||{},w=typeof M=="string"?_[M]:M;return o(w)?w:(r.error("Oops ... something went wrong when fetching "+M),!1)}function T(A){var M=A[0].trace,_=v(M);if(!_)return!1;var w={},m=[],u;for(u=0;u0?R.properties.ct=l(R):R.properties.ct=[NaN,NaN],N.fIn=z,N.fOut=R,m.push(R)}else r.log(["Location",N.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete w[F]}switch(_.type){case"FeatureCollection":var I=_.features;for(u=0;um&&(m=y,_=d)}else _=M;return E(_).geometry.coordinates}function g(A){var M=window.PlotlyGeoAssets||{},_=[];function w(I){return new Promise(function(L,z){h.json(I,function(F,N){if(F){delete M[I];var B=F.status===404?'GeoJSON at URL "'+I+'" does not exist.':"Unexpected error while fetching from "+I;return z(new Error(B))}return M[I]=N,L(N)})})}function m(I){return new Promise(function(L,z){var F=0,N=setInterval(function(){if(M[I]&&M[I]!=="pending")return clearInterval(N),L(M[I]);if(F>100)return clearInterval(N),z("Unexpected error while fetching from "+I);F++},50)})}for(var u=0;u")}}}),MI=Ge({"src/traces/scattergeo/event_data.js"(K,G){G.exports=function(b,S,E,e,t){b.lon=S.lon,b.lat=S.lat,b.location=S.loc?S.loc:null;var r=e[t];return r.fIn&&r.fIn.properties&&(b.properties=r.fIn.properties),b}}}),EI=Ge({"src/traces/scattergeo/select.js"(K,G){var h=uu(),b=Ii().BADNUM;G.exports=function(E,e){var t=E.cd,r=E.xaxis,o=E.yaxis,n=[],i=t[0].trace,a,s,f,c,p,v=!h.hasMarkers(i)&&!h.hasText(i);if(v)return[];if(e===!1)for(p=0;p$?1:ne>=$?0:NaN}function S(ne){return ne.length===1&&(ne=E(ne)),{left:function($,ue,te,H){for(te==null&&(te=0),H==null&&(H=$.length);te>>1;ne($[ae],ue)<0?te=ae+1:H=ae}return te},right:function($,ue,te,H){for(te==null&&(te=0),H==null&&(H=$.length);te>>1;ne($[ae],ue)>0?H=ae:te=ae+1}return te}}}function E(ne){return function($,ue){return b(ne($),ue)}}var e=S(b),t=e.right,r=e.left;function o(ne,$){$==null&&($=n);for(var ue=0,te=ne.length-1,H=ne[0],ae=new Array(te<0?0:te);uene?1:$>=ne?0:NaN}function s(ne){return ne===null?NaN:+ne}function f(ne,$){var ue=ne.length,te=0,H=-1,ae=0,ie,de,Se=0;if($==null)for(;++H1)return Se/(te-1)}function c(ne,$){var ue=f(ne,$);return ue&&Math.sqrt(ue)}function p(ne,$){var ue=ne.length,te=-1,H,ae,ie;if($==null){for(;++te=H)for(ae=ie=H;++teH&&(ae=H),ie=H)for(ae=ie=H;++teH&&(ae=H),ie0)return[ne];if((te=$0)for(ne=Math.ceil(ne/de),$=Math.floor($/de),ie=new Array(ae=Math.ceil($-ne+1));++H=0?(ae>=M?10:ae>=_?5:ae>=w?2:1)*Math.pow(10,H):-Math.pow(10,-H)/(ae>=M?10:ae>=_?5:ae>=w?2:1)}function d(ne,$,ue){var te=Math.abs($-ne)/Math.max(0,ue),H=Math.pow(10,Math.floor(Math.log(te)/Math.LN10)),ae=te/H;return ae>=M?H*=10:ae>=_?H*=5:ae>=w&&(H*=2),$ze;)Ye.pop(),--st;var ct=new Array(st+1),at;for(ae=0;ae<=st;++ae)at=ct[ae]=[],at.x0=ae>0?Ye[ae-1]:Fe,at.x1=ae=1)return+ue(ne[te-1],te-1,ne);var te,H=(te-1)*$,ae=Math.floor(H),ie=+ue(ne[ae],ae,ne),de=+ue(ne[ae+1],ae+1,ne);return ie+(de-ie)*(H-ae)}}function z(ne,$,ue){return ne=l.call(ne,s).sort(b),Math.ceil((ue-$)/(2*(L(ne,.75)-L(ne,.25))*Math.pow(ne.length,-1/3)))}function F(ne,$,ue){return Math.ceil((ue-$)/(3.5*c(ne)*Math.pow(ne.length,-1/3)))}function N(ne,$){var ue=ne.length,te=-1,H,ae;if($==null){for(;++te=H)for(ae=H;++teae&&(ae=H)}else for(;++te=H)for(ae=H;++teae&&(ae=H);return ae}function B(ne,$){var ue=ne.length,te=ue,H=-1,ae,ie=0;if($==null)for(;++H=0;)for(ie=ne[$],ue=ie.length;--ue>=0;)ae[--H]=ie[ue];return ae}function j(ne,$){var ue=ne.length,te=-1,H,ae;if($==null){for(;++te=H)for(ae=H;++teH&&(ae=H)}else for(;++te=H)for(ae=H;++teH&&(ae=H);return ae}function Z(ne,$){for(var ue=$.length,te=new Array(ue);ue--;)te[ue]=ne[$[ue]];return te}function re(ne,$){if(ue=ne.length){var ue,te=0,H=0,ae,ie=ne[H];for($==null&&($=b);++te0?1:cr<0?-1:0},m=Math.sqrt,u=Math.tan;function d(cr){return cr>1?0:cr<-1?n:Math.acos(cr)}function y(cr){return cr>1?i:cr<-1?-i:Math.asin(cr)}function I(cr){return(cr=_(cr/2))*cr}function L(){}function z(cr,Rr){cr&&N.hasOwnProperty(cr.type)&&N[cr.type](cr,Rr)}var F={Feature:function(cr,Rr){z(cr.geometry,Rr)},FeatureCollection:function(cr,Rr){for(var pn=cr.features,an=-1,On=pn.length;++an=0?1:-1,On=an*pn,Aa=l(Rr),xa=_(Rr),ti=V*xa,li=ce*Aa+ti*l(On),Ni=ti*an*_(On);j.add(T(Ni,li)),le=cr,ce=Aa,V=xa}function H(cr){return Z.reset(),U(cr,ee),Z*2}function ae(cr){return[T(cr[1],cr[0]),y(cr[2])]}function ie(cr){var Rr=cr[0],pn=cr[1],an=l(pn);return[an*l(Rr),an*_(Rr),_(pn)]}function de(cr,Rr){return cr[0]*Rr[0]+cr[1]*Rr[1]+cr[2]*Rr[2]}function Se(cr,Rr){return[cr[1]*Rr[2]-cr[2]*Rr[1],cr[2]*Rr[0]-cr[0]*Rr[2],cr[0]*Rr[1]-cr[1]*Rr[0]]}function Le(cr,Rr){cr[0]+=Rr[0],cr[1]+=Rr[1],cr[2]+=Rr[2]}function Fe(cr,Rr){return[cr[0]*Rr,cr[1]*Rr,cr[2]*Rr]}function ze(cr){var Rr=m(cr[0]*cr[0]+cr[1]*cr[1]+cr[2]*cr[2]);cr[0]/=Rr,cr[1]/=Rr,cr[2]/=Rr}var Ye,st,ct,at,et,Pe,Ae,pe,Ne=S(),ut,dt,nt={point:Ft,lineStart:Qt,lineEnd:ar,polygonStart:function(){nt.point=kr,nt.lineStart=Er,nt.lineEnd=$r,Ne.reset(),ee.polygonStart()},polygonEnd:function(){ee.polygonEnd(),nt.point=Ft,nt.lineStart=Qt,nt.lineEnd=ar,j<0?(Ye=-(ct=180),st=-(at=90)):Ne>r?at=90:Ne<-r&&(st=-90),dt[0]=Ye,dt[1]=ct},sphere:function(){Ye=-(ct=180),st=-(at=90)}};function Ft(cr,Rr){ut.push(dt=[Ye=cr,ct=cr]),Rrat&&(at=Rr)}function Nt(cr,Rr){var pn=ie([cr*c,Rr*c]);if(pe){var an=Se(pe,pn),On=[an[1],-an[0],0],Aa=Se(On,an);ze(Aa),Aa=ae(Aa);var xa=cr-et,ti=xa>0?1:-1,li=Aa[0]*f*ti,Ni,Ha=p(xa)>180;Ha^(ti*etat&&(at=Ni)):(li=(li+360)%360-180,Ha^(ti*etat&&(at=Rr))),Ha?crSr(Ye,ct)&&(ct=cr):Sr(cr,ct)>Sr(Ye,ct)&&(Ye=cr):ct>=Ye?(crct&&(ct=cr)):cr>et?Sr(Ye,cr)>Sr(Ye,ct)&&(ct=cr):Sr(cr,ct)>Sr(Ye,ct)&&(Ye=cr)}else ut.push(dt=[Ye=cr,ct=cr]);Rrat&&(at=Rr),pe=pn,et=cr}function Qt(){nt.point=Nt}function ar(){dt[0]=Ye,dt[1]=ct,nt.point=Ft,pe=null}function kr(cr,Rr){if(pe){var pn=cr-et;Ne.add(p(pn)>180?pn+(pn>0?360:-360):pn)}else Pe=cr,Ae=Rr;ee.point(cr,Rr),Nt(cr,Rr)}function Er(){ee.lineStart()}function $r(){kr(Pe,Ae),ee.lineEnd(),p(Ne)>r&&(Ye=-(ct=180)),dt[0]=Ye,dt[1]=ct,pe=null}function Sr(cr,Rr){return(Rr-=cr)<0?Rr+360:Rr}function Ur(cr,Rr){return cr[0]-Rr[0]}function Mt(cr,Rr){return cr[0]<=cr[1]?cr[0]<=Rr&&Rr<=cr[1]:RrSr(an[0],an[1])&&(an[1]=On[1]),Sr(On[0],an[1])>Sr(an[0],an[1])&&(an[0]=On[0])):Aa.push(an=On);for(xa=-1/0,pn=Aa.length-1,Rr=0,an=Aa[pn];Rr<=pn;an=On,++Rr)On=Aa[Rr],(ti=Sr(an[1],On[0]))>xa&&(xa=ti,Ye=On[0],ct=an[1])}return ut=dt=null,Ye===1/0||st===1/0?[[NaN,NaN],[NaN,NaN]]:[[Ye,st],[ct,at]]}var Je,ke,xe,ye,Ee,Xe,Qe,Lt,Ct,Ot,Kt,xr,mr,vr,Nr,kn,$n={sphere:L,point:Vn,lineStart:na,lineEnd:Va,polygonStart:function(){$n.lineStart=sr,$n.lineEnd=Vt},polygonEnd:function(){$n.lineStart=na,$n.lineEnd=Va}};function Vn(cr,Rr){cr*=c,Rr*=c;var pn=l(Rr);ra(pn*l(cr),pn*_(cr),_(Rr))}function ra(cr,Rr,pn){++Je,xe+=(cr-xe)/Je,ye+=(Rr-ye)/Je,Ee+=(pn-Ee)/Je}function na(){$n.point=Un}function Un(cr,Rr){cr*=c,Rr*=c;var pn=l(Rr);vr=pn*l(cr),Nr=pn*_(cr),kn=_(Rr),$n.point=ka,ra(vr,Nr,kn)}function ka(cr,Rr){cr*=c,Rr*=c;var pn=l(Rr),an=pn*l(cr),On=pn*_(cr),Aa=_(Rr),xa=T(m((xa=Nr*Aa-kn*On)*xa+(xa=kn*an-vr*Aa)*xa+(xa=vr*On-Nr*an)*xa),vr*an+Nr*On+kn*Aa);ke+=xa,Xe+=xa*(vr+(vr=an)),Qe+=xa*(Nr+(Nr=On)),Lt+=xa*(kn+(kn=Aa)),ra(vr,Nr,kn)}function Va(){$n.point=Vn}function sr(){$n.point=or}function Vt(){ur(xr,mr),$n.point=Vn}function or(cr,Rr){xr=cr,mr=Rr,cr*=c,Rr*=c,$n.point=ur;var pn=l(Rr);vr=pn*l(cr),Nr=pn*_(cr),kn=_(Rr),ra(vr,Nr,kn)}function ur(cr,Rr){cr*=c,Rr*=c;var pn=l(Rr),an=pn*l(cr),On=pn*_(cr),Aa=_(Rr),xa=Nr*Aa-kn*On,ti=kn*an-vr*Aa,li=vr*On-Nr*an,Ni=m(xa*xa+ti*ti+li*li),Ha=y(Ni),bi=Ni&&-Ha/Ni;Ct+=bi*xa,Ot+=bi*ti,Kt+=bi*li,ke+=Ha,Xe+=Ha*(vr+(vr=an)),Qe+=Ha*(Nr+(Nr=On)),Lt+=Ha*(kn+(kn=Aa)),ra(vr,Nr,kn)}function Gr(cr){Je=ke=xe=ye=Ee=Xe=Qe=Lt=Ct=Ot=Kt=0,U(cr,$n);var Rr=Ct,pn=Ot,an=Kt,On=Rr*Rr+pn*pn+an*an;return Onn?cr+Math.round(-cr/s)*s:cr,Rr]}An.invert=An;function Qn(cr,Rr,pn){return(cr%=s)?Rr||pn?gn(ha(cr),_a(Rr,pn)):ha(cr):Rr||pn?_a(Rr,pn):An}function pa(cr){return function(Rr,pn){return Rr+=cr,[Rr>n?Rr-s:Rr<-n?Rr+s:Rr,pn]}}function ha(cr){var Rr=pa(cr);return Rr.invert=pa(-cr),Rr}function _a(cr,Rr){var pn=l(cr),an=_(cr),On=l(Rr),Aa=_(Rr);function xa(ti,li){var Ni=l(li),Ha=l(ti)*Ni,bi=_(ti)*Ni,Qa=_(li),Na=Qa*pn+Ha*an;return[T(bi*On-Na*Aa,Ha*pn-Qa*an),y(Na*On+bi*Aa)]}return xa.invert=function(ti,li){var Ni=l(li),Ha=l(ti)*Ni,bi=_(ti)*Ni,Qa=_(li),Na=Qa*On-bi*Aa;return[T(bi*On+Qa*Aa,Ha*pn+Na*an),y(Na*pn-Ha*an)]},xa}function Ca(cr){cr=Qn(cr[0]*c,cr[1]*c,cr.length>2?cr[2]*c:0);function Rr(pn){return pn=cr(pn[0]*c,pn[1]*c),pn[0]*=f,pn[1]*=f,pn}return Rr.invert=function(pn){return pn=cr.invert(pn[0]*c,pn[1]*c),pn[0]*=f,pn[1]*=f,pn},Rr}function Hn(cr,Rr,pn,an,On,Aa){if(pn){var xa=l(Rr),ti=_(Rr),li=an*pn;On==null?(On=Rr+an*s,Aa=Rr-li/2):(On=pi(xa,On),Aa=pi(xa,Aa),(an>0?OnAa)&&(On+=an*s));for(var Ni,Ha=On;an>0?Ha>Aa:Ha1&&cr.push(cr.pop().concat(cr.shift()))},result:function(){var pn=cr;return cr=[],Rr=null,pn}}}function xt(cr,Rr){return p(cr[0]-Rr[0])=0;--ti)On.point((bi=Ha[ti])[0],bi[1]);else an(Qa.x,Qa.p.x,-1,On);Qa=Qa.p}Qa=Qa.o,Ha=Qa.z,Na=!Na}while(!Qa.v);On.lineEnd()}}}function Vr(cr){if(Rr=cr.length){for(var Rr,pn=0,an=cr[0],On;++pn=0?1:-1,Ml=Zl*Al,Wl=Ml>n,rl=No*ns;if(Dr.add(T(rl*Zl*_(Ml),Do*Bs+rl*l(Ml))),xa+=Wl?Al+Zl*s:Al,Wl^Na>=pn^Wi>=pn){var Cu=Se(ie(Qa),ie(jo));ze(Cu);var Mu=Se(Aa,Cu);ze(Mu);var Hl=(Wl^Al>=0?-1:1)*y(Mu[2]);(an>Hl||an===Hl&&(Cu[0]||Cu[1]))&&(ti+=Wl^Al>=0?1:-1)}}return(xa<-r||xa0){for(li||(On.polygonStart(),li=!0),On.lineStart(),Bs=0;Bs1&&Li&2&&ns.push(ns.pop().concat(ns.shift())),Ha.push(ns.filter(At))}}return Qa}}function At(cr){return cr.length>1}function lr(cr,Rr){return((cr=cr.x)[0]<0?cr[1]-i-r:i-cr[1])-((Rr=Rr.x)[0]<0?Rr[1]-i-r:i-Rr[1])}var zr=Jr(function(){return!0},cn,qn,[-n,-i]);function cn(cr){var Rr=NaN,pn=NaN,an=NaN,On;return{lineStart:function(){cr.lineStart(),On=1},point:function(Aa,xa){var ti=Aa>0?n:-n,li=p(Aa-Rr);p(li-n)0?i:-i),cr.point(an,pn),cr.lineEnd(),cr.lineStart(),cr.point(ti,pn),cr.point(Aa,pn),On=0):an!==ti&&li>=n&&(p(Rr-an)r?v((_(Rr)*(Aa=l(an))*_(pn)-_(an)*(On=l(Rr))*_(cr))/(On*Aa*xa)):(Rr+an)/2}function qn(cr,Rr,pn,an){var On;if(cr==null)On=pn*i,an.point(-n,On),an.point(0,On),an.point(n,On),an.point(n,0),an.point(n,-On),an.point(0,-On),an.point(-n,-On),an.point(-n,0),an.point(-n,On);else if(p(cr[0]-Rr[0])>r){var Aa=cr[0]0,On=p(Rr)>r;function Aa(Ha,bi,Qa,Na){Hn(Na,cr,pn,Qa,Ha,bi)}function xa(Ha,bi){return l(Ha)*l(bi)>Rr}function ti(Ha){var bi,Qa,Na,Yi,No;return{lineStart:function(){Yi=Na=!1,No=1},point:function(Do,Go){var jo=[Do,Go],Wi,Li=xa(Do,Go),ns=an?Li?0:Ni(Do,Go):Li?Ni(Do+(Do<0?n:-n),Go):0;if(!bi&&(Yi=Na=Li)&&Ha.lineStart(),Li!==Na&&(Wi=li(bi,jo),(!Wi||xt(bi,Wi)||xt(jo,Wi))&&(jo[2]=1)),Li!==Na)No=0,Li?(Ha.lineStart(),Wi=li(jo,bi),Ha.point(Wi[0],Wi[1])):(Wi=li(bi,jo),Ha.point(Wi[0],Wi[1],2),Ha.lineEnd()),bi=Wi;else if(On&&bi&&an^Li){var Bs;!(ns&Qa)&&(Bs=li(jo,bi,!0))&&(No=0,an?(Ha.lineStart(),Ha.point(Bs[0][0],Bs[0][1]),Ha.point(Bs[1][0],Bs[1][1]),Ha.lineEnd()):(Ha.point(Bs[1][0],Bs[1][1]),Ha.lineEnd(),Ha.lineStart(),Ha.point(Bs[0][0],Bs[0][1],3)))}Li&&(!bi||!xt(bi,jo))&&Ha.point(jo[0],jo[1]),bi=jo,Na=Li,Qa=ns},lineEnd:function(){Na&&Ha.lineEnd(),bi=null},clean:function(){return No|(Yi&&Na)<<1}}}function li(Ha,bi,Qa){var Na=ie(Ha),Yi=ie(bi),No=[1,0,0],Do=Se(Na,Yi),Go=de(Do,Do),jo=Do[0],Wi=Go-jo*jo;if(!Wi)return!Qa&&Ha;var Li=Rr*Go/Wi,ns=-Rr*jo/Wi,Bs=Se(No,Do),Al=Fe(No,Li),Zl=Fe(Do,ns);Le(Al,Zl);var Ml=Bs,Wl=de(Al,Ml),rl=de(Ml,Ml),Cu=Wl*Wl-rl*(de(Al,Al)-1);if(!(Cu<0)){var Mu=m(Cu),Hl=Fe(Ml,(-Wl-Mu)/rl);if(Le(Hl,Al),Hl=ae(Hl),!Qa)return Hl;var yo=Ha[0],ys=bi[0],zl=Ha[1],ml=bi[1],yc;ys0^Hl[1]<(p(Hl[0]-yo)n^(yo<=Hl[0]&&Hl[0]<=ys)){var xc=Fe(Ml,(-Wl+Mu)/rl);return Le(xc,Al),[Hl,ae(xc)]}}}function Ni(Ha,bi){var Qa=an?cr:n-cr,Na=0;return Ha<-Qa?Na|=1:Ha>Qa&&(Na|=2),bi<-Qa?Na|=4:bi>Qa&&(Na|=8),Na}return Jr(xa,ti,Aa,an?[0,-cr]:[-n,cr-n])}function fn(cr,Rr,pn,an,On,Aa){var xa=cr[0],ti=cr[1],li=Rr[0],Ni=Rr[1],Ha=0,bi=1,Qa=li-xa,Na=Ni-ti,Yi;if(Yi=pn-xa,!(!Qa&&Yi>0)){if(Yi/=Qa,Qa<0){if(Yi0){if(Yi>bi)return;Yi>Ha&&(Ha=Yi)}if(Yi=On-xa,!(!Qa&&Yi<0)){if(Yi/=Qa,Qa<0){if(Yi>bi)return;Yi>Ha&&(Ha=Yi)}else if(Qa>0){if(Yi0)){if(Yi/=Na,Na<0){if(Yi0){if(Yi>bi)return;Yi>Ha&&(Ha=Yi)}if(Yi=Aa-ti,!(!Na&&Yi<0)){if(Yi/=Na,Na<0){if(Yi>bi)return;Yi>Ha&&(Ha=Yi)}else if(Na>0){if(Yi0&&(cr[0]=xa+Ha*Qa,cr[1]=ti+Ha*Na),bi<1&&(Rr[0]=xa+bi*Qa,Rr[1]=ti+bi*Na),!0}}}}}var In=1e9,gi=-In;function Ea(cr,Rr,pn,an){function On(Ni,Ha){return cr<=Ni&&Ni<=pn&&Rr<=Ha&&Ha<=an}function Aa(Ni,Ha,bi,Qa){var Na=0,Yi=0;if(Ni==null||(Na=xa(Ni,bi))!==(Yi=xa(Ha,bi))||li(Ni,Ha)<0^bi>0)do Qa.point(Na===0||Na===3?cr:pn,Na>1?an:Rr);while((Na=(Na+bi+4)%4)!==Yi);else Qa.point(Ha[0],Ha[1])}function xa(Ni,Ha){return p(Ni[0]-cr)0?0:3:p(Ni[0]-pn)0?2:1:p(Ni[1]-Rr)0?1:0:Ha>0?3:2}function ti(Ni,Ha){return li(Ni.x,Ha.x)}function li(Ni,Ha){var bi=xa(Ni,1),Qa=xa(Ha,1);return bi!==Qa?bi-Qa:bi===0?Ha[1]-Ni[1]:bi===1?Ni[0]-Ha[0]:bi===2?Ni[1]-Ha[1]:Ha[0]-Ni[0]}return function(Ni){var Ha=Ni,bi=Dt(),Qa,Na,Yi,No,Do,Go,jo,Wi,Li,ns,Bs,Al={point:Zl,lineStart:Cu,lineEnd:Mu,polygonStart:Wl,polygonEnd:rl};function Zl(yo,ys){On(yo,ys)&&Ha.point(yo,ys)}function Ml(){for(var yo=0,ys=0,zl=Na.length;ysan&&(Lf-$f)*(an-xc)>(Lu-xc)*(cr-$f)&&++yo:Lu<=an&&(Lf-$f)*(an-xc)<(Lu-xc)*(cr-$f)&&--yo;return yo}function Wl(){Ha=bi,Qa=[],Na=[],Bs=!0}function rl(){var yo=Ml(),ys=Bs&&yo,zl=(Qa=b.merge(Qa)).length;(ys||zl)&&(Ni.polygonStart(),ys&&(Ni.lineStart(),Aa(null,null,1,Ni),Ni.lineEnd()),zl&&jr(Qa,ti,yo,Aa,Ni),Ni.polygonEnd()),Ha=Ni,Qa=Na=Yi=null}function Cu(){Al.point=Hl,Na&&Na.push(Yi=[]),ns=!0,Li=!1,jo=Wi=NaN}function Mu(){Qa&&(Hl(No,Do),Go&&Li&&bi.rejoin(),Qa.push(bi.result())),Al.point=Zl,Li&&Ha.lineEnd()}function Hl(yo,ys){var zl=On(yo,ys);if(Na&&Yi.push([yo,ys]),ns)No=yo,Do=ys,Go=zl,ns=!1,zl&&(Ha.lineStart(),Ha.point(yo,ys));else if(zl&&Li)Ha.point(yo,ys);else{var ml=[jo=Math.max(gi,Math.min(In,jo)),Wi=Math.max(gi,Math.min(In,Wi))],yc=[yo=Math.max(gi,Math.min(In,yo)),ys=Math.max(gi,Math.min(In,ys))];fn(ml,yc,cr,Rr,pn,an)?(Li||(Ha.lineStart(),Ha.point(ml[0],ml[1])),Ha.point(yc[0],yc[1]),zl||Ha.lineEnd(),Bs=!1):zl&&(Ha.lineStart(),Ha.point(yo,ys),Bs=!1)}jo=yo,Wi=ys,Li=zl}return Al}}function Ci(){var cr=0,Rr=0,pn=960,an=500,On,Aa,xa;return xa={stream:function(ti){return On&&Aa===ti?On:On=Ea(cr,Rr,pn,an)(Aa=ti)},extent:function(ti){return arguments.length?(cr=+ti[0][0],Rr=+ti[0][1],pn=+ti[1][0],an=+ti[1][1],On=Aa=null,xa):[[cr,Rr],[pn,an]]}}}var Xi=S(),so,io,Mo,ui={sphere:L,point:L,lineStart:ts,lineEnd:L,polygonStart:L,polygonEnd:L};function ts(){ui.point=Xs,ui.lineEnd=Ho}function Ho(){ui.point=ui.lineEnd=L}function Xs(cr,Rr){cr*=c,Rr*=c,so=cr,io=_(Rr),Mo=l(Rr),ui.point=cs}function cs(cr,Rr){cr*=c,Rr*=c;var pn=_(Rr),an=l(Rr),On=p(cr-so),Aa=l(On),xa=_(On),ti=an*xa,li=Mo*pn-io*an*Aa,Ni=io*pn+Mo*an*Aa;Xi.add(T(m(ti*ti+li*li),Ni)),so=cr,io=pn,Mo=an}function Jo(cr){return Xi.reset(),U(cr,ui),+Xi}var Uo=[null,null],Ys={type:"LineString",coordinates:Uo};function Vs(cr,Rr){return Uo[0]=cr,Uo[1]=Rr,Jo(Ys)}var ll={Feature:function(cr,Rr){return Zo(cr.geometry,Rr)},FeatureCollection:function(cr,Rr){for(var pn=cr.features,an=-1,On=pn.length;++an0&&(On=Vs(cr[Aa],cr[Aa-1]),On>0&&pn<=On&&an<=On&&(pn+an-On)*(1-Math.pow((pn-an)/On,2))r}).map(Qa)).concat(b.range(g(Aa/Ni)*Ni,On,Ni).filter(function(Wi){return p(Wi%bi)>r}).map(Na))}return Go.lines=function(){return jo().map(function(Wi){return{type:"LineString",coordinates:Wi}})},Go.outline=function(){return{type:"Polygon",coordinates:[Yi(an).concat(No(xa).slice(1),Yi(pn).reverse().slice(1),No(ti).reverse().slice(1))]}},Go.extent=function(Wi){return arguments.length?Go.extentMajor(Wi).extentMinor(Wi):Go.extentMinor()},Go.extentMajor=function(Wi){return arguments.length?(an=+Wi[0][0],pn=+Wi[1][0],ti=+Wi[0][1],xa=+Wi[1][1],an>pn&&(Wi=an,an=pn,pn=Wi),ti>xa&&(Wi=ti,ti=xa,xa=Wi),Go.precision(Do)):[[an,ti],[pn,xa]]},Go.extentMinor=function(Wi){return arguments.length?(Rr=+Wi[0][0],cr=+Wi[1][0],Aa=+Wi[0][1],On=+Wi[1][1],Rr>cr&&(Wi=Rr,Rr=cr,cr=Wi),Aa>On&&(Wi=Aa,Aa=On,On=Wi),Go.precision(Do)):[[Rr,Aa],[cr,On]]},Go.step=function(Wi){return arguments.length?Go.stepMajor(Wi).stepMinor(Wi):Go.stepMinor()},Go.stepMajor=function(Wi){return arguments.length?(Ha=+Wi[0],bi=+Wi[1],Go):[Ha,bi]},Go.stepMinor=function(Wi){return arguments.length?(li=+Wi[0],Ni=+Wi[1],Go):[li,Ni]},Go.precision=function(Wi){return arguments.length?(Do=+Wi,Qa=fi(Aa,On,90),Na=to(Rr,cr,Do),Yi=fi(ti,xa,90),No=to(an,pn,Do),Go):Do},Go.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Ps(){return Cl()()}function Fo(cr,Rr){var pn=cr[0]*c,an=cr[1]*c,On=Rr[0]*c,Aa=Rr[1]*c,xa=l(an),ti=_(an),li=l(Aa),Ni=_(Aa),Ha=xa*l(pn),bi=xa*_(pn),Qa=li*l(On),Na=li*_(On),Yi=2*y(m(I(Aa-an)+xa*li*I(On-pn))),No=_(Yi),Do=Yi?function(Go){var jo=_(Go*=Yi)/No,Wi=_(Yi-Go)/No,Li=Wi*Ha+jo*Qa,ns=Wi*bi+jo*Na,Bs=Wi*ti+jo*Ni;return[T(ns,Li)*f,T(Bs,m(Li*Li+ns*ns))*f]}:function(){return[pn*f,an*f]};return Do.distance=Yi,Do}function Il(cr){return cr}var Zs=S(),cl=S(),Au,Qi,gs,rs,Xl={point:L,lineStart:L,lineEnd:L,polygonStart:function(){Xl.lineStart=Yl,Xl.lineEnd=vu},polygonEnd:function(){Xl.lineStart=Xl.lineEnd=Xl.point=L,Zs.add(p(cl)),cl.reset()},result:function(){var cr=Zs/2;return Zs.reset(),cr}};function Yl(){Xl.point=Io}function Io(cr,Rr){Xl.point=cu,Au=gs=cr,Qi=rs=Rr}function cu(cr,Rr){cl.add(rs*cr-gs*Rr),gs=cr,rs=Rr}function vu(){cu(Au,Qi)}var Os=1/0,wl=Os,Nl=-Os,Vl=Nl,Zu={point:df,lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var cr=[[Os,wl],[Nl,Vl]];return Nl=Vl=-(wl=Os=1/0),cr}};function df(cr,Rr){crNl&&(Nl=cr),RrVl&&(Vl=Rr)}var Xc=0,rf=0,Dh=0,wh=0,Tl=0,Dc=0,zh=0,oc=0,Wu=0,sc,nf,eu,$u,Hs={point:Dl,lineStart:Mf,lineEnd:fu,polygonStart:function(){Hs.lineStart=Sd,Hs.lineEnd=Fs},polygonEnd:function(){Hs.point=Dl,Hs.lineStart=Mf,Hs.lineEnd=fu},result:function(){var cr=Wu?[zh/Wu,oc/Wu]:Dc?[wh/Dc,Tl/Dc]:Dh?[Xc/Dh,rf/Dh]:[NaN,NaN];return Xc=rf=Dh=wh=Tl=Dc=zh=oc=Wu=0,cr}};function Dl(cr,Rr){Xc+=cr,rf+=Rr,++Dh}function Mf(){Hs.point=wc}function wc(cr,Rr){Hs.point=Ff,Dl(eu=cr,$u=Rr)}function Ff(cr,Rr){var pn=cr-eu,an=Rr-$u,On=m(pn*pn+an*an);wh+=On*(eu+cr)/2,Tl+=On*($u+Rr)/2,Dc+=On,Dl(eu=cr,$u=Rr)}function fu(){Hs.point=Dl}function Sd(){Hs.point=Vd}function Fs(){pl(sc,nf)}function Vd(cr,Rr){Hs.point=pl,Dl(sc=eu=cr,nf=$u=Rr)}function pl(cr,Rr){var pn=cr-eu,an=Rr-$u,On=m(pn*pn+an*an);wh+=On*(eu+cr)/2,Tl+=On*($u+Rr)/2,Dc+=On,On=$u*cr-eu*Rr,zh+=On*(eu+cr),oc+=On*($u+Rr),Wu+=On*3,Dl(eu=cr,$u=Rr)}function Oo(cr){this._context=cr}Oo.prototype={_radius:4.5,pointRadius:function(cr){return this._radius=cr,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(cr,Rr){switch(this._point){case 0:{this._context.moveTo(cr,Rr),this._point=1;break}case 1:{this._context.lineTo(cr,Rr);break}default:{this._context.moveTo(cr+this._radius,Rr),this._context.arc(cr,Rr,this._radius,0,s);break}}},result:L};var th=S(),af,Ou,Oh,Bf,uh,Ku={point:L,lineStart:function(){Ku.point=fd},lineEnd:function(){af&&Hh(Ou,Oh),Ku.point=L},polygonStart:function(){af=!0},polygonEnd:function(){af=null},result:function(){var cr=+th;return th.reset(),cr}};function fd(cr,Rr){Ku.point=Hh,Ou=Bf=cr,Oh=uh=Rr}function Hh(cr,Rr){Bf-=cr,uh-=Rr,th.add(m(Bf*Bf+uh*uh)),Bf=cr,uh=Rr}function ch(){this._string=[]}ch.prototype={_radius:4.5,_circle:Nf(4.5),pointRadius:function(cr){return(cr=+cr)!==this._radius&&(this._radius=cr,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(cr,Rr){switch(this._point){case 0:{this._string.push("M",cr,",",Rr),this._point=1;break}case 1:{this._string.push("L",cr,",",Rr);break}default:{this._circle==null&&(this._circle=Nf(this._radius)),this._string.push("M",cr,",",Rr,this._circle);break}}},result:function(){if(this._string.length){var cr=this._string.join("");return this._string=[],cr}else return null}};function Nf(cr){return"m0,"+cr+"a"+cr+","+cr+" 0 1,1 0,"+-2*cr+"a"+cr+","+cr+" 0 1,1 0,"+2*cr+"z"}function Fh(cr,Rr){var pn=4.5,an,On;function Aa(xa){return xa&&(typeof pn=="function"&&On.pointRadius(+pn.apply(this,arguments)),U(xa,an(On))),On.result()}return Aa.area=function(xa){return U(xa,an(Xl)),Xl.result()},Aa.measure=function(xa){return U(xa,an(Ku)),Ku.result()},Aa.bounds=function(xa){return U(xa,an(Zu)),Zu.result()},Aa.centroid=function(xa){return U(xa,an(Hs)),Hs.result()},Aa.projection=function(xa){return arguments.length?(an=xa==null?(cr=null,Il):(cr=xa).stream,Aa):cr},Aa.context=function(xa){return arguments.length?(On=xa==null?(Rr=null,new ch):new Oo(Rr=xa),typeof pn!="function"&&On.pointRadius(pn),Aa):Rr},Aa.pointRadius=function(xa){return arguments.length?(pn=typeof xa=="function"?xa:(On.pointRadius(+xa),+xa),Aa):pn},Aa.projection(cr).context(Rr)}function Bh(cr){return{stream:of(cr)}}function of(cr){return function(Rr){var pn=new Gh;for(var an in cr)pn[an]=cr[an];return pn.stream=Rr,pn}}function Gh(){}Gh.prototype={constructor:Gh,point:function(cr,Rr){this.stream.point(cr,Rr)},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 Ef(cr,Rr,pn){var an=cr.clipExtent&&cr.clipExtent();return cr.scale(150).translate([0,0]),an!=null&&cr.clipExtent(null),U(pn,cr.stream(Zu)),Rr(Zu.result()),an!=null&&cr.clipExtent(an),cr}function vf(cr,Rr,pn){return Ef(cr,function(an){var On=Rr[1][0]-Rr[0][0],Aa=Rr[1][1]-Rr[0][1],xa=Math.min(On/(an[1][0]-an[0][0]),Aa/(an[1][1]-an[0][1])),ti=+Rr[0][0]+(On-xa*(an[1][0]+an[0][0]))/2,li=+Rr[0][1]+(Aa-xa*(an[1][1]+an[0][1]))/2;cr.scale(150*xa).translate([ti,li])},pn)}function Ju(cr,Rr,pn){return vf(cr,[[0,0],Rr],pn)}function Wf(cr,Rr,pn){return Ef(cr,function(an){var On=+Rr,Aa=On/(an[1][0]-an[0][0]),xa=(On-Aa*(an[1][0]+an[0][0]))/2,ti=-Aa*an[0][1];cr.scale(150*Aa).translate([xa,ti])},pn)}function Nh(cr,Rr,pn){return Ef(cr,function(an){var On=+Rr,Aa=On/(an[1][1]-an[0][1]),xa=-Aa*an[0][0],ti=(On-Aa*(an[1][1]+an[0][1]))/2;cr.scale(150*Aa).translate([xa,ti])},pn)}var Ul=16,Th=l(30*c);function Md(cr,Rr){return+Rr?fh(cr,Rr):Xh(cr)}function Xh(cr){return of({point:function(Rr,pn){Rr=cr(Rr,pn),this.stream.point(Rr[0],Rr[1])}})}function fh(cr,Rr){function pn(an,On,Aa,xa,ti,li,Ni,Ha,bi,Qa,Na,Yi,No,Do){var Go=Ni-an,jo=Ha-On,Wi=Go*Go+jo*jo;if(Wi>4*Rr&&No--){var Li=xa+Qa,ns=ti+Na,Bs=li+Yi,Al=m(Li*Li+ns*ns+Bs*Bs),Zl=y(Bs/=Al),Ml=p(p(Bs)-1)Rr||p((Go*Mu+jo*Hl)/Wi-.5)>.3||xa*Qa+ti*Na+li*Yi2?yo[2]%360*c:0,Mu()):[ti*f,li*f,Ni*f]},rl.angle=function(yo){return arguments.length?(bi=yo%360*c,Mu()):bi*f},rl.reflectX=function(yo){return arguments.length?(Qa=yo?-1:1,Mu()):Qa<0},rl.reflectY=function(yo){return arguments.length?(Na=yo?-1:1,Mu()):Na<0},rl.precision=function(yo){return arguments.length?(Bs=Md(Al,ns=yo*yo),Hl()):m(ns)},rl.fitExtent=function(yo,ys){return vf(rl,yo,ys)},rl.fitSize=function(yo,ys){return Ju(rl,yo,ys)},rl.fitWidth=function(yo,ys){return Wf(rl,yo,ys)},rl.fitHeight=function(yo,ys){return Nh(rl,yo,ys)};function Mu(){var yo=wu(pn,0,0,Qa,Na,bi).apply(null,Rr(Aa,xa)),ys=(bi?wu:Zh)(pn,an-yo[0],On-yo[1],Qa,Na,bi);return Ha=Qn(ti,li,Ni),Al=gn(Rr,ys),Zl=gn(Ha,Al),Bs=Md(Al,ns),Hl()}function Hl(){return Ml=Wl=null,rl}return function(){return Rr=cr.apply(this,arguments),rl.invert=Rr.invert&&Cu,Mu()}}function tu(cr){var Rr=0,pn=n/3,an=Uf(cr),On=an(Rr,pn);return On.parallels=function(Aa){return arguments.length?an(Rr=Aa[0]*c,pn=Aa[1]*c):[Rr*f,pn*f]},On}function kf(cr){var Rr=l(cr);function pn(an,On){return[an*Rr,_(On)/Rr]}return pn.invert=function(an,On){return[an/Rr,y(On*Rr)]},pn}function gc(cr,Rr){var pn=_(cr),an=(pn+_(Rr))/2;if(p(an)=.12&&Do<.234&&No>=-.425&&No<-.214?On:Do>=.166&&Do<.234&&No>=-.214&&No<-.115?xa:pn).invert(Qa)},Ha.stream=function(Qa){return cr&&Rr===Qa?cr:cr=rh([pn.stream(Rr=Qa),On.stream(Qa),xa.stream(Qa)])},Ha.precision=function(Qa){return arguments.length?(pn.precision(Qa),On.precision(Qa),xa.precision(Qa),bi()):pn.precision()},Ha.scale=function(Qa){return arguments.length?(pn.scale(Qa),On.scale(Qa*.35),xa.scale(Qa),Ha.translate(pn.translate())):pn.scale()},Ha.translate=function(Qa){if(!arguments.length)return pn.translate();var Na=pn.scale(),Yi=+Qa[0],No=+Qa[1];return an=pn.translate(Qa).clipExtent([[Yi-.455*Na,No-.238*Na],[Yi+.455*Na,No+.238*Na]]).stream(Ni),Aa=On.translate([Yi-.307*Na,No+.201*Na]).clipExtent([[Yi-.425*Na+r,No+.12*Na+r],[Yi-.214*Na-r,No+.234*Na-r]]).stream(Ni),ti=xa.translate([Yi-.205*Na,No+.212*Na]).clipExtent([[Yi-.214*Na+r,No+.166*Na+r],[Yi-.115*Na-r,No+.234*Na-r]]).stream(Ni),bi()},Ha.fitExtent=function(Qa,Na){return vf(Ha,Qa,Na)},Ha.fitSize=function(Qa,Na){return Ju(Ha,Qa,Na)},Ha.fitWidth=function(Qa,Na){return Wf(Ha,Qa,Na)},Ha.fitHeight=function(Qa,Na){return Nh(Ha,Qa,Na)};function bi(){return cr=Rr=null,Ha}return Ha.scale(1070)}function jf(cr){return function(Rr,pn){var an=l(Rr),On=l(pn),Aa=cr(an*On);return[Aa*On*_(Rr),Aa*_(pn)]}}function Ah(cr){return function(Rr,pn){var an=m(Rr*Rr+pn*pn),On=cr(an),Aa=_(On),xa=l(On);return[T(Rr*Aa,an*xa),y(an&&pn*Aa/an)]}}var Ed=jf(function(cr){return m(2/(1+cr))});Ed.invert=Ah(function(cr){return 2*y(cr/2)});function tv(){return Oc(Ed).scale(124.75).clipAngle(180-.001)}var nh=jf(function(cr){return(cr=d(cr))&&cr/_(cr)});nh.invert=Ah(function(cr){return cr});function Sh(){return Oc(nh).scale(79.4188).clipAngle(180-.001)}function Yc(cr,Rr){return[cr,A(u((i+Rr)/2))]}Yc.invert=function(cr,Rr){return[cr,2*v(x(Rr))-i]};function Mh(){return lc(Yc).scale(961/s)}function lc(cr){var Rr=Oc(cr),pn=Rr.center,an=Rr.scale,On=Rr.translate,Aa=Rr.clipExtent,xa=null,ti,li,Ni;Rr.scale=function(bi){return arguments.length?(an(bi),Ha()):an()},Rr.translate=function(bi){return arguments.length?(On(bi),Ha()):On()},Rr.center=function(bi){return arguments.length?(pn(bi),Ha()):pn()},Rr.clipExtent=function(bi){return arguments.length?(bi==null?xa=ti=li=Ni=null:(xa=+bi[0][0],ti=+bi[0][1],li=+bi[1][0],Ni=+bi[1][1]),Ha()):xa==null?null:[[xa,ti],[li,Ni]]};function Ha(){var bi=n*an(),Qa=Rr(Ca(Rr.rotate()).invert([0,0]));return Aa(xa==null?[[Qa[0]-bi,Qa[1]-bi],[Qa[0]+bi,Qa[1]+bi]]:cr===Yc?[[Math.max(Qa[0]-bi,xa),ti],[Math.min(Qa[0]+bi,li),Ni]]:[[xa,Math.max(Qa[1]-bi,ti)],[li,Math.min(Qa[1]+bi,Ni)]])}return Ha()}function ah(cr){return u((i+cr)/2)}function Wh(cr,Rr){var pn=l(cr),an=cr===Rr?_(cr):A(pn/l(Rr))/A(ah(Rr)/ah(cr)),On=pn*M(ah(cr),an)/an;if(!an)return Yc;function Aa(xa,ti){On>0?ti<-i+r&&(ti=-i+r):ti>i-r&&(ti=i-r);var li=On/M(ah(ti),an);return[li*_(an*xa),On-li*l(an*xa)]}return Aa.invert=function(xa,ti){var li=On-ti,Ni=w(an)*m(xa*xa+li*li),Ha=T(xa,p(li))*w(li);return li*an<0&&(Ha-=n*w(xa)*w(li)),[Ha/an,2*v(M(On/Ni,1/an))-i]},Aa}function ih(){return tu(Wh).scale(109.5).parallels([30,30])}function iu(cr,Rr){return[cr,Rr]}iu.invert=iu;function Bc(){return Oc(iu).scale(152.63)}function sf(cr,Rr){var pn=l(cr),an=cr===Rr?_(cr):(pn-l(Rr))/(Rr-cr),On=pn/an+cr;if(p(an)r&&--an>0);return[cr/(.8707+(Aa=pn*pn)*(-.131979+Aa*(-.013791+Aa*Aa*Aa*(.003971-.001529*Aa)))),pn]};function gf(){return Oc(Cf).scale(175.295)}function Su(cr,Rr){return[l(Rr)*_(cr),_(Rr)]}Su.invert=Ah(y);function Tc(){return Oc(Su).scale(249.5).clipAngle(90+r)}function pu(cr,Rr){var pn=l(Rr),an=1+l(cr)*pn;return[pn*_(cr)/an,_(Rr)/an]}pu.invert=Ah(function(cr){return 2*v(cr)});function Vf(){return Oc(pu).scale(250).clipAngle(142)}function yf(cr,Rr){return[A(u((i+Rr)/2)),-cr]}yf.invert=function(cr,Rr){return[-Rr,2*v(x(cr))-i]};function jh(){var cr=lc(yf),Rr=cr.center,pn=cr.rotate;return cr.center=function(an){return arguments.length?Rr([-an[1],an[0]]):(an=Rr(),[an[1],-an[0]])},cr.rotate=function(an){return arguments.length?pn([an[0],an[1],an.length>2?an[2]+90:90]):(an=pn(),[an[0],an[1],an[2]-90])},pn([0,0,90]).scale(159.155)}h.geoAlbers=hu,h.geoAlbersUsa=pf,h.geoArea=H,h.geoAzimuthalEqualArea=tv,h.geoAzimuthalEqualAreaRaw=Ed,h.geoAzimuthalEquidistant=Sh,h.geoAzimuthalEquidistantRaw=nh,h.geoBounds=je,h.geoCentroid=Gr,h.geoCircle=Si,h.geoClipAntimeridian=zr,h.geoClipCircle=jn,h.geoClipExtent=Ci,h.geoClipRectangle=Ea,h.geoConicConformal=ih,h.geoConicConformalRaw=Wh,h.geoConicEqualArea=Fc,h.geoConicEqualAreaRaw=gc,h.geoConicEquidistant=Uh,h.geoConicEquidistantRaw=sf,h.geoContains=Ms,h.geoDistance=Vs,h.geoEqualEarth=kd,h.geoEqualEarthRaw=vh,h.geoEquirectangular=Bc,h.geoEquirectangularRaw=iu,h.geoGnomonic=$h,h.geoGnomonicRaw=hc,h.geoGraticule=Cl,h.geoGraticule10=Ps,h.geoIdentity=Wc,h.geoInterpolate=Fo,h.geoLength=Jo,h.geoMercator=Mh,h.geoMercatorRaw=Yc,h.geoNaturalEarth1=gf,h.geoNaturalEarth1Raw=Cf,h.geoOrthographic=Tc,h.geoOrthographicRaw=Su,h.geoPath=Fh,h.geoProjection=Oc,h.geoProjectionMutator=Uf,h.geoRotation=Ca,h.geoStereographic=Vf,h.geoStereographicRaw=pu,h.geoStream=U,h.geoTransform=Bh,h.geoTransverseMercator=jh,h.geoTransverseMercatorRaw=yf,Object.defineProperty(h,"__esModule",{value:!0})})}}),kI=Ge({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,PC(),rS()):b(h.d3=h.d3||{},h.d3,h.d3)})(K,function(h,b,S){var E=Math.abs,e=Math.atan,t=Math.atan2,r=Math.cos,o=Math.exp,n=Math.floor,i=Math.log,a=Math.max,s=Math.min,f=Math.pow,c=Math.round,p=Math.sign||function(Ze){return Ze>0?1:Ze<0?-1:0},v=Math.sin,T=Math.tan,l=1e-6,g=1e-12,x=Math.PI,A=x/2,M=x/4,_=Math.SQRT1_2,w=F(2),m=F(x),u=x*2,d=180/x,y=x/180;function I(Ze){return Ze?Ze/Math.sin(Ze):1}function L(Ze){return Ze>1?A:Ze<-1?-A:Math.asin(Ze)}function z(Ze){return Ze>1?0:Ze<-1?x:Math.acos(Ze)}function F(Ze){return Ze>0?Math.sqrt(Ze):0}function N(Ze){return Ze=o(2*Ze),(Ze-1)/(Ze+1)}function B(Ze){return(o(Ze)-o(-Ze))/2}function R(Ze){return(o(Ze)+o(-Ze))/2}function U(Ze){return i(Ze+F(Ze*Ze+1))}function j(Ze){return i(Ze+F(Ze*Ze-1))}function Z(Ze){var tt=T(Ze/2),vt=2*i(r(Ze/2))/(tt*tt);function bt(zt,Et){var Ut=r(zt),gr=r(Et),Tr=v(Et),Pr=gr*Ut,Yr=-((1-Pr?i((1+Pr)/2)/(1-Pr):-.5)+vt/(1+Pr));return[Yr*gr*v(zt),Yr*Tr]}return bt.invert=function(zt,Et){var Ut=F(zt*zt+Et*Et),gr=-Ze/2,Tr=50,Pr;if(!Ut)return[0,0];do{var Yr=gr/2,sn=r(Yr),En=v(Yr),Pn=En/sn,Xn=-i(E(sn));gr-=Pr=(2/Pn*Xn-vt*Pn-Ut)/(-Xn/(En*En)+1-vt/(2*sn*sn))*(sn<0?.7:1)}while(E(Pr)>l&&--Tr>0);var Ta=v(gr);return[t(zt*Ta,Ut*r(gr)),L(Et*Ta/Ut)]},bt}function re(){var Ze=A,tt=b.geoProjectionMutator(Z),vt=tt(Ze);return vt.radius=function(bt){return arguments.length?tt(Ze=bt*y):Ze*d},vt.scale(179.976).clipAngle(147)}function fe(Ze,tt){var vt=r(tt),bt=I(z(vt*r(Ze/=2)));return[2*vt*v(Ze)*bt,v(tt)*bt]}fe.invert=function(Ze,tt){if(!(Ze*Ze+4*tt*tt>x*x+l)){var vt=Ze,bt=tt,zt=25;do{var Et=v(vt),Ut=v(vt/2),gr=r(vt/2),Tr=v(bt),Pr=r(bt),Yr=v(2*bt),sn=Tr*Tr,En=Pr*Pr,Pn=Ut*Ut,Xn=1-En*gr*gr,Ta=Xn?z(Pr*gr)*F(ri=1/Xn):ri=0,ri,Wa=2*Ta*Pr*Ut-Ze,ni=Ta*Tr-tt,$i=ri*(En*Pn+Ta*Pr*gr*sn),bo=ri*(.5*Et*Yr-Ta*2*Tr*Ut),vo=ri*.25*(Yr*Ut-Ta*Tr*En*Et),Wo=ri*(sn*gr+Ta*Pn*Pr),Ks=bo*vo-Wo*$i;if(!Ks)break;var Js=(ni*bo-Wa*Wo)/Ks,Es=(Wa*vo-ni*$i)/Ks;vt-=Js,bt-=Es}while((E(Js)>l||E(Es)>l)&&--zt>0);return[vt,bt]}};function le(){return b.geoProjection(fe).scale(152.63)}function ce(Ze){var tt=v(Ze),vt=r(Ze),bt=Ze>=0?1:-1,zt=T(bt*Ze),Et=(1+tt-vt)/2;function Ut(gr,Tr){var Pr=r(Tr),Yr=r(gr/=2);return[(1+Pr)*v(gr),(bt*Tr>-t(Yr,zt)-.001?0:-bt*10)+Et+v(Tr)*vt-(1+Pr)*tt*Yr]}return Ut.invert=function(gr,Tr){var Pr=0,Yr=0,sn=50;do{var En=r(Pr),Pn=v(Pr),Xn=r(Yr),Ta=v(Yr),ri=1+Xn,Wa=ri*Pn-gr,ni=Et+Ta*vt-ri*tt*En-Tr,$i=ri*En/2,bo=-Pn*Ta,vo=tt*ri*Pn/2,Wo=vt*Xn+tt*En*Ta,Ks=bo*vo-Wo*$i,Js=(ni*bo-Wa*Wo)/Ks/2,Es=(Wa*vo-ni*$i)/Ks;E(Es)>2&&(Es/=2),Pr-=Js,Yr-=Es}while((E(Js)>l||E(Es)>l)&&--sn>0);return bt*Yr>-t(r(Pr),zt)-.001?[Pr*2,Yr]:null},Ut}function V(){var Ze=20*y,tt=Ze>=0?1:-1,vt=T(tt*Ze),bt=b.geoProjectionMutator(ce),zt=bt(Ze),Et=zt.stream;return zt.parallel=function(Ut){return arguments.length?(vt=T((tt=(Ze=Ut*y)>=0?1:-1)*Ze),bt(Ze)):Ze*d},zt.stream=function(Ut){var gr=zt.rotate(),Tr=Et(Ut),Pr=(zt.rotate([0,0]),Et(Ut)),Yr=zt.precision();return zt.rotate(gr),Tr.sphere=function(){Pr.polygonStart(),Pr.lineStart();for(var sn=tt*-180;tt*sn<180;sn+=tt*90)Pr.point(sn,tt*90);if(Ze)for(;tt*(sn-=3*tt*Yr)>=-180;)Pr.point(sn,tt*-t(r(sn*y/2),vt)*d);Pr.lineEnd(),Pr.polygonEnd()},Tr},zt.scale(218.695).center([0,28.0974])}function ee(Ze,tt){var vt=T(tt/2),bt=F(1-vt*vt),zt=1+bt*r(Ze/=2),Et=v(Ze)*bt/zt,Ut=vt/zt,gr=Et*Et,Tr=Ut*Ut;return[4/3*Et*(3+gr-3*Tr),4/3*Ut*(3+3*gr-Tr)]}ee.invert=function(Ze,tt){if(Ze*=3/8,tt*=3/8,!Ze&&E(tt)>1)return null;var vt=Ze*Ze,bt=tt*tt,zt=1+vt+bt,Et=F((zt-F(zt*zt-4*tt*tt))/2),Ut=L(Et)/3,gr=Et?j(E(tt/Et))/3:U(E(Ze))/3,Tr=r(Ut),Pr=R(gr),Yr=Pr*Pr-Tr*Tr;return[p(Ze)*2*t(B(gr)*Tr,.25-Yr),p(tt)*2*t(Pr*v(Ut),.25+Yr)]};function ne(){return b.geoProjection(ee).scale(66.1603)}var $=F(8),ue=i(1+w);function te(Ze,tt){var vt=E(tt);return vtg&&--bt>0);return[Ze/(r(vt)*($-1/v(vt))),p(tt)*vt]};function H(){return b.geoProjection(te).scale(112.314)}function ae(Ze){var tt=2*x/Ze;function vt(bt,zt){var Et=b.geoAzimuthalEquidistantRaw(bt,zt);if(E(bt)>A){var Ut=t(Et[1],Et[0]),gr=F(Et[0]*Et[0]+Et[1]*Et[1]),Tr=tt*c((Ut-A)/tt)+A,Pr=t(v(Ut-=Tr),2-r(Ut));Ut=Tr+L(x/gr*v(Pr))-Pr,Et[0]=gr*r(Ut),Et[1]=gr*v(Ut)}return Et}return vt.invert=function(bt,zt){var Et=F(bt*bt+zt*zt);if(Et>A){var Ut=t(zt,bt),gr=tt*c((Ut-A)/tt)+A,Tr=Ut>gr?-1:1,Pr=Et*r(gr-Ut),Yr=1/T(Tr*z((Pr-x)/F(x*(x-2*Pr)+Et*Et)));Ut=gr+2*e((Yr+Tr*F(Yr*Yr-3))/3),bt=Et*r(Ut),zt=Et*v(Ut)}return b.geoAzimuthalEquidistantRaw.invert(bt,zt)},vt}function ie(){var Ze=5,tt=b.geoProjectionMutator(ae),vt=tt(Ze),bt=vt.stream,zt=.01,Et=-r(zt*y),Ut=v(zt*y);return vt.lobes=function(gr){return arguments.length?tt(Ze=+gr):Ze},vt.stream=function(gr){var Tr=vt.rotate(),Pr=bt(gr),Yr=(vt.rotate([0,0]),bt(gr));return vt.rotate(Tr),Pr.sphere=function(){Yr.polygonStart(),Yr.lineStart();for(var sn=0,En=360/Ze,Pn=2*x/Ze,Xn=90-180/Ze,Ta=A;sn0&&E(zt)>l);return bt<0?NaN:vt}function ze(Ze,tt,vt){return tt===void 0&&(tt=40),vt===void 0&&(vt=g),function(bt,zt,Et,Ut){var gr,Tr,Pr;Et=Et===void 0?0:+Et,Ut=Ut===void 0?0:+Ut;for(var Yr=0;Yrgr){Et-=Tr/=2,Ut-=Pr/=2;continue}gr=Xn;var Ta=(Et>0?-1:1)*vt,ri=(Ut>0?-1:1)*vt,Wa=Ze(Et+Ta,Ut),ni=Ze(Et,Ut+ri),$i=(Wa[0]-sn[0])/Ta,bo=(Wa[1]-sn[1])/Ta,vo=(ni[0]-sn[0])/ri,Wo=(ni[1]-sn[1])/ri,Ks=Wo*$i-bo*vo,Js=(E(Ks)<.5?.5:1)/Ks;if(Tr=(Pn*vo-En*Wo)*Js,Pr=(En*bo-Pn*$i)*Js,Et+=Tr,Ut+=Pr,E(Tr)0&&(gr[1]*=1+Tr/1.5*gr[0]*gr[0]),gr}return bt.invert=ze(bt),bt}function st(){return b.geoProjection(Ye()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ct(Ze,tt){var vt=Ze*v(tt),bt=30,zt;do tt-=zt=(tt+v(tt)-vt)/(1+r(tt));while(E(zt)>l&&--bt>0);return tt/2}function at(Ze,tt,vt){function bt(zt,Et){return[Ze*zt*r(Et=ct(vt,Et)),tt*v(Et)]}return bt.invert=function(zt,Et){return Et=L(Et/tt),[zt/(Ze*r(Et)),L((2*Et+v(2*Et))/vt)]},bt}var et=at(w/A,w,x);function Pe(){return b.geoProjection(et).scale(169.529)}var Ae=2.00276,pe=1.11072;function Ne(Ze,tt){var vt=ct(x,tt);return[Ae*Ze/(1/r(tt)+pe/r(vt)),(tt+w*v(vt))/Ae]}Ne.invert=function(Ze,tt){var vt=Ae*tt,bt=tt<0?-M:M,zt=25,Et,Ut;do Ut=vt-w*v(bt),bt-=Et=(v(2*bt)+2*bt-x*v(Ut))/(2*r(2*bt)+2+x*r(Ut)*w*r(bt));while(E(Et)>l&&--zt>0);return Ut=vt-w*v(bt),[Ze*(1/r(Ut)+pe/r(bt))/Ae,Ut]};function ut(){return b.geoProjection(Ne).scale(160.857)}function dt(Ze){var tt=0,vt=b.geoProjectionMutator(Ze),bt=vt(tt);return bt.parallel=function(zt){return arguments.length?vt(tt=zt*y):tt*d},bt}function nt(Ze,tt){return[Ze*r(tt),tt]}nt.invert=function(Ze,tt){return[Ze/r(tt),tt]};function Ft(){return b.geoProjection(nt).scale(152.63)}function Nt(Ze){if(!Ze)return nt;var tt=1/T(Ze);function vt(bt,zt){var Et=tt+Ze-zt,Ut=Et&&bt*r(zt)/Et;return[Et*v(Ut),tt-Et*r(Ut)]}return vt.invert=function(bt,zt){var Et=F(bt*bt+(zt=tt-zt)*zt),Ut=tt+Ze-Et;return[Et/r(Ut)*t(bt,zt),Ut]},vt}function Qt(){return dt(Nt).scale(123.082).center([0,26.1441]).parallel(45)}function ar(Ze){function tt(vt,bt){var zt=A-bt,Et=zt&&vt*Ze*v(zt)/zt;return[zt*v(Et)/Ze,A-zt*r(Et)]}return tt.invert=function(vt,bt){var zt=vt*Ze,Et=A-bt,Ut=F(zt*zt+Et*Et),gr=t(zt,Et);return[(Ut?Ut/v(Ut):1)*gr/Ze,A-Ut]},tt}function kr(){var Ze=.5,tt=b.geoProjectionMutator(ar),vt=tt(Ze);return vt.fraction=function(bt){return arguments.length?tt(Ze=+bt):Ze},vt.scale(158.837)}var Er=at(1,4/x,x);function $r(){return b.geoProjection(Er).scale(152.63)}function Sr(Ze,tt,vt,bt,zt,Et){var Ut=r(Et),gr;if(E(Ze)>1||E(Et)>1)gr=z(vt*zt+tt*bt*Ut);else{var Tr=v(Ze/2),Pr=v(Et/2);gr=2*L(F(Tr*Tr+tt*bt*Pr*Pr))}return E(gr)>l?[gr,t(bt*v(Et),tt*zt-vt*bt*Ut)]:[0,0]}function Ur(Ze,tt,vt){return z((Ze*Ze+tt*tt-vt*vt)/(2*Ze*tt))}function Mt(Ze){return Ze-2*x*n((Ze+x)/(2*x))}function je(Ze,tt,vt){for(var bt=[[Ze[0],Ze[1],v(Ze[1]),r(Ze[1])],[tt[0],tt[1],v(tt[1]),r(tt[1])],[vt[0],vt[1],v(vt[1]),r(vt[1])]],zt=bt[2],Et,Ut=0;Ut<3;++Ut,zt=Et)Et=bt[Ut],zt.v=Sr(Et[1]-zt[1],zt[3],zt[2],Et[3],Et[2],Et[0]-zt[0]),zt.point=[0,0];var gr=Ur(bt[0].v[0],bt[2].v[0],bt[1].v[0]),Tr=Ur(bt[0].v[0],bt[1].v[0],bt[2].v[0]),Pr=x-gr;bt[2].point[1]=0,bt[0].point[0]=-(bt[1].point[0]=bt[0].v[0]/2);var Yr=[bt[2].point[0]=bt[0].point[0]+bt[2].v[0]*r(gr),2*(bt[0].point[1]=bt[1].point[1]=bt[2].v[0]*v(gr))];function sn(En,Pn){var Xn=v(Pn),Ta=r(Pn),ri=new Array(3),Wa;for(Wa=0;Wa<3;++Wa){var ni=bt[Wa];if(ri[Wa]=Sr(Pn-ni[1],ni[3],ni[2],Ta,Xn,En-ni[0]),!ri[Wa][0])return ni.point;ri[Wa][1]=Mt(ri[Wa][1]-ni.v[1])}var $i=Yr.slice();for(Wa=0;Wa<3;++Wa){var bo=Wa==2?0:Wa+1,vo=Ur(bt[Wa].v[0],ri[Wa][0],ri[bo][0]);ri[Wa][1]<0&&(vo=-vo),Wa?Wa==1?(vo=Tr-vo,$i[0]-=ri[Wa][0]*r(vo),$i[1]-=ri[Wa][0]*v(vo)):(vo=Pr-vo,$i[0]+=ri[Wa][0]*r(vo),$i[1]+=ri[Wa][0]*v(vo)):($i[0]+=ri[Wa][0]*r(vo),$i[1]-=ri[Wa][0]*v(vo))}return $i[0]/=3,$i[1]/=3,$i}return sn}function Je(Ze){return Ze[0]*=y,Ze[1]*=y,Ze}function ke(){return xe([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function xe(Ze,tt,vt){var bt=b.geoCentroid({type:"MultiPoint",coordinates:[Ze,tt,vt]}),zt=[-bt[0],-bt[1]],Et=b.geoRotation(zt),Ut=je(Je(Et(Ze)),Je(Et(tt)),Je(Et(vt)));Ut.invert=ze(Ut);var gr=b.geoProjection(Ut).rotate(zt),Tr=gr.center;return delete gr.rotate,gr.center=function(Pr){return arguments.length?Tr(Et(Pr)):Et.invert(Tr())},gr.clipAngle(90)}function ye(Ze,tt){var vt=F(1-v(tt));return[2/m*Ze*vt,m*(1-vt)]}ye.invert=function(Ze,tt){var vt=(vt=tt/m-1)*vt;return[vt>0?Ze*F(x/vt)/2:0,L(1-vt)]};function Ee(){return b.geoProjection(ye).scale(95.6464).center([0,30])}function Xe(Ze){var tt=T(Ze);function vt(bt,zt){return[bt,(bt?bt/v(bt):1)*(v(zt)*r(bt)-tt*r(zt))]}return vt.invert=tt?function(bt,zt){bt&&(zt*=v(bt)/bt);var Et=r(bt);return[bt,2*t(F(Et*Et+tt*tt-zt*zt)-Et,tt-zt)]}:function(bt,zt){return[bt,L(bt?zt*T(bt)/bt:zt)]},vt}function Qe(){return dt(Xe).scale(249.828).clipAngle(90)}var Lt=F(3);function Ct(Ze,tt){return[Lt*Ze*(2*r(2*tt/3)-1)/m,Lt*m*v(tt/3)]}Ct.invert=function(Ze,tt){var vt=3*L(tt/(Lt*m));return[m*Ze/(Lt*(2*r(2*vt/3)-1)),vt]};function Ot(){return b.geoProjection(Ct).scale(156.19)}function Kt(Ze){var tt=r(Ze);function vt(bt,zt){return[bt*tt,v(zt)/tt]}return vt.invert=function(bt,zt){return[bt/tt,L(zt*tt)]},vt}function xr(){return dt(Kt).parallel(38.58).scale(195.044)}function mr(Ze){var tt=r(Ze);function vt(bt,zt){return[bt*tt,(1+tt)*T(zt/2)]}return vt.invert=function(bt,zt){return[bt/tt,e(zt/(1+tt))*2]},vt}function vr(){return dt(mr).scale(124.75)}function Nr(Ze,tt){var vt=F(8/(3*x));return[vt*Ze*(1-E(tt)/x),vt*tt]}Nr.invert=function(Ze,tt){var vt=F(8/(3*x)),bt=tt/vt;return[Ze/(vt*(1-E(bt)/x)),bt]};function kn(){return b.geoProjection(Nr).scale(165.664)}function $n(Ze,tt){var vt=F(4-3*v(E(tt)));return[2/F(6*x)*Ze*vt,p(tt)*F(2*x/3)*(2-vt)]}$n.invert=function(Ze,tt){var vt=2-E(tt)/F(2*x/3);return[Ze*F(6*x)/(2*vt),p(tt)*L((4-vt*vt)/3)]};function Vn(){return b.geoProjection($n).scale(165.664)}function ra(Ze,tt){var vt=F(x*(4+x));return[2/vt*Ze*(1+F(1-4*tt*tt/(x*x))),4/vt*tt]}ra.invert=function(Ze,tt){var vt=F(x*(4+x))/2;return[Ze*vt/(1+F(1-tt*tt*(4+x)/(4*x))),tt*vt/2]};function na(){return b.geoProjection(ra).scale(180.739)}function Un(Ze,tt){var vt=(2+A)*v(tt);tt/=2;for(var bt=0,zt=1/0;bt<10&&E(zt)>l;bt++){var Et=r(tt);tt-=zt=(tt+v(tt)*(Et+2)-vt)/(2*Et*(1+Et))}return[2/F(x*(4+x))*Ze*(1+r(tt)),2*F(x/(4+x))*v(tt)]}Un.invert=function(Ze,tt){var vt=tt*F((4+x)/x)/2,bt=L(vt),zt=r(bt);return[Ze/(2/F(x*(4+x))*(1+zt)),L((bt+vt*(zt+2))/(2+A))]};function ka(){return b.geoProjection(Un).scale(180.739)}function Va(Ze,tt){return[Ze*(1+r(tt))/F(2+x),2*tt/F(2+x)]}Va.invert=function(Ze,tt){var vt=F(2+x),bt=tt*vt/2;return[vt*Ze/(1+r(bt)),bt]};function sr(){return b.geoProjection(Va).scale(173.044)}function Vt(Ze,tt){for(var vt=(1+A)*v(tt),bt=0,zt=1/0;bt<10&&E(zt)>l;bt++)tt-=zt=(tt+v(tt)-vt)/(1+r(tt));return vt=F(2+x),[Ze*(1+r(tt))/vt,2*tt/vt]}Vt.invert=function(Ze,tt){var vt=1+A,bt=F(vt/2);return[Ze*2*bt/(1+r(tt*=bt)),L((tt+v(tt))/vt)]};function or(){return b.geoProjection(Vt).scale(173.044)}var ur=3+2*w;function Gr(Ze,tt){var vt=v(Ze/=2),bt=r(Ze),zt=F(r(tt)),Et=r(tt/=2),Ut=v(tt)/(Et+w*bt*zt),gr=F(2/(1+Ut*Ut)),Tr=F((w*Et+(bt+vt)*zt)/(w*Et+(bt-vt)*zt));return[ur*(gr*(Tr-1/Tr)-2*i(Tr)),ur*(gr*Ut*(Tr+1/Tr)-2*e(Ut))]}Gr.invert=function(Ze,tt){if(!(Et=ee.invert(Ze/1.2,tt*1.065)))return null;var vt=Et[0],bt=Et[1],zt=20,Et;Ze/=ur,tt/=ur;do{var Ut=vt/2,gr=bt/2,Tr=v(Ut),Pr=r(Ut),Yr=v(gr),sn=r(gr),En=r(bt),Pn=F(En),Xn=Yr/(sn+w*Pr*Pn),Ta=Xn*Xn,ri=F(2/(1+Ta)),Wa=w*sn+(Pr+Tr)*Pn,ni=w*sn+(Pr-Tr)*Pn,$i=Wa/ni,bo=F($i),vo=bo-1/bo,Wo=bo+1/bo,Ks=ri*vo-2*i(bo)-Ze,Js=ri*Xn*Wo-2*e(Xn)-tt,Es=Yr&&_*Pn*Tr*Ta/Yr,il=(w*Pr*sn+Pn)/(2*(sn+w*Pr*Pn)*(sn+w*Pr*Pn)*Pn),mu=-.5*Xn*ri*ri*ri,ou=mu*Es,ks=mu*il,Cs=(Cs=2*sn+w*Pn*(Pr-Tr))*Cs*bo,Ru=(w*Pr*sn*Pn+En)/Cs,uc=-(w*Tr*Yr)/(Pn*Cs),Uc=vo*ou-2*Ru/bo+ri*(Ru+Ru/$i),ge=vo*ks-2*uc/bo+ri*(uc+uc/$i),Oe=Xn*Wo*ou-2*Es/(1+Ta)+ri*Wo*Es+ri*Xn*(Ru-Ru/$i),rt=Xn*Wo*ks-2*il/(1+Ta)+ri*Wo*il+ri*Xn*(uc-uc/$i),wt=ge*Oe-rt*Uc;if(!wt)break;var St=(Js*ge-Ks*rt)/wt,It=(Ks*Oe-Js*Uc)/wt;vt-=St,bt=a(-A,s(A,bt-It))}while((E(St)>l||E(It)>l)&&--zt>0);return E(E(bt)-A)bt){var sn=F(Yr),En=t(Pr,Tr),Pn=vt*c(En/vt),Xn=En-Pn,Ta=Ze*r(Xn),ri=(Ze*v(Xn)-Xn*v(Ta))/(A-Ta),Wa=xt(Xn,ri),ni=(x-Ze)/Cr(Wa,Ta,x);Tr=sn;var $i=50,bo;do Tr-=bo=(Ze+Cr(Wa,Ta,Tr)*ni-sn)/(Wa(Tr)*ni);while(E(bo)>l&&--$i>0);Pr=Xn*v(Tr),Trbt){var Tr=F(gr),Pr=t(Ut,Et),Yr=vt*c(Pr/vt),sn=Pr-Yr;Et=Tr*r(sn),Ut=Tr*v(sn);for(var En=Et-A,Pn=v(Et),Xn=Ut/Pn,Ta=Etl||E(Xn)>l)&&--Ta>0);return[sn,En]},Tr}var Dr=Vr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function qr(){return b.geoProjection(Dr).scale(149.995)}var un=Vr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Jr(){return b.geoProjection(un).scale(153.93)}var At=Vr(5/6*x,-.62636,-.0344,0,1.3493,-.05524,0,.045);function lr(){return b.geoProjection(At).scale(130.945)}function zr(Ze,tt){var vt=Ze*Ze,bt=tt*tt;return[Ze*(1-.162388*bt)*(.87-952426e-9*vt*vt),tt*(1+bt/12)]}zr.invert=function(Ze,tt){var vt=Ze,bt=tt,zt=50,Et;do{var Ut=bt*bt;bt-=Et=(bt*(1+Ut/12)-tt)/(1+Ut/4)}while(E(Et)>l&&--zt>0);zt=50,Ze/=1-.162388*Ut;do{var gr=(gr=vt*vt)*gr;vt-=Et=(vt*(.87-952426e-9*gr)-Ze)/(.87-.00476213*gr)}while(E(Et)>l&&--zt>0);return[vt,bt]};function cn(){return b.geoProjection(zr).scale(131.747)}var Rn=Vr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function qn(){return b.geoProjection(Rn).scale(131.087)}function jn(Ze){var tt=Ze(A,0)[0]-Ze(-A,0)[0];function vt(bt,zt){var Et=bt>0?-.5:.5,Ut=Ze(bt+Et*x,zt);return Ut[0]-=Et*tt,Ut}return Ze.invert&&(vt.invert=function(bt,zt){var Et=bt>0?-.5:.5,Ut=Ze.invert(bt+Et*tt,zt),gr=Ut[0]-Et*x;return gr<-x?gr+=2*x:gr>x&&(gr-=2*x),Ut[0]=gr,Ut}),vt}function fn(Ze,tt){var vt=p(Ze),bt=p(tt),zt=r(tt),Et=r(Ze)*zt,Ut=v(Ze)*zt,gr=v(bt*tt);Ze=E(t(Ut,gr)),tt=L(Et),E(Ze-A)>l&&(Ze%=A);var Tr=In(Ze>x/4?A-Ze:Ze,tt);return Ze>x/4&&(gr=Tr[0],Tr[0]=-Tr[1],Tr[1]=-gr),Tr[0]*=vt,Tr[1]*=-bt,Tr}fn.invert=function(Ze,tt){E(Ze)>1&&(Ze=p(Ze)*2-Ze),E(tt)>1&&(tt=p(tt)*2-tt);var vt=p(Ze),bt=p(tt),zt=-vt*Ze,Et=-bt*tt,Ut=Et/zt<1,gr=gi(Ut?Et:zt,Ut?zt:Et),Tr=gr[0],Pr=gr[1],Yr=r(Pr);return Ut&&(Tr=-A-Tr),[vt*(t(v(Tr)*Yr,-v(Pr))+x),bt*L(r(Tr)*Yr)]};function In(Ze,tt){if(tt===A)return[0,0];var vt=v(tt),bt=vt*vt,zt=bt*bt,Et=1+zt,Ut=1+3*zt,gr=1-zt,Tr=L(1/F(Et)),Pr=gr+bt*Et*Tr,Yr=(1-vt)/Pr,sn=F(Yr),En=Yr*Et,Pn=F(En),Xn=sn*gr,Ta,ri;if(Ze===0)return[0,-(Xn+bt*Pn)];var Wa=r(tt),ni=1/Wa,$i=2*vt*Wa,bo=(-3*bt+Tr*Ut)*$i,vo=(-Pr*Wa-(1-vt)*bo)/(Pr*Pr),Wo=.5*vo/sn,Ks=gr*Wo-2*bt*sn*$i,Js=bt*Et*vo+Yr*Ut*$i,Es=-ni*$i,il=-ni*Js,mu=-2*ni*Ks,ou=4*Ze/x,ks;if(Ze>.222*x||tt.175*x){if(Ta=(Xn+bt*F(En*(1+zt)-Xn*Xn))/(1+zt),Ze>x/4)return[Ta,Ta];var Cs=Ta,Ru=.5*Ta;Ta=.5*(Ru+Cs),ri=50;do{var uc=F(En-Ta*Ta),Uc=Ta*(mu+Es*uc)+il*L(Ta/Pn)-ou;if(!Uc)break;Uc<0?Ru=Ta:Cs=Ta,Ta=.5*(Ru+Cs)}while(E(Cs-Ru)>l&&--ri>0)}else{Ta=l,ri=25;do{var ge=Ta*Ta,Oe=F(En-ge),rt=mu+Es*Oe,wt=Ta*rt+il*L(Ta/Pn)-ou,St=rt+(il-Es*ge)/Oe;Ta-=ks=Oe?wt/St:0}while(E(ks)>l&&--ri>0)}return[Ta,-Xn-bt*F(En-Ta*Ta)]}function gi(Ze,tt){for(var vt=0,bt=1,zt=.5,Et=50;;){var Ut=zt*zt,gr=F(zt),Tr=L(1/F(1+Ut)),Pr=1-Ut+zt*(1+Ut)*Tr,Yr=(1-gr)/Pr,sn=F(Yr),En=Yr*(1+Ut),Pn=sn*(1-Ut),Xn=En-Ze*Ze,Ta=F(Xn),ri=tt+Pn+zt*Ta;if(E(bt-vt)0?vt=zt:bt=zt,zt=.5*(vt+bt)}if(!Et)return null;var Wa=L(gr),ni=r(Wa),$i=1/ni,bo=2*gr*ni,vo=(-3*zt+Tr*(1+3*Ut))*bo,Wo=(-Pr*ni-(1-gr)*vo)/(Pr*Pr),Ks=.5*Wo/sn,Js=(1-Ut)*Ks-2*zt*sn*bo,Es=-2*$i*Js,il=-$i*bo,mu=-$i*(zt*(1+Ut)*Wo+Yr*(1+3*Ut)*bo);return[x/4*(Ze*(Es+il*Ta)+mu*L(Ze/F(En))),Wa]}function Ea(){return b.geoProjection(jn(fn)).scale(239.75)}function Ci(Ze,tt,vt){var bt,zt,Et;return Ze?(bt=Xi(Ze,vt),tt?(zt=Xi(tt,1-vt),Et=zt[1]*zt[1]+vt*bt[0]*bt[0]*zt[0]*zt[0],[[bt[0]*zt[2]/Et,bt[1]*bt[2]*zt[0]*zt[1]/Et],[bt[1]*zt[1]/Et,-bt[0]*bt[2]*zt[0]*zt[2]/Et],[bt[2]*zt[1]*zt[2]/Et,-vt*bt[0]*bt[1]*zt[0]/Et]]):[[bt[0],0],[bt[1],0],[bt[2],0]]):(zt=Xi(tt,1-vt),[[0,zt[0]/zt[1]],[1/zt[1],0],[zt[2]/zt[1],0]])}function Xi(Ze,tt){var vt,bt,zt,Et,Ut;if(tt=1-l)return vt=(1-tt)/4,bt=R(Ze),Et=N(Ze),zt=1/bt,Ut=bt*B(Ze),[Et+vt*(Ut-Ze)/(bt*bt),zt-vt*Et*zt*(Ut-Ze),zt+vt*Et*zt*(Ut+Ze),2*e(o(Ze))-A+vt*(Ut-Ze)/bt];var gr=[1,0,0,0,0,0,0,0,0],Tr=[F(tt),0,0,0,0,0,0,0,0],Pr=0;for(bt=F(1-tt),Ut=1;E(Tr[Pr]/gr[Pr])>l&&Pr<8;)vt=gr[Pr++],Tr[Pr]=(vt-bt)/2,gr[Pr]=(vt+bt)/2,bt=F(vt*bt),Ut*=2;zt=Ut*gr[Pr]*Ze;do Et=Tr[Pr]*v(bt=zt)/gr[Pr],zt=(L(Et)+zt)/2;while(--Pr);return[v(zt),Et=r(zt),Et/r(zt-bt),zt]}function so(Ze,tt,vt){var bt=E(Ze),zt=E(tt),Et=B(zt);if(bt){var Ut=1/v(bt),gr=1/(T(bt)*T(bt)),Tr=-(gr+vt*(Et*Et*Ut*Ut)-1+vt),Pr=(vt-1)*gr,Yr=(-Tr+F(Tr*Tr-4*Pr))/2;return[io(e(1/F(Yr)),vt)*p(Ze),io(e(F((Yr/gr-1)/vt)),1-vt)*p(tt)]}return[0,io(e(Et),1-vt)*p(tt)]}function io(Ze,tt){if(!tt)return Ze;if(tt===1)return i(T(Ze/2+M));for(var vt=1,bt=F(1-tt),zt=F(tt),Et=0;E(zt)>l;Et++){if(Ze%x){var Ut=e(bt*T(Ze)/vt);Ut<0&&(Ut+=x),Ze+=Ut+~~(Ze/x)*x}else Ze+=Ze;zt=(vt+bt)/2,bt=F(vt*bt),zt=((vt=zt)-bt)/2}return Ze/(f(2,Et)*vt)}function Mo(Ze,tt){var vt=(w-1)/(w+1),bt=F(1-vt*vt),zt=io(A,bt*bt),Et=-1,Ut=i(T(x/4+E(tt)/2)),gr=o(Et*Ut)/F(vt),Tr=ui(gr*r(Et*Ze),gr*v(Et*Ze)),Pr=so(Tr[0],Tr[1],bt*bt);return[-Pr[1],(tt>=0?1:-1)*(.5*zt-Pr[0])]}function ui(Ze,tt){var vt=Ze*Ze,bt=tt+1,zt=1-vt-tt*tt;return[.5*((Ze>=0?A:-A)-t(zt,2*Ze)),-.25*i(zt*zt+4*vt)+.5*i(bt*bt+vt)]}function ts(Ze,tt){var vt=tt[0]*tt[0]+tt[1]*tt[1];return[(Ze[0]*tt[0]+Ze[1]*tt[1])/vt,(Ze[1]*tt[0]-Ze[0]*tt[1])/vt]}Mo.invert=function(Ze,tt){var vt=(w-1)/(w+1),bt=F(1-vt*vt),zt=io(A,bt*bt),Et=-1,Ut=Ci(.5*zt-tt,-Ze,bt*bt),gr=ts(Ut[0],Ut[1]),Tr=t(gr[1],gr[0])/Et;return[Tr,2*e(o(.5/Et*i(vt*gr[0]*gr[0]+vt*gr[1]*gr[1])))-A]};function Ho(){return b.geoProjection(jn(Mo)).scale(151.496)}function Xs(Ze){var tt=v(Ze),vt=r(Ze),bt=cs(Ze);bt.invert=cs(-Ze);function zt(Et,Ut){var gr=bt(Et,Ut);Et=gr[0],Ut=gr[1];var Tr=v(Ut),Pr=r(Ut),Yr=r(Et),sn=z(tt*Tr+vt*Pr*Yr),En=v(sn),Pn=E(En)>l?sn/En:1;return[Pn*vt*v(Et),(E(Et)>A?Pn:-Pn)*(tt*Pr-vt*Tr*Yr)]}return zt.invert=function(Et,Ut){var gr=F(Et*Et+Ut*Ut),Tr=-v(gr),Pr=r(gr),Yr=gr*Pr,sn=-Ut*Tr,En=gr*tt,Pn=F(Yr*Yr+sn*sn-En*En),Xn=t(Yr*En+sn*Pn,sn*En-Yr*Pn),Ta=(gr>A?-1:1)*t(Et*Tr,gr*r(Xn)*Pr+Ut*v(Xn)*Tr);return bt.invert(Ta,Xn)},zt}function cs(Ze){var tt=v(Ze),vt=r(Ze);return function(bt,zt){var Et=r(zt),Ut=r(bt)*Et,gr=v(bt)*Et,Tr=v(zt);return[t(gr,Ut*vt-Tr*tt),L(Tr*vt+Ut*tt)]}}function Jo(){var Ze=0,tt=b.geoProjectionMutator(Xs),vt=tt(Ze),bt=vt.rotate,zt=vt.stream,Et=b.geoCircle();return vt.parallel=function(Ut){if(!arguments.length)return Ze*d;var gr=vt.rotate();return tt(Ze=Ut*y).rotate(gr)},vt.rotate=function(Ut){return arguments.length?(bt.call(vt,[Ut[0],Ut[1]-Ze*d]),Et.center([-Ut[0],-Ut[1]]),vt):(Ut=bt.call(vt),Ut[1]+=Ze*d,Ut)},vt.stream=function(Ut){return Ut=zt(Ut),Ut.sphere=function(){Ut.polygonStart();var gr=.01,Tr=Et.radius(90-gr)().coordinates[0],Pr=Tr.length-1,Yr=-1,sn;for(Ut.lineStart();++Yr=0;)Ut.point((sn=Tr[Yr])[0],sn[1]);Ut.lineEnd(),Ut.polygonEnd()},Ut},vt.scale(79.4187).parallel(45).clipAngle(180-.001)}var Uo=3,Ys=L(1-1/Uo)*d,Vs=Kt(0);function ll(Ze){var tt=Ys*y,vt=ye(x,tt)[0]-ye(-x,tt)[0],bt=Vs(0,tt)[1],zt=ye(0,tt)[1],Et=m-zt,Ut=u/Ze,gr=4/u,Tr=bt+Et*Et*4/u;function Pr(Yr,sn){var En,Pn=E(sn);if(Pn>tt){var Xn=s(Ze-1,a(0,n((Yr+x)/Ut)));Yr+=x*(Ze-1)/Ze-Xn*Ut,En=ye(Yr,Pn),En[0]=En[0]*u/vt-u*(Ze-1)/(2*Ze)+Xn*u/Ze,En[1]=bt+(En[1]-zt)*4*Et/u,sn<0&&(En[1]=-En[1])}else En=Vs(Yr,sn);return En[0]*=gr,En[1]/=Tr,En}return Pr.invert=function(Yr,sn){Yr/=gr,sn*=Tr;var En=E(sn);if(En>bt){var Pn=s(Ze-1,a(0,n((Yr+x)/Ut)));Yr=(Yr+x*(Ze-1)/Ze-Pn*Ut)*vt/u;var Xn=ye.invert(Yr,.25*(En-bt)*u/Et+zt);return Xn[0]-=x*(Ze-1)/Ze-Pn*Ut,sn<0&&(Xn[1]=-Xn[1]),Xn}return Vs.invert(Yr,sn)},Pr}function fs(Ze,tt){return[Ze,tt&1?90-l:Ys]}function Zo(Ze,tt){return[Ze,tt&1?-90+l:-Ys]}function po(Ze){return[Ze[0]*(1-l),Ze[1]]}function hs(Ze){var tt=[].concat(S.range(-180,180+Ze/2,Ze).map(fs),S.range(180,-180-Ze/2,-Ze).map(Zo));return{type:"Polygon",coordinates:[Ze===180?tt.map(po):tt]}}function ul(){var Ze=4,tt=b.geoProjectionMutator(ll),vt=tt(Ze),bt=vt.stream;return vt.lobes=function(zt){return arguments.length?tt(Ze=+zt):Ze},vt.stream=function(zt){var Et=vt.rotate(),Ut=bt(zt),gr=(vt.rotate([0,0]),bt(zt));return vt.rotate(Et),Ut.sphere=function(){b.geoStream(hs(180/Ze),gr)},Ut},vt.scale(239.75)}function kl(Ze){var tt=1+Ze,vt=v(1/tt),bt=L(vt),zt=2*F(x/(Et=x+4*bt*tt)),Et,Ut=.5*zt*(tt+F(Ze*(2+Ze))),gr=Ze*Ze,Tr=tt*tt;function Pr(Yr,sn){var En=1-v(sn),Pn,Xn;if(En&&En<2){var Ta=A-sn,ri=25,Wa;do{var ni=v(Ta),$i=r(Ta),bo=bt+t(ni,tt-$i),vo=1+Tr-2*tt*$i;Ta-=Wa=(Ta-gr*bt-tt*ni+vo*bo-.5*En*Et)/(2*tt*ni*bo)}while(E(Wa)>g&&--ri>0);Pn=zt*F(vo),Xn=Yr*bo/x}else Pn=zt*(Ze+En),Xn=Yr*bt/x;return[Pn*v(Xn),Ut-Pn*r(Xn)]}return Pr.invert=function(Yr,sn){var En=Yr*Yr+(sn-=Ut)*sn,Pn=(1+Tr-En/(zt*zt))/(2*tt),Xn=z(Pn),Ta=v(Xn),ri=bt+t(Ta,tt-Pn);return[L(Yr/F(En))*x/ri,L(1-2*(Xn-gr*bt-tt*Ta+(1+Tr-2*tt*Pn)*ri)/Et)]},Pr}function Rl(){var Ze=1,tt=b.geoProjectionMutator(kl),vt=tt(Ze);return vt.ratio=function(bt){return arguments.length?tt(Ze=+bt):Ze},vt.scale(167.774).center([0,18.67])}var Ms=.7109889596207567,fi=.0528035274542;function to(Ze,tt){return tt>-Ms?(Ze=et(Ze,tt),Ze[1]+=fi,Ze):nt(Ze,tt)}to.invert=function(Ze,tt){return tt>-Ms?et.invert(Ze,tt-fi):nt.invert(Ze,tt)};function Cl(){return b.geoProjection(to).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Ps(Ze,tt){return E(tt)>Ms?(Ze=et(Ze,tt),Ze[1]-=tt>0?fi:-fi,Ze):nt(Ze,tt)}Ps.invert=function(Ze,tt){return E(tt)>Ms?et.invert(Ze,tt+(tt>0?fi:-fi)):nt.invert(Ze,tt)};function Fo(){return b.geoProjection(Ps).scale(152.63)}function Il(Ze,tt,vt,bt){var zt=F(4*x/(2*vt+(1+Ze-tt/2)*v(2*vt)+(Ze+tt)/2*v(4*vt)+tt/2*v(6*vt))),Et=F(bt*v(vt)*F((1+Ze*r(2*vt)+tt*r(4*vt))/(1+Ze+tt))),Ut=vt*Tr(1);function gr(sn){return F(1+Ze*r(2*sn)+tt*r(4*sn))}function Tr(sn){var En=sn*vt;return(2*En+(1+Ze-tt/2)*v(2*En)+(Ze+tt)/2*v(4*En)+tt/2*v(6*En))/vt}function Pr(sn){return gr(sn)*v(sn)}var Yr=function(sn,En){var Pn=vt*Fe(Tr,Ut*v(En)/vt,En/x);isNaN(Pn)&&(Pn=vt*p(En));var Xn=zt*gr(Pn);return[Xn*Et*sn/x*r(Pn),Xn/Et*v(Pn)]};return Yr.invert=function(sn,En){var Pn=Fe(Pr,En*Et/zt);return[sn*x/(r(Pn)*zt*Et*gr(Pn)),L(vt*Tr(Pn/vt)/Ut)]},vt===0&&(zt=F(bt/x),Yr=function(sn,En){return[sn*zt,v(En)/zt]},Yr.invert=function(sn,En){return[sn/zt,L(En*zt)]}),Yr}function Zs(){var Ze=1,tt=0,vt=45*y,bt=2,zt=b.geoProjectionMutator(Il),Et=zt(Ze,tt,vt,bt);return Et.a=function(Ut){return arguments.length?zt(Ze=+Ut,tt,vt,bt):Ze},Et.b=function(Ut){return arguments.length?zt(Ze,tt=+Ut,vt,bt):tt},Et.psiMax=function(Ut){return arguments.length?zt(Ze,tt,vt=+Ut*y,bt):vt*d},Et.ratio=function(Ut){return arguments.length?zt(Ze,tt,vt,bt=+Ut):bt},Et.scale(180.739)}function cl(Ze,tt,vt,bt,zt,Et,Ut,gr,Tr,Pr,Yr){if(Yr.nanEncountered)return NaN;var sn,En,Pn,Xn,Ta,ri,Wa,ni,$i,bo;if(sn=vt-tt,En=Ze(tt+sn*.25),Pn=Ze(vt-sn*.25),isNaN(En)){Yr.nanEncountered=!0;return}if(isNaN(Pn)){Yr.nanEncountered=!0;return}return Xn=sn*(bt+4*En+zt)/12,Ta=sn*(zt+4*Pn+Et)/12,ri=Xn+Ta,bo=(ri-Ut)/15,Pr>Tr?(Yr.maxDepthCount++,ri+bo):Math.abs(bo)>1;do Tr[ri]>Pn?Ta=ri:Xn=ri,ri=Xn+Ta>>1;while(ri>Xn);var Wa=Tr[ri+1]-Tr[ri];return Wa&&(Wa=(Pn-Tr[ri+1])/Wa),(ri+1+Wa)/Ut}var sn=2*Yr(1)/x*Et/vt,En=function(Pn,Xn){var Ta=Yr(E(v(Xn))),ri=bt(Ta)*Pn;return Ta/=sn,[ri,Xn>=0?Ta:-Ta]};return En.invert=function(Pn,Xn){var Ta;return Xn*=sn,E(Xn)<1&&(Ta=p(Xn)*L(zt(E(Xn))*Et)),[Pn/bt(E(Xn)),Ta]},En}function gs(){var Ze=0,tt=2.5,vt=1.183136,bt=b.geoProjectionMutator(Qi),zt=bt(Ze,tt,vt);return zt.alpha=function(Et){return arguments.length?bt(Ze=+Et,tt,vt):Ze},zt.k=function(Et){return arguments.length?bt(Ze,tt=+Et,vt):tt},zt.gamma=function(Et){return arguments.length?bt(Ze,tt,vt=+Et):vt},zt.scale(152.63)}function rs(Ze,tt){return E(Ze[0]-tt[0])=0;--Tr)vt=Ze[1][Tr],bt=vt[0][0],zt=vt[0][1],Et=vt[1][1],Ut=vt[2][0],gr=vt[2][1],tt.push(Xl([[Ut-l,gr-l],[Ut-l,Et+l],[bt+l,Et+l],[bt+l,zt-l]],30));return{type:"Polygon",coordinates:[S.merge(tt)]}}function Io(Ze,tt,vt){var bt,zt;function Et(Tr,Pr){for(var Yr=Pr<0?-1:1,sn=tt[+(Pr<0)],En=0,Pn=sn.length-1;Ensn[En][2][0];++En);var Xn=Ze(Tr-sn[En][1][0],Pr);return Xn[0]+=Ze(sn[En][1][0],Yr*Pr>Yr*sn[En][0][1]?sn[En][0][1]:Pr)[0],Xn}vt?Et.invert=vt(Et):Ze.invert&&(Et.invert=function(Tr,Pr){for(var Yr=zt[+(Pr<0)],sn=tt[+(Pr<0)],En=0,Pn=Yr.length;EnXn&&(Ta=Pn,Pn=Xn,Xn=Ta),[[sn,Pn],[En,Xn]]})}),Ut):tt.map(function(Pr){return Pr.map(function(Yr){return[[Yr[0][0]*d,Yr[0][1]*d],[Yr[1][0]*d,Yr[1][1]*d],[Yr[2][0]*d,Yr[2][1]*d]]})})},tt!=null&&Ut.lobes(tt),Ut}var cu=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function vu(){return Io(Ne,cu).scale(160.857)}var Os=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function wl(){return Io(Ps,Os).scale(152.63)}var Nl=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Vl(){return Io(et,Nl).scale(169.529)}var Zu=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function df(){return Io(et,Zu).scale(169.529).rotate([20,0])}var Xc=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function rf(){return Io(to,Xc,ze).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Dh=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function wh(){return Io(nt,Dh).scale(152.63).rotate([-20,0])}function Tl(Ze,tt){return[3/u*Ze*F(x*x/3-tt*tt),tt]}Tl.invert=function(Ze,tt){return[u/3*Ze/F(x*x/3-tt*tt),tt]};function Dc(){return b.geoProjection(Tl).scale(158.837)}function zh(Ze){function tt(vt,bt){if(E(E(bt)-A)2)return null;vt/=2,bt/=2;var Et=vt*vt,Ut=bt*bt,gr=2*bt/(1+Et+Ut);return gr=f((1+gr)/(1-gr),1/Ze),[t(2*vt,1-Et-Ut)/Ze,L((gr-1)/(gr+1))]},tt}function oc(){var Ze=.5,tt=b.geoProjectionMutator(zh),vt=tt(Ze);return vt.spacing=function(bt){return arguments.length?tt(Ze=+bt):Ze},vt.scale(124.75)}var Wu=x/w;function sc(Ze,tt){return[Ze*(1+F(r(tt)))/2,tt/(r(tt/2)*r(Ze/6))]}sc.invert=function(Ze,tt){var vt=E(Ze),bt=E(tt),zt=l,Et=A;btl||E(ri)>l)&&--zt>0);return zt&&[vt,bt]};function $u(){return b.geoProjection(eu).scale(139.98)}function Hs(Ze,tt){return[v(Ze)/r(tt),T(tt)*r(Ze)]}Hs.invert=function(Ze,tt){var vt=Ze*Ze,bt=tt*tt,zt=bt+1,Et=vt+zt,Ut=Ze?_*F((Et-F(Et*Et-4*vt))/vt):1/F(zt);return[L(Ze*Ut),p(tt)*z(Ut)]};function Dl(){return b.geoProjection(Hs).scale(144.049).clipAngle(90-.001)}function Mf(Ze){var tt=r(Ze),vt=T(M+Ze/2);function bt(zt,Et){var Ut=Et-Ze,gr=E(Ut)=0;)Yr=Ze[Pr],sn=Yr[0]+gr*(Pn=sn)-Tr*En,En=Yr[1]+gr*En+Tr*Pn;return sn=gr*(Pn=sn)-Tr*En,En=gr*En+Tr*Pn,[sn,En]}return vt.invert=function(bt,zt){var Et=20,Ut=bt,gr=zt;do{for(var Tr=tt,Pr=Ze[Tr],Yr=Pr[0],sn=Pr[1],En=0,Pn=0,Xn;--Tr>=0;)Pr=Ze[Tr],En=Yr+Ut*(Xn=En)-gr*Pn,Pn=sn+Ut*Pn+gr*Xn,Yr=Pr[0]+Ut*(Xn=Yr)-gr*sn,sn=Pr[1]+Ut*sn+gr*Xn;En=Yr+Ut*(Xn=En)-gr*Pn,Pn=sn+Ut*Pn+gr*Xn,Yr=Ut*(Xn=Yr)-gr*sn-bt,sn=Ut*sn+gr*Xn-zt;var Ta=En*En+Pn*Pn,ri,Wa;Ut-=ri=(Yr*En+sn*Pn)/Ta,gr-=Wa=(sn*En-Yr*Pn)/Ta}while(E(ri)+E(Wa)>l*l&&--Et>0);if(Et){var ni=F(Ut*Ut+gr*gr),$i=2*e(ni*.5),bo=v($i);return[t(Ut*bo,ni*r($i)),ni?L(gr*bo/ni):0]}},vt}var Fs=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Vd=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],pl=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Oo=[[.9245,0],[0,0],[.01943,0]],th=[[.721316,0],[0,0],[-.00881625,-.00617325]];function af(){return Ku(Fs,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Ou(){return Ku(Vd,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Oh(){return Ku(pl,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Bf(){return Ku(Oo,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function uh(){return Ku(th,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Ku(Ze,tt){var vt=b.geoProjection(Sd(Ze)).rotate(tt).clipAngle(90),bt=b.geoRotation(tt),zt=vt.center;return delete vt.rotate,vt.center=function(Et){return arguments.length?zt(bt(Et)):bt.invert(zt())},vt}var fd=F(6),Hh=F(7);function ch(Ze,tt){var vt=L(7*v(tt)/(3*fd));return[fd*Ze*(2*r(2*vt/3)-1)/Hh,9*v(vt/3)/Hh]}ch.invert=function(Ze,tt){var vt=3*L(tt*Hh/9);return[Ze*Hh/(fd*(2*r(2*vt/3)-1)),L(v(vt)*3*fd/7)]};function Nf(){return b.geoProjection(ch).scale(164.859)}function Fh(Ze,tt){for(var vt=(1+_)*v(tt),bt=tt,zt=0,Et;zt<25&&(bt-=Et=(v(bt/2)+v(bt)-vt)/(.5*r(bt/2)+r(bt)),!(E(Et)g&&--bt>0);return Et=vt*vt,Ut=Et*Et,gr=Et*Ut,[Ze/(.84719-.13063*Et+gr*gr*(-.04515+.05494*Et-.02326*Ut+.00331*gr)),vt]};function vf(){return b.geoProjection(Ef).scale(175.295)}function Ju(Ze,tt){return[Ze*(1+r(tt))/2,2*(tt-T(tt/2))]}Ju.invert=function(Ze,tt){for(var vt=tt/2,bt=0,zt=1/0;bt<10&&E(zt)>l;++bt){var Et=r(tt/2);tt-=zt=(tt-T(tt/2)-vt)/(1-.5/(Et*Et))}return[2*Ze/(1+r(tt)),tt]};function Wf(){return b.geoProjection(Ju).scale(152.63)}var Nh=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Ul(){return Io(de(1/0),Nh).rotate([20,0]).scale(152.63)}function Th(Ze,tt){var vt=v(tt),bt=r(tt),zt=p(Ze);if(Ze===0||E(tt)===A)return[0,tt];if(tt===0)return[Ze,0];if(E(Ze)===A)return[Ze*bt,A*vt];var Et=x/(2*Ze)-2*Ze/x,Ut=2*tt/x,gr=(1-Ut*Ut)/(vt-Ut),Tr=Et*Et,Pr=gr*gr,Yr=1+Tr/Pr,sn=1+Pr/Tr,En=(Et*vt/gr-Et/2)/Yr,Pn=(Pr*vt/Tr+gr/2)/sn,Xn=En*En+bt*bt/Yr,Ta=Pn*Pn-(Pr*vt*vt/Tr+gr*vt-1)/sn;return[A*(En+F(Xn)*zt),A*(Pn+F(Ta<0?0:Ta)*p(-tt*Et)*zt)]}Th.invert=function(Ze,tt){Ze/=A,tt/=A;var vt=Ze*Ze,bt=tt*tt,zt=vt+bt,Et=x*x;return[Ze?(zt-1+F((1-zt)*(1-zt)+4*vt))/(2*Ze)*A:0,Fe(function(Ut){return zt*(x*v(Ut)-2*Ut)*x+4*Ut*Ut*(tt-v(Ut))+2*x*Ut-Et*tt},0)]};function Md(){return b.geoProjection(Th).scale(127.267)}var Xh=1.0148,fh=.23185,Yh=-.14499,zc=.02406,Zh=Xh,wu=5*fh,Oc=7*Yh,Uf=9*zc,tu=1.790857183;function kf(Ze,tt){var vt=tt*tt;return[Ze,tt*(Xh+vt*vt*(fh+vt*(Yh+zc*vt)))]}kf.invert=function(Ze,tt){tt>tu?tt=tu:tt<-tu&&(tt=-tu);var vt=tt,bt;do{var zt=vt*vt;vt-=bt=(vt*(Xh+zt*zt*(fh+zt*(Yh+zc*zt)))-tt)/(Zh+zt*zt*(wu+zt*(Oc+Uf*zt)))}while(E(bt)>l);return[Ze,vt]};function gc(){return b.geoProjection(kf).scale(139.319)}function Fc(Ze,tt){if(E(tt)l&&--zt>0);return Ut=T(bt),[(E(tt)=0;)if(bt=tt[gr],vt[0]===bt[0]&&vt[1]===bt[1]){if(Et)return[Et,vt];Et=vt}}}function lc(Ze){for(var tt=Ze.length,vt=[],bt=Ze[tt-1],zt=0;zt0?[-bt[0],0]:[180-bt[0],180])};var tt=ih.map(function(vt){return{face:vt,project:Ze(vt)}});return[-1,0,0,1,0,1,4,5].forEach(function(vt,bt){var zt=tt[vt];zt&&(zt.children||(zt.children=[])).push(tt[bt])}),nh(tt[0],function(vt,bt){return tt[vt<-x/2?bt<0?6:4:vt<0?bt<0?2:0:vtbt^Pn>bt&&vt<(En-Pr)*(bt-Yr)/(Pn-Yr)+Pr&&(zt=!zt)}return zt}function hc(Ze,tt){var vt=tt.stream,bt;if(!vt)throw new Error("invalid projection");switch(Ze&&Ze.type){case"Feature":bt=Wc;break;case"FeatureCollection":bt=$h;break;default:bt=gf;break}return bt(Ze,vt)}function $h(Ze,tt){return{type:"FeatureCollection",features:Ze.features.map(function(vt){return Wc(vt,tt)})}}function Wc(Ze,tt){return{type:"Feature",id:Ze.id,properties:Ze.properties,geometry:gf(Ze.geometry,tt)}}function Cf(Ze,tt){return{type:"GeometryCollection",geometries:Ze.geometries.map(function(vt){return gf(vt,tt)})}}function gf(Ze,tt){if(!Ze)return null;if(Ze.type==="GeometryCollection")return Cf(Ze,tt);var vt;switch(Ze.type){case"Point":vt=pu;break;case"MultiPoint":vt=pu;break;case"LineString":vt=Vf;break;case"MultiLineString":vt=Vf;break;case"Polygon":vt=yf;break;case"MultiPolygon":vt=yf;break;case"Sphere":vt=yf;break;default:return null}return b.geoStream(Ze,tt(vt)),vt.result()}var Su=[],Tc=[],pu={point:function(Ze,tt){Su.push([Ze,tt])},result:function(){var Ze=Su.length?Su.length<2?{type:"Point",coordinates:Su[0]}:{type:"MultiPoint",coordinates:Su}:null;return Su=[],Ze}},Vf={lineStart:mf,point:function(Ze,tt){Su.push([Ze,tt])},lineEnd:function(){Su.length&&(Tc.push(Su),Su=[])},result:function(){var Ze=Tc.length?Tc.length<2?{type:"LineString",coordinates:Tc[0]}:{type:"MultiLineString",coordinates:Tc}:null;return Tc=[],Ze}},yf={polygonStart:mf,lineStart:mf,point:function(Ze,tt){Su.push([Ze,tt])},lineEnd:function(){var Ze=Su.length;if(Ze){do Su.push(Su[0].slice());while(++Ze<4);Tc.push(Su),Su=[]}},polygonEnd:mf,result:function(){if(!Tc.length)return null;var Ze=[],tt=[];return Tc.forEach(function(vt){vh(vt)?Ze.push([vt]):tt.push(vt)}),tt.forEach(function(vt){var bt=vt[0];Ze.some(function(zt){if(kd(zt[0],bt))return zt.push(vt),!0})||Ze.push([vt])}),Tc=[],Ze.length?Ze.length>1?{type:"MultiPolygon",coordinates:Ze}:{type:"Polygon",coordinates:Ze[0]}:null}};function jh(Ze){var tt=Ze(A,0)[0]-Ze(-A,0)[0];function vt(bt,zt){var Et=E(bt)0?bt-x:bt+x,zt),gr=(Ut[0]-Ut[1])*_,Tr=(Ut[0]+Ut[1])*_;if(Et)return[gr,Tr];var Pr=tt*_,Yr=gr>0^Tr>0?-1:1;return[Yr*gr-p(Tr)*Pr,Yr*Tr-p(gr)*Pr]}return Ze.invert&&(vt.invert=function(bt,zt){var Et=(bt+zt)*_,Ut=(zt-bt)*_,gr=E(Et)<.5*tt&&E(Ut)<.5*tt;if(!gr){var Tr=tt*_,Pr=Et>0^Ut>0?-1:1,Yr=-Pr*bt+(Ut>0?1:-1)*Tr,sn=-Pr*zt+(Et>0?1:-1)*Tr;Et=(-Yr-sn)*_,Ut=(Yr-sn)*_}var En=Ze.invert(Et,Ut);return gr||(En[0]+=Et>0?x:-x),En}),b.geoProjection(vt).rotate([-90,-90,45]).clipAngle(180-.001)}function cr(){return jh(fn).scale(176.423)}function Rr(){return jh(Mo).scale(111.48)}function pn(Ze,tt){if(!(0<=(tt=+tt)&&tt<=20))throw new Error("invalid digits");function vt(Pr){var Yr=Pr.length,sn=2,En=new Array(Yr);for(En[0]=+Pr[0].toFixed(tt),En[1]=+Pr[1].toFixed(tt);sn2||Pn[0]!=Yr[0]||Pn[1]!=Yr[1])&&(sn.push(Pn),Yr=Pn)}return sn.length===1&&Pr.length>1&&sn.push(vt(Pr[Pr.length-1])),sn}function Et(Pr){return Pr.map(zt)}function Ut(Pr){if(Pr==null)return Pr;var Yr;switch(Pr.type){case"GeometryCollection":Yr={type:"GeometryCollection",geometries:Pr.geometries.map(Ut)};break;case"Point":Yr={type:"Point",coordinates:vt(Pr.coordinates)};break;case"MultiPoint":Yr={type:Pr.type,coordinates:bt(Pr.coordinates)};break;case"LineString":Yr={type:Pr.type,coordinates:zt(Pr.coordinates)};break;case"MultiLineString":case"Polygon":Yr={type:Pr.type,coordinates:Et(Pr.coordinates)};break;case"MultiPolygon":Yr={type:"MultiPolygon",coordinates:Pr.coordinates.map(Et)};break;default:return Pr}return Pr.bbox!=null&&(Yr.bbox=Pr.bbox),Yr}function gr(Pr){var Yr={type:"Feature",properties:Pr.properties,geometry:Ut(Pr.geometry)};return Pr.id!=null&&(Yr.id=Pr.id),Pr.bbox!=null&&(Yr.bbox=Pr.bbox),Yr}if(Ze!=null)switch(Ze.type){case"Feature":return gr(Ze);case"FeatureCollection":{var Tr={type:"FeatureCollection",features:Ze.features.map(gr)};return Ze.bbox!=null&&(Tr.bbox=Ze.bbox),Tr}default:return Ut(Ze)}return Ze}function an(Ze){var tt=v(Ze);function vt(bt,zt){var Et=tt?T(bt*tt/2)/tt:bt/2;if(!zt)return[2*Et,-Ze];var Ut=2*e(Et*v(zt)),gr=1/T(zt);return[v(Ut)*gr,zt+(1-r(Ut))*gr-Ze]}return vt.invert=function(bt,zt){if(E(zt+=Ze)l&&--gr>0);var En=bt*(Pr=T(Ut)),Pn=T(E(zt)0?A:-A)*(Tr+zt*(Yr-Ut)/2+zt*zt*(Yr-2*Tr+Ut)/2)]}xa.invert=function(Ze,tt){var vt=tt/A,bt=vt*90,zt=s(18,E(bt/5)),Et=a(0,n(zt));do{var Ut=Aa[Et][1],gr=Aa[Et+1][1],Tr=Aa[s(19,Et+2)][1],Pr=Tr-Ut,Yr=Tr-2*gr+Ut,sn=2*(E(vt)-gr)/Pr,En=Yr/Pr,Pn=sn*(1-En*sn*(1-2*En*sn));if(Pn>=0||Et===1){bt=(tt>=0?5:-5)*(Pn+zt);var Xn=50,Ta;do zt=s(18,E(bt)/5),Et=n(zt),Pn=zt-Et,Ut=Aa[Et][1],gr=Aa[Et+1][1],Tr=Aa[s(19,Et+2)][1],bt-=(Ta=(tt>=0?A:-A)*(gr+Pn*(Tr-Ut)/2+Pn*Pn*(Tr-2*gr+Ut)/2)-tt)*d;while(E(Ta)>g&&--Xn>0);break}}while(--Et>=0);var ri=Aa[Et][0],Wa=Aa[Et+1][0],ni=Aa[s(19,Et+2)][0];return[Ze/(Wa+Pn*(ni-ri)/2+Pn*Pn*(ni-2*Wa+ri)/2),bt*y]};function ti(){return b.geoProjection(xa).scale(152.63)}function li(Ze){function tt(vt,bt){var zt=r(bt),Et=(Ze-1)/(Ze-zt*r(vt));return[Et*zt*v(vt),Et*v(bt)]}return tt.invert=function(vt,bt){var zt=vt*vt+bt*bt,Et=F(zt),Ut=(Ze-F(1-zt*(Ze+1)/(Ze-1)))/((Ze-1)/Et+Et/(Ze-1));return[t(vt*Ut,Et*F(1-Ut*Ut)),Et?L(bt*Ut/Et):0]},tt}function Ni(Ze,tt){var vt=li(Ze);if(!tt)return vt;var bt=r(tt),zt=v(tt);function Et(Ut,gr){var Tr=vt(Ut,gr),Pr=Tr[1],Yr=Pr*zt/(Ze-1)+bt;return[Tr[0]*bt/Yr,Pr/Yr]}return Et.invert=function(Ut,gr){var Tr=(Ze-1)/(Ze-1-gr*zt);return vt.invert(Tr*Ut,Tr*gr*bt)},Et}function Ha(){var Ze=2,tt=0,vt=b.geoProjectionMutator(Ni),bt=vt(Ze,tt);return bt.distance=function(zt){return arguments.length?vt(Ze=+zt,tt):Ze},bt.tilt=function(zt){return arguments.length?vt(Ze,tt=zt*y):tt*d},bt.scale(432.147).clipAngle(z(1/Ze)*d-1e-6)}var bi=1e-4,Qa=1e4,Na=-180,Yi=Na+bi,No=180,Do=No-bi,Go=-90,jo=Go+bi,Wi=90,Li=Wi-bi;function ns(Ze){return Ze.length>0}function Bs(Ze){return Math.floor(Ze*Qa)/Qa}function Al(Ze){return Ze===Go||Ze===Wi?[0,Ze]:[Na,Bs(Ze)]}function Zl(Ze){var tt=Ze[0],vt=Ze[1],bt=!1;return tt<=Yi?(tt=Na,bt=!0):tt>=Do&&(tt=No,bt=!0),vt<=jo?(vt=Go,bt=!0):vt>=Li&&(vt=Wi,bt=!0),bt?[tt,vt]:Ze}function Ml(Ze){return Ze.map(Zl)}function Wl(Ze,tt,vt){for(var bt=0,zt=Ze.length;bt=Do||Yr<=jo||Yr>=Li){Et[Ut]=Zl(Tr);for(var sn=Ut+1;snYi&&Pnjo&&Xn=gr)break;vt.push({index:-1,polygon:tt,ring:Et=Et.slice(sn-1)}),Et[0]=Al(Et[0][1]),Ut=-1,gr=Et.length}}}}function rl(Ze){var tt,vt=Ze.length,bt={},zt={},Et,Ut,gr,Tr,Pr;for(tt=0;tt0?x-gr:gr)*d],Pr=b.geoProjection(Ze(Ut)).rotate(Tr),Yr=b.geoRotation(Tr),sn=Pr.center;return delete Pr.rotate,Pr.center=function(En){return arguments.length?sn(Yr(En)):Yr.invert(sn())},Pr.clipAngle(90)}function ml(Ze){var tt=r(Ze);function vt(bt,zt){var Et=b.geoGnomonicRaw(bt,zt);return Et[0]*=tt,Et}return vt.invert=function(bt,zt){return b.geoGnomonicRaw.invert(bt/tt,zt)},vt}function yc(){return _c([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function _c(Ze,tt){return zl(ml,Ze,tt)}function Ac(Ze){if(!(Ze*=2))return b.geoAzimuthalEquidistantRaw;var tt=-Ze/2,vt=-tt,bt=Ze*Ze,zt=T(vt),Et=.5/v(vt);function Ut(gr,Tr){var Pr=z(r(Tr)*r(gr-tt)),Yr=z(r(Tr)*r(gr-vt)),sn=Tr<0?-1:1;return Pr*=Pr,Yr*=Yr,[(Pr-Yr)/(2*Ze),sn*F(4*bt*Yr-(bt-Pr+Yr)*(bt-Pr+Yr))/(2*Ze)]}return Ut.invert=function(gr,Tr){var Pr=Tr*Tr,Yr=r(F(Pr+(En=gr+tt)*En)),sn=r(F(Pr+(En=gr+vt)*En)),En,Pn;return[t(Pn=Yr-sn,En=(Yr+sn)*zt),(Tr<0?-1:1)*z(F(En*En+Pn*Pn)*Et)]},Ut}function $f(){return xc([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function xc(Ze,tt){return zl(Ac,Ze,tt)}function Lf(Ze,tt){if(E(tt)l&&--gr>0);return[p(Ze)*(F(zt*zt+4)+zt)*x/4,A*Ut]};function Nc(){return b.geoProjection($c).scale(127.16)}function Ue(Ze,tt,vt,bt,zt){function Et(Ut,gr){var Tr=vt*v(bt*gr),Pr=F(1-Tr*Tr),Yr=F(2/(1+Pr*r(Ut*=zt)));return[Ze*Pr*Yr*v(Ut),tt*Tr*Yr]}return Et.invert=function(Ut,gr){var Tr=Ut/Ze,Pr=gr/tt,Yr=F(Tr*Tr+Pr*Pr),sn=2*L(Yr/2);return[t(Ut*T(sn),Ze*Yr)/zt,Yr&&L(gr*v(sn)/(tt*vt*Yr))/bt]},Et}function P(Ze,tt,vt,bt){var zt=x/3;Ze=a(Ze,l),tt=a(tt,l),Ze=s(Ze,A),tt=s(tt,x-l),vt=a(vt,0),vt=s(vt,100-l),bt=a(bt,l);var Et=vt/100+1,Ut=bt/100,gr=z(Et*r(zt))/zt,Tr=v(Ze)/v(gr*A),Pr=tt/x,Yr=F(Ut*v(Ze/2)/v(tt/2)),sn=Yr/F(Pr*Tr*gr),En=1/(Yr*F(Pr*Tr*gr));return Ue(sn,En,Tr,gr,Pr)}function oe(){var Ze=65*y,tt=60*y,vt=20,bt=200,zt=b.geoProjectionMutator(P),Et=zt(Ze,tt,vt,bt);return Et.poleline=function(Ut){return arguments.length?zt(Ze=+Ut*y,tt,vt,bt):Ze*d},Et.parallels=function(Ut){return arguments.length?zt(Ze,tt=+Ut*y,vt,bt):tt*d},Et.inflation=function(Ut){return arguments.length?zt(Ze,tt,vt=+Ut,bt):vt},Et.ratio=function(Ut){return arguments.length?zt(Ze,tt,vt,bt=+Ut):bt},Et.scale(163.775)}function Me(){return oe().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Ce=4*x+3*F(3),Be=2*F(2*x*F(3)/Ce),_t=at(Be*F(3)/x,Be,Ce/6);function kt(){return b.geoProjection(_t).scale(176.84)}function Xt(Ze,tt){return[Ze*F(1-3*tt*tt/(x*x)),tt]}Xt.invert=function(Ze,tt){return[Ze/F(1-3*tt*tt/(x*x)),tt]};function fr(){return b.geoProjection(Xt).scale(152.63)}function Ar(Ze,tt){var vt=r(tt),bt=r(Ze)*vt,zt=1-bt,Et=r(Ze=t(v(Ze)*vt,-v(tt))),Ut=v(Ze);return vt=F(1-bt*bt),[Ut*vt-Et*zt,-Et*vt-Ut*zt]}Ar.invert=function(Ze,tt){var vt=(Ze*Ze+tt*tt)/-2,bt=F(-vt*(2+vt)),zt=tt*vt+Ze*bt,Et=Ze*vt-tt*bt,Ut=F(Et*Et+zt*zt);return[t(bt*zt,Ut*(1+vt)),Ut?-L(bt*Et/Ut):0]};function Lr(){return b.geoProjection(Ar).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function tn(Ze,tt){var vt=fe(Ze,tt);return[(vt[0]+Ze/A)/2,(vt[1]+tt)/2]}tn.invert=function(Ze,tt){var vt=Ze,bt=tt,zt=25;do{var Et=r(bt),Ut=v(bt),gr=v(2*bt),Tr=Ut*Ut,Pr=Et*Et,Yr=v(vt),sn=r(vt/2),En=v(vt/2),Pn=En*En,Xn=1-Pr*sn*sn,Ta=Xn?z(Et*sn)*F(ri=1/Xn):ri=0,ri,Wa=.5*(2*Ta*Et*En+vt/A)-Ze,ni=.5*(Ta*Ut+bt)-tt,$i=.5*ri*(Pr*Pn+Ta*Et*sn*Tr)+.5/A,bo=ri*(Yr*gr/4-Ta*Ut*En),vo=.125*ri*(gr*En-Ta*Ut*Pr*Yr),Wo=.5*ri*(Tr*sn+Ta*Pn*Et)+.5,Ks=bo*vo-Wo*$i,Js=(ni*bo-Wa*Wo)/Ks,Es=(Wa*vo-ni*$i)/Ks;vt-=Js,bt-=Es}while((E(Js)>l||E(Es)>l)&&--zt>0);return[vt,bt]};function xn(){return b.geoProjection(tn).scale(158.837)}h.geoNaturalEarth=b.geoNaturalEarth1,h.geoNaturalEarthRaw=b.geoNaturalEarth1Raw,h.geoAiry=re,h.geoAiryRaw=Z,h.geoAitoff=le,h.geoAitoffRaw=fe,h.geoArmadillo=V,h.geoArmadilloRaw=ce,h.geoAugust=ne,h.geoAugustRaw=ee,h.geoBaker=H,h.geoBakerRaw=te,h.geoBerghaus=ie,h.geoBerghausRaw=ae,h.geoBertin1953=st,h.geoBertin1953Raw=Ye,h.geoBoggs=ut,h.geoBoggsRaw=Ne,h.geoBonne=Qt,h.geoBonneRaw=Nt,h.geoBottomley=kr,h.geoBottomleyRaw=ar,h.geoBromley=$r,h.geoBromleyRaw=Er,h.geoChamberlin=xe,h.geoChamberlinRaw=je,h.geoChamberlinAfrica=ke,h.geoCollignon=Ee,h.geoCollignonRaw=ye,h.geoCraig=Qe,h.geoCraigRaw=Xe,h.geoCraster=Ot,h.geoCrasterRaw=Ct,h.geoCylindricalEqualArea=xr,h.geoCylindricalEqualAreaRaw=Kt,h.geoCylindricalStereographic=vr,h.geoCylindricalStereographicRaw=mr,h.geoEckert1=kn,h.geoEckert1Raw=Nr,h.geoEckert2=Vn,h.geoEckert2Raw=$n,h.geoEckert3=na,h.geoEckert3Raw=ra,h.geoEckert4=ka,h.geoEckert4Raw=Un,h.geoEckert5=sr,h.geoEckert5Raw=Va,h.geoEckert6=or,h.geoEckert6Raw=Vt,h.geoEisenlohr=ln,h.geoEisenlohrRaw=Gr,h.geoFahey=Qn,h.geoFaheyRaw=An,h.geoFoucaut=ha,h.geoFoucautRaw=pa,h.geoFoucautSinusoidal=Ca,h.geoFoucautSinusoidalRaw=_a,h.geoGilbert=Si,h.geoGingery=jr,h.geoGingeryRaw=Dt,h.geoGinzburg4=qr,h.geoGinzburg4Raw=Dr,h.geoGinzburg5=Jr,h.geoGinzburg5Raw=un,h.geoGinzburg6=lr,h.geoGinzburg6Raw=At,h.geoGinzburg8=cn,h.geoGinzburg8Raw=zr,h.geoGinzburg9=qn,h.geoGinzburg9Raw=Rn,h.geoGringorten=Ea,h.geoGringortenRaw=fn,h.geoGuyou=Ho,h.geoGuyouRaw=Mo,h.geoHammer=Le,h.geoHammerRaw=de,h.geoHammerRetroazimuthal=Jo,h.geoHammerRetroazimuthalRaw=Xs,h.geoHealpix=ul,h.geoHealpixRaw=ll,h.geoHill=Rl,h.geoHillRaw=kl,h.geoHomolosine=Fo,h.geoHomolosineRaw=Ps,h.geoHufnagel=Zs,h.geoHufnagelRaw=Il,h.geoHyperelliptical=gs,h.geoHyperellipticalRaw=Qi,h.geoInterrupt=Io,h.geoInterruptedBoggs=vu,h.geoInterruptedHomolosine=wl,h.geoInterruptedMollweide=Vl,h.geoInterruptedMollweideHemispheres=df,h.geoInterruptedSinuMollweide=rf,h.geoInterruptedSinusoidal=wh,h.geoKavrayskiy7=Dc,h.geoKavrayskiy7Raw=Tl,h.geoLagrange=oc,h.geoLagrangeRaw=zh,h.geoLarrivee=nf,h.geoLarriveeRaw=sc,h.geoLaskowski=$u,h.geoLaskowskiRaw=eu,h.geoLittrow=Dl,h.geoLittrowRaw=Hs,h.geoLoximuthal=wc,h.geoLoximuthalRaw=Mf,h.geoMiller=fu,h.geoMillerRaw=Ff,h.geoModifiedStereographic=Ku,h.geoModifiedStereographicRaw=Sd,h.geoModifiedStereographicAlaska=af,h.geoModifiedStereographicGs48=Ou,h.geoModifiedStereographicGs50=Oh,h.geoModifiedStereographicMiller=Bf,h.geoModifiedStereographicLee=uh,h.geoMollweide=Pe,h.geoMollweideRaw=et,h.geoMtFlatPolarParabolic=Nf,h.geoMtFlatPolarParabolicRaw=ch,h.geoMtFlatPolarQuartic=Bh,h.geoMtFlatPolarQuarticRaw=Fh,h.geoMtFlatPolarSinusoidal=Gh,h.geoMtFlatPolarSinusoidalRaw=of,h.geoNaturalEarth2=vf,h.geoNaturalEarth2Raw=Ef,h.geoNellHammer=Wf,h.geoNellHammerRaw=Ju,h.geoInterruptedQuarticAuthalic=Ul,h.geoNicolosi=Md,h.geoNicolosiRaw=Th,h.geoPatterson=gc,h.geoPattersonRaw=kf,h.geoPolyconic=hu,h.geoPolyconicRaw=Fc,h.geoPolyhedral=nh,h.geoPolyhedralButterfly=iu,h.geoPolyhedralCollignon=Uh,h.geoPolyhedralWaterman=lu,h.geoProject=hc,h.geoGringortenQuincuncial=cr,h.geoPeirceQuincuncial=Rr,h.geoPierceQuincuncial=Rr,h.geoQuantize=pn,h.geoQuincuncial=jh,h.geoRectangularPolyconic=On,h.geoRectangularPolyconicRaw=an,h.geoRobinson=ti,h.geoRobinsonRaw=xa,h.geoSatellite=Ha,h.geoSatelliteRaw=Ni,h.geoSinuMollweide=Cl,h.geoSinuMollweideRaw=to,h.geoSinusoidal=Ft,h.geoSinusoidalRaw=nt,h.geoStitch=Hl,h.geoTimes=ys,h.geoTimesRaw=yo,h.geoTwoPointAzimuthal=_c,h.geoTwoPointAzimuthalRaw=ml,h.geoTwoPointAzimuthalUsa=yc,h.geoTwoPointEquidistant=xc,h.geoTwoPointEquidistantRaw=Ac,h.geoTwoPointEquidistantUsa=$f,h.geoVanDerGrinten=Lu,h.geoVanDerGrintenRaw=Lf,h.geoVanDerGrinten2=Xo,h.geoVanDerGrinten2Raw=Pf,h.geoVanDerGrinten3=Rf,h.geoVanDerGrinten3Raw=as,h.geoVanDerGrinten4=Nc,h.geoVanDerGrinten4Raw=$c,h.geoWagner=oe,h.geoWagner7=Me,h.geoWagnerRaw=P,h.geoWagner4=kt,h.geoWagner4Raw=_t,h.geoWagner6=fr,h.geoWagner6Raw=Xt,h.geoWiechel=Lr,h.geoWiechelRaw=Ar,h.geoWinkel3=xn,h.geoWinkel3Raw=tn,Object.defineProperty(h,"__esModule",{value:!0})})}}),CI=Ge({"src/plots/geo/zoom.js"(K,G){var h=ki(),b=_n(),S=Ro(),E=Math.PI/180,e=180/Math.PI,t={cursor:"pointer"},r={cursor:"auto"};function o(d,y){var I=d.projection,L;return y._isScoped?L=a:y._isClipped?L=f:L=s,L(d,I)}G.exports=o;function n(d,y){return h.behavior.zoom().translate(y.translate()).scale(y.scale())}function i(d,y,I){var L=d.id,z=d.graphDiv,F=z.layout,N=F[L],B=z._fullLayout,R=B[L],U={},j={};function Z(re,fe){U[L+"."+re]=b.nestedProperty(N,re).get(),S.call("_storeDirectGUIEdit",F,B._preGUI,U);var le=b.nestedProperty(R,re);le.get()!==fe&&(le.set(fe),b.nestedProperty(N,re).set(fe),j[L+"."+re]=fe)}I(Z),Z("projection.scale",y.scale()/d.fitScale),Z("fitbounds",!1),z.emit("plotly_relayout",j)}function a(d,y){var I=n(d,y);function L(){h.select(this).style(t)}function z(){y.scale(h.event.scale).translate(h.event.translate),d.render(!0);var B=y.invert(d.midPt);d.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/d.fitScale,"geo.center.lon":B[0],"geo.center.lat":B[1]})}function F(B){var R=y.invert(d.midPt);B("center.lon",R[0]),B("center.lat",R[1])}function N(){h.select(this).style(r),i(d,y,F)}return I.on("zoomstart",L).on("zoom",z).on("zoomend",N),I}function s(d,y){var I=n(d,y),L=2,z,F,N,B,R,U,j,Z,re;function fe($){return y.invert($)}function le($){var ue=fe($);if(!ue)return!0;var te=y(ue);return Math.abs(te[0]-$[0])>L||Math.abs(te[1]-$[1])>L}function ce(){h.select(this).style(t),z=h.mouse(this),F=y.rotate(),N=y.translate(),B=F,R=fe(z)}function V(){if(U=h.mouse(this),le(z)){I.scale(y.scale()),I.translate(y.translate());return}y.scale(h.event.scale),y.translate([N[0],h.event.translate[1]]),R?fe(U)&&(Z=fe(U),j=[B[0]+(Z[0]-R[0]),F[1],F[2]],y.rotate(j),B=j):(z=U,R=fe(z)),re=!0,d.render(!0);var $=y.rotate(),ue=y.invert(d.midPt);d.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/d.fitScale,"geo.center.lon":ue[0],"geo.center.lat":ue[1],"geo.projection.rotation.lon":-$[0]})}function ee(){h.select(this).style(r),re&&i(d,y,ne)}function ne($){var ue=y.rotate(),te=y.invert(d.midPt);$("projection.rotation.lon",-ue[0]),$("center.lon",te[0]),$("center.lat",te[1])}return I.on("zoomstart",ce).on("zoom",V).on("zoomend",ee),I}function f(d,y){y.rotate(),y.scale();var I=n(d,y),L=u(I,"zoomstart","zoom","zoomend"),z=0,F=I.on,N;I.on("zoomstart",function(){h.select(this).style(t);var Z=h.mouse(this),re=y.rotate(),fe=re,le=y.translate(),ce=p(re);N=c(y,Z),F.call(I,"zoom",function(){var V=h.mouse(this);if(y.scale(h.event.scale),!N)Z=V,N=c(y,Z);else if(c(y,V)){y.rotate(re).translate(le);var ee=c(y,V),ne=T(N,ee),$=M(v(ce,ne)),ue=l($,N,fe);(!isFinite(ue[0])||!isFinite(ue[1])||!isFinite(ue[2]))&&(ue=fe),y.rotate(ue),fe=ue}R(L.of(this,arguments))}),B(L.of(this,arguments))}).on("zoomend",function(){h.select(this).style(r),F.call(I,"zoom",null),U(L.of(this,arguments)),i(d,y,j)}).on("zoom.redraw",function(){d.render(!0);var Z=y.rotate();d.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/d.fitScale,"geo.projection.rotation.lon":-Z[0],"geo.projection.rotation.lat":-Z[1]})});function B(Z){z++||Z({type:"zoomstart"})}function R(Z){Z({type:"zoom"})}function U(Z){--z||Z({type:"zoomend"})}function j(Z){var re=y.rotate();Z("projection.rotation.lon",-re[0]),Z("projection.rotation.lat",-re[1])}return h.rebind(I,L,"on")}function c(d,y){var I=d.invert(y);return I&&isFinite(I[0])&&isFinite(I[1])&&_(I)}function p(d){var y=.5*d[0]*E,I=.5*d[1]*E,L=.5*d[2]*E,z=Math.sin(y),F=Math.cos(y),N=Math.sin(I),B=Math.cos(I),R=Math.sin(L),U=Math.cos(L);return[F*B*U+z*N*R,z*B*U-F*N*R,F*N*U+z*B*R,F*B*R-z*N*U]}function v(d,y){var I=d[0],L=d[1],z=d[2],F=d[3],N=y[0],B=y[1],R=y[2],U=y[3];return[I*N-L*B-z*R-F*U,I*B+L*N+z*U-F*R,I*R-L*U+z*N+F*B,I*U+L*R-z*B+F*N]}function T(d,y){if(!(!d||!y)){var I=m(d,y),L=Math.sqrt(w(I,I)),z=.5*Math.acos(Math.max(-1,Math.min(1,w(d,y)))),F=Math.sin(z)/L;return L&&[Math.cos(z),I[2]*F,-I[1]*F,I[0]*F]}}function l(d,y,I){var L=A(y,2,d[0]);L=A(L,1,d[1]),L=A(L,0,d[2]-I[2]);var z=y[0],F=y[1],N=y[2],B=L[0],R=L[1],U=L[2],j=Math.atan2(F,z)*e,Z=Math.sqrt(z*z+F*F),re,fe;Math.abs(R)>Z?(fe=(R>0?90:-90)-j,re=0):(fe=Math.asin(R/Z)*e-j,re=Math.sqrt(Z*Z-R*R));var le=180-fe-2*j,ce=(Math.atan2(U,B)-Math.atan2(N,re))*e,V=(Math.atan2(U,B)-Math.atan2(N,-re))*e,ee=g(I[0],I[1],fe,ce),ne=g(I[0],I[1],le,V);return ee<=ne?[fe,ce,I[2]]:[le,V,I[2]]}function g(d,y,I,L){var z=x(I-d),F=x(L-y);return Math.sqrt(z*z+F*F)}function x(d){return(d%360+540)%360-180}function A(d,y,I){var L=I*E,z=d.slice(),F=y===0?1:0,N=y===2?1:2,B=Math.cos(L),R=Math.sin(L);return z[F]=d[F]*B-d[N]*R,z[N]=d[N]*B+d[F]*R,z}function M(d){return[Math.atan2(2*(d[0]*d[1]+d[2]*d[3]),1-2*(d[1]*d[1]+d[2]*d[2]))*e,Math.asin(Math.max(-1,Math.min(1,2*(d[0]*d[2]-d[3]*d[1]))))*e,Math.atan2(2*(d[0]*d[3]+d[1]*d[2]),1-2*(d[2]*d[2]+d[3]*d[3]))*e]}function _(d){var y=d[0]*E,I=d[1]*E,L=Math.cos(I);return[L*Math.cos(y),L*Math.sin(y),Math.sin(I)]}function w(d,y){for(var I=0,L=0,z=d.length;L0&&R._module.calcGeoJSON(B,L)}if(!z){var U=this.updateProjection(I,L);if(U)return;(!this.viewInitial||this.scope!==F.scope)&&this.saveViewInitial(F)}this.scope=F.scope,this.updateBaseLayers(L,F),this.updateDims(L,F),this.updateFx(L,F),s.generalUpdatePerTraceModule(this.graphDiv,this,I,F);var j=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=j.selectAll(".point"),this.dataPoints.text=j.selectAll("text"),this.dataPaths.line=j.selectAll(".js-line");var Z=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=Z.selectAll("path"),this._render()},m.updateProjection=function(I,L){var z=this.graphDiv,F=L[this.id],N=L._size,B=F.domain,R=F.projection,U=F.lonaxis,j=F.lataxis,Z=U._ax,re=j._ax,fe=this.projection=u(F),le=[[N.l+N.w*B.x[0],N.t+N.h*(1-B.y[1])],[N.l+N.w*B.x[1],N.t+N.h*(1-B.y[0])]],ce=F.center||{},V=R.rotation||{},ee=U.range||[],ne=j.range||[];if(F.fitbounds){Z._length=le[1][0]-le[0][0],re._length=le[1][1]-le[0][1],Z.range=c(z,Z),re.range=c(z,re);var $=(Z.range[0]+Z.range[1])/2,ue=(re.range[0]+re.range[1])/2;if(F._isScoped)ce={lon:$,lat:ue};else if(F._isClipped){ce={lon:$,lat:ue},V={lon:$,lat:ue,roll:V.roll};var te=R.type,H=x.lonaxisSpan[te]/2||180,ae=x.lataxisSpan[te]/2||90;ee=[$-H,$+H],ne=[ue-ae,ue+ae]}else ce={lon:$,lat:ue},V={lon:$,lat:V.lat,roll:V.roll}}fe.center([ce.lon-V.lon,ce.lat-V.lat]).rotate([-V.lon,-V.lat,V.roll]).parallels(R.parallels);var ie=y(ee,ne);fe.fitExtent(le,ie);var de=this.bounds=fe.getBounds(ie),Se=this.fitScale=fe.scale(),Le=fe.translate();if(F.fitbounds){var Fe=fe.getBounds(y(Z.range,re.range)),ze=Math.min((de[1][0]-de[0][0])/(Fe[1][0]-Fe[0][0]),(de[1][1]-de[0][1])/(Fe[1][1]-Fe[0][1]));isFinite(ze)?fe.scale(ze*Se):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else fe.scale(R.scale*Se);var Ye=this.midPt=[(de[0][0]+de[1][0])/2,(de[0][1]+de[1][1])/2];if(fe.translate([Le[0]+(Ye[0]-Le[0]),Le[1]+(Ye[1]-Le[1])]).clipExtent(de),F._isAlbersUsa){var st=fe([ce.lon,ce.lat]),ct=fe.translate();fe.translate([ct[0]-(st[0]-ct[0]),ct[1]-(st[1]-ct[1])])}},m.updateBaseLayers=function(I,L){var z=this,F=z.topojson,N=z.layers,B=z.basePaths;function R(le){return le==="lonaxis"||le==="lataxis"}function U(le){return!!x.lineLayers[le]}function j(le){return!!x.fillLayers[le]}var Z=this.hasChoropleth?x.layersForChoropleth:x.layers,re=Z.filter(function(le){return U(le)||j(le)?L["show"+le]:R(le)?L[le].showgrid:!0}),fe=z.framework.selectAll(".layer").data(re,String);fe.exit().each(function(le){delete N[le],delete B[le],h.select(this).remove()}),fe.enter().append("g").attr("class",function(le){return"layer "+le}).each(function(le){var ce=N[le]=h.select(this);le==="bg"?z.bgRect=ce.append("rect").style("pointer-events","all"):R(le)?B[le]=ce.append("path").style("fill","none"):le==="backplot"?ce.append("g").classed("choroplethlayer",!0):le==="frontplot"?ce.append("g").classed("scatterlayer",!0):U(le)?B[le]=ce.append("path").style("fill","none").style("stroke-miterlimit",2):j(le)&&(B[le]=ce.append("path").style("stroke","none"))}),fe.order(),fe.each(function(le){var ce=B[le],V=x.layerNameToAdjective[le];le==="frame"?ce.datum(x.sphereSVG):U(le)||j(le)?ce.datum(_(F,F.objects[le])):R(le)&&ce.datum(d(le,L,I)).call(n.stroke,L[le].gridcolor).call(i.dashLine,L[le].griddash,L[le].gridwidth),U(le)?ce.call(n.stroke,L[V+"color"]).call(i.dashLine,"",L[V+"width"]):j(le)&&ce.call(n.fill,L[V+"color"])})},m.updateDims=function(I,L){var z=this.bounds,F=(L.framewidth||0)/2,N=z[0][0]-F,B=z[0][1]-F,R=z[1][0]-N+F,U=z[1][1]-B+F;i.setRect(this.clipRect,N,B,R,U),this.bgRect.call(i.setRect,N,B,R,U).call(n.fill,L.bgcolor),this.xaxis._offset=N,this.xaxis._length=R,this.yaxis._offset=B,this.yaxis._length=U},m.updateFx=function(I,L){var z=this,F=z.graphDiv,N=z.bgRect,B=I.dragmode,R=I.clickmode;if(z.isStatic)return;function U(){var fe=z.viewInitial,le={};for(var ce in fe)le[z.id+"."+ce]=fe[ce];t.call("_guiRelayout",F,le),F.emit("plotly_doubleclick",null)}function j(fe){return z.projection.invert([fe[0]+z.xaxis._offset,fe[1]+z.yaxis._offset])}var Z=function(fe,le){if(le.isRect){var ce=fe.range={};ce[z.id]=[j([le.xmin,le.ymin]),j([le.xmax,le.ymax])]}else{var V=fe.lassoPoints={};V[z.id]=le.map(j)}},re={element:z.bgRect.node(),gd:F,plotinfo:{id:z.id,xaxis:z.xaxis,yaxis:z.yaxis,fillRangeItems:Z},xaxes:[z.xaxis],yaxes:[z.yaxis],subplot:z.id,clickFn:function(fe){fe===2&&T(F)}};B==="pan"?(N.node().onmousedown=null,N.call(g(z,L)),N.on("dblclick.zoom",U),F._context._scrollZoom.geo||N.on("wheel.zoom",null)):(B==="select"||B==="lasso")&&(N.on(".zoom",null),re.prepFn=function(fe,le,ce){v(fe,le,ce,re,B)},p.init(re)),N.on("mousemove",function(){var fe=z.projection.invert(r.getPositionFromD3Event());if(!fe)return p.unhover(F,h.event);z.xaxis.p2c=function(){return fe[0]},z.yaxis.p2c=function(){return fe[1]},a.hover(F,h.event,z.id)}),N.on("mouseout",function(){F._dragging||p.unhover(F,h.event)}),N.on("click",function(){B!=="select"&&B!=="lasso"&&(R.indexOf("select")>-1&&l(h.event,F,[z.xaxis],[z.yaxis],z.id,re),R.indexOf("event")>-1&&a.click(F,h.event))})},m.makeFramework=function(){var I=this,L=I.graphDiv,z=L._fullLayout,F="clip"+z._uid+I.id;I.clipDef=z._clips.append("clipPath").attr("id",F),I.clipRect=I.clipDef.append("rect"),I.framework=h.select(I.container).append("g").attr("class","geo "+I.id).call(i.setClipUrl,F,L),I.project=function(N){var B=I.projection(N);return B?[B[0]-I.xaxis._offset,B[1]-I.yaxis._offset]:[null,null]},I.xaxis={_id:"x",c2p:function(N){return I.project(N)[0]}},I.yaxis={_id:"y",c2p:function(N){return I.project(N)[1]}},I.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(I.mockAxis,z)},m.saveViewInitial=function(I){var L=I.center||{},z=I.projection,F=z.rotation||{};this.viewInitial={fitbounds:I.fitbounds,"projection.scale":z.scale};var N;I._isScoped?N={"center.lon":L.lon,"center.lat":L.lat}:I._isClipped?N={"projection.rotation.lon":F.lon,"projection.rotation.lat":F.lat}:N={"center.lon":L.lon,"center.lat":L.lat,"projection.rotation.lon":F.lon},r.extendFlat(this.viewInitial,N)},m.render=function(I){this._hasMarkerAngles&&I?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},m._render=function(){var I=this.projection,L=I.getPath(),z;function F(B){var R=I(B.lonlat);return R?o(R[0],R[1]):null}function N(B){return I.isLonLatOverEdges(B.lonlat)?"none":null}for(z in this.basePaths)this.basePaths[z].attr("d",L);for(z in this.dataPaths)this.dataPaths[z].attr("d",function(B){return L(B.geojson)});for(z in this.dataPoints)this.dataPoints[z].attr("display",N).attr("transform",F)};function u(I){var L=I.projection,z=L.type,F=x.projNames[z];F="geo"+r.titleCase(F);for(var N=b[F]||e[F],B=N(),R=I._isSatellite?Math.acos(1/L.distance)*180/Math.PI:I._isClipped?x.lonaxisSpan[z]/2:null,U=["center","rotate","parallels","clipExtent"],j=function(fe){return fe?B:[]},Z=0;ZV}else return!1},B.getPath=function(){return S().projection(B)},B.getBounds=function(fe){return B.getPath().bounds(fe)},B.precision(x.precision),I._isSatellite&&B.tilt(L.tilt).distance(L.distance),R&&B.clipAngle(R-x.clipPad),B}function d(I,L,z){var F=1e-6,N=2.5,B=L[I],R=x.scopeDefaults[L.scope],U,j,Z;I==="lonaxis"?(U=R.lonaxisRange,j=R.lataxisRange,Z=function(ue,te){return[ue,te]}):I==="lataxis"&&(U=R.lataxisRange,j=R.lonaxisRange,Z=function(ue,te){return[te,ue]});var re={type:"linear",range:[U[0],U[1]-F],tick0:B.tick0,dtick:B.dtick};f.setConvert(re,z);var fe=f.calcTicks(re);!L.isScoped&&I==="lonaxis"&&fe.pop();for(var le=fe.length,ce=new Array(le),V=0;V0&&N<0&&(N+=360);var U=(N-F)/4;return{type:"Polygon",coordinates:[[[F,B],[F,R],[F+U,R],[F+2*U,R],[F+3*U,R],[N,R],[N,B],[N-U,B],[N-2*U,B],[N-3*U,B],[F,B]]]}}}}),RC=Ge({"src/plots/geo/layout_attributes.js"(K,G){var h=Xf(),b=Cc().attributes,S=md().dash,E=tS(),e=Hc().overrideAll,t=Op(),r={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:h.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:S},o=G.exports=e({domain:b({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:t(E.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:t(E.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:h.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:E.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:E.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:E.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:E.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:h.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:h.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:h.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:h.background},lonaxis:r,lataxis:r},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}}),PI=Ge({"src/plots/geo/layout_defaults.js"(K,G){var h=_n(),b=q0(),S=Bd().getSubplotData,E=tS(),e=RC(),t=E.axesNames;G.exports=function(n,i,a){b(n,i,a,{type:"geo",attributes:e,handleDefaults:r,fullData:a,partition:"y"})};function r(o,n,i,a){var s=S(a.fullData,"geo",a.id),f=s.map(function(ne){return ne.index}),c=i("resolution"),p=i("scope"),v=E.scopeDefaults[p],T=i("projection.type",v.projType),l=n._isAlbersUsa=T==="albers usa";l&&(p=n.scope="usa");var g=n._isScoped=p!=="world",x=n._isSatellite=T==="satellite",A=n._isConic=T.indexOf("conic")!==-1||T==="albers",M=n._isClipped=!!E.lonaxisSpan[T];if(o.visible===!1){var _=h.extendDeep({},n._template);_.showcoastlines=!1,_.showcountries=!1,_.showframe=!1,_.showlakes=!1,_.showland=!1,_.showocean=!1,_.showrivers=!1,_.showsubunits=!1,_.lonaxis&&(_.lonaxis.showgrid=!1),_.lataxis&&(_.lataxis.showgrid=!1),n._template=_}for(var w=i("visible"),m,u=0;u0&&j<0&&(j+=360);var Z=(U+j)/2,re;if(!l){var fe=g?v.projRotate:[Z,0,0];re=i("projection.rotation.lon",fe[0]),i("projection.rotation.lat",fe[1]),i("projection.rotation.roll",fe[2]),m=i("showcoastlines",!g&&w),m&&(i("coastlinecolor"),i("coastlinewidth")),m=i("showocean",w?void 0:!1),m&&i("oceancolor")}var le,ce;if(l?(le=-96.6,ce=38.7):(le=g?Z:re,ce=(R[0]+R[1])/2),i("center.lon",le),i("center.lat",ce),x&&(i("projection.tilt"),i("projection.distance")),A){var V=v.projParallels||[0,60];i("projection.parallels",V)}i("projection.scale"),m=i("showland",w?void 0:!1),m&&i("landcolor"),m=i("showlakes",w?void 0:!1),m&&i("lakecolor"),m=i("showrivers",w?void 0:!1),m&&(i("rivercolor"),i("riverwidth")),m=i("showcountries",g&&p!=="usa"&&w),m&&(i("countrycolor"),i("countrywidth")),(p==="usa"||p==="north america"&&c===50)&&(i("showsubunits",w),i("subunitcolor"),i("subunitwidth")),g||(m=i("showframe",w),m&&(i("framecolor"),i("framewidth"))),i("bgcolor");var ee=i("fitbounds");ee&&(delete n.projection.scale,g?(delete n.center.lon,delete n.center.lat):M?(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon,delete n.projection.rotation.lat,delete n.lonaxis.range,delete n.lataxis.range):(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon))}}}),IC=Ge({"src/plots/geo/index.js"(K,G){var h=Bd().getSubplotCalcData,b=_n().counterRegex,S=LI(),E="geo",e=b(E),t={};t[E]={valType:"subplotid",dflt:E,editType:"calc"};function r(i){for(var a=i._fullLayout,s=i.calcdata,f=a._subplots[E],c=0;c")}}}}),zE=Ge({"src/traces/choropleth/event_data.js"(K,G){G.exports=function(b,S,E,e,t){b.location=S.location,b.z=S.z;var r=e[t];return r.fIn&&r.fIn.properties&&(b.properties=r.fIn.properties),b.ct=r.ct,b}}}),OE=Ge({"src/traces/choropleth/select.js"(K,G){G.exports=function(b,S){var E=b.cd,e=b.xaxis,t=b.yaxis,r=[],o,n,i,a,s;if(S===!1)for(o=0;o=Math.min(j,Z)&&T<=Math.max(j,Z)?0:1/0}if(L=Math.min(re,fe)&&l<=Math.max(re,fe)?0:1/0}N=Math.sqrt(L*L+z*z),u=x[I]}}}else for(I=x.length-1;I>-1;I--)m=x[I],d=p[m],y=v[m],L=f.c2p(d)-T,z=c.c2p(y)-l,F=Math.sqrt(L*L+z*z),F100},K.isDotSymbol=function(h){return typeof h=="string"?G.DOT_RE.test(h):h>200}}}),FI=Ge({"src/traces/scattergl/defaults.js"(K,G){var h=_n(),b=Ro(),S=BE(),E=nS(),e=c0(),t=uu(),r=qp(),o=Vp(),n=Jd(),i=Hp(),a=Nd(),s=op();G.exports=function(c,p,v,T){function l(u,d){return h.coerce(c,p,E,u,d)}var g=c.marker?S.isOpenSymbol(c.marker.symbol):!1,x=t.isBubble(c),A=r(c,p,T,l);if(!A){p.visible=!1;return}o(c,p,T,l),l("xhoverformat"),l("yhoverformat");var M=A>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p>=0?(s=f,a=f-1):i=f+1}return s}function b(r,o,n,i,a){for(var s=a+1;i<=a;){var f=i+a>>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p>0?(s=f,a=f-1):i=f+1}return s}function S(r,o,n,i,a){for(var s=i-1;i<=a;){var f=i+a>>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p<0?(s=f,i=f+1):a=f-1}return s}function E(r,o,n,i,a){for(var s=i-1;i<=a;){var f=i+a>>>1,c=r[f],p=n!==void 0?n(c,o):c-o;p<=0?(s=f,i=f+1):a=f-1}return s}function e(r,o,n,i,a){for(;i<=a;){var s=i+a>>>1,f=r[s],c=n!==void 0?n(f,o):f-o;if(c===0)return s;c<=0?i=s+1:a=s-1}return-1}function t(r,o,n,i,a,s){return typeof n=="function"?s(r,o,n,i===void 0?0:i|0,a===void 0?r.length-1:a|0):s(r,o,void 0,n===void 0?0:n|0,i===void 0?r.length-1:i|0)}G.exports={ge:function(r,o,n,i,a){return t(r,o,n,i,a,h)},gt:function(r,o,n,i,a){return t(r,o,n,i,a,b)},lt:function(r,o,n,i,a){return t(r,o,n,i,a,S)},le:function(r,o,n,i,a){return t(r,o,n,i,a,E)},eq:function(r,o,n,i,a){return t(r,o,n,i,a,e)}}}}),Og=Ge({"node_modules/pick-by-alias/index.js"(K,G){G.exports=function(E,e,t){var r={},o,n;if(typeof e=="string"&&(e=b(e)),Array.isArray(e)){var i={};for(n=0;n1&&(S=arguments),typeof S=="string"?S=S.split(/\s/).map(parseFloat):typeof S=="number"&&(S=[S]),S.length&&typeof S[0]=="number"?S.length===1?E={width:S[0],height:S[0],x:0,y:0}:S.length===2?E={width:S[0],height:S[1],x:0,y:0}:E={x:S[0],y:S[1],width:S[2]-S[0]||0,height:S[3]-S[1]||0}:S&&(S=h(S,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),E={x:S.left||0,y:S.top||0},S.width==null?S.right?E.width=S.right-E.x:E.width=0:E.width=S.width,S.height==null?S.bottom?E.height=S.bottom-E.y:E.height=0:E.height=S.height),E}}}),$b=Ge({"node_modules/array-bounds/index.js"(K,G){G.exports=h;function h(b,S){if(!b||b.length==null)throw Error("Argument should be an array");S==null?S=1:S=Math.floor(S);for(var E=Array(S*2),e=0;et&&(t=b[o]),b[o]>>1,x;p.dtype||(p.dtype="array"),typeof p.dtype=="string"?x=new(n(p.dtype))(g):p.dtype&&(x=p.dtype,Array.isArray(x)&&(x.length=g));for(let L=0;Lv||R>a){for(let ue=0;ueie||Z>de||re=le||H===ae)return;let Se=A[te];ae===void 0&&(ae=Se.length);for(let Pe=H;Pe=N&&pe<=R&&Ne>=B&&Ne<=U&&ce.push(Ae)}let Le=M[te],Fe=Le[H*4+0],ze=Le[H*4+1],Ye=Le[H*4+2],st=Le[H*4+3],ct=ee(Le,H+1),at=ue*.5,et=te+1;V(ne,$,at,et,Fe,ze||Ye||st||ct),V(ne,$+at,at,et,ze,Ye||st||ct),V(ne+at,$,at,et,Ye,st||ct),V(ne+at,$+at,at,et,st,ct)}function ee(ne,$){let ue=null,te=0;for(;ue===null;)if(ue=ne[$*4+te],te++,te>ne.length)return null;return ue}return ce}function y(L,z,F,N,B){let R=[];for(let U=0;U1&&(c=1),c<-1&&(c=-1),f*Math.acos(c)},t=function(n,i,a,s,f,c,p,v,T,l,g,x){var A=Math.pow(f,2),M=Math.pow(c,2),_=Math.pow(g,2),w=Math.pow(x,2),m=A*M-A*w-M*_;m<0&&(m=0),m/=A*w+M*_,m=Math.sqrt(m)*(p===v?-1:1);var u=m*f/c*x,d=m*-c/f*g,y=l*u-T*d+(n+a)/2,I=T*u+l*d+(i+s)/2,L=(g-u)/f,z=(x-d)/c,F=(-g-u)/f,N=(-x-d)/c,B=e(1,0,L,z),R=e(L,z,F,N);return v===0&&R>0&&(R-=b),v===1&&R<0&&(R+=b),[y,I,B,R]},r=function(n){var i=n.px,a=n.py,s=n.cx,f=n.cy,c=n.rx,p=n.ry,v=n.xAxisRotation,T=v===void 0?0:v,l=n.largeArcFlag,g=l===void 0?0:l,x=n.sweepFlag,A=x===void 0?0:x,M=[];if(c===0||p===0)return[];var _=Math.sin(T*b/360),w=Math.cos(T*b/360),m=w*(i-s)/2+_*(a-f)/2,u=-_*(i-s)/2+w*(a-f)/2;if(m===0&&u===0)return[];c=Math.abs(c),p=Math.abs(p);var d=Math.pow(m,2)/Math.pow(c,2)+Math.pow(u,2)/Math.pow(p,2);d>1&&(c*=Math.sqrt(d),p*=Math.sqrt(d));var y=t(i,a,s,f,c,p,g,A,_,w,m,u),I=h(y,4),L=I[0],z=I[1],F=I[2],N=I[3],B=Math.abs(N)/(b/4);Math.abs(1-B)<1e-7&&(B=1);var R=Math.max(Math.ceil(B),1);N/=R;for(var U=0;U4?(o=l[l.length-4],n=l[l.length-3]):(o=c,n=p),r.push(l)}return r}function S(e,t,r,o){return["C",e,t,r,o,r,o]}function E(e,t,r,o,n,i){return["C",e/3+2/3*r,t/3+2/3*o,n/3+2/3*r,i/3+2/3*o,n,i]}}}),OC=Ge({"node_modules/is-svg-path/index.js"(K,G){G.exports=function(b){return typeof b!="string"?!1:(b=b.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(b)&&/[\dz]$/i.test(b)&&b.length>4))}}}),XI=Ge({"node_modules/svg-path-bounds/index.js"(K,G){var h=lm(),b=zC(),S=GI(),E=OC(),e=Ey();G.exports=t;function t(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(e(E(r),"String is not an SVG path."),r=h(r)),e(Array.isArray(r),"Argument should be a string or an array of path segments."),r=b(r),r=S(r),!r.length)return[0,0,0,0];for(var o=[1/0,1/0,-1/0,-1/0],n=0,i=r.length;no[2]&&(o[2]=a[s+0]),a[s+1]>o[3]&&(o[3]=a[s+1]);return o}}}),YI=Ge({"node_modules/normalize-svg-path/index.js"(K,G){var h=Math.PI,b=o(120);G.exports=S;function S(n){for(var i,a=[],s=0,f=0,c=0,p=0,v=null,T=null,l=0,g=0,x=0,A=n.length;x7&&(a.push(M.splice(0,7)),M.unshift("C"));break;case"S":var w=l,m=g;(i=="C"||i=="S")&&(w+=w-s,m+=m-f),M=["C",w,m,M[1],M[2],M[3],M[4]];break;case"T":i=="Q"||i=="T"?(v=l*2-v,T=g*2-T):(v=l,T=g),M=e(l,g,v,T,M[1],M[2]);break;case"Q":v=M[1],T=M[2],M=e(l,g,M[1],M[2],M[3],M[4]);break;case"L":M=E(l,g,M[1],M[2]);break;case"H":M=E(l,g,M[1],g);break;case"V":M=E(l,g,l,M[1]);break;case"Z":M=E(l,g,c,p);break}i=_,l=M[M.length-2],g=M[M.length-1],M.length>4?(s=M[M.length-4],f=M[M.length-3]):(s=l,f=g),a.push(M)}return a}function E(n,i,a,s){return["C",n,i,a,s,a,s]}function e(n,i,a,s,f,c){return["C",n/3+2/3*a,i/3+2/3*s,f/3+2/3*a,c/3+2/3*s,f,c]}function t(n,i,a,s,f,c,p,v,T,l){if(l)y=l[0],I=l[1],u=l[2],d=l[3];else{var g=r(n,i,-f);n=g.x,i=g.y,g=r(v,T,-f),v=g.x,T=g.y;var x=(n-v)/2,A=(i-T)/2,M=x*x/(a*a)+A*A/(s*s);M>1&&(M=Math.sqrt(M),a=M*a,s=M*s);var _=a*a,w=s*s,m=(c==p?-1:1)*Math.sqrt(Math.abs((_*w-_*A*A-w*x*x)/(_*A*A+w*x*x)));m==1/0&&(m=1);var u=m*a*A/s+(n+v)/2,d=m*-s*x/a+(i+T)/2,y=Math.asin(((i-d)/s).toFixed(9)),I=Math.asin(((T-d)/s).toFixed(9));y=nI&&(y=y-h*2),!p&&I>y&&(I=I-h*2)}if(Math.abs(I-y)>b){var L=I,z=v,F=T;I=y+b*(p&&I>y?1:-1),v=u+a*Math.cos(I),T=d+s*Math.sin(I);var N=t(v,T,a,s,f,0,p,z,F,[I,L,u,d])}var B=Math.tan((I-y)/4),R=4/3*a*B,U=4/3*s*B,j=[2*n-(n+R*Math.sin(y)),2*i-(i-U*Math.cos(y)),v+R*Math.sin(I),T-U*Math.cos(I),v,T];if(l)return j;N&&(j=j.concat(N));for(var Z=0;Z0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(v)),r.translate(f*.5,c*.5),r.scale(g,g),i()){var x=new Path2D(a);r.fill(x),v&&r.stroke(x)}else{var A=b(a);S(r,A),r.fill(),v&&r.stroke()}r.setTransform(1,0,0,1,0,0);var M=e(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:p*.5});return M}var n;function i(){if(n!=null)return n;var a=document.createElement("canvas").getContext("2d");if(a.canvas.width=a.canvas.height=1,!window.Path2D)return n=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");a.fillStyle="black",a.fill(s);var f=a.getImageData(0,0,1,1);return n=f&&f.data&&f.data[3]===255}}}),Jb=Ge({"src/traces/scattergl/convert.js"(K,G){var h=Ei(),b=$I(),S=D_(),E=Ro(),e=_n(),t=e.isArrayOrTypedArray,r=As(),o=Df(),n=Xy().formatColor,i=uu(),a=Bp(),s=BE(),f=B_(),c=kv().DESELECTDIM,p={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},v=Kd().appendArrayPointValue;function T(N,B){var R,U={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},j=N._context.plotGlPixelRatio;if(B.visible!==!0)return U;if(i.hasText(B)&&(U.text=l(N,B),U.textSel=M(N,B,B.selected),U.textUnsel=M(N,B,B.unselected)),i.hasMarkers(B)&&(U.marker=x(N,B),U.markerSel=A(N,B,B.selected),U.markerUnsel=A(N,B,B.unselected),!B.unselected&&t(B.marker.opacity))){var Z=B.marker.opacity;for(U.markerUnsel.opacity=new Array(Z.length),R=0;R500?"bold":"normal":N}function x(N,B){var R=B._length,U=B.marker,j={},Z,re=t(U.symbol),fe=t(U.angle),le=t(U.color),ce=t(U.line.color),V=t(U.opacity),ee=t(U.size),ne=t(U.line.width),$;if(re||($=s.isOpenSymbol(U.symbol)),re||le||ce||V||fe){j.symbols=new Array(R),j.angles=new Array(R),j.colors=new Array(R),j.borderColors=new Array(R);var ue=U.symbol,te=U.angle,H=n(U,U.opacity,R),ae=n(U.line,U.opacity,R);if(!t(ae[0])){var ie=ae;for(ae=Array(R),Z=0;Zf.TOO_MANY_POINTS||i.hasMarkers(B)?"rect":"round";if(ce&&B.connectgaps){var ee=Z[0],ne=Z[1];for(re=0;re1?le[re]:le[0]:le,$=t(ce)?ce.length>1?ce[re]:ce[0]:ce,ue=p[ne],te=p[$],H=V?V/.8+1:0,ae=-te*H-te*.5;Z.offset[re]=[ue*H/ee,ae/ee]}}return Z}G.exports={style:T,markerStyle:x,markerSelection:A,linePositions:L,errorBarPositions:z,textPosition:F}}}),FC=Ge({"src/traces/scattergl/scene_update.js"(K,G){var h=_n();G.exports=function(S,E){var e=E._scene,t={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},r={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return E._scene||(e=E._scene={},e.init=function(){h.extendFlat(e,r,t)},e.init(),e.update=function(n){var i=h.repeat(n,e.count);if(e.fill2d&&e.fill2d.update(i),e.scatter2d&&e.scatter2d.update(i),e.line2d&&e.line2d.update(i),e.error2d&&e.error2d.update(i.concat(i)),e.select2d&&e.select2d.update(i),e.glText)for(var a=0;a=c,u=w*2,d={},y,I=A.makeCalcdata(g,"x"),L=M.makeCalcdata(g,"y"),z=e(g,A,"x",I),F=e(g,M,"y",L),N=z.vals,B=F.vals;g._x=N,g._y=B,g.xperiodalignment&&(g._origX=I,g._xStarts=z.starts,g._xEnds=z.ends),g.yperiodalignment&&(g._origY=L,g._yStarts=F.starts,g._yEnds=F.ends);var R=new Array(u),U=new Array(w);for(y=0;y1&&b.extendFlat(_.line,a.linePositions(T,g,x)),_.errorX||_.errorY){var w=a.errorBarPositions(T,g,x,A,M);_.errorX&&b.extendFlat(_.errorX,w.x),_.errorY&&b.extendFlat(_.errorY,w.y)}return _.text&&(b.extendFlat(_.text,{positions:x},a.textPosition(T,g,_.text,_.marker)),b.extendFlat(_.textSel,{positions:x},a.textPosition(T,g,_.text,_.markerSel)),b.extendFlat(_.textUnsel,{positions:x},a.textPosition(T,g,_.text,_.markerUnsel))),_}}}),BC=Ge({"src/traces/scattergl/edit_style.js"(K,G){var h=_n(),b=go(),S=kv().DESELECTDIM;function E(e){var t=e[0],r=t.trace,o=t.t,n=o._scene,i=o.index,a=n.selectBatch[i],s=n.unselectBatch[i],f=n.textOptions[i],c=n.textSelectedOptions[i]||{},p=n.textUnselectedOptions[i]||{},v=h.extendFlat({},f),T,l;if(a.length||s.length){var g=c.color,x=p.color,A=f.color,M=h.isArrayOrTypedArray(A);for(v.color=new Array(r._length),T=0;T>>24,r=(E&16711680)>>>16,o=(E&65280)>>>8,n=E&255;return e===!1?[t,r,o,n]:[t/255,r/255,o/255,n/255]}}}),Ad=Ge({"node_modules/object-assign/index.js"(K,G){var h=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;function E(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function e(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var r={},o=0;o<10;o++)r["_"+String.fromCharCode(o)]=o;var n=Object.getOwnPropertyNames(r).map(function(a){return r[a]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(a){i[a]=a}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}G.exports=e()?Object.assign:function(t,r){for(var o,n=E(t),i,a=1;ad.length)&&(y=d.length);for(var I=0,L=new Array(y);ITe)?Qe.tree=c(nt,{bounds:rt}):Te&&Te.length&&(Qe.tree=Te),Qe.tree){var Ft={primitive:"points",usage:"static",data:Qe.tree,type:"uint32"};Qe.elements?Qe.elements(Ft):Qe.elements=N.elements(Ft)}var Nt=A.float32(nt);pe({data:Nt,usage:"dynamic"});var $t=A.fract32(nt,Nt);return Ne({data:$t,usage:"dynamic"}),ot({data:new Uint8Array(ft),type:"uint8",usage:"stream"}),nt}},{marker:function(nt,Qe,Le){var Te=Qe.activation;if(Te.forEach(function($t){return $t&&$t.destroy&&$t.destroy()}),Te.length=0,!nt||typeof nt[0]=="number"){var pe=v.addMarker(nt);Te[pe]=!0}else{for(var Ne=[],ot=0,ft=Math.min(nt.length,Qe.count);ot=0)return z;var F;if(v instanceof Uint8Array||v instanceof Uint8ClampedArray)F=v;else{F=new Uint8Array(v.length);for(var N=0,B=v.length;NL*4&&(this.tooManyColors=!0),this.updatePalette(I),z.length===1?z[0]:z},w.prototype.updatePalette=function(v){if(!this.tooManyColors){var y=this.maxColors,I=this.paletteTexture,L=Math.ceil(v.length*.25/y);if(L>1){v=v.slice();for(var z=v.length*.25%y;z80*R){fe=ce=N[0],le=V=N[1];for(var ue=R;uece&&(ce=ee),ne>V&&(V=ne);K=Math.max(ce-fe,V-le),K=K!==0?32767/K:0}return E(Z,re,R,fe,le,K,0),re}function b(N,B,R,U,j){var Z,re;if(j===F(N,B,R,U)>0)for(Z=B;Z=B;Z-=U)re=I(Z,N[Z],N[Z+1],re);return re&&A(re,re.next)&&(L(re),re=re.next),re}function S(N,B){if(!N)return N;B||(B=N);var R=N,U;do if(U=!1,!R.steiner&&(A(R,R.next)||x(R.prev,R,R.next)===0)){if(L(R),R=B=R.prev,R===R.next)break;U=!0}else R=R.next;while(U||R!==B);return B}function E(N,B,R,U,j,Z,re){if(N){!re&&Z&&c(N,U,j,Z);for(var fe=N,le,ce;N.prev!==N.next;){if(le=N.prev,ce=N.next,Z?t(N,U,j,Z):e(N)){B.push(le.i/R|0),B.push(N.i/R|0),B.push(ce.i/R|0),L(N),N=ce.next,fe=ce.next;continue}if(N=ce,N===fe){re?re===1?(N=r(S(N),B,R),E(N,B,R,U,j,Z,2)):re===2&&o(N,B,R,U,j,Z):E(S(N),B,R,U,j,Z,1);break}}}}function e(N){var B=N.prev,R=N,U=N.next;if(x(B,R,U)>=0)return!1;for(var j=B.x,Z=R.x,re=U.x,fe=B.y,le=R.y,ce=U.y,V=jZ?j>re?j:re:Z>re?Z:re,K=fe>le?fe>ce?fe:ce:le>ce?le:ce,ue=U.next;ue!==B;){if(ue.x>=V&&ue.x<=ne&&ue.y>=ee&&ue.y<=K&&l(j,fe,Z,le,re,ce,ue.x,ue.y)&&x(ue.prev,ue,ue.next)>=0)return!1;ue=ue.next}return!0}function t(N,B,R,U){var j=N.prev,Z=N,re=N.next;if(x(j,Z,re)>=0)return!1;for(var fe=j.x,le=Z.x,ce=re.x,V=j.y,ee=Z.y,ne=re.y,K=fele?fe>ce?fe:ce:le>ce?le:ce,H=V>ee?V>ne?V:ne:ee>ne?ee:ne,ae=d(K,ue,B,R,U),ie=d(te,H,B,R,U),ve=N.prevZ,Ae=N.nextZ;ve&&ve.z>=ae&&Ae&&Ae.z<=ie;){if(ve.x>=K&&ve.x<=te&&ve.y>=ue&&ve.y<=H&&ve!==j&&ve!==re&&l(fe,V,le,ee,ce,ne,ve.x,ve.y)&&x(ve.prev,ve,ve.next)>=0||(ve=ve.prevZ,Ae.x>=K&&Ae.x<=te&&Ae.y>=ue&&Ae.y<=H&&Ae!==j&&Ae!==re&&l(fe,V,le,ee,ce,ne,Ae.x,Ae.y)&&x(Ae.prev,Ae,Ae.next)>=0))return!1;Ae=Ae.nextZ}for(;ve&&ve.z>=ae;){if(ve.x>=K&&ve.x<=te&&ve.y>=ue&&ve.y<=H&&ve!==j&&ve!==re&&l(fe,V,le,ee,ce,ne,ve.x,ve.y)&&x(ve.prev,ve,ve.next)>=0)return!1;ve=ve.prevZ}for(;Ae&&Ae.z<=ie;){if(Ae.x>=K&&Ae.x<=te&&Ae.y>=ue&&Ae.y<=H&&Ae!==j&&Ae!==re&&l(fe,V,le,ee,ce,ne,Ae.x,Ae.y)&&x(Ae.prev,Ae,Ae.next)>=0)return!1;Ae=Ae.nextZ}return!0}function r(N,B,R){var U=N;do{var j=U.prev,Z=U.next.next;!A(j,Z)&&M(j,U,U.next,Z)&&u(j,Z)&&u(Z,j)&&(B.push(j.i/R|0),B.push(U.i/R|0),B.push(Z.i/R|0),L(U),L(U.next),U=N=Z),U=U.next}while(U!==N);return S(U)}function o(N,B,R,U,j,Z){var re=N;do{for(var fe=re.next.next;fe!==re.prev;){if(re.i!==fe.i&&g(re,fe)){var le=y(re,fe);re=S(re,re.next),le=S(le,le.next),E(re,B,R,U,j,Z,0),E(le,B,R,U,j,Z,0);return}fe=fe.next}re=re.next}while(re!==N)}function n(N,B,R,U){var j=[],Z,re,fe,le,ce;for(Z=0,re=B.length;Z=R.next.y&&R.next.y!==R.y){var fe=R.x+(j-R.y)*(R.next.x-R.x)/(R.next.y-R.y);if(fe<=U&&fe>Z&&(Z=fe,re=R.x=R.x&&R.x>=ce&&U!==R.x&&l(jre.x||R.x===re.x&&f(re,R)))&&(re=R,ee=ne)),R=R.next;while(R!==le);return re}function f(N,B){return x(N.prev,N,B.prev)<0&&x(B.next,N,N.next)<0}function c(N,B,R,U){var j=N;do j.z===0&&(j.z=d(j.x,j.y,B,R,U)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==N);j.prevZ.nextZ=null,j.prevZ=null,p(j)}function p(N){var B,R,U,j,Z,re,fe,le,ce=1;do{for(R=N,N=null,Z=null,re=0;R;){for(re++,U=R,fe=0,B=0;B0||le>0&&U;)fe!==0&&(le===0||!U||R.z<=U.z)?(j=R,R=R.nextZ,fe--):(j=U,U=U.nextZ,le--),Z?Z.nextZ=j:N=j,j.prevZ=Z,Z=j;R=U}Z.nextZ=null,ce*=2}while(re>1);return N}function d(N,B,R,U,j){return N=(N-R)*j|0,B=(B-U)*j|0,N=(N|N<<8)&16711935,N=(N|N<<4)&252645135,N=(N|N<<2)&858993459,N=(N|N<<1)&1431655765,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,N|B<<1}function T(N){var B=N,R=N;do(B.x=(N-re)*(Z-fe)&&(N-re)*(U-fe)>=(R-re)*(B-fe)&&(R-re)*(Z-fe)>=(j-re)*(U-fe)}function g(N,B){return N.next.i!==B.i&&N.prev.i!==B.i&&!m(N,B)&&(u(N,B)&&u(B,N)&&v(N,B)&&(x(N.prev,N,B.prev)||x(N,B.prev,B))||A(N,B)&&x(N.prev,N,N.next)>0&&x(B.prev,B,B.next)>0)}function x(N,B,R){return(B.y-N.y)*(R.x-B.x)-(B.x-N.x)*(R.y-B.y)}function A(N,B){return N.x===B.x&&N.y===B.y}function M(N,B,R,U){var j=w(x(N,B,R)),Z=w(x(N,B,U)),re=w(x(R,U,N)),fe=w(x(R,U,B));return!!(j!==Z&&re!==fe||j===0&&_(N,R,B)||Z===0&&_(N,U,B)||re===0&&_(R,N,U)||fe===0&&_(R,B,U))}function _(N,B,R){return B.x<=Math.max(N.x,R.x)&&B.x>=Math.min(N.x,R.x)&&B.y<=Math.max(N.y,R.y)&&B.y>=Math.min(N.y,R.y)}function w(N){return N>0?1:N<0?-1:0}function m(N,B){var R=N;do{if(R.i!==N.i&&R.next.i!==N.i&&R.i!==B.i&&R.next.i!==B.i&&M(R,R.next,N,B))return!0;R=R.next}while(R!==N);return!1}function u(N,B){return x(N.prev,N,N.next)<0?x(N,B,N.next)>=0&&x(N,N.prev,B)>=0:x(N,B,N.prev)<0||x(N,N.next,B)<0}function v(N,B){var R=N,U=!1,j=(N.x+B.x)/2,Z=(N.y+B.y)/2;do R.y>Z!=R.next.y>Z&&R.next.y!==R.y&&j<(R.next.x-R.x)*(Z-R.y)/(R.next.y-R.y)+R.x&&(U=!U),R=R.next;while(R!==N);return U}function y(N,B){var R=new z(N.i,N.x,N.y),U=new z(B.i,B.x,B.y),j=N.next,Z=B.prev;return N.next=B,B.prev=N,R.next=j,j.prev=R,U.next=R,R.prev=U,Z.next=U,U.prev=Z,U}function I(N,B,R,U){var j=new z(N,B,R);return U?(j.next=U.next,j.prev=U,U.next.prev=j,U.next=j):(j.prev=j,j.next=j),j}function L(N){N.next.prev=N.prev,N.prev.next=N.next,N.prevZ&&(N.prevZ.nextZ=N.nextZ),N.nextZ&&(N.nextZ.prevZ=N.prevZ)}function z(N,B,R){this.i=N,this.x=B,this.y=R,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}h.deviation=function(N,B,R,U){var j=B&&B.length,Z=j?B[0]*R:N.length,re=Math.abs(F(N,0,Z,R));if(j)for(var fe=0,le=B.length;fe0&&(U+=N[j-1].length,R.holes.push(U))}return R}}}),RR=Ge({"node_modules/array-normalize/index.js"($,G){var h=Yb();G.exports=b;function b(S,E,e){if(!S||S.length==null)throw Error("Argument should be an array");E==null&&(E=1),e==null&&(e=h(S,E));for(var t=0;t-1}}}),fC=Ge({"node_modules/es5-ext/string/#/contains/index.js"($,G){G.exports=GR()()?String.prototype.contains:XR()}}),Hy=Ge({"node_modules/d/index.js"($,G){var h=Kb(),b=uC(),S=SE(),E=cC(),e=fC(),t=G.exports=function(r,o){var n,i,a,s,f;return arguments.length<2||typeof r!="string"?(s=o,o=r,r=null):s=arguments[2],h(r)?(n=e.call(r,"c"),i=e.call(r,"e"),a=e.call(r,"w")):(n=a=!0,i=!1),f={value:o,configurable:n,enumerable:i,writable:a},s?S(E(s),f):f};t.gs=function(r,o,n){var i,a,s,f;return typeof r!="string"?(s=n,n=o,o=r,r=null):s=arguments[3],h(o)?b(o)?h(n)?b(n)||(s=n,n=void 0):n=void 0:(s=o,o=n=void 0):o=void 0,h(r)?(i=e.call(r,"c"),a=e.call(r,"e")):(i=!0,a=!1),f={get:o,set:n,configurable:i,enumerable:a},s?S(E(s),f):f}}}),WA=Ge({"node_modules/es5-ext/function/is-arguments.js"($,G){var h=Object.prototype.toString,b=h.call((function(){return arguments})());G.exports=function(S){return h.call(S)===b}}}),KA=Ge({"node_modules/es5-ext/string/is-string.js"($,G){var h=Object.prototype.toString,b=h.call("");G.exports=function(S){return typeof S=="string"||S&&typeof S=="object"&&(S instanceof String||h.call(S)===b)||!1}}}),YR=Ge({"node_modules/ext/global-this/is-implemented.js"($,G){G.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),ZR=Ge({"node_modules/ext/global-this/implementation.js"($,G){var h=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};G.exports=(function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return h()}try{return __global__||h()}finally{delete Object.prototype.__global__}})()}}),$A=Ge({"node_modules/ext/global-this/index.js"($,G){G.exports=YR()()?globalThis:ZR()}}),WR=Ge({"node_modules/es6-symbol/is-implemented.js"($,G){var h=$A(),b={object:!0,symbol:!0};G.exports=function(){var S=h.Symbol,E;if(typeof S!="function")return!1;E=S("test symbol");try{String(E)}catch{return!1}return!(!b[typeof S.iterator]||!b[typeof S.toPrimitive]||!b[typeof S.toStringTag])}}}),KR=Ge({"node_modules/es6-symbol/is-symbol.js"($,G){G.exports=function(h){return h?typeof h=="symbol"?!0:!h.constructor||h.constructor.name!=="Symbol"?!1:h[h.constructor.toStringTag]==="Symbol":!1}}}),hC=Ge({"node_modules/es6-symbol/validate-symbol.js"($,G){var h=KR();G.exports=function(b){if(!h(b))throw new TypeError(b+" is not a symbol");return b}}}),$R=Ge({"node_modules/es6-symbol/lib/private/generate-name.js"($,G){var h=Hy(),b=Object.create,S=Object.defineProperty,E=Object.prototype,e=b(null);G.exports=function(t){for(var r=0,o,n;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,o="@@"+t,S(E,o,h.gs(null,function(i){n||(n=!0,S(this,o,h(i)),n=!1)})),o}}}),JR=Ge({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"($,G){var h=Hy(),b=$A().Symbol;G.exports=function(S){return Object.defineProperties(S,{hasInstance:h("",b&&b.hasInstance||S("hasInstance")),isConcatSpreadable:h("",b&&b.isConcatSpreadable||S("isConcatSpreadable")),iterator:h("",b&&b.iterator||S("iterator")),match:h("",b&&b.match||S("match")),replace:h("",b&&b.replace||S("replace")),search:h("",b&&b.search||S("search")),species:h("",b&&b.species||S("species")),split:h("",b&&b.split||S("split")),toPrimitive:h("",b&&b.toPrimitive||S("toPrimitive")),toStringTag:h("",b&&b.toStringTag||S("toStringTag")),unscopables:h("",b&&b.unscopables||S("unscopables"))})}}}),QR=Ge({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"($,G){var h=Hy(),b=hC(),S=Object.create(null);G.exports=function(E){return Object.defineProperties(E,{for:h(function(e){return S[e]?S[e]:S[e]=E(String(e))}),keyFor:h(function(e){var t;b(e);for(t in S)if(S[t]===e)return t})})}}}),eI=Ge({"node_modules/es6-symbol/polyfill.js"($,G){var h=Hy(),b=hC(),S=$A().Symbol,E=$R(),e=JR(),t=QR(),r=Object.create,o=Object.defineProperties,n=Object.defineProperty,i,a,s;if(typeof S=="function")try{String(S()),s=!0}catch{}else S=null;a=function(c){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return i(c)},G.exports=i=function f(c){var p;if(this instanceof f)throw new TypeError("Symbol is not a constructor");return s?S(c):(p=r(a.prototype),c=c===void 0?"":String(c),o(p,{__description__:h("",c),__name__:h("",E(c))}))},e(i),t(i),o(a.prototype,{constructor:h(i),toString:h("",function(){return this.__name__})}),o(i.prototype,{toString:h(function(){return"Symbol ("+b(this).__description__+")"}),valueOf:h(function(){return b(this)})}),n(i.prototype,i.toPrimitive,h("",function(){var f=b(this);return typeof f=="symbol"?f:f.toString()})),n(i.prototype,i.toStringTag,h("c","Symbol")),n(a.prototype,i.toStringTag,h("c",i.prototype[i.toStringTag])),n(a.prototype,i.toPrimitive,h("c",i.prototype[i.toPrimitive]))}}),O_=Ge({"node_modules/es6-symbol/index.js"($,G){G.exports=WR()()?$A().Symbol:eI()}}),tI=Ge({"node_modules/es5-ext/array/#/clear.js"($,G){var h=Vy();G.exports=function(){return h(this).length=0,this}}}),U3=Ge({"node_modules/es5-ext/object/valid-callable.js"($,G){G.exports=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h}}}),rI=Ge({"node_modules/type/string/coerce.js"($,G){var h=Kb(),b=AE(),S=Object.prototype.toString;G.exports=function(E){if(!h(E))return null;if(b(E)){var e=E.toString;if(typeof e!="function"||e===S)return null}try{return""+E}catch{return null}}}}),nI=Ge({"node_modules/type/lib/safe-to-string.js"($,G){G.exports=function(h){try{return h.toString()}catch{try{return String(h)}catch{return null}}}}}),aI=Ge({"node_modules/type/lib/to-short-string.js"($,G){var h=nI(),b=/[\n\r\u2028\u2029]/g;G.exports=function(S){var E=h(S);return E===null?"":(E.length>100&&(E=E.slice(0,99)+"…"),E=E.replace(b,function(e){switch(e){case` -`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),E)}}}),vC=Ge({"node_modules/type/lib/resolve-exception.js"($,G){var h=Kb(),b=AE(),S=rI(),E=aI(),e=function(t,r){return t.replace("%v",E(r))};G.exports=function(t,r,o){if(!b(o))throw new TypeError(e(r,t));if(!h(t)){if("default"in o)return o.default;if(o.isOptional)return null}var n=S(o.errorMessage);throw h(n)||(n=r),new TypeError(e(n,t))}}}),iI=Ge({"node_modules/type/value/ensure.js"($,G){var h=vC(),b=Kb();G.exports=function(S){return b(S)?S:h(S,"Cannot use %v",arguments[1])}}}),oI=Ge({"node_modules/type/plain-function/ensure.js"($,G){var h=vC(),b=uC();G.exports=function(S){return b(S)?S:h(S,"%v is not a plain function",arguments[1])}}}),sI=Ge({"node_modules/es5-ext/array/from/is-implemented.js"($,G){G.exports=function(){var h=Array.from,b,S;return typeof h!="function"?!1:(b=["raz","dwa"],S=h(b),!!(S&&S!==b&&S[1]==="dwa"))}}}),lI=Ge({"node_modules/es5-ext/function/is-function.js"($,G){var h=Object.prototype.toString,b=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);G.exports=function(S){return typeof S=="function"&&b(h.call(S))}}}),uI=Ge({"node_modules/es5-ext/math/sign/is-implemented.js"($,G){G.exports=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1}}}),cI=Ge({"node_modules/es5-ext/math/sign/shim.js"($,G){G.exports=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}}}),fI=Ge({"node_modules/es5-ext/math/sign/index.js"($,G){G.exports=uI()()?Math.sign:cI()}}),hI=Ge({"node_modules/es5-ext/number/to-integer.js"($,G){var h=fI(),b=Math.abs,S=Math.floor;G.exports=function(E){return isNaN(E)?0:(E=Number(E),E===0||!isFinite(E)?E:h(E)*S(b(E)))}}}),vI=Ge({"node_modules/es5-ext/number/to-pos-integer.js"($,G){var h=hI(),b=Math.max;G.exports=function(S){return b(0,h(S))}}}),dI=Ge({"node_modules/es5-ext/array/from/shim.js"($,G){var h=O_().iterator,b=WA(),S=lI(),E=vI(),e=U3(),t=Vy(),r=z_(),o=KA(),n=Array.isArray,i=Function.prototype.call,a={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;G.exports=function(f){var c=arguments[1],p=arguments[2],d,T,l,g,x,A,M,_,w,m;if(f=Object(t(f)),r(c)&&e(c),!this||this===Array||!S(this)){if(!c){if(b(f))return x=f.length,x!==1?Array.apply(null,f):(g=new Array(1),g[0]=f[0],g);if(n(f)){for(g=new Array(x=f.length),T=0;T=55296&&A<=56319&&(m+=f[++T])),m=c?i.call(c,p,m,l):m,d?(a.value=m,s(g,l,a)):g[l]=m,++l;x=l}}if(x===void 0)for(x=E(f.length),d&&(g=new d(x)),T=0;T=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){o(this,"__redo__",e("c",[a]));return}this.__redo__.forEach(function(s,f){s>=a&&(this.__redo__[f]=++s)},this),this.__redo__.push(a)}}),_onDelete:e(function(a){var s;a>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(a),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(f,c){f>a&&(this.__redo__[c]=--f)},this)))}),_onClear:e(function(){this.__redo__&&h.call(this.__redo__),this.__nextIndex__=0})}))),o(i.prototype,r.iterator,e(function(){return this}))}}),bI=Ge({"node_modules/es6-iterator/array.js"($,G){var h=TE(),b=fC(),S=Hy(),E=O_(),e=dC(),t=Object.defineProperty,r;r=G.exports=function(o,n){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e.call(this,o),n?b.call(n,"key+value")?n="key+value":b.call(n,"key")?n="key":n="value":n="value",t(this,"__kind__",S("",n))},h&&h(r,e),delete r.prototype.constructor,r.prototype=Object.create(e.prototype,{_resolve:S(function(o){return this.__kind__==="value"?this.__list__[o]:this.__kind__==="key+value"?[o,this.__list__[o]]:o})}),t(r.prototype,E.toStringTag,S("c","Array Iterator"))}}),wI=Ge({"node_modules/es6-iterator/string.js"($,G){var h=TE(),b=Hy(),S=O_(),E=dC(),e=Object.defineProperty,t;t=G.exports=function(r){if(!(this instanceof t))throw new TypeError("Constructor requires 'new'");r=String(r),E.call(this,r),e(this,"__length__",b("",r.length))},h&&h(t,E),delete t.prototype.constructor,t.prototype=Object.create(E.prototype,{_next:b(function(){if(this.__list__){if(this.__nextIndex__=55296&&n<=56319?o+this.__list__[this.__nextIndex__++]:o)})}),e(t.prototype,S.toStringTag,b("c","String Iterator"))}}),TI=Ge({"node_modules/es6-iterator/is-iterable.js"($,G){var h=WA(),b=z_(),S=KA(),E=O_().iterator,e=Array.isArray;G.exports=function(t){return b(t)?e(t)||S(t)||h(t)?!0:typeof t[E]=="function":!1}}}),AI=Ge({"node_modules/es6-iterator/valid-iterable.js"($,G){var h=TI();G.exports=function(b){if(!h(b))throw new TypeError(b+" is not iterable");return b}}}),pC=Ge({"node_modules/es6-iterator/get.js"($,G){var h=WA(),b=KA(),S=bI(),E=wI(),e=AI(),t=O_().iterator;G.exports=function(r){return typeof e(r)[t]=="function"?r[t]():h(r)?new S(r):b(r)?new E(r):new S(r)}}}),SI=Ge({"node_modules/es6-iterator/for-of.js"($,G){var h=WA(),b=U3(),S=KA(),E=pC(),e=Array.isArray,t=Function.prototype.call,r=Array.prototype.some;G.exports=function(o,n){var i,a=arguments[2],s,f,c,p,d,T,l;if(e(o)||h(o)?i="array":S(o)?i="string":o=E(o),b(n),f=function(){c=!0},i==="array"){r.call(o,function(g){return t.call(n,a,g,f),c});return}if(i==="string"){for(d=o.length,p=0;p=55296&&l<=56319&&(T+=o[++p])),t.call(n,a,T,f),!c);++p);return}for(s=o.next();!s.done;){if(t.call(n,a,s.value,f),c)return;s=o.next()}}}}),MI=Ge({"node_modules/es6-weak-map/is-native-implemented.js"($,G){G.exports=(function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"})()}}),EI=Ge({"node_modules/es6-weak-map/polyfill.js"($,G){var h=z_(),b=TE(),S=OR(),E=Vy(),e=FR(),t=Hy(),r=pC(),o=SI(),n=O_().toStringTag,i=MI(),a=Array.isArray,s=Object.defineProperty,f=Object.prototype.hasOwnProperty,c=Object.getPrototypeOf,p;G.exports=p=function(){var d=arguments[0],T;if(!(this instanceof p))throw new TypeError("Constructor requires 'new'");return T=i&&b&&WeakMap!==p?b(new WeakMap,c(this)):this,h(d)&&(a(d)||(d=r(d))),s(T,"__weakMapData__",t("c","$weakMap$"+e())),d&&o(d,function(l){E(l),T.set(l[0],l[1])}),T},i&&(b&&b(p,WeakMap),p.prototype=Object.create(WeakMap.prototype,{constructor:t(p)})),Object.defineProperties(p.prototype,{delete:t(function(d){return f.call(S(d),this.__weakMapData__)?(delete d[this.__weakMapData__],!0):!1}),get:t(function(d){if(f.call(S(d),this.__weakMapData__))return d[this.__weakMapData__]}),has:t(function(d){return f.call(S(d),this.__weakMapData__)}),set:t(function(d,T){return s(S(d),this.__weakMapData__,t("c",T)),this}),toString:t(function(){return"[object WeakMap]"})}),s(p.prototype,n,t("c","WeakMap"))}}),mC=Ge({"node_modules/es6-weak-map/index.js"($,G){G.exports=IR()()?WeakMap:EI()}}),kI=Ge({"node_modules/array-find-index/index.js"($,G){G.exports=function(h,b,S){if(typeof Array.prototype.findIndex=="function")return h.findIndex(b,S);if(typeof b!="function")throw new TypeError("predicate must be a function");var E=Object(h),e=E.length;if(e===0)return-1;for(var t=0;tAe)?et.tree=c(at,{bounds:nt}):Ae&&Ae.length&&(et.tree=Ae),et.tree){var Ft={primitive:"points",usage:"static",data:et.tree,type:"uint32"};et.elements?et.elements(Ft):et.elements=N.elements(Ft)}var Nt=A.float32(at);pe({data:Nt,usage:"dynamic"});var Qt=A.fract32(at,Nt);return Ne({data:Qt,usage:"dynamic"}),ut({data:new Uint8Array(dt),type:"uint8",usage:"stream"}),at}},{marker:function(at,et,Pe){var Ae=et.activation;if(Ae.forEach(function(Qt){return Qt&&Qt.destroy&&Qt.destroy()}),Ae.length=0,!at||typeof at[0]=="number"){var pe=d.addMarker(at);Ae[pe]=!0}else{for(var Ne=[],ut=0,dt=Math.min(at.length,et.count);ut=0)return z;var F;if(d instanceof Uint8Array||d instanceof Uint8ClampedArray)F=d;else{F=new Uint8Array(d.length);for(var N=0,B=d.length;NL*4&&(this.tooManyColors=!0),this.updatePalette(I),z.length===1?z[0]:z},w.prototype.updatePalette=function(d){if(!this.tooManyColors){var y=this.maxColors,I=this.paletteTexture,L=Math.ceil(d.length*.25/y);if(L>1){d=d.slice();for(var z=d.length*.25%y;z80*R){fe=ce=N[0],le=V=N[1];for(var ue=R;uece&&(ce=ee),ne>V&&(V=ne);$=Math.max(ce-fe,V-le),$=$!==0?32767/$:0}return E(Z,re,R,fe,le,$,0),re}function b(N,B,R,U,j){var Z,re;if(j===F(N,B,R,U)>0)for(Z=B;Z=B;Z-=U)re=I(Z,N[Z],N[Z+1],re);return re&&A(re,re.next)&&(L(re),re=re.next),re}function S(N,B){if(!N)return N;B||(B=N);var R=N,U;do if(U=!1,!R.steiner&&(A(R,R.next)||x(R.prev,R,R.next)===0)){if(L(R),R=B=R.prev,R===R.next)break;U=!0}else R=R.next;while(U||R!==B);return B}function E(N,B,R,U,j,Z,re){if(N){!re&&Z&&c(N,U,j,Z);for(var fe=N,le,ce;N.prev!==N.next;){if(le=N.prev,ce=N.next,Z?t(N,U,j,Z):e(N)){B.push(le.i/R|0),B.push(N.i/R|0),B.push(ce.i/R|0),L(N),N=ce.next,fe=ce.next;continue}if(N=ce,N===fe){re?re===1?(N=r(S(N),B,R),E(N,B,R,U,j,Z,2)):re===2&&o(N,B,R,U,j,Z):E(S(N),B,R,U,j,Z,1);break}}}}function e(N){var B=N.prev,R=N,U=N.next;if(x(B,R,U)>=0)return!1;for(var j=B.x,Z=R.x,re=U.x,fe=B.y,le=R.y,ce=U.y,V=jZ?j>re?j:re:Z>re?Z:re,$=fe>le?fe>ce?fe:ce:le>ce?le:ce,ue=U.next;ue!==B;){if(ue.x>=V&&ue.x<=ne&&ue.y>=ee&&ue.y<=$&&l(j,fe,Z,le,re,ce,ue.x,ue.y)&&x(ue.prev,ue,ue.next)>=0)return!1;ue=ue.next}return!0}function t(N,B,R,U){var j=N.prev,Z=N,re=N.next;if(x(j,Z,re)>=0)return!1;for(var fe=j.x,le=Z.x,ce=re.x,V=j.y,ee=Z.y,ne=re.y,$=fele?fe>ce?fe:ce:le>ce?le:ce,H=V>ee?V>ne?V:ne:ee>ne?ee:ne,ae=v($,ue,B,R,U),ie=v(te,H,B,R,U),de=N.prevZ,Se=N.nextZ;de&&de.z>=ae&&Se&&Se.z<=ie;){if(de.x>=$&&de.x<=te&&de.y>=ue&&de.y<=H&&de!==j&&de!==re&&l(fe,V,le,ee,ce,ne,de.x,de.y)&&x(de.prev,de,de.next)>=0||(de=de.prevZ,Se.x>=$&&Se.x<=te&&Se.y>=ue&&Se.y<=H&&Se!==j&&Se!==re&&l(fe,V,le,ee,ce,ne,Se.x,Se.y)&&x(Se.prev,Se,Se.next)>=0))return!1;Se=Se.nextZ}for(;de&&de.z>=ae;){if(de.x>=$&&de.x<=te&&de.y>=ue&&de.y<=H&&de!==j&&de!==re&&l(fe,V,le,ee,ce,ne,de.x,de.y)&&x(de.prev,de,de.next)>=0)return!1;de=de.prevZ}for(;Se&&Se.z<=ie;){if(Se.x>=$&&Se.x<=te&&Se.y>=ue&&Se.y<=H&&Se!==j&&Se!==re&&l(fe,V,le,ee,ce,ne,Se.x,Se.y)&&x(Se.prev,Se,Se.next)>=0)return!1;Se=Se.nextZ}return!0}function r(N,B,R){var U=N;do{var j=U.prev,Z=U.next.next;!A(j,Z)&&M(j,U,U.next,Z)&&u(j,Z)&&u(Z,j)&&(B.push(j.i/R|0),B.push(U.i/R|0),B.push(Z.i/R|0),L(U),L(U.next),U=N=Z),U=U.next}while(U!==N);return S(U)}function o(N,B,R,U,j,Z){var re=N;do{for(var fe=re.next.next;fe!==re.prev;){if(re.i!==fe.i&&g(re,fe)){var le=y(re,fe);re=S(re,re.next),le=S(le,le.next),E(re,B,R,U,j,Z,0),E(le,B,R,U,j,Z,0);return}fe=fe.next}re=re.next}while(re!==N)}function n(N,B,R,U){var j=[],Z,re,fe,le,ce;for(Z=0,re=B.length;Z=R.next.y&&R.next.y!==R.y){var fe=R.x+(j-R.y)*(R.next.x-R.x)/(R.next.y-R.y);if(fe<=U&&fe>Z&&(Z=fe,re=R.x=R.x&&R.x>=ce&&U!==R.x&&l(jre.x||R.x===re.x&&f(re,R)))&&(re=R,ee=ne)),R=R.next;while(R!==le);return re}function f(N,B){return x(N.prev,N,B.prev)<0&&x(B.next,N,N.next)<0}function c(N,B,R,U){var j=N;do j.z===0&&(j.z=v(j.x,j.y,B,R,U)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==N);j.prevZ.nextZ=null,j.prevZ=null,p(j)}function p(N){var B,R,U,j,Z,re,fe,le,ce=1;do{for(R=N,N=null,Z=null,re=0;R;){for(re++,U=R,fe=0,B=0;B0||le>0&&U;)fe!==0&&(le===0||!U||R.z<=U.z)?(j=R,R=R.nextZ,fe--):(j=U,U=U.nextZ,le--),Z?Z.nextZ=j:N=j,j.prevZ=Z,Z=j;R=U}Z.nextZ=null,ce*=2}while(re>1);return N}function v(N,B,R,U,j){return N=(N-R)*j|0,B=(B-U)*j|0,N=(N|N<<8)&16711935,N=(N|N<<4)&252645135,N=(N|N<<2)&858993459,N=(N|N<<1)&1431655765,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,N|B<<1}function T(N){var B=N,R=N;do(B.x=(N-re)*(Z-fe)&&(N-re)*(U-fe)>=(R-re)*(B-fe)&&(R-re)*(Z-fe)>=(j-re)*(U-fe)}function g(N,B){return N.next.i!==B.i&&N.prev.i!==B.i&&!m(N,B)&&(u(N,B)&&u(B,N)&&d(N,B)&&(x(N.prev,N,B.prev)||x(N,B.prev,B))||A(N,B)&&x(N.prev,N,N.next)>0&&x(B.prev,B,B.next)>0)}function x(N,B,R){return(B.y-N.y)*(R.x-B.x)-(B.x-N.x)*(R.y-B.y)}function A(N,B){return N.x===B.x&&N.y===B.y}function M(N,B,R,U){var j=w(x(N,B,R)),Z=w(x(N,B,U)),re=w(x(R,U,N)),fe=w(x(R,U,B));return!!(j!==Z&&re!==fe||j===0&&_(N,R,B)||Z===0&&_(N,U,B)||re===0&&_(R,N,U)||fe===0&&_(R,B,U))}function _(N,B,R){return B.x<=Math.max(N.x,R.x)&&B.x>=Math.min(N.x,R.x)&&B.y<=Math.max(N.y,R.y)&&B.y>=Math.min(N.y,R.y)}function w(N){return N>0?1:N<0?-1:0}function m(N,B){var R=N;do{if(R.i!==N.i&&R.next.i!==N.i&&R.i!==B.i&&R.next.i!==B.i&&M(R,R.next,N,B))return!0;R=R.next}while(R!==N);return!1}function u(N,B){return x(N.prev,N,N.next)<0?x(N,B,N.next)>=0&&x(N,N.prev,B)>=0:x(N,B,N.prev)<0||x(N,N.next,B)<0}function d(N,B){var R=N,U=!1,j=(N.x+B.x)/2,Z=(N.y+B.y)/2;do R.y>Z!=R.next.y>Z&&R.next.y!==R.y&&j<(R.next.x-R.x)*(Z-R.y)/(R.next.y-R.y)+R.x&&(U=!U),R=R.next;while(R!==N);return U}function y(N,B){var R=new z(N.i,N.x,N.y),U=new z(B.i,B.x,B.y),j=N.next,Z=B.prev;return N.next=B,B.prev=N,R.next=j,j.prev=R,U.next=R,R.prev=U,Z.next=U,U.prev=Z,U}function I(N,B,R,U){var j=new z(N,B,R);return U?(j.next=U.next,j.prev=U,U.next.prev=j,U.next=j):(j.prev=j,j.next=j),j}function L(N){N.next.prev=N.prev,N.prev.next=N.next,N.prevZ&&(N.prevZ.nextZ=N.nextZ),N.nextZ&&(N.nextZ.prevZ=N.prevZ)}function z(N,B,R){this.i=N,this.x=B,this.y=R,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}h.deviation=function(N,B,R,U){var j=B&&B.length,Z=j?B[0]*R:N.length,re=Math.abs(F(N,0,Z,R));if(j)for(var fe=0,le=B.length;fe0&&(U+=N[j-1].length,R.holes.push(U))}return R}}}),nD=Ge({"node_modules/array-normalize/index.js"(K,G){var h=$b();G.exports=b;function b(S,E,e){if(!S||S.length==null)throw Error("Argument should be an array");E==null&&(E=1),e==null&&(e=h(S,E));for(var t=0;t-1}}}),YC=Ge({"node_modules/es5-ext/string/#/contains/index.js"(K,G){G.exports=mD()()?String.prototype.contains:gD()}}),Zy=Ge({"node_modules/d/index.js"(K,G){var h=Qb(),b=GC(),S=VE(),E=XC(),e=YC(),t=G.exports=function(r,o){var n,i,a,s,f;return arguments.length<2||typeof r!="string"?(s=o,o=r,r=null):s=arguments[2],h(r)?(n=e.call(r,"c"),i=e.call(r,"e"),a=e.call(r,"w")):(n=a=!0,i=!1),f={value:o,configurable:n,enumerable:i,writable:a},s?S(E(s),f):f};t.gs=function(r,o,n){var i,a,s,f;return typeof r!="string"?(s=n,n=o,o=r,r=null):s=arguments[3],h(o)?b(o)?h(n)?b(n)||(s=n,n=void 0):n=void 0:(s=o,o=n=void 0):o=void 0,h(r)?(i=e.call(r,"c"),a=e.call(r,"e")):(i=!0,a=!1),f={get:o,set:n,configurable:i,enumerable:a},s?S(E(s),f):f}}}),aS=Ge({"node_modules/es5-ext/function/is-arguments.js"(K,G){var h=Object.prototype.toString,b=h.call((function(){return arguments})());G.exports=function(S){return h.call(S)===b}}}),iS=Ge({"node_modules/es5-ext/string/is-string.js"(K,G){var h=Object.prototype.toString,b=h.call("");G.exports=function(S){return typeof S=="string"||S&&typeof S=="object"&&(S instanceof String||h.call(S)===b)||!1}}}),yD=Ge({"node_modules/ext/global-this/is-implemented.js"(K,G){G.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),_D=Ge({"node_modules/ext/global-this/implementation.js"(K,G){var h=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};G.exports=(function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return h()}try{return __global__||h()}finally{delete Object.prototype.__global__}})()}}),oS=Ge({"node_modules/ext/global-this/index.js"(K,G){G.exports=yD()()?globalThis:_D()}}),xD=Ge({"node_modules/es6-symbol/is-implemented.js"(K,G){var h=oS(),b={object:!0,symbol:!0};G.exports=function(){var S=h.Symbol,E;if(typeof S!="function")return!1;E=S("test symbol");try{String(E)}catch{return!1}return!(!b[typeof S.iterator]||!b[typeof S.toPrimitive]||!b[typeof S.toStringTag])}}}),bD=Ge({"node_modules/es6-symbol/is-symbol.js"(K,G){G.exports=function(h){return h?typeof h=="symbol"?!0:!h.constructor||h.constructor.name!=="Symbol"?!1:h[h.constructor.toStringTag]==="Symbol":!1}}}),ZC=Ge({"node_modules/es6-symbol/validate-symbol.js"(K,G){var h=bD();G.exports=function(b){if(!h(b))throw new TypeError(b+" is not a symbol");return b}}}),wD=Ge({"node_modules/es6-symbol/lib/private/generate-name.js"(K,G){var h=Zy(),b=Object.create,S=Object.defineProperty,E=Object.prototype,e=b(null);G.exports=function(t){for(var r=0,o,n;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,o="@@"+t,S(E,o,h.gs(null,function(i){n||(n=!0,S(this,o,h(i)),n=!1)})),o}}}),TD=Ge({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(K,G){var h=Zy(),b=oS().Symbol;G.exports=function(S){return Object.defineProperties(S,{hasInstance:h("",b&&b.hasInstance||S("hasInstance")),isConcatSpreadable:h("",b&&b.isConcatSpreadable||S("isConcatSpreadable")),iterator:h("",b&&b.iterator||S("iterator")),match:h("",b&&b.match||S("match")),replace:h("",b&&b.replace||S("replace")),search:h("",b&&b.search||S("search")),species:h("",b&&b.species||S("species")),split:h("",b&&b.split||S("split")),toPrimitive:h("",b&&b.toPrimitive||S("toPrimitive")),toStringTag:h("",b&&b.toStringTag||S("toStringTag")),unscopables:h("",b&&b.unscopables||S("unscopables"))})}}}),AD=Ge({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(K,G){var h=Zy(),b=ZC(),S=Object.create(null);G.exports=function(E){return Object.defineProperties(E,{for:h(function(e){return S[e]?S[e]:S[e]=E(String(e))}),keyFor:h(function(e){var t;b(e);for(t in S)if(S[t]===e)return t})})}}}),SD=Ge({"node_modules/es6-symbol/polyfill.js"(K,G){var h=Zy(),b=ZC(),S=oS().Symbol,E=wD(),e=TD(),t=AD(),r=Object.create,o=Object.defineProperties,n=Object.defineProperty,i,a,s;if(typeof S=="function")try{String(S()),s=!0}catch{}else S=null;a=function(c){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return i(c)},G.exports=i=function f(c){var p;if(this instanceof f)throw new TypeError("Symbol is not a constructor");return s?S(c):(p=r(a.prototype),c=c===void 0?"":String(c),o(p,{__description__:h("",c),__name__:h("",E(c))}))},e(i),t(i),o(a.prototype,{constructor:h(i),toString:h("",function(){return this.__name__})}),o(i.prototype,{toString:h(function(){return"Symbol ("+b(this).__description__+")"}),valueOf:h(function(){return b(this)})}),n(i.prototype,i.toPrimitive,h("",function(){var f=b(this);return typeof f=="symbol"?f:f.toString()})),n(i.prototype,i.toStringTag,h("c","Symbol")),n(a.prototype,i.toStringTag,h("c",i.prototype[i.toStringTag])),n(a.prototype,i.toPrimitive,h("c",i.prototype[i.toPrimitive]))}}),U_=Ge({"node_modules/es6-symbol/index.js"(K,G){G.exports=xD()()?oS().Symbol:SD()}}),MD=Ge({"node_modules/es5-ext/array/#/clear.js"(K,G){var h=Yy();G.exports=function(){return h(this).length=0,this}}}),G3=Ge({"node_modules/es5-ext/object/valid-callable.js"(K,G){G.exports=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h}}}),ED=Ge({"node_modules/type/string/coerce.js"(K,G){var h=Qb(),b=qE(),S=Object.prototype.toString;G.exports=function(E){if(!h(E))return null;if(b(E)){var e=E.toString;if(typeof e!="function"||e===S)return null}try{return""+E}catch{return null}}}}),kD=Ge({"node_modules/type/lib/safe-to-string.js"(K,G){G.exports=function(h){try{return h.toString()}catch{try{return String(h)}catch{return null}}}}}),CD=Ge({"node_modules/type/lib/to-short-string.js"(K,G){var h=kD(),b=/[\n\r\u2028\u2029]/g;G.exports=function(S){var E=h(S);return E===null?"":(E.length>100&&(E=E.slice(0,99)+"…"),E=E.replace(b,function(e){switch(e){case` +`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),E)}}}),WC=Ge({"node_modules/type/lib/resolve-exception.js"(K,G){var h=Qb(),b=qE(),S=ED(),E=CD(),e=function(t,r){return t.replace("%v",E(r))};G.exports=function(t,r,o){if(!b(o))throw new TypeError(e(r,t));if(!h(t)){if("default"in o)return o.default;if(o.isOptional)return null}var n=S(o.errorMessage);throw h(n)||(n=r),new TypeError(e(n,t))}}}),LD=Ge({"node_modules/type/value/ensure.js"(K,G){var h=WC(),b=Qb();G.exports=function(S){return b(S)?S:h(S,"Cannot use %v",arguments[1])}}}),PD=Ge({"node_modules/type/plain-function/ensure.js"(K,G){var h=WC(),b=GC();G.exports=function(S){return b(S)?S:h(S,"%v is not a plain function",arguments[1])}}}),RD=Ge({"node_modules/es5-ext/array/from/is-implemented.js"(K,G){G.exports=function(){var h=Array.from,b,S;return typeof h!="function"?!1:(b=["raz","dwa"],S=h(b),!!(S&&S!==b&&S[1]==="dwa"))}}}),ID=Ge({"node_modules/es5-ext/function/is-function.js"(K,G){var h=Object.prototype.toString,b=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);G.exports=function(S){return typeof S=="function"&&b(h.call(S))}}}),DD=Ge({"node_modules/es5-ext/math/sign/is-implemented.js"(K,G){G.exports=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1}}}),zD=Ge({"node_modules/es5-ext/math/sign/shim.js"(K,G){G.exports=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}}}),OD=Ge({"node_modules/es5-ext/math/sign/index.js"(K,G){G.exports=DD()()?Math.sign:zD()}}),FD=Ge({"node_modules/es5-ext/number/to-integer.js"(K,G){var h=OD(),b=Math.abs,S=Math.floor;G.exports=function(E){return isNaN(E)?0:(E=Number(E),E===0||!isFinite(E)?E:h(E)*S(b(E)))}}}),BD=Ge({"node_modules/es5-ext/number/to-pos-integer.js"(K,G){var h=FD(),b=Math.max;G.exports=function(S){return b(0,h(S))}}}),ND=Ge({"node_modules/es5-ext/array/from/shim.js"(K,G){var h=U_().iterator,b=aS(),S=ID(),E=BD(),e=G3(),t=Yy(),r=N_(),o=iS(),n=Array.isArray,i=Function.prototype.call,a={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;G.exports=function(f){var c=arguments[1],p=arguments[2],v,T,l,g,x,A,M,_,w,m;if(f=Object(t(f)),r(c)&&e(c),!this||this===Array||!S(this)){if(!c){if(b(f))return x=f.length,x!==1?Array.apply(null,f):(g=new Array(1),g[0]=f[0],g);if(n(f)){for(g=new Array(x=f.length),T=0;T=55296&&A<=56319&&(m+=f[++T])),m=c?i.call(c,p,m,l):m,v?(a.value=m,s(g,l,a)):g[l]=m,++l;x=l}}if(x===void 0)for(x=E(f.length),v&&(g=new v(x)),T=0;T=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){o(this,"__redo__",e("c",[a]));return}this.__redo__.forEach(function(s,f){s>=a&&(this.__redo__[f]=++s)},this),this.__redo__.push(a)}}),_onDelete:e(function(a){var s;a>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(a),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(f,c){f>a&&(this.__redo__[c]=--f)},this)))}),_onClear:e(function(){this.__redo__&&h.call(this.__redo__),this.__nextIndex__=0})}))),o(i.prototype,r.iterator,e(function(){return this}))}}),XD=Ge({"node_modules/es6-iterator/array.js"(K,G){var h=jE(),b=YC(),S=Zy(),E=U_(),e=$C(),t=Object.defineProperty,r;r=G.exports=function(o,n){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e.call(this,o),n?b.call(n,"key+value")?n="key+value":b.call(n,"key")?n="key":n="value":n="value",t(this,"__kind__",S("",n))},h&&h(r,e),delete r.prototype.constructor,r.prototype=Object.create(e.prototype,{_resolve:S(function(o){return this.__kind__==="value"?this.__list__[o]:this.__kind__==="key+value"?[o,this.__list__[o]]:o})}),t(r.prototype,E.toStringTag,S("c","Array Iterator"))}}),YD=Ge({"node_modules/es6-iterator/string.js"(K,G){var h=jE(),b=Zy(),S=U_(),E=$C(),e=Object.defineProperty,t;t=G.exports=function(r){if(!(this instanceof t))throw new TypeError("Constructor requires 'new'");r=String(r),E.call(this,r),e(this,"__length__",b("",r.length))},h&&h(t,E),delete t.prototype.constructor,t.prototype=Object.create(E.prototype,{_next:b(function(){if(this.__list__){if(this.__nextIndex__=55296&&n<=56319?o+this.__list__[this.__nextIndex__++]:o)})}),e(t.prototype,S.toStringTag,b("c","String Iterator"))}}),ZD=Ge({"node_modules/es6-iterator/is-iterable.js"(K,G){var h=aS(),b=N_(),S=iS(),E=U_().iterator,e=Array.isArray;G.exports=function(t){return b(t)?e(t)||S(t)||h(t)?!0:typeof t[E]=="function":!1}}}),WD=Ge({"node_modules/es6-iterator/valid-iterable.js"(K,G){var h=ZD();G.exports=function(b){if(!h(b))throw new TypeError(b+" is not iterable");return b}}}),KC=Ge({"node_modules/es6-iterator/get.js"(K,G){var h=aS(),b=iS(),S=XD(),E=YD(),e=WD(),t=U_().iterator;G.exports=function(r){return typeof e(r)[t]=="function"?r[t]():h(r)?new S(r):b(r)?new E(r):new S(r)}}}),$D=Ge({"node_modules/es6-iterator/for-of.js"(K,G){var h=aS(),b=G3(),S=iS(),E=KC(),e=Array.isArray,t=Function.prototype.call,r=Array.prototype.some;G.exports=function(o,n){var i,a=arguments[2],s,f,c,p,v,T,l;if(e(o)||h(o)?i="array":S(o)?i="string":o=E(o),b(n),f=function(){c=!0},i==="array"){r.call(o,function(g){return t.call(n,a,g,f),c});return}if(i==="string"){for(v=o.length,p=0;p=55296&&l<=56319&&(T+=o[++p])),t.call(n,a,T,f),!c);++p);return}for(s=o.next();!s.done;){if(t.call(n,a,s.value,f),c)return;s=o.next()}}}}),KD=Ge({"node_modules/es6-weak-map/is-native-implemented.js"(K,G){G.exports=(function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"})()}}),JD=Ge({"node_modules/es6-weak-map/polyfill.js"(K,G){var h=N_(),b=jE(),S=sD(),E=Yy(),e=lD(),t=Zy(),r=KC(),o=$D(),n=U_().toStringTag,i=KD(),a=Array.isArray,s=Object.defineProperty,f=Object.prototype.hasOwnProperty,c=Object.getPrototypeOf,p;G.exports=p=function(){var v=arguments[0],T;if(!(this instanceof p))throw new TypeError("Constructor requires 'new'");return T=i&&b&&WeakMap!==p?b(new WeakMap,c(this)):this,h(v)&&(a(v)||(v=r(v))),s(T,"__weakMapData__",t("c","$weakMap$"+e())),v&&o(v,function(l){E(l),T.set(l[0],l[1])}),T},i&&(b&&b(p,WeakMap),p.prototype=Object.create(WeakMap.prototype,{constructor:t(p)})),Object.defineProperties(p.prototype,{delete:t(function(v){return f.call(S(v),this.__weakMapData__)?(delete v[this.__weakMapData__],!0):!1}),get:t(function(v){if(f.call(S(v),this.__weakMapData__))return v[this.__weakMapData__]}),has:t(function(v){return f.call(S(v),this.__weakMapData__)}),set:t(function(v,T){return s(S(v),this.__weakMapData__,t("c",T)),this}),toString:t(function(){return"[object WeakMap]"})}),s(p.prototype,n,t("c","WeakMap"))}}),JC=Ge({"node_modules/es6-weak-map/index.js"(K,G){G.exports=aD()()?WeakMap:JD()}}),QD=Ge({"node_modules/array-find-index/index.js"(K,G){G.exports=function(h,b,S){if(typeof Array.prototype.findIndex=="function")return h.findIndex(b,S);if(typeof b!="function")throw new TypeError("predicate must be a function");var E=Object(h),e=E.length;if(e===0)return-1;for(var t=0;tv.join==="round"?2:1,miterLimit:x.prop("miterLimit"),scale:x.prop("scale"),scaleFract:x.prop("scaleFract"),translateFract:x.prop("translateFract"),translate:x.prop("translate"),thickness:x.prop("thickness"),dashTexture:x.prop("dashTexture"),opacity:x.prop("opacity"),pixelRatio:x.context("pixelRatio"),id:x.prop("id"),dashLength:x.prop("dashLength"),viewport:(u,v)=>[v.viewport.x,v.viewport.y,u.viewportWidth,u.viewportHeight],depth:x.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(u,v)=>!v.overlay},stencil:{enable:!1},scissor:{enable:!0,box:x.prop("viewport")},viewport:x.prop("viewport")},_=x(S({vert:f,frag:c,attributes:{lineEnd:{buffer:A,divisor:0,stride:8,offset:0},lineTop:{buffer:A,divisor:0,stride:8,offset:4},aCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:x.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:x.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:x.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},M)),w;try{w=x(S({cull:{enable:!0,face:"back"},vert:T,frag:l,attributes:{lineEnd:{buffer:A,divisor:0,stride:8,offset:0},lineTop:{buffer:A,divisor:0,stride:8,offset:4},aColor:{buffer:x.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:x.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},M))}catch{w=_}return{fill:x({primitive:"triangle",elements:(u,v)=>v.triangles,offset:0,vert:p,frag:d,uniforms:{scale:x.prop("scale"),color:x.prop("fill"),scaleFract:x.prop("scaleFract"),translateFract:x.prop("translateFract"),translate:x.prop("translate"),opacity:x.prop("opacity"),pixelRatio:x.context("pixelRatio"),id:x.prop("id"),viewport:(u,v)=>[v.viewport.x,v.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:x.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:x.prop("positionFractBuffer"),stride:8,offset:8}},blend:M.blend,depth:{enable:!1},scissor:M.scissor,stencil:M.stencil,viewport:M.viewport}),rect:_,miter:w}},g.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},g.prototype.render=function(...x){x.length&&this.update(...x),this.draw()},g.prototype.draw=function(...x){return(x.length?x:this.passes).forEach((A,M)=>{if(A&&Array.isArray(A))return this.draw(...A);typeof A=="number"&&(A=this.passes[A]),A&&A.count>1&&A.opacity&&(this.regl._refresh(),A.fill&&A.triangles&&A.triangles.length>2&&this.shaders.fill(A),A.thickness&&(A.scale[0]*A.viewport.width>g.precisionThreshold||A.scale[1]*A.viewport.height>g.precisionThreshold?this.shaders.rect(A):A.join==="rect"||!A.join&&(A.thickness<=2||A.count>=g.maxPoints)?this.shaders.rect(A):this.shaders.miter(A)))}),this},g.prototype.update=function(x){if(!x)return;x.length!=null?typeof x[0]=="number"&&(x=[{positions:x}]):Array.isArray(x)||(x=[x]);let{regl:A,gl:M}=this;if(x.forEach((w,m)=>{let u=this.passes[m];if(w!==void 0){if(w===null){this.passes[m]=null;return}if(typeof w[0]=="number"&&(w={positions:w}),w=E(w,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),u||(this.passes[m]=u={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:A.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:A.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:A.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:A.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},w=S({},g.defaults,w)),w.thickness!=null&&(u.thickness=parseFloat(w.thickness)),w.opacity!=null&&(u.opacity=parseFloat(w.opacity)),w.miterLimit!=null&&(u.miterLimit=parseFloat(w.miterLimit)),w.overlay!=null&&(u.overlay=!!w.overlay,mle-ce),Z=[],re=0,fe=u.hole!=null?u.hole[0]:null;if(fe!=null){let le=s(j,ce=>ce>=fe);j=j.slice(0,le),j.push(fe)}for(let le=0;lene-fe+(j[le]-re)),ee=t(ce,V);ee=ee.map(ne=>ne+re+(ne+re{x.colorBuffer.destroy(),x.positionBuffer.destroy(),x.dashTexture.destroy()}),this.passes.length=0,this}}}),CI=Ge({"node_modules/regl-error2d/index.js"($,G){var h=Yb(),b=L_(),S=aC(),E=Ig(),e=xv(),t=Zb(),{float32:r,fract32:o}=wE();G.exports=i;var n=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function i(a,s){if(typeof a=="function"?(s||(s={}),s.regl=a):s=a,s.length&&(s.positions=s),a=s.regl,!a.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let f=a._gl,c,p,d,T,l,g,x={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},A=[];return T=a.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),p=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),d=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=a.buffer({usage:"static",type:"float",data:n}),m(s),c=a({vert:` +`;G.exports=g;function g(x,A){if(!(this instanceof g))return new g(x,A);if(typeof x=="function"?(A||(A={}),A.regl=x):A=x,A.length&&(A.positions=A),x=A.regl,!x.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=x._gl,this.regl=x,this.passes=[],this.shaders=g.shaders.has(x)?g.shaders.get(x):g.shaders.set(x,g.createShaders(x)).get(x),this.update(A)}g.dashMult=2,g.maxPatternLength=256,g.precisionThreshold=3e6,g.maxPoints=1e4,g.maxLines=2048,g.shaders=new i,g.createShaders=function(x){let A=x.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),M={primitive:"triangle strip",instances:x.prop("count"),count:4,offset:0,uniforms:{miterMode:(u,d)=>d.join==="round"?2:1,miterLimit:x.prop("miterLimit"),scale:x.prop("scale"),scaleFract:x.prop("scaleFract"),translateFract:x.prop("translateFract"),translate:x.prop("translate"),thickness:x.prop("thickness"),dashTexture:x.prop("dashTexture"),opacity:x.prop("opacity"),pixelRatio:x.context("pixelRatio"),id:x.prop("id"),dashLength:x.prop("dashLength"),viewport:(u,d)=>[d.viewport.x,d.viewport.y,u.viewportWidth,u.viewportHeight],depth:x.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(u,d)=>!d.overlay},stencil:{enable:!1},scissor:{enable:!0,box:x.prop("viewport")},viewport:x.prop("viewport")},_=x(S({vert:f,frag:c,attributes:{lineEnd:{buffer:A,divisor:0,stride:8,offset:0},lineTop:{buffer:A,divisor:0,stride:8,offset:4},aCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:x.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:x.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:x.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},M)),w;try{w=x(S({cull:{enable:!0,face:"back"},vert:T,frag:l,attributes:{lineEnd:{buffer:A,divisor:0,stride:8,offset:0},lineTop:{buffer:A,divisor:0,stride:8,offset:4},aColor:{buffer:x.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:x.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:x.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},M))}catch{w=_}return{fill:x({primitive:"triangle",elements:(u,d)=>d.triangles,offset:0,vert:p,frag:v,uniforms:{scale:x.prop("scale"),color:x.prop("fill"),scaleFract:x.prop("scaleFract"),translateFract:x.prop("translateFract"),translate:x.prop("translate"),opacity:x.prop("opacity"),pixelRatio:x.context("pixelRatio"),id:x.prop("id"),viewport:(u,d)=>[d.viewport.x,d.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:x.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:x.prop("positionFractBuffer"),stride:8,offset:8}},blend:M.blend,depth:{enable:!1},scissor:M.scissor,stencil:M.stencil,viewport:M.viewport}),rect:_,miter:w}},g.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},g.prototype.render=function(...x){x.length&&this.update(...x),this.draw()},g.prototype.draw=function(...x){return(x.length?x:this.passes).forEach((A,M)=>{if(A&&Array.isArray(A))return this.draw(...A);typeof A=="number"&&(A=this.passes[A]),A&&A.count>1&&A.opacity&&(this.regl._refresh(),A.fill&&A.triangles&&A.triangles.length>2&&this.shaders.fill(A),A.thickness&&(A.scale[0]*A.viewport.width>g.precisionThreshold||A.scale[1]*A.viewport.height>g.precisionThreshold?this.shaders.rect(A):A.join==="rect"||!A.join&&(A.thickness<=2||A.count>=g.maxPoints)?this.shaders.rect(A):this.shaders.miter(A)))}),this},g.prototype.update=function(x){if(!x)return;x.length!=null?typeof x[0]=="number"&&(x=[{positions:x}]):Array.isArray(x)||(x=[x]);let{regl:A,gl:M}=this;if(x.forEach((w,m)=>{let u=this.passes[m];if(w!==void 0){if(w===null){this.passes[m]=null;return}if(typeof w[0]=="number"&&(w={positions:w}),w=E(w,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),u||(this.passes[m]=u={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:A.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:A.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:A.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:A.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},w=S({},g.defaults,w)),w.thickness!=null&&(u.thickness=parseFloat(w.thickness)),w.opacity!=null&&(u.opacity=parseFloat(w.opacity)),w.miterLimit!=null&&(u.miterLimit=parseFloat(w.miterLimit)),w.overlay!=null&&(u.overlay=!!w.overlay,mle-ce),Z=[],re=0,fe=u.hole!=null?u.hole[0]:null;if(fe!=null){let le=s(j,ce=>ce>=fe);j=j.slice(0,le),j.push(fe)}for(let le=0;lene-fe+(j[le]-re)),ee=t(ce,V);ee=ee.map(ne=>ne+re+(ne+re{x.colorBuffer.destroy(),x.positionBuffer.destroy(),x.dashTexture.destroy()}),this.passes.length=0,this}}}),ez=Ge({"node_modules/regl-error2d/index.js"(K,G){var h=$b(),b=D_(),S=UC(),E=Og(),e=Ad(),t=Kb(),{float32:r,fract32:o}=UE();G.exports=i;var n=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function i(a,s){if(typeof a=="function"?(s||(s={}),s.regl=a):s=a,s.length&&(s.positions=s),a=s.regl,!a.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let f=a._gl,c,p,v,T,l,g,x={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},A=[];return T=a.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),p=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),v=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=a.buffer({usage:"static",type:"float",data:n}),m(s),c=a({vert:` precision highp float; attribute vec2 position, positionFract; @@ -2622,10 +2622,10 @@ void main() { gl_FragColor = fragColor; gl_FragColor.a *= opacity; } - `,uniforms:{range:a.prop("range"),lineWidth:a.prop("lineWidth"),capSize:a.prop("capSize"),opacity:a.prop("opacity"),scale:a.prop("scale"),translate:a.prop("translate"),scaleFract:a.prop("scaleFract"),translateFract:a.prop("translateFract"),viewport:(v,y)=>[y.viewport.x,y.viewport.y,v.viewportWidth,v.viewportHeight]},attributes:{color:{buffer:T,offset:(v,y)=>y.offset*4,divisor:1},position:{buffer:p,offset:(v,y)=>y.offset*8,divisor:1},positionFract:{buffer:d,offset:(v,y)=>y.offset*8,divisor:1},error:{buffer:l,offset:(v,y)=>y.offset*16,divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:a.prop("viewport")},viewport:a.prop("viewport"),stencil:!1,instances:a.prop("count"),count:n.length}),e(M,{update:m,draw:_,destroy:u,regl:a,gl:f,canvas:f.canvas,groups:A}),M;function M(v){v?m(v):v===null&&u(),_()}function _(v){if(typeof v=="number")return w(v);v&&!Array.isArray(v)&&(v=[v]),a._refresh(),A.forEach((y,I)=>{if(y){if(v&&(v[I]?y.draw=!0:y.draw=!1),!y.draw){y.draw=!0;return}w(I)}})}function w(v){typeof v=="number"&&(v=A[v]),v!=null&&v&&v.count&&v.color&&v.opacity&&v.positions&&v.positions.length>1&&(v.scaleRatio=[v.scale[0]*v.viewport.width,v.scale[1]*v.viewport.height],c(v),v.after&&v.after(v))}function m(v){if(!v)return;v.length!=null?typeof v[0]=="number"&&(v=[{positions:v}]):Array.isArray(v)||(v=[v]);let y=0,I=0;if(M.groups=A=v.map((F,N)=>{let B=A[N];if(F)typeof F=="function"?F={after:F}:typeof F[0]=="number"&&(F={positions:F});else return B;return F=E(F,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),B||(A[N]=B={id:N,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},F=e({},x,F)),S(B,F,[{lineWidth:R=>+R*.5,capSize:R=>+R*.5,opacity:parseFloat,errors:R=>(R=t(R),I+=R.length,R),positions:(R,U)=>(R=t(R,"float64"),U.count=Math.floor(R.length/2),U.bounds=h(R,2),U.offset=y,y+=U.count,R)},{color:(R,U)=>{let j=U.count;if(R||(R="transparent"),!Array.isArray(R)||typeof R[0]=="number"){let re=R;R=Array(j);for(let fe=0;fe{let Z=U.bounds;return R||(R=Z),U.scale=[1/(R[2]-R[0]),1/(R[3]-R[1])],U.translate=[-R[0],-R[1]],U.scaleFract=o(U.scale),U.translateFract=o(U.translate),R},viewport:R=>{let U;return Array.isArray(R)?U={x:R[0],y:R[1],width:R[2]-R[0],height:R[3]-R[1]}:R?(U={x:R.x||R.left||0,y:R.y||R.top||0},R.right?U.width=R.right-U.x:U.width=R.w||R.width||0,R.bottom?U.height=R.bottom-U.y:U.height=R.h||R.height||0):U={x:0,y:0,width:f.drawingBufferWidth,height:f.drawingBufferHeight},U}}]),B}),y||I){let F=A.reduce((U,j,Z)=>U+(j?j.count:0),0),N=new Float64Array(F*2),B=new Uint8Array(F*4),R=new Float32Array(F*4);A.forEach((U,j)=>{if(!U)return;let{positions:Z,count:re,offset:fe,color:le,errors:ce}=U;re&&(B.set(le,fe*4),R.set(ce,fe*4),N.set(Z,fe*2))});var L=r(N);p(L);var z=o(N,L);d(z),T(B),l(R)}}function u(){p.destroy(),d.destroy(),T.destroy(),l.destroy(),g.destroy()}}}}),LI=Ge({"node_modules/unquote/index.js"($,G){var h=/[\'\"]/;G.exports=function(S){return S?(h.test(S.charAt(0))&&(S=S.substr(1)),h.test(S.charAt(S.length-1))&&(S=S.substr(0,S.length-1)),S):""}}}),yC=Ge({"node_modules/css-global-keywords/index.json"($,G){G.exports=["inherit","initial","unset"]}}),_C=Ge({"node_modules/css-system-font-keywords/index.json"($,G){G.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),xC=Ge({"node_modules/css-font-weight-keywords/index.json"($,G){G.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),bC=Ge({"node_modules/css-font-style-keywords/index.json"($,G){G.exports=["normal","italic","oblique"]}}),wC=Ge({"node_modules/css-font-stretch-keywords/index.json"($,G){G.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),PI=Ge({"node_modules/parenthesis/index.js"($,G){function h(E,e){if(typeof E!="string")return[E];var t=[E];typeof e=="string"||Array.isArray(e)?e={brackets:e}:e||(e={});var r=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],o=e.escape||"___",n=!!e.flat;r.forEach(function(s){var f=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),c=[];function p(d,T,l){var g=t.push(d.slice(s[0].length,-s[1].length))-1;return c.push(g),o+g+o}t.forEach(function(d,T){for(var l,g=0;d!=l;)if(l=d,d=d.replace(f,p),g++>1e4)throw Error("References have circular dependency. Please, check them.");t[T]=d}),c=c.reverse(),t=t.map(function(d){return c.forEach(function(T){d=d.replace(new RegExp("(\\"+o+T+"\\"+o+")","g"),s[0]+"$1"+s[1])}),d})});var i=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(s,f,c){for(var p=[],d,T=0;d=i.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");p.push(s.slice(0,d.index)),p.push(a(f[d[1]],f)),s=s.slice(d.index+d[0].length)}return p.push(s),p}return n?t:a(t[0],t)}function b(E,e){if(e&&e.flat){var t=e&&e.escape||"___",r=E[0],o;if(!r)return"";for(var n=new RegExp("\\"+t+"([0-9]+)\\"+t),i=0;r!=o;){if(i++>1e4)throw Error("Circular references in "+E);o=r,r=r.replace(n,a)}return r}return E.reduce(function s(f,c){return Array.isArray(c)&&(c=c.reduce(s,"")),f+c},"");function a(s,f){if(E[f]==null)throw Error("Reference "+f+"is undefined");return E[f]}}function S(E,e){return Array.isArray(E)?b(E,e):h(E,e)}S.parse=h,S.stringify=b,G.exports=S}}),RI=Ge({"node_modules/string-split-by/index.js"($,G){var h=PI();G.exports=function(S,E,e){if(S==null)throw Error("First argument should be a string");if(E==null)throw Error("Separator should be a string or a RegExp");e?(typeof e=="string"||Array.isArray(e))&&(e={ignore:e}):e={},e.escape==null&&(e.escape=!0),e.ignore==null?e.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof e.ignore=="string"&&(e.ignore=[e.ignore]),e.ignore=e.ignore.map(function(f){return f.length===1&&(f=f+f),f}));var t=h.parse(S,{flat:!0,brackets:e.ignore}),r=t[0],o=r.split(E);if(e.escape){for(var n=[],i=0;i1&&gr===wr&&(gr==='"'||gr==="'"))return['"'+r(dt.substr(1,dt.length-2))+'"'];var Cn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(dt);if(Cn)return o(dt.substr(0,Cn.index)).concat(o(Cn[1])).concat(o(dt.substr(Cn.index+Cn[0].length)));var ua=dt.split(".");if(ua.length===1)return['"'+r(dt)+'"'];for(var gn=[],pn=0;pn"u"?1:window.devicePixelRatio,Wa=!1,Bi={},bi=function(rn){},Ha=function(){};if(typeof gr=="string"?wr=document.querySelector(gr):typeof gr=="object"&&(g(gr)?wr=gr:x(gr)?(gn=gr,ua=gn.canvas):("gl"in gr?gn=gr.gl:"canvas"in gr?ua=M(gr.canvas):"container"in gr&&(Cn=M(gr.container)),"attributes"in gr&&(pn=gr.attributes),"extensions"in gr&&(za=A(gr.extensions)),"optionalExtensions"in gr&&(Ia=A(gr.optionalExtensions)),"onDone"in gr&&(bi=gr.onDone),"profile"in gr&&(Wa=!!gr.profile),"pixelRatio"in gr&&(Da=+gr.pixelRatio),"cachedCode"in gr&&(Bi=gr.cachedCode))),wr&&(wr.nodeName.toLowerCase()==="canvas"?ua=wr:Cn=wr),!gn){if(!ua){var ga=T(Cn||document.body,bi,Da);if(!ga)return null;ua=ga.canvas,Ha=ga.onDestroy}pn.premultipliedAlpha===void 0&&(pn.premultipliedAlpha=!0),gn=l(ua,pn)}return gn?{gl:gn,canvas:ua,container:Cn,extensions:za,optionalExtensions:Ia,pixelRatio:Da,profile:Wa,cachedCode:Bi,onDone:bi,onDestroy:Ha}:(Ha(),bi("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(dt,gr){var wr={};function Cn(pn){var za=pn.toLowerCase(),Ia;try{Ia=wr[za]=dt.getExtension(za)}catch{}return!!Ia}for(var ua=0;ua65535)<<4,dt>>>=gr,wr=(dt>255)<<3,dt>>>=wr,gr|=wr,wr=(dt>15)<<2,dt>>>=wr,gr|=wr,wr=(dt>3)<<1,dt>>>=wr,gr|=wr,gr|dt>>1}function R(){var dt=m(8,function(){return[]});function gr(gn){var pn=N(gn),za=dt[B(pn)>>2];return za.length>0?za.pop():new ArrayBuffer(pn)}function wr(gn){dt[B(gn.byteLength)>>2].push(gn)}function Cn(gn,pn){var za=null;switch(gn){case u:za=new Int8Array(gr(pn),0,pn);break;case v:za=new Uint8Array(gr(pn),0,pn);break;case y:za=new Int16Array(gr(2*pn),0,pn);break;case I:za=new Uint16Array(gr(2*pn),0,pn);break;case L:za=new Int32Array(gr(4*pn),0,pn);break;case z:za=new Uint32Array(gr(4*pn),0,pn);break;case F:za=new Float32Array(gr(4*pn),0,pn);break;default:return null}return za.length!==pn?za.subarray(0,pn):za}function ua(gn){wr(gn.buffer)}return{alloc:gr,free:wr,allocType:Cn,freeType:ua}}var U=R();U.zero=R();var j=3408,Z=3410,re=3411,fe=3412,le=3413,ce=3414,V=3415,ee=33901,ne=33902,K=3379,ue=3386,te=34921,H=36347,ae=36348,ie=35661,ve=35660,Ae=34930,Ce=36349,Fe=34076,ze=34024,Ye=7936,it=7937,st=7938,nt=35724,Qe=34047,Le=36063,Te=34852,pe=3553,Ne=34067,ot=34069,ft=33984,rt=6408,Ft=5126,Nt=5121,$t=36160,rr=36053,Er=36064,Mr=16384,Wr=function(dt,gr){var wr=1;gr.ext_texture_filter_anisotropic&&(wr=dt.getParameter(Qe));var Cn=1,ua=1;gr.webgl_draw_buffers&&(Cn=dt.getParameter(Te),ua=dt.getParameter(Le));var gn=!!gr.oes_texture_float;if(gn){var pn=dt.createTexture();dt.bindTexture(pe,pn),dt.texImage2D(pe,0,rt,1,1,0,rt,Ft,null);var za=dt.createFramebuffer();if(dt.bindFramebuffer($t,za),dt.framebufferTexture2D($t,Er,pe,pn,0),dt.bindTexture(pe,null),dt.checkFramebufferStatus($t)!==rr)gn=!1;else{dt.viewport(0,0,1,1),dt.clearColor(1,0,0,1),dt.clear(Mr);var Ia=U.allocType(Ft,4);dt.readPixels(0,0,1,1,rt,Ft,Ia),dt.getError()?gn=!1:(dt.deleteFramebuffer(za),dt.deleteTexture(pn),gn=Ia[0]===1),U.freeType(Ia)}}var Da=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Wa=!0;if(!Da){var Bi=dt.createTexture(),bi=U.allocType(Nt,36);dt.activeTexture(ft),dt.bindTexture(Ne,Bi),dt.texImage2D(ot,0,rt,3,3,0,rt,Nt,bi),U.freeType(bi),dt.bindTexture(Ne,null),dt.deleteTexture(Bi),Wa=!dt.getError()}return{colorBits:[dt.getParameter(Z),dt.getParameter(re),dt.getParameter(fe),dt.getParameter(le)],depthBits:dt.getParameter(ce),stencilBits:dt.getParameter(V),subpixelBits:dt.getParameter(j),extensions:Object.keys(gr).filter(function(Ha){return!!gr[Ha]}),maxAnisotropic:wr,maxDrawbuffers:Cn,maxColorAttachments:ua,pointSizeDims:dt.getParameter(ee),lineWidthDims:dt.getParameter(ne),maxViewportDims:dt.getParameter(ue),maxCombinedTextureUnits:dt.getParameter(ie),maxCubeMapSize:dt.getParameter(Fe),maxRenderbufferSize:dt.getParameter(ze),maxTextureUnits:dt.getParameter(Ae),maxTextureSize:dt.getParameter(K),maxAttributes:dt.getParameter(te),maxVertexUniforms:dt.getParameter(H),maxVertexTextureUnits:dt.getParameter(ve),maxVaryingVectors:dt.getParameter(ae),maxFragmentUniforms:dt.getParameter(Ce),glsl:dt.getParameter(nt),renderer:dt.getParameter(it),vendor:dt.getParameter(Ye),version:dt.getParameter(st),readFloat:gn,npotTextureCube:Wa}},Sr=function(dt){return dt instanceof Uint8Array||dt instanceof Uint16Array||dt instanceof Uint32Array||dt instanceof Int8Array||dt instanceof Int16Array||dt instanceof Int32Array||dt instanceof Float32Array||dt instanceof Float64Array||dt instanceof Uint8ClampedArray};function Br(dt){return!!dt&&typeof dt=="object"&&Array.isArray(dt.shape)&&Array.isArray(dt.stride)&&typeof dt.offset=="number"&&dt.shape.length===dt.stride.length&&(Array.isArray(dt.data)||Sr(dt.data))}var Mt=function(dt){return Object.keys(dt).map(function(gr){return dt[gr]})},je={shape:Xe,flatten:Me};function $e(dt,gr,wr){for(var Cn=0;Cn0){var Di;if(Array.isArray(Fn[0])){Ua=Nn(Fn);for(var aa=1,Zn=1;Zn0){if(typeof aa[0]=="number"){var $a=U.allocType(na.dtype,aa.length);Vr($a,aa),Ua($a,li),U.freeType($a)}else if(Array.isArray(aa[0])||Sr(aa[0])){Dn=Nn(aa);var Oa=ra(aa,Dn,na.dtype);Ua(Oa,li),U.freeType(Oa)}}}else if(Br(aa)){Dn=aa.shape;var Oi=aa.stride,Po=0,wi=0,ji=0,Ya=0;Dn.length===1?(Po=Dn[0],wi=1,ji=Oi[0],Ya=0):Dn.length===2&&(Po=Dn[0],wi=Dn[1],ji=Oi[0],Ya=Oi[1]);var Mo=Array.isArray(aa.data)?na.dtype:lr(aa.data),Ho=U.allocType(Mo,Po*wi);sn(Ho,aa.data,Po,wi,ji,Ya,aa.offset),Ua(Ho,li),U.freeType(Ho)}return di}return ea||di(rn),di._reglType="buffer",di._buffer=na,di.subdata=Di,wr.profile&&(di.stats=na.stats),di.destroy=function(){bi(na)},di}function ga(){Mt(gn).forEach(function(rn){rn.buffer=dt.createBuffer(),dt.bindBuffer(rn.type,rn.buffer),dt.bufferData(rn.type,rn.persistentData||rn.byteLength,rn.usage)})}return wr.profile&&(gr.getTotalBufferSize=function(){var rn=0;return Object.keys(gn).forEach(function(Fn){rn+=gn[Fn].stats.size}),rn}),{create:Ha,createStream:Ia,destroyStream:Da,clear:function(){Mt(gn).forEach(bi),za.forEach(bi)},getBuffer:function(rn){return rn&&rn._buffer instanceof pn?rn._buffer:null},restore:ga,_initBuffer:Bi}}var wn=0,Jn=0,pa=1,ha=1,_a=4,Ca=4,Vn={points:wn,point:Jn,lines:pa,line:ha,triangles:_a,triangle:Ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},yi=0,Ci=1,Dt=4,yt=5120,kr=5121,Nr=5122,jr=5123,Ir=5124,Ur=5125,ln=34963,$r=35040,At=35044;function or(dt,gr,wr,Cn){var ua={},gn=0,pn={uint8:kr,uint16:jr};gr.oes_element_index_uint&&(pn.uint32=Ur);function za(ga){this.id=gn++,ua[this.id]=this,this.buffer=ga,this.primType=Dt,this.vertCount=0,this.type=0}za.prototype.bind=function(){this.buffer.bind()};var Ia=[];function Da(ga){var rn=Ia.pop();return rn||(rn=new za(wr.create(null,ln,!0,!1)._buffer)),Bi(rn,ga,$r,-1,-1,0,0),rn}function Wa(ga){Ia.push(ga)}function Bi(ga,rn,Fn,ea,ya,na,di){ga.buffer.bind();var Ua;if(rn){var Di=di;!di&&(!Sr(rn)||Br(rn)&&!Sr(rn.data))&&(Di=gr.oes_element_index_uint?Ur:jr),wr._initBuffer(ga.buffer,rn,Fn,Di,3)}else dt.bufferData(ln,na,Fn),ga.buffer.dtype=Ua||kr,ga.buffer.usage=Fn,ga.buffer.dimension=3,ga.buffer.byteLength=na;if(Ua=di,!di){switch(ga.buffer.dtype){case kr:case yt:Ua=kr;break;case jr:case Nr:Ua=jr;break;case Ur:case Ir:Ua=Ur;break}ga.buffer.dtype=Ua}ga.type=Ua;var aa=ya;aa<0&&(aa=ga.buffer.byteLength,Ua===jr?aa>>=1:Ua===Ur&&(aa>>=2)),ga.vertCount=aa;var Zn=ea;if(ea<0){Zn=Dt;var li=ga.buffer.dimension;li===1&&(Zn=yi),li===2&&(Zn=Ci),li===3&&(Zn=Dt)}ga.primType=Zn}function bi(ga){Cn.elementsCount--,delete ua[ga.id],ga.buffer.destroy(),ga.buffer=null}function Ha(ga,rn){var Fn=wr.create(null,ln,!0),ea=new za(Fn._buffer);Cn.elementsCount++;function ya(na){if(!na)Fn(),ea.primType=Dt,ea.vertCount=0,ea.type=kr;else if(typeof na=="number")Fn(na),ea.primType=Dt,ea.vertCount=na|0,ea.type=kr;else{var di=null,Ua=At,Di=-1,aa=-1,Zn=0,li=0;Array.isArray(na)||Sr(na)||Br(na)?di=na:("data"in na&&(di=na.data),"usage"in na&&(Ua=ta[na.usage]),"primitive"in na&&(Di=Vn[na.primitive]),"count"in na&&(aa=na.count|0),"type"in na&&(li=pn[na.type]),"length"in na?Zn=na.length|0:(Zn=aa,li===jr||li===Nr?Zn*=2:(li===Ur||li===Ir)&&(Zn*=4))),Bi(ea,di,Ua,Di,aa,Zn,li)}return ya}return ya(ga),ya._reglType="elements",ya._elements=ea,ya.subdata=function(na,di){return Fn.subdata(na,di),ya},ya.destroy=function(){bi(ea)},ya}return{create:Ha,createStream:Da,destroyStream:Wa,getElements:function(ga){return typeof ga=="function"&&ga._elements instanceof za?ga._elements:null},clear:function(){Mt(ua).forEach(bi)}}}var Dr=new Float32Array(1),un=new Uint32Array(Dr.buffer),Rn=5123;function jn(dt){for(var gr=U.allocType(Rn,dt.length),wr=0;wr>>31<<15,gn=(Cn<<1>>>24)-127,pn=Cn>>13&1023;if(gn<-24)gr[wr]=ua;else if(gn<-14){var za=-14-gn;gr[wr]=ua+(pn+1024>>za)}else gn>15?gr[wr]=ua+31744:gr[wr]=ua+(gn+15<<10)+pn}return gr}function Un(dt){return Array.isArray(dt)||Sr(dt)}var cn=34467,In=3553,xi=34067,Ea=34069,Pi=6408,Xi=6406,uo=6407,so=6409,Eo=6410,vi=32854,ns=32855,Xo=36194,Ys=32819,vs=32820,es=33635,qo=34042,Zs=6402,Hs=34041,sl=35904,ds=35906,Ko=36193,_o=33776,ps=33777,ll=33778,kl=33779,Rl=35986,Cs=35987,pi=34798,no=35840,Cl=35841,Ds=35842,No=35843,Il=36196,Ws=5121,ul=5123,xu=5125,eo=5126,_s=10242,as=10243,Hl=10497,Gl=33071,Do=33648,su=10240,fu=10241,Bs=9728,wl=9729,Bl=9984,jl=9985,Hu=9986,uf=9987,qc=33170,Qc=4352,Lh=4353,yh=4354,Tl=34046,Lc=3317,Ph=37440,nc=37441,Gu=37443,ac=37444,ef=33984,Kl=[Bl,Hu,jl,uf],Xu=[0,so,Eo,uo,Pi],Gs={};Gs[so]=Gs[Xi]=Gs[Zs]=1,Gs[Hs]=Gs[Eo]=2,Gs[uo]=Gs[sl]=3,Gs[Pi]=Gs[ds]=4;function Dl(dt){return"[object "+dt+"]"}var wf=Dl("HTMLCanvasElement"),yc=Dl("OffscreenCanvas"),If=Dl("CanvasRenderingContext2D"),lu=Dl("ImageBitmap"),bv=Dl("HTMLImageElement"),Ns=Dl("HTMLVideoElement"),Bv=Object.keys(Je).concat([wf,yc,If,lu,bv,Ns]),dl=[];dl[Ws]=1,dl[eo]=4,dl[Ko]=2,dl[ul]=2,dl[xu]=4;var Bo=[];Bo[vi]=2,Bo[ns]=2,Bo[Xo]=2,Bo[Hs]=4,Bo[_o]=.5,Bo[ps]=.5,Bo[ll]=1,Bo[kl]=1,Bo[Rl]=.5,Bo[Cs]=1,Bo[pi]=1,Bo[no]=.5,Bo[Cl]=.25,Bo[Ds]=.5,Bo[No]=.25,Bo[Il]=.5;function Kf(dt){return Array.isArray(dt)&&(dt.length===0||typeof dt[0]=="number")}function tf(dt){if(!Array.isArray(dt))return!1;var gr=dt.length;return!(gr===0||!Un(dt[0]))}function Iu(dt){return Object.prototype.toString.call(dt)}function Rh(dt){return Iu(dt)===wf}function Df(dt){return Iu(dt)===yc}function ih(dt){return Iu(dt)===If}function Yu(dt){return Iu(dt)===lu}function sv(dt){return Iu(dt)===bv}function Uh(dt){return Iu(dt)===Ns}function oh(dt){if(!dt)return!1;var gr=Iu(dt);return Bv.indexOf(gr)>=0?!0:Kf(dt)||tf(dt)||Br(dt)}function zf(dt){return Je[Object.prototype.toString.call(dt)]|0}function Ih(dt,gr){var wr=gr.length;switch(dt.type){case Ws:case ul:case xu:case eo:var Cn=U.allocType(dt.type,wr);Cn.set(gr),dt.data=Cn;break;case Ko:dt.data=jn(gr);break}}function Dh(dt,gr){return U.allocType(dt.type===Ko?eo:dt.type,gr)}function rf(dt,gr){dt.type===Ko?(dt.data=jn(gr),U.freeType(gr)):dt.data=gr}function jh(dt,gr,wr,Cn,ua,gn){for(var pn=dt.width,za=dt.height,Ia=dt.channels,Da=pn*za*Ia,Wa=Dh(dt,Da),Bi=0,bi=0;bi=1;)za+=pn*Ia*Ia,Ia/=2;return za}else return pn*wr*Cn}function cf(dt,gr,wr,Cn,ua,gn,pn){var za={"don't care":Qc,"dont care":Qc,nice:yh,fast:Lh},Ia={repeat:Hl,clamp:Gl,mirror:Do},Da={nearest:Bs,linear:wl},Wa=h({mipmap:uf,"nearest mipmap nearest":Bl,"linear mipmap nearest":jl,"nearest mipmap linear":Hu,"linear mipmap linear":uf},Da),Bi={none:0,browser:ac},bi={uint8:Ws,rgba4:Ys,rgb565:es,"rgb5 a1":vs},Ha={alpha:Xi,luminance:so,"luminance alpha":Eo,rgb:uo,rgba:Pi,rgba4:vi,"rgb5 a1":ns,rgb565:Xo},ga={};gr.ext_srgb&&(Ha.srgb=sl,Ha.srgba=ds),gr.oes_texture_float&&(bi.float32=bi.float=eo),gr.oes_texture_half_float&&(bi.float16=bi["half float"]=Ko),gr.webgl_depth_texture&&(h(Ha,{depth:Zs,"depth stencil":Hs}),h(bi,{uint16:ul,uint32:xu,"depth stencil":qo})),gr.webgl_compressed_texture_s3tc&&h(ga,{"rgb s3tc dxt1":_o,"rgba s3tc dxt1":ps,"rgba s3tc dxt3":ll,"rgba s3tc dxt5":kl}),gr.webgl_compressed_texture_atc&&h(ga,{"rgb atc":Rl,"rgba atc explicit alpha":Cs,"rgba atc interpolated alpha":pi}),gr.webgl_compressed_texture_pvrtc&&h(ga,{"rgb pvrtc 4bppv1":no,"rgb pvrtc 2bppv1":Cl,"rgba pvrtc 4bppv1":Ds,"rgba pvrtc 2bppv1":No}),gr.webgl_compressed_texture_etc1&&(ga["rgb etc1"]=Il);var rn=Array.prototype.slice.call(dt.getParameter(cn));Object.keys(ga).forEach(function(q){var he=ga[q];rn.indexOf(he)>=0&&(Ha[q]=he)});var Fn=Object.keys(Ha);wr.textureFormats=Fn;var ea=[];Object.keys(Ha).forEach(function(q){var he=Ha[q];ea[he]=q});var ya=[];Object.keys(bi).forEach(function(q){var he=bi[q];ya[he]=q});var na=[];Object.keys(Da).forEach(function(q){var he=Da[q];na[he]=q});var di=[];Object.keys(Wa).forEach(function(q){var he=Wa[q];di[he]=q});var Ua=[];Object.keys(Ia).forEach(function(q){var he=Ia[q];Ua[he]=q});var Di=Fn.reduce(function(q,he){var J=Ha[he];return J===so||J===Xi||J===so||J===Eo||J===Zs||J===Hs||gr.ext_srgb&&(J===sl||J===ds)?q[J]=J:J===ns||he.indexOf("rgba")>=0?q[J]=Pi:q[J]=uo,q},{});function aa(){this.internalformat=Pi,this.format=Pi,this.type=Ws,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=ac,this.width=0,this.height=0,this.channels=0}function Zn(q,he){q.internalformat=he.internalformat,q.format=he.format,q.type=he.type,q.compressed=he.compressed,q.premultiplyAlpha=he.premultiplyAlpha,q.flipY=he.flipY,q.unpackAlignment=he.unpackAlignment,q.colorSpace=he.colorSpace,q.width=he.width,q.height=he.height,q.channels=he.channels}function li(q,he){if(!(typeof he!="object"||!he)){if("premultiplyAlpha"in he&&(q.premultiplyAlpha=he.premultiplyAlpha),"flipY"in he&&(q.flipY=he.flipY),"alignment"in he&&(q.unpackAlignment=he.alignment),"colorSpace"in he&&(q.colorSpace=Bi[he.colorSpace]),"type"in he){var J=he.type;q.type=bi[J]}var _e=q.width,qe=q.height,lt=q.channels,vt=!1;"shape"in he?(_e=he.shape[0],qe=he.shape[1],he.shape.length===3&&(lt=he.shape[2],vt=!0)):("radius"in he&&(_e=qe=he.radius),"width"in he&&(_e=he.width),"height"in he&&(qe=he.height),"channels"in he&&(lt=he.channels,vt=!0)),q.width=_e|0,q.height=qe|0,q.channels=lt|0;var Ke=!1;if("format"in he){var at=he.format,bt=q.internalformat=Ha[at];q.format=Di[bt],at in bi&&("type"in he||(q.type=bi[at])),at in ga&&(q.compressed=!0),Ke=!0}!vt&&Ke?q.channels=Gs[q.format]:vt&&!Ke&&q.channels!==Xu[q.format]&&(q.format=q.internalformat=Xu[q.channels])}}function Dn(q){dt.pixelStorei(Ph,q.flipY),dt.pixelStorei(nc,q.premultiplyAlpha),dt.pixelStorei(Gu,q.colorSpace),dt.pixelStorei(Lc,q.unpackAlignment)}function $a(){aa.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Oa(q,he){var J=null;if(oh(he)?J=he:he&&(li(q,he),"x"in he&&(q.xOffset=he.x|0),"y"in he&&(q.yOffset=he.y|0),oh(he.data)&&(J=he.data)),he.copy){var _e=ua.viewportWidth,qe=ua.viewportHeight;q.width=q.width||_e-q.xOffset,q.height=q.height||qe-q.yOffset,q.needsCopy=!0}else if(!J)q.width=q.width||1,q.height=q.height||1,q.channels=q.channels||4;else if(Sr(J))q.channels=q.channels||4,q.data=J,!("type"in he)&&q.type===Ws&&(q.type=zf(J));else if(Kf(J))q.channels=q.channels||4,Ih(q,J),q.alignment=1,q.needsFree=!0;else if(Br(J)){var lt=J.data;!Array.isArray(lt)&&q.type===Ws&&(q.type=zf(lt));var vt=J.shape,Ke=J.stride,at,bt,Zt,Vt,Kt,nr;vt.length===3?(Zt=vt[2],nr=Ke[2]):(Zt=1,nr=1),at=vt[0],bt=vt[1],Vt=Ke[0],Kt=Ke[1],q.alignment=1,q.width=at,q.height=bt,q.channels=Zt,q.format=q.internalformat=Xu[Zt],q.needsFree=!0,jh(q,lt,Vt,Kt,nr,J.offset)}else if(Rh(J)||Df(J)||ih(J))Rh(J)||Df(J)?q.element=J:q.element=J.canvas,q.width=q.element.width,q.height=q.element.height,q.channels=4;else if(Yu(J))q.element=J,q.width=J.width,q.height=J.height,q.channels=4;else if(sv(J))q.element=J,q.width=J.naturalWidth,q.height=J.naturalHeight,q.channels=4;else if(Uh(J))q.element=J,q.width=J.videoWidth,q.height=J.videoHeight,q.channels=4;else if(tf(J)){var er=q.width||J[0].length,Bt=q.height||J.length,Xt=q.channels;Un(J[0][0])?Xt=Xt||J[0][0].length:Xt=Xt||1;for(var Ht=je.shape(J),zr=1,Yr=0;Yr>=qe,J.height>>=qe,Oa(J,_e[qe]),q.mipmask|=1<=0&&!("faces"in he)&&(q.genMipmaps=!0)}if("mag"in he){var _e=he.mag;q.magFilter=Da[_e]}var qe=q.wrapS,lt=q.wrapT;if("wrap"in he){var vt=he.wrap;typeof vt=="string"?qe=lt=Ia[vt]:Array.isArray(vt)&&(qe=Ia[vt[0]],lt=Ia[vt[1]])}else{if("wrapS"in he){var Ke=he.wrapS;qe=Ia[Ke]}if("wrapT"in he){var at=he.wrapT;lt=Ia[at]}}if(q.wrapS=qe,q.wrapT=lt,"anisotropic"in he&&(he.anisotropic,q.anisotropic=he.anisotropic),"mipmap"in he){var bt=!1;switch(typeof he.mipmap){case"string":q.mipmapHint=za[he.mipmap],q.genMipmaps=!0,bt=!0;break;case"boolean":bt=q.genMipmaps=he.mipmap;break;case"object":q.genMipmaps=!1,bt=!0;break}bt&&!("min"in he)&&(q.minFilter=Bl)}}function Wu(q,he){dt.texParameteri(he,fu,q.minFilter),dt.texParameteri(he,su,q.magFilter),dt.texParameteri(he,_s,q.wrapS),dt.texParameteri(he,as,q.wrapT),gr.ext_texture_filter_anisotropic&&dt.texParameteri(he,Tl,q.anisotropic),q.genMipmaps&&(dt.hint(qc,q.mipmapHint),dt.generateMipmap(he))}var pf=0,Ql={},cu=wr.maxTextureUnits,vo=Array(cu).map(function(){return null});function Ku(q){aa.call(this),this.mipmask=0,this.internalformat=Pi,this.id=pf++,this.refCount=1,this.target=q,this.texture=dt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new du,pn.profile&&(this.stats={size:0})}function Vs(q){dt.activeTexture(ef),dt.bindTexture(q.target,q.texture)}function Fl(){var q=vo[0];q?dt.bindTexture(q.target,q.texture):dt.bindTexture(In,null)}function uc(q){var he=q.texture,J=q.unit,_e=q.target;J>=0&&(dt.activeTexture(ef+J),dt.bindTexture(_e,null),vo[J]=null),dt.deleteTexture(he),q.texture=null,q.params=null,q.pixels=null,q.refCount=0,delete Ql[q.id],gn.textureCount--}h(Ku.prototype,{bind:function(){var q=this;q.bindCount+=1;var he=q.unit;if(he<0){for(var J=0;J0)continue;_e.unit=-1}vo[J]=q,he=J;break}pn.profile&&gn.maxTextureUnits>Kt)-Zt,nr.height=nr.height||(J.height>>Kt)-Vt,Vs(J),Po(nr,In,Zt,Vt,Kt),Fl(),Ya(nr),_e}function lt(vt,Ke){var at=vt|0,bt=Ke|0||at;if(at===J.width&&bt===J.height)return _e;_e.width=J.width=at,_e.height=J.height=bt,Vs(J);for(var Zt=0;J.mipmask>>Zt;++Zt){var Vt=at>>Zt,Kt=bt>>Zt;if(!Vt||!Kt)break;dt.texImage2D(In,Zt,J.format,Vt,Kt,0,J.format,J.type,null)}return Fl(),pn.profile&&(J.stats.size=Tf(J.internalformat,J.type,at,bt,!1,!1)),_e}return _e(q,he),_e.subimage=qe,_e.resize=lt,_e._reglType="texture2d",_e._texture=J,pn.profile&&(_e.stats=J.stats),_e.destroy=function(){J.decRef()},_e}function Co(q,he,J,_e,qe,lt){var vt=new Ku(xi);Ql[vt.id]=vt,gn.cubeCount++;var Ke=new Array(6);function at(Vt,Kt,nr,er,Bt,Xt){var Ht,zr=vt.texInfo;for(du.call(zr),Ht=0;Ht<6;++Ht)Ke[Ht]=Tu();if(typeof Vt=="number"||!Vt){var Yr=Vt|0||1;for(Ht=0;Ht<6;++Ht)Ho(Ke[Ht],Yr,Yr)}else if(typeof Vt=="object")if(Kt)ts(Ke[0],Vt),ts(Ke[1],Kt),ts(Ke[2],nr),ts(Ke[3],er),ts(Ke[4],Bt),ts(Ke[5],Xt);else if(Du(zr,Vt),li(vt,Vt),"faces"in Vt){var fn=Vt.faces;for(Ht=0;Ht<6;++Ht)Zn(Ke[Ht],vt),ts(Ke[Ht],fn[Ht])}else for(Ht=0;Ht<6;++Ht)ts(Ke[Ht],Vt);for(Zn(vt,Ke[0]),zr.genMipmaps?vt.mipmask=(Ke[0].width<<1)-1:vt.mipmask=Ke[0].mipmask,vt.internalformat=Ke[0].internalformat,at.width=Ke[0].width,at.height=Ke[0].height,Vs(vt),Ht=0;Ht<6;++Ht)cl(Ke[Ht],Ea+Ht);for(Wu(zr,xi),Fl(),pn.profile&&(vt.stats.size=Tf(vt.internalformat,vt.type,at.width,at.height,zr.genMipmaps,!0)),at.format=ea[vt.internalformat],at.type=ya[vt.type],at.mag=na[zr.magFilter],at.min=di[zr.minFilter],at.wrapS=Ua[zr.wrapS],at.wrapT=Ua[zr.wrapT],Ht=0;Ht<6;++Ht)tl(Ke[Ht]);return at}function bt(Vt,Kt,nr,er,Bt){var Xt=nr|0,Ht=er|0,zr=Bt|0,Yr=ji();return Zn(Yr,vt),Yr.width=0,Yr.height=0,Oa(Yr,Kt),Yr.width=Yr.width||(vt.width>>zr)-Xt,Yr.height=Yr.height||(vt.height>>zr)-Ht,Vs(vt),Po(Yr,Ea+Vt,Xt,Ht,zr),Fl(),Ya(Yr),at}function Zt(Vt){var Kt=Vt|0;if(Kt!==vt.width){at.width=vt.width=Kt,at.height=vt.height=Kt,Vs(vt);for(var nr=0;nr<6;++nr)for(var er=0;vt.mipmask>>er;++er)dt.texImage2D(Ea+nr,er,vt.format,Kt>>er,Kt>>er,0,vt.format,vt.type,null);return Fl(),pn.profile&&(vt.stats.size=Tf(vt.internalformat,vt.type,at.width,at.height,!1,!0)),at}}return at(q,he,J,_e,qe,lt),at.subimage=bt,at.resize=Zt,at._reglType="textureCube",at._texture=vt,pn.profile&&(at.stats=vt.stats),at.destroy=function(){vt.decRef()},at}function ms(){for(var q=0;q>_e,J.height>>_e,0,J.internalformat,J.type,null);else for(var qe=0;qe<6;++qe)dt.texImage2D(Ea+qe,_e,J.internalformat,J.width>>_e,J.height>>_e,0,J.internalformat,J.type,null);Wu(J.texInfo,J.target)})}function be(){for(var q=0;q=0?Tu=!0:Ia.indexOf(tl)>=0&&(Tu=!1))),("depthTexture"in vo||"depthStencilTexture"in vo)&&(cu=!!(vo.depthTexture||vo.depthStencilTexture)),"depth"in vo&&(typeof vo.depth=="boolean"?ts=vo.depth:(Wu=vo.depth,cl=!1)),"stencil"in vo&&(typeof vo.stencil=="boolean"?cl=vo.stencil:(pf=vo.stencil,ts=!1)),"depthStencil"in vo&&(typeof vo.depthStencil=="boolean"?ts=cl=vo.depthStencil:(Ql=vo.depthStencil,ts=!1,cl=!1))}var Vs=null,Fl=null,uc=null,cc=null;if(Array.isArray(rs))Vs=rs.map(Ha);else if(rs)Vs=[Ha(rs)];else for(Vs=new Array(Du),Ya=0;Ya0&&(ji.depth=$a[0].depth,ji.stencil=$a[0].stencil,ji.depthStencil=$a[0].depthStencil),$a[wi]?$a[wi](ji):$a[wi]=aa(ji)}return h(Oa,{width:Ya,height:Ya,color:tl})}function Oi(Po){var wi,ji=Po|0;if(ji===Oa.width)return Oa;var Ya=Oa.color;for(wi=0;wi=Mo.byteLength?Ho.subdata(Mo):(Ho.destroy(),Zn.buffers[wi]=null)),Zn.buffers[wi]||(Ho=Zn.buffers[wi]=ua.create(ji,eh,!1,!0)),Ya.buffer=ua.getBuffer(Ho),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1,Oi[wi]=1}else ua.getBuffer(ji)?(Ya.buffer=ua.getBuffer(ji),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1):ua.getBuffer(ji.buffer)?(Ya.buffer=ua.getBuffer(ji.buffer),Ya.size=(+ji.size||Ya.buffer.dimension)|0,Ya.normalized=!!ji.normalized||!1,"type"in ji?Ya.type=En[ji.type]:Ya.type=Ya.buffer.dtype,Ya.offset=(ji.offset||0)|0,Ya.stride=(ji.stride||0)|0,Ya.divisor=(ji.divisor||0)|0,Ya.state=1):"x"in ji&&(Ya.x=+ji.x||0,Ya.y=+ji.y||0,Ya.z=+ji.z||0,Ya.w=+ji.w||0,Ya.state=2)}for(var ts=0;ts1)for(var Dn=0;Dnrn&&(rn=Fn.stats.uniformsCount)}),rn},wr.getMaxAttributesCount=function(){var rn=0;return Wa.forEach(function(Fn){Fn.stats.attributesCount>rn&&(rn=Fn.stats.attributesCount)}),rn});function ga(){ua={},gn={};for(var rn=0;rn>>4&15)+gr.charAt(Cn&15);return wr}function vf(dt){for(var gr="",wr=-1,Cn,ua;++wr>>6&31,128|Cn&63):Cn<=65535?gr+=String.fromCharCode(224|Cn>>>12&15,128|Cn>>>6&63,128|Cn&63):Cn<=2097151&&(gr+=String.fromCharCode(240|Cn>>>18&7,128|Cn>>>12&63,128|Cn>>>6&63,128|Cn&63));return gr}function bu(dt){for(var gr=Array(dt.length>>2),wr=0;wr>5]|=(dt.charCodeAt(wr/8)&255)<<24-wr%32;return gr}function _c(dt){for(var gr="",wr=0;wr>5]>>>24-wr%32&255);return gr}function hu(dt,gr){return dt>>>gr|dt<<32-gr}function Nf(dt,gr){return dt>>>gr}function df(dt,gr,wr){return dt&gr^~dt&wr}function Fh(dt,gr,wr){return dt&gr^dt&wr^gr&wr}function ur(dt){return hu(dt,2)^hu(dt,13)^hu(dt,22)}function Pr(dt){return hu(dt,6)^hu(dt,11)^hu(dt,25)}function dn(dt){return hu(dt,7)^hu(dt,18)^Nf(dt,3)}function nn(dt){return hu(dt,17)^hu(dt,19)^Nf(dt,10)}var On=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function Ta(dt,gr){var wr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Cn=new Array(64),ua,gn,pn,za,Ia,Da,Wa,Bi,bi,Ha,ga,rn;for(dt[gr>>5]|=128<<24-gr%32,dt[(gr+64>>9<<4)+15]=gr,bi=0;bi>16)+(gr>>16)+(wr>>16);return Cn<<16|wr&65535}function ri(dt){return Array.prototype.slice.call(dt)}function fi(dt){return ri(dt).join("")}function Ni(dt){var gr=dt&&dt.cache,wr=0,Cn=[],ua=[],gn=[];function pn(ga,rn){var Fn=rn&&rn.stable;if(!Fn){for(var ea=0;ea0&&(ga.push(ya,"="),ga.push.apply(ga,ri(arguments)),ga.push(";")),ya}return h(rn,{def:ea,toString:function(){return fi([Fn.length>0?"var "+Fn.join(",")+";":"",fi(ga)])}})}function Ia(){var ga=za(),rn=za(),Fn=ga.toString,ea=rn.toString;function ya(na,di){rn(na,di,"=",ga.def(na,di),";")}return h(function(){ga.apply(ga,ri(arguments))},{def:ga.def,entry:ga,exit:rn,save:ya,set:function(na,di,Ua){ya(na,di),ga(na,di,"=",Ua,";")},toString:function(){return Fn()+ea()}})}function Da(){var ga=fi(arguments),rn=Ia(),Fn=Ia(),ea=rn.toString,ya=Fn.toString;return h(rn,{then:function(){return rn.apply(rn,ri(arguments)),this},else:function(){return Fn.apply(Fn,ri(arguments)),this},toString:function(){var na=ya();return na&&(na="else{"+na+"}"),fi(["if(",ga,"){",ea(),"}",na])}})}var Wa=za(),Bi={};function bi(ga,rn){var Fn=[];function ea(){var Di="a"+Fn.length;return Fn.push(Di),Di}rn=rn||0;for(var ya=0;ya[y.viewport.x,y.viewport.y,d.viewportWidth,d.viewportHeight]},attributes:{color:{buffer:T,offset:(d,y)=>y.offset*4,divisor:1},position:{buffer:p,offset:(d,y)=>y.offset*8,divisor:1},positionFract:{buffer:v,offset:(d,y)=>y.offset*8,divisor:1},error:{buffer:l,offset:(d,y)=>y.offset*16,divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:a.prop("viewport")},viewport:a.prop("viewport"),stencil:!1,instances:a.prop("count"),count:n.length}),e(M,{update:m,draw:_,destroy:u,regl:a,gl:f,canvas:f.canvas,groups:A}),M;function M(d){d?m(d):d===null&&u(),_()}function _(d){if(typeof d=="number")return w(d);d&&!Array.isArray(d)&&(d=[d]),a._refresh(),A.forEach((y,I)=>{if(y){if(d&&(d[I]?y.draw=!0:y.draw=!1),!y.draw){y.draw=!0;return}w(I)}})}function w(d){typeof d=="number"&&(d=A[d]),d!=null&&d&&d.count&&d.color&&d.opacity&&d.positions&&d.positions.length>1&&(d.scaleRatio=[d.scale[0]*d.viewport.width,d.scale[1]*d.viewport.height],c(d),d.after&&d.after(d))}function m(d){if(!d)return;d.length!=null?typeof d[0]=="number"&&(d=[{positions:d}]):Array.isArray(d)||(d=[d]);let y=0,I=0;if(M.groups=A=d.map((F,N)=>{let B=A[N];if(F)typeof F=="function"?F={after:F}:typeof F[0]=="number"&&(F={positions:F});else return B;return F=E(F,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),B||(A[N]=B={id:N,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},F=e({},x,F)),S(B,F,[{lineWidth:R=>+R*.5,capSize:R=>+R*.5,opacity:parseFloat,errors:R=>(R=t(R),I+=R.length,R),positions:(R,U)=>(R=t(R,"float64"),U.count=Math.floor(R.length/2),U.bounds=h(R,2),U.offset=y,y+=U.count,R)},{color:(R,U)=>{let j=U.count;if(R||(R="transparent"),!Array.isArray(R)||typeof R[0]=="number"){let re=R;R=Array(j);for(let fe=0;fe{let Z=U.bounds;return R||(R=Z),U.scale=[1/(R[2]-R[0]),1/(R[3]-R[1])],U.translate=[-R[0],-R[1]],U.scaleFract=o(U.scale),U.translateFract=o(U.translate),R},viewport:R=>{let U;return Array.isArray(R)?U={x:R[0],y:R[1],width:R[2]-R[0],height:R[3]-R[1]}:R?(U={x:R.x||R.left||0,y:R.y||R.top||0},R.right?U.width=R.right-U.x:U.width=R.w||R.width||0,R.bottom?U.height=R.bottom-U.y:U.height=R.h||R.height||0):U={x:0,y:0,width:f.drawingBufferWidth,height:f.drawingBufferHeight},U}}]),B}),y||I){let F=A.reduce((U,j,Z)=>U+(j?j.count:0),0),N=new Float64Array(F*2),B=new Uint8Array(F*4),R=new Float32Array(F*4);A.forEach((U,j)=>{if(!U)return;let{positions:Z,count:re,offset:fe,color:le,errors:ce}=U;re&&(B.set(le,fe*4),R.set(ce,fe*4),N.set(Z,fe*2))});var L=r(N);p(L);var z=o(N,L);v(z),T(B),l(R)}}function u(){p.destroy(),v.destroy(),T.destroy(),l.destroy(),g.destroy()}}}}),tz=Ge({"node_modules/unquote/index.js"(K,G){var h=/[\'\"]/;G.exports=function(S){return S?(h.test(S.charAt(0))&&(S=S.substr(1)),h.test(S.charAt(S.length-1))&&(S=S.substr(0,S.length-1)),S):""}}}),eL=Ge({"node_modules/css-global-keywords/index.json"(K,G){G.exports=["inherit","initial","unset"]}}),tL=Ge({"node_modules/css-system-font-keywords/index.json"(K,G){G.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),rL=Ge({"node_modules/css-font-weight-keywords/index.json"(K,G){G.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),nL=Ge({"node_modules/css-font-style-keywords/index.json"(K,G){G.exports=["normal","italic","oblique"]}}),aL=Ge({"node_modules/css-font-stretch-keywords/index.json"(K,G){G.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),rz=Ge({"node_modules/parenthesis/index.js"(K,G){function h(E,e){if(typeof E!="string")return[E];var t=[E];typeof e=="string"||Array.isArray(e)?e={brackets:e}:e||(e={});var r=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],o=e.escape||"___",n=!!e.flat;r.forEach(function(s){var f=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),c=[];function p(v,T,l){var g=t.push(v.slice(s[0].length,-s[1].length))-1;return c.push(g),o+g+o}t.forEach(function(v,T){for(var l,g=0;v!=l;)if(l=v,v=v.replace(f,p),g++>1e4)throw Error("References have circular dependency. Please, check them.");t[T]=v}),c=c.reverse(),t=t.map(function(v){return c.forEach(function(T){v=v.replace(new RegExp("(\\"+o+T+"\\"+o+")","g"),s[0]+"$1"+s[1])}),v})});var i=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(s,f,c){for(var p=[],v,T=0;v=i.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");p.push(s.slice(0,v.index)),p.push(a(f[v[1]],f)),s=s.slice(v.index+v[0].length)}return p.push(s),p}return n?t:a(t[0],t)}function b(E,e){if(e&&e.flat){var t=e&&e.escape||"___",r=E[0],o;if(!r)return"";for(var n=new RegExp("\\"+t+"([0-9]+)\\"+t),i=0;r!=o;){if(i++>1e4)throw Error("Circular references in "+E);o=r,r=r.replace(n,a)}return r}return E.reduce(function s(f,c){return Array.isArray(c)&&(c=c.reduce(s,"")),f+c},"");function a(s,f){if(E[f]==null)throw Error("Reference "+f+"is undefined");return E[f]}}function S(E,e){return Array.isArray(E)?b(E,e):h(E,e)}S.parse=h,S.stringify=b,G.exports=S}}),nz=Ge({"node_modules/string-split-by/index.js"(K,G){var h=rz();G.exports=function(S,E,e){if(S==null)throw Error("First argument should be a string");if(E==null)throw Error("Separator should be a string or a RegExp");e?(typeof e=="string"||Array.isArray(e))&&(e={ignore:e}):e={},e.escape==null&&(e.escape=!0),e.ignore==null?e.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof e.ignore=="string"&&(e.ignore=[e.ignore]),e.ignore=e.ignore.map(function(f){return f.length===1&&(f=f+f),f}));var t=h.parse(S,{flat:!0,brackets:e.ignore}),r=t[0],o=r.split(E);if(e.escape){for(var n=[],i=0;i1&&yr===wr&&(yr==='"'||yr==="'"))return['"'+r(mt.substr(1,mt.length-2))+'"'];var Ln=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(mt);if(Ln)return o(mt.substr(0,Ln.index)).concat(o(Ln[1])).concat(o(mt.substr(Ln.index+Ln[0].length)));var ca=mt.split(".");if(ca.length===1)return['"'+r(mt)+'"'];for(var yn=[],mn=0;mn"u"?1:window.devicePixelRatio,Za=!1,Fi={},yi=function(nn){},Ga=function(){};if(typeof yr=="string"?wr=document.querySelector(yr):typeof yr=="object"&&(g(yr)?wr=yr:x(yr)?(yn=yr,ca=yn.canvas):("gl"in yr?yn=yr.gl:"canvas"in yr?ca=M(yr.canvas):"container"in yr&&(Ln=M(yr.container)),"attributes"in yr&&(mn=yr.attributes),"extensions"in yr&&(za=A(yr.extensions)),"optionalExtensions"in yr&&(Ia=A(yr.optionalExtensions)),"onDone"in yr&&(yi=yr.onDone),"profile"in yr&&(Za=!!yr.profile),"pixelRatio"in yr&&(Da=+yr.pixelRatio),"cachedCode"in yr&&(Fi=yr.cachedCode))),wr&&(wr.nodeName.toLowerCase()==="canvas"?ca=wr:Ln=wr),!yn){if(!ca){var ma=T(Ln||document.body,yi,Da);if(!ma)return null;ca=ma.canvas,Ga=ma.onDestroy}mn.premultipliedAlpha===void 0&&(mn.premultipliedAlpha=!0),yn=l(ca,mn)}return yn?{gl:yn,canvas:ca,container:Ln,extensions:za,optionalExtensions:Ia,pixelRatio:Da,profile:Za,cachedCode:Fi,onDone:yi,onDestroy:Ga}:(Ga(),yi("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(mt,yr){var wr={};function Ln(mn){var za=mn.toLowerCase(),Ia;try{Ia=wr[za]=mt.getExtension(za)}catch{}return!!Ia}for(var ca=0;ca65535)<<4,mt>>>=yr,wr=(mt>255)<<3,mt>>>=wr,yr|=wr,wr=(mt>15)<<2,mt>>>=wr,yr|=wr,wr=(mt>3)<<1,mt>>>=wr,yr|=wr,yr|mt>>1}function R(){var mt=m(8,function(){return[]});function yr(yn){var mn=N(yn),za=mt[B(mn)>>2];return za.length>0?za.pop():new ArrayBuffer(mn)}function wr(yn){mt[B(yn.byteLength)>>2].push(yn)}function Ln(yn,mn){var za=null;switch(yn){case u:za=new Int8Array(yr(mn),0,mn);break;case d:za=new Uint8Array(yr(mn),0,mn);break;case y:za=new Int16Array(yr(2*mn),0,mn);break;case I:za=new Uint16Array(yr(2*mn),0,mn);break;case L:za=new Int32Array(yr(4*mn),0,mn);break;case z:za=new Uint32Array(yr(4*mn),0,mn);break;case F:za=new Float32Array(yr(4*mn),0,mn);break;default:return null}return za.length!==mn?za.subarray(0,mn):za}function ca(yn){wr(yn.buffer)}return{alloc:yr,free:wr,allocType:Ln,freeType:ca}}var U=R();U.zero=R();var j=3408,Z=3410,re=3411,fe=3412,le=3413,ce=3414,V=3415,ee=33901,ne=33902,$=3379,ue=3386,te=34921,H=36347,ae=36348,ie=35661,de=35660,Se=34930,Le=36349,Fe=34076,ze=34024,Ye=7936,st=7937,ct=7938,at=35724,et=34047,Pe=36063,Ae=34852,pe=3553,Ne=34067,ut=34069,dt=33984,nt=6408,Ft=5126,Nt=5121,Qt=36160,ar=36053,kr=36064,Er=16384,$r=function(mt,yr){var wr=1;yr.ext_texture_filter_anisotropic&&(wr=mt.getParameter(et));var Ln=1,ca=1;yr.webgl_draw_buffers&&(Ln=mt.getParameter(Ae),ca=mt.getParameter(Pe));var yn=!!yr.oes_texture_float;if(yn){var mn=mt.createTexture();mt.bindTexture(pe,mn),mt.texImage2D(pe,0,nt,1,1,0,nt,Ft,null);var za=mt.createFramebuffer();if(mt.bindFramebuffer(Qt,za),mt.framebufferTexture2D(Qt,kr,pe,mn,0),mt.bindTexture(pe,null),mt.checkFramebufferStatus(Qt)!==ar)yn=!1;else{mt.viewport(0,0,1,1),mt.clearColor(1,0,0,1),mt.clear(Er);var Ia=U.allocType(Ft,4);mt.readPixels(0,0,1,1,nt,Ft,Ia),mt.getError()?yn=!1:(mt.deleteFramebuffer(za),mt.deleteTexture(mn),yn=Ia[0]===1),U.freeType(Ia)}}var Da=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Za=!0;if(!Da){var Fi=mt.createTexture(),yi=U.allocType(Nt,36);mt.activeTexture(dt),mt.bindTexture(Ne,Fi),mt.texImage2D(ut,0,nt,3,3,0,nt,Nt,yi),U.freeType(yi),mt.bindTexture(Ne,null),mt.deleteTexture(Fi),Za=!mt.getError()}return{colorBits:[mt.getParameter(Z),mt.getParameter(re),mt.getParameter(fe),mt.getParameter(le)],depthBits:mt.getParameter(ce),stencilBits:mt.getParameter(V),subpixelBits:mt.getParameter(j),extensions:Object.keys(yr).filter(function(Ga){return!!yr[Ga]}),maxAnisotropic:wr,maxDrawbuffers:Ln,maxColorAttachments:ca,pointSizeDims:mt.getParameter(ee),lineWidthDims:mt.getParameter(ne),maxViewportDims:mt.getParameter(ue),maxCombinedTextureUnits:mt.getParameter(ie),maxCubeMapSize:mt.getParameter(Fe),maxRenderbufferSize:mt.getParameter(ze),maxTextureUnits:mt.getParameter(Se),maxTextureSize:mt.getParameter($),maxAttributes:mt.getParameter(te),maxVertexUniforms:mt.getParameter(H),maxVertexTextureUnits:mt.getParameter(de),maxVaryingVectors:mt.getParameter(ae),maxFragmentUniforms:mt.getParameter(Le),glsl:mt.getParameter(at),renderer:mt.getParameter(st),vendor:mt.getParameter(Ye),version:mt.getParameter(ct),readFloat:yn,npotTextureCube:Za}},Sr=function(mt){return mt instanceof Uint8Array||mt instanceof Uint16Array||mt instanceof Uint32Array||mt instanceof Int8Array||mt instanceof Int16Array||mt instanceof Int32Array||mt instanceof Float32Array||mt instanceof Float64Array||mt instanceof Uint8ClampedArray};function Ur(mt){return!!mt&&typeof mt=="object"&&Array.isArray(mt.shape)&&Array.isArray(mt.stride)&&typeof mt.offset=="number"&&mt.shape.length===mt.stride.length&&(Array.isArray(mt.data)||Sr(mt.data))}var Mt=function(mt){return Object.keys(mt).map(function(yr){return mt[yr]})},je={shape:Xe,flatten:Ee};function Je(mt,yr,wr){for(var Ln=0;Ln0){var Ri;if(Array.isArray(Fn[0])){Ua=Un(Fn);for(var ia=1,Yn=1;Yn0){if(typeof ia[0]=="number"){var $a=U.allocType(aa.dtype,ia.length);Gr($a,ia),Ua($a,ii),U.freeType($a)}else if(Array.isArray(ia[0])||Sr(ia[0])){Dn=Un(ia);var Oa=na(ia,Dn,aa.dtype);Ua(Oa,ii),U.freeType(Oa)}}}else if(Ur(ia)){Dn=ia.shape;var zi=ia.stride,Lo=0,_i=0,ji=0,Ya=0;Dn.length===1?(Lo=Dn[0],_i=1,ji=zi[0],Ya=0):Dn.length===2&&(Lo=Dn[0],_i=Dn[1],ji=zi[0],Ya=zi[1]);var To=Array.isArray(ia.data)?aa.dtype:ur(ia.data),qo=U.allocType(To,Lo*_i);ln(qo,ia.data,Lo,_i,ji,Ya,ia.offset),Ua(qo,ii),U.freeType(qo)}return ci}return ta||ci(nn),ci._reglType="buffer",ci._buffer=aa,ci.subdata=Ri,wr.profile&&(ci.stats=aa.stats),ci.destroy=function(){yi(aa)},ci}function ma(){Mt(yn).forEach(function(nn){nn.buffer=mt.createBuffer(),mt.bindBuffer(nn.type,nn.buffer),mt.bufferData(nn.type,nn.persistentData||nn.byteLength,nn.usage)})}return wr.profile&&(yr.getTotalBufferSize=function(){var nn=0;return Object.keys(yn).forEach(function(Fn){nn+=yn[Fn].stats.size}),nn}),{create:Ga,createStream:Ia,destroyStream:Da,clear:function(){Mt(yn).forEach(yi),za.forEach(yi)},getBuffer:function(nn){return nn&&nn._buffer instanceof mn?nn._buffer:null},restore:ma,_initBuffer:Fi}}var An=0,Qn=0,pa=1,ha=1,_a=4,Ca=4,Hn={points:An,point:Qn,lines:pa,line:ha,triangles:_a,triangle:Ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},pi=0,Si=1,Dt=4,xt=5120,Cr=5121,jr=5122,Vr=5123,Dr=5124,qr=5125,un=34963,Jr=35040,At=35044;function lr(mt,yr,wr,Ln){var ca={},yn=0,mn={uint8:Cr,uint16:Vr};yr.oes_element_index_uint&&(mn.uint32=qr);function za(ma){this.id=yn++,ca[this.id]=this,this.buffer=ma,this.primType=Dt,this.vertCount=0,this.type=0}za.prototype.bind=function(){this.buffer.bind()};var Ia=[];function Da(ma){var nn=Ia.pop();return nn||(nn=new za(wr.create(null,un,!0,!1)._buffer)),Fi(nn,ma,Jr,-1,-1,0,0),nn}function Za(ma){Ia.push(ma)}function Fi(ma,nn,Fn,ta,ya,aa,ci){ma.buffer.bind();var Ua;if(nn){var Ri=ci;!ci&&(!Sr(nn)||Ur(nn)&&!Sr(nn.data))&&(Ri=yr.oes_element_index_uint?qr:Vr),wr._initBuffer(ma.buffer,nn,Fn,Ri,3)}else mt.bufferData(un,aa,Fn),ma.buffer.dtype=Ua||Cr,ma.buffer.usage=Fn,ma.buffer.dimension=3,ma.buffer.byteLength=aa;if(Ua=ci,!ci){switch(ma.buffer.dtype){case Cr:case xt:Ua=Cr;break;case Vr:case jr:Ua=Vr;break;case qr:case Dr:Ua=qr;break}ma.buffer.dtype=Ua}ma.type=Ua;var ia=ya;ia<0&&(ia=ma.buffer.byteLength,Ua===Vr?ia>>=1:Ua===qr&&(ia>>=2)),ma.vertCount=ia;var Yn=ta;if(ta<0){Yn=Dt;var ii=ma.buffer.dimension;ii===1&&(Yn=pi),ii===2&&(Yn=Si),ii===3&&(Yn=Dt)}ma.primType=Yn}function yi(ma){Ln.elementsCount--,delete ca[ma.id],ma.buffer.destroy(),ma.buffer=null}function Ga(ma,nn){var Fn=wr.create(null,un,!0),ta=new za(Fn._buffer);Ln.elementsCount++;function ya(aa){if(!aa)Fn(),ta.primType=Dt,ta.vertCount=0,ta.type=Cr;else if(typeof aa=="number")Fn(aa),ta.primType=Dt,ta.vertCount=aa|0,ta.type=Cr;else{var ci=null,Ua=At,Ri=-1,ia=-1,Yn=0,ii=0;Array.isArray(aa)||Sr(aa)||Ur(aa)?ci=aa:("data"in aa&&(ci=aa.data),"usage"in aa&&(Ua=ra[aa.usage]),"primitive"in aa&&(Ri=Hn[aa.primitive]),"count"in aa&&(ia=aa.count|0),"type"in aa&&(ii=mn[aa.type]),"length"in aa?Yn=aa.length|0:(Yn=ia,ii===Vr||ii===jr?Yn*=2:(ii===qr||ii===Dr)&&(Yn*=4))),Fi(ta,ci,Ua,Ri,ia,Yn,ii)}return ya}return ya(ma),ya._reglType="elements",ya._elements=ta,ya.subdata=function(aa,ci){return Fn.subdata(aa,ci),ya},ya.destroy=function(){yi(ta)},ya}return{create:Ga,createStream:Da,destroyStream:Za,getElements:function(ma){return typeof ma=="function"&&ma._elements instanceof za?ma._elements:null},clear:function(){Mt(ca).forEach(yi)}}}var zr=new Float32Array(1),cn=new Uint32Array(zr.buffer),Rn=5123;function qn(mt){for(var yr=U.allocType(Rn,mt.length),wr=0;wr>>31<<15,yn=(Ln<<1>>>24)-127,mn=Ln>>13&1023;if(yn<-24)yr[wr]=ca;else if(yn<-14){var za=-14-yn;yr[wr]=ca+(mn+1024>>za)}else yn>15?yr[wr]=ca+31744:yr[wr]=ca+(yn+15<<10)+mn}return yr}function jn(mt){return Array.isArray(mt)||Sr(mt)}var fn=34467,In=3553,gi=34067,Ea=34069,Ci=6408,Xi=6406,so=6407,io=6409,Mo=6410,ui=32854,ts=32855,Ho=36194,Xs=32819,cs=32820,Jo=33635,Uo=34042,Ys=6402,Vs=34041,ll=35904,fs=35906,Zo=36193,po=33776,hs=33777,ul=33778,kl=33779,Rl=35986,Ms=35987,fi=34798,to=35840,Cl=35841,Ps=35842,Fo=35843,Il=36196,Zs=5121,cl=5123,Au=5125,Qi=5126,gs=10242,rs=10243,Xl=10497,Yl=33071,Io=33648,cu=10240,vu=10241,Os=9728,wl=9729,Nl=9984,Vl=9985,Zu=9986,df=9987,Xc=33170,rf=4352,Dh=4353,wh=4354,Tl=34046,Dc=3317,zh=37440,oc=37441,Wu=37443,sc=37444,nf=33984,eu=[Nl,Zu,Vl,df],$u=[0,io,Mo,so,Ci],Hs={};Hs[io]=Hs[Xi]=Hs[Ys]=1,Hs[Vs]=Hs[Mo]=2,Hs[so]=Hs[ll]=3,Hs[Ci]=Hs[fs]=4;function Dl(mt){return"[object "+mt+"]"}var Mf=Dl("HTMLCanvasElement"),wc=Dl("OffscreenCanvas"),Ff=Dl("CanvasRenderingContext2D"),fu=Dl("ImageBitmap"),Sd=Dl("HTMLImageElement"),Fs=Dl("HTMLVideoElement"),Vd=Object.keys(Qe).concat([Mf,wc,Ff,fu,Sd,Fs]),pl=[];pl[Zs]=1,pl[Qi]=4,pl[Zo]=2,pl[cl]=2,pl[Au]=4;var Oo=[];Oo[ui]=2,Oo[ts]=2,Oo[Ho]=2,Oo[Vs]=4,Oo[po]=.5,Oo[hs]=.5,Oo[ul]=1,Oo[kl]=1,Oo[Rl]=.5,Oo[Ms]=1,Oo[fi]=1,Oo[to]=.5,Oo[Cl]=.25,Oo[Ps]=.5,Oo[Fo]=.25,Oo[Il]=.5;function th(mt){return Array.isArray(mt)&&(mt.length===0||typeof mt[0]=="number")}function af(mt){if(!Array.isArray(mt))return!1;var yr=mt.length;return!(yr===0||!jn(mt[0]))}function Ou(mt){return Object.prototype.toString.call(mt)}function Oh(mt){return Ou(mt)===Mf}function Bf(mt){return Ou(mt)===wc}function uh(mt){return Ou(mt)===Ff}function Ku(mt){return Ou(mt)===fu}function fd(mt){return Ou(mt)===Sd}function Hh(mt){return Ou(mt)===Fs}function ch(mt){if(!mt)return!1;var yr=Ou(mt);return Vd.indexOf(yr)>=0?!0:th(mt)||af(mt)||Ur(mt)}function Nf(mt){return Qe[Object.prototype.toString.call(mt)]|0}function Fh(mt,yr){var wr=yr.length;switch(mt.type){case Zs:case cl:case Au:case Qi:var Ln=U.allocType(mt.type,wr);Ln.set(yr),mt.data=Ln;break;case Zo:mt.data=qn(yr);break}}function Bh(mt,yr){return U.allocType(mt.type===Zo?Qi:mt.type,yr)}function of(mt,yr){mt.type===Zo?(mt.data=qn(yr),U.freeType(yr)):mt.data=yr}function Gh(mt,yr,wr,Ln,ca,yn){for(var mn=mt.width,za=mt.height,Ia=mt.channels,Da=mn*za*Ia,Za=Bh(mt,Da),Fi=0,yi=0;yi=1;)za+=mn*Ia*Ia,Ia/=2;return za}else return mn*wr*Ln}function vf(mt,yr,wr,Ln,ca,yn,mn){var za={"don't care":rf,"dont care":rf,nice:wh,fast:Dh},Ia={repeat:Xl,clamp:Yl,mirror:Io},Da={nearest:Os,linear:wl},Za=h({mipmap:df,"nearest mipmap nearest":Nl,"linear mipmap nearest":Vl,"nearest mipmap linear":Zu,"linear mipmap linear":df},Da),Fi={none:0,browser:sc},yi={uint8:Zs,rgba4:Xs,rgb565:Jo,"rgb5 a1":cs},Ga={alpha:Xi,luminance:io,"luminance alpha":Mo,rgb:so,rgba:Ci,rgba4:ui,"rgb5 a1":ts,rgb565:Ho},ma={};yr.ext_srgb&&(Ga.srgb=ll,Ga.srgba=fs),yr.oes_texture_float&&(yi.float32=yi.float=Qi),yr.oes_texture_half_float&&(yi.float16=yi["half float"]=Zo),yr.webgl_depth_texture&&(h(Ga,{depth:Ys,"depth stencil":Vs}),h(yi,{uint16:cl,uint32:Au,"depth stencil":Uo})),yr.webgl_compressed_texture_s3tc&&h(ma,{"rgb s3tc dxt1":po,"rgba s3tc dxt1":hs,"rgba s3tc dxt3":ul,"rgba s3tc dxt5":kl}),yr.webgl_compressed_texture_atc&&h(ma,{"rgb atc":Rl,"rgba atc explicit alpha":Ms,"rgba atc interpolated alpha":fi}),yr.webgl_compressed_texture_pvrtc&&h(ma,{"rgb pvrtc 4bppv1":to,"rgb pvrtc 2bppv1":Cl,"rgba pvrtc 4bppv1":Ps,"rgba pvrtc 2bppv1":Fo}),yr.webgl_compressed_texture_etc1&&(ma["rgb etc1"]=Il);var nn=Array.prototype.slice.call(mt.getParameter(fn));Object.keys(ma).forEach(function(q){var he=ma[q];nn.indexOf(he)>=0&&(Ga[q]=he)});var Fn=Object.keys(Ga);wr.textureFormats=Fn;var ta=[];Object.keys(Ga).forEach(function(q){var he=Ga[q];ta[he]=q});var ya=[];Object.keys(yi).forEach(function(q){var he=yi[q];ya[he]=q});var aa=[];Object.keys(Da).forEach(function(q){var he=Da[q];aa[he]=q});var ci=[];Object.keys(Za).forEach(function(q){var he=Za[q];ci[he]=q});var Ua=[];Object.keys(Ia).forEach(function(q){var he=Ia[q];Ua[he]=q});var Ri=Fn.reduce(function(q,he){var J=Ga[he];return J===io||J===Xi||J===io||J===Mo||J===Ys||J===Vs||yr.ext_srgb&&(J===ll||J===fs)?q[J]=J:J===ts||he.indexOf("rgba")>=0?q[J]=Ci:q[J]=so,q},{});function ia(){this.internalformat=Ci,this.format=Ci,this.type=Zs,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=sc,this.width=0,this.height=0,this.channels=0}function Yn(q,he){q.internalformat=he.internalformat,q.format=he.format,q.type=he.type,q.compressed=he.compressed,q.premultiplyAlpha=he.premultiplyAlpha,q.flipY=he.flipY,q.unpackAlignment=he.unpackAlignment,q.colorSpace=he.colorSpace,q.width=he.width,q.height=he.height,q.channels=he.channels}function ii(q,he){if(!(typeof he!="object"||!he)){if("premultiplyAlpha"in he&&(q.premultiplyAlpha=he.premultiplyAlpha),"flipY"in he&&(q.flipY=he.flipY),"alignment"in he&&(q.unpackAlignment=he.alignment),"colorSpace"in he&&(q.colorSpace=Fi[he.colorSpace]),"type"in he){var J=he.type;q.type=yi[J]}var _e=q.width,qe=q.height,ft=q.channels,pt=!1;"shape"in he?(_e=he.shape[0],qe=he.shape[1],he.shape.length===3&&(ft=he.shape[2],pt=!0)):("radius"in he&&(_e=qe=he.radius),"width"in he&&(_e=he.width),"height"in he&&(qe=he.height),"channels"in he&&(ft=he.channels,pt=!0)),q.width=_e|0,q.height=qe|0,q.channels=ft|0;var $e=!1;if("format"in he){var it=he.format,Tt=q.internalformat=Ga[it];q.format=Ri[Tt],it in yi&&("type"in he||(q.type=yi[it])),it in ma&&(q.compressed=!0),$e=!0}!pt&&$e?q.channels=Hs[q.format]:pt&&!$e&&q.channels!==$u[q.format]&&(q.format=q.internalformat=$u[q.channels])}}function Dn(q){mt.pixelStorei(zh,q.flipY),mt.pixelStorei(oc,q.premultiplyAlpha),mt.pixelStorei(Wu,q.colorSpace),mt.pixelStorei(Dc,q.unpackAlignment)}function $a(){ia.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Oa(q,he){var J=null;if(ch(he)?J=he:he&&(ii(q,he),"x"in he&&(q.xOffset=he.x|0),"y"in he&&(q.yOffset=he.y|0),ch(he.data)&&(J=he.data)),he.copy){var _e=ca.viewportWidth,qe=ca.viewportHeight;q.width=q.width||_e-q.xOffset,q.height=q.height||qe-q.yOffset,q.needsCopy=!0}else if(!J)q.width=q.width||1,q.height=q.height||1,q.channels=q.channels||4;else if(Sr(J))q.channels=q.channels||4,q.data=J,!("type"in he)&&q.type===Zs&&(q.type=Nf(J));else if(th(J))q.channels=q.channels||4,Fh(q,J),q.alignment=1,q.needsFree=!0;else if(Ur(J)){var ft=J.data;!Array.isArray(ft)&&q.type===Zs&&(q.type=Nf(ft));var pt=J.shape,$e=J.stride,it,Tt,$t,Ht,Jt,ir;pt.length===3?($t=pt[2],ir=$e[2]):($t=1,ir=1),it=pt[0],Tt=pt[1],Ht=$e[0],Jt=$e[1],q.alignment=1,q.width=it,q.height=Tt,q.channels=$t,q.format=q.internalformat=$u[$t],q.needsFree=!0,Gh(q,ft,Ht,Jt,ir,J.offset)}else if(Oh(J)||Bf(J)||uh(J))Oh(J)||Bf(J)?q.element=J:q.element=J.canvas,q.width=q.element.width,q.height=q.element.height,q.channels=4;else if(Ku(J))q.element=J,q.width=J.width,q.height=J.height,q.channels=4;else if(fd(J))q.element=J,q.width=J.naturalWidth,q.height=J.naturalHeight,q.channels=4;else if(Hh(J))q.element=J,q.width=J.videoWidth,q.height=J.videoHeight,q.channels=4;else if(af(J)){var rr=q.width||J[0].length,Bt=q.height||J.length,Zt=q.channels;jn(J[0][0])?Zt=Zt||J[0][0].length:Zt=Zt||1;for(var Gt=je.shape(J),Or=1,Wr=0;Wr>=qe,J.height>>=qe,Oa(J,_e[qe]),q.mipmask|=1<=0&&!("faces"in he)&&(q.genMipmaps=!0)}if("mag"in he){var _e=he.mag;q.magFilter=Da[_e]}var qe=q.wrapS,ft=q.wrapT;if("wrap"in he){var pt=he.wrap;typeof pt=="string"?qe=ft=Ia[pt]:Array.isArray(pt)&&(qe=Ia[pt[0]],ft=Ia[pt[1]])}else{if("wrapS"in he){var $e=he.wrapS;qe=Ia[$e]}if("wrapT"in he){var it=he.wrapT;ft=Ia[it]}}if(q.wrapS=qe,q.wrapT=ft,"anisotropic"in he&&(he.anisotropic,q.anisotropic=he.anisotropic),"mipmap"in he){var Tt=!1;switch(typeof he.mipmap){case"string":q.mipmapHint=za[he.mipmap],q.genMipmaps=!0,Tt=!0;break;case"boolean":Tt=q.genMipmaps=he.mipmap;break;case"object":q.genMipmaps=!1,Tt=!0;break}Tt&&!("min"in he)&&(q.minFilter=Nl)}}function Qu(q,he){mt.texParameteri(he,vu,q.minFilter),mt.texParameteri(he,cu,q.magFilter),mt.texParameteri(he,gs,q.wrapS),mt.texParameteri(he,rs,q.wrapT),yr.ext_texture_filter_anisotropic&&mt.texParameteri(he,Tl,q.anisotropic),q.genMipmaps&&(mt.hint(Xc,q.mipmapHint),mt.generateMipmap(he))}var _f=0,nu={},du=wr.maxTextureUnits,ho=Array(du).map(function(){return null});function ec(q){ia.call(this),this.mipmask=0,this.internalformat=Ci,this.id=_f++,this.refCount=1,this.target=q,this.texture=mt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new gu,mn.profile&&(this.stats={size:0})}function qs(q){mt.activeTexture(nf),mt.bindTexture(q.target,q.texture)}function Fl(){var q=ho[0];q?mt.bindTexture(q.target,q.texture):mt.bindTexture(In,null)}function dc(q){var he=q.texture,J=q.unit,_e=q.target;J>=0&&(mt.activeTexture(nf+J),mt.bindTexture(_e,null),ho[J]=null),mt.deleteTexture(he),q.texture=null,q.params=null,q.pixels=null,q.refCount=0,delete nu[q.id],yn.textureCount--}h(ec.prototype,{bind:function(){var q=this;q.bindCount+=1;var he=q.unit;if(he<0){for(var J=0;J0)continue;_e.unit=-1}ho[J]=q,he=J;break}mn.profile&&yn.maxTextureUnits>Jt)-$t,ir.height=ir.height||(J.height>>Jt)-Ht,qs(J),Lo(ir,In,$t,Ht,Jt),Fl(),Ya(ir),_e}function ft(pt,$e){var it=pt|0,Tt=$e|0||it;if(it===J.width&&Tt===J.height)return _e;_e.width=J.width=it,_e.height=J.height=Tt,qs(J);for(var $t=0;J.mipmask>>$t;++$t){var Ht=it>>$t,Jt=Tt>>$t;if(!Ht||!Jt)break;mt.texImage2D(In,$t,J.format,Ht,Jt,0,J.format,J.type,null)}return Fl(),mn.profile&&(J.stats.size=Ef(J.internalformat,J.type,it,Tt,!1,!1)),_e}return _e(q,he),_e.subimage=qe,_e.resize=ft,_e._reglType="texture2d",_e._texture=J,mn.profile&&(_e.stats=J.stats),_e.destroy=function(){J.decRef()},_e}function Co(q,he,J,_e,qe,ft){var pt=new ec(gi);nu[pt.id]=pt,yn.cubeCount++;var $e=new Array(6);function it(Ht,Jt,ir,rr,Bt,Zt){var Gt,Or=pt.texInfo;for(gu.call(Or),Gt=0;Gt<6;++Gt)$e[Gt]=Eu();if(typeof Ht=="number"||!Ht){var Wr=Ht|0||1;for(Gt=0;Gt<6;++Gt)qo($e[Gt],Wr,Wr)}else if(typeof Ht=="object")if(Jt)Qo($e[0],Ht),Qo($e[1],Jt),Qo($e[2],ir),Qo($e[3],rr),Qo($e[4],Bt),Qo($e[5],Zt);else if(Fu(Or,Ht),ii(pt,Ht),"faces"in Ht){var hn=Ht.faces;for(Gt=0;Gt<6;++Gt)Yn($e[Gt],pt),Qo($e[Gt],hn[Gt])}else for(Gt=0;Gt<6;++Gt)Qo($e[Gt],Ht);for(Yn(pt,$e[0]),Or.genMipmaps?pt.mipmask=($e[0].width<<1)-1:pt.mipmask=$e[0].mipmask,pt.internalformat=$e[0].internalformat,it.width=$e[0].width,it.height=$e[0].height,qs(pt),Gt=0;Gt<6;++Gt)fl($e[Gt],Ea+Gt);for(Qu(Or,gi),Fl(),mn.profile&&(pt.stats.size=Ef(pt.internalformat,pt.type,it.width,it.height,Or.genMipmaps,!0)),it.format=ta[pt.internalformat],it.type=ya[pt.type],it.mag=aa[Or.magFilter],it.min=ci[Or.minFilter],it.wrapS=Ua[Or.wrapS],it.wrapT=Ua[Or.wrapT],Gt=0;Gt<6;++Gt)el($e[Gt]);return it}function Tt(Ht,Jt,ir,rr,Bt){var Zt=ir|0,Gt=rr|0,Or=Bt|0,Wr=ji();return Yn(Wr,pt),Wr.width=0,Wr.height=0,Oa(Wr,Jt),Wr.width=Wr.width||(pt.width>>Or)-Zt,Wr.height=Wr.height||(pt.height>>Or)-Gt,qs(pt),Lo(Wr,Ea+Ht,Zt,Gt,Or),Fl(),Ya(Wr),it}function $t(Ht){var Jt=Ht|0;if(Jt!==pt.width){it.width=pt.width=Jt,it.height=pt.height=Jt,qs(pt);for(var ir=0;ir<6;++ir)for(var rr=0;pt.mipmask>>rr;++rr)mt.texImage2D(Ea+ir,rr,pt.format,Jt>>rr,Jt>>rr,0,pt.format,pt.type,null);return Fl(),mn.profile&&(pt.stats.size=Ef(pt.internalformat,pt.type,it.width,it.height,!1,!0)),it}}return it(q,he,J,_e,qe,ft),it.subimage=Tt,it.resize=$t,it._reglType="textureCube",it._texture=pt,mn.profile&&(it.stats=pt.stats),it.destroy=function(){pt.decRef()},it}function ds(){for(var q=0;q>_e,J.height>>_e,0,J.internalformat,J.type,null);else for(var qe=0;qe<6;++qe)mt.texImage2D(Ea+qe,_e,J.internalformat,J.width>>_e,J.height>>_e,0,J.internalformat,J.type,null);Qu(J.texInfo,J.target)})}function be(){for(var q=0;q=0?Eu=!0:Ia.indexOf(el)>=0&&(Eu=!1))),("depthTexture"in ho||"depthStencilTexture"in ho)&&(du=!!(ho.depthTexture||ho.depthStencilTexture)),"depth"in ho&&(typeof ho.depth=="boolean"?Qo=ho.depth:(Qu=ho.depth,fl=!1)),"stencil"in ho&&(typeof ho.stencil=="boolean"?fl=ho.stencil:(_f=ho.stencil,Qo=!1)),"depthStencil"in ho&&(typeof ho.depthStencil=="boolean"?Qo=fl=ho.depthStencil:(nu=ho.depthStencil,Qo=!1,fl=!1))}var qs=null,Fl=null,dc=null,vc=null;if(Array.isArray(es))qs=es.map(Ga);else if(es)qs=[Ga(es)];else for(qs=new Array(Fu),Ya=0;Ya0&&(ji.depth=$a[0].depth,ji.stencil=$a[0].stencil,ji.depthStencil=$a[0].depthStencil),$a[_i]?$a[_i](ji):$a[_i]=ia(ji)}return h(Oa,{width:Ya,height:Ya,color:el})}function zi(Lo){var _i,ji=Lo|0;if(ji===Oa.width)return Oa;var Ya=Oa.color;for(_i=0;_i=To.byteLength?qo.subdata(To):(qo.destroy(),Yn.buffers[_i]=null)),Yn.buffers[_i]||(qo=Yn.buffers[_i]=ca.create(ji,ih,!1,!0)),Ya.buffer=ca.getBuffer(qo),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1,zi[_i]=1}else ca.getBuffer(ji)?(Ya.buffer=ca.getBuffer(ji),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1):ca.getBuffer(ji.buffer)?(Ya.buffer=ca.getBuffer(ji.buffer),Ya.size=(+ji.size||Ya.buffer.dimension)|0,Ya.normalized=!!ji.normalized||!1,"type"in ji?Ya.type=kn[ji.type]:Ya.type=Ya.buffer.dtype,Ya.offset=(ji.offset||0)|0,Ya.stride=(ji.stride||0)|0,Ya.divisor=(ji.divisor||0)|0,Ya.state=1):"x"in ji&&(Ya.x=+ji.x||0,Ya.y=+ji.y||0,Ya.z=+ji.z||0,Ya.w=+ji.w||0,Ya.state=2)}for(var Qo=0;Qo1)for(var Dn=0;Dnnn&&(nn=Fn.stats.uniformsCount)}),nn},wr.getMaxAttributesCount=function(){var nn=0;return Za.forEach(function(Fn){Fn.stats.attributesCount>nn&&(nn=Fn.stats.attributesCount)}),nn});function ma(){ca={},yn={};for(var nn=0;nn>>4&15)+yr.charAt(Ln&15);return wr}function gf(mt){for(var yr="",wr=-1,Ln,ca;++wr>>6&31,128|Ln&63):Ln<=65535?yr+=String.fromCharCode(224|Ln>>>12&15,128|Ln>>>6&63,128|Ln&63):Ln<=2097151&&(yr+=String.fromCharCode(240|Ln>>>18&7,128|Ln>>>12&63,128|Ln>>>6&63,128|Ln&63));return yr}function Su(mt){for(var yr=Array(mt.length>>2),wr=0;wr>5]|=(mt.charCodeAt(wr/8)&255)<<24-wr%32;return yr}function Tc(mt){for(var yr="",wr=0;wr>5]>>>24-wr%32&255);return yr}function pu(mt,yr){return mt>>>yr|mt<<32-yr}function Vf(mt,yr){return mt>>>yr}function yf(mt,yr,wr){return mt&yr^~mt&wr}function jh(mt,yr,wr){return mt&yr^mt&wr^yr&wr}function cr(mt){return pu(mt,2)^pu(mt,13)^pu(mt,22)}function Rr(mt){return pu(mt,6)^pu(mt,11)^pu(mt,25)}function pn(mt){return pu(mt,7)^pu(mt,18)^Vf(mt,3)}function an(mt){return pu(mt,17)^pu(mt,19)^Vf(mt,10)}var On=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function Aa(mt,yr){var wr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Ln=new Array(64),ca,yn,mn,za,Ia,Da,Za,Fi,yi,Ga,ma,nn;for(mt[yr>>5]|=128<<24-yr%32,mt[(yr+64>>9<<4)+15]=yr,yi=0;yi>16)+(yr>>16)+(wr>>16);return Ln<<16|wr&65535}function ti(mt){return Array.prototype.slice.call(mt)}function li(mt){return ti(mt).join("")}function Ni(mt){var yr=mt&&mt.cache,wr=0,Ln=[],ca=[],yn=[];function mn(ma,nn){var Fn=nn&&nn.stable;if(!Fn){for(var ta=0;ta0&&(ma.push(ya,"="),ma.push.apply(ma,ti(arguments)),ma.push(";")),ya}return h(nn,{def:ta,toString:function(){return li([Fn.length>0?"var "+Fn.join(",")+";":"",li(ma)])}})}function Ia(){var ma=za(),nn=za(),Fn=ma.toString,ta=nn.toString;function ya(aa,ci){nn(aa,ci,"=",ma.def(aa,ci),";")}return h(function(){ma.apply(ma,ti(arguments))},{def:ma.def,entry:ma,exit:nn,save:ya,set:function(aa,ci,Ua){ya(aa,ci),ma(aa,ci,"=",Ua,";")},toString:function(){return Fn()+ta()}})}function Da(){var ma=li(arguments),nn=Ia(),Fn=Ia(),ta=nn.toString,ya=Fn.toString;return h(nn,{then:function(){return nn.apply(nn,ti(arguments)),this},else:function(){return Fn.apply(Fn,ti(arguments)),this},toString:function(){var aa=ya();return aa&&(aa="else{"+aa+"}"),li(["if(",ma,"){",ta(),"}",aa])}})}var Za=za(),Fi={};function yi(ma,nn){var Fn=[];function ta(){var Ri="a"+Fn.length;return Fn.push(Ri),Ri}nn=nn||0;for(var ya=0;ya":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},oa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Aa={cw:xt,ccw:St};function Ra(dt){return Array.isArray(dt)||Sr(dt)||Br(dt)}function ia(dt){return dt.sort(function(gr,wr){return gr===zc?-1:wr===zc?1:gr=1,Cn>=2,gr)}else if(wr===Vo){var ua=dt.data;return new oi(ua.thisDep,ua.contextDep,ua.propDep,gr)}else{if(wr===Ki)return new oi(!1,!1,!1,gr);if(wr===Ri){for(var gn=!1,pn=!1,za=!1,Ia=0;Ia=1&&(pn=!0),Wa>=2&&(za=!0)}else Da.type===Vo&&(gn=gn||Da.data.thisDep,pn=pn||Da.data.contextDep,za=za||Da.data.propDep)}return new oi(gn,pn,za,gr)}else return new oi(wr===Yo,wr===Fo,wr===jo,gr)}}var wo=new oi(!1,!1,!1,function(){});function ko(dt,gr,wr,Cn,ua,gn,pn,za,Ia,Da,Wa,Bi,bi,Ha,ga,rn){var Fn=Da.Record,ea={add:32774,subtract:32778,"reverse subtract":32779};wr.ext_blend_minmax&&(ea.min=It,ea.max=Qt);var ya=wr.angle_instanced_arrays,na=wr.webgl_draw_buffers,di=wr.oes_vertex_array_object,Ua={dirty:!0,profile:rn.profile},Di={},aa=[],Zn={},li={};function Dn(Ke){return Ke.replace(".","_")}function $a(Ke,at,bt){var Zt=Dn(Ke);aa.push(Ke),Di[Zt]=Ua[Zt]=!!bt,Zn[Zt]=at}function Oa(Ke,at,bt){var Zt=Dn(Ke);aa.push(Ke),Array.isArray(bt)?(Ua[Zt]=bt.slice(),Di[Zt]=bt.slice()):Ua[Zt]=Di[Zt]=bt,li[Zt]=at}function Oi(Ke){return!!isNaN(Ke)}$a(is,Gr),$a(Us,Lr),Oa(Al,"blendColor",[0,0,0,0]),Oa(Xl,"blendEquationSeparate",[hn,hn]),Oa(Ml,"blendFuncSeparate",[Hr,Xr,Hr,Xr]),$a(Yl,Mn,!0),Oa(rl,"depthFunc",An),Oa(Su,"depthRange",[0,1]),Oa(wu,"depthMask",!0),Oa(ql,ql,[!0,!0,!0,!0]),$a(bo,Tr),Oa(xs,"cullFace",tt),Oa(zl,zl,St),Oa(pl,pl,1),$a(dc,Yn),Oa(pc,"polygonOffset",[0,0]),$a(xc,wa),$a(Gf,ni),Oa(mc,"sampleCoverage",[1,!1]),$a(Mf,on),Oa(Mu,"stencilMask",-1),Oa(Ef,"stencilFunc",[Jt,0,-1]),Oa(Zo,"stencilOpSeparate",[Oe,yr,yr,yr]),Oa(ss,"stencilOpSeparate",[tt,yr,yr,yr]),$a(kf,Pn),Oa(Xc,"scissor",[0,0,dt.drawingBufferWidth,dt.drawingBufferHeight]),Oa(zc,zc,[0,0,dt.drawingBufferWidth,dt.drawingBufferHeight]);var Po={gl:dt,context:bi,strings:gr,next:Di,current:Ua,draw:Bi,elements:gn,buffer:ua,shader:Wa,attributes:Da.state,vao:Da,uniforms:Ia,framebuffer:za,extensions:wr,timer:Ha,isBufferArgs:Ra},wi={primTypes:Vn,compareFuncs:Qn,blendFuncs:zn,blendEquations:ea,stencilOps:oa,glTypes:En,orientationType:Aa};na&&(wi.backBuffer=[tt],wi.drawBuffer=m(Cn.maxDrawbuffers,function(Ke){return Ke===0?[0]:m(Ke,function(at){return La+at})}));var ji=0;function Ya(){var Ke=Ni({cache:ga}),at=Ke.link,bt=Ke.global;Ke.id=ji++,Ke.batchId="0";var Zt=at(Po),Vt=Ke.shared={props:"a0"};Object.keys(Po).forEach(function(Xt){Vt[Xt]=bt.def(Zt,".",Xt)});var Kt=Ke.next={},nr=Ke.current={};Object.keys(li).forEach(function(Xt){Array.isArray(Ua[Xt])&&(Kt[Xt]=bt.def(Vt.next,".",Xt),nr[Xt]=bt.def(Vt.current,".",Xt))});var er=Ke.constants={};Object.keys(wi).forEach(function(Xt){er[Xt]=bt.def(JSON.stringify(wi[Xt]))}),Ke.invoke=function(Xt,Ht){switch(Ht.type){case Zi:var zr=["this",Vt.context,Vt.props,Ke.batchId];return Xt.def(at(Ht.data),".call(",zr.slice(0,Math.max(Ht.data.length+1,4)),")");case jo:return Xt.def(Vt.props,Ht.data);case Fo:return Xt.def(Vt.context,Ht.data);case Yo:return Xt.def("this",Ht.data);case Vo:return Ht.data.append(Ke,Xt),Ht.data.ref;case Ki:return Ht.data.toString();case Ri:return Ht.data.map(function(Yr){return Ke.invoke(Xt,Yr)})}},Ke.attribCache={};var Bt={};return Ke.scopeAttrib=function(Xt){var Ht=gr.id(Xt);if(Ht in Bt)return Bt[Ht];var zr=Da.scope[Ht];zr||(zr=Da.scope[Ht]=new Fn);var Yr=Bt[Ht]=at(zr);return Yr},Ke}function Mo(Ke){var at=Ke.static,bt=Ke.dynamic,Zt;if(Ue in at){var Vt=!!at[Ue];Zt=zi(function(nr,er){return Vt}),Zt.enable=Vt}else if(Ue in bt){var Kt=bt[Ue];Zt=Gi(Kt,function(nr,er){return nr.invoke(er,Kt)})}return Zt}function Ho(Ke,at){var bt=Ke.static,Zt=Ke.dynamic;if(P in bt){var Vt=bt[P];return Vt?(Vt=za.getFramebuffer(Vt),zi(function(nr,er){var Bt=nr.link(Vt),Xt=nr.shared;er.set(Xt.framebuffer,".next",Bt);var Ht=Xt.context;return er.set(Ht,"."+Qr,Bt+".width"),er.set(Ht,"."+_n,Bt+".height"),Bt})):zi(function(nr,er){var Bt=nr.shared;er.set(Bt.framebuffer,".next","null");var Xt=Bt.context;return er.set(Xt,"."+Qr,Xt+"."+_t),er.set(Xt,"."+_n,Xt+"."+zt),"null"})}else if(P in Zt){var Kt=Zt[P];return Gi(Kt,function(nr,er){var Bt=nr.invoke(er,Kt),Xt=nr.shared,Ht=Xt.framebuffer,zr=er.def(Ht,".getFramebuffer(",Bt,")");er.set(Ht,".next",zr);var Yr=Xt.context;return er.set(Yr,"."+Qr,zr+"?"+zr+".width:"+Yr+"."+_t),er.set(Yr,"."+_n,zr+"?"+zr+".height:"+Yr+"."+zt),zr})}else return null}function ts(Ke,at,bt){var Zt=Ke.static,Vt=Ke.dynamic;function Kt(Bt){if(Bt in Zt){var Xt=Zt[Bt],Ht=!0,zr=Xt.x|0,Yr=Xt.y|0,fn,sa;return"width"in Xt?fn=Xt.width|0:Ht=!1,"height"in Xt?sa=Xt.height|0:Ht=!1,new oi(!Ht&&at&&at.thisDep,!Ht&&at&&at.contextDep,!Ht&&at&&at.propDep,function(la,va){var Pa=la.shared.context,ca=fn;"width"in Xt||(ca=va.def(Pa,".",Qr,"-",zr));var Fa=sa;return"height"in Xt||(Fa=va.def(Pa,".",_n,"-",Yr)),[zr,Yr,ca,Fa]})}else if(Bt in Vt){var Wn=Vt[Bt],Hn=Gi(Wn,function(la,va){var Pa=la.invoke(va,Wn),ca=la.shared.context,Fa=va.def(Pa,".x|0"),Ja=va.def(Pa,".y|0"),Ei=va.def('"width" in ',Pa,"?",Pa,".width|0:","(",ca,".",Qr,"-",Fa,")"),Hi=va.def('"height" in ',Pa,"?",Pa,".height|0:","(",ca,".",_n,"-",Ja,")");return[Fa,Ja,Ei,Hi]});return at&&(Hn.thisDep=Hn.thisDep||at.thisDep,Hn.contextDep=Hn.contextDep||at.contextDep,Hn.propDep=Hn.propDep||at.propDep),Hn}else return at?new oi(at.thisDep,at.contextDep,at.propDep,function(la,va){var Pa=la.shared.context;return[0,0,va.def(Pa,".",Qr),va.def(Pa,".",_n)]}):null}var nr=Kt(zc);if(nr){var er=nr;nr=new oi(nr.thisDep,nr.contextDep,nr.propDep,function(Bt,Xt){var Ht=er.append(Bt,Xt),zr=Bt.shared.context;return Xt.set(zr,"."+Ze,Ht[2]),Xt.set(zr,"."+et,Ht[3]),Ht})}return{viewport:nr,scissor_box:Kt(Xc)}}function cl(Ke,at){var bt=Ke.static,Zt=typeof bt[Se]=="string"&&typeof bt[oe]=="string";if(Zt){if(Object.keys(at.dynamic).length>0)return null;var Vt=at.static,Kt=Object.keys(Vt);if(Kt.length>0&&typeof Vt[Kt[0]]=="number"){for(var nr=[],er=0;er"+Fa+"?"+Ht+".constant["+Fa+"]:0;"}).join(""),"}}else{","if(",fn,"(",Ht,".buffer)){",la,"=",sa,".createStream(",Ut,",",Ht,".buffer);","}else{",la,"=",sa,".getBuffer(",Ht,".buffer);","}",va,'="type" in ',Ht,"?",Yr.glTypes,"[",Ht,".type]:",la,".dtype;",Wn.normalized,"=!!",Ht,".normalized;");function Pa(ca){Xt(Wn[ca],"=",Ht,".",ca,"|0;")}return Pa("size"),Pa("offset"),Pa("stride"),Pa("divisor"),Xt("}}"),Xt.exit("if(",Wn.isStream,"){",sa,".destroyStream(",la,");","}"),Wn}Vt[Kt]=Gi(nr,er)}),Vt}function Wu(Ke){var at=Ke.static,bt=Ke.dynamic,Zt={};return Object.keys(at).forEach(function(Vt){var Kt=at[Vt];Zt[Vt]=zi(function(nr,er){return typeof Kt=="number"||typeof Kt=="boolean"?""+Kt:nr.link(Kt)})}),Object.keys(bt).forEach(function(Vt){var Kt=bt[Vt];Zt[Vt]=Gi(Kt,function(nr,er){return nr.invoke(er,Kt)})}),Zt}function pf(Ke,at,bt,Zt,Vt){Ke.static,Ke.dynamic;var Kt=cl(Ke,at),nr=Ho(Ke),er=ts(Ke,nr),Bt=Tu(Ke),Xt=tl(Ke),Ht=rs(Ke,Vt,Kt);function zr(la){var va=er[la];va&&(Xt[la]=va)}zr(zc),zr(Dn(Xc));var Yr=Object.keys(Xt).length>0,fn={framebuffer:nr,draw:Bt,shader:Ht,state:Xt,dirty:Yr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(fn.profile=Mo(Ke),fn.uniforms=du(bt),fn.drawVAO=fn.scopeVAO=Bt.vao,!fn.drawVAO&&Ht.program&&!Kt&&wr.angle_instanced_arrays&&Bt.static.elements){var sa=!0,Wn=Ht.program.attributes.map(function(la){var va=at.static[la];return sa=sa&&!!va,va});if(sa&&Wn.length>0){var Hn=Da.getVAO(Da.createVAO({attributes:Wn,elements:Bt.static.elements}));fn.drawVAO=new oi(null,null,null,function(la,va){return la.link(Hn)}),fn.useVAO=!0}}return Kt?fn.useVAO=!0:fn.attributes=Du(at),fn.context=Wu(Zt),fn}function Ql(Ke,at,bt){var Zt=Ke.shared,Vt=Zt.context,Kt=Ke.scope();Object.keys(bt).forEach(function(nr){at.save(Vt,"."+nr);var er=bt[nr],Bt=er.append(Ke,at);Array.isArray(Bt)?Kt(Vt,".",nr,"=[",Bt.join(),"];"):Kt(Vt,".",nr,"=",Bt,";")}),at(Kt)}function cu(Ke,at,bt,Zt){var Vt=Ke.shared,Kt=Vt.gl,nr=Vt.framebuffer,er;na&&(er=at.def(Vt.extensions,".webgl_draw_buffers"));var Bt=Ke.constants,Xt=Bt.drawBuffer,Ht=Bt.backBuffer,zr;bt?zr=bt.append(Ke,at):zr=at.def(nr,".next"),Zt||at("if(",zr,"!==",nr,".cur){"),at("if(",zr,"){",Kt,".bindFramebuffer(",kn,",",zr,".framebuffer);"),na&&at(er,".drawBuffersWEBGL(",Xt,"[",zr,".colorAttachments.length]);"),at("}else{",Kt,".bindFramebuffer(",kn,",null);"),na&&at(er,".drawBuffersWEBGL(",Ht,");"),at("}",nr,".cur=",zr,";"),Zt||at("}")}function vo(Ke,at,bt){var Zt=Ke.shared,Vt=Zt.gl,Kt=Ke.current,nr=Ke.next,er=Zt.current,Bt=Zt.next,Xt=Ke.cond(er,".dirty");aa.forEach(function(Ht){var zr=Dn(Ht);if(!(zr in bt.state)){var Yr,fn;if(zr in nr){Yr=nr[zr],fn=Kt[zr];var sa=m(Ua[zr].length,function(Hn){return Xt.def(Yr,"[",Hn,"]")});Xt(Ke.cond(sa.map(function(Hn,la){return Hn+"!=="+fn+"["+la+"]"}).join("||")).then(Vt,".",li[zr],"(",sa,");",sa.map(function(Hn,la){return fn+"["+la+"]="+Hn}).join(";"),";"))}else{Yr=Xt.def(Bt,".",zr);var Wn=Ke.cond(Yr,"!==",er,".",zr);Xt(Wn),zr in Zn?Wn(Ke.cond(Yr).then(Vt,".enable(",Zn[zr],");").else(Vt,".disable(",Zn[zr],");"),er,".",zr,"=",Yr,";"):Wn(Vt,".",li[zr],"(",Yr,");",er,".",zr,"=",Yr,";")}}}),Object.keys(bt.state).length===0&&Xt(er,".dirty=false;"),at(Xt)}function Ku(Ke,at,bt,Zt){var Vt=Ke.shared,Kt=Ke.current,nr=Vt.current,er=Vt.gl,Bt;ia(Object.keys(bt)).forEach(function(Xt){var Ht=bt[Xt];if(!(Zt&&!Zt(Ht))){var zr=Ht.append(Ke,at);if(Zn[Xt]){var Yr=Zn[Xt];Wi(Ht)?(Bt=Ke.link(zr,{stable:!0}),at(Ke.cond(Bt).then(er,".enable(",Yr,");").else(er,".disable(",Yr,");")),at(nr,".",Xt,"=",Bt,";")):(at(Ke.cond(zr).then(er,".enable(",Yr,");").else(er,".disable(",Yr,");")),at(nr,".",Xt,"=",zr,";"))}else if(Un(zr)){var fn=Kt[Xt];at(er,".",li[Xt],"(",zr,");",zr.map(function(sa,Wn){return fn+"["+Wn+"]="+sa}).join(";"),";")}else Wi(Ht)?(Bt=Ke.link(zr,{stable:!0}),at(er,".",li[Xt],"(",Bt,");",nr,".",Xt,"=",Bt,";")):at(er,".",li[Xt],"(",zr,");",nr,".",Xt,"=",zr,";")}})}function Vs(Ke,at){ya&&(Ke.instancing=at.def(Ke.shared.extensions,".angle_instanced_arrays"))}function Fl(Ke,at,bt,Zt,Vt){var Kt=Ke.shared,nr=Ke.stats,er=Kt.current,Bt=Kt.timer,Xt=bt.profile;function Ht(){return typeof performance>"u"?"Date.now()":"performance.now()"}var zr,Yr;function fn(Pa){zr=at.def(),Pa(zr,"=",Ht(),";"),typeof Vt=="string"?Pa(nr,".count+=",Vt,";"):Pa(nr,".count++;"),Ha&&(Zt?(Yr=at.def(),Pa(Yr,"=",Bt,".getNumPendingQueries();")):Pa(Bt,".beginQuery(",nr,");"))}function sa(Pa){Pa(nr,".cpuTime+=",Ht(),"-",zr,";"),Ha&&(Zt?Pa(Bt,".pushScopeStats(",Yr,",",Bt,".getNumPendingQueries(),",nr,");"):Pa(Bt,".endQuery();"))}function Wn(Pa){var ca=at.def(er,".profile");at(er,".profile=",Pa,";"),at.exit(er,".profile=",ca,";")}var Hn;if(Xt){if(Wi(Xt)){Xt.enable?(fn(at),sa(at.exit),Wn("true")):Wn("false");return}Hn=Xt.append(Ke,at),Wn(Hn)}else Hn=at.def(er,".profile");var la=Ke.block();fn(la),at("if(",Hn,"){",la,"}");var va=Ke.block();sa(va),at.exit("if(",Hn,"){",va,"}")}function uc(Ke,at,bt,Zt,Vt){var Kt=Ke.shared;function nr(Bt){switch(Bt){case ii:case $o:case al:return 2;case $i:case Js:case vu:return 3;case Ao:case Qs:case ru:return 4;default:return 1}}function er(Bt,Xt,Ht){var zr=Kt.gl,Yr=at.def(Bt,".location"),fn=at.def(Kt.attributes,"[",Yr,"]"),sa=Ht.state,Wn=Ht.buffer,Hn=[Ht.x,Ht.y,Ht.z,Ht.w],la=["buffer","normalized","offset","stride"];function va(){at("if(!",fn,".buffer){",zr,".enableVertexAttribArray(",Yr,");}");var ca=Ht.type,Fa;if(Ht.size?Fa=at.def(Ht.size,"||",Xt):Fa=Xt,at("if(",fn,".type!==",ca,"||",fn,".size!==",Fa,"||",la.map(function(Ei){return fn+"."+Ei+"!=="+Ht[Ei]}).join("||"),"){",zr,".bindBuffer(",Ut,",",Wn,".buffer);",zr,".vertexAttribPointer(",[Yr,Fa,ca,Ht.normalized,Ht.stride,Ht.offset],");",fn,".type=",ca,";",fn,".size=",Fa,";",la.map(function(Ei){return fn+"."+Ei+"="+Ht[Ei]+";"}).join(""),"}"),ya){var Ja=Ht.divisor;at("if(",fn,".divisor!==",Ja,"){",Ke.instancing,".vertexAttribDivisorANGLE(",[Yr,Ja],");",fn,".divisor=",Ja,";}")}}function Pa(){at("if(",fn,".buffer){",zr,".disableVertexAttribArray(",Yr,");",fn,".buffer=null;","}if(",Va.map(function(ca,Fa){return fn+"."+ca+"!=="+Hn[Fa]}).join("||"),"){",zr,".vertexAttrib4f(",Yr,",",Hn,");",Va.map(function(ca,Fa){return fn+"."+ca+"="+Hn[Fa]+";"}).join(""),"}")}sa===ei?va():sa===Na?Pa():(at("if(",sa,"===",ei,"){"),va(),at("}else{"),Pa(),at("}"))}Zt.forEach(function(Bt){var Xt=Bt.name,Ht=bt.attributes[Xt],zr;if(Ht){if(!Vt(Ht))return;zr=Ht.append(Ke,at)}else{if(!Vt(wo))return;var Yr=Ke.scopeAttrib(Xt);zr={},Object.keys(new Fn).forEach(function(fn){zr[fn]=at.def(Yr,".",fn)})}er(Ke.link(Bt),nr(Bt.info.type),zr)})}function cc(Ke,at,bt,Zt,Vt,Kt){for(var nr=Ke.shared,er=nr.gl,Bt,Xt=0;Xt1){for(var ws=[],gs=[],ml=0;ml>1)",Wn],");")}function Ja(){bt(Hn,".drawArraysInstancedANGLE(",[Yr,fn,sa,Wn],");")}Ht&&Ht!=="null"?va?Fa():(bt("if(",Ht,"){"),Fa(),bt("}else{"),Ja(),bt("}")):Ja()}function ca(){function Fa(){bt(Kt+".drawElements("+[Yr,sa,la,fn+"<<(("+la+"-"+Ai+")>>1)"]+");")}function Ja(){bt(Kt+".drawArrays("+[Yr,fn,sa]+");")}Ht&&Ht!=="null"?va?Fa():(bt("if(",Ht,"){"),Fa(),bt("}else{"),Ja(),bt("}")):Ja()}ya&&(typeof Wn!="number"||Wn>=0)?typeof Wn=="string"?(bt("if(",Wn,">0){"),Pa(),bt("}else if(",Wn,"<0){"),ca(),bt("}")):Pa():ca()}function ms(Ke,at,bt,Zt,Vt){var Kt=Ya(),nr=Kt.proc("body",Vt);return ya&&(Kt.instancing=nr.def(Kt.shared.extensions,".angle_instanced_arrays")),Ke(Kt,nr,bt,Zt),Kt.compile().body}function bs(Ke,at,bt,Zt){Vs(Ke,at),bt.useVAO?bt.drawVAO?at(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,at),");"):at(Ke.shared.vao,".setVAO(",Ke.shared.vao,".targetVAO);"):(at(Ke.shared.vao,".setVAO(null);"),uc(Ke,at,bt,Zt.attributes,function(){return!0})),cc(Ke,at,bt,Zt.uniforms,function(){return!0},!1),Co(Ke,at,at,bt)}function be(Ke,at){var bt=Ke.proc("draw",1);Vs(Ke,bt),Ql(Ke,bt,at.context),cu(Ke,bt,at.framebuffer),vo(Ke,bt,at),Ku(Ke,bt,at.state),Fl(Ke,bt,at,!1,!0);var Zt=at.shader.progVar.append(Ke,bt);if(bt(Ke.shared.gl,".useProgram(",Zt,".program);"),at.shader.program)bs(Ke,bt,at,at.shader.program);else{bt(Ke.shared.vao,".setVAO(null);");var Vt=Ke.global.def("{}"),Kt=bt.def(Zt,".id"),nr=bt.def(Vt,"[",Kt,"]");bt(Ke.cond(nr).then(nr,".call(this,a0);").else(nr,"=",Vt,"[",Kt,"]=",Ke.link(function(er){return ms(bs,Ke,at,er,1)}),"(",Zt,");",nr,".call(this,a0);"))}Object.keys(at.state).length>0&&bt(Ke.shared.current,".dirty=true;"),Ke.shared.vao&&bt(Ke.shared.vao,".setVAO(null);")}function q(Ke,at,bt,Zt){Ke.batchId="a1",Vs(Ke,at);function Vt(){return!0}uc(Ke,at,bt,Zt.attributes,Vt),cc(Ke,at,bt,Zt.uniforms,Vt,!1),Co(Ke,at,at,bt)}function he(Ke,at,bt,Zt){Vs(Ke,at);var Vt=bt.contextDep,Kt=at.def(),nr="a0",er="a1",Bt=at.def();Ke.shared.props=Bt,Ke.batchId=Kt;var Xt=Ke.scope(),Ht=Ke.scope();at(Xt.entry,"for(",Kt,"=0;",Kt,"<",er,";++",Kt,"){",Bt,"=",nr,"[",Kt,"];",Ht,"}",Xt.exit);function zr(la){return la.contextDep&&Vt||la.propDep}function Yr(la){return!zr(la)}if(bt.needsContext&&Ql(Ke,Ht,bt.context),bt.needsFramebuffer&&cu(Ke,Ht,bt.framebuffer),Ku(Ke,Ht,bt.state,zr),bt.profile&&zr(bt.profile)&&Fl(Ke,Ht,bt,!1,!0),Zt)bt.useVAO?bt.drawVAO?zr(bt.drawVAO)?Ht(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,Ht),");"):Xt(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,Xt),");"):Xt(Ke.shared.vao,".setVAO(",Ke.shared.vao,".targetVAO);"):(Xt(Ke.shared.vao,".setVAO(null);"),uc(Ke,Xt,bt,Zt.attributes,Yr),uc(Ke,Ht,bt,Zt.attributes,zr)),cc(Ke,Xt,bt,Zt.uniforms,Yr,!1),cc(Ke,Ht,bt,Zt.uniforms,zr,!0),Co(Ke,Xt,Ht,bt);else{var fn=Ke.global.def("{}"),sa=bt.shader.progVar.append(Ke,Ht),Wn=Ht.def(sa,".id"),Hn=Ht.def(fn,"[",Wn,"]");Ht(Ke.shared.gl,".useProgram(",sa,".program);","if(!",Hn,"){",Hn,"=",fn,"[",Wn,"]=",Ke.link(function(la){return ms(q,Ke,bt,la,2)}),"(",sa,");}",Hn,".call(this,a0[",Kt,"],",Kt,");")}}function J(Ke,at){var bt=Ke.proc("batch",2);Ke.batchId="0",Vs(Ke,bt);var Zt=!1,Vt=!0;Object.keys(at.context).forEach(function(fn){Zt=Zt||at.context[fn].propDep}),Zt||(Ql(Ke,bt,at.context),Vt=!1);var Kt=at.framebuffer,nr=!1;Kt?(Kt.propDep?Zt=nr=!0:Kt.contextDep&&Zt&&(nr=!0),nr||cu(Ke,bt,Kt)):cu(Ke,bt,null),at.state.viewport&&at.state.viewport.propDep&&(Zt=!0);function er(fn){return fn.contextDep&&Zt||fn.propDep}vo(Ke,bt,at),Ku(Ke,bt,at.state,function(fn){return!er(fn)}),(!at.profile||!er(at.profile))&&Fl(Ke,bt,at,!1,"a1"),at.contextDep=Zt,at.needsContext=Vt,at.needsFramebuffer=nr;var Bt=at.shader.progVar;if(Bt.contextDep&&Zt||Bt.propDep)he(Ke,bt,at,null);else{var Xt=Bt.append(Ke,bt);if(bt(Ke.shared.gl,".useProgram(",Xt,".program);"),at.shader.program)he(Ke,bt,at,at.shader.program);else{bt(Ke.shared.vao,".setVAO(null);");var Ht=Ke.global.def("{}"),zr=bt.def(Xt,".id"),Yr=bt.def(Ht,"[",zr,"]");bt(Ke.cond(Yr).then(Yr,".call(this,a0,a1);").else(Yr,"=",Ht,"[",zr,"]=",Ke.link(function(fn){return ms(he,Ke,at,fn,2)}),"(",Xt,");",Yr,".call(this,a0,a1);"))}}Object.keys(at.state).length>0&&bt(Ke.shared.current,".dirty=true;"),Ke.shared.vao&&bt(Ke.shared.vao,".setVAO(null);")}function _e(Ke,at){var bt=Ke.proc("scope",3);Ke.batchId="a2";var Zt=Ke.shared,Vt=Zt.current;if(Ql(Ke,bt,at.context),at.framebuffer&&at.framebuffer.append(Ke,bt),ia(Object.keys(at.state)).forEach(function(er){var Bt=at.state[er],Xt=Bt.append(Ke,bt);Un(Xt)?Xt.forEach(function(Ht,zr){Oi(Ht)?bt.set(Ke.next[er],"["+zr+"]",Ht):bt.set(Ke.next[er],"["+zr+"]",Ke.link(Ht,{stable:!0}))}):Wi(Bt)?bt.set(Zt.next,"."+er,Ke.link(Xt,{stable:!0})):bt.set(Zt.next,"."+er,Xt)}),Fl(Ke,bt,at,!0,!0),[ke,kt,gt,Gt,Be].forEach(function(er){var Bt=at.draw[er];if(Bt){var Xt=Bt.append(Ke,bt);Oi(Xt)?bt.set(Zt.draw,"."+er,Xt):bt.set(Zt.draw,"."+er,Ke.link(Xt),{stable:!0})}}),Object.keys(at.uniforms).forEach(function(er){var Bt=at.uniforms[er].append(Ke,bt);Array.isArray(Bt)&&(Bt="["+Bt.map(function(Xt){return Oi(Xt)?Xt:Ke.link(Xt,{stable:!0})})+"]"),bt.set(Zt.uniforms,"["+Ke.link(gr.id(er),{stable:!0})+"]",Bt)}),Object.keys(at.attributes).forEach(function(er){var Bt=at.attributes[er].append(Ke,bt),Xt=Ke.scopeAttrib(er);Object.keys(new Fn).forEach(function(Ht){bt.set(Xt,"."+Ht,Bt[Ht])})}),at.scopeVAO){var Kt=at.scopeVAO.append(Ke,bt);Oi(Kt)?bt.set(Zt.vao,".targetVAO",Kt):bt.set(Zt.vao,".targetVAO",Ke.link(Kt,{stable:!0}))}function nr(er){var Bt=at.shader[er];if(Bt){var Xt=Bt.append(Ke,bt);Oi(Xt)?bt.set(Zt.shader,"."+er,Xt):bt.set(Zt.shader,"."+er,Ke.link(Xt,{stable:!0}))}}nr(oe),nr(Se),Object.keys(at.state).length>0&&(bt(Vt,".dirty=true;"),bt.exit(Vt,".dirty=true;")),bt("a1(",Ke.shared.context,",a0,",Ke.batchId,");")}function qe(Ke){if(!(typeof Ke!="object"||Un(Ke))){for(var at=Object.keys(Ke),bt=0;bt=0;--Co){var ms=Oi[Co];ms&&ms(Ha,null,0)}wr.flush(),Da&&Da.update()}function Ho(){!Ya&&Oi.length>0&&(Ya=c.next(Mo))}function ts(){Ya&&(c.cancel(Mo),Ya=null)}function cl(Co){Co.preventDefault(),ts(),Po.forEach(function(ms){ms()})}function rs(Co){wr.getError(),ua.restore(),Ua.restore(),ea.restore(),Di.restore(),aa.restore(),Zn.restore(),na.restore(),Da&&Da.restore(),li.procs.refresh(),Ho(),wi.forEach(function(ms){ms()})}Oa&&(Oa.addEventListener(Zl,cl,!1),Oa.addEventListener(Ol,rs,!1));function Tu(){Oi.length=0,ts(),Oa&&(Oa.removeEventListener(Zl,cl),Oa.removeEventListener(Ol,rs)),Ua.clear(),Zn.clear(),aa.clear(),na.clear(),Di.clear(),ya.clear(),ea.clear(),Da&&Da.clear(),ji.forEach(function(Co){Co()})}function tl(Co){function ms(Vt){var Kt=h({},Vt);delete Kt.uniforms,delete Kt.attributes,delete Kt.context,delete Kt.vao,"stencil"in Kt&&Kt.stencil.op&&(Kt.stencil.opBack=Kt.stencil.opFront=Kt.stencil.op,delete Kt.stencil.op);function nr(er){if(er in Kt){var Bt=Kt[er];delete Kt[er],Object.keys(Bt).forEach(function(Xt){Kt[er+"."+Xt]=Bt[Xt]})}}return nr("blend"),nr("depth"),nr("cull"),nr("stencil"),nr("polygonOffset"),nr("scissor"),nr("sample"),"vao"in Vt&&(Kt.vao=Vt.vao),Kt}function bs(Vt,Kt){var nr={},er={};return Object.keys(Vt).forEach(function(Bt){var Xt=Vt[Bt];if(f.isDynamic(Xt)){er[Bt]=f.unbox(Xt,Bt);return}else if(Kt&&Array.isArray(Xt)){for(var Ht=0;Ht0)return vt.call(this,bt(Vt|0),Vt|0)}else if(Array.isArray(Vt)){if(Vt.length)return vt.call(this,Vt,Vt.length)}else return lt.call(this,Vt)}return h(Zt,{stats:_e,destroy:function(){qe.destroy()}})}var du=Zn.setFBO=tl({framebuffer:f.define.call(null,bc,"framebuffer")});function Du(Co,ms){var bs=0;li.procs.poll();var be=ms.color;be&&(wr.clearColor(+be[0]||0,+be[1]||0,+be[2]||0,+be[3]||0),bs|=Jl),"depth"in ms&&(wr.clearDepth(+ms.depth),bs|=co),"stencil"in ms&&(wr.clearStencil(ms.stencil|0),bs|=Is),wr.clear(bs)}function Wu(Co){if("framebuffer"in Co)if(Co.framebuffer&&Co.framebuffer_reglType==="framebufferCube")for(var ms=0;ms<6;++ms)du(h({framebuffer:Co.framebuffer.faces[ms]},Co),Du);else du(Co,Du);else Du(null,Co)}function pf(Co){Oi.push(Co);function ms(){var bs=Yc(Oi,Co);function be(){var q=Yc(Oi,be);Oi[q]=Oi[Oi.length-1],Oi.length-=1,Oi.length<=0&&ts()}Oi[bs]=be}return Ho(),{cancel:ms}}function Ql(){var Co=$a.viewport,ms=$a.scissor_box;Co[0]=Co[1]=ms[0]=ms[1]=0,Ha.viewportWidth=Ha.framebufferWidth=Ha.drawingBufferWidth=Co[2]=ms[2]=wr.drawingBufferWidth,Ha.viewportHeight=Ha.framebufferHeight=Ha.drawingBufferHeight=Co[3]=ms[3]=wr.drawingBufferHeight}function cu(){Ha.tick+=1,Ha.time=Ku(),Ql(),li.procs.poll()}function vo(){Di.refresh(),Ql(),li.procs.refresh(),Da&&Da.update()}function Ku(){return(p()-Wa)/1e3}vo();function Vs(Co,ms){var bs;switch(Co){case"frame":return pf(ms);case"lost":bs=Po;break;case"restore":bs=wi;break;case"destroy":bs=ji;break}return bs.push(ms),{cancel:function(){for(var be=0;be=0},read:Dn,destroy:Tu,_gl:wr,_refresh:vo,poll:function(){cu(),Da&&Da.update()},now:Ku,stats:pn,getCachedCode:Fl,preloadCachedCode:uc});return gr.onDone(null,cc),cc}return Eu})}}),FI=Ge({"node_modules/gl-util/context.js"($,G){var h=Ig();G.exports=function(o){if(o?typeof o=="string"&&(o={container:o}):o={},S(o)?o={container:o}:E(o)?o={container:o}:e(o)?o={gl:o}:o=h(o,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),o.pixelRatio||(o.pixelRatio=window.pixelRatio||1),o.gl)return o.gl;if(o.canvas&&(o.container=o.canvas.parentNode),o.container){if(typeof o.container=="string"){var n=document.querySelector(o.container);if(!n)throw Error("Element "+o.container+" is not found");o.container=n}S(o.container)?(o.canvas=o.container,o.container=o.canvas.parentNode):o.canvas||(o.canvas=t(),o.container.appendChild(o.canvas),b(o))}else if(!o.canvas)if(typeof document<"u")o.container=document.body||document.documentElement,o.canvas=t(),o.container.appendChild(o.canvas),b(o);else throw Error("Not DOM environment. Use headless-gl.");return o.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(i){try{o.gl=o.canvas.getContext(i,o.attrs)}catch{}return o.gl}),o.gl};function b(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var o=r.container.getBoundingClientRect();r.canvas.width=r.width||o.right-o.left,r.canvas.height=r.height||o.bottom-o.top}}function S(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function E(r){return typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.getBoundingClientRect=="function"}function e(r){return typeof r.drawArrays=="function"||typeof r.drawElements=="function"}function t(){var r=document.createElement("canvas");return r.style.position="absolute",r.style.top=0,r.style.left=0,r}}}),BI=Ge({"node_modules/font-atlas/index.js"($,G){var h=AC(),b=[32,126];G.exports=S;function S(E){E=E||{};var e=E.shape?E.shape:E.canvas?[E.canvas.width,E.canvas.height]:[512,512],t=E.canvas||document.createElement("canvas"),r=E.font,o=typeof E.step=="number"?[E.step,E.step]:E.step||[32,32],n=E.chars||b;if(r&&typeof r!="string"&&(r=h(r)),!Array.isArray(n))n=String(n).split("");else if(n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"){for(var i=[],a=n[0],s=0;a<=n[1];a++)i[s++]=String.fromCharCode(a);n=i}e=e.slice(),t.width=e[0],t.height=e[1];var f=t.getContext("2d");f.fillStyle="#000",f.fillRect(0,0,t.width,t.height),f.font=r,f.textAlign="center",f.textBaseline="middle",f.fillStyle="#fff";for(var c=o[0]/2,p=o[1]/2,a=0;ae[0]-o[0]/2&&(c=o[0]/2,p+=o[1]);return t}}}),SC=Ge({"node_modules/bit-twiddle/twiddle.js"($){"use restrict";var G=32;$.INT_BITS=G,$.INT_MAX=2147483647,$.INT_MIN=-1<0)-(S<0)},$.abs=function(S){var E=S>>G-1;return(S^E)-E},$.min=function(S,E){return E^(S^E)&-(S65535)<<4,S>>>=E,e=(S>255)<<3,S>>>=e,E|=e,e=(S>15)<<2,S>>>=e,E|=e,e=(S>3)<<1,S>>>=e,E|=e,E|S>>1},$.log10=function(S){return S>=1e9?9:S>=1e8?8:S>=1e7?7:S>=1e6?6:S>=1e5?5:S>=1e4?4:S>=1e3?3:S>=100?2:S>=10?1:0},$.popCount=function(S){return S=S-(S>>>1&1431655765),S=(S&858993459)+(S>>>2&858993459),(S+(S>>>4)&252645135)*16843009>>>24};function h(S){var E=32;return S&=-S,S&&E--,S&65535&&(E-=16),S&16711935&&(E-=8),S&252645135&&(E-=4),S&858993459&&(E-=2),S&1431655765&&(E-=1),E}$.countTrailingZeros=h,$.nextPow2=function(S){return S+=S===0,--S,S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S+1},$.prevPow2=function(S){return S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S-(S>>>1)},$.parity=function(S){return S^=S>>>16,S^=S>>>8,S^=S>>>4,S&=15,27030>>>S&1};var b=new Array(256);(function(S){for(var E=0;E<256;++E){var e=E,t=E,r=7;for(e>>>=1;e;e>>>=1)t<<=1,t|=e&1,--r;S[E]=t<>>8&255]<<16|b[S>>>16&255]<<8|b[S>>>24&255]},$.interleave2=function(S,E){return S&=65535,S=(S|S<<8)&16711935,S=(S|S<<4)&252645135,S=(S|S<<2)&858993459,S=(S|S<<1)&1431655765,E&=65535,E=(E|E<<8)&16711935,E=(E|E<<4)&252645135,E=(E|E<<2)&858993459,E=(E|E<<1)&1431655765,S|E<<1},$.deinterleave2=function(S,E){return S=S>>>E&1431655765,S=(S|S>>>1)&858993459,S=(S|S>>>2)&252645135,S=(S|S>>>4)&16711935,S=(S|S>>>16)&65535,S<<16>>16},$.interleave3=function(S,E,e){return S&=1023,S=(S|S<<16)&4278190335,S=(S|S<<8)&251719695,S=(S|S<<4)&3272356035,S=(S|S<<2)&1227133513,E&=1023,E=(E|E<<16)&4278190335,E=(E|E<<8)&251719695,E=(E|E<<4)&3272356035,E=(E|E<<2)&1227133513,S|=E<<1,e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,S|e<<2},$.deinterleave3=function(S,E){return S=S>>>E&1227133513,S=(S|S>>>2)&3272356035,S=(S|S>>>4)&251719695,S=(S|S>>>8)&4278190335,S=(S|S>>>16)&1023,S<<22>>22},$.nextCombination=function(S){var E=S|S-1;return E+1|(~E&-~E)-1>>>h(S)+1}}}),NI=Ge({"node_modules/dup/dup.js"($,G){function h(E,e,t){var r=E[t]|0;if(r<=0)return[];var o=new Array(r),n;if(t===E.length-1)for(n=0;n"u"&&(e=0),typeof E){case"number":if(E>0)return b(E|0,e);break;case"object":if(typeof E.length=="number")return h(E,e,0);break}return[]}G.exports=S}}),UI=Ge({"node_modules/typedarray-pool/pool.js"($){var G=SC(),h=NI(),b=gg().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:h([32,0]),UINT16:h([32,0]),UINT32:h([32,0]),BIGUINT64:h([32,0]),INT8:h([32,0]),INT16:h([32,0]),INT32:h([32,0]),BIGINT64:h([32,0]),FLOAT:h([32,0]),DOUBLE:h([32,0]),DATA:h([32,0]),UINT8C:h([32,0]),BUFFER:h([32,0])});var S=typeof Uint8ClampedArray<"u",E=typeof BigUint64Array<"u",e=typeof BigInt64Array<"u",t=window.__TYPEDARRAY_POOL;t.UINT8C||(t.UINT8C=h([32,0])),t.BIGUINT64||(t.BIGUINT64=h([32,0])),t.BIGINT64||(t.BIGINT64=h([32,0])),t.BUFFER||(t.BUFFER=h([32,0]));var r=t.DATA,o=t.BUFFER;$.free=function(u){if(b.isBuffer(u))o[G.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var v=u.length||u.byteLength,y=G.log2(v)|0;r[y].push(u)}};function n(m){if(m){var u=m.length||m.byteLength,v=G.log2(u);r[v].push(m)}}function i(m){n(m.buffer)}$.freeUint8=$.freeUint16=$.freeUint32=$.freeBigUint64=$.freeInt8=$.freeInt16=$.freeInt32=$.freeBigInt64=$.freeFloat32=$.freeFloat=$.freeFloat64=$.freeDouble=$.freeUint8Clamped=$.freeDataView=i,$.freeArrayBuffer=n,$.freeBuffer=function(u){o[G.log2(u.length)].push(u)},$.malloc=function(u,v){if(v===void 0||v==="arraybuffer")return a(u);switch(v){case"uint8":return s(u);case"uint16":return f(u);case"uint32":return c(u);case"int8":return p(u);case"int16":return d(u);case"int32":return T(u);case"float":case"float32":return l(u);case"double":case"float64":return g(u);case"uint8_clamped":return x(u);case"bigint64":return M(u);case"biguint64":return A(u);case"buffer":return w(u);case"data":case"dataview":return _(u);default:return null}return null};function a(u){var u=G.nextPow2(u),v=G.log2(u),y=r[v];return y.length>0?y.pop():new ArrayBuffer(u)}$.mallocArrayBuffer=a;function s(m){return new Uint8Array(a(m),0,m)}$.mallocUint8=s;function f(m){return new Uint16Array(a(2*m),0,m)}$.mallocUint16=f;function c(m){return new Uint32Array(a(4*m),0,m)}$.mallocUint32=c;function p(m){return new Int8Array(a(m),0,m)}$.mallocInt8=p;function d(m){return new Int16Array(a(2*m),0,m)}$.mallocInt16=d;function T(m){return new Int32Array(a(4*m),0,m)}$.mallocInt32=T;function l(m){return new Float32Array(a(4*m),0,m)}$.mallocFloat32=$.mallocFloat=l;function g(m){return new Float64Array(a(8*m),0,m)}$.mallocFloat64=$.mallocDouble=g;function x(m){return S?new Uint8ClampedArray(a(m),0,m):s(m)}$.mallocUint8Clamped=x;function A(m){return E?new BigUint64Array(a(8*m),0,m):null}$.mallocBigUint64=A;function M(m){return e?new BigInt64Array(a(8*m),0,m):null}$.mallocBigInt64=M;function _(m){return new DataView(a(m),0,m)}$.mallocDataView=_;function w(m){m=G.nextPow2(m);var u=G.log2(m),v=o[u];return v.length>0?v.pop():new b(m)}$.mallocBuffer=w,$.clearCache=function(){for(var u=0;u<32;++u)t.UINT8[u].length=0,t.UINT16[u].length=0,t.UINT32[u].length=0,t.INT8[u].length=0,t.INT16[u].length=0,t.INT32[u].length=0,t.FLOAT[u].length=0,t.DOUBLE[u].length=0,t.BIGUINT64[u].length=0,t.BIGINT64[u].length=0,t.UINT8C[u].length=0,r[u].length=0,o[u].length=0}}}),jI=Ge({"node_modules/is-plain-obj/index.js"($,G){var h=Object.prototype.toString;G.exports=function(b){var S;return h.call(b)==="[object Object]"&&(S=Object.getPrototypeOf(b),S===null||S===Object.getPrototypeOf({}))}}}),MC=Ge({"node_modules/parse-unit/index.js"($,G){G.exports=function(b,S){S||(S=[0,""]),b=String(b);var E=parseFloat(b,10);return S[0]=E,S[1]=b.match(/[\d.\-\+]*\s*(.*)/)[1]||"",S}}}),qI=Ge({"node_modules/to-px/topx.js"($,G){var h=MC();G.exports=e;var b=96;function S(t,r){var o=h(getComputedStyle(t).getPropertyValue(r));return o[0]*e(o[1],t)}function E(t,r){var o=document.createElement("div");o.style["font-size"]="128"+t,r.appendChild(o);var n=S(o,"font-size")/128;return r.removeChild(o),n}function e(t,r){switch(r=r||document.body,t=(t||"px").trim().toLowerCase(),(r===window||r===document)&&(r=document.body),t){case"%":return r.clientHeight/100;case"ch":case"ex":return E(t,r);case"em":return S(r,"font-size");case"rem":return S(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return b;case"cm":return b/2.54;case"mm":return b/25.4;case"pt":return b/72;case"pc":return b/6}return 1}}}),VI=Ge({"node_modules/detect-kerning/index.js"($,G){G.exports=E;var h=E.canvas=document.createElement("canvas"),b=h.getContext("2d"),S=e([32,126]);E.createPairs=e,E.ascii=S;function E(t,r){Array.isArray(t)&&(t=t.join(", "));var o={},n,i=16,a=.05;r&&(r.length===2&&typeof r[0]=="number"?n=e(r):Array.isArray(r)?n=r:(r.o?n=e(r.o):r.pairs&&(n=r.pairs),r.fontSize&&(i=r.fontSize),r.threshold!=null&&(a=r.threshold))),n||(n=S),b.font=i+"px "+t;for(var s=0;si*a){var d=(p-c)/i;o[f]=d*1e3}}return o}function e(t){for(var r=[],o=t[0];o<=t[1];o++)for(var n=String.fromCharCode(o),i=t[0];i0;o-=4)if(r[o]!==0)return Math.floor((o-3)*.25/t)}}}),GI=Ge({"node_modules/gl-text/dist.js"($,G){var h=zI(),b=Ig(),S=OI(),E=FI(),e=mC(),t=L_(),r=BI(),o=UI(),n=N3(),i=jI(),a=MC(),s=qI(),f=VI(),c=xv(),p=HI(),d=Zb(),T=SC(),l=T.nextPow2,g=new e,x=!1;document.body&&(A=document.body.appendChild(document.createElement("div")),A.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(A).fontStretch&&(x=!0),document.body.removeChild(A));var A,M=function(m){_(m)?(m={regl:m},this.gl=m.regl._gl):this.gl=E(m),this.shader=g.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=m.regl||S({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),g.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(i(m)?m:{})};M.prototype.createShader=function(){var m=this.regl,u=m({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:m.prop("count"),offset:m.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:m.this("sizeBuffer")},width:{offset:0,stride:8,buffer:m.this("sizeBuffer")},char:m.this("charBuffer"),position:m.this("position")},uniforms:{atlasSize:function(y,I){return[I.atlas.width,I.atlas.height]},atlasDim:function(y,I){return[I.atlas.cols,I.atlas.rows]},atlas:function(y,I){return I.atlas.texture},charStep:function(y,I){return I.atlas.step},em:function(y,I){return I.atlas.em},color:m.prop("color"),opacity:m.prop("opacity"),viewport:m.this("viewportArray"),scale:m.this("scale"),align:m.prop("align"),baseline:m.prop("baseline"),translate:m.this("translate"),positionOffset:m.prop("positionOffset")},primitive:"points",viewport:m.this("viewport"),vert:` +`),Fn;if(yr&&(Fn=$h(nn),yr[Fn]))return yr[Fn].apply(null,ca);var ta=Function.apply(null,Ln.concat(nn));return yr&&(yr[Fn]=ta),ta.apply(null,ca)}return{global:Za,link:mn,block:za,proc:yi,scope:Ia,cond:Da,compile:Ga}}var Ha="xyzw".split(""),bi=5121,Qa=1,Na=2,Yi=0,No=1,Do=2,Go=3,jo=4,Wi=5,Li=6,ns="dither",Bs="blend.enable",Al="blend.color",Zl="blend.equation",Ml="blend.func",Wl="depth.enable",rl="depth.func",Cu="depth.range",Mu="depth.mask",Hl="colorMask",yo="cull.enable",ys="cull.face",zl="frontFace",ml="lineWidth",yc="polygonOffset.enable",_c="polygonOffset.offset",Ac="sample.alpha",$f="sample.enable",xc="sample.coverage",Lf="stencil.enable",Lu="stencil.mask",Pf="stencil.func",Xo="stencil.opFront",as="stencil.opBack",Rf="scissor.enable",$c="scissor.box",Nc="viewport",Ue="profile",P="framebuffer",oe="vert",Me="frag",Ce="elements",Be="primitive",_t="count",kt="offset",Xt="instances",fr="vao",Ar="Width",Lr="Height",tn=P+Ar,xn=P+Lr,Ze=Nc+Ar,tt=Nc+Lr,vt="drawingBuffer",bt=vt+Ar,zt=vt+Lr,Et=[Ml,Zl,Pf,Xo,as,xc,Nc,$c,_c],Ut=34962,gr=34963,Tr=2884,Pr=3042,Yr=3024,sn=2960,En=2929,Pn=3089,Xn=32823,Ta=32926,ri=32928,Wa=5126,ni=35664,$i=35665,bo=35666,vo=5124,Wo=35667,Ks=35668,Js=35669,Es=35670,il=35671,mu=35672,ou=35673,ks=35674,Cs=35675,Ru=35676,uc=35678,Uc=35680,ge=4,Oe=1028,rt=1029,wt=2304,St=2305,It=32775,tr=32776,er=519,_r=7680,Zr=0,Xr=1,dn=32774,Mn=513,Cn=36160,La=36064,zn={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},ea={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},sa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Sa={cw:wt,ccw:St};function Ra(mt){return Array.isArray(mt)||Sr(mt)||Ur(mt)}function oa(mt){return mt.sort(function(yr,wr){return yr===Nc?-1:wr===Nc?1:yr=1,Ln>=2,yr)}else if(wr===jo){var ca=mt.data;return new ai(ca.thisDep,ca.contextDep,ca.propDep,yr)}else{if(wr===Wi)return new ai(!1,!1,!1,yr);if(wr===Li){for(var yn=!1,mn=!1,za=!1,Ia=0;Ia=1&&(mn=!0),Za>=2&&(za=!0)}else Da.type===jo&&(yn=yn||Da.data.thisDep,mn=mn||Da.data.contextDep,za=za||Da.data.propDep)}return new ai(yn,mn,za,yr)}else return new ai(wr===Go,wr===Do,wr===No,yr)}}var _o=new ai(!1,!1,!1,function(){});function ko(mt,yr,wr,Ln,ca,yn,mn,za,Ia,Da,Za,Fi,yi,Ga,ma,nn){var Fn=Da.Record,ta={add:32774,subtract:32778,"reverse subtract":32779};wr.ext_blend_minmax&&(ta.min=It,ta.max=tr);var ya=wr.angle_instanced_arrays,aa=wr.webgl_draw_buffers,ci=wr.oes_vertex_array_object,Ua={dirty:!0,profile:nn.profile},Ri={},ia=[],Yn={},ii={};function Dn($e){return $e.replace(".","_")}function $a($e,it,Tt){var $t=Dn($e);ia.push($e),Ri[$t]=Ua[$t]=!!Tt,Yn[$t]=it}function Oa($e,it,Tt){var $t=Dn($e);ia.push($e),Array.isArray(Tt)?(Ua[$t]=Tt.slice(),Ri[$t]=Tt.slice()):Ua[$t]=Ri[$t]=Tt,ii[$t]=it}function zi($e){return!!isNaN($e)}$a(ns,Yr),$a(Bs,Pr),Oa(Al,"blendColor",[0,0,0,0]),Oa(Zl,"blendEquationSeparate",[dn,dn]),Oa(Ml,"blendFuncSeparate",[Xr,Zr,Xr,Zr]),$a(Wl,En,!0),Oa(rl,"depthFunc",Mn),Oa(Cu,"depthRange",[0,1]),Oa(Mu,"depthMask",!0),Oa(Hl,Hl,[!0,!0,!0,!0]),$a(yo,Tr),Oa(ys,"cullFace",rt),Oa(zl,zl,St),Oa(ml,ml,1),$a(yc,Xn),Oa(_c,"polygonOffset",[0,0]),$a(Ac,Ta),$a($f,ri),Oa(xc,"sampleCoverage",[1,!1]),$a(Lf,sn),Oa(Lu,"stencilMask",-1),Oa(Pf,"stencilFunc",[er,0,-1]),Oa(Xo,"stencilOpSeparate",[Oe,_r,_r,_r]),Oa(as,"stencilOpSeparate",[rt,_r,_r,_r]),$a(Rf,Pn),Oa($c,"scissor",[0,0,mt.drawingBufferWidth,mt.drawingBufferHeight]),Oa(Nc,Nc,[0,0,mt.drawingBufferWidth,mt.drawingBufferHeight]);var Lo={gl:mt,context:yi,strings:yr,next:Ri,current:Ua,draw:Fi,elements:yn,buffer:ca,shader:Za,attributes:Da.state,vao:Da,uniforms:Ia,framebuffer:za,extensions:wr,timer:Ga,isBufferArgs:Ra},_i={primTypes:Hn,compareFuncs:ea,blendFuncs:zn,blendEquations:ta,stencilOps:sa,glTypes:kn,orientationType:Sa};aa&&(_i.backBuffer=[rt],_i.drawBuffer=m(Ln.maxDrawbuffers,function($e){return $e===0?[0]:m($e,function(it){return La+it})}));var ji=0;function Ya(){var $e=Ni({cache:ma}),it=$e.link,Tt=$e.global;$e.id=ji++,$e.batchId="0";var $t=it(Lo),Ht=$e.shared={props:"a0"};Object.keys(Lo).forEach(function(Zt){Ht[Zt]=Tt.def($t,".",Zt)});var Jt=$e.next={},ir=$e.current={};Object.keys(ii).forEach(function(Zt){Array.isArray(Ua[Zt])&&(Jt[Zt]=Tt.def(Ht.next,".",Zt),ir[Zt]=Tt.def(Ht.current,".",Zt))});var rr=$e.constants={};Object.keys(_i).forEach(function(Zt){rr[Zt]=Tt.def(JSON.stringify(_i[Zt]))}),$e.invoke=function(Zt,Gt){switch(Gt.type){case Yi:var Or=["this",Ht.context,Ht.props,$e.batchId];return Zt.def(it(Gt.data),".call(",Or.slice(0,Math.max(Gt.data.length+1,4)),")");case No:return Zt.def(Ht.props,Gt.data);case Do:return Zt.def(Ht.context,Gt.data);case Go:return Zt.def("this",Gt.data);case jo:return Gt.data.append($e,Zt),Gt.data.ref;case Wi:return Gt.data.toString();case Li:return Gt.data.map(function(Wr){return $e.invoke(Zt,Wr)})}},$e.attribCache={};var Bt={};return $e.scopeAttrib=function(Zt){var Gt=yr.id(Zt);if(Gt in Bt)return Bt[Gt];var Or=Da.scope[Gt];Or||(Or=Da.scope[Gt]=new Fn);var Wr=Bt[Gt]=it(Or);return Wr},$e}function To($e){var it=$e.static,Tt=$e.dynamic,$t;if(Ue in it){var Ht=!!it[Ue];$t=Di(function(ir,rr){return Ht}),$t.enable=Ht}else if(Ue in Tt){var Jt=Tt[Ue];$t=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}return $t}function qo($e,it){var Tt=$e.static,$t=$e.dynamic;if(P in Tt){var Ht=Tt[P];return Ht?(Ht=za.getFramebuffer(Ht),Di(function(ir,rr){var Bt=ir.link(Ht),Zt=ir.shared;rr.set(Zt.framebuffer,".next",Bt);var Gt=Zt.context;return rr.set(Gt,"."+tn,Bt+".width"),rr.set(Gt,"."+xn,Bt+".height"),Bt})):Di(function(ir,rr){var Bt=ir.shared;rr.set(Bt.framebuffer,".next","null");var Zt=Bt.context;return rr.set(Zt,"."+tn,Zt+"."+bt),rr.set(Zt,"."+xn,Zt+"."+zt),"null"})}else if(P in $t){var Jt=$t[P];return Vi(Jt,function(ir,rr){var Bt=ir.invoke(rr,Jt),Zt=ir.shared,Gt=Zt.framebuffer,Or=rr.def(Gt,".getFramebuffer(",Bt,")");rr.set(Gt,".next",Or);var Wr=Zt.context;return rr.set(Wr,"."+tn,Or+"?"+Or+".width:"+Wr+"."+bt),rr.set(Wr,"."+xn,Or+"?"+Or+".height:"+Wr+"."+zt),Or})}else return null}function Qo($e,it,Tt){var $t=$e.static,Ht=$e.dynamic;function Jt(Bt){if(Bt in $t){var Zt=$t[Bt],Gt=!0,Or=Zt.x|0,Wr=Zt.y|0,hn,la;return"width"in Zt?hn=Zt.width|0:Gt=!1,"height"in Zt?la=Zt.height|0:Gt=!1,new ai(!Gt&&it&&it.thisDep,!Gt&&it&&it.contextDep,!Gt&&it&&it.propDep,function(ua,da){var Pa=ua.shared.context,fa=hn;"width"in Zt||(fa=da.def(Pa,".",tn,"-",Or));var Fa=la;return"height"in Zt||(Fa=da.def(Pa,".",xn,"-",Wr)),[Or,Wr,fa,Fa]})}else if(Bt in Ht){var Zn=Ht[Bt],Gn=Vi(Zn,function(ua,da){var Pa=ua.invoke(da,Zn),fa=ua.shared.context,Fa=da.def(Pa,".x|0"),Ka=da.def(Pa,".y|0"),wi=da.def('"width" in ',Pa,"?",Pa,".width|0:","(",fa,".",tn,"-",Fa,")"),qi=da.def('"height" in ',Pa,"?",Pa,".height|0:","(",fa,".",xn,"-",Ka,")");return[Fa,Ka,wi,qi]});return it&&(Gn.thisDep=Gn.thisDep||it.thisDep,Gn.contextDep=Gn.contextDep||it.contextDep,Gn.propDep=Gn.propDep||it.propDep),Gn}else return it?new ai(it.thisDep,it.contextDep,it.propDep,function(ua,da){var Pa=ua.shared.context;return[0,0,da.def(Pa,".",tn),da.def(Pa,".",xn)]}):null}var ir=Jt(Nc);if(ir){var rr=ir;ir=new ai(ir.thisDep,ir.contextDep,ir.propDep,function(Bt,Zt){var Gt=rr.append(Bt,Zt),Or=Bt.shared.context;return Zt.set(Or,"."+Ze,Gt[2]),Zt.set(Or,"."+tt,Gt[3]),Gt})}return{viewport:ir,scissor_box:Jt($c)}}function fl($e,it){var Tt=$e.static,$t=typeof Tt[Me]=="string"&&typeof Tt[oe]=="string";if($t){if(Object.keys(it.dynamic).length>0)return null;var Ht=it.static,Jt=Object.keys(Ht);if(Jt.length>0&&typeof Ht[Jt[0]]=="number"){for(var ir=[],rr=0;rr"+Fa+"?"+Gt+".constant["+Fa+"]:0;"}).join(""),"}}else{","if(",hn,"(",Gt,".buffer)){",ua,"=",la,".createStream(",Ut,",",Gt,".buffer);","}else{",ua,"=",la,".getBuffer(",Gt,".buffer);","}",da,'="type" in ',Gt,"?",Wr.glTypes,"[",Gt,".type]:",ua,".dtype;",Zn.normalized,"=!!",Gt,".normalized;");function Pa(fa){Zt(Zn[fa],"=",Gt,".",fa,"|0;")}return Pa("size"),Pa("offset"),Pa("stride"),Pa("divisor"),Zt("}}"),Zt.exit("if(",Zn.isStream,"){",la,".destroyStream(",ua,");","}"),Zn}Ht[Jt]=Vi(ir,rr)}),Ht}function Qu($e){var it=$e.static,Tt=$e.dynamic,$t={};return Object.keys(it).forEach(function(Ht){var Jt=it[Ht];$t[Ht]=Di(function(ir,rr){return typeof Jt=="number"||typeof Jt=="boolean"?""+Jt:ir.link(Jt)})}),Object.keys(Tt).forEach(function(Ht){var Jt=Tt[Ht];$t[Ht]=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}),$t}function _f($e,it,Tt,$t,Ht){$e.static,$e.dynamic;var Jt=fl($e,it),ir=qo($e),rr=Qo($e,ir),Bt=Eu($e),Zt=el($e),Gt=es($e,Ht,Jt);function Or(ua){var da=rr[ua];da&&(Zt[ua]=da)}Or(Nc),Or(Dn($c));var Wr=Object.keys(Zt).length>0,hn={framebuffer:ir,draw:Bt,shader:Gt,state:Zt,dirty:Wr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(hn.profile=To($e),hn.uniforms=gu(Tt),hn.drawVAO=hn.scopeVAO=Bt.vao,!hn.drawVAO&&Gt.program&&!Jt&&wr.angle_instanced_arrays&&Bt.static.elements){var la=!0,Zn=Gt.program.attributes.map(function(ua){var da=it.static[ua];return la=la&&!!da,da});if(la&&Zn.length>0){var Gn=Da.getVAO(Da.createVAO({attributes:Zn,elements:Bt.static.elements}));hn.drawVAO=new ai(null,null,null,function(ua,da){return ua.link(Gn)}),hn.useVAO=!0}}return Jt?hn.useVAO=!0:hn.attributes=Fu(it),hn.context=Qu($t),hn}function nu($e,it,Tt){var $t=$e.shared,Ht=$t.context,Jt=$e.scope();Object.keys(Tt).forEach(function(ir){it.save(Ht,"."+ir);var rr=Tt[ir],Bt=rr.append($e,it);Array.isArray(Bt)?Jt(Ht,".",ir,"=[",Bt.join(),"];"):Jt(Ht,".",ir,"=",Bt,";")}),it(Jt)}function du($e,it,Tt,$t){var Ht=$e.shared,Jt=Ht.gl,ir=Ht.framebuffer,rr;aa&&(rr=it.def(Ht.extensions,".webgl_draw_buffers"));var Bt=$e.constants,Zt=Bt.drawBuffer,Gt=Bt.backBuffer,Or;Tt?Or=Tt.append($e,it):Or=it.def(ir,".next"),$t||it("if(",Or,"!==",ir,".cur){"),it("if(",Or,"){",Jt,".bindFramebuffer(",Cn,",",Or,".framebuffer);"),aa&&it(rr,".drawBuffersWEBGL(",Zt,"[",Or,".colorAttachments.length]);"),it("}else{",Jt,".bindFramebuffer(",Cn,",null);"),aa&&it(rr,".drawBuffersWEBGL(",Gt,");"),it("}",ir,".cur=",Or,";"),$t||it("}")}function ho($e,it,Tt){var $t=$e.shared,Ht=$t.gl,Jt=$e.current,ir=$e.next,rr=$t.current,Bt=$t.next,Zt=$e.cond(rr,".dirty");ia.forEach(function(Gt){var Or=Dn(Gt);if(!(Or in Tt.state)){var Wr,hn;if(Or in ir){Wr=ir[Or],hn=Jt[Or];var la=m(Ua[Or].length,function(Gn){return Zt.def(Wr,"[",Gn,"]")});Zt($e.cond(la.map(function(Gn,ua){return Gn+"!=="+hn+"["+ua+"]"}).join("||")).then(Ht,".",ii[Or],"(",la,");",la.map(function(Gn,ua){return hn+"["+ua+"]="+Gn}).join(";"),";"))}else{Wr=Zt.def(Bt,".",Or);var Zn=$e.cond(Wr,"!==",rr,".",Or);Zt(Zn),Or in Yn?Zn($e.cond(Wr).then(Ht,".enable(",Yn[Or],");").else(Ht,".disable(",Yn[Or],");"),rr,".",Or,"=",Wr,";"):Zn(Ht,".",ii[Or],"(",Wr,");",rr,".",Or,"=",Wr,";")}}}),Object.keys(Tt.state).length===0&&Zt(rr,".dirty=false;"),it(Zt)}function ec($e,it,Tt,$t){var Ht=$e.shared,Jt=$e.current,ir=Ht.current,rr=Ht.gl,Bt;oa(Object.keys(Tt)).forEach(function(Zt){var Gt=Tt[Zt];if(!($t&&!$t(Gt))){var Or=Gt.append($e,it);if(Yn[Zt]){var Wr=Yn[Zt];Zi(Gt)?(Bt=$e.link(Or,{stable:!0}),it($e.cond(Bt).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Zt,"=",Bt,";")):(it($e.cond(Or).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Zt,"=",Or,";"))}else if(jn(Or)){var hn=Jt[Zt];it(rr,".",ii[Zt],"(",Or,");",Or.map(function(la,Zn){return hn+"["+Zn+"]="+la}).join(";"),";")}else Zi(Gt)?(Bt=$e.link(Or,{stable:!0}),it(rr,".",ii[Zt],"(",Bt,");",ir,".",Zt,"=",Bt,";")):it(rr,".",ii[Zt],"(",Or,");",ir,".",Zt,"=",Or,";")}})}function qs($e,it){ya&&($e.instancing=it.def($e.shared.extensions,".angle_instanced_arrays"))}function Fl($e,it,Tt,$t,Ht){var Jt=$e.shared,ir=$e.stats,rr=Jt.current,Bt=Jt.timer,Zt=Tt.profile;function Gt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Or,Wr;function hn(Pa){Or=it.def(),Pa(Or,"=",Gt(),";"),typeof Ht=="string"?Pa(ir,".count+=",Ht,";"):Pa(ir,".count++;"),Ga&&($t?(Wr=it.def(),Pa(Wr,"=",Bt,".getNumPendingQueries();")):Pa(Bt,".beginQuery(",ir,");"))}function la(Pa){Pa(ir,".cpuTime+=",Gt(),"-",Or,";"),Ga&&($t?Pa(Bt,".pushScopeStats(",Wr,",",Bt,".getNumPendingQueries(),",ir,");"):Pa(Bt,".endQuery();"))}function Zn(Pa){var fa=it.def(rr,".profile");it(rr,".profile=",Pa,";"),it.exit(rr,".profile=",fa,";")}var Gn;if(Zt){if(Zi(Zt)){Zt.enable?(hn(it),la(it.exit),Zn("true")):Zn("false");return}Gn=Zt.append($e,it),Zn(Gn)}else Gn=it.def(rr,".profile");var ua=$e.block();hn(ua),it("if(",Gn,"){",ua,"}");var da=$e.block();la(da),it.exit("if(",Gn,"){",da,"}")}function dc($e,it,Tt,$t,Ht){var Jt=$e.shared;function ir(Bt){switch(Bt){case ni:case Wo:case il:return 2;case $i:case Ks:case mu:return 3;case bo:case Js:case ou:return 4;default:return 1}}function rr(Bt,Zt,Gt){var Or=Jt.gl,Wr=it.def(Bt,".location"),hn=it.def(Jt.attributes,"[",Wr,"]"),la=Gt.state,Zn=Gt.buffer,Gn=[Gt.x,Gt.y,Gt.z,Gt.w],ua=["buffer","normalized","offset","stride"];function da(){it("if(!",hn,".buffer){",Or,".enableVertexAttribArray(",Wr,");}");var fa=Gt.type,Fa;if(Gt.size?Fa=it.def(Gt.size,"||",Zt):Fa=Zt,it("if(",hn,".type!==",fa,"||",hn,".size!==",Fa,"||",ua.map(function(wi){return hn+"."+wi+"!=="+Gt[wi]}).join("||"),"){",Or,".bindBuffer(",Ut,",",Zn,".buffer);",Or,".vertexAttribPointer(",[Wr,Fa,fa,Gt.normalized,Gt.stride,Gt.offset],");",hn,".type=",fa,";",hn,".size=",Fa,";",ua.map(function(wi){return hn+"."+wi+"="+Gt[wi]+";"}).join(""),"}"),ya){var Ka=Gt.divisor;it("if(",hn,".divisor!==",Ka,"){",$e.instancing,".vertexAttribDivisorANGLE(",[Wr,Ka],");",hn,".divisor=",Ka,";}")}}function Pa(){it("if(",hn,".buffer){",Or,".disableVertexAttribArray(",Wr,");",hn,".buffer=null;","}if(",Ha.map(function(fa,Fa){return hn+"."+fa+"!=="+Gn[Fa]}).join("||"),"){",Or,".vertexAttrib4f(",Wr,",",Gn,");",Ha.map(function(fa,Fa){return hn+"."+fa+"="+Gn[Fa]+";"}).join(""),"}")}la===Qa?da():la===Na?Pa():(it("if(",la,"===",Qa,"){"),da(),it("}else{"),Pa(),it("}"))}$t.forEach(function(Bt){var Zt=Bt.name,Gt=Tt.attributes[Zt],Or;if(Gt){if(!Ht(Gt))return;Or=Gt.append($e,it)}else{if(!Ht(_o))return;var Wr=$e.scopeAttrib(Zt);Or={},Object.keys(new Fn).forEach(function(hn){Or[hn]=it.def(Wr,".",hn)})}rr($e.link(Bt),ir(Bt.info.type),Or)})}function vc($e,it,Tt,$t,Ht,Jt){for(var ir=$e.shared,rr=ir.gl,Bt,Zt=0;Zt<$t.length;++Zt){var Gt=$t[Zt],Or=Gt.name,Wr=Gt.info.type,hn=Tt.uniforms[Or],la=$e.link(Gt),Zn=la+".location",Gn;if(hn){if(!Ht(hn))continue;if(Zi(hn)){var ua=hn.value;if(Wr===uc||Wr===Uc){var da=$e.link(ua._texture||ua.color[0]._texture);it(rr,".uniform1i(",Zn,",",da+".bind());"),it.exit(da,".unbind();")}else if(Wr===ks||Wr===Cs||Wr===Ru){var Pa=$e.global.def("new Float32Array(["+Array.prototype.slice.call(ua)+"])"),fa=2;Wr===Cs?fa=3:Wr===Ru&&(fa=4),it(rr,".uniformMatrix",fa,"fv(",Zn,",false,",Pa,");")}else{switch(Wr){case Wa:Bt="1f";break;case ni:Bt="2f";break;case $i:Bt="3f";break;case bo:Bt="4f";break;case Es:Bt="1i";break;case vo:Bt="1i";break;case il:Bt="2i";break;case Wo:Bt="2i";break;case mu:Bt="3i";break;case Ks:Bt="3i";break;case ou:Bt="4i";break;case Js:Bt="4i";break}it(rr,".uniform",Bt,"(",Zn,",",jn(ua)?Array.prototype.slice.call(ua):ua,");")}continue}else Gn=hn.append($e,it)}else{if(!Ht(_o))continue;Gn=it.def(ir.uniforms,"[",yr.id(Or),"]")}Wr===uc?it("if(",Gn,"&&",Gn,'._reglType==="framebuffer"){',Gn,"=",Gn,".color[0];","}"):Wr===Uc&&it("if(",Gn,"&&",Gn,'._reglType==="framebufferCube"){',Gn,"=",Gn,".color[0];","}");var Fa=1;switch(Wr){case uc:case Uc:var Ka=it.def(Gn,"._texture");it(rr,".uniform1i(",Zn,",",Ka,".bind());"),it.exit(Ka,".unbind();");continue;case vo:case Es:Bt="1i";break;case Wo:case il:Bt="2i",Fa=2;break;case Ks:case mu:Bt="3i",Fa=3;break;case Js:case ou:Bt="4i",Fa=4;break;case Wa:Bt="1f";break;case ni:Bt="2f",Fa=2;break;case $i:Bt="3f",Fa=3;break;case bo:Bt="4f",Fa=4;break;case ks:Bt="Matrix2fv";break;case Cs:Bt="Matrix3fv";break;case Ru:Bt="Matrix4fv";break}if(Bt.charAt(0)==="M"){it(rr,".uniform",Bt,"(",Zn,",");var wi=Math.pow(Wr-ks+2,2),qi=$e.global.def("new Float32Array(",wi,")");Array.isArray(Gn)?it("false,(",m(wi,function(xl){return qi+"["+xl+"]="+Gn[xl]}),",",qi,")"):it("false,(Array.isArray(",Gn,")||",Gn," instanceof Float32Array)?",Gn,":(",m(wi,function(xl){return qi+"["+xl+"]="+Gn+"["+xl+"]"}),",",qi,")"),it(");")}else if(Fa>1){for(var xs=[],ps=[],yl=0;yl>1)",Zn],");")}function Ka(){Tt(Gn,".drawArraysInstancedANGLE(",[Wr,hn,la,Zn],");")}Gt&&Gt!=="null"?da?Fa():(Tt("if(",Gt,"){"),Fa(),Tt("}else{"),Ka(),Tt("}")):Ka()}function fa(){function Fa(){Tt(Jt+".drawElements("+[Wr,la,ua,hn+"<<(("+ua+"-"+bi+")>>1)"]+");")}function Ka(){Tt(Jt+".drawArrays("+[Wr,hn,la]+");")}Gt&&Gt!=="null"?da?Fa():(Tt("if(",Gt,"){"),Fa(),Tt("}else{"),Ka(),Tt("}")):Ka()}ya&&(typeof Zn!="number"||Zn>=0)?typeof Zn=="string"?(Tt("if(",Zn,">0){"),Pa(),Tt("}else if(",Zn,"<0){"),fa(),Tt("}")):Pa():fa()}function ds($e,it,Tt,$t,Ht){var Jt=Ya(),ir=Jt.proc("body",Ht);return ya&&(Jt.instancing=ir.def(Jt.shared.extensions,".angle_instanced_arrays")),$e(Jt,ir,Tt,$t),Jt.compile().body}function _s($e,it,Tt,$t){qs($e,it),Tt.useVAO?Tt.drawVAO?it($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,it),");"):it($e.shared.vao,".setVAO(",$e.shared.vao,".targetVAO);"):(it($e.shared.vao,".setVAO(null);"),dc($e,it,Tt,$t.attributes,function(){return!0})),vc($e,it,Tt,$t.uniforms,function(){return!0},!1),Co($e,it,it,Tt)}function be($e,it){var Tt=$e.proc("draw",1);qs($e,Tt),nu($e,Tt,it.context),du($e,Tt,it.framebuffer),ho($e,Tt,it),ec($e,Tt,it.state),Fl($e,Tt,it,!1,!0);var $t=it.shader.progVar.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",$t,".program);"),it.shader.program)_s($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Ht=$e.global.def("{}"),Jt=Tt.def($t,".id"),ir=Tt.def(Ht,"[",Jt,"]");Tt($e.cond(ir).then(ir,".call(this,a0);").else(ir,"=",Ht,"[",Jt,"]=",$e.link(function(rr){return ds(_s,$e,it,rr,1)}),"(",$t,");",ir,".call(this,a0);"))}Object.keys(it.state).length>0&&Tt($e.shared.current,".dirty=true;"),$e.shared.vao&&Tt($e.shared.vao,".setVAO(null);")}function q($e,it,Tt,$t){$e.batchId="a1",qs($e,it);function Ht(){return!0}dc($e,it,Tt,$t.attributes,Ht),vc($e,it,Tt,$t.uniforms,Ht,!1),Co($e,it,it,Tt)}function he($e,it,Tt,$t){qs($e,it);var Ht=Tt.contextDep,Jt=it.def(),ir="a0",rr="a1",Bt=it.def();$e.shared.props=Bt,$e.batchId=Jt;var Zt=$e.scope(),Gt=$e.scope();it(Zt.entry,"for(",Jt,"=0;",Jt,"<",rr,";++",Jt,"){",Bt,"=",ir,"[",Jt,"];",Gt,"}",Zt.exit);function Or(ua){return ua.contextDep&&Ht||ua.propDep}function Wr(ua){return!Or(ua)}if(Tt.needsContext&&nu($e,Gt,Tt.context),Tt.needsFramebuffer&&du($e,Gt,Tt.framebuffer),ec($e,Gt,Tt.state,Or),Tt.profile&&Or(Tt.profile)&&Fl($e,Gt,Tt,!1,!0),$t)Tt.useVAO?Tt.drawVAO?Or(Tt.drawVAO)?Gt($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Gt),");"):Zt($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Zt),");"):Zt($e.shared.vao,".setVAO(",$e.shared.vao,".targetVAO);"):(Zt($e.shared.vao,".setVAO(null);"),dc($e,Zt,Tt,$t.attributes,Wr),dc($e,Gt,Tt,$t.attributes,Or)),vc($e,Zt,Tt,$t.uniforms,Wr,!1),vc($e,Gt,Tt,$t.uniforms,Or,!0),Co($e,Zt,Gt,Tt);else{var hn=$e.global.def("{}"),la=Tt.shader.progVar.append($e,Gt),Zn=Gt.def(la,".id"),Gn=Gt.def(hn,"[",Zn,"]");Gt($e.shared.gl,".useProgram(",la,".program);","if(!",Gn,"){",Gn,"=",hn,"[",Zn,"]=",$e.link(function(ua){return ds(q,$e,Tt,ua,2)}),"(",la,");}",Gn,".call(this,a0[",Jt,"],",Jt,");")}}function J($e,it){var Tt=$e.proc("batch",2);$e.batchId="0",qs($e,Tt);var $t=!1,Ht=!0;Object.keys(it.context).forEach(function(hn){$t=$t||it.context[hn].propDep}),$t||(nu($e,Tt,it.context),Ht=!1);var Jt=it.framebuffer,ir=!1;Jt?(Jt.propDep?$t=ir=!0:Jt.contextDep&&$t&&(ir=!0),ir||du($e,Tt,Jt)):du($e,Tt,null),it.state.viewport&&it.state.viewport.propDep&&($t=!0);function rr(hn){return hn.contextDep&&$t||hn.propDep}ho($e,Tt,it),ec($e,Tt,it.state,function(hn){return!rr(hn)}),(!it.profile||!rr(it.profile))&&Fl($e,Tt,it,!1,"a1"),it.contextDep=$t,it.needsContext=Ht,it.needsFramebuffer=ir;var Bt=it.shader.progVar;if(Bt.contextDep&&$t||Bt.propDep)he($e,Tt,it,null);else{var Zt=Bt.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",Zt,".program);"),it.shader.program)he($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Gt=$e.global.def("{}"),Or=Tt.def(Zt,".id"),Wr=Tt.def(Gt,"[",Or,"]");Tt($e.cond(Wr).then(Wr,".call(this,a0,a1);").else(Wr,"=",Gt,"[",Or,"]=",$e.link(function(hn){return ds(he,$e,it,hn,2)}),"(",Zt,");",Wr,".call(this,a0,a1);"))}}Object.keys(it.state).length>0&&Tt($e.shared.current,".dirty=true;"),$e.shared.vao&&Tt($e.shared.vao,".setVAO(null);")}function _e($e,it){var Tt=$e.proc("scope",3);$e.batchId="a2";var $t=$e.shared,Ht=$t.current;if(nu($e,Tt,it.context),it.framebuffer&&it.framebuffer.append($e,Tt),oa(Object.keys(it.state)).forEach(function(rr){var Bt=it.state[rr],Zt=Bt.append($e,Tt);jn(Zt)?Zt.forEach(function(Gt,Or){zi(Gt)?Tt.set($e.next[rr],"["+Or+"]",Gt):Tt.set($e.next[rr],"["+Or+"]",$e.link(Gt,{stable:!0}))}):Zi(Bt)?Tt.set($t.next,"."+rr,$e.link(Zt,{stable:!0})):Tt.set($t.next,"."+rr,Zt)}),Fl($e,Tt,it,!0,!0),[Ce,kt,_t,Xt,Be].forEach(function(rr){var Bt=it.draw[rr];if(Bt){var Zt=Bt.append($e,Tt);zi(Zt)?Tt.set($t.draw,"."+rr,Zt):Tt.set($t.draw,"."+rr,$e.link(Zt),{stable:!0})}}),Object.keys(it.uniforms).forEach(function(rr){var Bt=it.uniforms[rr].append($e,Tt);Array.isArray(Bt)&&(Bt="["+Bt.map(function(Zt){return zi(Zt)?Zt:$e.link(Zt,{stable:!0})})+"]"),Tt.set($t.uniforms,"["+$e.link(yr.id(rr),{stable:!0})+"]",Bt)}),Object.keys(it.attributes).forEach(function(rr){var Bt=it.attributes[rr].append($e,Tt),Zt=$e.scopeAttrib(rr);Object.keys(new Fn).forEach(function(Gt){Tt.set(Zt,"."+Gt,Bt[Gt])})}),it.scopeVAO){var Jt=it.scopeVAO.append($e,Tt);zi(Jt)?Tt.set($t.vao,".targetVAO",Jt):Tt.set($t.vao,".targetVAO",$e.link(Jt,{stable:!0}))}function ir(rr){var Bt=it.shader[rr];if(Bt){var Zt=Bt.append($e,Tt);zi(Zt)?Tt.set($t.shader,"."+rr,Zt):Tt.set($t.shader,"."+rr,$e.link(Zt,{stable:!0}))}}ir(oe),ir(Me),Object.keys(it.state).length>0&&(Tt(Ht,".dirty=true;"),Tt.exit(Ht,".dirty=true;")),Tt("a1(",$e.shared.context,",a0,",$e.batchId,");")}function qe($e){if(!(typeof $e!="object"||jn($e))){for(var it=Object.keys($e),Tt=0;Tt=0;--Co){var ds=zi[Co];ds&&ds(Ga,null,0)}wr.flush(),Da&&Da.update()}function qo(){!Ya&&zi.length>0&&(Ya=c.next(To))}function Qo(){Ya&&(c.cancel(To),Ya=null)}function fl(Co){Co.preventDefault(),Qo(),Lo.forEach(function(ds){ds()})}function es(Co){wr.getError(),ca.restore(),Ua.restore(),ta.restore(),Ri.restore(),ia.restore(),Yn.restore(),aa.restore(),Da&&Da.restore(),ii.procs.refresh(),qo(),_i.forEach(function(ds){ds()})}Oa&&(Oa.addEventListener($l,fl,!1),Oa.addEventListener(Ol,es,!1));function Eu(){zi.length=0,Qo(),Oa&&(Oa.removeEventListener($l,fl),Oa.removeEventListener(Ol,es)),Ua.clear(),Yn.clear(),ia.clear(),aa.clear(),Ri.clear(),ya.clear(),ta.clear(),Da&&Da.clear(),ji.forEach(function(Co){Co()})}function el(Co){function ds(Ht){var Jt=h({},Ht);delete Jt.uniforms,delete Jt.attributes,delete Jt.context,delete Jt.vao,"stencil"in Jt&&Jt.stencil.op&&(Jt.stencil.opBack=Jt.stencil.opFront=Jt.stencil.op,delete Jt.stencil.op);function ir(rr){if(rr in Jt){var Bt=Jt[rr];delete Jt[rr],Object.keys(Bt).forEach(function(Zt){Jt[rr+"."+Zt]=Bt[Zt]})}}return ir("blend"),ir("depth"),ir("cull"),ir("stencil"),ir("polygonOffset"),ir("scissor"),ir("sample"),"vao"in Ht&&(Jt.vao=Ht.vao),Jt}function _s(Ht,Jt){var ir={},rr={};return Object.keys(Ht).forEach(function(Bt){var Zt=Ht[Bt];if(f.isDynamic(Zt)){rr[Bt]=f.unbox(Zt,Bt);return}else if(Jt&&Array.isArray(Zt)){for(var Gt=0;Gt0)return pt.call(this,Tt(Ht|0),Ht|0)}else if(Array.isArray(Ht)){if(Ht.length)return pt.call(this,Ht,Ht.length)}else return ft.call(this,Ht)}return h($t,{stats:_e,destroy:function(){qe.destroy()}})}var gu=Yn.setFBO=el({framebuffer:f.define.call(null,Sc,"framebuffer")});function Fu(Co,ds){var _s=0;ii.procs.poll();var be=ds.color;be&&(wr.clearColor(+be[0]||0,+be[1]||0,+be[2]||0,+be[3]||0),_s|=ru),"depth"in ds&&(wr.clearDepth(+ds.depth),_s|=lo),"stencil"in ds&&(wr.clearStencil(ds.stencil|0),_s|=Ls),wr.clear(_s)}function Qu(Co){if("framebuffer"in Co)if(Co.framebuffer&&Co.framebuffer_reglType==="framebufferCube")for(var ds=0;ds<6;++ds)gu(h({framebuffer:Co.framebuffer.faces[ds]},Co),Fu);else gu(Co,Fu);else Fu(null,Co)}function _f(Co){zi.push(Co);function ds(){var _s=Kc(zi,Co);function be(){var q=Kc(zi,be);zi[q]=zi[zi.length-1],zi.length-=1,zi.length<=0&&Qo()}zi[_s]=be}return qo(),{cancel:ds}}function nu(){var Co=$a.viewport,ds=$a.scissor_box;Co[0]=Co[1]=ds[0]=ds[1]=0,Ga.viewportWidth=Ga.framebufferWidth=Ga.drawingBufferWidth=Co[2]=ds[2]=wr.drawingBufferWidth,Ga.viewportHeight=Ga.framebufferHeight=Ga.drawingBufferHeight=Co[3]=ds[3]=wr.drawingBufferHeight}function du(){Ga.tick+=1,Ga.time=ec(),nu(),ii.procs.poll()}function ho(){Ri.refresh(),nu(),ii.procs.refresh(),Da&&Da.update()}function ec(){return(p()-Za)/1e3}ho();function qs(Co,ds){var _s;switch(Co){case"frame":return _f(ds);case"lost":_s=Lo;break;case"restore":_s=_i;break;case"destroy":_s=ji;break}return _s.push(ds),{cancel:function(){for(var be=0;be<_s.length;++be)if(_s[be]===ds){_s[be]=_s[_s.length-1],_s.pop();return}}}}function Fl(){return za}function dc(Co){Object.entries(Co).forEach(function(ds){za[ds[0]]=ds[1]})}var vc=h(el,{clear:Qu,prop:f.define.bind(null,Sc),context:f.define.bind(null,El),this:f.define.bind(null,Kl),draw:el({}),buffer:function(Co){return ta.create(Co,Qs,!1,!1)},elements:function(Co){return ya.create(Co,!1)},texture:Ri.create2D,cube:Ri.createCube,renderbuffer:ia.create,framebuffer:Yn.create,framebufferCube:Yn.createCube,vao:aa.createVAO,attributes:Ln,frame:_f,on:qs,limits:Fn,hasExtension:function(Co){return Fn.extensions.indexOf(Co.toLowerCase())>=0},read:Dn,destroy:Eu,_gl:wr,_refresh:ho,poll:function(){du(),Da&&Da.update()},now:ec,stats:mn,getCachedCode:Fl,preloadCachedCode:dc});return yr.onDone(null,vc),vc}return Pu})}}),lz=Ge({"node_modules/gl-util/context.js"(K,G){var h=Og();G.exports=function(o){if(o?typeof o=="string"&&(o={container:o}):o={},S(o)?o={container:o}:E(o)?o={container:o}:e(o)?o={gl:o}:o=h(o,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),o.pixelRatio||(o.pixelRatio=window.pixelRatio||1),o.gl)return o.gl;if(o.canvas&&(o.container=o.canvas.parentNode),o.container){if(typeof o.container=="string"){var n=document.querySelector(o.container);if(!n)throw Error("Element "+o.container+" is not found");o.container=n}S(o.container)?(o.canvas=o.container,o.container=o.canvas.parentNode):o.canvas||(o.canvas=t(),o.container.appendChild(o.canvas),b(o))}else if(!o.canvas)if(typeof document<"u")o.container=document.body||document.documentElement,o.canvas=t(),o.container.appendChild(o.canvas),b(o);else throw Error("Not DOM environment. Use headless-gl.");return o.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(i){try{o.gl=o.canvas.getContext(i,o.attrs)}catch{}return o.gl}),o.gl};function b(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var o=r.container.getBoundingClientRect();r.canvas.width=r.width||o.right-o.left,r.canvas.height=r.height||o.bottom-o.top}}function S(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function E(r){return typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.getBoundingClientRect=="function"}function e(r){return typeof r.drawArrays=="function"||typeof r.drawElements=="function"}function t(){var r=document.createElement("canvas");return r.style.position="absolute",r.style.top=0,r.style.left=0,r}}}),uz=Ge({"node_modules/font-atlas/index.js"(K,G){var h=oL(),b=[32,126];G.exports=S;function S(E){E=E||{};var e=E.shape?E.shape:E.canvas?[E.canvas.width,E.canvas.height]:[512,512],t=E.canvas||document.createElement("canvas"),r=E.font,o=typeof E.step=="number"?[E.step,E.step]:E.step||[32,32],n=E.chars||b;if(r&&typeof r!="string"&&(r=h(r)),!Array.isArray(n))n=String(n).split("");else if(n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"){for(var i=[],a=n[0],s=0;a<=n[1];a++)i[s++]=String.fromCharCode(a);n=i}e=e.slice(),t.width=e[0],t.height=e[1];var f=t.getContext("2d");f.fillStyle="#000",f.fillRect(0,0,t.width,t.height),f.font=r,f.textAlign="center",f.textBaseline="middle",f.fillStyle="#fff";for(var c=o[0]/2,p=o[1]/2,a=0;ae[0]-o[0]/2&&(c=o[0]/2,p+=o[1]);return t}}}),sL=Ge({"node_modules/bit-twiddle/twiddle.js"(K){"use restrict";var G=32;K.INT_BITS=G,K.INT_MAX=2147483647,K.INT_MIN=-1<0)-(S<0)},K.abs=function(S){var E=S>>G-1;return(S^E)-E},K.min=function(S,E){return E^(S^E)&-(S65535)<<4,S>>>=E,e=(S>255)<<3,S>>>=e,E|=e,e=(S>15)<<2,S>>>=e,E|=e,e=(S>3)<<1,S>>>=e,E|=e,E|S>>1},K.log10=function(S){return S>=1e9?9:S>=1e8?8:S>=1e7?7:S>=1e6?6:S>=1e5?5:S>=1e4?4:S>=1e3?3:S>=100?2:S>=10?1:0},K.popCount=function(S){return S=S-(S>>>1&1431655765),S=(S&858993459)+(S>>>2&858993459),(S+(S>>>4)&252645135)*16843009>>>24};function h(S){var E=32;return S&=-S,S&&E--,S&65535&&(E-=16),S&16711935&&(E-=8),S&252645135&&(E-=4),S&858993459&&(E-=2),S&1431655765&&(E-=1),E}K.countTrailingZeros=h,K.nextPow2=function(S){return S+=S===0,--S,S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S+1},K.prevPow2=function(S){return S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S-(S>>>1)},K.parity=function(S){return S^=S>>>16,S^=S>>>8,S^=S>>>4,S&=15,27030>>>S&1};var b=new Array(256);(function(S){for(var E=0;E<256;++E){var e=E,t=E,r=7;for(e>>>=1;e;e>>>=1)t<<=1,t|=e&1,--r;S[E]=t<>>8&255]<<16|b[S>>>16&255]<<8|b[S>>>24&255]},K.interleave2=function(S,E){return S&=65535,S=(S|S<<8)&16711935,S=(S|S<<4)&252645135,S=(S|S<<2)&858993459,S=(S|S<<1)&1431655765,E&=65535,E=(E|E<<8)&16711935,E=(E|E<<4)&252645135,E=(E|E<<2)&858993459,E=(E|E<<1)&1431655765,S|E<<1},K.deinterleave2=function(S,E){return S=S>>>E&1431655765,S=(S|S>>>1)&858993459,S=(S|S>>>2)&252645135,S=(S|S>>>4)&16711935,S=(S|S>>>16)&65535,S<<16>>16},K.interleave3=function(S,E,e){return S&=1023,S=(S|S<<16)&4278190335,S=(S|S<<8)&251719695,S=(S|S<<4)&3272356035,S=(S|S<<2)&1227133513,E&=1023,E=(E|E<<16)&4278190335,E=(E|E<<8)&251719695,E=(E|E<<4)&3272356035,E=(E|E<<2)&1227133513,S|=E<<1,e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,S|e<<2},K.deinterleave3=function(S,E){return S=S>>>E&1227133513,S=(S|S>>>2)&3272356035,S=(S|S>>>4)&251719695,S=(S|S>>>8)&4278190335,S=(S|S>>>16)&1023,S<<22>>22},K.nextCombination=function(S){var E=S|S-1;return E+1|(~E&-~E)-1>>>h(S)+1}}}),cz=Ge({"node_modules/dup/dup.js"(K,G){function h(E,e,t){var r=E[t]|0;if(r<=0)return[];var o=new Array(r),n;if(t===E.length-1)for(n=0;n"u"&&(e=0),typeof E){case"number":if(E>0)return b(E|0,e);break;case"object":if(typeof E.length=="number")return h(E,e,0);break}return[]}G.exports=S}}),fz=Ge({"node_modules/typedarray-pool/pool.js"(K){var G=sL(),h=cz(),b=xg().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:h([32,0]),UINT16:h([32,0]),UINT32:h([32,0]),BIGUINT64:h([32,0]),INT8:h([32,0]),INT16:h([32,0]),INT32:h([32,0]),BIGINT64:h([32,0]),FLOAT:h([32,0]),DOUBLE:h([32,0]),DATA:h([32,0]),UINT8C:h([32,0]),BUFFER:h([32,0])});var S=typeof Uint8ClampedArray<"u",E=typeof BigUint64Array<"u",e=typeof BigInt64Array<"u",t=window.__TYPEDARRAY_POOL;t.UINT8C||(t.UINT8C=h([32,0])),t.BIGUINT64||(t.BIGUINT64=h([32,0])),t.BIGINT64||(t.BIGINT64=h([32,0])),t.BUFFER||(t.BUFFER=h([32,0]));var r=t.DATA,o=t.BUFFER;K.free=function(u){if(b.isBuffer(u))o[G.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var d=u.length||u.byteLength,y=G.log2(d)|0;r[y].push(u)}};function n(m){if(m){var u=m.length||m.byteLength,d=G.log2(u);r[d].push(m)}}function i(m){n(m.buffer)}K.freeUint8=K.freeUint16=K.freeUint32=K.freeBigUint64=K.freeInt8=K.freeInt16=K.freeInt32=K.freeBigInt64=K.freeFloat32=K.freeFloat=K.freeFloat64=K.freeDouble=K.freeUint8Clamped=K.freeDataView=i,K.freeArrayBuffer=n,K.freeBuffer=function(u){o[G.log2(u.length)].push(u)},K.malloc=function(u,d){if(d===void 0||d==="arraybuffer")return a(u);switch(d){case"uint8":return s(u);case"uint16":return f(u);case"uint32":return c(u);case"int8":return p(u);case"int16":return v(u);case"int32":return T(u);case"float":case"float32":return l(u);case"double":case"float64":return g(u);case"uint8_clamped":return x(u);case"bigint64":return M(u);case"biguint64":return A(u);case"buffer":return w(u);case"data":case"dataview":return _(u);default:return null}return null};function a(u){var u=G.nextPow2(u),d=G.log2(u),y=r[d];return y.length>0?y.pop():new ArrayBuffer(u)}K.mallocArrayBuffer=a;function s(m){return new Uint8Array(a(m),0,m)}K.mallocUint8=s;function f(m){return new Uint16Array(a(2*m),0,m)}K.mallocUint16=f;function c(m){return new Uint32Array(a(4*m),0,m)}K.mallocUint32=c;function p(m){return new Int8Array(a(m),0,m)}K.mallocInt8=p;function v(m){return new Int16Array(a(2*m),0,m)}K.mallocInt16=v;function T(m){return new Int32Array(a(4*m),0,m)}K.mallocInt32=T;function l(m){return new Float32Array(a(4*m),0,m)}K.mallocFloat32=K.mallocFloat=l;function g(m){return new Float64Array(a(8*m),0,m)}K.mallocFloat64=K.mallocDouble=g;function x(m){return S?new Uint8ClampedArray(a(m),0,m):s(m)}K.mallocUint8Clamped=x;function A(m){return E?new BigUint64Array(a(8*m),0,m):null}K.mallocBigUint64=A;function M(m){return e?new BigInt64Array(a(8*m),0,m):null}K.mallocBigInt64=M;function _(m){return new DataView(a(m),0,m)}K.mallocDataView=_;function w(m){m=G.nextPow2(m);var u=G.log2(m),d=o[u];return d.length>0?d.pop():new b(m)}K.mallocBuffer=w,K.clearCache=function(){for(var u=0;u<32;++u)t.UINT8[u].length=0,t.UINT16[u].length=0,t.UINT32[u].length=0,t.INT8[u].length=0,t.INT16[u].length=0,t.INT32[u].length=0,t.FLOAT[u].length=0,t.DOUBLE[u].length=0,t.BIGUINT64[u].length=0,t.BIGINT64[u].length=0,t.UINT8C[u].length=0,r[u].length=0,o[u].length=0}}}),hz=Ge({"node_modules/is-plain-obj/index.js"(K,G){var h=Object.prototype.toString;G.exports=function(b){var S;return h.call(b)==="[object Object]"&&(S=Object.getPrototypeOf(b),S===null||S===Object.getPrototypeOf({}))}}}),lL=Ge({"node_modules/parse-unit/index.js"(K,G){G.exports=function(b,S){S||(S=[0,""]),b=String(b);var E=parseFloat(b,10);return S[0]=E,S[1]=b.match(/[\d.\-\+]*\s*(.*)/)[1]||"",S}}}),dz=Ge({"node_modules/to-px/topx.js"(K,G){var h=lL();G.exports=e;var b=96;function S(t,r){var o=h(getComputedStyle(t).getPropertyValue(r));return o[0]*e(o[1],t)}function E(t,r){var o=document.createElement("div");o.style["font-size"]="128"+t,r.appendChild(o);var n=S(o,"font-size")/128;return r.removeChild(o),n}function e(t,r){switch(r=r||document.body,t=(t||"px").trim().toLowerCase(),(r===window||r===document)&&(r=document.body),t){case"%":return r.clientHeight/100;case"ch":case"ex":return E(t,r);case"em":return S(r,"font-size");case"rem":return S(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return b;case"cm":return b/2.54;case"mm":return b/25.4;case"pt":return b/72;case"pc":return b/6}return 1}}}),vz=Ge({"node_modules/detect-kerning/index.js"(K,G){G.exports=E;var h=E.canvas=document.createElement("canvas"),b=h.getContext("2d"),S=e([32,126]);E.createPairs=e,E.ascii=S;function E(t,r){Array.isArray(t)&&(t=t.join(", "));var o={},n,i=16,a=.05;r&&(r.length===2&&typeof r[0]=="number"?n=e(r):Array.isArray(r)?n=r:(r.o?n=e(r.o):r.pairs&&(n=r.pairs),r.fontSize&&(i=r.fontSize),r.threshold!=null&&(a=r.threshold))),n||(n=S),b.font=i+"px "+t;for(var s=0;si*a){var v=(p-c)/i;o[f]=v*1e3}}return o}function e(t){for(var r=[],o=t[0];o<=t[1];o++)for(var n=String.fromCharCode(o),i=t[0];i0;o-=4)if(r[o]!==0)return Math.floor((o-3)*.25/t)}}}),mz=Ge({"node_modules/gl-text/dist.js"(K,G){var h=oz(),b=Og(),S=sz(),E=lz(),e=JC(),t=D_(),r=uz(),o=fz(),n=H3(),i=hz(),a=lL(),s=dz(),f=vz(),c=Ad(),p=pz(),v=Kb(),T=sL(),l=T.nextPow2,g=new e,x=!1;document.body&&(A=document.body.appendChild(document.createElement("div")),A.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(A).fontStretch&&(x=!0),document.body.removeChild(A));var A,M=function(m){_(m)?(m={regl:m},this.gl=m.regl._gl):this.gl=E(m),this.shader=g.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=m.regl||S({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),g.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(i(m)?m:{})};M.prototype.createShader=function(){var m=this.regl,u=m({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:m.prop("count"),offset:m.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:m.this("sizeBuffer")},width:{offset:0,stride:8,buffer:m.this("sizeBuffer")},char:m.this("charBuffer"),position:m.this("position")},uniforms:{atlasSize:function(y,I){return[I.atlas.width,I.atlas.height]},atlasDim:function(y,I){return[I.atlas.cols,I.atlas.rows]},atlas:function(y,I){return I.atlas.texture},charStep:function(y,I){return I.atlas.step},em:function(y,I){return I.atlas.em},color:m.prop("color"),opacity:m.prop("opacity"),viewport:m.this("viewportArray"),scale:m.this("scale"),align:m.prop("align"),baseline:m.prop("baseline"),translate:m.this("translate"),positionOffset:m.prop("positionOffset")},primitive:"points",viewport:m.this("viewport"),vert:` precision highp float; attribute float width, charOffset, char; attribute vec2 position; @@ -2699,17 +2699,17 @@ void main() { // color.rgb += (1. - color.rgb) * (1. - mask.rgb); gl_FragColor = color; - }`}),v={};return{regl:m,draw:u,atlas:v}},M.prototype.update=function(m){var u=this;if(typeof m=="string")m={text:m};else if(!m)return;m=b(m,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0),m.opacity!=null&&(Array.isArray(m.opacity)?this.opacity=m.opacity.map(function(pe){return parseFloat(pe)}):this.opacity=parseFloat(m.opacity)),m.viewport!=null&&(this.viewport=n(m.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),m.kerning!=null&&(this.kerning=m.kerning),m.offset!=null&&(typeof m.offset=="number"&&(m.offset=[m.offset,0]),this.positionOffset=d(m.offset)),m.direction&&(this.direction=m.direction),m.range&&(this.range=m.range,this.scale=[1/(m.range[2]-m.range[0]),1/(m.range[3]-m.range[1])],this.translate=[-m.range[0],-m.range[1]]),m.scale&&(this.scale=m.scale),m.translate&&(this.translate=m.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!m.font&&(m.font=M.baseFontSize+"px sans-serif");var v=!1,y=!1;if(m.font&&(Array.isArray(m.font)?m.font:[m.font]).forEach(function(pe,Ne){if(typeof pe=="string")try{pe=h.parse(pe)}catch{pe=h.parse(M.baseFontSize+"px "+pe)}else{var ot=pe.style,ft=pe.weight,rt=pe.stretch,Ft=pe.variant;pe=h.parse(h.stringify(pe)),ot&&(pe.style=ot),ft&&(pe.weight=ft),rt&&(pe.stretch=rt),Ft&&(pe.variant=Ft)}var Nt=h.stringify({size:M.baseFontSize,family:pe.family,stretch:x?pe.stretch:void 0,variant:pe.variant,weight:pe.weight,style:pe.style}),$t=a(pe.size),rr=Math.round($t[0]*s($t[1]));if(rr!==u.fontSize[Ne]&&(y=!0,u.fontSize[Ne]=rr),(!u.font[Ne]||Nt!=u.font[Ne].baseString)&&(v=!0,u.font[Ne]=M.fonts[Nt],!u.font[Ne])){var Er=pe.family.join(", "),Mr=[pe.style];pe.style!=pe.variant&&Mr.push(pe.variant),pe.variant!=pe.weight&&Mr.push(pe.weight),x&&pe.weight!=pe.stretch&&Mr.push(pe.stretch),u.font[Ne]={baseString:Nt,family:Er,weight:pe.weight,stretch:pe.stretch,style:pe.style,variant:pe.variant,width:{},kerning:{},metrics:p(Er,{origin:"top",fontSize:M.baseFontSize,fontStyle:Mr.join(" ")})},M.fonts[Nt]=u.font[Ne]}}),(v||y)&&this.font.forEach(function(pe,Ne){var ot=h.stringify({size:u.fontSize[Ne],family:pe.family,stretch:x?pe.stretch:void 0,variant:pe.variant,weight:pe.weight,style:pe.style});if(u.fontAtlas[Ne]=u.shader.atlas[ot],!u.fontAtlas[Ne]){var ft=pe.metrics;u.shader.atlas[ot]=u.fontAtlas[Ne]={fontString:ot,step:Math.ceil(u.fontSize[Ne]*ft.bottom*.5)*2,em:u.fontSize[Ne],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:u.regl.texture()}}m.text==null&&(m.text=u.text)}),typeof m.text=="string"&&m.position&&m.position.length>2){for(var I=Array(m.position.length*.5),L=0;L2){for(var N=!m.position[0].length,B=o.mallocFloat(this.count*2),R=0,U=0;R1?u.align[Ne]:u.align[0]:u.align;if(typeof ot=="number")return ot;switch(ot){case"right":case"end":return-pe;case"center":case"centre":case"middle":return-pe*.5}return 0})),this.baseline==null&&m.baseline==null&&(m.baseline=0),m.baseline!=null&&(this.baseline=m.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(pe,Ne){var ot=(u.font[Ne]||u.font[0]).metrics,ft=0;return ft+=ot.bottom*.5,typeof pe=="number"?ft+=pe-ot.baseline:ft+=-ot[pe],ft*=-1,ft})),m.color!=null)if(m.color||(m.color="transparent"),typeof m.color=="string"||!isNaN(m.color))this.color=t(m.color,"uint8");else{var Fe;if(typeof m.color[0]=="number"&&m.color.length>this.counts.length){var ze=m.color.length;Fe=o.mallocUint8(ze);for(var Ye=(m.color.subarray||m.color.slice).bind(m.color),it=0;it4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(Qe){var Le=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(Le);for(var Te=0;Te1?this.counts[Te]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Te]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(Te*4,Te*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Te]:this.opacity,baseline:this.baselineOffset[Te]!=null?this.baselineOffset[Te]:this.baselineOffset[0],align:this.align?this.alignOffset[Te]!=null?this.alignOffset[Te]:this.alignOffset[0]:0,atlas:this.fontAtlas[Te]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(Te*2,Te*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},M.prototype.destroy=function(){},M.prototype.kerning=!0,M.prototype.position={constant:new Float32Array(2)},M.prototype.translate=null,M.prototype.scale=null,M.prototype.font=null,M.prototype.text="",M.prototype.positionOffset=[0,0],M.prototype.opacity=1,M.prototype.color=new Uint8Array([0,0,0,255]),M.prototype.alignOffset=[0,0],M.maxAtlasSize=1024,M.atlasCanvas=document.createElement("canvas"),M.atlasContext=M.atlasCanvas.getContext("2d",{alpha:!1}),M.baseFontSize=64,M.fonts={};function _(w){return typeof w=="function"&&w._gl&&w.prop&&w.texture&&w.buffer}G.exports=M}}),XI=Ge({"node_modules/@plotly/regl/dist/regl.unchecked.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?G.exports=b():h.createREGL=b()})($,function(){var h=function(dt,gr){for(var wr=Object.keys(gr),Cn=0;Cn1&&gr===wr&&(gr==='"'||gr==="'"))return['"'+r(dt.substr(1,dt.length-2))+'"'];var Cn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(dt);if(Cn)return o(dt.substr(0,Cn.index)).concat(o(Cn[1])).concat(o(dt.substr(Cn.index+Cn[0].length)));var ua=dt.split(".");if(ua.length===1)return['"'+r(dt)+'"'];for(var gn=[],pn=0;pn"u"?1:window.devicePixelRatio,Wa=!1,Bi={},bi=function(rn){},Ha=function(){};if(typeof gr=="string"?wr=document.querySelector(gr):typeof gr=="object"&&(g(gr)?wr=gr:x(gr)?(gn=gr,ua=gn.canvas):("gl"in gr?gn=gr.gl:"canvas"in gr?ua=M(gr.canvas):"container"in gr&&(Cn=M(gr.container)),"attributes"in gr&&(pn=gr.attributes),"extensions"in gr&&(za=A(gr.extensions)),"optionalExtensions"in gr&&(Ia=A(gr.optionalExtensions)),"onDone"in gr&&(bi=gr.onDone),"profile"in gr&&(Wa=!!gr.profile),"pixelRatio"in gr&&(Da=+gr.pixelRatio),"cachedCode"in gr&&(Bi=gr.cachedCode))),wr&&(wr.nodeName.toLowerCase()==="canvas"?ua=wr:Cn=wr),!gn){if(!ua){var ga=T(Cn||document.body,bi,Da);if(!ga)return null;ua=ga.canvas,Ha=ga.onDestroy}pn.premultipliedAlpha===void 0&&(pn.premultipliedAlpha=!0),gn=l(ua,pn)}return gn?{gl:gn,canvas:ua,container:Cn,extensions:za,optionalExtensions:Ia,pixelRatio:Da,profile:Wa,cachedCode:Bi,onDone:bi,onDestroy:Ha}:(Ha(),bi("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(dt,gr){var wr={};function Cn(pn){var za=pn.toLowerCase(),Ia;try{Ia=wr[za]=dt.getExtension(za)}catch{}return!!Ia}for(var ua=0;ua65535)<<4,dt>>>=gr,wr=(dt>255)<<3,dt>>>=wr,gr|=wr,wr=(dt>15)<<2,dt>>>=wr,gr|=wr,wr=(dt>3)<<1,dt>>>=wr,gr|=wr,gr|dt>>1}function R(){var dt=m(8,function(){return[]});function gr(gn){var pn=N(gn),za=dt[B(pn)>>2];return za.length>0?za.pop():new ArrayBuffer(pn)}function wr(gn){dt[B(gn.byteLength)>>2].push(gn)}function Cn(gn,pn){var za=null;switch(gn){case u:za=new Int8Array(gr(pn),0,pn);break;case v:za=new Uint8Array(gr(pn),0,pn);break;case y:za=new Int16Array(gr(2*pn),0,pn);break;case I:za=new Uint16Array(gr(2*pn),0,pn);break;case L:za=new Int32Array(gr(4*pn),0,pn);break;case z:za=new Uint32Array(gr(4*pn),0,pn);break;case F:za=new Float32Array(gr(4*pn),0,pn);break;default:return null}return za.length!==pn?za.subarray(0,pn):za}function ua(gn){wr(gn.buffer)}return{alloc:gr,free:wr,allocType:Cn,freeType:ua}}var U=R();U.zero=R();var j=3408,Z=3410,re=3411,fe=3412,le=3413,ce=3414,V=3415,ee=33901,ne=33902,K=3379,ue=3386,te=34921,H=36347,ae=36348,ie=35661,ve=35660,Ae=34930,Ce=36349,Fe=34076,ze=34024,Ye=7936,it=7937,st=7938,nt=35724,Qe=34047,Le=36063,Te=34852,pe=3553,Ne=34067,ot=34069,ft=33984,rt=6408,Ft=5126,Nt=5121,$t=36160,rr=36053,Er=36064,Mr=16384,Wr=function(dt,gr){var wr=1;gr.ext_texture_filter_anisotropic&&(wr=dt.getParameter(Qe));var Cn=1,ua=1;gr.webgl_draw_buffers&&(Cn=dt.getParameter(Te),ua=dt.getParameter(Le));var gn=!!gr.oes_texture_float;if(gn){var pn=dt.createTexture();dt.bindTexture(pe,pn),dt.texImage2D(pe,0,rt,1,1,0,rt,Ft,null);var za=dt.createFramebuffer();if(dt.bindFramebuffer($t,za),dt.framebufferTexture2D($t,Er,pe,pn,0),dt.bindTexture(pe,null),dt.checkFramebufferStatus($t)!==rr)gn=!1;else{dt.viewport(0,0,1,1),dt.clearColor(1,0,0,1),dt.clear(Mr);var Ia=U.allocType(Ft,4);dt.readPixels(0,0,1,1,rt,Ft,Ia),dt.getError()?gn=!1:(dt.deleteFramebuffer(za),dt.deleteTexture(pn),gn=Ia[0]===1),U.freeType(Ia)}}var Da=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Wa=!0;if(!Da){var Bi=dt.createTexture(),bi=U.allocType(Nt,36);dt.activeTexture(ft),dt.bindTexture(Ne,Bi),dt.texImage2D(ot,0,rt,3,3,0,rt,Nt,bi),U.freeType(bi),dt.bindTexture(Ne,null),dt.deleteTexture(Bi),Wa=!dt.getError()}return{colorBits:[dt.getParameter(Z),dt.getParameter(re),dt.getParameter(fe),dt.getParameter(le)],depthBits:dt.getParameter(ce),stencilBits:dt.getParameter(V),subpixelBits:dt.getParameter(j),extensions:Object.keys(gr).filter(function(Ha){return!!gr[Ha]}),maxAnisotropic:wr,maxDrawbuffers:Cn,maxColorAttachments:ua,pointSizeDims:dt.getParameter(ee),lineWidthDims:dt.getParameter(ne),maxViewportDims:dt.getParameter(ue),maxCombinedTextureUnits:dt.getParameter(ie),maxCubeMapSize:dt.getParameter(Fe),maxRenderbufferSize:dt.getParameter(ze),maxTextureUnits:dt.getParameter(Ae),maxTextureSize:dt.getParameter(K),maxAttributes:dt.getParameter(te),maxVertexUniforms:dt.getParameter(H),maxVertexTextureUnits:dt.getParameter(ve),maxVaryingVectors:dt.getParameter(ae),maxFragmentUniforms:dt.getParameter(Ce),glsl:dt.getParameter(nt),renderer:dt.getParameter(it),vendor:dt.getParameter(Ye),version:dt.getParameter(st),readFloat:gn,npotTextureCube:Wa}},Sr=function(dt){return dt instanceof Uint8Array||dt instanceof Uint16Array||dt instanceof Uint32Array||dt instanceof Int8Array||dt instanceof Int16Array||dt instanceof Int32Array||dt instanceof Float32Array||dt instanceof Float64Array||dt instanceof Uint8ClampedArray};function Br(dt){return!!dt&&typeof dt=="object"&&Array.isArray(dt.shape)&&Array.isArray(dt.stride)&&typeof dt.offset=="number"&&dt.shape.length===dt.stride.length&&(Array.isArray(dt.data)||Sr(dt.data))}var Mt=function(dt){return Object.keys(dt).map(function(gr){return dt[gr]})},je={shape:Xe,flatten:Me};function $e(dt,gr,wr){for(var Cn=0;Cn0){var Di;if(Array.isArray(Fn[0])){Ua=Nn(Fn);for(var aa=1,Zn=1;Zn0){if(typeof aa[0]=="number"){var $a=U.allocType(na.dtype,aa.length);Vr($a,aa),Ua($a,li),U.freeType($a)}else if(Array.isArray(aa[0])||Sr(aa[0])){Dn=Nn(aa);var Oa=ra(aa,Dn,na.dtype);Ua(Oa,li),U.freeType(Oa)}}}else if(Br(aa)){Dn=aa.shape;var Oi=aa.stride,Po=0,wi=0,ji=0,Ya=0;Dn.length===1?(Po=Dn[0],wi=1,ji=Oi[0],Ya=0):Dn.length===2&&(Po=Dn[0],wi=Dn[1],ji=Oi[0],Ya=Oi[1]);var Mo=Array.isArray(aa.data)?na.dtype:lr(aa.data),Ho=U.allocType(Mo,Po*wi);sn(Ho,aa.data,Po,wi,ji,Ya,aa.offset),Ua(Ho,li),U.freeType(Ho)}return di}return ea||di(rn),di._reglType="buffer",di._buffer=na,di.subdata=Di,wr.profile&&(di.stats=na.stats),di.destroy=function(){bi(na)},di}function ga(){Mt(gn).forEach(function(rn){rn.buffer=dt.createBuffer(),dt.bindBuffer(rn.type,rn.buffer),dt.bufferData(rn.type,rn.persistentData||rn.byteLength,rn.usage)})}return wr.profile&&(gr.getTotalBufferSize=function(){var rn=0;return Object.keys(gn).forEach(function(Fn){rn+=gn[Fn].stats.size}),rn}),{create:Ha,createStream:Ia,destroyStream:Da,clear:function(){Mt(gn).forEach(bi),za.forEach(bi)},getBuffer:function(rn){return rn&&rn._buffer instanceof pn?rn._buffer:null},restore:ga,_initBuffer:Bi}}var wn=0,Jn=0,pa=1,ha=1,_a=4,Ca=4,Vn={points:wn,point:Jn,lines:pa,line:ha,triangles:_a,triangle:Ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},yi=0,Ci=1,Dt=4,yt=5120,kr=5121,Nr=5122,jr=5123,Ir=5124,Ur=5125,ln=34963,$r=35040,At=35044;function or(dt,gr,wr,Cn){var ua={},gn=0,pn={uint8:kr,uint16:jr};gr.oes_element_index_uint&&(pn.uint32=Ur);function za(ga){this.id=gn++,ua[this.id]=this,this.buffer=ga,this.primType=Dt,this.vertCount=0,this.type=0}za.prototype.bind=function(){this.buffer.bind()};var Ia=[];function Da(ga){var rn=Ia.pop();return rn||(rn=new za(wr.create(null,ln,!0,!1)._buffer)),Bi(rn,ga,$r,-1,-1,0,0),rn}function Wa(ga){Ia.push(ga)}function Bi(ga,rn,Fn,ea,ya,na,di){ga.buffer.bind();var Ua;if(rn){var Di=di;!di&&(!Sr(rn)||Br(rn)&&!Sr(rn.data))&&(Di=gr.oes_element_index_uint?Ur:jr),wr._initBuffer(ga.buffer,rn,Fn,Di,3)}else dt.bufferData(ln,na,Fn),ga.buffer.dtype=Ua||kr,ga.buffer.usage=Fn,ga.buffer.dimension=3,ga.buffer.byteLength=na;if(Ua=di,!di){switch(ga.buffer.dtype){case kr:case yt:Ua=kr;break;case jr:case Nr:Ua=jr;break;case Ur:case Ir:Ua=Ur;break}ga.buffer.dtype=Ua}ga.type=Ua;var aa=ya;aa<0&&(aa=ga.buffer.byteLength,Ua===jr?aa>>=1:Ua===Ur&&(aa>>=2)),ga.vertCount=aa;var Zn=ea;if(ea<0){Zn=Dt;var li=ga.buffer.dimension;li===1&&(Zn=yi),li===2&&(Zn=Ci),li===3&&(Zn=Dt)}ga.primType=Zn}function bi(ga){Cn.elementsCount--,delete ua[ga.id],ga.buffer.destroy(),ga.buffer=null}function Ha(ga,rn){var Fn=wr.create(null,ln,!0),ea=new za(Fn._buffer);Cn.elementsCount++;function ya(na){if(!na)Fn(),ea.primType=Dt,ea.vertCount=0,ea.type=kr;else if(typeof na=="number")Fn(na),ea.primType=Dt,ea.vertCount=na|0,ea.type=kr;else{var di=null,Ua=At,Di=-1,aa=-1,Zn=0,li=0;Array.isArray(na)||Sr(na)||Br(na)?di=na:("data"in na&&(di=na.data),"usage"in na&&(Ua=ta[na.usage]),"primitive"in na&&(Di=Vn[na.primitive]),"count"in na&&(aa=na.count|0),"type"in na&&(li=pn[na.type]),"length"in na?Zn=na.length|0:(Zn=aa,li===jr||li===Nr?Zn*=2:(li===Ur||li===Ir)&&(Zn*=4))),Bi(ea,di,Ua,Di,aa,Zn,li)}return ya}return ya(ga),ya._reglType="elements",ya._elements=ea,ya.subdata=function(na,di){return Fn.subdata(na,di),ya},ya.destroy=function(){bi(ea)},ya}return{create:Ha,createStream:Da,destroyStream:Wa,getElements:function(ga){return typeof ga=="function"&&ga._elements instanceof za?ga._elements:null},clear:function(){Mt(ua).forEach(bi)}}}var Dr=new Float32Array(1),un=new Uint32Array(Dr.buffer),Rn=5123;function jn(dt){for(var gr=U.allocType(Rn,dt.length),wr=0;wr>>31<<15,gn=(Cn<<1>>>24)-127,pn=Cn>>13&1023;if(gn<-24)gr[wr]=ua;else if(gn<-14){var za=-14-gn;gr[wr]=ua+(pn+1024>>za)}else gn>15?gr[wr]=ua+31744:gr[wr]=ua+(gn+15<<10)+pn}return gr}function Un(dt){return Array.isArray(dt)||Sr(dt)}var cn=34467,In=3553,xi=34067,Ea=34069,Pi=6408,Xi=6406,uo=6407,so=6409,Eo=6410,vi=32854,ns=32855,Xo=36194,Ys=32819,vs=32820,es=33635,qo=34042,Zs=6402,Hs=34041,sl=35904,ds=35906,Ko=36193,_o=33776,ps=33777,ll=33778,kl=33779,Rl=35986,Cs=35987,pi=34798,no=35840,Cl=35841,Ds=35842,No=35843,Il=36196,Ws=5121,ul=5123,xu=5125,eo=5126,_s=10242,as=10243,Hl=10497,Gl=33071,Do=33648,su=10240,fu=10241,Bs=9728,wl=9729,Bl=9984,jl=9985,Hu=9986,uf=9987,qc=33170,Qc=4352,Lh=4353,yh=4354,Tl=34046,Lc=3317,Ph=37440,nc=37441,Gu=37443,ac=37444,ef=33984,Kl=[Bl,Hu,jl,uf],Xu=[0,so,Eo,uo,Pi],Gs={};Gs[so]=Gs[Xi]=Gs[Zs]=1,Gs[Hs]=Gs[Eo]=2,Gs[uo]=Gs[sl]=3,Gs[Pi]=Gs[ds]=4;function Dl(dt){return"[object "+dt+"]"}var wf=Dl("HTMLCanvasElement"),yc=Dl("OffscreenCanvas"),If=Dl("CanvasRenderingContext2D"),lu=Dl("ImageBitmap"),bv=Dl("HTMLImageElement"),Ns=Dl("HTMLVideoElement"),Bv=Object.keys(Je).concat([wf,yc,If,lu,bv,Ns]),dl=[];dl[Ws]=1,dl[eo]=4,dl[Ko]=2,dl[ul]=2,dl[xu]=4;var Bo=[];Bo[vi]=2,Bo[ns]=2,Bo[Xo]=2,Bo[Hs]=4,Bo[_o]=.5,Bo[ps]=.5,Bo[ll]=1,Bo[kl]=1,Bo[Rl]=.5,Bo[Cs]=1,Bo[pi]=1,Bo[no]=.5,Bo[Cl]=.25,Bo[Ds]=.5,Bo[No]=.25,Bo[Il]=.5;function Kf(dt){return Array.isArray(dt)&&(dt.length===0||typeof dt[0]=="number")}function tf(dt){if(!Array.isArray(dt))return!1;var gr=dt.length;return!(gr===0||!Un(dt[0]))}function Iu(dt){return Object.prototype.toString.call(dt)}function Rh(dt){return Iu(dt)===wf}function Df(dt){return Iu(dt)===yc}function ih(dt){return Iu(dt)===If}function Yu(dt){return Iu(dt)===lu}function sv(dt){return Iu(dt)===bv}function Uh(dt){return Iu(dt)===Ns}function oh(dt){if(!dt)return!1;var gr=Iu(dt);return Bv.indexOf(gr)>=0?!0:Kf(dt)||tf(dt)||Br(dt)}function zf(dt){return Je[Object.prototype.toString.call(dt)]|0}function Ih(dt,gr){var wr=gr.length;switch(dt.type){case Ws:case ul:case xu:case eo:var Cn=U.allocType(dt.type,wr);Cn.set(gr),dt.data=Cn;break;case Ko:dt.data=jn(gr);break}}function Dh(dt,gr){return U.allocType(dt.type===Ko?eo:dt.type,gr)}function rf(dt,gr){dt.type===Ko?(dt.data=jn(gr),U.freeType(gr)):dt.data=gr}function jh(dt,gr,wr,Cn,ua,gn){for(var pn=dt.width,za=dt.height,Ia=dt.channels,Da=pn*za*Ia,Wa=Dh(dt,Da),Bi=0,bi=0;bi=1;)za+=pn*Ia*Ia,Ia/=2;return za}else return pn*wr*Cn}function cf(dt,gr,wr,Cn,ua,gn,pn){var za={"don't care":Qc,"dont care":Qc,nice:yh,fast:Lh},Ia={repeat:Hl,clamp:Gl,mirror:Do},Da={nearest:Bs,linear:wl},Wa=h({mipmap:uf,"nearest mipmap nearest":Bl,"linear mipmap nearest":jl,"nearest mipmap linear":Hu,"linear mipmap linear":uf},Da),Bi={none:0,browser:ac},bi={uint8:Ws,rgba4:Ys,rgb565:es,"rgb5 a1":vs},Ha={alpha:Xi,luminance:so,"luminance alpha":Eo,rgb:uo,rgba:Pi,rgba4:vi,"rgb5 a1":ns,rgb565:Xo},ga={};gr.ext_srgb&&(Ha.srgb=sl,Ha.srgba=ds),gr.oes_texture_float&&(bi.float32=bi.float=eo),gr.oes_texture_half_float&&(bi.float16=bi["half float"]=Ko),gr.webgl_depth_texture&&(h(Ha,{depth:Zs,"depth stencil":Hs}),h(bi,{uint16:ul,uint32:xu,"depth stencil":qo})),gr.webgl_compressed_texture_s3tc&&h(ga,{"rgb s3tc dxt1":_o,"rgba s3tc dxt1":ps,"rgba s3tc dxt3":ll,"rgba s3tc dxt5":kl}),gr.webgl_compressed_texture_atc&&h(ga,{"rgb atc":Rl,"rgba atc explicit alpha":Cs,"rgba atc interpolated alpha":pi}),gr.webgl_compressed_texture_pvrtc&&h(ga,{"rgb pvrtc 4bppv1":no,"rgb pvrtc 2bppv1":Cl,"rgba pvrtc 4bppv1":Ds,"rgba pvrtc 2bppv1":No}),gr.webgl_compressed_texture_etc1&&(ga["rgb etc1"]=Il);var rn=Array.prototype.slice.call(dt.getParameter(cn));Object.keys(ga).forEach(function(q){var he=ga[q];rn.indexOf(he)>=0&&(Ha[q]=he)});var Fn=Object.keys(Ha);wr.textureFormats=Fn;var ea=[];Object.keys(Ha).forEach(function(q){var he=Ha[q];ea[he]=q});var ya=[];Object.keys(bi).forEach(function(q){var he=bi[q];ya[he]=q});var na=[];Object.keys(Da).forEach(function(q){var he=Da[q];na[he]=q});var di=[];Object.keys(Wa).forEach(function(q){var he=Wa[q];di[he]=q});var Ua=[];Object.keys(Ia).forEach(function(q){var he=Ia[q];Ua[he]=q});var Di=Fn.reduce(function(q,he){var J=Ha[he];return J===so||J===Xi||J===so||J===Eo||J===Zs||J===Hs||gr.ext_srgb&&(J===sl||J===ds)?q[J]=J:J===ns||he.indexOf("rgba")>=0?q[J]=Pi:q[J]=uo,q},{});function aa(){this.internalformat=Pi,this.format=Pi,this.type=Ws,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=ac,this.width=0,this.height=0,this.channels=0}function Zn(q,he){q.internalformat=he.internalformat,q.format=he.format,q.type=he.type,q.compressed=he.compressed,q.premultiplyAlpha=he.premultiplyAlpha,q.flipY=he.flipY,q.unpackAlignment=he.unpackAlignment,q.colorSpace=he.colorSpace,q.width=he.width,q.height=he.height,q.channels=he.channels}function li(q,he){if(!(typeof he!="object"||!he)){if("premultiplyAlpha"in he&&(q.premultiplyAlpha=he.premultiplyAlpha),"flipY"in he&&(q.flipY=he.flipY),"alignment"in he&&(q.unpackAlignment=he.alignment),"colorSpace"in he&&(q.colorSpace=Bi[he.colorSpace]),"type"in he){var J=he.type;q.type=bi[J]}var _e=q.width,qe=q.height,lt=q.channels,vt=!1;"shape"in he?(_e=he.shape[0],qe=he.shape[1],he.shape.length===3&&(lt=he.shape[2],vt=!0)):("radius"in he&&(_e=qe=he.radius),"width"in he&&(_e=he.width),"height"in he&&(qe=he.height),"channels"in he&&(lt=he.channels,vt=!0)),q.width=_e|0,q.height=qe|0,q.channels=lt|0;var Ke=!1;if("format"in he){var at=he.format,bt=q.internalformat=Ha[at];q.format=Di[bt],at in bi&&("type"in he||(q.type=bi[at])),at in ga&&(q.compressed=!0),Ke=!0}!vt&&Ke?q.channels=Gs[q.format]:vt&&!Ke&&q.channels!==Xu[q.format]&&(q.format=q.internalformat=Xu[q.channels])}}function Dn(q){dt.pixelStorei(Ph,q.flipY),dt.pixelStorei(nc,q.premultiplyAlpha),dt.pixelStorei(Gu,q.colorSpace),dt.pixelStorei(Lc,q.unpackAlignment)}function $a(){aa.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Oa(q,he){var J=null;if(oh(he)?J=he:he&&(li(q,he),"x"in he&&(q.xOffset=he.x|0),"y"in he&&(q.yOffset=he.y|0),oh(he.data)&&(J=he.data)),he.copy){var _e=ua.viewportWidth,qe=ua.viewportHeight;q.width=q.width||_e-q.xOffset,q.height=q.height||qe-q.yOffset,q.needsCopy=!0}else if(!J)q.width=q.width||1,q.height=q.height||1,q.channels=q.channels||4;else if(Sr(J))q.channels=q.channels||4,q.data=J,!("type"in he)&&q.type===Ws&&(q.type=zf(J));else if(Kf(J))q.channels=q.channels||4,Ih(q,J),q.alignment=1,q.needsFree=!0;else if(Br(J)){var lt=J.data;!Array.isArray(lt)&&q.type===Ws&&(q.type=zf(lt));var vt=J.shape,Ke=J.stride,at,bt,Zt,Vt,Kt,nr;vt.length===3?(Zt=vt[2],nr=Ke[2]):(Zt=1,nr=1),at=vt[0],bt=vt[1],Vt=Ke[0],Kt=Ke[1],q.alignment=1,q.width=at,q.height=bt,q.channels=Zt,q.format=q.internalformat=Xu[Zt],q.needsFree=!0,jh(q,lt,Vt,Kt,nr,J.offset)}else if(Rh(J)||Df(J)||ih(J))Rh(J)||Df(J)?q.element=J:q.element=J.canvas,q.width=q.element.width,q.height=q.element.height,q.channels=4;else if(Yu(J))q.element=J,q.width=J.width,q.height=J.height,q.channels=4;else if(sv(J))q.element=J,q.width=J.naturalWidth,q.height=J.naturalHeight,q.channels=4;else if(Uh(J))q.element=J,q.width=J.videoWidth,q.height=J.videoHeight,q.channels=4;else if(tf(J)){var er=q.width||J[0].length,Bt=q.height||J.length,Xt=q.channels;Un(J[0][0])?Xt=Xt||J[0][0].length:Xt=Xt||1;for(var Ht=je.shape(J),zr=1,Yr=0;Yr>=qe,J.height>>=qe,Oa(J,_e[qe]),q.mipmask|=1<=0&&!("faces"in he)&&(q.genMipmaps=!0)}if("mag"in he){var _e=he.mag;q.magFilter=Da[_e]}var qe=q.wrapS,lt=q.wrapT;if("wrap"in he){var vt=he.wrap;typeof vt=="string"?qe=lt=Ia[vt]:Array.isArray(vt)&&(qe=Ia[vt[0]],lt=Ia[vt[1]])}else{if("wrapS"in he){var Ke=he.wrapS;qe=Ia[Ke]}if("wrapT"in he){var at=he.wrapT;lt=Ia[at]}}if(q.wrapS=qe,q.wrapT=lt,"anisotropic"in he&&(he.anisotropic,q.anisotropic=he.anisotropic),"mipmap"in he){var bt=!1;switch(typeof he.mipmap){case"string":q.mipmapHint=za[he.mipmap],q.genMipmaps=!0,bt=!0;break;case"boolean":bt=q.genMipmaps=he.mipmap;break;case"object":q.genMipmaps=!1,bt=!0;break}bt&&!("min"in he)&&(q.minFilter=Bl)}}function Wu(q,he){dt.texParameteri(he,fu,q.minFilter),dt.texParameteri(he,su,q.magFilter),dt.texParameteri(he,_s,q.wrapS),dt.texParameteri(he,as,q.wrapT),gr.ext_texture_filter_anisotropic&&dt.texParameteri(he,Tl,q.anisotropic),q.genMipmaps&&(dt.hint(qc,q.mipmapHint),dt.generateMipmap(he))}var pf=0,Ql={},cu=wr.maxTextureUnits,vo=Array(cu).map(function(){return null});function Ku(q){aa.call(this),this.mipmask=0,this.internalformat=Pi,this.id=pf++,this.refCount=1,this.target=q,this.texture=dt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new du,pn.profile&&(this.stats={size:0})}function Vs(q){dt.activeTexture(ef),dt.bindTexture(q.target,q.texture)}function Fl(){var q=vo[0];q?dt.bindTexture(q.target,q.texture):dt.bindTexture(In,null)}function uc(q){var he=q.texture,J=q.unit,_e=q.target;J>=0&&(dt.activeTexture(ef+J),dt.bindTexture(_e,null),vo[J]=null),dt.deleteTexture(he),q.texture=null,q.params=null,q.pixels=null,q.refCount=0,delete Ql[q.id],gn.textureCount--}h(Ku.prototype,{bind:function(){var q=this;q.bindCount+=1;var he=q.unit;if(he<0){for(var J=0;J0)continue;_e.unit=-1}vo[J]=q,he=J;break}pn.profile&&gn.maxTextureUnits>Kt)-Zt,nr.height=nr.height||(J.height>>Kt)-Vt,Vs(J),Po(nr,In,Zt,Vt,Kt),Fl(),Ya(nr),_e}function lt(vt,Ke){var at=vt|0,bt=Ke|0||at;if(at===J.width&&bt===J.height)return _e;_e.width=J.width=at,_e.height=J.height=bt,Vs(J);for(var Zt=0;J.mipmask>>Zt;++Zt){var Vt=at>>Zt,Kt=bt>>Zt;if(!Vt||!Kt)break;dt.texImage2D(In,Zt,J.format,Vt,Kt,0,J.format,J.type,null)}return Fl(),pn.profile&&(J.stats.size=Tf(J.internalformat,J.type,at,bt,!1,!1)),_e}return _e(q,he),_e.subimage=qe,_e.resize=lt,_e._reglType="texture2d",_e._texture=J,pn.profile&&(_e.stats=J.stats),_e.destroy=function(){J.decRef()},_e}function Co(q,he,J,_e,qe,lt){var vt=new Ku(xi);Ql[vt.id]=vt,gn.cubeCount++;var Ke=new Array(6);function at(Vt,Kt,nr,er,Bt,Xt){var Ht,zr=vt.texInfo;for(du.call(zr),Ht=0;Ht<6;++Ht)Ke[Ht]=Tu();if(typeof Vt=="number"||!Vt){var Yr=Vt|0||1;for(Ht=0;Ht<6;++Ht)Ho(Ke[Ht],Yr,Yr)}else if(typeof Vt=="object")if(Kt)ts(Ke[0],Vt),ts(Ke[1],Kt),ts(Ke[2],nr),ts(Ke[3],er),ts(Ke[4],Bt),ts(Ke[5],Xt);else if(Du(zr,Vt),li(vt,Vt),"faces"in Vt){var fn=Vt.faces;for(Ht=0;Ht<6;++Ht)Zn(Ke[Ht],vt),ts(Ke[Ht],fn[Ht])}else for(Ht=0;Ht<6;++Ht)ts(Ke[Ht],Vt);for(Zn(vt,Ke[0]),zr.genMipmaps?vt.mipmask=(Ke[0].width<<1)-1:vt.mipmask=Ke[0].mipmask,vt.internalformat=Ke[0].internalformat,at.width=Ke[0].width,at.height=Ke[0].height,Vs(vt),Ht=0;Ht<6;++Ht)cl(Ke[Ht],Ea+Ht);for(Wu(zr,xi),Fl(),pn.profile&&(vt.stats.size=Tf(vt.internalformat,vt.type,at.width,at.height,zr.genMipmaps,!0)),at.format=ea[vt.internalformat],at.type=ya[vt.type],at.mag=na[zr.magFilter],at.min=di[zr.minFilter],at.wrapS=Ua[zr.wrapS],at.wrapT=Ua[zr.wrapT],Ht=0;Ht<6;++Ht)tl(Ke[Ht]);return at}function bt(Vt,Kt,nr,er,Bt){var Xt=nr|0,Ht=er|0,zr=Bt|0,Yr=ji();return Zn(Yr,vt),Yr.width=0,Yr.height=0,Oa(Yr,Kt),Yr.width=Yr.width||(vt.width>>zr)-Xt,Yr.height=Yr.height||(vt.height>>zr)-Ht,Vs(vt),Po(Yr,Ea+Vt,Xt,Ht,zr),Fl(),Ya(Yr),at}function Zt(Vt){var Kt=Vt|0;if(Kt!==vt.width){at.width=vt.width=Kt,at.height=vt.height=Kt,Vs(vt);for(var nr=0;nr<6;++nr)for(var er=0;vt.mipmask>>er;++er)dt.texImage2D(Ea+nr,er,vt.format,Kt>>er,Kt>>er,0,vt.format,vt.type,null);return Fl(),pn.profile&&(vt.stats.size=Tf(vt.internalformat,vt.type,at.width,at.height,!1,!0)),at}}return at(q,he,J,_e,qe,lt),at.subimage=bt,at.resize=Zt,at._reglType="textureCube",at._texture=vt,pn.profile&&(at.stats=vt.stats),at.destroy=function(){vt.decRef()},at}function ms(){for(var q=0;q>_e,J.height>>_e,0,J.internalformat,J.type,null);else for(var qe=0;qe<6;++qe)dt.texImage2D(Ea+qe,_e,J.internalformat,J.width>>_e,J.height>>_e,0,J.internalformat,J.type,null);Wu(J.texInfo,J.target)})}function be(){for(var q=0;q=0?Tu=!0:Ia.indexOf(tl)>=0&&(Tu=!1))),("depthTexture"in vo||"depthStencilTexture"in vo)&&(cu=!!(vo.depthTexture||vo.depthStencilTexture)),"depth"in vo&&(typeof vo.depth=="boolean"?ts=vo.depth:(Wu=vo.depth,cl=!1)),"stencil"in vo&&(typeof vo.stencil=="boolean"?cl=vo.stencil:(pf=vo.stencil,ts=!1)),"depthStencil"in vo&&(typeof vo.depthStencil=="boolean"?ts=cl=vo.depthStencil:(Ql=vo.depthStencil,ts=!1,cl=!1))}var Vs=null,Fl=null,uc=null,cc=null;if(Array.isArray(rs))Vs=rs.map(Ha);else if(rs)Vs=[Ha(rs)];else for(Vs=new Array(Du),Ya=0;Ya0&&(ji.depth=$a[0].depth,ji.stencil=$a[0].stencil,ji.depthStencil=$a[0].depthStencil),$a[wi]?$a[wi](ji):$a[wi]=aa(ji)}return h(Oa,{width:Ya,height:Ya,color:tl})}function Oi(Po){var wi,ji=Po|0;if(ji===Oa.width)return Oa;var Ya=Oa.color;for(wi=0;wi=Mo.byteLength?Ho.subdata(Mo):(Ho.destroy(),Zn.buffers[wi]=null)),Zn.buffers[wi]||(Ho=Zn.buffers[wi]=ua.create(ji,eh,!1,!0)),Ya.buffer=ua.getBuffer(Ho),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1,Oi[wi]=1}else ua.getBuffer(ji)?(Ya.buffer=ua.getBuffer(ji),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1):ua.getBuffer(ji.buffer)?(Ya.buffer=ua.getBuffer(ji.buffer),Ya.size=(+ji.size||Ya.buffer.dimension)|0,Ya.normalized=!!ji.normalized||!1,"type"in ji?Ya.type=En[ji.type]:Ya.type=Ya.buffer.dtype,Ya.offset=(ji.offset||0)|0,Ya.stride=(ji.stride||0)|0,Ya.divisor=(ji.divisor||0)|0,Ya.state=1):"x"in ji&&(Ya.x=+ji.x||0,Ya.y=+ji.y||0,Ya.z=+ji.z||0,Ya.w=+ji.w||0,Ya.state=2)}for(var ts=0;ts1)for(var Dn=0;Dnrn&&(rn=Fn.stats.uniformsCount)}),rn},wr.getMaxAttributesCount=function(){var rn=0;return Wa.forEach(function(Fn){Fn.stats.attributesCount>rn&&(rn=Fn.stats.attributesCount)}),rn});function ga(){ua={},gn={};for(var rn=0;rn>>4&15)+gr.charAt(Cn&15);return wr}function vf(dt){for(var gr="",wr=-1,Cn,ua;++wr>>6&31,128|Cn&63):Cn<=65535?gr+=String.fromCharCode(224|Cn>>>12&15,128|Cn>>>6&63,128|Cn&63):Cn<=2097151&&(gr+=String.fromCharCode(240|Cn>>>18&7,128|Cn>>>12&63,128|Cn>>>6&63,128|Cn&63));return gr}function bu(dt){for(var gr=Array(dt.length>>2),wr=0;wr>5]|=(dt.charCodeAt(wr/8)&255)<<24-wr%32;return gr}function _c(dt){for(var gr="",wr=0;wr>5]>>>24-wr%32&255);return gr}function hu(dt,gr){return dt>>>gr|dt<<32-gr}function Nf(dt,gr){return dt>>>gr}function df(dt,gr,wr){return dt&gr^~dt&wr}function Fh(dt,gr,wr){return dt&gr^dt&wr^gr&wr}function ur(dt){return hu(dt,2)^hu(dt,13)^hu(dt,22)}function Pr(dt){return hu(dt,6)^hu(dt,11)^hu(dt,25)}function dn(dt){return hu(dt,7)^hu(dt,18)^Nf(dt,3)}function nn(dt){return hu(dt,17)^hu(dt,19)^Nf(dt,10)}var On=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function Ta(dt,gr){var wr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Cn=new Array(64),ua,gn,pn,za,Ia,Da,Wa,Bi,bi,Ha,ga,rn;for(dt[gr>>5]|=128<<24-gr%32,dt[(gr+64>>9<<4)+15]=gr,bi=0;bi>16)+(gr>>16)+(wr>>16);return Cn<<16|wr&65535}function ri(dt){return Array.prototype.slice.call(dt)}function fi(dt){return ri(dt).join("")}function Ni(dt){var gr=dt&&dt.cache,wr=0,Cn=[],ua=[],gn=[];function pn(ga,rn){var Fn=rn&&rn.stable;if(!Fn){for(var ea=0;ea0&&(ga.push(ya,"="),ga.push.apply(ga,ri(arguments)),ga.push(";")),ya}return h(rn,{def:ea,toString:function(){return fi([Fn.length>0?"var "+Fn.join(",")+";":"",fi(ga)])}})}function Ia(){var ga=za(),rn=za(),Fn=ga.toString,ea=rn.toString;function ya(na,di){rn(na,di,"=",ga.def(na,di),";")}return h(function(){ga.apply(ga,ri(arguments))},{def:ga.def,entry:ga,exit:rn,save:ya,set:function(na,di,Ua){ya(na,di),ga(na,di,"=",Ua,";")},toString:function(){return Fn()+ea()}})}function Da(){var ga=fi(arguments),rn=Ia(),Fn=Ia(),ea=rn.toString,ya=Fn.toString;return h(rn,{then:function(){return rn.apply(rn,ri(arguments)),this},else:function(){return Fn.apply(Fn,ri(arguments)),this},toString:function(){var na=ya();return na&&(na="else{"+na+"}"),fi(["if(",ga,"){",ea(),"}",na])}})}var Wa=za(),Bi={};function bi(ga,rn){var Fn=[];function ea(){var Di="a"+Fn.length;return Fn.push(Di),Di}rn=rn||0;for(var ya=0;ya2){for(var I=Array(m.position.length*.5),L=0;L2){for(var N=!m.position[0].length,B=o.mallocFloat(this.count*2),R=0,U=0;R1?u.align[Ne]:u.align[0]:u.align;if(typeof ut=="number")return ut;switch(ut){case"right":case"end":return-pe;case"center":case"centre":case"middle":return-pe*.5}return 0})),this.baseline==null&&m.baseline==null&&(m.baseline=0),m.baseline!=null&&(this.baseline=m.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(pe,Ne){var ut=(u.font[Ne]||u.font[0]).metrics,dt=0;return dt+=ut.bottom*.5,typeof pe=="number"?dt+=pe-ut.baseline:dt+=-ut[pe],dt*=-1,dt})),m.color!=null)if(m.color||(m.color="transparent"),typeof m.color=="string"||!isNaN(m.color))this.color=t(m.color,"uint8");else{var Fe;if(typeof m.color[0]=="number"&&m.color.length>this.counts.length){var ze=m.color.length;Fe=o.mallocUint8(ze);for(var Ye=(m.color.subarray||m.color.slice).bind(m.color),st=0;st4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(et){var Pe=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(Pe);for(var Ae=0;Ae1?this.counts[Ae]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Ae]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(Ae*4,Ae*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Ae]:this.opacity,baseline:this.baselineOffset[Ae]!=null?this.baselineOffset[Ae]:this.baselineOffset[0],align:this.align?this.alignOffset[Ae]!=null?this.alignOffset[Ae]:this.alignOffset[0]:0,atlas:this.fontAtlas[Ae]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(Ae*2,Ae*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},M.prototype.destroy=function(){},M.prototype.kerning=!0,M.prototype.position={constant:new Float32Array(2)},M.prototype.translate=null,M.prototype.scale=null,M.prototype.font=null,M.prototype.text="",M.prototype.positionOffset=[0,0],M.prototype.opacity=1,M.prototype.color=new Uint8Array([0,0,0,255]),M.prototype.alignOffset=[0,0],M.maxAtlasSize=1024,M.atlasCanvas=document.createElement("canvas"),M.atlasContext=M.atlasCanvas.getContext("2d",{alpha:!1}),M.baseFontSize=64,M.fonts={};function _(w){return typeof w=="function"&&w._gl&&w.prop&&w.texture&&w.buffer}G.exports=M}}),gz=Ge({"node_modules/@plotly/regl/dist/regl.unchecked.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?G.exports=b():h.createREGL=b()})(K,function(){var h=function(mt,yr){for(var wr=Object.keys(yr),Ln=0;Ln1&&yr===wr&&(yr==='"'||yr==="'"))return['"'+r(mt.substr(1,mt.length-2))+'"'];var Ln=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(mt);if(Ln)return o(mt.substr(0,Ln.index)).concat(o(Ln[1])).concat(o(mt.substr(Ln.index+Ln[0].length)));var ca=mt.split(".");if(ca.length===1)return['"'+r(mt)+'"'];for(var yn=[],mn=0;mn"u"?1:window.devicePixelRatio,Za=!1,Fi={},yi=function(nn){},Ga=function(){};if(typeof yr=="string"?wr=document.querySelector(yr):typeof yr=="object"&&(g(yr)?wr=yr:x(yr)?(yn=yr,ca=yn.canvas):("gl"in yr?yn=yr.gl:"canvas"in yr?ca=M(yr.canvas):"container"in yr&&(Ln=M(yr.container)),"attributes"in yr&&(mn=yr.attributes),"extensions"in yr&&(za=A(yr.extensions)),"optionalExtensions"in yr&&(Ia=A(yr.optionalExtensions)),"onDone"in yr&&(yi=yr.onDone),"profile"in yr&&(Za=!!yr.profile),"pixelRatio"in yr&&(Da=+yr.pixelRatio),"cachedCode"in yr&&(Fi=yr.cachedCode))),wr&&(wr.nodeName.toLowerCase()==="canvas"?ca=wr:Ln=wr),!yn){if(!ca){var ma=T(Ln||document.body,yi,Da);if(!ma)return null;ca=ma.canvas,Ga=ma.onDestroy}mn.premultipliedAlpha===void 0&&(mn.premultipliedAlpha=!0),yn=l(ca,mn)}return yn?{gl:yn,canvas:ca,container:Ln,extensions:za,optionalExtensions:Ia,pixelRatio:Da,profile:Za,cachedCode:Fi,onDone:yi,onDestroy:Ga}:(Ga(),yi("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(mt,yr){var wr={};function Ln(mn){var za=mn.toLowerCase(),Ia;try{Ia=wr[za]=mt.getExtension(za)}catch{}return!!Ia}for(var ca=0;ca65535)<<4,mt>>>=yr,wr=(mt>255)<<3,mt>>>=wr,yr|=wr,wr=(mt>15)<<2,mt>>>=wr,yr|=wr,wr=(mt>3)<<1,mt>>>=wr,yr|=wr,yr|mt>>1}function R(){var mt=m(8,function(){return[]});function yr(yn){var mn=N(yn),za=mt[B(mn)>>2];return za.length>0?za.pop():new ArrayBuffer(mn)}function wr(yn){mt[B(yn.byteLength)>>2].push(yn)}function Ln(yn,mn){var za=null;switch(yn){case u:za=new Int8Array(yr(mn),0,mn);break;case d:za=new Uint8Array(yr(mn),0,mn);break;case y:za=new Int16Array(yr(2*mn),0,mn);break;case I:za=new Uint16Array(yr(2*mn),0,mn);break;case L:za=new Int32Array(yr(4*mn),0,mn);break;case z:za=new Uint32Array(yr(4*mn),0,mn);break;case F:za=new Float32Array(yr(4*mn),0,mn);break;default:return null}return za.length!==mn?za.subarray(0,mn):za}function ca(yn){wr(yn.buffer)}return{alloc:yr,free:wr,allocType:Ln,freeType:ca}}var U=R();U.zero=R();var j=3408,Z=3410,re=3411,fe=3412,le=3413,ce=3414,V=3415,ee=33901,ne=33902,$=3379,ue=3386,te=34921,H=36347,ae=36348,ie=35661,de=35660,Se=34930,Le=36349,Fe=34076,ze=34024,Ye=7936,st=7937,ct=7938,at=35724,et=34047,Pe=36063,Ae=34852,pe=3553,Ne=34067,ut=34069,dt=33984,nt=6408,Ft=5126,Nt=5121,Qt=36160,ar=36053,kr=36064,Er=16384,$r=function(mt,yr){var wr=1;yr.ext_texture_filter_anisotropic&&(wr=mt.getParameter(et));var Ln=1,ca=1;yr.webgl_draw_buffers&&(Ln=mt.getParameter(Ae),ca=mt.getParameter(Pe));var yn=!!yr.oes_texture_float;if(yn){var mn=mt.createTexture();mt.bindTexture(pe,mn),mt.texImage2D(pe,0,nt,1,1,0,nt,Ft,null);var za=mt.createFramebuffer();if(mt.bindFramebuffer(Qt,za),mt.framebufferTexture2D(Qt,kr,pe,mn,0),mt.bindTexture(pe,null),mt.checkFramebufferStatus(Qt)!==ar)yn=!1;else{mt.viewport(0,0,1,1),mt.clearColor(1,0,0,1),mt.clear(Er);var Ia=U.allocType(Ft,4);mt.readPixels(0,0,1,1,nt,Ft,Ia),mt.getError()?yn=!1:(mt.deleteFramebuffer(za),mt.deleteTexture(mn),yn=Ia[0]===1),U.freeType(Ia)}}var Da=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Za=!0;if(!Da){var Fi=mt.createTexture(),yi=U.allocType(Nt,36);mt.activeTexture(dt),mt.bindTexture(Ne,Fi),mt.texImage2D(ut,0,nt,3,3,0,nt,Nt,yi),U.freeType(yi),mt.bindTexture(Ne,null),mt.deleteTexture(Fi),Za=!mt.getError()}return{colorBits:[mt.getParameter(Z),mt.getParameter(re),mt.getParameter(fe),mt.getParameter(le)],depthBits:mt.getParameter(ce),stencilBits:mt.getParameter(V),subpixelBits:mt.getParameter(j),extensions:Object.keys(yr).filter(function(Ga){return!!yr[Ga]}),maxAnisotropic:wr,maxDrawbuffers:Ln,maxColorAttachments:ca,pointSizeDims:mt.getParameter(ee),lineWidthDims:mt.getParameter(ne),maxViewportDims:mt.getParameter(ue),maxCombinedTextureUnits:mt.getParameter(ie),maxCubeMapSize:mt.getParameter(Fe),maxRenderbufferSize:mt.getParameter(ze),maxTextureUnits:mt.getParameter(Se),maxTextureSize:mt.getParameter($),maxAttributes:mt.getParameter(te),maxVertexUniforms:mt.getParameter(H),maxVertexTextureUnits:mt.getParameter(de),maxVaryingVectors:mt.getParameter(ae),maxFragmentUniforms:mt.getParameter(Le),glsl:mt.getParameter(at),renderer:mt.getParameter(st),vendor:mt.getParameter(Ye),version:mt.getParameter(ct),readFloat:yn,npotTextureCube:Za}},Sr=function(mt){return mt instanceof Uint8Array||mt instanceof Uint16Array||mt instanceof Uint32Array||mt instanceof Int8Array||mt instanceof Int16Array||mt instanceof Int32Array||mt instanceof Float32Array||mt instanceof Float64Array||mt instanceof Uint8ClampedArray};function Ur(mt){return!!mt&&typeof mt=="object"&&Array.isArray(mt.shape)&&Array.isArray(mt.stride)&&typeof mt.offset=="number"&&mt.shape.length===mt.stride.length&&(Array.isArray(mt.data)||Sr(mt.data))}var Mt=function(mt){return Object.keys(mt).map(function(yr){return mt[yr]})},je={shape:Xe,flatten:Ee};function Je(mt,yr,wr){for(var Ln=0;Ln0){var Ri;if(Array.isArray(Fn[0])){Ua=Un(Fn);for(var ia=1,Yn=1;Yn0){if(typeof ia[0]=="number"){var $a=U.allocType(aa.dtype,ia.length);Gr($a,ia),Ua($a,ii),U.freeType($a)}else if(Array.isArray(ia[0])||Sr(ia[0])){Dn=Un(ia);var Oa=na(ia,Dn,aa.dtype);Ua(Oa,ii),U.freeType(Oa)}}}else if(Ur(ia)){Dn=ia.shape;var zi=ia.stride,Lo=0,_i=0,ji=0,Ya=0;Dn.length===1?(Lo=Dn[0],_i=1,ji=zi[0],Ya=0):Dn.length===2&&(Lo=Dn[0],_i=Dn[1],ji=zi[0],Ya=zi[1]);var To=Array.isArray(ia.data)?aa.dtype:ur(ia.data),qo=U.allocType(To,Lo*_i);ln(qo,ia.data,Lo,_i,ji,Ya,ia.offset),Ua(qo,ii),U.freeType(qo)}return ci}return ta||ci(nn),ci._reglType="buffer",ci._buffer=aa,ci.subdata=Ri,wr.profile&&(ci.stats=aa.stats),ci.destroy=function(){yi(aa)},ci}function ma(){Mt(yn).forEach(function(nn){nn.buffer=mt.createBuffer(),mt.bindBuffer(nn.type,nn.buffer),mt.bufferData(nn.type,nn.persistentData||nn.byteLength,nn.usage)})}return wr.profile&&(yr.getTotalBufferSize=function(){var nn=0;return Object.keys(yn).forEach(function(Fn){nn+=yn[Fn].stats.size}),nn}),{create:Ga,createStream:Ia,destroyStream:Da,clear:function(){Mt(yn).forEach(yi),za.forEach(yi)},getBuffer:function(nn){return nn&&nn._buffer instanceof mn?nn._buffer:null},restore:ma,_initBuffer:Fi}}var An=0,Qn=0,pa=1,ha=1,_a=4,Ca=4,Hn={points:An,point:Qn,lines:pa,line:ha,triangles:_a,triangle:Ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},pi=0,Si=1,Dt=4,xt=5120,Cr=5121,jr=5122,Vr=5123,Dr=5124,qr=5125,un=34963,Jr=35040,At=35044;function lr(mt,yr,wr,Ln){var ca={},yn=0,mn={uint8:Cr,uint16:Vr};yr.oes_element_index_uint&&(mn.uint32=qr);function za(ma){this.id=yn++,ca[this.id]=this,this.buffer=ma,this.primType=Dt,this.vertCount=0,this.type=0}za.prototype.bind=function(){this.buffer.bind()};var Ia=[];function Da(ma){var nn=Ia.pop();return nn||(nn=new za(wr.create(null,un,!0,!1)._buffer)),Fi(nn,ma,Jr,-1,-1,0,0),nn}function Za(ma){Ia.push(ma)}function Fi(ma,nn,Fn,ta,ya,aa,ci){ma.buffer.bind();var Ua;if(nn){var Ri=ci;!ci&&(!Sr(nn)||Ur(nn)&&!Sr(nn.data))&&(Ri=yr.oes_element_index_uint?qr:Vr),wr._initBuffer(ma.buffer,nn,Fn,Ri,3)}else mt.bufferData(un,aa,Fn),ma.buffer.dtype=Ua||Cr,ma.buffer.usage=Fn,ma.buffer.dimension=3,ma.buffer.byteLength=aa;if(Ua=ci,!ci){switch(ma.buffer.dtype){case Cr:case xt:Ua=Cr;break;case Vr:case jr:Ua=Vr;break;case qr:case Dr:Ua=qr;break}ma.buffer.dtype=Ua}ma.type=Ua;var ia=ya;ia<0&&(ia=ma.buffer.byteLength,Ua===Vr?ia>>=1:Ua===qr&&(ia>>=2)),ma.vertCount=ia;var Yn=ta;if(ta<0){Yn=Dt;var ii=ma.buffer.dimension;ii===1&&(Yn=pi),ii===2&&(Yn=Si),ii===3&&(Yn=Dt)}ma.primType=Yn}function yi(ma){Ln.elementsCount--,delete ca[ma.id],ma.buffer.destroy(),ma.buffer=null}function Ga(ma,nn){var Fn=wr.create(null,un,!0),ta=new za(Fn._buffer);Ln.elementsCount++;function ya(aa){if(!aa)Fn(),ta.primType=Dt,ta.vertCount=0,ta.type=Cr;else if(typeof aa=="number")Fn(aa),ta.primType=Dt,ta.vertCount=aa|0,ta.type=Cr;else{var ci=null,Ua=At,Ri=-1,ia=-1,Yn=0,ii=0;Array.isArray(aa)||Sr(aa)||Ur(aa)?ci=aa:("data"in aa&&(ci=aa.data),"usage"in aa&&(Ua=ra[aa.usage]),"primitive"in aa&&(Ri=Hn[aa.primitive]),"count"in aa&&(ia=aa.count|0),"type"in aa&&(ii=mn[aa.type]),"length"in aa?Yn=aa.length|0:(Yn=ia,ii===Vr||ii===jr?Yn*=2:(ii===qr||ii===Dr)&&(Yn*=4))),Fi(ta,ci,Ua,Ri,ia,Yn,ii)}return ya}return ya(ma),ya._reglType="elements",ya._elements=ta,ya.subdata=function(aa,ci){return Fn.subdata(aa,ci),ya},ya.destroy=function(){yi(ta)},ya}return{create:Ga,createStream:Da,destroyStream:Za,getElements:function(ma){return typeof ma=="function"&&ma._elements instanceof za?ma._elements:null},clear:function(){Mt(ca).forEach(yi)}}}var zr=new Float32Array(1),cn=new Uint32Array(zr.buffer),Rn=5123;function qn(mt){for(var yr=U.allocType(Rn,mt.length),wr=0;wr>>31<<15,yn=(Ln<<1>>>24)-127,mn=Ln>>13&1023;if(yn<-24)yr[wr]=ca;else if(yn<-14){var za=-14-yn;yr[wr]=ca+(mn+1024>>za)}else yn>15?yr[wr]=ca+31744:yr[wr]=ca+(yn+15<<10)+mn}return yr}function jn(mt){return Array.isArray(mt)||Sr(mt)}var fn=34467,In=3553,gi=34067,Ea=34069,Ci=6408,Xi=6406,so=6407,io=6409,Mo=6410,ui=32854,ts=32855,Ho=36194,Xs=32819,cs=32820,Jo=33635,Uo=34042,Ys=6402,Vs=34041,ll=35904,fs=35906,Zo=36193,po=33776,hs=33777,ul=33778,kl=33779,Rl=35986,Ms=35987,fi=34798,to=35840,Cl=35841,Ps=35842,Fo=35843,Il=36196,Zs=5121,cl=5123,Au=5125,Qi=5126,gs=10242,rs=10243,Xl=10497,Yl=33071,Io=33648,cu=10240,vu=10241,Os=9728,wl=9729,Nl=9984,Vl=9985,Zu=9986,df=9987,Xc=33170,rf=4352,Dh=4353,wh=4354,Tl=34046,Dc=3317,zh=37440,oc=37441,Wu=37443,sc=37444,nf=33984,eu=[Nl,Zu,Vl,df],$u=[0,io,Mo,so,Ci],Hs={};Hs[io]=Hs[Xi]=Hs[Ys]=1,Hs[Vs]=Hs[Mo]=2,Hs[so]=Hs[ll]=3,Hs[Ci]=Hs[fs]=4;function Dl(mt){return"[object "+mt+"]"}var Mf=Dl("HTMLCanvasElement"),wc=Dl("OffscreenCanvas"),Ff=Dl("CanvasRenderingContext2D"),fu=Dl("ImageBitmap"),Sd=Dl("HTMLImageElement"),Fs=Dl("HTMLVideoElement"),Vd=Object.keys(Qe).concat([Mf,wc,Ff,fu,Sd,Fs]),pl=[];pl[Zs]=1,pl[Qi]=4,pl[Zo]=2,pl[cl]=2,pl[Au]=4;var Oo=[];Oo[ui]=2,Oo[ts]=2,Oo[Ho]=2,Oo[Vs]=4,Oo[po]=.5,Oo[hs]=.5,Oo[ul]=1,Oo[kl]=1,Oo[Rl]=.5,Oo[Ms]=1,Oo[fi]=1,Oo[to]=.5,Oo[Cl]=.25,Oo[Ps]=.5,Oo[Fo]=.25,Oo[Il]=.5;function th(mt){return Array.isArray(mt)&&(mt.length===0||typeof mt[0]=="number")}function af(mt){if(!Array.isArray(mt))return!1;var yr=mt.length;return!(yr===0||!jn(mt[0]))}function Ou(mt){return Object.prototype.toString.call(mt)}function Oh(mt){return Ou(mt)===Mf}function Bf(mt){return Ou(mt)===wc}function uh(mt){return Ou(mt)===Ff}function Ku(mt){return Ou(mt)===fu}function fd(mt){return Ou(mt)===Sd}function Hh(mt){return Ou(mt)===Fs}function ch(mt){if(!mt)return!1;var yr=Ou(mt);return Vd.indexOf(yr)>=0?!0:th(mt)||af(mt)||Ur(mt)}function Nf(mt){return Qe[Object.prototype.toString.call(mt)]|0}function Fh(mt,yr){var wr=yr.length;switch(mt.type){case Zs:case cl:case Au:case Qi:var Ln=U.allocType(mt.type,wr);Ln.set(yr),mt.data=Ln;break;case Zo:mt.data=qn(yr);break}}function Bh(mt,yr){return U.allocType(mt.type===Zo?Qi:mt.type,yr)}function of(mt,yr){mt.type===Zo?(mt.data=qn(yr),U.freeType(yr)):mt.data=yr}function Gh(mt,yr,wr,Ln,ca,yn){for(var mn=mt.width,za=mt.height,Ia=mt.channels,Da=mn*za*Ia,Za=Bh(mt,Da),Fi=0,yi=0;yi=1;)za+=mn*Ia*Ia,Ia/=2;return za}else return mn*wr*Ln}function vf(mt,yr,wr,Ln,ca,yn,mn){var za={"don't care":rf,"dont care":rf,nice:wh,fast:Dh},Ia={repeat:Xl,clamp:Yl,mirror:Io},Da={nearest:Os,linear:wl},Za=h({mipmap:df,"nearest mipmap nearest":Nl,"linear mipmap nearest":Vl,"nearest mipmap linear":Zu,"linear mipmap linear":df},Da),Fi={none:0,browser:sc},yi={uint8:Zs,rgba4:Xs,rgb565:Jo,"rgb5 a1":cs},Ga={alpha:Xi,luminance:io,"luminance alpha":Mo,rgb:so,rgba:Ci,rgba4:ui,"rgb5 a1":ts,rgb565:Ho},ma={};yr.ext_srgb&&(Ga.srgb=ll,Ga.srgba=fs),yr.oes_texture_float&&(yi.float32=yi.float=Qi),yr.oes_texture_half_float&&(yi.float16=yi["half float"]=Zo),yr.webgl_depth_texture&&(h(Ga,{depth:Ys,"depth stencil":Vs}),h(yi,{uint16:cl,uint32:Au,"depth stencil":Uo})),yr.webgl_compressed_texture_s3tc&&h(ma,{"rgb s3tc dxt1":po,"rgba s3tc dxt1":hs,"rgba s3tc dxt3":ul,"rgba s3tc dxt5":kl}),yr.webgl_compressed_texture_atc&&h(ma,{"rgb atc":Rl,"rgba atc explicit alpha":Ms,"rgba atc interpolated alpha":fi}),yr.webgl_compressed_texture_pvrtc&&h(ma,{"rgb pvrtc 4bppv1":to,"rgb pvrtc 2bppv1":Cl,"rgba pvrtc 4bppv1":Ps,"rgba pvrtc 2bppv1":Fo}),yr.webgl_compressed_texture_etc1&&(ma["rgb etc1"]=Il);var nn=Array.prototype.slice.call(mt.getParameter(fn));Object.keys(ma).forEach(function(q){var he=ma[q];nn.indexOf(he)>=0&&(Ga[q]=he)});var Fn=Object.keys(Ga);wr.textureFormats=Fn;var ta=[];Object.keys(Ga).forEach(function(q){var he=Ga[q];ta[he]=q});var ya=[];Object.keys(yi).forEach(function(q){var he=yi[q];ya[he]=q});var aa=[];Object.keys(Da).forEach(function(q){var he=Da[q];aa[he]=q});var ci=[];Object.keys(Za).forEach(function(q){var he=Za[q];ci[he]=q});var Ua=[];Object.keys(Ia).forEach(function(q){var he=Ia[q];Ua[he]=q});var Ri=Fn.reduce(function(q,he){var J=Ga[he];return J===io||J===Xi||J===io||J===Mo||J===Ys||J===Vs||yr.ext_srgb&&(J===ll||J===fs)?q[J]=J:J===ts||he.indexOf("rgba")>=0?q[J]=Ci:q[J]=so,q},{});function ia(){this.internalformat=Ci,this.format=Ci,this.type=Zs,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=sc,this.width=0,this.height=0,this.channels=0}function Yn(q,he){q.internalformat=he.internalformat,q.format=he.format,q.type=he.type,q.compressed=he.compressed,q.premultiplyAlpha=he.premultiplyAlpha,q.flipY=he.flipY,q.unpackAlignment=he.unpackAlignment,q.colorSpace=he.colorSpace,q.width=he.width,q.height=he.height,q.channels=he.channels}function ii(q,he){if(!(typeof he!="object"||!he)){if("premultiplyAlpha"in he&&(q.premultiplyAlpha=he.premultiplyAlpha),"flipY"in he&&(q.flipY=he.flipY),"alignment"in he&&(q.unpackAlignment=he.alignment),"colorSpace"in he&&(q.colorSpace=Fi[he.colorSpace]),"type"in he){var J=he.type;q.type=yi[J]}var _e=q.width,qe=q.height,ft=q.channels,pt=!1;"shape"in he?(_e=he.shape[0],qe=he.shape[1],he.shape.length===3&&(ft=he.shape[2],pt=!0)):("radius"in he&&(_e=qe=he.radius),"width"in he&&(_e=he.width),"height"in he&&(qe=he.height),"channels"in he&&(ft=he.channels,pt=!0)),q.width=_e|0,q.height=qe|0,q.channels=ft|0;var $e=!1;if("format"in he){var it=he.format,Tt=q.internalformat=Ga[it];q.format=Ri[Tt],it in yi&&("type"in he||(q.type=yi[it])),it in ma&&(q.compressed=!0),$e=!0}!pt&&$e?q.channels=Hs[q.format]:pt&&!$e&&q.channels!==$u[q.format]&&(q.format=q.internalformat=$u[q.channels])}}function Dn(q){mt.pixelStorei(zh,q.flipY),mt.pixelStorei(oc,q.premultiplyAlpha),mt.pixelStorei(Wu,q.colorSpace),mt.pixelStorei(Dc,q.unpackAlignment)}function $a(){ia.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Oa(q,he){var J=null;if(ch(he)?J=he:he&&(ii(q,he),"x"in he&&(q.xOffset=he.x|0),"y"in he&&(q.yOffset=he.y|0),ch(he.data)&&(J=he.data)),he.copy){var _e=ca.viewportWidth,qe=ca.viewportHeight;q.width=q.width||_e-q.xOffset,q.height=q.height||qe-q.yOffset,q.needsCopy=!0}else if(!J)q.width=q.width||1,q.height=q.height||1,q.channels=q.channels||4;else if(Sr(J))q.channels=q.channels||4,q.data=J,!("type"in he)&&q.type===Zs&&(q.type=Nf(J));else if(th(J))q.channels=q.channels||4,Fh(q,J),q.alignment=1,q.needsFree=!0;else if(Ur(J)){var ft=J.data;!Array.isArray(ft)&&q.type===Zs&&(q.type=Nf(ft));var pt=J.shape,$e=J.stride,it,Tt,$t,Ht,Jt,ir;pt.length===3?($t=pt[2],ir=$e[2]):($t=1,ir=1),it=pt[0],Tt=pt[1],Ht=$e[0],Jt=$e[1],q.alignment=1,q.width=it,q.height=Tt,q.channels=$t,q.format=q.internalformat=$u[$t],q.needsFree=!0,Gh(q,ft,Ht,Jt,ir,J.offset)}else if(Oh(J)||Bf(J)||uh(J))Oh(J)||Bf(J)?q.element=J:q.element=J.canvas,q.width=q.element.width,q.height=q.element.height,q.channels=4;else if(Ku(J))q.element=J,q.width=J.width,q.height=J.height,q.channels=4;else if(fd(J))q.element=J,q.width=J.naturalWidth,q.height=J.naturalHeight,q.channels=4;else if(Hh(J))q.element=J,q.width=J.videoWidth,q.height=J.videoHeight,q.channels=4;else if(af(J)){var rr=q.width||J[0].length,Bt=q.height||J.length,Zt=q.channels;jn(J[0][0])?Zt=Zt||J[0][0].length:Zt=Zt||1;for(var Gt=je.shape(J),Or=1,Wr=0;Wr>=qe,J.height>>=qe,Oa(J,_e[qe]),q.mipmask|=1<=0&&!("faces"in he)&&(q.genMipmaps=!0)}if("mag"in he){var _e=he.mag;q.magFilter=Da[_e]}var qe=q.wrapS,ft=q.wrapT;if("wrap"in he){var pt=he.wrap;typeof pt=="string"?qe=ft=Ia[pt]:Array.isArray(pt)&&(qe=Ia[pt[0]],ft=Ia[pt[1]])}else{if("wrapS"in he){var $e=he.wrapS;qe=Ia[$e]}if("wrapT"in he){var it=he.wrapT;ft=Ia[it]}}if(q.wrapS=qe,q.wrapT=ft,"anisotropic"in he&&(he.anisotropic,q.anisotropic=he.anisotropic),"mipmap"in he){var Tt=!1;switch(typeof he.mipmap){case"string":q.mipmapHint=za[he.mipmap],q.genMipmaps=!0,Tt=!0;break;case"boolean":Tt=q.genMipmaps=he.mipmap;break;case"object":q.genMipmaps=!1,Tt=!0;break}Tt&&!("min"in he)&&(q.minFilter=Nl)}}function Qu(q,he){mt.texParameteri(he,vu,q.minFilter),mt.texParameteri(he,cu,q.magFilter),mt.texParameteri(he,gs,q.wrapS),mt.texParameteri(he,rs,q.wrapT),yr.ext_texture_filter_anisotropic&&mt.texParameteri(he,Tl,q.anisotropic),q.genMipmaps&&(mt.hint(Xc,q.mipmapHint),mt.generateMipmap(he))}var _f=0,nu={},du=wr.maxTextureUnits,ho=Array(du).map(function(){return null});function ec(q){ia.call(this),this.mipmask=0,this.internalformat=Ci,this.id=_f++,this.refCount=1,this.target=q,this.texture=mt.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new gu,mn.profile&&(this.stats={size:0})}function qs(q){mt.activeTexture(nf),mt.bindTexture(q.target,q.texture)}function Fl(){var q=ho[0];q?mt.bindTexture(q.target,q.texture):mt.bindTexture(In,null)}function dc(q){var he=q.texture,J=q.unit,_e=q.target;J>=0&&(mt.activeTexture(nf+J),mt.bindTexture(_e,null),ho[J]=null),mt.deleteTexture(he),q.texture=null,q.params=null,q.pixels=null,q.refCount=0,delete nu[q.id],yn.textureCount--}h(ec.prototype,{bind:function(){var q=this;q.bindCount+=1;var he=q.unit;if(he<0){for(var J=0;J0)continue;_e.unit=-1}ho[J]=q,he=J;break}mn.profile&&yn.maxTextureUnits>Jt)-$t,ir.height=ir.height||(J.height>>Jt)-Ht,qs(J),Lo(ir,In,$t,Ht,Jt),Fl(),Ya(ir),_e}function ft(pt,$e){var it=pt|0,Tt=$e|0||it;if(it===J.width&&Tt===J.height)return _e;_e.width=J.width=it,_e.height=J.height=Tt,qs(J);for(var $t=0;J.mipmask>>$t;++$t){var Ht=it>>$t,Jt=Tt>>$t;if(!Ht||!Jt)break;mt.texImage2D(In,$t,J.format,Ht,Jt,0,J.format,J.type,null)}return Fl(),mn.profile&&(J.stats.size=Ef(J.internalformat,J.type,it,Tt,!1,!1)),_e}return _e(q,he),_e.subimage=qe,_e.resize=ft,_e._reglType="texture2d",_e._texture=J,mn.profile&&(_e.stats=J.stats),_e.destroy=function(){J.decRef()},_e}function Co(q,he,J,_e,qe,ft){var pt=new ec(gi);nu[pt.id]=pt,yn.cubeCount++;var $e=new Array(6);function it(Ht,Jt,ir,rr,Bt,Zt){var Gt,Or=pt.texInfo;for(gu.call(Or),Gt=0;Gt<6;++Gt)$e[Gt]=Eu();if(typeof Ht=="number"||!Ht){var Wr=Ht|0||1;for(Gt=0;Gt<6;++Gt)qo($e[Gt],Wr,Wr)}else if(typeof Ht=="object")if(Jt)Qo($e[0],Ht),Qo($e[1],Jt),Qo($e[2],ir),Qo($e[3],rr),Qo($e[4],Bt),Qo($e[5],Zt);else if(Fu(Or,Ht),ii(pt,Ht),"faces"in Ht){var hn=Ht.faces;for(Gt=0;Gt<6;++Gt)Yn($e[Gt],pt),Qo($e[Gt],hn[Gt])}else for(Gt=0;Gt<6;++Gt)Qo($e[Gt],Ht);for(Yn(pt,$e[0]),Or.genMipmaps?pt.mipmask=($e[0].width<<1)-1:pt.mipmask=$e[0].mipmask,pt.internalformat=$e[0].internalformat,it.width=$e[0].width,it.height=$e[0].height,qs(pt),Gt=0;Gt<6;++Gt)fl($e[Gt],Ea+Gt);for(Qu(Or,gi),Fl(),mn.profile&&(pt.stats.size=Ef(pt.internalformat,pt.type,it.width,it.height,Or.genMipmaps,!0)),it.format=ta[pt.internalformat],it.type=ya[pt.type],it.mag=aa[Or.magFilter],it.min=ci[Or.minFilter],it.wrapS=Ua[Or.wrapS],it.wrapT=Ua[Or.wrapT],Gt=0;Gt<6;++Gt)el($e[Gt]);return it}function Tt(Ht,Jt,ir,rr,Bt){var Zt=ir|0,Gt=rr|0,Or=Bt|0,Wr=ji();return Yn(Wr,pt),Wr.width=0,Wr.height=0,Oa(Wr,Jt),Wr.width=Wr.width||(pt.width>>Or)-Zt,Wr.height=Wr.height||(pt.height>>Or)-Gt,qs(pt),Lo(Wr,Ea+Ht,Zt,Gt,Or),Fl(),Ya(Wr),it}function $t(Ht){var Jt=Ht|0;if(Jt!==pt.width){it.width=pt.width=Jt,it.height=pt.height=Jt,qs(pt);for(var ir=0;ir<6;++ir)for(var rr=0;pt.mipmask>>rr;++rr)mt.texImage2D(Ea+ir,rr,pt.format,Jt>>rr,Jt>>rr,0,pt.format,pt.type,null);return Fl(),mn.profile&&(pt.stats.size=Ef(pt.internalformat,pt.type,it.width,it.height,!1,!0)),it}}return it(q,he,J,_e,qe,ft),it.subimage=Tt,it.resize=$t,it._reglType="textureCube",it._texture=pt,mn.profile&&(it.stats=pt.stats),it.destroy=function(){pt.decRef()},it}function ds(){for(var q=0;q>_e,J.height>>_e,0,J.internalformat,J.type,null);else for(var qe=0;qe<6;++qe)mt.texImage2D(Ea+qe,_e,J.internalformat,J.width>>_e,J.height>>_e,0,J.internalformat,J.type,null);Qu(J.texInfo,J.target)})}function be(){for(var q=0;q=0?Eu=!0:Ia.indexOf(el)>=0&&(Eu=!1))),("depthTexture"in ho||"depthStencilTexture"in ho)&&(du=!!(ho.depthTexture||ho.depthStencilTexture)),"depth"in ho&&(typeof ho.depth=="boolean"?Qo=ho.depth:(Qu=ho.depth,fl=!1)),"stencil"in ho&&(typeof ho.stencil=="boolean"?fl=ho.stencil:(_f=ho.stencil,Qo=!1)),"depthStencil"in ho&&(typeof ho.depthStencil=="boolean"?Qo=fl=ho.depthStencil:(nu=ho.depthStencil,Qo=!1,fl=!1))}var qs=null,Fl=null,dc=null,vc=null;if(Array.isArray(es))qs=es.map(Ga);else if(es)qs=[Ga(es)];else for(qs=new Array(Fu),Ya=0;Ya0&&(ji.depth=$a[0].depth,ji.stencil=$a[0].stencil,ji.depthStencil=$a[0].depthStencil),$a[_i]?$a[_i](ji):$a[_i]=ia(ji)}return h(Oa,{width:Ya,height:Ya,color:el})}function zi(Lo){var _i,ji=Lo|0;if(ji===Oa.width)return Oa;var Ya=Oa.color;for(_i=0;_i=To.byteLength?qo.subdata(To):(qo.destroy(),Yn.buffers[_i]=null)),Yn.buffers[_i]||(qo=Yn.buffers[_i]=ca.create(ji,ih,!1,!0)),Ya.buffer=ca.getBuffer(qo),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1,zi[_i]=1}else ca.getBuffer(ji)?(Ya.buffer=ca.getBuffer(ji),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1):ca.getBuffer(ji.buffer)?(Ya.buffer=ca.getBuffer(ji.buffer),Ya.size=(+ji.size||Ya.buffer.dimension)|0,Ya.normalized=!!ji.normalized||!1,"type"in ji?Ya.type=kn[ji.type]:Ya.type=Ya.buffer.dtype,Ya.offset=(ji.offset||0)|0,Ya.stride=(ji.stride||0)|0,Ya.divisor=(ji.divisor||0)|0,Ya.state=1):"x"in ji&&(Ya.x=+ji.x||0,Ya.y=+ji.y||0,Ya.z=+ji.z||0,Ya.w=+ji.w||0,Ya.state=2)}for(var Qo=0;Qo1)for(var Dn=0;Dnnn&&(nn=Fn.stats.uniformsCount)}),nn},wr.getMaxAttributesCount=function(){var nn=0;return Za.forEach(function(Fn){Fn.stats.attributesCount>nn&&(nn=Fn.stats.attributesCount)}),nn});function ma(){ca={},yn={};for(var nn=0;nn>>4&15)+yr.charAt(Ln&15);return wr}function gf(mt){for(var yr="",wr=-1,Ln,ca;++wr>>6&31,128|Ln&63):Ln<=65535?yr+=String.fromCharCode(224|Ln>>>12&15,128|Ln>>>6&63,128|Ln&63):Ln<=2097151&&(yr+=String.fromCharCode(240|Ln>>>18&7,128|Ln>>>12&63,128|Ln>>>6&63,128|Ln&63));return yr}function Su(mt){for(var yr=Array(mt.length>>2),wr=0;wr>5]|=(mt.charCodeAt(wr/8)&255)<<24-wr%32;return yr}function Tc(mt){for(var yr="",wr=0;wr>5]>>>24-wr%32&255);return yr}function pu(mt,yr){return mt>>>yr|mt<<32-yr}function Vf(mt,yr){return mt>>>yr}function yf(mt,yr,wr){return mt&yr^~mt&wr}function jh(mt,yr,wr){return mt&yr^mt&wr^yr&wr}function cr(mt){return pu(mt,2)^pu(mt,13)^pu(mt,22)}function Rr(mt){return pu(mt,6)^pu(mt,11)^pu(mt,25)}function pn(mt){return pu(mt,7)^pu(mt,18)^Vf(mt,3)}function an(mt){return pu(mt,17)^pu(mt,19)^Vf(mt,10)}var On=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function Aa(mt,yr){var wr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Ln=new Array(64),ca,yn,mn,za,Ia,Da,Za,Fi,yi,Ga,ma,nn;for(mt[yr>>5]|=128<<24-yr%32,mt[(yr+64>>9<<4)+15]=yr,yi=0;yi>16)+(yr>>16)+(wr>>16);return Ln<<16|wr&65535}function ti(mt){return Array.prototype.slice.call(mt)}function li(mt){return ti(mt).join("")}function Ni(mt){var yr=mt&&mt.cache,wr=0,Ln=[],ca=[],yn=[];function mn(ma,nn){var Fn=nn&&nn.stable;if(!Fn){for(var ta=0;ta0&&(ma.push(ya,"="),ma.push.apply(ma,ti(arguments)),ma.push(";")),ya}return h(nn,{def:ta,toString:function(){return li([Fn.length>0?"var "+Fn.join(",")+";":"",li(ma)])}})}function Ia(){var ma=za(),nn=za(),Fn=ma.toString,ta=nn.toString;function ya(aa,ci){nn(aa,ci,"=",ma.def(aa,ci),";")}return h(function(){ma.apply(ma,ti(arguments))},{def:ma.def,entry:ma,exit:nn,save:ya,set:function(aa,ci,Ua){ya(aa,ci),ma(aa,ci,"=",Ua,";")},toString:function(){return Fn()+ta()}})}function Da(){var ma=li(arguments),nn=Ia(),Fn=Ia(),ta=nn.toString,ya=Fn.toString;return h(nn,{then:function(){return nn.apply(nn,ti(arguments)),this},else:function(){return Fn.apply(Fn,ti(arguments)),this},toString:function(){var aa=ya();return aa&&(aa="else{"+aa+"}"),li(["if(",ma,"){",ta(),"}",aa])}})}var Za=za(),Fi={};function yi(ma,nn){var Fn=[];function ta(){var Ri="a"+Fn.length;return Fn.push(Ri),Ri}nn=nn||0;for(var ya=0;ya":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},oa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Aa={cw:xt,ccw:St};function Ra(dt){return Array.isArray(dt)||Sr(dt)||Br(dt)}function ia(dt){return dt.sort(function(gr,wr){return gr===zc?-1:wr===zc?1:gr=1,Cn>=2,gr)}else if(wr===Vo){var ua=dt.data;return new oi(ua.thisDep,ua.contextDep,ua.propDep,gr)}else{if(wr===Ki)return new oi(!1,!1,!1,gr);if(wr===Ri){for(var gn=!1,pn=!1,za=!1,Ia=0;Ia=1&&(pn=!0),Wa>=2&&(za=!0)}else Da.type===Vo&&(gn=gn||Da.data.thisDep,pn=pn||Da.data.contextDep,za=za||Da.data.propDep)}return new oi(gn,pn,za,gr)}else return new oi(wr===Yo,wr===Fo,wr===jo,gr)}}var wo=new oi(!1,!1,!1,function(){});function ko(dt,gr,wr,Cn,ua,gn,pn,za,Ia,Da,Wa,Bi,bi,Ha,ga,rn){var Fn=Da.Record,ea={add:32774,subtract:32778,"reverse subtract":32779};wr.ext_blend_minmax&&(ea.min=It,ea.max=Qt);var ya=wr.angle_instanced_arrays,na=wr.webgl_draw_buffers,di=wr.oes_vertex_array_object,Ua={dirty:!0,profile:rn.profile},Di={},aa=[],Zn={},li={};function Dn(Ke){return Ke.replace(".","_")}function $a(Ke,at,bt){var Zt=Dn(Ke);aa.push(Ke),Di[Zt]=Ua[Zt]=!!bt,Zn[Zt]=at}function Oa(Ke,at,bt){var Zt=Dn(Ke);aa.push(Ke),Array.isArray(bt)?(Ua[Zt]=bt.slice(),Di[Zt]=bt.slice()):Ua[Zt]=Di[Zt]=bt,li[Zt]=at}function Oi(Ke){return!!isNaN(Ke)}$a(is,Gr),$a(Us,Lr),Oa(Al,"blendColor",[0,0,0,0]),Oa(Xl,"blendEquationSeparate",[hn,hn]),Oa(Ml,"blendFuncSeparate",[Hr,Xr,Hr,Xr]),$a(Yl,Mn,!0),Oa(rl,"depthFunc",An),Oa(Su,"depthRange",[0,1]),Oa(wu,"depthMask",!0),Oa(ql,ql,[!0,!0,!0,!0]),$a(bo,Tr),Oa(xs,"cullFace",tt),Oa(zl,zl,St),Oa(pl,pl,1),$a(dc,Yn),Oa(pc,"polygonOffset",[0,0]),$a(xc,wa),$a(Gf,ni),Oa(mc,"sampleCoverage",[1,!1]),$a(Mf,on),Oa(Mu,"stencilMask",-1),Oa(Ef,"stencilFunc",[Jt,0,-1]),Oa(Zo,"stencilOpSeparate",[Oe,yr,yr,yr]),Oa(ss,"stencilOpSeparate",[tt,yr,yr,yr]),$a(kf,Pn),Oa(Xc,"scissor",[0,0,dt.drawingBufferWidth,dt.drawingBufferHeight]),Oa(zc,zc,[0,0,dt.drawingBufferWidth,dt.drawingBufferHeight]);var Po={gl:dt,context:bi,strings:gr,next:Di,current:Ua,draw:Bi,elements:gn,buffer:ua,shader:Wa,attributes:Da.state,vao:Da,uniforms:Ia,framebuffer:za,extensions:wr,timer:Ha,isBufferArgs:Ra},wi={primTypes:Vn,compareFuncs:Qn,blendFuncs:zn,blendEquations:ea,stencilOps:oa,glTypes:En,orientationType:Aa};na&&(wi.backBuffer=[tt],wi.drawBuffer=m(Cn.maxDrawbuffers,function(Ke){return Ke===0?[0]:m(Ke,function(at){return La+at})}));var ji=0;function Ya(){var Ke=Ni({cache:ga}),at=Ke.link,bt=Ke.global;Ke.id=ji++,Ke.batchId="0";var Zt=at(Po),Vt=Ke.shared={props:"a0"};Object.keys(Po).forEach(function(Xt){Vt[Xt]=bt.def(Zt,".",Xt)});var Kt=Ke.next={},nr=Ke.current={};Object.keys(li).forEach(function(Xt){Array.isArray(Ua[Xt])&&(Kt[Xt]=bt.def(Vt.next,".",Xt),nr[Xt]=bt.def(Vt.current,".",Xt))});var er=Ke.constants={};Object.keys(wi).forEach(function(Xt){er[Xt]=bt.def(JSON.stringify(wi[Xt]))}),Ke.invoke=function(Xt,Ht){switch(Ht.type){case Zi:var zr=["this",Vt.context,Vt.props,Ke.batchId];return Xt.def(at(Ht.data),".call(",zr.slice(0,Math.max(Ht.data.length+1,4)),")");case jo:return Xt.def(Vt.props,Ht.data);case Fo:return Xt.def(Vt.context,Ht.data);case Yo:return Xt.def("this",Ht.data);case Vo:return Ht.data.append(Ke,Xt),Ht.data.ref;case Ki:return Ht.data.toString();case Ri:return Ht.data.map(function(Yr){return Ke.invoke(Xt,Yr)})}},Ke.attribCache={};var Bt={};return Ke.scopeAttrib=function(Xt){var Ht=gr.id(Xt);if(Ht in Bt)return Bt[Ht];var zr=Da.scope[Ht];zr||(zr=Da.scope[Ht]=new Fn);var Yr=Bt[Ht]=at(zr);return Yr},Ke}function Mo(Ke){var at=Ke.static,bt=Ke.dynamic,Zt;if(Ue in at){var Vt=!!at[Ue];Zt=zi(function(nr,er){return Vt}),Zt.enable=Vt}else if(Ue in bt){var Kt=bt[Ue];Zt=Gi(Kt,function(nr,er){return nr.invoke(er,Kt)})}return Zt}function Ho(Ke,at){var bt=Ke.static,Zt=Ke.dynamic;if(P in bt){var Vt=bt[P];return Vt?(Vt=za.getFramebuffer(Vt),zi(function(nr,er){var Bt=nr.link(Vt),Xt=nr.shared;er.set(Xt.framebuffer,".next",Bt);var Ht=Xt.context;return er.set(Ht,"."+Qr,Bt+".width"),er.set(Ht,"."+_n,Bt+".height"),Bt})):zi(function(nr,er){var Bt=nr.shared;er.set(Bt.framebuffer,".next","null");var Xt=Bt.context;return er.set(Xt,"."+Qr,Xt+"."+_t),er.set(Xt,"."+_n,Xt+"."+zt),"null"})}else if(P in Zt){var Kt=Zt[P];return Gi(Kt,function(nr,er){var Bt=nr.invoke(er,Kt),Xt=nr.shared,Ht=Xt.framebuffer,zr=er.def(Ht,".getFramebuffer(",Bt,")");er.set(Ht,".next",zr);var Yr=Xt.context;return er.set(Yr,"."+Qr,zr+"?"+zr+".width:"+Yr+"."+_t),er.set(Yr,"."+_n,zr+"?"+zr+".height:"+Yr+"."+zt),zr})}else return null}function ts(Ke,at,bt){var Zt=Ke.static,Vt=Ke.dynamic;function Kt(Bt){if(Bt in Zt){var Xt=Zt[Bt],Ht=!0,zr=Xt.x|0,Yr=Xt.y|0,fn,sa;return"width"in Xt?fn=Xt.width|0:Ht=!1,"height"in Xt?sa=Xt.height|0:Ht=!1,new oi(!Ht&&at&&at.thisDep,!Ht&&at&&at.contextDep,!Ht&&at&&at.propDep,function(la,va){var Pa=la.shared.context,ca=fn;"width"in Xt||(ca=va.def(Pa,".",Qr,"-",zr));var Fa=sa;return"height"in Xt||(Fa=va.def(Pa,".",_n,"-",Yr)),[zr,Yr,ca,Fa]})}else if(Bt in Vt){var Wn=Vt[Bt],Hn=Gi(Wn,function(la,va){var Pa=la.invoke(va,Wn),ca=la.shared.context,Fa=va.def(Pa,".x|0"),Ja=va.def(Pa,".y|0"),Ei=va.def('"width" in ',Pa,"?",Pa,".width|0:","(",ca,".",Qr,"-",Fa,")"),Hi=va.def('"height" in ',Pa,"?",Pa,".height|0:","(",ca,".",_n,"-",Ja,")");return[Fa,Ja,Ei,Hi]});return at&&(Hn.thisDep=Hn.thisDep||at.thisDep,Hn.contextDep=Hn.contextDep||at.contextDep,Hn.propDep=Hn.propDep||at.propDep),Hn}else return at?new oi(at.thisDep,at.contextDep,at.propDep,function(la,va){var Pa=la.shared.context;return[0,0,va.def(Pa,".",Qr),va.def(Pa,".",_n)]}):null}var nr=Kt(zc);if(nr){var er=nr;nr=new oi(nr.thisDep,nr.contextDep,nr.propDep,function(Bt,Xt){var Ht=er.append(Bt,Xt),zr=Bt.shared.context;return Xt.set(zr,"."+Ze,Ht[2]),Xt.set(zr,"."+et,Ht[3]),Ht})}return{viewport:nr,scissor_box:Kt(Xc)}}function cl(Ke,at){var bt=Ke.static,Zt=typeof bt[Se]=="string"&&typeof bt[oe]=="string";if(Zt){if(Object.keys(at.dynamic).length>0)return null;var Vt=at.static,Kt=Object.keys(Vt);if(Kt.length>0&&typeof Vt[Kt[0]]=="number"){for(var nr=[],er=0;er"+Fa+"?"+Ht+".constant["+Fa+"]:0;"}).join(""),"}}else{","if(",fn,"(",Ht,".buffer)){",la,"=",sa,".createStream(",Ut,",",Ht,".buffer);","}else{",la,"=",sa,".getBuffer(",Ht,".buffer);","}",va,'="type" in ',Ht,"?",Yr.glTypes,"[",Ht,".type]:",la,".dtype;",Wn.normalized,"=!!",Ht,".normalized;");function Pa(ca){Xt(Wn[ca],"=",Ht,".",ca,"|0;")}return Pa("size"),Pa("offset"),Pa("stride"),Pa("divisor"),Xt("}}"),Xt.exit("if(",Wn.isStream,"){",sa,".destroyStream(",la,");","}"),Wn}Vt[Kt]=Gi(nr,er)}),Vt}function Wu(Ke){var at=Ke.static,bt=Ke.dynamic,Zt={};return Object.keys(at).forEach(function(Vt){var Kt=at[Vt];Zt[Vt]=zi(function(nr,er){return typeof Kt=="number"||typeof Kt=="boolean"?""+Kt:nr.link(Kt)})}),Object.keys(bt).forEach(function(Vt){var Kt=bt[Vt];Zt[Vt]=Gi(Kt,function(nr,er){return nr.invoke(er,Kt)})}),Zt}function pf(Ke,at,bt,Zt,Vt){Ke.static,Ke.dynamic;var Kt=cl(Ke,at),nr=Ho(Ke),er=ts(Ke,nr),Bt=Tu(Ke),Xt=tl(Ke),Ht=rs(Ke,Vt,Kt);function zr(la){var va=er[la];va&&(Xt[la]=va)}zr(zc),zr(Dn(Xc));var Yr=Object.keys(Xt).length>0,fn={framebuffer:nr,draw:Bt,shader:Ht,state:Xt,dirty:Yr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(fn.profile=Mo(Ke),fn.uniforms=du(bt),fn.drawVAO=fn.scopeVAO=Bt.vao,!fn.drawVAO&&Ht.program&&!Kt&&wr.angle_instanced_arrays&&Bt.static.elements){var sa=!0,Wn=Ht.program.attributes.map(function(la){var va=at.static[la];return sa=sa&&!!va,va});if(sa&&Wn.length>0){var Hn=Da.getVAO(Da.createVAO({attributes:Wn,elements:Bt.static.elements}));fn.drawVAO=new oi(null,null,null,function(la,va){return la.link(Hn)}),fn.useVAO=!0}}return Kt?fn.useVAO=!0:fn.attributes=Du(at),fn.context=Wu(Zt),fn}function Ql(Ke,at,bt){var Zt=Ke.shared,Vt=Zt.context,Kt=Ke.scope();Object.keys(bt).forEach(function(nr){at.save(Vt,"."+nr);var er=bt[nr],Bt=er.append(Ke,at);Array.isArray(Bt)?Kt(Vt,".",nr,"=[",Bt.join(),"];"):Kt(Vt,".",nr,"=",Bt,";")}),at(Kt)}function cu(Ke,at,bt,Zt){var Vt=Ke.shared,Kt=Vt.gl,nr=Vt.framebuffer,er;na&&(er=at.def(Vt.extensions,".webgl_draw_buffers"));var Bt=Ke.constants,Xt=Bt.drawBuffer,Ht=Bt.backBuffer,zr;bt?zr=bt.append(Ke,at):zr=at.def(nr,".next"),Zt||at("if(",zr,"!==",nr,".cur){"),at("if(",zr,"){",Kt,".bindFramebuffer(",kn,",",zr,".framebuffer);"),na&&at(er,".drawBuffersWEBGL(",Xt,"[",zr,".colorAttachments.length]);"),at("}else{",Kt,".bindFramebuffer(",kn,",null);"),na&&at(er,".drawBuffersWEBGL(",Ht,");"),at("}",nr,".cur=",zr,";"),Zt||at("}")}function vo(Ke,at,bt){var Zt=Ke.shared,Vt=Zt.gl,Kt=Ke.current,nr=Ke.next,er=Zt.current,Bt=Zt.next,Xt=Ke.cond(er,".dirty");aa.forEach(function(Ht){var zr=Dn(Ht);if(!(zr in bt.state)){var Yr,fn;if(zr in nr){Yr=nr[zr],fn=Kt[zr];var sa=m(Ua[zr].length,function(Hn){return Xt.def(Yr,"[",Hn,"]")});Xt(Ke.cond(sa.map(function(Hn,la){return Hn+"!=="+fn+"["+la+"]"}).join("||")).then(Vt,".",li[zr],"(",sa,");",sa.map(function(Hn,la){return fn+"["+la+"]="+Hn}).join(";"),";"))}else{Yr=Xt.def(Bt,".",zr);var Wn=Ke.cond(Yr,"!==",er,".",zr);Xt(Wn),zr in Zn?Wn(Ke.cond(Yr).then(Vt,".enable(",Zn[zr],");").else(Vt,".disable(",Zn[zr],");"),er,".",zr,"=",Yr,";"):Wn(Vt,".",li[zr],"(",Yr,");",er,".",zr,"=",Yr,";")}}}),Object.keys(bt.state).length===0&&Xt(er,".dirty=false;"),at(Xt)}function Ku(Ke,at,bt,Zt){var Vt=Ke.shared,Kt=Ke.current,nr=Vt.current,er=Vt.gl,Bt;ia(Object.keys(bt)).forEach(function(Xt){var Ht=bt[Xt];if(!(Zt&&!Zt(Ht))){var zr=Ht.append(Ke,at);if(Zn[Xt]){var Yr=Zn[Xt];Wi(Ht)?(Bt=Ke.link(zr,{stable:!0}),at(Ke.cond(Bt).then(er,".enable(",Yr,");").else(er,".disable(",Yr,");")),at(nr,".",Xt,"=",Bt,";")):(at(Ke.cond(zr).then(er,".enable(",Yr,");").else(er,".disable(",Yr,");")),at(nr,".",Xt,"=",zr,";"))}else if(Un(zr)){var fn=Kt[Xt];at(er,".",li[Xt],"(",zr,");",zr.map(function(sa,Wn){return fn+"["+Wn+"]="+sa}).join(";"),";")}else Wi(Ht)?(Bt=Ke.link(zr,{stable:!0}),at(er,".",li[Xt],"(",Bt,");",nr,".",Xt,"=",Bt,";")):at(er,".",li[Xt],"(",zr,");",nr,".",Xt,"=",zr,";")}})}function Vs(Ke,at){ya&&(Ke.instancing=at.def(Ke.shared.extensions,".angle_instanced_arrays"))}function Fl(Ke,at,bt,Zt,Vt){var Kt=Ke.shared,nr=Ke.stats,er=Kt.current,Bt=Kt.timer,Xt=bt.profile;function Ht(){return typeof performance>"u"?"Date.now()":"performance.now()"}var zr,Yr;function fn(Pa){zr=at.def(),Pa(zr,"=",Ht(),";"),typeof Vt=="string"?Pa(nr,".count+=",Vt,";"):Pa(nr,".count++;"),Ha&&(Zt?(Yr=at.def(),Pa(Yr,"=",Bt,".getNumPendingQueries();")):Pa(Bt,".beginQuery(",nr,");"))}function sa(Pa){Pa(nr,".cpuTime+=",Ht(),"-",zr,";"),Ha&&(Zt?Pa(Bt,".pushScopeStats(",Yr,",",Bt,".getNumPendingQueries(),",nr,");"):Pa(Bt,".endQuery();"))}function Wn(Pa){var ca=at.def(er,".profile");at(er,".profile=",Pa,";"),at.exit(er,".profile=",ca,";")}var Hn;if(Xt){if(Wi(Xt)){Xt.enable?(fn(at),sa(at.exit),Wn("true")):Wn("false");return}Hn=Xt.append(Ke,at),Wn(Hn)}else Hn=at.def(er,".profile");var la=Ke.block();fn(la),at("if(",Hn,"){",la,"}");var va=Ke.block();sa(va),at.exit("if(",Hn,"){",va,"}")}function uc(Ke,at,bt,Zt,Vt){var Kt=Ke.shared;function nr(Bt){switch(Bt){case ii:case $o:case al:return 2;case $i:case Js:case vu:return 3;case Ao:case Qs:case ru:return 4;default:return 1}}function er(Bt,Xt,Ht){var zr=Kt.gl,Yr=at.def(Bt,".location"),fn=at.def(Kt.attributes,"[",Yr,"]"),sa=Ht.state,Wn=Ht.buffer,Hn=[Ht.x,Ht.y,Ht.z,Ht.w],la=["buffer","normalized","offset","stride"];function va(){at("if(!",fn,".buffer){",zr,".enableVertexAttribArray(",Yr,");}");var ca=Ht.type,Fa;if(Ht.size?Fa=at.def(Ht.size,"||",Xt):Fa=Xt,at("if(",fn,".type!==",ca,"||",fn,".size!==",Fa,"||",la.map(function(Ei){return fn+"."+Ei+"!=="+Ht[Ei]}).join("||"),"){",zr,".bindBuffer(",Ut,",",Wn,".buffer);",zr,".vertexAttribPointer(",[Yr,Fa,ca,Ht.normalized,Ht.stride,Ht.offset],");",fn,".type=",ca,";",fn,".size=",Fa,";",la.map(function(Ei){return fn+"."+Ei+"="+Ht[Ei]+";"}).join(""),"}"),ya){var Ja=Ht.divisor;at("if(",fn,".divisor!==",Ja,"){",Ke.instancing,".vertexAttribDivisorANGLE(",[Yr,Ja],");",fn,".divisor=",Ja,";}")}}function Pa(){at("if(",fn,".buffer){",zr,".disableVertexAttribArray(",Yr,");",fn,".buffer=null;","}if(",Va.map(function(ca,Fa){return fn+"."+ca+"!=="+Hn[Fa]}).join("||"),"){",zr,".vertexAttrib4f(",Yr,",",Hn,");",Va.map(function(ca,Fa){return fn+"."+ca+"="+Hn[Fa]+";"}).join(""),"}")}sa===ei?va():sa===Na?Pa():(at("if(",sa,"===",ei,"){"),va(),at("}else{"),Pa(),at("}"))}Zt.forEach(function(Bt){var Xt=Bt.name,Ht=bt.attributes[Xt],zr;if(Ht){if(!Vt(Ht))return;zr=Ht.append(Ke,at)}else{if(!Vt(wo))return;var Yr=Ke.scopeAttrib(Xt);zr={},Object.keys(new Fn).forEach(function(fn){zr[fn]=at.def(Yr,".",fn)})}er(Ke.link(Bt),nr(Bt.info.type),zr)})}function cc(Ke,at,bt,Zt,Vt,Kt){for(var nr=Ke.shared,er=nr.gl,Bt,Xt=0;Xt1){for(var ws=[],gs=[],ml=0;ml>1)",Wn],");")}function Ja(){bt(Hn,".drawArraysInstancedANGLE(",[Yr,fn,sa,Wn],");")}Ht&&Ht!=="null"?va?Fa():(bt("if(",Ht,"){"),Fa(),bt("}else{"),Ja(),bt("}")):Ja()}function ca(){function Fa(){bt(Kt+".drawElements("+[Yr,sa,la,fn+"<<(("+la+"-"+Ai+")>>1)"]+");")}function Ja(){bt(Kt+".drawArrays("+[Yr,fn,sa]+");")}Ht&&Ht!=="null"?va?Fa():(bt("if(",Ht,"){"),Fa(),bt("}else{"),Ja(),bt("}")):Ja()}ya&&(typeof Wn!="number"||Wn>=0)?typeof Wn=="string"?(bt("if(",Wn,">0){"),Pa(),bt("}else if(",Wn,"<0){"),ca(),bt("}")):Pa():ca()}function ms(Ke,at,bt,Zt,Vt){var Kt=Ya(),nr=Kt.proc("body",Vt);return ya&&(Kt.instancing=nr.def(Kt.shared.extensions,".angle_instanced_arrays")),Ke(Kt,nr,bt,Zt),Kt.compile().body}function bs(Ke,at,bt,Zt){Vs(Ke,at),bt.useVAO?bt.drawVAO?at(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,at),");"):at(Ke.shared.vao,".setVAO(",Ke.shared.vao,".targetVAO);"):(at(Ke.shared.vao,".setVAO(null);"),uc(Ke,at,bt,Zt.attributes,function(){return!0})),cc(Ke,at,bt,Zt.uniforms,function(){return!0},!1),Co(Ke,at,at,bt)}function be(Ke,at){var bt=Ke.proc("draw",1);Vs(Ke,bt),Ql(Ke,bt,at.context),cu(Ke,bt,at.framebuffer),vo(Ke,bt,at),Ku(Ke,bt,at.state),Fl(Ke,bt,at,!1,!0);var Zt=at.shader.progVar.append(Ke,bt);if(bt(Ke.shared.gl,".useProgram(",Zt,".program);"),at.shader.program)bs(Ke,bt,at,at.shader.program);else{bt(Ke.shared.vao,".setVAO(null);");var Vt=Ke.global.def("{}"),Kt=bt.def(Zt,".id"),nr=bt.def(Vt,"[",Kt,"]");bt(Ke.cond(nr).then(nr,".call(this,a0);").else(nr,"=",Vt,"[",Kt,"]=",Ke.link(function(er){return ms(bs,Ke,at,er,1)}),"(",Zt,");",nr,".call(this,a0);"))}Object.keys(at.state).length>0&&bt(Ke.shared.current,".dirty=true;"),Ke.shared.vao&&bt(Ke.shared.vao,".setVAO(null);")}function q(Ke,at,bt,Zt){Ke.batchId="a1",Vs(Ke,at);function Vt(){return!0}uc(Ke,at,bt,Zt.attributes,Vt),cc(Ke,at,bt,Zt.uniforms,Vt,!1),Co(Ke,at,at,bt)}function he(Ke,at,bt,Zt){Vs(Ke,at);var Vt=bt.contextDep,Kt=at.def(),nr="a0",er="a1",Bt=at.def();Ke.shared.props=Bt,Ke.batchId=Kt;var Xt=Ke.scope(),Ht=Ke.scope();at(Xt.entry,"for(",Kt,"=0;",Kt,"<",er,";++",Kt,"){",Bt,"=",nr,"[",Kt,"];",Ht,"}",Xt.exit);function zr(la){return la.contextDep&&Vt||la.propDep}function Yr(la){return!zr(la)}if(bt.needsContext&&Ql(Ke,Ht,bt.context),bt.needsFramebuffer&&cu(Ke,Ht,bt.framebuffer),Ku(Ke,Ht,bt.state,zr),bt.profile&&zr(bt.profile)&&Fl(Ke,Ht,bt,!1,!0),Zt)bt.useVAO?bt.drawVAO?zr(bt.drawVAO)?Ht(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,Ht),");"):Xt(Ke.shared.vao,".setVAO(",bt.drawVAO.append(Ke,Xt),");"):Xt(Ke.shared.vao,".setVAO(",Ke.shared.vao,".targetVAO);"):(Xt(Ke.shared.vao,".setVAO(null);"),uc(Ke,Xt,bt,Zt.attributes,Yr),uc(Ke,Ht,bt,Zt.attributes,zr)),cc(Ke,Xt,bt,Zt.uniforms,Yr,!1),cc(Ke,Ht,bt,Zt.uniforms,zr,!0),Co(Ke,Xt,Ht,bt);else{var fn=Ke.global.def("{}"),sa=bt.shader.progVar.append(Ke,Ht),Wn=Ht.def(sa,".id"),Hn=Ht.def(fn,"[",Wn,"]");Ht(Ke.shared.gl,".useProgram(",sa,".program);","if(!",Hn,"){",Hn,"=",fn,"[",Wn,"]=",Ke.link(function(la){return ms(q,Ke,bt,la,2)}),"(",sa,");}",Hn,".call(this,a0[",Kt,"],",Kt,");")}}function J(Ke,at){var bt=Ke.proc("batch",2);Ke.batchId="0",Vs(Ke,bt);var Zt=!1,Vt=!0;Object.keys(at.context).forEach(function(fn){Zt=Zt||at.context[fn].propDep}),Zt||(Ql(Ke,bt,at.context),Vt=!1);var Kt=at.framebuffer,nr=!1;Kt?(Kt.propDep?Zt=nr=!0:Kt.contextDep&&Zt&&(nr=!0),nr||cu(Ke,bt,Kt)):cu(Ke,bt,null),at.state.viewport&&at.state.viewport.propDep&&(Zt=!0);function er(fn){return fn.contextDep&&Zt||fn.propDep}vo(Ke,bt,at),Ku(Ke,bt,at.state,function(fn){return!er(fn)}),(!at.profile||!er(at.profile))&&Fl(Ke,bt,at,!1,"a1"),at.contextDep=Zt,at.needsContext=Vt,at.needsFramebuffer=nr;var Bt=at.shader.progVar;if(Bt.contextDep&&Zt||Bt.propDep)he(Ke,bt,at,null);else{var Xt=Bt.append(Ke,bt);if(bt(Ke.shared.gl,".useProgram(",Xt,".program);"),at.shader.program)he(Ke,bt,at,at.shader.program);else{bt(Ke.shared.vao,".setVAO(null);");var Ht=Ke.global.def("{}"),zr=bt.def(Xt,".id"),Yr=bt.def(Ht,"[",zr,"]");bt(Ke.cond(Yr).then(Yr,".call(this,a0,a1);").else(Yr,"=",Ht,"[",zr,"]=",Ke.link(function(fn){return ms(he,Ke,at,fn,2)}),"(",Xt,");",Yr,".call(this,a0,a1);"))}}Object.keys(at.state).length>0&&bt(Ke.shared.current,".dirty=true;"),Ke.shared.vao&&bt(Ke.shared.vao,".setVAO(null);")}function _e(Ke,at){var bt=Ke.proc("scope",3);Ke.batchId="a2";var Zt=Ke.shared,Vt=Zt.current;if(Ql(Ke,bt,at.context),at.framebuffer&&at.framebuffer.append(Ke,bt),ia(Object.keys(at.state)).forEach(function(er){var Bt=at.state[er],Xt=Bt.append(Ke,bt);Un(Xt)?Xt.forEach(function(Ht,zr){Oi(Ht)?bt.set(Ke.next[er],"["+zr+"]",Ht):bt.set(Ke.next[er],"["+zr+"]",Ke.link(Ht,{stable:!0}))}):Wi(Bt)?bt.set(Zt.next,"."+er,Ke.link(Xt,{stable:!0})):bt.set(Zt.next,"."+er,Xt)}),Fl(Ke,bt,at,!0,!0),[ke,kt,gt,Gt,Be].forEach(function(er){var Bt=at.draw[er];if(Bt){var Xt=Bt.append(Ke,bt);Oi(Xt)?bt.set(Zt.draw,"."+er,Xt):bt.set(Zt.draw,"."+er,Ke.link(Xt),{stable:!0})}}),Object.keys(at.uniforms).forEach(function(er){var Bt=at.uniforms[er].append(Ke,bt);Array.isArray(Bt)&&(Bt="["+Bt.map(function(Xt){return Oi(Xt)?Xt:Ke.link(Xt,{stable:!0})})+"]"),bt.set(Zt.uniforms,"["+Ke.link(gr.id(er),{stable:!0})+"]",Bt)}),Object.keys(at.attributes).forEach(function(er){var Bt=at.attributes[er].append(Ke,bt),Xt=Ke.scopeAttrib(er);Object.keys(new Fn).forEach(function(Ht){bt.set(Xt,"."+Ht,Bt[Ht])})}),at.scopeVAO){var Kt=at.scopeVAO.append(Ke,bt);Oi(Kt)?bt.set(Zt.vao,".targetVAO",Kt):bt.set(Zt.vao,".targetVAO",Ke.link(Kt,{stable:!0}))}function nr(er){var Bt=at.shader[er];if(Bt){var Xt=Bt.append(Ke,bt);Oi(Xt)?bt.set(Zt.shader,"."+er,Xt):bt.set(Zt.shader,"."+er,Ke.link(Xt,{stable:!0}))}}nr(oe),nr(Se),Object.keys(at.state).length>0&&(bt(Vt,".dirty=true;"),bt.exit(Vt,".dirty=true;")),bt("a1(",Ke.shared.context,",a0,",Ke.batchId,");")}function qe(Ke){if(!(typeof Ke!="object"||Un(Ke))){for(var at=Object.keys(Ke),bt=0;bt=0;--Co){var ms=Oi[Co];ms&&ms(Ha,null,0)}wr.flush(),Da&&Da.update()}function Ho(){!Ya&&Oi.length>0&&(Ya=c.next(Mo))}function ts(){Ya&&(c.cancel(Mo),Ya=null)}function cl(Co){Co.preventDefault(),ts(),Po.forEach(function(ms){ms()})}function rs(Co){wr.getError(),ua.restore(),Ua.restore(),ea.restore(),Di.restore(),aa.restore(),Zn.restore(),na.restore(),Da&&Da.restore(),li.procs.refresh(),Ho(),wi.forEach(function(ms){ms()})}Oa&&(Oa.addEventListener(Zl,cl,!1),Oa.addEventListener(Ol,rs,!1));function Tu(){Oi.length=0,ts(),Oa&&(Oa.removeEventListener(Zl,cl),Oa.removeEventListener(Ol,rs)),Ua.clear(),Zn.clear(),aa.clear(),na.clear(),Di.clear(),ya.clear(),ea.clear(),Da&&Da.clear(),ji.forEach(function(Co){Co()})}function tl(Co){function ms(Vt){var Kt=h({},Vt);delete Kt.uniforms,delete Kt.attributes,delete Kt.context,delete Kt.vao,"stencil"in Kt&&Kt.stencil.op&&(Kt.stencil.opBack=Kt.stencil.opFront=Kt.stencil.op,delete Kt.stencil.op);function nr(er){if(er in Kt){var Bt=Kt[er];delete Kt[er],Object.keys(Bt).forEach(function(Xt){Kt[er+"."+Xt]=Bt[Xt]})}}return nr("blend"),nr("depth"),nr("cull"),nr("stencil"),nr("polygonOffset"),nr("scissor"),nr("sample"),"vao"in Vt&&(Kt.vao=Vt.vao),Kt}function bs(Vt,Kt){var nr={},er={};return Object.keys(Vt).forEach(function(Bt){var Xt=Vt[Bt];if(f.isDynamic(Xt)){er[Bt]=f.unbox(Xt,Bt);return}else if(Kt&&Array.isArray(Xt)){for(var Ht=0;Ht0)return vt.call(this,bt(Vt|0),Vt|0)}else if(Array.isArray(Vt)){if(Vt.length)return vt.call(this,Vt,Vt.length)}else return lt.call(this,Vt)}return h(Zt,{stats:_e,destroy:function(){qe.destroy()}})}var du=Zn.setFBO=tl({framebuffer:f.define.call(null,bc,"framebuffer")});function Du(Co,ms){var bs=0;li.procs.poll();var be=ms.color;be&&(wr.clearColor(+be[0]||0,+be[1]||0,+be[2]||0,+be[3]||0),bs|=Jl),"depth"in ms&&(wr.clearDepth(+ms.depth),bs|=co),"stencil"in ms&&(wr.clearStencil(ms.stencil|0),bs|=Is),wr.clear(bs)}function Wu(Co){if("framebuffer"in Co)if(Co.framebuffer&&Co.framebuffer_reglType==="framebufferCube")for(var ms=0;ms<6;++ms)du(h({framebuffer:Co.framebuffer.faces[ms]},Co),Du);else du(Co,Du);else Du(null,Co)}function pf(Co){Oi.push(Co);function ms(){var bs=Yc(Oi,Co);function be(){var q=Yc(Oi,be);Oi[q]=Oi[Oi.length-1],Oi.length-=1,Oi.length<=0&&ts()}Oi[bs]=be}return Ho(),{cancel:ms}}function Ql(){var Co=$a.viewport,ms=$a.scissor_box;Co[0]=Co[1]=ms[0]=ms[1]=0,Ha.viewportWidth=Ha.framebufferWidth=Ha.drawingBufferWidth=Co[2]=ms[2]=wr.drawingBufferWidth,Ha.viewportHeight=Ha.framebufferHeight=Ha.drawingBufferHeight=Co[3]=ms[3]=wr.drawingBufferHeight}function cu(){Ha.tick+=1,Ha.time=Ku(),Ql(),li.procs.poll()}function vo(){Di.refresh(),Ql(),li.procs.refresh(),Da&&Da.update()}function Ku(){return(p()-Wa)/1e3}vo();function Vs(Co,ms){var bs;switch(Co){case"frame":return pf(ms);case"lost":bs=Po;break;case"restore":bs=wi;break;case"destroy":bs=ji;break}return bs.push(ms),{cancel:function(){for(var be=0;be=0},read:Dn,destroy:Tu,_gl:wr,_refresh:vo,poll:function(){cu(),Da&&Da.update()},now:Ku,stats:pn,getCachedCode:Fl,preloadCachedCode:uc});return gr.onDone(null,cc),cc}return Eu})}}),ME=Ge({"src/lib/prepare_regl.js"($,G){var h=Fk(),b=XI();G.exports=function(E,e,t){var r=E._fullLayout,o=!0;return r._glcanvas.each(function(n){if(n.regl){n.regl.preloadCachedCode(t);return}if(!(n.pick&&!r._has("parcoords"))){try{n.regl=b({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:E._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:t||{}})}catch{o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(i){E&&E.emit&&E.emit("plotly_webglcontextlost",{event:i,layer:n.key})},!1)}}),o||h({container:r._glcontainer.node()}),o}}}),EC=Ge({"src/traces/scattergl/plot.js"(f,G){var h=iC(),b=gC(),S=CI(),E=GI(),e=yn(),t=Dp().selectMode,r=ME(),o=ou(),n=np(),i=rC().styleTextSelection,a={};function s(c,p,d,T){var l=c._size,g=c.width*T,x=c.height*T,A=l.l*T,M=l.b*T,_=l.r*T,w=l.t*T,m=l.w*T,u=l.h*T;return[A+p.domain[0]*m,M+d.domain[0]*u,g-_-(1-p.domain[1])*m,x-w-(1-d.domain[1])*u]}var f=G.exports=function(p,d,T){if(T.length){var l=p._fullLayout,g=d._scene,x=d.xaxis,A=d.yaxis,M,_;if(g){var w=r(p,["ANGLE_instanced_arrays","OES_element_index_uint"],a);if(!w){g.init();return}var m=g.count,u=l._glcanvas.data()[0].regl;if(n(p,d,T),g.dirty){if((g.line2d||g.error2d)&&!(g.scatter2d||g.fill2d||g.glText)&&u.clear({color:!0,depth:!0}),g.error2d===!0&&(g.error2d=S(u)),g.line2d===!0&&(g.line2d=b(u)),g.scatter2d===!0&&(g.scatter2d=h(u)),g.fill2d===!0&&(g.fill2d=b(u)),g.glText===!0)for(g.glText=new Array(m),M=0;Mg.glText.length){var v=m-g.glText.length;for(M=0;Mie&&(isNaN(ae[ve])||isNaN(ae[ve+1]));)ve-=2;H.positions=ae.slice(ie,ve+2)}return H}),g.line2d.update(g.lineOptions)),g.error2d){var L=(g.errorXOptions||[]).concat(g.errorYOptions||[]);g.error2d.update(L)}g.scatter2d&&g.scatter2d.update(g.markerOptions),g.fillOrder=e.repeat(null,m),g.fill2d&&(g.fillOptions=g.fillOptions.map(function(H,ae){var ie=T[ae];if(!(!H||!ie||!ie[0]||!ie[0].trace)){var ve=ie[0],Ae=ve.trace,Ce=ve.t,Fe=g.lineOptions[ae],ze,Ye,it=[];Ae._ownfill&&it.push(ae),Ae._nexttrace&&it.push(ae+1),it.length&&(g.fillOrder[ae]=it);var st=[],nt=Fe&&Fe.positions||Ce.positions,Qe,Le;if(Ae.fill==="tozeroy"){for(Qe=0;QeQe&&isNaN(nt[Le+1]);)Le-=2;nt[Qe+1]!==0&&(st=[nt[Qe],0]),st=st.concat(nt.slice(Qe,Le+2)),nt[Le+1]!==0&&(st=st.concat([nt[Le],0]))}else if(Ae.fill==="tozerox"){for(Qe=0;QeQe&&isNaN(nt[Le]);)Le-=2;nt[Qe]!==0&&(st=[0,nt[Qe+1]]),st=st.concat(nt.slice(Qe,Le+2)),nt[Le]!==0&&(st=st.concat([0,nt[Le+1]]))}else if(Ae.fill==="toself"||Ae.fill==="tonext"){for(st=[],ze=0,H.splitNull=!0,Ye=0;Ye-1;for(M=0;Mx&&d||gi,y;for(v?y=d.sizeAvg||Math.max(d.size,3):y=S(f,p),A=0;A{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,E(()=>{this.dirty=!1})),this)},o.prototype.update=function(...s){if(!s.length)return;for(let p=0;py||!d.lower&&v{f[T+g]=p})}this.scatter.draw(...f)}return this},o.prototype.destroy=function(){return this.traces.forEach(s=>{s.buffer&&s.buffer.destroy&&s.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function n(s,f,c){let p=s.id!=null?s.id:s,d=f,T=c;return p<<16|(d&255)<<8|T&255}function i(s,f,c){let p,d,T,l,g=s[f],x=s[c];return g.length>2?(g[0],g[2],p=g[1],d=g[3]):g.length?(p=g[0],d=g[1]):(g.x,p=g.y,g.x+g.width,d=g.y+g.height),x.length>2?(T=x[0],l=x[2],x[1],x[3]):x.length?(T=x[0],l=x[1]):(T=x.x,x.y,l=x.x+x.width,x.y+x.height),[T,p,l,d]}function a(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];{let f=t(s);return[f.x,f.y,f.x+f.width,f.y+f.height]}}}}),rD=Ge({"src/traces/splom/plot.js"($,G){var h=tD(),b=yn(),S=Lf(),E=Dp().selectMode;G.exports=function(r,o,n){if(n.length)for(var i=0;i-1,N=E(d)||!!i.selectedpoints||F,B=!0;if(N){var R=i._length;if(i.selectedpoints){s.selectBatch=i.selectedpoints;var U=i.selectedpoints,j={};for(g=0;g=Z[re][0]&&j<=Z[re][1])return!0;return!1}function f(j){j.attr("x",-h.bar.captureWidth/2).attr("width",h.bar.captureWidth)}function c(j){j.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function p(j){if(!j.brush.filterSpecified)return"0,"+j.height;for(var Z=d(j.brush.filter.getConsolidated(),j.height),re=[0],fe,le,ce,V=Z.length?Z[0][0]:null,ee=0;eej[1]+re||Z=.9*j[1]+.1*j[0]?"n":Z<=.9*j[0]+.1*j[1]?"s":"ns"}function l(){b.select(document.body).style("cursor",null)}function g(j){j.attr("stroke-dasharray",p)}function x(j,Z){var re=b.select(j).selectAll(".highlight, .highlight-shadow"),fe=Z?re.transition().duration(h.bar.snapDuration).each("end",Z):re;g(fe)}function A(j,Z){var re=j.brush,fe=re.filterSpecified,le=NaN,ce={},V;if(fe){var ee=j.height,ne=re.filter.getConsolidated(),K=d(ne,ee),ue=NaN,te=NaN,H=NaN;for(V=0;V<=K.length;V++){var ae=K[V];if(ae&&ae[0]<=Z&&Z<=ae[1]){ue=V;break}else if(te=V?V-1:NaN,ae&&ae[0]>Z){H=V;break}}if(le=ue,isNaN(le)&&(isNaN(te)||isNaN(H)?le=isNaN(te)?H:te:le=Z-K[te][1]=Fe[0]&&Ce<=Fe[1]){ce.clickableOrdinalRange=Fe;break}}}return ce}function M(j,Z){b.event.sourceEvent.stopPropagation();var re=Z.height-b.mouse(j)[1]-2*h.verticalPadding,fe=Z.unitToPaddedPx.invert(re),le=Z.brush,ce=A(Z,re),V=ce.interval,ee=le.svgBrush;if(ee.wasDragged=!1,ee.grabbingBar=ce.region==="ns",ee.grabbingBar){var ne=V.map(Z.unitToPaddedPx);ee.grabPoint=re-ne[0]-h.verticalPadding,ee.barLength=ne[1]-ne[0]}ee.clickableOrdinalRange=ce.clickableOrdinalRange,ee.stayingIntervals=Z.multiselect&&le.filterSpecified?le.filter.getConsolidated():[],V&&(ee.stayingIntervals=ee.stayingIntervals.filter(function(K){return K[0]!==V[0]&&K[1]!==V[1]})),ee.startExtent=ce.region?V[ce.region==="s"?1:0]:fe,Z.parent.inBrushDrag=!0,ee.brushStartCallback()}function _(j,Z){b.event.sourceEvent.stopPropagation();var re=Z.height-b.mouse(j)[1]-2*h.verticalPadding,fe=Z.brush.svgBrush;fe.wasDragged=!0,fe._dragging=!0,fe.grabbingBar?fe.newExtent=[re-fe.grabPoint,re+fe.barLength-fe.grabPoint].map(Z.unitToPaddedPx.invert):fe.newExtent=[fe.startExtent,Z.unitToPaddedPx.invert(re)].sort(e),Z.brush.filterSpecified=!0,fe.extent=fe.stayingIntervals.concat([fe.newExtent]),fe.brushCallback(Z),x(j.parentNode)}function w(j,Z){var re=Z.brush,fe=re.filter,le=re.svgBrush;le._dragging||(m(j,Z),_(j,Z),Z.brush.svgBrush.wasDragged=!1),le._dragging=!1;var ce=b.event;ce.sourceEvent.stopPropagation();var V=le.grabbingBar;if(le.grabbingBar=!1,le.grabLocation=void 0,Z.parent.inBrushDrag=!1,l(),!le.wasDragged){le.wasDragged=void 0,le.clickableOrdinalRange?re.filterSpecified&&Z.multiselect?le.extent.push(le.clickableOrdinalRange):(le.extent=[le.clickableOrdinalRange],re.filterSpecified=!0):V?(le.extent=le.stayingIntervals,le.extent.length===0&&z(re)):z(re),le.brushCallback(Z),x(j.parentNode),le.brushEndCallback(re.filterSpecified?fe.getConsolidated():[]);return}var ee=function(){fe.set(fe.getConsolidated())};if(Z.ordinal){var ne=Z.unitTickvals;ne[ne.length-1]le.newExtent[0];le.extent=le.stayingIntervals.concat(K?[le.newExtent]:[]),le.extent.length||z(re),le.brushCallback(Z),K?x(j.parentNode,ee):(ee(),x(j.parentNode))}else ee();le.brushEndCallback(re.filterSpecified?fe.getConsolidated():[])}function m(j,Z){var re=Z.height-b.mouse(j)[1]-2*h.verticalPadding,fe=A(Z,re),le="crosshair";fe.clickableOrdinalRange?le="pointer":fe.region&&(le=fe.region+"-resize"),b.select(document.body).style("cursor",le)}function u(j){j.on("mousemove",function(Z){b.event.preventDefault(),Z.parent.inBrushDrag||m(this,Z)}).on("mouseleave",function(Z){Z.parent.inBrushDrag||l()}).call(b.behavior.drag().on("dragstart",function(Z){M(this,Z)}).on("drag",function(Z){_(this,Z)}).on("dragend",function(Z){w(this,Z)}))}function v(j,Z){return j[0]-Z[0]}function y(j,Z,re){var fe=re._context.staticPlot,le=j.selectAll(".background").data(E);le.enter().append("rect").classed("background",!0).call(f).call(c).style("pointer-events",fe?"none":"auto").attr("transform",t(0,h.verticalPadding)),le.call(u).attr("height",function(ee){return ee.height-h.verticalPadding});var ce=j.selectAll(".highlight-shadow").data(E);ce.enter().append("line").classed("highlight-shadow",!0).attr("x",-h.bar.width/2).attr("stroke-width",h.bar.width+h.bar.strokeWidth).attr("stroke",Z).attr("opacity",h.bar.strokeOpacity).attr("stroke-linecap","butt"),ce.attr("y1",function(ee){return ee.height}).call(g);var V=j.selectAll(".highlight").data(E);V.enter().append("line").classed("highlight",!0).attr("x",-h.bar.width/2).attr("stroke-width",h.bar.width-h.bar.strokeWidth).attr("stroke",h.bar.fillColor).attr("opacity",h.bar.fillOpacity).attr("stroke-linecap","butt"),V.attr("y1",function(ee){return ee.height}).call(g)}function I(j,Z,re){var fe=j.selectAll("."+h.cn.axisBrush).data(E,S);fe.enter().append("g").classed(h.cn.axisBrush,!0),y(fe,Z,re)}function L(j){return j.svgBrush.extent.map(function(Z){return Z.slice()})}function z(j){j.filterSpecified=!1,j.svgBrush.extent=[[-1/0,1/0]]}function F(j){return function(re){var fe=re.brush,le=L(fe),ce=le.slice();fe.filter.set(ce),j()}}function N(j){for(var Z=j.slice(),re=[],fe,le=Z.shift();le;){for(fe=le.slice();(le=Z.shift())&&le[0]<=fe[1];)fe[1]=Math.max(fe[1],le[1]);re.push(fe)}return re.length===1&&re[0][0]>re[0][1]&&(re=[]),re}function B(){var j=[],Z,re;return{set:function(fe){j=fe.map(function(le){return le.slice().sort(e)}).sort(v),j.length===1&&j[0][0]===-1/0&&j[0][1]===1/0&&(j=[[0,-1]]),Z=N(j),re=j.reduce(function(le,ce){return[Math.min(le[0],ce[0]),Math.max(le[1],ce[1])]},[1/0,-1/0])},get:function(){return j.slice()},getConsolidated:function(){return Z},getBounds:function(){return re}}}function R(j,Z,re,fe,le,ce){var V=B();return V.set(re),{filter:V,filterSpecified:Z,svgBrush:{extent:[],brushStartCallback:fe,brushCallback:F(le),brushEndCallback:ce}}}function U(j,Z){if(Array.isArray(j[0])?(j=j.map(function(fe){return fe.sort(e)}),Z.multiselect?j=N(j.sort(v)):j=[j[0]]):j=[j.sort(e)],Z.tickvals){var re=Z.tickvals.slice().sort(e);if(j=j.map(function(fe){var le=[a(0,re,fe[0],[]),a(1,re,fe[1],[])];if(le[1]>le[0])return le}).filter(function(fe){return fe}),!j.length)return}return j.length>1?j:j[0]}G.exports={makeBrush:R,ensureAxisBrush:I,cleanRanges:U}}}),cD=Ge({"src/traces/parcoords/defaults.js"($,G){var h=yn(),b=vv().hasColorscale,S=dh(),E=Sc().defaults,e=dv(),t=Ss(),r=LC(),o=PC(),n=JA().maxDimensionCount,i=EE();function a(f,c,p,d,T){var l=T("line.color",p);if(b(f,"line")&&h.isArrayOrTypedArray(l)){if(l.length)return T("line.colorscale"),S(f,c,d,T,{prefix:"line.",cLetter:"c"}),l.length;c.line.color=p}return 1/0}function s(f,c,p,d){function T(M,_){return h.coerce(f,c,r.dimensions,M,_)}var l=T("values"),g=T("visible");if(l&&l.length||(g=c.visible=!1),g){T("label"),T("tickvals"),T("ticktext"),T("tickformat");var x=T("range");c._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:x},t.setConvert(c._ax,d.layout),T("multiselect");var A=T("constraintrange");A&&(c.constraintrange=o.cleanRanges(A,c))}}G.exports=function(c,p,d,T){function l(_,w){return h.coerce(c,p,r,_,w)}var g=c.dimensions;Array.isArray(g)&&g.length>n&&(h.log("parcoords traces support up to "+n+" dimensions at the moment"),g.splice(n));var x=e(c,p,{name:"dimensions",layout:T,handleItemDefaults:s}),A=a(c,p,d,T,l);E(p,T,l),(!Array.isArray(x)||!x.length)&&(p.visible=!1),i(p,x,"values",A);var M=h.extendFlat({},T.font,{size:Math.round(T.font.size/1.2)});h.coerceFont(l,"labelfont",M),h.coerceFont(l,"tickfont",M,{autoShadowDflt:!0}),h.coerceFont(l,"rangefont",M),l("labelangle"),l("labelside"),l("unselected.line.color"),l("unselected.line.opacity")}}}),fD=Ge({"src/traces/parcoords/calc.js"($,G){var h=yn().isArrayOrTypedArray,b=Ac(),S=Dg().wrap;G.exports=function(t,r){var o,n;return b.hasColorscale(r,"line")&&h(r.line.color)?(o=r.line.color,n=b.extractOpts(r.line).colorscale,b.calc(t,r,{vals:o,containerStr:"line",cLetter:"c"})):(o=E(r._length),n=[[0,r.line.color],[1,r.line.color]]),S({lineColor:o,cscale:n})};function E(e){for(var t=new Array(e),r=0;r>>16,($&65280)>>>8,$&255],alpha:1};if(typeof $=="number")return{space:"rgb",values:[$>>>16,($&65280)>>>8,$&255],alpha:1};if($=String($).toLowerCase(),kE.default[$])S=kE.default[$].slice(),e="rgb";else if($==="transparent")E=0,e="rgb",S=[0,0,0];else if($[0]==="#"){var t=$.slice(1),r=t.length,o=r<=4;E=1,o?(S=[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16)],r===4&&(E=parseInt(t[3]+t[3],16)/255)):(S=[parseInt(t[0]+t[1],16),parseInt(t[2]+t[3],16),parseInt(t[4]+t[5],16)],r===8&&(E=parseInt(t[6]+t[7],16)/255)),S[0]||(S[0]=0),S[1]||(S[1]=0),S[2]||(S[2]=0),e="rgb"}else if(b=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec($)){var n=b[1];e=n.replace(/a$/,"");var i=e==="cmyk"?4:e==="gray"?1:3;S=b[2].trim().split(/\s*[,\/]\s*|\s+/),e==="color"&&(e=S.shift()),S=S.map(function(a,s){if(a[a.length-1]==="%")return a=parseFloat(a)/100,s===3?a:e==="rgb"?a*255:e[0]==="h"||e[0]==="l"&&!s?a*100:e==="lab"?a*125:e==="lch"?s<2?a*150:a*360:e[0]==="o"&&!s?a:e==="oklab"?a*.4:e==="oklch"?s<2?a*.4:a*360:a;if(e[s]==="h"||s===2&&e[e.length-1]==="h"){if(CE[a]!==void 0)return CE[a];if(a.endsWith("deg"))return parseFloat(a);if(a.endsWith("turn"))return parseFloat(a)*360;if(a.endsWith("grad"))return parseFloat(a)*360/400;if(a.endsWith("rad"))return parseFloat(a)*180/Math.PI}return a==="none"?0:parseFloat(a)}),E=S.length>i?S.pop():1}else/[0-9](?:\s|\/|,)/.test($)&&(S=$.match(/([0-9]+)/g).map(function(a){return parseFloat(a)}),e=((h=(G=$.match(/([a-z])/ig))==null?void 0:G.join(""))==null?void 0:h.toLowerCase())||"rgb");return{space:e,values:S,alpha:E}}var kE,RC,CE,vD=si({"node_modules/color-parse/index.js"(){kE=go(Dk()),RC=hD,CE={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),QA,IC=si({"node_modules/color-space/rgb.js"(){QA={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),eS,dD=si({"node_modules/color-space/hsl.js"(){IC(),eS={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function($){var G=$[0]/360,h=$[1]/100,b=$[2]/100,S,E,e,t,r,o=0;if(h===0)return r=b*255,[r,r,r];for(E=b<.5?b*(1+h):b+h-b*h,S=2*b-E,t=[0,0,0];o<3;)e=G+1/3*-(o-1),e<0?e++:e>1&&e--,r=6*e<1?S+(E-S)*6*e:2*e<1?E:3*e<2?S+(E-S)*(2/3-e)*6:S,t[o++]=r*255;return t}},QA.hsl=function($){var G=$[0]/255,h=$[1]/255,b=$[2]/255,S=Math.min(G,h,b),E=Math.max(G,h,b),e=E-S,t,r,o;return E===S?t=0:G===E?t=(h-b)/e:h===E?t=2+(b-G)/e:b===E&&(t=4+(G-h)/e),t=Math.min(t*60,360),t<0&&(t+=360),o=(S+E)/2,E===S?r=0:o<=.5?r=e/(E+S):r=e/(2-E-S),[t,r*100,o*100]}}}),DC={};zo(DC,{default:()=>pD});function pD($){Array.isArray($)&&$.raw&&($=String.raw(...arguments)),$ instanceof Number&&($=+$);var G,h=RC($);if(!h.space)return[];const b=h.space[0]==="h"?eS.min:QA.min,S=h.space[0]==="h"?eS.max:QA.max;return G=Array(3),G[0]=Math.min(Math.max(h.values[0],b[0]),S[0]),G[1]=Math.min(Math.max(h.values[1],b[1]),S[1]),G[2]=Math.min(Math.max(h.values[2],b[2]),S[2]),h.space[0]==="h"&&(G=eS.rgb(G)),G.push(Math.min(Math.max(h.alpha,0),1)),G}var mD=si({"node_modules/color-rgba/index.js"(){vD(),IC(),dD()}}),zC=Ge({"src/traces/parcoords/helpers.js"($){var G=yn().isTypedArray;$.convertTypedArray=function(h){return G(h)?Array.prototype.slice.call(h):h},$.isOrdinal=function(h){return!!h.tickvals},$.isVisible=function(h){return h.visible||!("visible"in h)}}}),gD=Ge({"src/traces/parcoords/lines.js"($,G){var h=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` +`),Fn;if(yr&&(Fn=$h(nn),yr[Fn]))return yr[Fn].apply(null,ca);var ta=Function.apply(null,Ln.concat(nn));return yr&&(yr[Fn]=ta),ta.apply(null,ca)}return{global:Za,link:mn,block:za,proc:yi,scope:Ia,cond:Da,compile:Ga}}var Ha="xyzw".split(""),bi=5121,Qa=1,Na=2,Yi=0,No=1,Do=2,Go=3,jo=4,Wi=5,Li=6,ns="dither",Bs="blend.enable",Al="blend.color",Zl="blend.equation",Ml="blend.func",Wl="depth.enable",rl="depth.func",Cu="depth.range",Mu="depth.mask",Hl="colorMask",yo="cull.enable",ys="cull.face",zl="frontFace",ml="lineWidth",yc="polygonOffset.enable",_c="polygonOffset.offset",Ac="sample.alpha",$f="sample.enable",xc="sample.coverage",Lf="stencil.enable",Lu="stencil.mask",Pf="stencil.func",Xo="stencil.opFront",as="stencil.opBack",Rf="scissor.enable",$c="scissor.box",Nc="viewport",Ue="profile",P="framebuffer",oe="vert",Me="frag",Ce="elements",Be="primitive",_t="count",kt="offset",Xt="instances",fr="vao",Ar="Width",Lr="Height",tn=P+Ar,xn=P+Lr,Ze=Nc+Ar,tt=Nc+Lr,vt="drawingBuffer",bt=vt+Ar,zt=vt+Lr,Et=[Ml,Zl,Pf,Xo,as,xc,Nc,$c,_c],Ut=34962,gr=34963,Tr=2884,Pr=3042,Yr=3024,sn=2960,En=2929,Pn=3089,Xn=32823,Ta=32926,ri=32928,Wa=5126,ni=35664,$i=35665,bo=35666,vo=5124,Wo=35667,Ks=35668,Js=35669,Es=35670,il=35671,mu=35672,ou=35673,ks=35674,Cs=35675,Ru=35676,uc=35678,Uc=35680,ge=4,Oe=1028,rt=1029,wt=2304,St=2305,It=32775,tr=32776,er=519,_r=7680,Zr=0,Xr=1,dn=32774,Mn=513,Cn=36160,La=36064,zn={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},ea={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},sa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Sa={cw:wt,ccw:St};function Ra(mt){return Array.isArray(mt)||Sr(mt)||Ur(mt)}function oa(mt){return mt.sort(function(yr,wr){return yr===Nc?-1:wr===Nc?1:yr=1,Ln>=2,yr)}else if(wr===jo){var ca=mt.data;return new ai(ca.thisDep,ca.contextDep,ca.propDep,yr)}else{if(wr===Wi)return new ai(!1,!1,!1,yr);if(wr===Li){for(var yn=!1,mn=!1,za=!1,Ia=0;Ia=1&&(mn=!0),Za>=2&&(za=!0)}else Da.type===jo&&(yn=yn||Da.data.thisDep,mn=mn||Da.data.contextDep,za=za||Da.data.propDep)}return new ai(yn,mn,za,yr)}else return new ai(wr===Go,wr===Do,wr===No,yr)}}var _o=new ai(!1,!1,!1,function(){});function ko(mt,yr,wr,Ln,ca,yn,mn,za,Ia,Da,Za,Fi,yi,Ga,ma,nn){var Fn=Da.Record,ta={add:32774,subtract:32778,"reverse subtract":32779};wr.ext_blend_minmax&&(ta.min=It,ta.max=tr);var ya=wr.angle_instanced_arrays,aa=wr.webgl_draw_buffers,ci=wr.oes_vertex_array_object,Ua={dirty:!0,profile:nn.profile},Ri={},ia=[],Yn={},ii={};function Dn($e){return $e.replace(".","_")}function $a($e,it,Tt){var $t=Dn($e);ia.push($e),Ri[$t]=Ua[$t]=!!Tt,Yn[$t]=it}function Oa($e,it,Tt){var $t=Dn($e);ia.push($e),Array.isArray(Tt)?(Ua[$t]=Tt.slice(),Ri[$t]=Tt.slice()):Ua[$t]=Ri[$t]=Tt,ii[$t]=it}function zi($e){return!!isNaN($e)}$a(ns,Yr),$a(Bs,Pr),Oa(Al,"blendColor",[0,0,0,0]),Oa(Zl,"blendEquationSeparate",[dn,dn]),Oa(Ml,"blendFuncSeparate",[Xr,Zr,Xr,Zr]),$a(Wl,En,!0),Oa(rl,"depthFunc",Mn),Oa(Cu,"depthRange",[0,1]),Oa(Mu,"depthMask",!0),Oa(Hl,Hl,[!0,!0,!0,!0]),$a(yo,Tr),Oa(ys,"cullFace",rt),Oa(zl,zl,St),Oa(ml,ml,1),$a(yc,Xn),Oa(_c,"polygonOffset",[0,0]),$a(Ac,Ta),$a($f,ri),Oa(xc,"sampleCoverage",[1,!1]),$a(Lf,sn),Oa(Lu,"stencilMask",-1),Oa(Pf,"stencilFunc",[er,0,-1]),Oa(Xo,"stencilOpSeparate",[Oe,_r,_r,_r]),Oa(as,"stencilOpSeparate",[rt,_r,_r,_r]),$a(Rf,Pn),Oa($c,"scissor",[0,0,mt.drawingBufferWidth,mt.drawingBufferHeight]),Oa(Nc,Nc,[0,0,mt.drawingBufferWidth,mt.drawingBufferHeight]);var Lo={gl:mt,context:yi,strings:yr,next:Ri,current:Ua,draw:Fi,elements:yn,buffer:ca,shader:Za,attributes:Da.state,vao:Da,uniforms:Ia,framebuffer:za,extensions:wr,timer:Ga,isBufferArgs:Ra},_i={primTypes:Hn,compareFuncs:ea,blendFuncs:zn,blendEquations:ta,stencilOps:sa,glTypes:kn,orientationType:Sa};aa&&(_i.backBuffer=[rt],_i.drawBuffer=m(Ln.maxDrawbuffers,function($e){return $e===0?[0]:m($e,function(it){return La+it})}));var ji=0;function Ya(){var $e=Ni({cache:ma}),it=$e.link,Tt=$e.global;$e.id=ji++,$e.batchId="0";var $t=it(Lo),Ht=$e.shared={props:"a0"};Object.keys(Lo).forEach(function(Zt){Ht[Zt]=Tt.def($t,".",Zt)});var Jt=$e.next={},ir=$e.current={};Object.keys(ii).forEach(function(Zt){Array.isArray(Ua[Zt])&&(Jt[Zt]=Tt.def(Ht.next,".",Zt),ir[Zt]=Tt.def(Ht.current,".",Zt))});var rr=$e.constants={};Object.keys(_i).forEach(function(Zt){rr[Zt]=Tt.def(JSON.stringify(_i[Zt]))}),$e.invoke=function(Zt,Gt){switch(Gt.type){case Yi:var Or=["this",Ht.context,Ht.props,$e.batchId];return Zt.def(it(Gt.data),".call(",Or.slice(0,Math.max(Gt.data.length+1,4)),")");case No:return Zt.def(Ht.props,Gt.data);case Do:return Zt.def(Ht.context,Gt.data);case Go:return Zt.def("this",Gt.data);case jo:return Gt.data.append($e,Zt),Gt.data.ref;case Wi:return Gt.data.toString();case Li:return Gt.data.map(function(Wr){return $e.invoke(Zt,Wr)})}},$e.attribCache={};var Bt={};return $e.scopeAttrib=function(Zt){var Gt=yr.id(Zt);if(Gt in Bt)return Bt[Gt];var Or=Da.scope[Gt];Or||(Or=Da.scope[Gt]=new Fn);var Wr=Bt[Gt]=it(Or);return Wr},$e}function To($e){var it=$e.static,Tt=$e.dynamic,$t;if(Ue in it){var Ht=!!it[Ue];$t=Di(function(ir,rr){return Ht}),$t.enable=Ht}else if(Ue in Tt){var Jt=Tt[Ue];$t=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}return $t}function qo($e,it){var Tt=$e.static,$t=$e.dynamic;if(P in Tt){var Ht=Tt[P];return Ht?(Ht=za.getFramebuffer(Ht),Di(function(ir,rr){var Bt=ir.link(Ht),Zt=ir.shared;rr.set(Zt.framebuffer,".next",Bt);var Gt=Zt.context;return rr.set(Gt,"."+tn,Bt+".width"),rr.set(Gt,"."+xn,Bt+".height"),Bt})):Di(function(ir,rr){var Bt=ir.shared;rr.set(Bt.framebuffer,".next","null");var Zt=Bt.context;return rr.set(Zt,"."+tn,Zt+"."+bt),rr.set(Zt,"."+xn,Zt+"."+zt),"null"})}else if(P in $t){var Jt=$t[P];return Vi(Jt,function(ir,rr){var Bt=ir.invoke(rr,Jt),Zt=ir.shared,Gt=Zt.framebuffer,Or=rr.def(Gt,".getFramebuffer(",Bt,")");rr.set(Gt,".next",Or);var Wr=Zt.context;return rr.set(Wr,"."+tn,Or+"?"+Or+".width:"+Wr+"."+bt),rr.set(Wr,"."+xn,Or+"?"+Or+".height:"+Wr+"."+zt),Or})}else return null}function Qo($e,it,Tt){var $t=$e.static,Ht=$e.dynamic;function Jt(Bt){if(Bt in $t){var Zt=$t[Bt],Gt=!0,Or=Zt.x|0,Wr=Zt.y|0,hn,la;return"width"in Zt?hn=Zt.width|0:Gt=!1,"height"in Zt?la=Zt.height|0:Gt=!1,new ai(!Gt&&it&&it.thisDep,!Gt&&it&&it.contextDep,!Gt&&it&&it.propDep,function(ua,da){var Pa=ua.shared.context,fa=hn;"width"in Zt||(fa=da.def(Pa,".",tn,"-",Or));var Fa=la;return"height"in Zt||(Fa=da.def(Pa,".",xn,"-",Wr)),[Or,Wr,fa,Fa]})}else if(Bt in Ht){var Zn=Ht[Bt],Gn=Vi(Zn,function(ua,da){var Pa=ua.invoke(da,Zn),fa=ua.shared.context,Fa=da.def(Pa,".x|0"),Ka=da.def(Pa,".y|0"),wi=da.def('"width" in ',Pa,"?",Pa,".width|0:","(",fa,".",tn,"-",Fa,")"),qi=da.def('"height" in ',Pa,"?",Pa,".height|0:","(",fa,".",xn,"-",Ka,")");return[Fa,Ka,wi,qi]});return it&&(Gn.thisDep=Gn.thisDep||it.thisDep,Gn.contextDep=Gn.contextDep||it.contextDep,Gn.propDep=Gn.propDep||it.propDep),Gn}else return it?new ai(it.thisDep,it.contextDep,it.propDep,function(ua,da){var Pa=ua.shared.context;return[0,0,da.def(Pa,".",tn),da.def(Pa,".",xn)]}):null}var ir=Jt(Nc);if(ir){var rr=ir;ir=new ai(ir.thisDep,ir.contextDep,ir.propDep,function(Bt,Zt){var Gt=rr.append(Bt,Zt),Or=Bt.shared.context;return Zt.set(Or,"."+Ze,Gt[2]),Zt.set(Or,"."+tt,Gt[3]),Gt})}return{viewport:ir,scissor_box:Jt($c)}}function fl($e,it){var Tt=$e.static,$t=typeof Tt[Me]=="string"&&typeof Tt[oe]=="string";if($t){if(Object.keys(it.dynamic).length>0)return null;var Ht=it.static,Jt=Object.keys(Ht);if(Jt.length>0&&typeof Ht[Jt[0]]=="number"){for(var ir=[],rr=0;rr"+Fa+"?"+Gt+".constant["+Fa+"]:0;"}).join(""),"}}else{","if(",hn,"(",Gt,".buffer)){",ua,"=",la,".createStream(",Ut,",",Gt,".buffer);","}else{",ua,"=",la,".getBuffer(",Gt,".buffer);","}",da,'="type" in ',Gt,"?",Wr.glTypes,"[",Gt,".type]:",ua,".dtype;",Zn.normalized,"=!!",Gt,".normalized;");function Pa(fa){Zt(Zn[fa],"=",Gt,".",fa,"|0;")}return Pa("size"),Pa("offset"),Pa("stride"),Pa("divisor"),Zt("}}"),Zt.exit("if(",Zn.isStream,"){",la,".destroyStream(",ua,");","}"),Zn}Ht[Jt]=Vi(ir,rr)}),Ht}function Qu($e){var it=$e.static,Tt=$e.dynamic,$t={};return Object.keys(it).forEach(function(Ht){var Jt=it[Ht];$t[Ht]=Di(function(ir,rr){return typeof Jt=="number"||typeof Jt=="boolean"?""+Jt:ir.link(Jt)})}),Object.keys(Tt).forEach(function(Ht){var Jt=Tt[Ht];$t[Ht]=Vi(Jt,function(ir,rr){return ir.invoke(rr,Jt)})}),$t}function _f($e,it,Tt,$t,Ht){$e.static,$e.dynamic;var Jt=fl($e,it),ir=qo($e),rr=Qo($e,ir),Bt=Eu($e),Zt=el($e),Gt=es($e,Ht,Jt);function Or(ua){var da=rr[ua];da&&(Zt[ua]=da)}Or(Nc),Or(Dn($c));var Wr=Object.keys(Zt).length>0,hn={framebuffer:ir,draw:Bt,shader:Gt,state:Zt,dirty:Wr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(hn.profile=To($e),hn.uniforms=gu(Tt),hn.drawVAO=hn.scopeVAO=Bt.vao,!hn.drawVAO&&Gt.program&&!Jt&&wr.angle_instanced_arrays&&Bt.static.elements){var la=!0,Zn=Gt.program.attributes.map(function(ua){var da=it.static[ua];return la=la&&!!da,da});if(la&&Zn.length>0){var Gn=Da.getVAO(Da.createVAO({attributes:Zn,elements:Bt.static.elements}));hn.drawVAO=new ai(null,null,null,function(ua,da){return ua.link(Gn)}),hn.useVAO=!0}}return Jt?hn.useVAO=!0:hn.attributes=Fu(it),hn.context=Qu($t),hn}function nu($e,it,Tt){var $t=$e.shared,Ht=$t.context,Jt=$e.scope();Object.keys(Tt).forEach(function(ir){it.save(Ht,"."+ir);var rr=Tt[ir],Bt=rr.append($e,it);Array.isArray(Bt)?Jt(Ht,".",ir,"=[",Bt.join(),"];"):Jt(Ht,".",ir,"=",Bt,";")}),it(Jt)}function du($e,it,Tt,$t){var Ht=$e.shared,Jt=Ht.gl,ir=Ht.framebuffer,rr;aa&&(rr=it.def(Ht.extensions,".webgl_draw_buffers"));var Bt=$e.constants,Zt=Bt.drawBuffer,Gt=Bt.backBuffer,Or;Tt?Or=Tt.append($e,it):Or=it.def(ir,".next"),$t||it("if(",Or,"!==",ir,".cur){"),it("if(",Or,"){",Jt,".bindFramebuffer(",Cn,",",Or,".framebuffer);"),aa&&it(rr,".drawBuffersWEBGL(",Zt,"[",Or,".colorAttachments.length]);"),it("}else{",Jt,".bindFramebuffer(",Cn,",null);"),aa&&it(rr,".drawBuffersWEBGL(",Gt,");"),it("}",ir,".cur=",Or,";"),$t||it("}")}function ho($e,it,Tt){var $t=$e.shared,Ht=$t.gl,Jt=$e.current,ir=$e.next,rr=$t.current,Bt=$t.next,Zt=$e.cond(rr,".dirty");ia.forEach(function(Gt){var Or=Dn(Gt);if(!(Or in Tt.state)){var Wr,hn;if(Or in ir){Wr=ir[Or],hn=Jt[Or];var la=m(Ua[Or].length,function(Gn){return Zt.def(Wr,"[",Gn,"]")});Zt($e.cond(la.map(function(Gn,ua){return Gn+"!=="+hn+"["+ua+"]"}).join("||")).then(Ht,".",ii[Or],"(",la,");",la.map(function(Gn,ua){return hn+"["+ua+"]="+Gn}).join(";"),";"))}else{Wr=Zt.def(Bt,".",Or);var Zn=$e.cond(Wr,"!==",rr,".",Or);Zt(Zn),Or in Yn?Zn($e.cond(Wr).then(Ht,".enable(",Yn[Or],");").else(Ht,".disable(",Yn[Or],");"),rr,".",Or,"=",Wr,";"):Zn(Ht,".",ii[Or],"(",Wr,");",rr,".",Or,"=",Wr,";")}}}),Object.keys(Tt.state).length===0&&Zt(rr,".dirty=false;"),it(Zt)}function ec($e,it,Tt,$t){var Ht=$e.shared,Jt=$e.current,ir=Ht.current,rr=Ht.gl,Bt;oa(Object.keys(Tt)).forEach(function(Zt){var Gt=Tt[Zt];if(!($t&&!$t(Gt))){var Or=Gt.append($e,it);if(Yn[Zt]){var Wr=Yn[Zt];Zi(Gt)?(Bt=$e.link(Or,{stable:!0}),it($e.cond(Bt).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Zt,"=",Bt,";")):(it($e.cond(Or).then(rr,".enable(",Wr,");").else(rr,".disable(",Wr,");")),it(ir,".",Zt,"=",Or,";"))}else if(jn(Or)){var hn=Jt[Zt];it(rr,".",ii[Zt],"(",Or,");",Or.map(function(la,Zn){return hn+"["+Zn+"]="+la}).join(";"),";")}else Zi(Gt)?(Bt=$e.link(Or,{stable:!0}),it(rr,".",ii[Zt],"(",Bt,");",ir,".",Zt,"=",Bt,";")):it(rr,".",ii[Zt],"(",Or,");",ir,".",Zt,"=",Or,";")}})}function qs($e,it){ya&&($e.instancing=it.def($e.shared.extensions,".angle_instanced_arrays"))}function Fl($e,it,Tt,$t,Ht){var Jt=$e.shared,ir=$e.stats,rr=Jt.current,Bt=Jt.timer,Zt=Tt.profile;function Gt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Or,Wr;function hn(Pa){Or=it.def(),Pa(Or,"=",Gt(),";"),typeof Ht=="string"?Pa(ir,".count+=",Ht,";"):Pa(ir,".count++;"),Ga&&($t?(Wr=it.def(),Pa(Wr,"=",Bt,".getNumPendingQueries();")):Pa(Bt,".beginQuery(",ir,");"))}function la(Pa){Pa(ir,".cpuTime+=",Gt(),"-",Or,";"),Ga&&($t?Pa(Bt,".pushScopeStats(",Wr,",",Bt,".getNumPendingQueries(),",ir,");"):Pa(Bt,".endQuery();"))}function Zn(Pa){var fa=it.def(rr,".profile");it(rr,".profile=",Pa,";"),it.exit(rr,".profile=",fa,";")}var Gn;if(Zt){if(Zi(Zt)){Zt.enable?(hn(it),la(it.exit),Zn("true")):Zn("false");return}Gn=Zt.append($e,it),Zn(Gn)}else Gn=it.def(rr,".profile");var ua=$e.block();hn(ua),it("if(",Gn,"){",ua,"}");var da=$e.block();la(da),it.exit("if(",Gn,"){",da,"}")}function dc($e,it,Tt,$t,Ht){var Jt=$e.shared;function ir(Bt){switch(Bt){case ni:case Wo:case il:return 2;case $i:case Ks:case mu:return 3;case bo:case Js:case ou:return 4;default:return 1}}function rr(Bt,Zt,Gt){var Or=Jt.gl,Wr=it.def(Bt,".location"),hn=it.def(Jt.attributes,"[",Wr,"]"),la=Gt.state,Zn=Gt.buffer,Gn=[Gt.x,Gt.y,Gt.z,Gt.w],ua=["buffer","normalized","offset","stride"];function da(){it("if(!",hn,".buffer){",Or,".enableVertexAttribArray(",Wr,");}");var fa=Gt.type,Fa;if(Gt.size?Fa=it.def(Gt.size,"||",Zt):Fa=Zt,it("if(",hn,".type!==",fa,"||",hn,".size!==",Fa,"||",ua.map(function(wi){return hn+"."+wi+"!=="+Gt[wi]}).join("||"),"){",Or,".bindBuffer(",Ut,",",Zn,".buffer);",Or,".vertexAttribPointer(",[Wr,Fa,fa,Gt.normalized,Gt.stride,Gt.offset],");",hn,".type=",fa,";",hn,".size=",Fa,";",ua.map(function(wi){return hn+"."+wi+"="+Gt[wi]+";"}).join(""),"}"),ya){var Ka=Gt.divisor;it("if(",hn,".divisor!==",Ka,"){",$e.instancing,".vertexAttribDivisorANGLE(",[Wr,Ka],");",hn,".divisor=",Ka,";}")}}function Pa(){it("if(",hn,".buffer){",Or,".disableVertexAttribArray(",Wr,");",hn,".buffer=null;","}if(",Ha.map(function(fa,Fa){return hn+"."+fa+"!=="+Gn[Fa]}).join("||"),"){",Or,".vertexAttrib4f(",Wr,",",Gn,");",Ha.map(function(fa,Fa){return hn+"."+fa+"="+Gn[Fa]+";"}).join(""),"}")}la===Qa?da():la===Na?Pa():(it("if(",la,"===",Qa,"){"),da(),it("}else{"),Pa(),it("}"))}$t.forEach(function(Bt){var Zt=Bt.name,Gt=Tt.attributes[Zt],Or;if(Gt){if(!Ht(Gt))return;Or=Gt.append($e,it)}else{if(!Ht(_o))return;var Wr=$e.scopeAttrib(Zt);Or={},Object.keys(new Fn).forEach(function(hn){Or[hn]=it.def(Wr,".",hn)})}rr($e.link(Bt),ir(Bt.info.type),Or)})}function vc($e,it,Tt,$t,Ht,Jt){for(var ir=$e.shared,rr=ir.gl,Bt,Zt=0;Zt<$t.length;++Zt){var Gt=$t[Zt],Or=Gt.name,Wr=Gt.info.type,hn=Tt.uniforms[Or],la=$e.link(Gt),Zn=la+".location",Gn;if(hn){if(!Ht(hn))continue;if(Zi(hn)){var ua=hn.value;if(Wr===uc||Wr===Uc){var da=$e.link(ua._texture||ua.color[0]._texture);it(rr,".uniform1i(",Zn,",",da+".bind());"),it.exit(da,".unbind();")}else if(Wr===ks||Wr===Cs||Wr===Ru){var Pa=$e.global.def("new Float32Array(["+Array.prototype.slice.call(ua)+"])"),fa=2;Wr===Cs?fa=3:Wr===Ru&&(fa=4),it(rr,".uniformMatrix",fa,"fv(",Zn,",false,",Pa,");")}else{switch(Wr){case Wa:Bt="1f";break;case ni:Bt="2f";break;case $i:Bt="3f";break;case bo:Bt="4f";break;case Es:Bt="1i";break;case vo:Bt="1i";break;case il:Bt="2i";break;case Wo:Bt="2i";break;case mu:Bt="3i";break;case Ks:Bt="3i";break;case ou:Bt="4i";break;case Js:Bt="4i";break}it(rr,".uniform",Bt,"(",Zn,",",jn(ua)?Array.prototype.slice.call(ua):ua,");")}continue}else Gn=hn.append($e,it)}else{if(!Ht(_o))continue;Gn=it.def(ir.uniforms,"[",yr.id(Or),"]")}Wr===uc?it("if(",Gn,"&&",Gn,'._reglType==="framebuffer"){',Gn,"=",Gn,".color[0];","}"):Wr===Uc&&it("if(",Gn,"&&",Gn,'._reglType==="framebufferCube"){',Gn,"=",Gn,".color[0];","}");var Fa=1;switch(Wr){case uc:case Uc:var Ka=it.def(Gn,"._texture");it(rr,".uniform1i(",Zn,",",Ka,".bind());"),it.exit(Ka,".unbind();");continue;case vo:case Es:Bt="1i";break;case Wo:case il:Bt="2i",Fa=2;break;case Ks:case mu:Bt="3i",Fa=3;break;case Js:case ou:Bt="4i",Fa=4;break;case Wa:Bt="1f";break;case ni:Bt="2f",Fa=2;break;case $i:Bt="3f",Fa=3;break;case bo:Bt="4f",Fa=4;break;case ks:Bt="Matrix2fv";break;case Cs:Bt="Matrix3fv";break;case Ru:Bt="Matrix4fv";break}if(Bt.charAt(0)==="M"){it(rr,".uniform",Bt,"(",Zn,",");var wi=Math.pow(Wr-ks+2,2),qi=$e.global.def("new Float32Array(",wi,")");Array.isArray(Gn)?it("false,(",m(wi,function(xl){return qi+"["+xl+"]="+Gn[xl]}),",",qi,")"):it("false,(Array.isArray(",Gn,")||",Gn," instanceof Float32Array)?",Gn,":(",m(wi,function(xl){return qi+"["+xl+"]="+Gn+"["+xl+"]"}),",",qi,")"),it(");")}else if(Fa>1){for(var xs=[],ps=[],yl=0;yl>1)",Zn],");")}function Ka(){Tt(Gn,".drawArraysInstancedANGLE(",[Wr,hn,la,Zn],");")}Gt&&Gt!=="null"?da?Fa():(Tt("if(",Gt,"){"),Fa(),Tt("}else{"),Ka(),Tt("}")):Ka()}function fa(){function Fa(){Tt(Jt+".drawElements("+[Wr,la,ua,hn+"<<(("+ua+"-"+bi+")>>1)"]+");")}function Ka(){Tt(Jt+".drawArrays("+[Wr,hn,la]+");")}Gt&&Gt!=="null"?da?Fa():(Tt("if(",Gt,"){"),Fa(),Tt("}else{"),Ka(),Tt("}")):Ka()}ya&&(typeof Zn!="number"||Zn>=0)?typeof Zn=="string"?(Tt("if(",Zn,">0){"),Pa(),Tt("}else if(",Zn,"<0){"),fa(),Tt("}")):Pa():fa()}function ds($e,it,Tt,$t,Ht){var Jt=Ya(),ir=Jt.proc("body",Ht);return ya&&(Jt.instancing=ir.def(Jt.shared.extensions,".angle_instanced_arrays")),$e(Jt,ir,Tt,$t),Jt.compile().body}function _s($e,it,Tt,$t){qs($e,it),Tt.useVAO?Tt.drawVAO?it($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,it),");"):it($e.shared.vao,".setVAO(",$e.shared.vao,".targetVAO);"):(it($e.shared.vao,".setVAO(null);"),dc($e,it,Tt,$t.attributes,function(){return!0})),vc($e,it,Tt,$t.uniforms,function(){return!0},!1),Co($e,it,it,Tt)}function be($e,it){var Tt=$e.proc("draw",1);qs($e,Tt),nu($e,Tt,it.context),du($e,Tt,it.framebuffer),ho($e,Tt,it),ec($e,Tt,it.state),Fl($e,Tt,it,!1,!0);var $t=it.shader.progVar.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",$t,".program);"),it.shader.program)_s($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Ht=$e.global.def("{}"),Jt=Tt.def($t,".id"),ir=Tt.def(Ht,"[",Jt,"]");Tt($e.cond(ir).then(ir,".call(this,a0);").else(ir,"=",Ht,"[",Jt,"]=",$e.link(function(rr){return ds(_s,$e,it,rr,1)}),"(",$t,");",ir,".call(this,a0);"))}Object.keys(it.state).length>0&&Tt($e.shared.current,".dirty=true;"),$e.shared.vao&&Tt($e.shared.vao,".setVAO(null);")}function q($e,it,Tt,$t){$e.batchId="a1",qs($e,it);function Ht(){return!0}dc($e,it,Tt,$t.attributes,Ht),vc($e,it,Tt,$t.uniforms,Ht,!1),Co($e,it,it,Tt)}function he($e,it,Tt,$t){qs($e,it);var Ht=Tt.contextDep,Jt=it.def(),ir="a0",rr="a1",Bt=it.def();$e.shared.props=Bt,$e.batchId=Jt;var Zt=$e.scope(),Gt=$e.scope();it(Zt.entry,"for(",Jt,"=0;",Jt,"<",rr,";++",Jt,"){",Bt,"=",ir,"[",Jt,"];",Gt,"}",Zt.exit);function Or(ua){return ua.contextDep&&Ht||ua.propDep}function Wr(ua){return!Or(ua)}if(Tt.needsContext&&nu($e,Gt,Tt.context),Tt.needsFramebuffer&&du($e,Gt,Tt.framebuffer),ec($e,Gt,Tt.state,Or),Tt.profile&&Or(Tt.profile)&&Fl($e,Gt,Tt,!1,!0),$t)Tt.useVAO?Tt.drawVAO?Or(Tt.drawVAO)?Gt($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Gt),");"):Zt($e.shared.vao,".setVAO(",Tt.drawVAO.append($e,Zt),");"):Zt($e.shared.vao,".setVAO(",$e.shared.vao,".targetVAO);"):(Zt($e.shared.vao,".setVAO(null);"),dc($e,Zt,Tt,$t.attributes,Wr),dc($e,Gt,Tt,$t.attributes,Or)),vc($e,Zt,Tt,$t.uniforms,Wr,!1),vc($e,Gt,Tt,$t.uniforms,Or,!0),Co($e,Zt,Gt,Tt);else{var hn=$e.global.def("{}"),la=Tt.shader.progVar.append($e,Gt),Zn=Gt.def(la,".id"),Gn=Gt.def(hn,"[",Zn,"]");Gt($e.shared.gl,".useProgram(",la,".program);","if(!",Gn,"){",Gn,"=",hn,"[",Zn,"]=",$e.link(function(ua){return ds(q,$e,Tt,ua,2)}),"(",la,");}",Gn,".call(this,a0[",Jt,"],",Jt,");")}}function J($e,it){var Tt=$e.proc("batch",2);$e.batchId="0",qs($e,Tt);var $t=!1,Ht=!0;Object.keys(it.context).forEach(function(hn){$t=$t||it.context[hn].propDep}),$t||(nu($e,Tt,it.context),Ht=!1);var Jt=it.framebuffer,ir=!1;Jt?(Jt.propDep?$t=ir=!0:Jt.contextDep&&$t&&(ir=!0),ir||du($e,Tt,Jt)):du($e,Tt,null),it.state.viewport&&it.state.viewport.propDep&&($t=!0);function rr(hn){return hn.contextDep&&$t||hn.propDep}ho($e,Tt,it),ec($e,Tt,it.state,function(hn){return!rr(hn)}),(!it.profile||!rr(it.profile))&&Fl($e,Tt,it,!1,"a1"),it.contextDep=$t,it.needsContext=Ht,it.needsFramebuffer=ir;var Bt=it.shader.progVar;if(Bt.contextDep&&$t||Bt.propDep)he($e,Tt,it,null);else{var Zt=Bt.append($e,Tt);if(Tt($e.shared.gl,".useProgram(",Zt,".program);"),it.shader.program)he($e,Tt,it,it.shader.program);else{Tt($e.shared.vao,".setVAO(null);");var Gt=$e.global.def("{}"),Or=Tt.def(Zt,".id"),Wr=Tt.def(Gt,"[",Or,"]");Tt($e.cond(Wr).then(Wr,".call(this,a0,a1);").else(Wr,"=",Gt,"[",Or,"]=",$e.link(function(hn){return ds(he,$e,it,hn,2)}),"(",Zt,");",Wr,".call(this,a0,a1);"))}}Object.keys(it.state).length>0&&Tt($e.shared.current,".dirty=true;"),$e.shared.vao&&Tt($e.shared.vao,".setVAO(null);")}function _e($e,it){var Tt=$e.proc("scope",3);$e.batchId="a2";var $t=$e.shared,Ht=$t.current;if(nu($e,Tt,it.context),it.framebuffer&&it.framebuffer.append($e,Tt),oa(Object.keys(it.state)).forEach(function(rr){var Bt=it.state[rr],Zt=Bt.append($e,Tt);jn(Zt)?Zt.forEach(function(Gt,Or){zi(Gt)?Tt.set($e.next[rr],"["+Or+"]",Gt):Tt.set($e.next[rr],"["+Or+"]",$e.link(Gt,{stable:!0}))}):Zi(Bt)?Tt.set($t.next,"."+rr,$e.link(Zt,{stable:!0})):Tt.set($t.next,"."+rr,Zt)}),Fl($e,Tt,it,!0,!0),[Ce,kt,_t,Xt,Be].forEach(function(rr){var Bt=it.draw[rr];if(Bt){var Zt=Bt.append($e,Tt);zi(Zt)?Tt.set($t.draw,"."+rr,Zt):Tt.set($t.draw,"."+rr,$e.link(Zt),{stable:!0})}}),Object.keys(it.uniforms).forEach(function(rr){var Bt=it.uniforms[rr].append($e,Tt);Array.isArray(Bt)&&(Bt="["+Bt.map(function(Zt){return zi(Zt)?Zt:$e.link(Zt,{stable:!0})})+"]"),Tt.set($t.uniforms,"["+$e.link(yr.id(rr),{stable:!0})+"]",Bt)}),Object.keys(it.attributes).forEach(function(rr){var Bt=it.attributes[rr].append($e,Tt),Zt=$e.scopeAttrib(rr);Object.keys(new Fn).forEach(function(Gt){Tt.set(Zt,"."+Gt,Bt[Gt])})}),it.scopeVAO){var Jt=it.scopeVAO.append($e,Tt);zi(Jt)?Tt.set($t.vao,".targetVAO",Jt):Tt.set($t.vao,".targetVAO",$e.link(Jt,{stable:!0}))}function ir(rr){var Bt=it.shader[rr];if(Bt){var Zt=Bt.append($e,Tt);zi(Zt)?Tt.set($t.shader,"."+rr,Zt):Tt.set($t.shader,"."+rr,$e.link(Zt,{stable:!0}))}}ir(oe),ir(Me),Object.keys(it.state).length>0&&(Tt(Ht,".dirty=true;"),Tt.exit(Ht,".dirty=true;")),Tt("a1(",$e.shared.context,",a0,",$e.batchId,");")}function qe($e){if(!(typeof $e!="object"||jn($e))){for(var it=Object.keys($e),Tt=0;Tt=0;--Co){var ds=zi[Co];ds&&ds(Ga,null,0)}wr.flush(),Da&&Da.update()}function qo(){!Ya&&zi.length>0&&(Ya=c.next(To))}function Qo(){Ya&&(c.cancel(To),Ya=null)}function fl(Co){Co.preventDefault(),Qo(),Lo.forEach(function(ds){ds()})}function es(Co){wr.getError(),ca.restore(),Ua.restore(),ta.restore(),Ri.restore(),ia.restore(),Yn.restore(),aa.restore(),Da&&Da.restore(),ii.procs.refresh(),qo(),_i.forEach(function(ds){ds()})}Oa&&(Oa.addEventListener($l,fl,!1),Oa.addEventListener(Ol,es,!1));function Eu(){zi.length=0,Qo(),Oa&&(Oa.removeEventListener($l,fl),Oa.removeEventListener(Ol,es)),Ua.clear(),Yn.clear(),ia.clear(),aa.clear(),Ri.clear(),ya.clear(),ta.clear(),Da&&Da.clear(),ji.forEach(function(Co){Co()})}function el(Co){function ds(Ht){var Jt=h({},Ht);delete Jt.uniforms,delete Jt.attributes,delete Jt.context,delete Jt.vao,"stencil"in Jt&&Jt.stencil.op&&(Jt.stencil.opBack=Jt.stencil.opFront=Jt.stencil.op,delete Jt.stencil.op);function ir(rr){if(rr in Jt){var Bt=Jt[rr];delete Jt[rr],Object.keys(Bt).forEach(function(Zt){Jt[rr+"."+Zt]=Bt[Zt]})}}return ir("blend"),ir("depth"),ir("cull"),ir("stencil"),ir("polygonOffset"),ir("scissor"),ir("sample"),"vao"in Ht&&(Jt.vao=Ht.vao),Jt}function _s(Ht,Jt){var ir={},rr={};return Object.keys(Ht).forEach(function(Bt){var Zt=Ht[Bt];if(f.isDynamic(Zt)){rr[Bt]=f.unbox(Zt,Bt);return}else if(Jt&&Array.isArray(Zt)){for(var Gt=0;Gt0)return pt.call(this,Tt(Ht|0),Ht|0)}else if(Array.isArray(Ht)){if(Ht.length)return pt.call(this,Ht,Ht.length)}else return ft.call(this,Ht)}return h($t,{stats:_e,destroy:function(){qe.destroy()}})}var gu=Yn.setFBO=el({framebuffer:f.define.call(null,Sc,"framebuffer")});function Fu(Co,ds){var _s=0;ii.procs.poll();var be=ds.color;be&&(wr.clearColor(+be[0]||0,+be[1]||0,+be[2]||0,+be[3]||0),_s|=ru),"depth"in ds&&(wr.clearDepth(+ds.depth),_s|=lo),"stencil"in ds&&(wr.clearStencil(ds.stencil|0),_s|=Ls),wr.clear(_s)}function Qu(Co){if("framebuffer"in Co)if(Co.framebuffer&&Co.framebuffer_reglType==="framebufferCube")for(var ds=0;ds<6;++ds)gu(h({framebuffer:Co.framebuffer.faces[ds]},Co),Fu);else gu(Co,Fu);else Fu(null,Co)}function _f(Co){zi.push(Co);function ds(){var _s=Kc(zi,Co);function be(){var q=Kc(zi,be);zi[q]=zi[zi.length-1],zi.length-=1,zi.length<=0&&Qo()}zi[_s]=be}return qo(),{cancel:ds}}function nu(){var Co=$a.viewport,ds=$a.scissor_box;Co[0]=Co[1]=ds[0]=ds[1]=0,Ga.viewportWidth=Ga.framebufferWidth=Ga.drawingBufferWidth=Co[2]=ds[2]=wr.drawingBufferWidth,Ga.viewportHeight=Ga.framebufferHeight=Ga.drawingBufferHeight=Co[3]=ds[3]=wr.drawingBufferHeight}function du(){Ga.tick+=1,Ga.time=ec(),nu(),ii.procs.poll()}function ho(){Ri.refresh(),nu(),ii.procs.refresh(),Da&&Da.update()}function ec(){return(p()-Za)/1e3}ho();function qs(Co,ds){var _s;switch(Co){case"frame":return _f(ds);case"lost":_s=Lo;break;case"restore":_s=_i;break;case"destroy":_s=ji;break}return _s.push(ds),{cancel:function(){for(var be=0;be<_s.length;++be)if(_s[be]===ds){_s[be]=_s[_s.length-1],_s.pop();return}}}}function Fl(){return za}function dc(Co){Object.entries(Co).forEach(function(ds){za[ds[0]]=ds[1]})}var vc=h(el,{clear:Qu,prop:f.define.bind(null,Sc),context:f.define.bind(null,El),this:f.define.bind(null,Kl),draw:el({}),buffer:function(Co){return ta.create(Co,Qs,!1,!1)},elements:function(Co){return ya.create(Co,!1)},texture:Ri.create2D,cube:Ri.createCube,renderbuffer:ia.create,framebuffer:Yn.create,framebufferCube:Yn.createCube,vao:aa.createVAO,attributes:Ln,frame:_f,on:qs,limits:Fn,hasExtension:function(Co){return Fn.extensions.indexOf(Co.toLowerCase())>=0},read:Dn,destroy:Eu,_gl:wr,_refresh:ho,poll:function(){du(),Da&&Da.update()},now:ec,stats:mn,getCachedCode:Fl,preloadCachedCode:dc});return yr.onDone(null,vc),vc}return Pu})}}),HE=Ge({"src/lib/prepare_regl.js"(K,G){var h=_C(),b=gz();G.exports=function(E,e,t){var r=E._fullLayout,o=!0;return r._glcanvas.each(function(n){if(n.regl){n.regl.preloadCachedCode(t);return}if(!(n.pick&&!r._has("parcoords"))){try{n.regl=b({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:E._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:t||{}})}catch{o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(i){E&&E.emit&&E.emit("plotly_webglcontextlost",{event:i,layer:n.key})},!1)}}),o||h({container:r._glcontainer.node()}),o}}}),uL=Ge({"src/traces/scattergl/plot.js"(f,G){var h=jC(),b=QC(),S=ez(),E=mz(),e=_n(),t=jp().selectMode,r=HE(),o=uu(),n=up(),i=BC().styleTextSelection,a={};function s(c,p,v,T){var l=c._size,g=c.width*T,x=c.height*T,A=l.l*T,M=l.b*T,_=l.r*T,w=l.t*T,m=l.w*T,u=l.h*T;return[A+p.domain[0]*m,M+v.domain[0]*u,g-_-(1-p.domain[1])*m,x-w-(1-v.domain[1])*u]}var f=G.exports=function(p,v,T){if(T.length){var l=p._fullLayout,g=v._scene,x=v.xaxis,A=v.yaxis,M,_;if(g){var w=r(p,["ANGLE_instanced_arrays","OES_element_index_uint"],a);if(!w){g.init();return}var m=g.count,u=l._glcanvas.data()[0].regl;if(n(p,v,T),g.dirty){if((g.line2d||g.error2d)&&!(g.scatter2d||g.fill2d||g.glText)&&u.clear({color:!0,depth:!0}),g.error2d===!0&&(g.error2d=S(u)),g.line2d===!0&&(g.line2d=b(u)),g.scatter2d===!0&&(g.scatter2d=h(u)),g.fill2d===!0&&(g.fill2d=b(u)),g.glText===!0)for(g.glText=new Array(m),M=0;Mg.glText.length){var d=m-g.glText.length;for(M=0;Mie&&(isNaN(ae[de])||isNaN(ae[de+1]));)de-=2;H.positions=ae.slice(ie,de+2)}return H}),g.line2d.update(g.lineOptions)),g.error2d){var L=(g.errorXOptions||[]).concat(g.errorYOptions||[]);g.error2d.update(L)}g.scatter2d&&g.scatter2d.update(g.markerOptions),g.fillOrder=e.repeat(null,m),g.fill2d&&(g.fillOptions=g.fillOptions.map(function(H,ae){var ie=T[ae];if(!(!H||!ie||!ie[0]||!ie[0].trace)){var de=ie[0],Se=de.trace,Le=de.t,Fe=g.lineOptions[ae],ze,Ye,st=[];Se._ownfill&&st.push(ae),Se._nexttrace&&st.push(ae+1),st.length&&(g.fillOrder[ae]=st);var ct=[],at=Fe&&Fe.positions||Le.positions,et,Pe;if(Se.fill==="tozeroy"){for(et=0;etet&&isNaN(at[Pe+1]);)Pe-=2;at[et+1]!==0&&(ct=[at[et],0]),ct=ct.concat(at.slice(et,Pe+2)),at[Pe+1]!==0&&(ct=ct.concat([at[Pe],0]))}else if(Se.fill==="tozerox"){for(et=0;etet&&isNaN(at[Pe]);)Pe-=2;at[et]!==0&&(ct=[0,at[et+1]]),ct=ct.concat(at.slice(et,Pe+2)),at[Pe]!==0&&(ct=ct.concat([0,at[Pe+1]]))}else if(Se.fill==="toself"||Se.fill==="tonext"){for(ct=[],ze=0,H.splitNull=!0,Ye=0;Ye-1;for(M=0;Mx&&v||gi,y;for(d?y=v.sizeAvg||Math.max(v.size,3):y=S(f,p),A=0;A{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,E(()=>{this.dirty=!1})),this)},o.prototype.update=function(...s){if(!s.length)return;for(let p=0;py||!v.lower&&d{f[T+g]=p})}this.scatter.draw(...f)}return this},o.prototype.destroy=function(){return this.traces.forEach(s=>{s.buffer&&s.buffer.destroy&&s.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function n(s,f,c){let p=s.id!=null?s.id:s,v=f,T=c;return p<<16|(v&255)<<8|T&255}function i(s,f,c){let p,v,T,l,g=s[f],x=s[c];return g.length>2?(g[0],g[2],p=g[1],v=g[3]):g.length?(p=g[0],v=g[1]):(g.x,p=g.y,g.x+g.width,v=g.y+g.height),x.length>2?(T=x[0],l=x[2],x[1],x[3]):x.length?(T=x[0],l=x[1]):(T=x.x,x.y,l=x.x+x.width,x.y+x.height),[T,p,l,v]}function a(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];{let f=t(s);return[f.x,f.y,f.x+f.width,f.y+f.height]}}}}),Ez=Ge({"src/traces/splom/plot.js"(K,G){var h=Mz(),b=_n(),S=Df(),E=jp().selectMode;G.exports=function(r,o,n){if(n.length)for(var i=0;i-1,N=E(v)||!!i.selectedpoints||F,B=!0;if(N){var R=i._length;if(i.selectedpoints){s.selectBatch=i.selectedpoints;var U=i.selectedpoints,j={};for(g=0;g=Z[re][0]&&j<=Z[re][1])return!0;return!1}function f(j){j.attr("x",-h.bar.captureWidth/2).attr("width",h.bar.captureWidth)}function c(j){j.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function p(j){if(!j.brush.filterSpecified)return"0,"+j.height;for(var Z=v(j.brush.filter.getConsolidated(),j.height),re=[0],fe,le,ce,V=Z.length?Z[0][0]:null,ee=0;eej[1]+re||Z=.9*j[1]+.1*j[0]?"n":Z<=.9*j[0]+.1*j[1]?"s":"ns"}function l(){b.select(document.body).style("cursor",null)}function g(j){j.attr("stroke-dasharray",p)}function x(j,Z){var re=b.select(j).selectAll(".highlight, .highlight-shadow"),fe=Z?re.transition().duration(h.bar.snapDuration).each("end",Z):re;g(fe)}function A(j,Z){var re=j.brush,fe=re.filterSpecified,le=NaN,ce={},V;if(fe){var ee=j.height,ne=re.filter.getConsolidated(),$=v(ne,ee),ue=NaN,te=NaN,H=NaN;for(V=0;V<=$.length;V++){var ae=$[V];if(ae&&ae[0]<=Z&&Z<=ae[1]){ue=V;break}else if(te=V?V-1:NaN,ae&&ae[0]>Z){H=V;break}}if(le=ue,isNaN(le)&&(isNaN(te)||isNaN(H)?le=isNaN(te)?H:te:le=Z-$[te][1]<$[H][0]-Z?te:H),!isNaN(le)){var ie=$[le],de=T(ie,Z);de&&(ce.interval=ne[le],ce.intervalPix=ie,ce.region=de)}}if(j.ordinal&&!ce.region){var Se=j.unitTickvals,Le=j.unitToPaddedPx.invert(Z);for(V=0;V=Fe[0]&&Le<=Fe[1]){ce.clickableOrdinalRange=Fe;break}}}return ce}function M(j,Z){b.event.sourceEvent.stopPropagation();var re=Z.height-b.mouse(j)[1]-2*h.verticalPadding,fe=Z.unitToPaddedPx.invert(re),le=Z.brush,ce=A(Z,re),V=ce.interval,ee=le.svgBrush;if(ee.wasDragged=!1,ee.grabbingBar=ce.region==="ns",ee.grabbingBar){var ne=V.map(Z.unitToPaddedPx);ee.grabPoint=re-ne[0]-h.verticalPadding,ee.barLength=ne[1]-ne[0]}ee.clickableOrdinalRange=ce.clickableOrdinalRange,ee.stayingIntervals=Z.multiselect&&le.filterSpecified?le.filter.getConsolidated():[],V&&(ee.stayingIntervals=ee.stayingIntervals.filter(function($){return $[0]!==V[0]&&$[1]!==V[1]})),ee.startExtent=ce.region?V[ce.region==="s"?1:0]:fe,Z.parent.inBrushDrag=!0,ee.brushStartCallback()}function _(j,Z){b.event.sourceEvent.stopPropagation();var re=Z.height-b.mouse(j)[1]-2*h.verticalPadding,fe=Z.brush.svgBrush;fe.wasDragged=!0,fe._dragging=!0,fe.grabbingBar?fe.newExtent=[re-fe.grabPoint,re+fe.barLength-fe.grabPoint].map(Z.unitToPaddedPx.invert):fe.newExtent=[fe.startExtent,Z.unitToPaddedPx.invert(re)].sort(e),Z.brush.filterSpecified=!0,fe.extent=fe.stayingIntervals.concat([fe.newExtent]),fe.brushCallback(Z),x(j.parentNode)}function w(j,Z){var re=Z.brush,fe=re.filter,le=re.svgBrush;le._dragging||(m(j,Z),_(j,Z),Z.brush.svgBrush.wasDragged=!1),le._dragging=!1;var ce=b.event;ce.sourceEvent.stopPropagation();var V=le.grabbingBar;if(le.grabbingBar=!1,le.grabLocation=void 0,Z.parent.inBrushDrag=!1,l(),!le.wasDragged){le.wasDragged=void 0,le.clickableOrdinalRange?re.filterSpecified&&Z.multiselect?le.extent.push(le.clickableOrdinalRange):(le.extent=[le.clickableOrdinalRange],re.filterSpecified=!0):V?(le.extent=le.stayingIntervals,le.extent.length===0&&z(re)):z(re),le.brushCallback(Z),x(j.parentNode),le.brushEndCallback(re.filterSpecified?fe.getConsolidated():[]);return}var ee=function(){fe.set(fe.getConsolidated())};if(Z.ordinal){var ne=Z.unitTickvals;ne[ne.length-1]le.newExtent[0];le.extent=le.stayingIntervals.concat($?[le.newExtent]:[]),le.extent.length||z(re),le.brushCallback(Z),$?x(j.parentNode,ee):(ee(),x(j.parentNode))}else ee();le.brushEndCallback(re.filterSpecified?fe.getConsolidated():[])}function m(j,Z){var re=Z.height-b.mouse(j)[1]-2*h.verticalPadding,fe=A(Z,re),le="crosshair";fe.clickableOrdinalRange?le="pointer":fe.region&&(le=fe.region+"-resize"),b.select(document.body).style("cursor",le)}function u(j){j.on("mousemove",function(Z){b.event.preventDefault(),Z.parent.inBrushDrag||m(this,Z)}).on("mouseleave",function(Z){Z.parent.inBrushDrag||l()}).call(b.behavior.drag().on("dragstart",function(Z){M(this,Z)}).on("drag",function(Z){_(this,Z)}).on("dragend",function(Z){w(this,Z)}))}function d(j,Z){return j[0]-Z[0]}function y(j,Z,re){var fe=re._context.staticPlot,le=j.selectAll(".background").data(E);le.enter().append("rect").classed("background",!0).call(f).call(c).style("pointer-events",fe?"none":"auto").attr("transform",t(0,h.verticalPadding)),le.call(u).attr("height",function(ee){return ee.height-h.verticalPadding});var ce=j.selectAll(".highlight-shadow").data(E);ce.enter().append("line").classed("highlight-shadow",!0).attr("x",-h.bar.width/2).attr("stroke-width",h.bar.width+h.bar.strokeWidth).attr("stroke",Z).attr("opacity",h.bar.strokeOpacity).attr("stroke-linecap","butt"),ce.attr("y1",function(ee){return ee.height}).call(g);var V=j.selectAll(".highlight").data(E);V.enter().append("line").classed("highlight",!0).attr("x",-h.bar.width/2).attr("stroke-width",h.bar.width-h.bar.strokeWidth).attr("stroke",h.bar.fillColor).attr("opacity",h.bar.fillOpacity).attr("stroke-linecap","butt"),V.attr("y1",function(ee){return ee.height}).call(g)}function I(j,Z,re){var fe=j.selectAll("."+h.cn.axisBrush).data(E,S);fe.enter().append("g").classed(h.cn.axisBrush,!0),y(fe,Z,re)}function L(j){return j.svgBrush.extent.map(function(Z){return Z.slice()})}function z(j){j.filterSpecified=!1,j.svgBrush.extent=[[-1/0,1/0]]}function F(j){return function(re){var fe=re.brush,le=L(fe),ce=le.slice();fe.filter.set(ce),j()}}function N(j){for(var Z=j.slice(),re=[],fe,le=Z.shift();le;){for(fe=le.slice();(le=Z.shift())&&le[0]<=fe[1];)fe[1]=Math.max(fe[1],le[1]);re.push(fe)}return re.length===1&&re[0][0]>re[0][1]&&(re=[]),re}function B(){var j=[],Z,re;return{set:function(fe){j=fe.map(function(le){return le.slice().sort(e)}).sort(d),j.length===1&&j[0][0]===-1/0&&j[0][1]===1/0&&(j=[[0,-1]]),Z=N(j),re=j.reduce(function(le,ce){return[Math.min(le[0],ce[0]),Math.max(le[1],ce[1])]},[1/0,-1/0])},get:function(){return j.slice()},getConsolidated:function(){return Z},getBounds:function(){return re}}}function R(j,Z,re,fe,le,ce){var V=B();return V.set(re),{filter:V,filterSpecified:Z,svgBrush:{extent:[],brushStartCallback:fe,brushCallback:F(le),brushEndCallback:ce}}}function U(j,Z){if(Array.isArray(j[0])?(j=j.map(function(fe){return fe.sort(e)}),Z.multiselect?j=N(j.sort(d)):j=[j[0]]):j=[j.sort(e)],Z.tickvals){var re=Z.tickvals.slice().sort(e);if(j=j.map(function(fe){var le=[a(0,re,fe[0],[]),a(1,re,fe[1],[])];if(le[1]>le[0])return le}).filter(function(fe){return fe}),!j.length)return}return j.length>1?j:j[0]}G.exports={makeBrush:R,ensureAxisBrush:I,cleanRanges:U}}}),zz=Ge({"src/traces/parcoords/defaults.js"(K,G){var h=_n(),b=gd().hasColorscale,S=yh(),E=Cc().defaults,e=yd(),t=Ts(),r=hL(),o=dL(),n=sS().maxDimensionCount,i=GE();function a(f,c,p,v,T){var l=T("line.color",p);if(b(f,"line")&&h.isArrayOrTypedArray(l)){if(l.length)return T("line.colorscale"),S(f,c,v,T,{prefix:"line.",cLetter:"c"}),l.length;c.line.color=p}return 1/0}function s(f,c,p,v){function T(M,_){return h.coerce(f,c,r.dimensions,M,_)}var l=T("values"),g=T("visible");if(l&&l.length||(g=c.visible=!1),g){T("label"),T("tickvals"),T("ticktext"),T("tickformat");var x=T("range");c._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:x},t.setConvert(c._ax,v.layout),T("multiselect");var A=T("constraintrange");A&&(c.constraintrange=o.cleanRanges(A,c))}}G.exports=function(c,p,v,T){function l(_,w){return h.coerce(c,p,r,_,w)}var g=c.dimensions;Array.isArray(g)&&g.length>n&&(h.log("parcoords traces support up to "+n+" dimensions at the moment"),g.splice(n));var x=e(c,p,{name:"dimensions",layout:T,handleItemDefaults:s}),A=a(c,p,v,T,l);E(p,T,l),(!Array.isArray(x)||!x.length)&&(p.visible=!1),i(p,x,"values",A);var M=h.extendFlat({},T.font,{size:Math.round(T.font.size/1.2)});h.coerceFont(l,"labelfont",M),h.coerceFont(l,"tickfont",M,{autoShadowDflt:!0}),h.coerceFont(l,"rangefont",M),l("labelangle"),l("labelside"),l("unselected.line.color"),l("unselected.line.opacity")}}}),Oz=Ge({"src/traces/parcoords/calc.js"(K,G){var h=_n().isArrayOrTypedArray,b=kc(),S=Fg().wrap;G.exports=function(t,r){var o,n;return b.hasColorscale(r,"line")&&h(r.line.color)?(o=r.line.color,n=b.extractOpts(r.line).colorscale,b.calc(t,r,{vals:o,containerStr:"line",cLetter:"c"})):(o=E(r._length),n=[[0,r.line.color],[1,r.line.color]]),S({lineColor:o,cscale:n})};function E(e){for(var t=new Array(e),r=0;r>>16,(K&65280)>>>8,K&255],alpha:1};if(typeof K=="number")return{space:"rgb",values:[K>>>16,(K&65280)>>>8,K&255],alpha:1};if(K=String(K).toLowerCase(),XE.default[K])S=XE.default[K].slice(),e="rgb";else if(K==="transparent")E=0,e="rgb",S=[0,0,0];else if(K[0]==="#"){var t=K.slice(1),r=t.length,o=r<=4;E=1,o?(S=[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16)],r===4&&(E=parseInt(t[3]+t[3],16)/255)):(S=[parseInt(t[0]+t[1],16),parseInt(t[2]+t[3],16),parseInt(t[4]+t[5],16)],r===8&&(E=parseInt(t[6]+t[7],16)/255)),S[0]||(S[0]=0),S[1]||(S[1]=0),S[2]||(S[2]=0),e="rgb"}else if(b=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(K)){var n=b[1];e=n.replace(/a$/,"");var i=e==="cmyk"?4:e==="gray"?1:3;S=b[2].trim().split(/\s*[,\/]\s*|\s+/),e==="color"&&(e=S.shift()),S=S.map(function(a,s){if(a[a.length-1]==="%")return a=parseFloat(a)/100,s===3?a:e==="rgb"?a*255:e[0]==="h"||e[0]==="l"&&!s?a*100:e==="lab"?a*125:e==="lch"?s<2?a*150:a*360:e[0]==="o"&&!s?a:e==="oklab"?a*.4:e==="oklch"?s<2?a*.4:a*360:a;if(e[s]==="h"||s===2&&e[e.length-1]==="h"){if(YE[a]!==void 0)return YE[a];if(a.endsWith("deg"))return parseFloat(a);if(a.endsWith("turn"))return parseFloat(a)*360;if(a.endsWith("grad"))return parseFloat(a)*360/400;if(a.endsWith("rad"))return parseFloat(a)*180/Math.PI}return a==="none"?0:parseFloat(a)}),E=S.length>i?S.pop():1}else/[0-9](?:\s|\/|,)/.test(K)&&(S=K.match(/([0-9]+)/g).map(function(a){return parseFloat(a)}),e=((h=(G=K.match(/([a-z])/ig))==null?void 0:G.join(""))==null?void 0:h.toLowerCase())||"rgb");return{space:e,values:S,alpha:E}}var XE,vL,YE,Bz=hi({"node_modules/color-parse/index.js"(){XE=uo(mC()),vL=Fz,YE={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),lS,pL=hi({"node_modules/color-space/rgb.js"(){lS={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),uS,Nz=hi({"node_modules/color-space/hsl.js"(){pL(),uS={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(K){var G=K[0]/360,h=K[1]/100,b=K[2]/100,S,E,e,t,r,o=0;if(h===0)return r=b*255,[r,r,r];for(E=b<.5?b*(1+h):b+h-b*h,S=2*b-E,t=[0,0,0];o<3;)e=G+1/3*-(o-1),e<0?e++:e>1&&e--,r=6*e<1?S+(E-S)*6*e:2*e<1?E:3*e<2?S+(E-S)*(2/3-e)*6:S,t[o++]=r*255;return t}},lS.hsl=function(K){var G=K[0]/255,h=K[1]/255,b=K[2]/255,S=Math.min(G,h,b),E=Math.max(G,h,b),e=E-S,t,r,o;return E===S?t=0:G===E?t=(h-b)/e:h===E?t=2+(b-G)/e:b===E&&(t=4+(G-h)/e),t=Math.min(t*60,360),t<0&&(t+=360),o=(S+E)/2,E===S?r=0:o<=.5?r=e/(E+S):r=e/(2-E-S),[t,r*100,o*100]}}}),mL={};Ao(mL,{default:()=>Uz});function Uz(K){Array.isArray(K)&&K.raw&&(K=String.raw(...arguments)),K instanceof Number&&(K=+K);var G,h=vL(K);if(!h.space)return[];const b=h.space[0]==="h"?uS.min:lS.min,S=h.space[0]==="h"?uS.max:lS.max;return G=Array(3),G[0]=Math.min(Math.max(h.values[0],b[0]),S[0]),G[1]=Math.min(Math.max(h.values[1],b[1]),S[1]),G[2]=Math.min(Math.max(h.values[2],b[2]),S[2]),h.space[0]==="h"&&(G=uS.rgb(G)),G.push(Math.min(Math.max(h.alpha,0),1)),G}var jz=hi({"node_modules/color-rgba/index.js"(){Bz(),pL(),Nz()}}),gL=Ge({"src/traces/parcoords/helpers.js"(K){var G=_n().isTypedArray;K.convertTypedArray=function(h){return G(h)?Array.prototype.slice.call(h):h},K.isOrdinal=function(h){return!!h.tickvals},K.isVisible=function(h){return h.visible||!("visible"in h)}}}),qz=Ge({"src/traces/parcoords/lines.js"(K,G){var h=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` `),b=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` -`),S=JA().maxDimensionCount,E=yn(),e=1e-6,t=2048,r=new Uint8Array(4),o=new Uint8Array(4),n={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function i(w){w.read({x:0,y:0,width:1,height:1,data:r})}function a(w,m,u,v,y){var I=w._gl;I.enable(I.SCISSOR_TEST),I.scissor(m,u,v,y),w.clear({color:[0,0,0,0],depth:1})}function s(w,m,u,v,y,I){var L=I.key;function z(F){var N=Math.min(v,y-F*v);F===0&&(window.cancelAnimationFrame(u.currentRafs[L]),delete u.currentRafs[L],a(w,I.scissorX,I.scissorY,I.scissorWidth,I.viewBoxSize[1])),!u.clearOnly&&(I.count=2*N,I.offset=2*F*v,m(I),F*v+N>>8*m)%256/255}function d(w,m,u){for(var v=new Array(w*(S+4)),y=0,I=0;Ize&&(ze=te[ve].dim1.canvasX,Ce=ve);ie===0&&a(y,0,0,N.canvasWidth,N.canvasHeight);var Ye=V(u);for(ve=0;veve._length&&(Qe=Qe.slice(0,ve._length));var Le=ve.tickvals,Te;function pe(Ft,Nt){return{val:Ft,text:Te[Nt]}}function Ne(Ft,Nt){return Ft.val-Nt.val}if(S(Le)&&Le.length){b.isTypedArray(Le)&&(Le=Array.from(Le)),Te=ve.ticktext,!S(Te)||!Te.length?Te=Le.map(E(ve.tickformat)):Te.length>Le.length?Te=Te.slice(0,Le.length):Le.length>Te.length&&(Le=Le.slice(0,Te.length));for(var ot=1;ot=Nt||Mr>=$t)return;var Wr=rt.lineLayer.readPixel(Er,$t-1-Mr),Sr=Wr[3]!==0,Br=Sr?Wr[2]+256*(Wr[1]+256*Wr[0]):null,Mt={x:Er,y:Mr,clientX:Ft.clientX,clientY:Ft.clientY,dataIndex:rt.model.key,curveNumber:Br};Br!==Ce&&(Sr?ee.hover(Mt):ee.unhover&&ee.unhover(Mt),Ce=Br)}}),Ae.style("opacity",function(rt){return rt.pick?0:1}),ue.style("background","rgba(255, 255, 255, 0)");var ze=ue.selectAll("."+T.cn.parcoords).data(ve,f);ze.exit().remove(),ze.enter().append("g").classed(T.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),ze.attr("transform",function(rt){return o(rt.model.translateX,rt.model.translateY)});var Ye=ze.selectAll("."+T.cn.parcoordsControlView).data(c,f);Ye.enter().append("g").classed(T.cn.parcoordsControlView,!0),Ye.attr("transform",function(rt){return o(rt.model.pad.l,rt.model.pad.t)});var it=Ye.selectAll("."+T.cn.yAxis).data(function(rt){return rt.dimensions},f);it.enter().append("g").classed(T.cn.yAxis,!0),Ye.each(function(rt){U(it,rt,H)}),Ae.each(function(rt){if(rt.viewModel){!rt.lineLayer||ee?rt.lineLayer=g(this,rt):rt.lineLayer.update(rt),(rt.key||rt.key===0)&&(rt.viewModel[rt.key]=rt.lineLayer);var Ft=!rt.context||ee;rt.lineLayer.render(rt.viewModel.panels,Ft)}}),it.attr("transform",function(rt){return o(rt.xScale(rt.xIndex),0)}),it.call(h.behavior.drag().origin(function(rt){return rt}).on("drag",function(rt){var Ft=rt.parent;ie.linePickActive(!1),rt.x=Math.max(-T.overdrag,Math.min(rt.model.width+T.overdrag,h.event.x)),rt.canvasX=rt.x*rt.model.canvasPixelRatio,it.sort(function(Nt,$t){return Nt.x-$t.x}).each(function(Nt,$t){Nt.xIndex=$t,Nt.x=rt===Nt?Nt.x:Nt.xScale(Nt.xIndex),Nt.canvasX=Nt.x*Nt.model.canvasPixelRatio}),U(it,Ft,H),it.filter(function(Nt){return Math.abs(rt.xIndex-Nt.xIndex)!==0}).attr("transform",function(Nt){return o(Nt.xScale(Nt.xIndex),0)}),h.select(this).attr("transform",o(rt.x,0)),it.each(function(Nt,$t,rr){rr===rt.parent.key&&(Ft.dimensions[$t]=Nt)}),Ft.contextLayer&&Ft.contextLayer.render(Ft.panels,!1,!L(Ft)),Ft.focusLayer.render&&Ft.focusLayer.render(Ft.panels)}).on("dragend",function(rt){var Ft=rt.parent;rt.x=rt.xScale(rt.xIndex),rt.canvasX=rt.x*rt.model.canvasPixelRatio,U(it,Ft,H),h.select(this).attr("transform",function(Nt){return o(Nt.x,0)}),Ft.contextLayer&&Ft.contextLayer.render(Ft.panels,!1,!L(Ft)),Ft.focusLayer&&Ft.focusLayer.render(Ft.panels),Ft.pickLayer&&Ft.pickLayer.render(Ft.panels,!0),ie.linePickActive(!0),ee&&ee.axesMoved&&ee.axesMoved(Ft.key,Ft.dimensions.map(function(Nt){return Nt.crossfilterDimensionIndex}))})),it.exit().remove();var st=it.selectAll("."+T.cn.axisOverlays).data(c,f);st.enter().append("g").classed(T.cn.axisOverlays,!0),st.selectAll("."+T.cn.axis).remove();var nt=st.selectAll("."+T.cn.axis).data(c,f);nt.enter().append("g").classed(T.cn.axis,!0),nt.each(function(rt){var Ft=rt.model.height/rt.model.tickDistance,Nt=rt.domainScale,$t=Nt.domain();h.select(this).call(h.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Ft,rt.tickFormat).tickValues(rt.ordinal?$t:null).tickFormat(function(rr){return d.isOrdinal(rt)?rr:Z(rt.model.dimensions[rt.visibleIndex],rr)}).scale(Nt)),i.font(nt.selectAll("text"),rt.model.tickFont)}),nt.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),nt.selectAll("text").style("cursor","default");var Qe=st.selectAll("."+T.cn.axisHeading).data(c,f);Qe.enter().append("g").classed(T.cn.axisHeading,!0);var Le=Qe.selectAll("."+T.cn.axisTitle).data(c,f);Le.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",ne?"none":"auto"),Le.text(function(rt){return rt.label}).each(function(rt){var Ft=h.select(this);i.font(Ft,rt.model.labelFont),n.convertToTspans(Ft,le)}).attr("transform",function(rt){var Ft=R(rt.model.labelAngle,rt.model.labelSide),Nt=T.axisTitleOffset;return(Ft.dir>0?"":o(0,2*Nt+rt.model.height))+r(Ft.degrees)+o(-Nt*Ft.dx,-Nt*Ft.dy)}).attr("text-anchor",function(rt){var Ft=R(rt.model.labelAngle,rt.model.labelSide),Nt=Math.abs(Ft.dx),$t=Math.abs(Ft.dy);return 2*Nt>$t?Ft.dir*Ft.dx<0?"start":"end":"middle"});var Te=st.selectAll("."+T.cn.axisExtent).data(c,f);Te.enter().append("g").classed(T.cn.axisExtent,!0);var pe=Te.selectAll("."+T.cn.axisExtentTop).data(c,f);pe.enter().append("g").classed(T.cn.axisExtentTop,!0),pe.attr("transform",o(0,-T.axisExtentOffset));var Ne=pe.selectAll("."+T.cn.axisExtentTopText).data(c,f);Ne.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(N),Ne.text(function(rt){return re(rt,!0)}).each(function(rt){i.font(h.select(this),rt.model.rangeFont)});var ot=Te.selectAll("."+T.cn.axisExtentBottom).data(c,f);ot.enter().append("g").classed(T.cn.axisExtentBottom,!0),ot.attr("transform",function(rt){return o(0,rt.model.height+T.axisExtentOffset)});var ft=ot.selectAll("."+T.cn.axisExtentBottomText).data(c,f);ft.enter().append("text").classed(T.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(N),ft.text(function(rt){return re(rt,!1)}).each(function(rt){i.font(h.select(this),rt.model.rangeFont)}),l.ensureAxisBrush(st,ae,le)}}}),OC=Ge({"src/traces/parcoords/plot.js"(r,G){var h=yD(),b=ME(),S=zC().isVisible,E={};function e(o,n,i){var a=n.indexOf(i),s=o.indexOf(a);return s===-1&&(s+=n.length),s}function t(o,n){return function(a,s){return e(o,n,a)-e(o,n,s)}}var r=G.exports=function(n,i){var a=n._fullLayout,s=b(n,[],E);if(s){var f={},c={},p={},d={},T=a._size;i.forEach(function(M,_){var w=M[0].trace;p[_]=w.index;var m=d[_]=w.index;f[_]=n.data[m].dimensions,c[_]=n.data[m].dimensions.slice()});var l=function(M,_,w){var m=c[M][_],u=w.map(function(F){return F.slice()}),v="dimensions["+_+"].constraintrange",y=a._tracePreGUI[n._fullData[p[M]]._fullInput.uid];if(y[v]===void 0){var I=m.constraintrange;y[v]=I||null}var L=n._fullData[p[M]].dimensions[_];u.length?(u.length===1&&(u=u[0]),m.constraintrange=u,L.constraintrange=u.slice(),u=[u]):(delete m.constraintrange,delete L.constraintrange,u=null);var z={};z[v]=u,n.emit("plotly_restyle",[z,[d[M]]])},g=function(M){n.emit("plotly_hover",M)},x=function(M){n.emit("plotly_unhover",M)},A=function(M,_){var w=t(_,c[M].filter(S));f[M].sort(w),c[M].filter(function(m){return!S(m)}).sort(function(m){return c[M].indexOf(m)}).forEach(function(m){f[M].splice(f[M].indexOf(m),1),f[M].splice(c[M].indexOf(m),0,m)}),n.emit("plotly_restyle",[{dimensions:[f[M]]},[d[M]]])};h(n,i,{width:T.w,height:T.h,margin:{t:T.t,r:T.r,b:T.b,l:T.l}},{filterChanged:l,hover:g,unhover:x,axesMoved:A})}};r.reglPrecompiled=E}}),_D=Ge({"src/traces/parcoords/base_plot.js"($){var G=Za(),h=Iv().getModuleCalcData,b=OC(),S=Ad();$.name="parcoords",$.plot=function(E){var e=h(E.calcdata,"parcoords")[0];e.length&&b(E,e)},$.clean=function(E,e,t,r){var o=r._has&&r._has("parcoords"),n=e._has&&e._has("parcoords");o&&!n&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},$.toSVG=function(E){var e=E._fullLayout._glimages,t=G.select(E).selectAll(".svg-container"),r=t.filter(function(n,i){return i===t.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function o(){var n=this,i=n.toDataURL("image/png"),a=e.append("svg:image");a.attr({xmlns:S.svg,"xlink:href":i,preserveAspectRatio:"none",x:0,y:0,width:n.style.width,height:n.style.height})}r.each(o),window.setTimeout(function(){G.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),xD=Ge({"src/traces/parcoords/base_index.js"($,G){G.exports={attributes:LC(),supplyDefaults:cD(),calc:fD(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:_D(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),bD=Ge({"src/traces/parcoords/index.js"($,G){var h=xD();h.plot=OC(),G.exports=h}}),wD=Ge({"lib/parcoords.js"($,G){G.exports=bD()}}),FC=Ge({"src/traces/parcats/attributes.js"($,G){var h=Qi().extendFlat,b=nu(),S=Fs(),E=Ru(),{hovertemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=Sc().attributes,o=h({editType:"calc"},E("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:t({editType:"plot"})});G.exports={domain:r({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:h({},b.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:t({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:S({editType:"calc"}),tickfont:S({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:o,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),TD=Ge({"src/traces/parcats/defaults.js"($,G){var h=yn(),b=vv().hasColorscale,S=dh(),E=Sc().defaults,e=dv(),t=FC(),r=EE(),o=ro().isTypedArraySpec;function n(a,s,f,c,p){p("line.shape"),p("line.hovertemplate"),p("line.hovertemplatefallback");var d=p("line.color",c.colorway[0]);if(b(a,"line")&&h.isArrayOrTypedArray(d)){if(d.length)return p("line.colorscale"),S(a,s,c,p,{prefix:"line.",cLetter:"c"}),d.length;s.line.color=f}return 1/0}function i(a,s){function f(x,A){return h.coerce(a,s,t.dimensions,x,A)}var c=f("values"),p=f("visible");if(c&&c.length||(p=s.visible=!1),p){f("label"),f("displayindex",s._index);var d=a.categoryarray,T=h.isArrayOrTypedArray(d)&&d.length>0||o(d),l;T&&(l="array");var g=f("categoryorder",l);g==="array"?(f("categoryarray"),f("ticktext")):(delete a.categoryarray,delete a.ticktext),!T&&g==="array"&&(s.categoryorder="trace")}}G.exports=function(s,f,c,p){function d(x,A){return h.coerce(s,f,t,x,A)}var T=e(s,f,{name:"dimensions",handleItemDefaults:i}),l=n(s,f,c,p,d);E(f,p,d),(!Array.isArray(T)||!T.length)&&(f.visible=!1),r(f,T,"values",l),d("hoveron"),d("hovertemplate"),d("hovertemplatefallback"),d("arrangement"),d("bundlecolors"),d("sortpaths"),d("counts");var g=p.font;h.coerceFont(d,"labelfont",g,{overrideDflt:{size:Math.round(g.size)}}),h.coerceFont(d,"tickfont",g,{autoShadowDflt:!0,overrideDflt:{size:Math.round(g.size/1.2)}})}}}),AD=Ge({"src/traces/parcats/calc.js"($,G){var h=Dg().wrap,b=vv().hasColorscale,S=pv(),E=_1(),e=Ms(),t=yn(),r=Ga();G.exports=function(g,x){var A=t.filterVisible(x.dimensions);if(A.length===0)return[];var M=A.map(function(V){var ee;if(V.categoryorder==="trace")ee=null;else if(V.categoryorder==="array")ee=V.categoryarray;else{ee=E(V.values);for(var ne=!0,K=0;K=l.length||g[l[x]]!==void 0)return!1;g[l[x]]=!0}return!0}}}),SD=Ge({"src/traces/parcats/parcats.js"($,G){var h=Za(),b=(oo(),mi(Ti)).interpolateNumber,S=_x(),E=qf(),e=yn(),t=e.strTranslate,r=Ms(),o=ks(),n=ec();function i(K,ue,te,H){var ae=ue._context.staticPlot,ie=K.map(le.bind(0,ue,te)),ve=H.selectAll("g.parcatslayer").data([null]);ve.enter().append("g").attr("class","parcatslayer").style("pointer-events",ae?"none":"all");var Ae=ve.selectAll("g.trace.parcats").data(ie,a),Ce=Ae.enter().append("g").attr("class","trace parcats");Ae.attr("transform",function(pe){return t(pe.x,pe.y)}),Ce.append("g").attr("class","paths");var Fe=Ae.select("g.paths"),ze=Fe.selectAll("path.path").data(function(pe){return pe.paths},a);ze.attr("fill",function(pe){return pe.model.color});var Ye=ze.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(pe){return pe.model.color}).attr("fill-opacity",0);g(Ye),ze.attr("d",function(pe){return pe.svgD}),Ye.empty()||ze.sort(f),ze.exit().remove(),ze.on("mouseover",c).on("mouseout",p).on("click",l),Ce.append("g").attr("class","dimensions");var it=Ae.select("g.dimensions"),st=it.selectAll("g.dimension").data(function(pe){return pe.dimensions},a);st.enter().append("g").attr("class","dimension"),st.attr("transform",function(pe){return t(pe.x,0)}),st.exit().remove();var nt=st.selectAll("g.category").data(function(pe){return pe.categories},a),Qe=nt.enter().append("g").attr("class","category");nt.attr("transform",function(pe){return t(0,pe.y)}),Qe.append("rect").attr("class","catrect").attr("pointer-events","none"),nt.select("rect.catrect").attr("fill","none").attr("width",function(pe){return pe.width}).attr("height",function(pe){return pe.height}),M(Qe);var Le=nt.selectAll("rect.bandrect").data(function(pe){return pe.bands},a);Le.each(function(){e.raiseToTop(this)}),Le.attr("fill",function(pe){return pe.color});var Te=Le.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(pe){return pe.color}).attr("fill-opacity",0);Le.attr("fill",function(pe){return pe.color}).attr("width",function(pe){return pe.width}).attr("height",function(pe){return pe.height}).attr("y",function(pe){return pe.y}).attr("cursor",function(pe){return pe.parcatsViewModel.arrangement==="fixed"?"default":pe.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),w(Te),Le.exit().remove(),Qe.append("text").attr("class","catlabel").attr("pointer-events","none"),nt.select("text.catlabel").attr("text-anchor",function(pe){return s(pe)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(pe){return s(pe)?pe.width+5:-5}).attr("y",function(pe){return pe.height/2}).text(function(pe){return pe.model.categoryLabel}).each(function(pe){r.font(h.select(this),pe.parcatsViewModel.categorylabelfont),n.convertToTspans(h.select(this),ue)}),Qe.append("text").attr("class","dimlabel"),nt.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(pe){return pe.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(pe){return pe.width/2}).attr("y",-5).text(function(pe,Ne){return Ne===0?pe.parcatsViewModel.model.dimensions[pe.model.dimensionInd].dimensionLabel:null}).each(function(pe){r.font(h.select(this),pe.parcatsViewModel.labelfont)}),nt.selectAll("rect.bandrect").on("mouseover",N).on("mouseout",B),nt.exit().remove(),st.call(h.behavior.drag().origin(function(pe){return{x:pe.x,y:0}}).on("dragstart",R).on("drag",U).on("dragend",j)),Ae.each(function(pe){pe.traceSelection=h.select(this),pe.pathSelection=h.select(this).selectAll("g.paths").selectAll("path.path"),pe.dimensionSelection=h.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),Ae.exit().remove()}G.exports=function(K,ue,te,H){i(te,K,H,ue)};function a(K){return K.key}function s(K){var ue=K.parcatsViewModel.dimensions.length,te=K.parcatsViewModel.dimensions[ue-1].model.dimensionInd;return K.model.dimensionInd===te}function f(K,ue){return K.model.rawColor>ue.model.rawColor?1:K.model.rawColor"),rt=h.mouse(ae)[0];E.loneHover({trace:ie,x:nt-Ae.left+Ce.left,y:Qe-Ae.top+Ce.top,text:ft,color:K.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Le,idealAlign:rt1&&Fe.displayInd===Ce.dimensions.length-1?(it=ve.left,st="left"):(it=ve.left+ve.width,st="right");var nt=Ae.model.count,Qe=Ae.model.categoryLabel,Le=nt/Ae.parcatsViewModel.model.count,Te={countLabel:nt,categoryLabel:Qe,probabilityLabel:Le.toFixed(3)},pe=[];Ae.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&pe.push(["Count:",Te.countLabel].join(" ")),Ae.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&pe.push(["P("+Te.categoryLabel+"):",Te.probabilityLabel].join(" "));var Ne=pe.join("
");return{trace:ze,x:H*(it-ue.left),y:ae*(Ye-ue.top),text:Ne,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:st,hovertemplate:ze.hovertemplate,hovertemplateLabels:Te,eventData:[{data:ze._input,fullData:ze,count:nt,category:Qe,probability:Le}]}}function z(K,ue,te){var H=[];return h.select(te.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var ae=this;H.push(L(K,ue,ae))}),H}function F(K,ue,te){K._fullLayout._calcInverseTransform(K);var H=K._fullLayout._invScaleX,ae=K._fullLayout._invScaleY,ie=te.getBoundingClientRect(),ve=h.select(te).datum(),Ae=ve.categoryViewModel,Ce=Ae.parcatsViewModel,Fe=Ce.model.dimensions[Ae.model.dimensionInd],ze=Ce.trace,Ye=ie.y+ie.height/2,it,st;Ce.dimensions.length>1&&Fe.displayInd===Ce.dimensions.length-1?(it=ie.left,st="left"):(it=ie.left+ie.width,st="right");var nt=Ae.model.categoryLabel,Qe=ve.parcatsViewModel.model.count,Le=0;ve.categoryViewModel.bands.forEach(function(rr){rr.color===ve.color&&(Le+=rr.count)});var Te=Ae.model.count,pe=0;Ce.pathSelection.each(function(rr){rr.model.color===ve.color&&(pe+=rr.model.count)});var Ne=Le/Qe,ot=Le/pe,ft=Le/Te,rt={countLabel:Le,categoryLabel:nt,probabilityLabel:Ne.toFixed(3)},Ft=[];Ae.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Ft.push(["Count:",rt.countLabel].join(" ")),Ae.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Ft.push("P(color ∩ "+nt+"): "+rt.probabilityLabel),Ft.push("P("+nt+" | color): "+ot.toFixed(3)),Ft.push("P(color | "+nt+"): "+ft.toFixed(3)));var Nt=Ft.join("
"),$t=o.mostReadable(ve.color,["black","white"]);return{trace:ze,x:H*(it-ue.left),y:ae*(Ye-ue.top),text:Nt,color:ve.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:$t,fontSize:10,idealAlign:st,hovertemplate:ze.hovertemplate,hovertemplateLabels:rt,eventData:[{data:ze._input,fullData:ze,category:nt,count:Qe,probability:Ne,categorycount:Te,colorcount:pe,bandcolorcount:Le}]}}function N(K){if(!K.parcatsViewModel.dragDimension&&K.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var ue=h.mouse(this)[1];if(ue<-1)return;var te=K.parcatsViewModel.graphDiv,H=te._fullLayout,ae=H._paperdiv.node().getBoundingClientRect(),ie=K.parcatsViewModel.hoveron,ve=this;if(ie==="color"?(v(ve),I(ve,"plotly_hover",h.event)):(u(ve),y(ve,"plotly_hover",h.event)),K.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Ae;ie==="category"?Ae=L(te,ae,ve):ie==="color"?Ae=F(te,ae,ve):ie==="dimension"&&(Ae=z(te,ae,ve)),Ae&&E.loneHover(Ae,{container:H._hoverlayer.node(),outerContainer:H._paper.node(),gd:te})}}}function B(K){var ue=K.parcatsViewModel;if(!ue.dragDimension&&(g(ue.pathSelection),M(ue.dimensionSelection.selectAll("g.category")),w(ue.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),E.loneUnhover(ue.graphDiv._fullLayout._hoverlayer.node()),ue.pathSelection.sort(f),ue.hoverinfoItems.indexOf("skip")===-1)){var te=K.parcatsViewModel.hoveron,H=this;te==="color"?I(H,"plotly_unhover",h.event):y(H,"plotly_unhover",h.event)}}function R(K){K.parcatsViewModel.arrangement!=="fixed"&&(K.dragDimensionDisplayInd=K.model.displayInd,K.initialDragDimensionDisplayInds=K.parcatsViewModel.model.dimensions.map(function(ue){return ue.displayInd}),K.dragHasMoved=!1,K.dragCategoryDisplayInd=null,h.select(this).selectAll("g.category").select("rect.catrect").each(function(ue){var te=h.mouse(this)[0],H=h.mouse(this)[1];-2<=te&&te<=ue.width+2&&-2<=H&&H<=ue.height+2&&(K.dragCategoryDisplayInd=ue.model.displayInd,K.initialDragCategoryDisplayInds=K.model.categories.map(function(ae){return ae.displayInd}),ue.model.dragY=ue.y,e.raiseToTop(this.parentNode),h.select(this.parentNode).selectAll("rect.bandrect").each(function(ae){ae.yze.y+ze.height/2&&(ie.model.displayInd=ze.model.displayInd,ze.model.displayInd=Ae),K.dragCategoryDisplayInd=ie.model.displayInd}if(K.dragCategoryDisplayInd===null||K.parcatsViewModel.arrangement==="freeform"){ae.model.dragX=h.event.x;var Ye=K.parcatsViewModel.dimensions[te],it=K.parcatsViewModel.dimensions[H];Ye!==void 0&&ae.model.dragXit.x&&(ae.model.displayInd=it.model.displayInd,it.model.displayInd=K.dragDimensionDisplayInd),K.dragDimensionDisplayInd=ae.model.displayInd}ee(K.parcatsViewModel),V(K.parcatsViewModel),fe(K.parcatsViewModel),re(K.parcatsViewModel)}}function j(K){if(K.parcatsViewModel.arrangement!=="fixed"&&K.dragDimensionDisplayInd!==null){h.select(this).selectAll("text").attr("font-weight","normal");var ue={},te=Z(K.parcatsViewModel),H=K.parcatsViewModel.model.dimensions.map(function(it){return it.displayInd}),ae=K.initialDragDimensionDisplayInds.some(function(it,st){return it!==H[st]});ae&&H.forEach(function(it,st){var nt=K.parcatsViewModel.model.dimensions[st].containerInd;ue["dimensions["+nt+"].displayindex"]=it});var ie=!1;if(K.dragCategoryDisplayInd!==null){var ve=K.model.categories.map(function(it){return it.displayInd});if(ie=K.initialDragCategoryDisplayInds.some(function(it,st){return it!==ve[st]}),ie){var Ae=K.model.categories.slice().sort(function(it,st){return it.displayInd-st.displayInd}),Ce=Ae.map(function(it){return it.categoryValue}),Fe=Ae.map(function(it){return it.categoryLabel});ue["dimensions["+K.model.containerInd+"].categoryarray"]=[Ce],ue["dimensions["+K.model.containerInd+"].ticktext"]=[Fe],ue["dimensions["+K.model.containerInd+"].categoryorder"]="array"}}if(K.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!K.dragHasMoved&&K.potentialClickBand&&(K.parcatsViewModel.hoveron==="color"?I(K.potentialClickBand,"plotly_click",h.event.sourceEvent):y(K.potentialClickBand,"plotly_click",h.event.sourceEvent)),K.model.dragX=null,K.dragCategoryDisplayInd!==null){var ze=K.parcatsViewModel.dimensions[K.dragDimensionDisplayInd].categories[K.dragCategoryDisplayInd];ze.model.dragY=null,K.dragCategoryDisplayInd=null}K.dragDimensionDisplayInd=null,K.parcatsViewModel.dragDimension=null,K.dragHasMoved=null,K.potentialClickBand=null,ee(K.parcatsViewModel),V(K.parcatsViewModel);var Ye=h.transition().duration(300).ease("cubic-in-out");Ye.each(function(){fe(K.parcatsViewModel,!0),re(K.parcatsViewModel,!0)}).each("end",function(){(ae||ie)&&S.restyle(K.parcatsViewModel.graphDiv,ue,[te])})}}function Z(K){for(var ue,te=K.graphDiv._fullData,H=0;H=0;Ce--)Fe+="C"+ve[Ce]+","+(ue[Ce+1]+H)+" "+ie[Ce]+","+(ue[Ce]+H)+" "+(K[Ce]+te[Ce])+","+(ue[Ce]+H),Fe+="l-"+te[Ce]+",0 ";return Fe+="Z",Fe}function V(K){var ue=K.dimensions,te=K.model,H=ue.map(function(Wr){return Wr.categories.map(function(Sr){return Sr.y})}),ae=K.model.dimensions.map(function(Wr){return Wr.categories.map(function(Sr){return Sr.displayInd})}),ie=K.model.dimensions.map(function(Wr){return Wr.displayInd}),ve=K.dimensions.map(function(Wr){return Wr.model.dimensionInd}),Ae=ue.map(function(Wr){return Wr.x}),Ce=ue.map(function(Wr){return Wr.width}),Fe=[];for(var ze in te.paths)te.paths.hasOwnProperty(ze)&&Fe.push(te.paths[ze]);function Ye(Wr){var Sr=Wr.categoryInds.map(function(Mt,je){return ae[je][Mt]}),Br=ve.map(function(Mt){return Sr[Mt]});return Br}Fe.sort(function(Wr,Sr){var Br=Ye(Wr),Mt=Ye(Sr);return K.sortpaths==="backward"&&(Br.reverse(),Mt.reverse()),Br.push(Wr.valueInds[0]),Mt.push(Sr.valueInds[0]),K.bundlecolors&&(Br.unshift(Wr.rawColor),Mt.unshift(Sr.rawColor)),BrMt?1:0});for(var it=new Array(Fe.length),st=ue[0].model.count,nt=ue[0].categories.map(function(Wr){return Wr.height}).reduce(function(Wr,Sr){return Wr+Sr}),Qe=0;Qe0?Te=nt*(Le.count/st):Te=0;for(var pe=new Array(H.length),Ne=0;Ne1?ve=(K.width-2*te-H)/(ae-1):ve=0,Ae=te,Ce=Ae+ve*ie;var Fe=[],ze=K.model.maxCats,Ye=ue.categories.length,it=8,st=ue.count,nt=K.height-it*(ze-1),Qe,Le,Te,pe,Ne,ot=(ze-Ye)*it/2,ft=ue.categories.map(function(rt){return{displayInd:rt.displayInd,categoryInd:rt.categoryInd}});for(ft.sort(function(rt,Ft){return rt.displayInd-Ft.displayInd}),Ne=0;Ne0?Qe=Le.count/st*nt:Qe=0,Te={key:Le.valueInds[0],model:Le,width:H,height:Qe,y:Le.dragY!==null?Le.dragY:ot,bands:[],parcatsViewModel:K},ot=ot+Qe+it,Fe.push(Te);return{key:ue.dimensionInd,x:ue.dragX!==null?ue.dragX:Ce,y:0,width:H,model:ue,categories:Fe,parcatsViewModel:K,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),BC=Ge({"src/traces/parcats/plot.js"($,G){var h=SD();G.exports=function(S,E,e,t){var r=S._fullLayout,o=r._paper,n=r._size;h(S,o,E,{width:n.w,height:n.h,margin:{t:n.t,r:n.r,b:n.b,l:n.l}},e,t)}}}),MD=Ge({"src/traces/parcats/base_plot.js"($){var G=Iv().getModuleCalcData,h=BC(),b="parcats";$.name=b,$.plot=function(S,E,e,t){var r=G(S.calcdata,b);if(r.length){var o=r[0];h(S,o,e,t)}},$.clean=function(S,E,e,t){var r=t._has&&t._has("parcats"),o=E._has&&E._has("parcats");r&&!o&&t._paperdiv.selectAll(".parcats").remove()}}}),ED=Ge({"src/traces/parcats/index.js"($,G){G.exports={attributes:FC(),supplyDefaults:TD(),calc:AD(),plot:BC(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:MD(),categories:["noOpacity"],meta:{}}}}),kD=Ge({"lib/parcats.js"($,G){G.exports=ED()}}),Gy=Ge({"src/plots/mapbox/constants.js"($,G){var h=Cp(),b="1.13.4",S='© OpenStreetMap contributors',E=['© Carto',S].join(" "),e=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),t=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),r={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:S,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},o=h(r);G.exports={requiredVersion:b,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:o,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+b+"."].join(` +`),S=sS().maxDimensionCount,E=_n(),e=1e-6,t=2048,r=new Uint8Array(4),o=new Uint8Array(4),n={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function i(w){w.read({x:0,y:0,width:1,height:1,data:r})}function a(w,m,u,d,y){var I=w._gl;I.enable(I.SCISSOR_TEST),I.scissor(m,u,d,y),w.clear({color:[0,0,0,0],depth:1})}function s(w,m,u,d,y,I){var L=I.key;function z(F){var N=Math.min(d,y-F*d);F===0&&(window.cancelAnimationFrame(u.currentRafs[L]),delete u.currentRafs[L],a(w,I.scissorX,I.scissorY,I.scissorWidth,I.viewBoxSize[1])),!u.clearOnly&&(I.count=2*N,I.offset=2*F*d,m(I),F*d+N>>8*m)%256/255}function v(w,m,u){for(var d=new Array(w*(S+4)),y=0,I=0;Ize&&(ze=te[de].dim1.canvasX,Le=de);ie===0&&a(y,0,0,N.canvasWidth,N.canvasHeight);var Ye=V(u);for(de=0;dede._length&&(et=et.slice(0,de._length));var Pe=de.tickvals,Ae;function pe(Ft,Nt){return{val:Ft,text:Ae[Nt]}}function Ne(Ft,Nt){return Ft.val-Nt.val}if(S(Pe)&&Pe.length){b.isTypedArray(Pe)&&(Pe=Array.from(Pe)),Ae=de.ticktext,!S(Ae)||!Ae.length?Ae=Pe.map(E(de.tickformat)):Ae.length>Pe.length?Ae=Ae.slice(0,Pe.length):Pe.length>Ae.length&&(Pe=Pe.slice(0,Ae.length));for(var ut=1;ut=Nt||Er>=Qt)return;var $r=nt.lineLayer.readPixel(kr,Qt-1-Er),Sr=$r[3]!==0,Ur=Sr?$r[2]+256*($r[1]+256*$r[0]):null,Mt={x:kr,y:Er,clientX:Ft.clientX,clientY:Ft.clientY,dataIndex:nt.model.key,curveNumber:Ur};Ur!==Le&&(Sr?ee.hover(Mt):ee.unhover&&ee.unhover(Mt),Le=Ur)}}),Se.style("opacity",function(nt){return nt.pick?0:1}),ue.style("background","rgba(255, 255, 255, 0)");var ze=ue.selectAll("."+T.cn.parcoords).data(de,f);ze.exit().remove(),ze.enter().append("g").classed(T.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),ze.attr("transform",function(nt){return o(nt.model.translateX,nt.model.translateY)});var Ye=ze.selectAll("."+T.cn.parcoordsControlView).data(c,f);Ye.enter().append("g").classed(T.cn.parcoordsControlView,!0),Ye.attr("transform",function(nt){return o(nt.model.pad.l,nt.model.pad.t)});var st=Ye.selectAll("."+T.cn.yAxis).data(function(nt){return nt.dimensions},f);st.enter().append("g").classed(T.cn.yAxis,!0),Ye.each(function(nt){U(st,nt,H)}),Se.each(function(nt){if(nt.viewModel){!nt.lineLayer||ee?nt.lineLayer=g(this,nt):nt.lineLayer.update(nt),(nt.key||nt.key===0)&&(nt.viewModel[nt.key]=nt.lineLayer);var Ft=!nt.context||ee;nt.lineLayer.render(nt.viewModel.panels,Ft)}}),st.attr("transform",function(nt){return o(nt.xScale(nt.xIndex),0)}),st.call(h.behavior.drag().origin(function(nt){return nt}).on("drag",function(nt){var Ft=nt.parent;ie.linePickActive(!1),nt.x=Math.max(-T.overdrag,Math.min(nt.model.width+T.overdrag,h.event.x)),nt.canvasX=nt.x*nt.model.canvasPixelRatio,st.sort(function(Nt,Qt){return Nt.x-Qt.x}).each(function(Nt,Qt){Nt.xIndex=Qt,Nt.x=nt===Nt?Nt.x:Nt.xScale(Nt.xIndex),Nt.canvasX=Nt.x*Nt.model.canvasPixelRatio}),U(st,Ft,H),st.filter(function(Nt){return Math.abs(nt.xIndex-Nt.xIndex)!==0}).attr("transform",function(Nt){return o(Nt.xScale(Nt.xIndex),0)}),h.select(this).attr("transform",o(nt.x,0)),st.each(function(Nt,Qt,ar){ar===nt.parent.key&&(Ft.dimensions[Qt]=Nt)}),Ft.contextLayer&&Ft.contextLayer.render(Ft.panels,!1,!L(Ft)),Ft.focusLayer.render&&Ft.focusLayer.render(Ft.panels)}).on("dragend",function(nt){var Ft=nt.parent;nt.x=nt.xScale(nt.xIndex),nt.canvasX=nt.x*nt.model.canvasPixelRatio,U(st,Ft,H),h.select(this).attr("transform",function(Nt){return o(Nt.x,0)}),Ft.contextLayer&&Ft.contextLayer.render(Ft.panels,!1,!L(Ft)),Ft.focusLayer&&Ft.focusLayer.render(Ft.panels),Ft.pickLayer&&Ft.pickLayer.render(Ft.panels,!0),ie.linePickActive(!0),ee&&ee.axesMoved&&ee.axesMoved(Ft.key,Ft.dimensions.map(function(Nt){return Nt.crossfilterDimensionIndex}))})),st.exit().remove();var ct=st.selectAll("."+T.cn.axisOverlays).data(c,f);ct.enter().append("g").classed(T.cn.axisOverlays,!0),ct.selectAll("."+T.cn.axis).remove();var at=ct.selectAll("."+T.cn.axis).data(c,f);at.enter().append("g").classed(T.cn.axis,!0),at.each(function(nt){var Ft=nt.model.height/nt.model.tickDistance,Nt=nt.domainScale,Qt=Nt.domain();h.select(this).call(h.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Ft,nt.tickFormat).tickValues(nt.ordinal?Qt:null).tickFormat(function(ar){return v.isOrdinal(nt)?ar:Z(nt.model.dimensions[nt.visibleIndex],ar)}).scale(Nt)),i.font(at.selectAll("text"),nt.model.tickFont)}),at.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),at.selectAll("text").style("cursor","default");var et=ct.selectAll("."+T.cn.axisHeading).data(c,f);et.enter().append("g").classed(T.cn.axisHeading,!0);var Pe=et.selectAll("."+T.cn.axisTitle).data(c,f);Pe.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",ne?"none":"auto"),Pe.text(function(nt){return nt.label}).each(function(nt){var Ft=h.select(this);i.font(Ft,nt.model.labelFont),n.convertToTspans(Ft,le)}).attr("transform",function(nt){var Ft=R(nt.model.labelAngle,nt.model.labelSide),Nt=T.axisTitleOffset;return(Ft.dir>0?"":o(0,2*Nt+nt.model.height))+r(Ft.degrees)+o(-Nt*Ft.dx,-Nt*Ft.dy)}).attr("text-anchor",function(nt){var Ft=R(nt.model.labelAngle,nt.model.labelSide),Nt=Math.abs(Ft.dx),Qt=Math.abs(Ft.dy);return 2*Nt>Qt?Ft.dir*Ft.dx<0?"start":"end":"middle"});var Ae=ct.selectAll("."+T.cn.axisExtent).data(c,f);Ae.enter().append("g").classed(T.cn.axisExtent,!0);var pe=Ae.selectAll("."+T.cn.axisExtentTop).data(c,f);pe.enter().append("g").classed(T.cn.axisExtentTop,!0),pe.attr("transform",o(0,-T.axisExtentOffset));var Ne=pe.selectAll("."+T.cn.axisExtentTopText).data(c,f);Ne.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(N),Ne.text(function(nt){return re(nt,!0)}).each(function(nt){i.font(h.select(this),nt.model.rangeFont)});var ut=Ae.selectAll("."+T.cn.axisExtentBottom).data(c,f);ut.enter().append("g").classed(T.cn.axisExtentBottom,!0),ut.attr("transform",function(nt){return o(0,nt.model.height+T.axisExtentOffset)});var dt=ut.selectAll("."+T.cn.axisExtentBottomText).data(c,f);dt.enter().append("text").classed(T.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(N),dt.text(function(nt){return re(nt,!1)}).each(function(nt){i.font(h.select(this),nt.model.rangeFont)}),l.ensureAxisBrush(ct,ae,le)}}}),yL=Ge({"src/traces/parcoords/plot.js"(r,G){var h=Vz(),b=HE(),S=gL().isVisible,E={};function e(o,n,i){var a=n.indexOf(i),s=o.indexOf(a);return s===-1&&(s+=n.length),s}function t(o,n){return function(a,s){return e(o,n,a)-e(o,n,s)}}var r=G.exports=function(n,i){var a=n._fullLayout,s=b(n,[],E);if(s){var f={},c={},p={},v={},T=a._size;i.forEach(function(M,_){var w=M[0].trace;p[_]=w.index;var m=v[_]=w.index;f[_]=n.data[m].dimensions,c[_]=n.data[m].dimensions.slice()});var l=function(M,_,w){var m=c[M][_],u=w.map(function(F){return F.slice()}),d="dimensions["+_+"].constraintrange",y=a._tracePreGUI[n._fullData[p[M]]._fullInput.uid];if(y[d]===void 0){var I=m.constraintrange;y[d]=I||null}var L=n._fullData[p[M]].dimensions[_];u.length?(u.length===1&&(u=u[0]),m.constraintrange=u,L.constraintrange=u.slice(),u=[u]):(delete m.constraintrange,delete L.constraintrange,u=null);var z={};z[d]=u,n.emit("plotly_restyle",[z,[v[M]]])},g=function(M){n.emit("plotly_hover",M)},x=function(M){n.emit("plotly_unhover",M)},A=function(M,_){var w=t(_,c[M].filter(S));f[M].sort(w),c[M].filter(function(m){return!S(m)}).sort(function(m){return c[M].indexOf(m)}).forEach(function(m){f[M].splice(f[M].indexOf(m),1),f[M].splice(c[M].indexOf(m),0,m)}),n.emit("plotly_restyle",[{dimensions:[f[M]]},[v[M]]])};h(n,i,{width:T.w,height:T.h,margin:{t:T.t,r:T.r,b:T.b,l:T.l}},{filterChanged:l,hover:g,unhover:x,axesMoved:A})}};r.reglPrecompiled=E}}),Hz=Ge({"src/traces/parcoords/base_plot.js"(K){var G=ki(),h=Bd().getModuleCalcData,b=yL(),S=Lv();K.name="parcoords",K.plot=function(E){var e=h(E.calcdata,"parcoords")[0];e.length&&b(E,e)},K.clean=function(E,e,t,r){var o=r._has&&r._has("parcoords"),n=e._has&&e._has("parcoords");o&&!n&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},K.toSVG=function(E){var e=E._fullLayout._glimages,t=G.select(E).selectAll(".svg-container"),r=t.filter(function(n,i){return i===t.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function o(){var n=this,i=n.toDataURL("image/png"),a=e.append("svg:image");a.attr({xmlns:S.svg,"xlink:href":i,preserveAspectRatio:"none",x:0,y:0,width:n.style.width,height:n.style.height})}r.each(o),window.setTimeout(function(){G.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),Gz=Ge({"src/traces/parcoords/base_index.js"(K,G){G.exports={attributes:hL(),supplyDefaults:zz(),calc:Oz(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:Hz(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),Xz=Ge({"src/traces/parcoords/index.js"(K,G){var h=Gz();h.plot=yL(),G.exports=h}}),Yz=Ge({"lib/parcoords.js"(K,G){G.exports=Xz()}}),_L=Ge({"src/traces/parcats/attributes.js"(K,G){var h=Ji().extendFlat,b=Jl(),S=Us(),E=zu(),{hovertemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=Cc().attributes,o=h({editType:"calc"},E("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:t({editType:"plot"})});G.exports={domain:r({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:h({},b.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:t({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:S({editType:"calc"}),tickfont:S({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:o,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),Zz=Ge({"src/traces/parcats/defaults.js"(K,G){var h=_n(),b=gd().hasColorscale,S=yh(),E=Cc().defaults,e=yd(),t=_L(),r=GE(),o=ws().isTypedArraySpec;function n(a,s,f,c,p){p("line.shape"),p("line.hovertemplate"),p("line.hovertemplatefallback");var v=p("line.color",c.colorway[0]);if(b(a,"line")&&h.isArrayOrTypedArray(v)){if(v.length)return p("line.colorscale"),S(a,s,c,p,{prefix:"line.",cLetter:"c"}),v.length;s.line.color=f}return 1/0}function i(a,s){function f(x,A){return h.coerce(a,s,t.dimensions,x,A)}var c=f("values"),p=f("visible");if(c&&c.length||(p=s.visible=!1),p){f("label"),f("displayindex",s._index);var v=a.categoryarray,T=h.isArrayOrTypedArray(v)&&v.length>0||o(v),l;T&&(l="array");var g=f("categoryorder",l);g==="array"?(f("categoryarray"),f("ticktext")):(delete a.categoryarray,delete a.ticktext),!T&&g==="array"&&(s.categoryorder="trace")}}G.exports=function(s,f,c,p){function v(x,A){return h.coerce(s,f,t,x,A)}var T=e(s,f,{name:"dimensions",handleItemDefaults:i}),l=n(s,f,c,p,v);E(f,p,v),(!Array.isArray(T)||!T.length)&&(f.visible=!1),r(f,T,"values",l),v("hoveron"),v("hovertemplate"),v("hovertemplatefallback"),v("arrangement"),v("bundlecolors"),v("sortpaths"),v("counts");var g=p.font;h.coerceFont(v,"labelfont",g,{overrideDflt:{size:Math.round(g.size)}}),h.coerceFont(v,"tickfont",g,{autoShadowDflt:!0,overrideDflt:{size:Math.round(g.size/1.2)}})}}}),Wz=Ge({"src/traces/parcats/calc.js"(K,G){var h=Fg().wrap,b=gd().hasColorscale,S=_d(),E=T1(),e=As(),t=_n(),r=Ei();G.exports=function(g,x){var A=t.filterVisible(x.dimensions);if(A.length===0)return[];var M=A.map(function(V){var ee;if(V.categoryorder==="trace")ee=null;else if(V.categoryorder==="array")ee=V.categoryarray;else{ee=E(V.values);for(var ne=!0,$=0;$=l.length||g[l[x]]!==void 0)return!1;g[l[x]]=!0}return!0}}}),$z=Ge({"src/traces/parcats/parcats.js"(K,G){var h=ki(),b=(ao(),di(xi)).interpolateNumber,S=wx(),E=Yf(),e=_n(),t=e.strTranslate,r=As(),o=Rs(),n=nc();function i($,ue,te,H){var ae=ue._context.staticPlot,ie=$.map(le.bind(0,ue,te)),de=H.selectAll("g.parcatslayer").data([null]);de.enter().append("g").attr("class","parcatslayer").style("pointer-events",ae?"none":"all");var Se=de.selectAll("g.trace.parcats").data(ie,a),Le=Se.enter().append("g").attr("class","trace parcats");Se.attr("transform",function(pe){return t(pe.x,pe.y)}),Le.append("g").attr("class","paths");var Fe=Se.select("g.paths"),ze=Fe.selectAll("path.path").data(function(pe){return pe.paths},a);ze.attr("fill",function(pe){return pe.model.color});var Ye=ze.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(pe){return pe.model.color}).attr("fill-opacity",0);g(Ye),ze.attr("d",function(pe){return pe.svgD}),Ye.empty()||ze.sort(f),ze.exit().remove(),ze.on("mouseover",c).on("mouseout",p).on("click",l),Le.append("g").attr("class","dimensions");var st=Se.select("g.dimensions"),ct=st.selectAll("g.dimension").data(function(pe){return pe.dimensions},a);ct.enter().append("g").attr("class","dimension"),ct.attr("transform",function(pe){return t(pe.x,0)}),ct.exit().remove();var at=ct.selectAll("g.category").data(function(pe){return pe.categories},a),et=at.enter().append("g").attr("class","category");at.attr("transform",function(pe){return t(0,pe.y)}),et.append("rect").attr("class","catrect").attr("pointer-events","none"),at.select("rect.catrect").attr("fill","none").attr("width",function(pe){return pe.width}).attr("height",function(pe){return pe.height}),M(et);var Pe=at.selectAll("rect.bandrect").data(function(pe){return pe.bands},a);Pe.each(function(){e.raiseToTop(this)}),Pe.attr("fill",function(pe){return pe.color});var Ae=Pe.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(pe){return pe.color}).attr("fill-opacity",0);Pe.attr("fill",function(pe){return pe.color}).attr("width",function(pe){return pe.width}).attr("height",function(pe){return pe.height}).attr("y",function(pe){return pe.y}).attr("cursor",function(pe){return pe.parcatsViewModel.arrangement==="fixed"?"default":pe.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),w(Ae),Pe.exit().remove(),et.append("text").attr("class","catlabel").attr("pointer-events","none"),at.select("text.catlabel").attr("text-anchor",function(pe){return s(pe)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(pe){return s(pe)?pe.width+5:-5}).attr("y",function(pe){return pe.height/2}).text(function(pe){return pe.model.categoryLabel}).each(function(pe){r.font(h.select(this),pe.parcatsViewModel.categorylabelfont),n.convertToTspans(h.select(this),ue)}),et.append("text").attr("class","dimlabel"),at.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(pe){return pe.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(pe){return pe.width/2}).attr("y",-5).text(function(pe,Ne){return Ne===0?pe.parcatsViewModel.model.dimensions[pe.model.dimensionInd].dimensionLabel:null}).each(function(pe){r.font(h.select(this),pe.parcatsViewModel.labelfont)}),at.selectAll("rect.bandrect").on("mouseover",N).on("mouseout",B),at.exit().remove(),ct.call(h.behavior.drag().origin(function(pe){return{x:pe.x,y:0}}).on("dragstart",R).on("drag",U).on("dragend",j)),Se.each(function(pe){pe.traceSelection=h.select(this),pe.pathSelection=h.select(this).selectAll("g.paths").selectAll("path.path"),pe.dimensionSelection=h.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),Se.exit().remove()}G.exports=function($,ue,te,H){i(te,$,H,ue)};function a($){return $.key}function s($){var ue=$.parcatsViewModel.dimensions.length,te=$.parcatsViewModel.dimensions[ue-1].model.dimensionInd;return $.model.dimensionInd===te}function f($,ue){return $.model.rawColor>ue.model.rawColor?1:$.model.rawColor"),nt=h.mouse(ae)[0];E.loneHover({trace:ie,x:at-Se.left+Le.left,y:et-Se.top+Le.top,text:dt,color:$.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Pe,idealAlign:nt1&&Fe.displayInd===Le.dimensions.length-1?(st=de.left,ct="left"):(st=de.left+de.width,ct="right");var at=Se.model.count,et=Se.model.categoryLabel,Pe=at/Se.parcatsViewModel.model.count,Ae={countLabel:at,categoryLabel:et,probabilityLabel:Pe.toFixed(3)},pe=[];Se.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&pe.push(["Count:",Ae.countLabel].join(" ")),Se.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&pe.push(["P("+Ae.categoryLabel+"):",Ae.probabilityLabel].join(" "));var Ne=pe.join("
");return{trace:ze,x:H*(st-ue.left),y:ae*(Ye-ue.top),text:Ne,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:ct,hovertemplate:ze.hovertemplate,hovertemplateLabels:Ae,eventData:[{data:ze._input,fullData:ze,count:at,category:et,probability:Pe}]}}function z($,ue,te){var H=[];return h.select(te.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var ae=this;H.push(L($,ue,ae))}),H}function F($,ue,te){$._fullLayout._calcInverseTransform($);var H=$._fullLayout._invScaleX,ae=$._fullLayout._invScaleY,ie=te.getBoundingClientRect(),de=h.select(te).datum(),Se=de.categoryViewModel,Le=Se.parcatsViewModel,Fe=Le.model.dimensions[Se.model.dimensionInd],ze=Le.trace,Ye=ie.y+ie.height/2,st,ct;Le.dimensions.length>1&&Fe.displayInd===Le.dimensions.length-1?(st=ie.left,ct="left"):(st=ie.left+ie.width,ct="right");var at=Se.model.categoryLabel,et=de.parcatsViewModel.model.count,Pe=0;de.categoryViewModel.bands.forEach(function(ar){ar.color===de.color&&(Pe+=ar.count)});var Ae=Se.model.count,pe=0;Le.pathSelection.each(function(ar){ar.model.color===de.color&&(pe+=ar.model.count)});var Ne=Pe/et,ut=Pe/pe,dt=Pe/Ae,nt={countLabel:Pe,categoryLabel:at,probabilityLabel:Ne.toFixed(3)},Ft=[];Se.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Ft.push(["Count:",nt.countLabel].join(" ")),Se.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Ft.push("P(color ∩ "+at+"): "+nt.probabilityLabel),Ft.push("P("+at+" | color): "+ut.toFixed(3)),Ft.push("P(color | "+at+"): "+dt.toFixed(3)));var Nt=Ft.join("
"),Qt=o.mostReadable(de.color,["black","white"]);return{trace:ze,x:H*(st-ue.left),y:ae*(Ye-ue.top),text:Nt,color:de.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:Qt,fontSize:10,idealAlign:ct,hovertemplate:ze.hovertemplate,hovertemplateLabels:nt,eventData:[{data:ze._input,fullData:ze,category:at,count:et,probability:Ne,categorycount:Ae,colorcount:pe,bandcolorcount:Pe}]}}function N($){if(!$.parcatsViewModel.dragDimension&&$.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var ue=h.mouse(this)[1];if(ue<-1)return;var te=$.parcatsViewModel.graphDiv,H=te._fullLayout,ae=H._paperdiv.node().getBoundingClientRect(),ie=$.parcatsViewModel.hoveron,de=this;if(ie==="color"?(d(de),I(de,"plotly_hover",h.event)):(u(de),y(de,"plotly_hover",h.event)),$.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Se;ie==="category"?Se=L(te,ae,de):ie==="color"?Se=F(te,ae,de):ie==="dimension"&&(Se=z(te,ae,de)),Se&&E.loneHover(Se,{container:H._hoverlayer.node(),outerContainer:H._paper.node(),gd:te})}}}function B($){var ue=$.parcatsViewModel;if(!ue.dragDimension&&(g(ue.pathSelection),M(ue.dimensionSelection.selectAll("g.category")),w(ue.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),E.loneUnhover(ue.graphDiv._fullLayout._hoverlayer.node()),ue.pathSelection.sort(f),ue.hoverinfoItems.indexOf("skip")===-1)){var te=$.parcatsViewModel.hoveron,H=this;te==="color"?I(H,"plotly_unhover",h.event):y(H,"plotly_unhover",h.event)}}function R($){$.parcatsViewModel.arrangement!=="fixed"&&($.dragDimensionDisplayInd=$.model.displayInd,$.initialDragDimensionDisplayInds=$.parcatsViewModel.model.dimensions.map(function(ue){return ue.displayInd}),$.dragHasMoved=!1,$.dragCategoryDisplayInd=null,h.select(this).selectAll("g.category").select("rect.catrect").each(function(ue){var te=h.mouse(this)[0],H=h.mouse(this)[1];-2<=te&&te<=ue.width+2&&-2<=H&&H<=ue.height+2&&($.dragCategoryDisplayInd=ue.model.displayInd,$.initialDragCategoryDisplayInds=$.model.categories.map(function(ae){return ae.displayInd}),ue.model.dragY=ue.y,e.raiseToTop(this.parentNode),h.select(this.parentNode).selectAll("rect.bandrect").each(function(ae){ae.yze.y+ze.height/2&&(ie.model.displayInd=ze.model.displayInd,ze.model.displayInd=Se),$.dragCategoryDisplayInd=ie.model.displayInd}if($.dragCategoryDisplayInd===null||$.parcatsViewModel.arrangement==="freeform"){ae.model.dragX=h.event.x;var Ye=$.parcatsViewModel.dimensions[te],st=$.parcatsViewModel.dimensions[H];Ye!==void 0&&ae.model.dragXst.x&&(ae.model.displayInd=st.model.displayInd,st.model.displayInd=$.dragDimensionDisplayInd),$.dragDimensionDisplayInd=ae.model.displayInd}ee($.parcatsViewModel),V($.parcatsViewModel),fe($.parcatsViewModel),re($.parcatsViewModel)}}function j($){if($.parcatsViewModel.arrangement!=="fixed"&&$.dragDimensionDisplayInd!==null){h.select(this).selectAll("text").attr("font-weight","normal");var ue={},te=Z($.parcatsViewModel),H=$.parcatsViewModel.model.dimensions.map(function(st){return st.displayInd}),ae=$.initialDragDimensionDisplayInds.some(function(st,ct){return st!==H[ct]});ae&&H.forEach(function(st,ct){var at=$.parcatsViewModel.model.dimensions[ct].containerInd;ue["dimensions["+at+"].displayindex"]=st});var ie=!1;if($.dragCategoryDisplayInd!==null){var de=$.model.categories.map(function(st){return st.displayInd});if(ie=$.initialDragCategoryDisplayInds.some(function(st,ct){return st!==de[ct]}),ie){var Se=$.model.categories.slice().sort(function(st,ct){return st.displayInd-ct.displayInd}),Le=Se.map(function(st){return st.categoryValue}),Fe=Se.map(function(st){return st.categoryLabel});ue["dimensions["+$.model.containerInd+"].categoryarray"]=[Le],ue["dimensions["+$.model.containerInd+"].ticktext"]=[Fe],ue["dimensions["+$.model.containerInd+"].categoryorder"]="array"}}if($.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!$.dragHasMoved&&$.potentialClickBand&&($.parcatsViewModel.hoveron==="color"?I($.potentialClickBand,"plotly_click",h.event.sourceEvent):y($.potentialClickBand,"plotly_click",h.event.sourceEvent)),$.model.dragX=null,$.dragCategoryDisplayInd!==null){var ze=$.parcatsViewModel.dimensions[$.dragDimensionDisplayInd].categories[$.dragCategoryDisplayInd];ze.model.dragY=null,$.dragCategoryDisplayInd=null}$.dragDimensionDisplayInd=null,$.parcatsViewModel.dragDimension=null,$.dragHasMoved=null,$.potentialClickBand=null,ee($.parcatsViewModel),V($.parcatsViewModel);var Ye=h.transition().duration(300).ease("cubic-in-out");Ye.each(function(){fe($.parcatsViewModel,!0),re($.parcatsViewModel,!0)}).each("end",function(){(ae||ie)&&S.restyle($.parcatsViewModel.graphDiv,ue,[te])})}}function Z($){for(var ue,te=$.graphDiv._fullData,H=0;H=0;Le--)Fe+="C"+de[Le]+","+(ue[Le+1]+H)+" "+ie[Le]+","+(ue[Le]+H)+" "+($[Le]+te[Le])+","+(ue[Le]+H),Fe+="l-"+te[Le]+",0 ";return Fe+="Z",Fe}function V($){var ue=$.dimensions,te=$.model,H=ue.map(function($r){return $r.categories.map(function(Sr){return Sr.y})}),ae=$.model.dimensions.map(function($r){return $r.categories.map(function(Sr){return Sr.displayInd})}),ie=$.model.dimensions.map(function($r){return $r.displayInd}),de=$.dimensions.map(function($r){return $r.model.dimensionInd}),Se=ue.map(function($r){return $r.x}),Le=ue.map(function($r){return $r.width}),Fe=[];for(var ze in te.paths)te.paths.hasOwnProperty(ze)&&Fe.push(te.paths[ze]);function Ye($r){var Sr=$r.categoryInds.map(function(Mt,je){return ae[je][Mt]}),Ur=de.map(function(Mt){return Sr[Mt]});return Ur}Fe.sort(function($r,Sr){var Ur=Ye($r),Mt=Ye(Sr);return $.sortpaths==="backward"&&(Ur.reverse(),Mt.reverse()),Ur.push($r.valueInds[0]),Mt.push(Sr.valueInds[0]),$.bundlecolors&&(Ur.unshift($r.rawColor),Mt.unshift(Sr.rawColor)),UrMt?1:0});for(var st=new Array(Fe.length),ct=ue[0].model.count,at=ue[0].categories.map(function($r){return $r.height}).reduce(function($r,Sr){return $r+Sr}),et=0;et0?Ae=at*(Pe.count/ct):Ae=0;for(var pe=new Array(H.length),Ne=0;Ne1?de=($.width-2*te-H)/(ae-1):de=0,Se=te,Le=Se+de*ie;var Fe=[],ze=$.model.maxCats,Ye=ue.categories.length,st=8,ct=ue.count,at=$.height-st*(ze-1),et,Pe,Ae,pe,Ne,ut=(ze-Ye)*st/2,dt=ue.categories.map(function(nt){return{displayInd:nt.displayInd,categoryInd:nt.categoryInd}});for(dt.sort(function(nt,Ft){return nt.displayInd-Ft.displayInd}),Ne=0;Ne0?et=Pe.count/ct*at:et=0,Ae={key:Pe.valueInds[0],model:Pe,width:H,height:et,y:Pe.dragY!==null?Pe.dragY:ut,bands:[],parcatsViewModel:$},ut=ut+et+st,Fe.push(Ae);return{key:ue.dimensionInd,x:ue.dragX!==null?ue.dragX:Le,y:0,width:H,model:ue,categories:Fe,parcatsViewModel:$,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),xL=Ge({"src/traces/parcats/plot.js"(K,G){var h=$z();G.exports=function(S,E,e,t){var r=S._fullLayout,o=r._paper,n=r._size;h(S,o,E,{width:n.w,height:n.h,margin:{t:n.t,r:n.r,b:n.b,l:n.l}},e,t)}}}),Kz=Ge({"src/traces/parcats/base_plot.js"(K){var G=Bd().getModuleCalcData,h=xL(),b="parcats";K.name=b,K.plot=function(S,E,e,t){var r=G(S.calcdata,b);if(r.length){var o=r[0];h(S,o,e,t)}},K.clean=function(S,E,e,t){var r=t._has&&t._has("parcats"),o=E._has&&E._has("parcats");r&&!o&&t._paperdiv.selectAll(".parcats").remove()}}}),Jz=Ge({"src/traces/parcats/index.js"(K,G){G.exports={attributes:_L(),supplyDefaults:Zz(),calc:Wz(),plot:xL(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:Kz(),categories:["noOpacity"],meta:{}}}}),Qz=Ge({"lib/parcats.js"(K,G){G.exports=Jz()}}),Wy=Ge({"src/plots/mapbox/constants.js"(K,G){var h=Op(),b="1.13.4",S='© OpenStreetMap contributors',E=['© Carto',S].join(" "),e=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),t=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),r={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:S,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},o=h(r);G.exports={requiredVersion:b,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:o,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+b+"."].join(` `),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(` `),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",o.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(` `),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(` -`),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}}),tS=Ge({"src/plots/mapbox/layout_attributes.js"($,G){var h=yn(),b=So().defaultLine,S=Sc().attributes,E=Fs(),e=jc().textposition,t=Uc().overrideAll,r=mu().templatedArray,o=Gy(),n=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[h.counterRegex("mapbox",".layers",!0)],domain:S({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:o.styleValuesMapbox.concat(o.styleValuesNonMapbox),dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:b},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:b}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:h.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),LE=Ge({"src/traces/scattermapbox/attributes.js"($,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=ad(),e=Xb(),t=jc(),r=tS(),o=nu(),n=Ru(),i=Qi().extendFlat,a=Uc().overrideAll,s=tS(),f=e.line,c=e.marker;G.exports=a({lon:e.lon,lat:e.lat,cluster:{enabled:{valType:"boolean"},maxzoom:i({},s.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:i({},c.opacity,{dflt:1})},mode:i({},t.mode,{dflt:"markers"}),text:i({},t.text,{}),texttemplate:b({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:i({},t.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:t.connectgaps,marker:i({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},n("marker")),fill:e.fill,fillcolor:E(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:i({},o.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:h(),hovertemplatefallback:S()},"calc","nested")}}),NC=Ge({"src/traces/scattermapbox/constants.js"($,G){var h=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];G.exports={isSupportedFont:function(b){return h.indexOf(b)!==-1}}}}),CD=Ge({"src/traces/scattermapbox/defaults.js"($,G){var h=yn(),b=ou(),S=Gv(),E=Fp(),e=ep(),t=Dv(),r=LE(),o=NC().isSupportedFont;G.exports=function(a,s,f,c){function p(v,y){return h.coerce(a,s,r,v,y)}function d(v,y){return h.coerce2(a,s,r,v,y)}var T=n(a,s,p);if(!T){s.visible=!1;return}if(p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback"),p("mode"),p("below"),b.hasMarkers(s)){S(a,s,f,c,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var l=s.marker;l.symbol!=="circle"&&(h.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),h.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}b.hasLines(s)&&(E(a,s,f,c,p,{noDash:!0}),p("connectgaps"));var g=d("cluster.maxzoom"),x=d("cluster.step"),A=d("cluster.color",s.marker&&s.marker.color||f),M=d("cluster.size"),_=d("cluster.opacity"),w=g!==!1||x!==!1||A!==!1||M!==!1||_!==!1,m=p("cluster.enabled",w);if(m||b.hasText(s)){var u=c.font.family;e(a,s,c,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:c.font.weight,style:c.font.style,size:c.font.size,color:c.font.color}})}p("fill"),s.fill!=="none"&&t(a,s,f,p),h.coerceSelectionMarkerOpacity(s,p)};function n(i,a,s){var f=s("lon")||[],c=s("lat")||[],p=Math.min(f.length,c.length);return a._length=p,p}}}),UC=Ge({"src/traces/scattermapbox/format_labels.js"($,G){var h=Ss();G.exports=function(S,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,n=S.lonlat;return t.lonLabel=h.tickText(o,o.c2l(n[0]),!0).text,t.latLabel=h.tickText(o,o.c2l(n[1]),!0).text,t}}}),jC=Ge({"src/plots/mapbox/convert_text_opts.js"($,G){var h=yn();G.exports=function(S,E){var e=S.split(" "),t=e[0],r=e[1],o=h.isArrayOrTypedArray(E)?h.mean(E):E,n=.5+o/100,i=1.5+o/100,a=["",""],s=[0,0];switch(t){case"top":a[0]="top",s[1]=-i;break;case"bottom":a[0]="bottom",s[1]=i;break}switch(r){case"left":a[1]="right",s[0]=-n;break;case"right":a[1]="left",s[0]=n;break}var f;return a[0]&&a[1]?f=a.join("-"):a[0]?f=a[0]:a[1]?f=a[1]:f="center",{anchor:f,offset:s}}}}),LD=Ge({"src/traces/scattermapbox/convert.js"($,G){var h=Ga(),b=yn(),S=hi().BADNUM,E=R_(),e=Ac(),t=Ms(),r=Pp(),o=ou(),n=NC().isSupportedFont,i=jC(),a=Hv().appendArrayPointValue,s=ec().NEWLINES,f=ec().BR_TAG_ALL;G.exports=function(_,w){var m=w[0].trace,u=m.visible===!0&&m._length!==0,v=m.fill!=="none",y=o.hasLines(m),I=o.hasMarkers(m),L=o.hasText(m),z=I&&m.marker.symbol==="circle",F=I&&m.marker.symbol!=="circle",N=m.cluster&&m.cluster.enabled,B=c("fill"),R=c("line"),U=c("circle"),j=c("symbol"),Z={fill:B,line:R,circle:U,symbol:j};if(!u)return Z;var re;if((v||y)&&(re=E.calcTraceToLineCoords(w)),v&&(B.geojson=E.makePolygon(re),B.layout.visibility="visible",b.extendFlat(B.paint,{"fill-color":m.fillcolor})),y&&(R.geojson=E.makeLine(re),R.layout.visibility="visible",b.extendFlat(R.paint,{"line-width":m.line.width,"line-color":m.line.color,"line-opacity":m.opacity})),z){var fe=p(w);U.geojson=fe.geojson,U.layout.visibility="visible",N&&(U.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(m.cluster.color,m.cluster.step),"circle-radius":x(m.cluster.size,m.cluster.step),"circle-opacity":x(m.cluster.opacity,m.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":A(m),"text-size":12}}),b.extendFlat(U.paint,{"circle-color":fe.mcc,"circle-radius":fe.mrc,"circle-opacity":fe.mo})}if(z&&N&&(U.filter=["!",["has","point_count"]]),(F||L)&&(j.geojson=d(w,_),b.extendFlat(j.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(b.extendFlat(j.layout,{"icon-size":m.marker.size/10}),"angle"in m.marker&&m.marker.angle!=="auto"&&b.extendFlat(j.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),j.layout["icon-allow-overlap"]=m.marker.allowoverlap,b.extendFlat(j.paint,{"icon-opacity":m.opacity*m.marker.opacity,"icon-color":m.marker.color})),L)){var le=(m.marker||{}).size,ce=i(m.textposition,le);b.extendFlat(j.layout,{"text-size":m.textfont.size,"text-anchor":ce.anchor,"text-offset":ce.offset,"text-font":A(m)}),b.extendFlat(j.paint,{"text-color":m.textfont.color,"text-opacity":m.opacity})}return Z};function c(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function p(M){var _=M[0].trace,w=_.marker,m=_.selectedpoints,u=b.isArrayOrTypedArray(w.color),v=b.isArrayOrTypedArray(w.size),y=b.isArrayOrTypedArray(w.opacity),I;function L(le){return _.opacity*le}function z(le){return le/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=b.identity);var N;v&&(N=r(_));var B;y&&(B=function(le){var ce=h(le)?+b.constrain(le,0,1):0;return L(ce)});var R=[];for(I=0;I850?I+=" Black":u>750?I+=" Extra Bold":u>650?I+=" Bold":u>550?I+=" Semi Bold":u>450?I+=" Medium":u>350?I+=" Regular":u>250?I+=" Light":u>150?I+=" Extra Light":I+=" Thin"):v.slice(0,2).join(" ")==="Open Sans"?(I="Open Sans",u>750?I+=" Extrabold":u>650?I+=" Bold":u>550?I+=" Semibold":u>350?I+=" Regular":I+=" Light"):v.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(I="Klokantech Noto Sans",v[3]==="CJK"&&(I+=" CJK"),I+=u>500?" Bold":" Regular")),y&&(I+=" Italic"),I==="Open Sans Regular Italic"?I="Open Sans Italic":I==="Open Sans Regular Bold"?I="Open Sans Bold":I==="Open Sans Regular Bold Italic"?I="Open Sans Bold Italic":I==="Klokantech Noto Sans Regular Italic"&&(I="Klokantech Noto Sans Italic"),n(I)||(I=w);var L=I.split(", ");return L}}}),PD=Ge({"src/traces/scattermapbox/plot.js"($,G){var h=yn(),b=LD(),S=Gy().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,n,i){this.type="scattermapbox",this.subplot=r,this.uid=o,this.clusterEnabled=n,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:S+o+"-fill",line:S+o+"-line",circle:S+o+"-circle",symbol:S+o+"-symbol",cluster:S+o+"-cluster",clusterCount:S+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,n){var i={type:"geojson",data:o.geojson};n&&n.enabled&&h.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[r]);a?a.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,n){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var a=this.layerIds[r],s,f=this.subplot.getMapLayers(),c=0;c=0;y--){var I=v[y];a.removeLayer(d.layerIds[I])}u||a.removeSource(d.sourceIds.circle)}function g(u){for(var v=E.nonCluster,y=0;y=0;y--){var I=v[y];a.removeLayer(d.layerIds[I]),u||a.removeSource(d.sourceIds[I])}}function A(u){p?l(u):x(u)}function M(u){c?T(u):g(u)}function _(){for(var u=c?E.cluster:E.nonCluster,v=0;v=0;i--){var a=n[i];o.removeLayer(this.layerIds[a]),o.removeSource(this.sourceIds[a])}},G.exports=function(o,n){var i=n[0].trace,a=i.cluster&&i.cluster.enabled,s=i.visible!==!0,f=new e(o,i.uid,a,s),c=b(o.gd,n),p=f.below=o.belowLookup["trace-"+i.uid],d,T,l;if(a)for(f.addSource("circle",c.circle,i.cluster),d=0;d=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=A*360,_=i-M;function w(N){var B=N.lonlat;if(B[0]===e||g&&T.indexOf(N.i+1)===-1)return 1/0;var R=b.modHalf(B[0],360),U=B[1],j=d.project([R,U]),Z=j.x-c.c2p([_,U]),re=j.y-p.c2p([R,a]),fe=Math.max(3,N.mrc||0);return Math.max(Math.sqrt(Z*Z+re*re)-fe,1-3/fe)}if(h.getClosest(s,w,n),n.index!==!1){var m=s[n.index],u=m.lonlat,v=[b.modHalf(u[0],360)+M,u[1]],y=c.c2p(v),I=p.c2p(v),L=m.mrc||1;n.x0=y-L,n.x1=y+L,n.y0=I-L,n.y1=I+L;var z={};z[f.subplot]={_subplot:d};var F=f._module.formatLabels(m,f,z);return n.lonLabel=F.lonLabel,n.latLabel=F.latLabel,n.color=S(f,m),n.extraText=o(f,m,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function o(n,i,a){if(n.hovertemplate)return;var s=i.hi||n.hoverinfo,f=s.split("+"),c=f.indexOf("all")!==-1,p=f.indexOf("lon")!==-1,d=f.indexOf("lat")!==-1,T=i.lonlat,l=[];function g(x){return x+"°"}return c||p&&d?l.push("("+g(T[1])+", "+g(T[0])+")"):p?l.push(a.lon+g(T[0])):d&&l.push(a.lat+g(T[1])),(c||f.indexOf("text")!==-1)&&E(i,n,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),RD=Ge({"src/traces/scattermapbox/event_data.js"($,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b}}}),ID=Ge({"src/traces/scattermapbox/select.js"($,G){var h=yn(),b=ou(),S=hi().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,n=e.yaxis,i=[],a=r[0].trace,s;if(!b.hasMarkers(a))return[];if(t===!1)for(s=0;s"u"&&(C=1e-6);var X,se,we,De,He;for(we=k,He=0;He<8;He++){if(De=this.sampleCurveX(we)-k,Math.abs(De)se)return se;for(;XDe?X=we:se=we,we=(se-X)*.5+X}return we},n.prototype.solve=function(k,C){return this.sampleCurveY(this.solveCurveX(k,C))};var i=a;function a(k,C){this.x=k,this.y=C}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(k){return this.clone()._add(k)},sub:function(k){return this.clone()._sub(k)},multByPoint:function(k){return this.clone()._multByPoint(k)},divByPoint:function(k){return this.clone()._divByPoint(k)},mult:function(k){return this.clone()._mult(k)},div:function(k){return this.clone()._div(k)},rotate:function(k){return this.clone()._rotate(k)},rotateAround:function(k,C){return this.clone()._rotateAround(k,C)},matMult:function(k){return this.clone()._matMult(k)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(k){return this.x===k.x&&this.y===k.y},dist:function(k){return Math.sqrt(this.distSqr(k))},distSqr:function(k){var C=k.x-this.x,X=k.y-this.y;return C*C+X*X},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(k){return Math.atan2(this.y-k.y,this.x-k.x)},angleWith:function(k){return this.angleWithSep(k.x,k.y)},angleWithSep:function(k,C){return Math.atan2(this.x*C-this.y*k,this.x*k+this.y*C)},_matMult:function(k){var C=k[0]*this.x+k[1]*this.y,X=k[2]*this.x+k[3]*this.y;return this.x=C,this.y=X,this},_add:function(k){return this.x+=k.x,this.y+=k.y,this},_sub:function(k){return this.x-=k.x,this.y-=k.y,this},_mult:function(k){return this.x*=k,this.y*=k,this},_div:function(k){return this.x/=k,this.y/=k,this},_multByPoint:function(k){return this.x*=k.x,this.y*=k.y,this},_divByPoint:function(k){return this.x/=k.x,this.y/=k.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var k=this.y;return this.y=this.x,this.x=-k,this},_rotate:function(k){var C=Math.cos(k),X=Math.sin(k),se=C*this.x-X*this.y,we=X*this.x+C*this.y;return this.x=se,this.y=we,this},_rotateAround:function(k,C){var X=Math.cos(k),se=Math.sin(k),we=C.x+X*(this.x-C.x)-se*(this.y-C.y),De=C.y+se*(this.x-C.x)+X*(this.y-C.y);return this.x=we,this.y=De,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(k){return k instanceof a?k:Array.isArray(k)?new a(k[0],k[1]):k};var s=typeof self<"u"?self:{};function f(k,C){if(Array.isArray(k)){if(!Array.isArray(C)||k.length!==C.length)return!1;for(var X=0;X=1)return 1;var C=k*k,X=C*k;return 4*(k<.5?X:3*(k-C)+X-.75)}function d(k,C,X,se){var we=new o(k,C,X,se);return function(De){return we.solve(De)}}var T=d(.25,.1,.25,1);function l(k,C,X){return Math.min(X,Math.max(C,k))}function g(k,C,X){var se=X-C,we=((k-C)%se+se)%se+C;return we===C?X:we}function x(k,C,X){if(!k.length)return X(null,[]);var se=k.length,we=new Array(k.length),De=null;k.forEach(function(He,mt){C(He,function(jt,tr){jt&&(De=jt),we[mt]=tr,--se===0&&X(De,we)})})}function A(k){var C=[];for(var X in k)C.push(k[X]);return C}function M(k,C){var X=[];for(var se in k)se in C||X.push(se);return X}function _(k){for(var C=[],X=arguments.length-1;X-- >0;)C[X]=arguments[X+1];for(var se=0,we=C;se>C/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,k)}return k()}function y(k){return k<=1?1:Math.pow(2,Math.ceil(Math.log(k)/Math.LN2))}function I(k){return k?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(k):!1}function L(k,C){k.forEach(function(X){C[X]&&(C[X]=C[X].bind(C))})}function z(k,C){return k.indexOf(C,k.length-C.length)!==-1}function F(k,C,X){var se={};for(var we in k)se[we]=C.call(X||this,k[we],we,k);return se}function N(k,C,X){var se={};for(var we in k)C.call(X||this,k[we],we,k)&&(se[we]=k[we]);return se}function B(k){return Array.isArray(k)?k.map(B):typeof k=="object"&&k?F(k,B):k}function R(k,C){for(var X=0;X=0)return!0;return!1}var U={};function j(k){U[k]||(typeof console<"u"&&console.warn(k),U[k]=!0)}function Z(k,C,X){return(X.y-k.y)*(C.x-k.x)>(C.y-k.y)*(X.x-k.x)}function re(k){for(var C=0,X=0,se=k.length,we=se-1,De=void 0,He=void 0;X@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,X={};if(k.replace(C,function(we,De,He,mt){var jt=He||mt;return X[De]=jt?jt.toLowerCase():!0,""}),X["max-age"]){var se=parseInt(X["max-age"],10);isNaN(se)?delete X["max-age"]:X["max-age"]=se}return X}var V=null;function ee(k){if(V==null){var C=k.navigator?k.navigator.userAgent:null;V=!!k.safari||!!(C&&(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return V}function ne(k){try{var C=s[k];return C.setItem("_mapbox_test_",1),C.removeItem("_mapbox_test_"),!0}catch{return!1}}function K(k){return s.btoa(encodeURIComponent(k).replace(/%([0-9A-F]{2})/g,function(C,X){return String.fromCharCode(+("0x"+X))}))}function ue(k){return decodeURIComponent(s.atob(k).split("").map(function(C){return"%"+("00"+C.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var te=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),H=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,ae=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,ie,ve,Ae={now:te,frame:function(C){var X=H(C);return{cancel:function(){return ae(X)}}},getImageData:function(C,X){X===void 0&&(X=0);var se=s.document.createElement("canvas"),we=se.getContext("2d");if(!we)throw new Error("failed to create canvas 2d context");return se.width=C.width,se.height=C.height,we.drawImage(C,0,0,C.width,C.height),we.getImageData(-X,-X,C.width+2*X,C.height+2*X)},resolveURL:function(C){return ie||(ie=s.document.createElement("a")),ie.href=C,ie.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(ve==null&&(ve=s.matchMedia("(prefers-reduced-motion: reduce)")),ve.matches):!1}},Ce={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Fe={supported:!1,testSupport:nt},ze,Ye=!1,it,st=!1;s.document&&(it=s.document.createElement("img"),it.onload=function(){ze&&Qe(ze),ze=null,st=!0},it.onerror=function(){Ye=!0,ze=null},it.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function nt(k){Ye||!it||(st?Qe(k):ze=k)}function Qe(k){var C=k.createTexture();k.bindTexture(k.TEXTURE_2D,C);try{if(k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,it),k.isContextLost())return;Fe.supported=!0}catch{}k.deleteTexture(C),Ye=!0}var Le="01";function Te(){for(var k="1",C="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",X="",se=0;se<10;se++)X+=C[Math.floor(Math.random()*62)];var we=720*60*1e3,De=[k,Le,X].join(""),He=Date.now()+we;return{token:De,tokenExpiresAt:He}}var pe=function(C,X){this._transformRequestFn=C,this._customAccessToken=X,this._createSkuToken()};pe.prototype._createSkuToken=function(){var C=Te();this._skuToken=C.token,this._skuTokenExpiresAt=C.tokenExpiresAt},pe.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},pe.prototype.transformRequest=function(C,X){return this._transformRequestFn?this._transformRequestFn(C,X)||{url:C}:{url:C}},pe.prototype.normalizeStyleURL=function(C,X){if(!Ne(C))return C;var se=$t(C);return se.path="/styles/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||X)},pe.prototype.normalizeGlyphsURL=function(C,X){if(!Ne(C))return C;var se=$t(C);return se.path="/fonts/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||X)},pe.prototype.normalizeSourceURL=function(C,X){if(!Ne(C))return C;var se=$t(C);return se.path="/v4/"+se.authority+".json",se.params.push("secure"),this._makeAPIURL(se,this._customAccessToken||X)},pe.prototype.normalizeSpriteURL=function(C,X,se,we){var De=$t(C);return Ne(C)?(De.path="/styles/v1"+De.path+"/sprite"+X+se,this._makeAPIURL(De,this._customAccessToken||we)):(De.path+=""+X+se,rr(De))},pe.prototype.normalizeTileURL=function(C,X){if(this._isSkuTokenExpired()&&this._createSkuToken(),C&&!Ne(C))return C;var se=$t(C),we=/(\.(png|jpg)\d*)(?=$)/,De=/^.+\/v4\//,He=Ae.devicePixelRatio>=2||X===512?"@2x":"",mt=Fe.supported?".webp":"$1";se.path=se.path.replace(we,""+He+mt),se.path=se.path.replace(De,"/"),se.path="/v4"+se.path;var jt=this._customAccessToken||Ft(se.params)||Ce.ACCESS_TOKEN;return Ce.REQUIRE_ACCESS_TOKEN&&jt&&this._skuToken&&se.params.push("sku="+this._skuToken),this._makeAPIURL(se,jt)},pe.prototype.canonicalizeTileURL=function(C,X){var se="/v4/",we=/\.[\w]+$/,De=$t(C);if(!De.path.match(/(^\/v4\/)/)||!De.path.match(we))return C;var He="mapbox://tiles/";He+=De.path.replace(se,"");var mt=De.params;return X&&(mt=mt.filter(function(jt){return!jt.match(/^access_token=/)})),mt.length&&(He+="?"+mt.join("&")),He},pe.prototype.canonicalizeTileset=function(C,X){for(var se=X?Ne(X):!1,we=[],De=0,He=C.tiles||[];De=0&&C.params.splice(De,1)}if(we.path!=="/"&&(C.path=""+we.path+C.path),!Ce.REQUIRE_ACCESS_TOKEN)return rr(C);if(X=X||Ce.ACCESS_TOKEN,!X)throw new Error("An API access token is required to use Mapbox GL. "+se);if(X[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+se);return C.params=C.params.filter(function(He){return He.indexOf("access_token")===-1}),C.params.push("access_token="+X),rr(C)};function Ne(k){return k.indexOf("mapbox:")===0}var ot=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function ft(k){return ot.test(k)}function rt(k){return k.indexOf("sku=")>0&&ft(k)}function Ft(k){for(var C=0,X=k;C=1&&s.localStorage.setItem(X,JSON.stringify(this.eventData))}catch{j("Unable to write to LocalStorage")}},Wr.prototype.processRequests=function(C){},Wr.prototype.postEvent=function(C,X,se,we){var De=this;if(Ce.EVENTS_URL){var He=$t(Ce.EVENTS_URL);He.params.push("access_token="+(we||Ce.ACCESS_TOKEN||""));var mt={event:this.type,created:new Date(C).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:Le,userId:this.anonId},jt=X?_(mt,X):mt,tr={url:rr(He),headers:{"Content-Type":"text/plain"},body:JSON.stringify([jt])};this.pendingRequest=wn(tr,function(fr){De.pendingRequest=null,se(fr),De.saveEventData(),De.processRequests(we)})}},Wr.prototype.queueRequest=function(C,X){this.queue.push(C),this.processRequests(X)};var Sr=(function(k){function C(){k.call(this,"map.load"),this.success={},this.skuToken=""}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postMapLoadEvent=function(se,we,De,He){this.skuToken=De,(Ce.EVENTS_URL&&He||Ce.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(mt){return Ne(mt)||ft(mt)}))&&this.queueRequest({id:we,timestamp:Date.now()},He)},C.prototype.processRequests=function(se){var we=this;if(!(this.pendingRequest||this.queue.length===0)){var De=this.queue.shift(),He=De.id,mt=De.timestamp;He&&this.success[He]||(this.anonId||this.fetchEventData(),I(this.anonId)||(this.anonId=v()),this.postEvent(mt,{skuToken:this.skuToken},function(jt){jt||He&&(we.success[He]=!0)},se))}},C})(Wr),Br=(function(k){function C(X){k.call(this,"appUserTurnstile"),this._customAccessToken=X}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postTurnstileEvent=function(se,we){Ce.EVENTS_URL&&Ce.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(De){return Ne(De)||ft(De)})&&this.queueRequest(Date.now(),we)},C.prototype.processRequests=function(se){var we=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var De=Mr(Ce.ACCESS_TOKEN),He=De?De.u:Ce.ACCESS_TOKEN,mt=He!==this.eventData.tokenU;I(this.anonId)||(this.anonId=v(),mt=!0);var jt=this.queue.shift();if(this.eventData.lastSuccess){var tr=new Date(this.eventData.lastSuccess),fr=new Date(jt),Or=(jt-this.eventData.lastSuccess)/(1440*60*1e3);mt=mt||Or>=1||Or<-1||tr.getDate()!==fr.getDate()}else mt=!0;if(!mt)return this.processRequests();this.postEvent(jt,{"enabled.telemetry":!1},function(en){en||(we.eventData.lastSuccess=jt,we.eventData.tokenU=He)},se)}},C})(Wr),Mt=new Br,je=Mt.postTurnstileEvent.bind(Mt),$e=new Sr,Ee=$e.postMapLoadEvent.bind($e),xe="mapbox-tiles",ye=500,Me=50,Xe=1e3*60*7,Je;function Lt(){s.caches&&!Je&&(Je=s.caches.open(xe))}var Ct;function Ot(k,C){if(Ct===void 0)try{new Response(new ReadableStream),Ct=!0}catch{Ct=!1}Ct?C(k.body):k.blob().then(C)}function Wt(k,C,X){if(Lt(),!!Je){var se={status:C.status,statusText:C.statusText,headers:new s.Headers};C.headers.forEach(function(He,mt){return se.headers.set(mt,He)});var we=ce(C.headers.get("Cache-Control")||"");if(!we["no-store"]){we["max-age"]&&se.headers.set("Expires",new Date(X+we["max-age"]*1e3).toUTCString());var De=new Date(se.headers.get("Expires")).getTime()-X;DeDate.now()&&!X["no-cache"]}var Fr=1/0;function En(k){Fr++,Fr>Me&&(k.getActor().send("enforceCacheSizeLimit",ye),Fr=0)}function Kn(k){Lt(),Je&&Je.then(function(C){C.keys().then(function(X){for(var se=0;se=200&&X.status<300||X.status===0)&&X.response!==null){var we=X.response;if(k.type==="json")try{we=JSON.parse(X.response)}catch(De){return C(De)}C(null,we,X.getResponseHeader("Cache-Control"),X.getResponseHeader("Expires"))}else C(new qa(X.statusText,X.status,k.url))},X.send(k.body),{cancel:function(){return X.abort()}}}var Vr=function(k,C){if(!qt(k.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return ar(k,C);if(le()&&self.worker&&self.worker.actor){var X=!0;return self.worker.actor.send("getResource",k,C,void 0,X)}}return lr(k,C)},sn=function(k,C){return Vr(_(k,{type:"json"}),C)},mn=function(k,C){return Vr(_(k,{type:"arrayBuffer"}),C)},wn=function(k,C){return Vr(_(k,{method:"POST"}),C)};function Jn(k){var C=s.document.createElement("a");return C.href=k,C.protocol===s.document.location.protocol&&C.host===s.document.location.host}var pa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function ha(k,C,X,se){var we=new s.Image,De=s.URL;we.onload=function(){C(null,we),De.revokeObjectURL(we.src),we.onload=null,s.requestAnimationFrame(function(){we.src=pa})},we.onerror=function(){return C(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var He=new s.Blob([new Uint8Array(k)],{type:"image/png"});we.cacheControl=X,we.expires=se,we.src=k.byteLength?De.createObjectURL(He):pa}function _a(k,C){var X=new s.Blob([new Uint8Array(k)],{type:"image/png"});s.createImageBitmap(X).then(function(se){C(null,se)}).catch(function(se){C(new Error("Could not load image because of "+se.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var Ca,Vn,yi=function(){Ca=[],Vn=0};yi();var Ci=function(k,C){if(Fe.supported&&(k.headers||(k.headers={}),k.headers.accept="image/webp,*/*"),Vn>=Ce.MAX_PARALLEL_IMAGE_REQUESTS){var X={requestParameters:k,callback:C,cancelled:!1,cancel:function(){this.cancelled=!0}};return Ca.push(X),X}Vn++;var se=!1,we=function(){if(!se)for(se=!0,Vn--;Ca.length&&Vn0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)},Ir.prototype.setEventedParent=function(C,X){return this._eventedParent=C,this._eventedParentData=X,this};var Ur=8,ln={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},$r={"*":{type:"source"}},At=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],or={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Dr={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},un={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Rn={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},jn={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Un={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},cn={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},In=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],xi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ea={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Pi={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Xi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},uo={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},so={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Eo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},vi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ns={type:"array",value:"*"},Xo={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},Ys={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},vs={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},es={type:"array",value:"*",minimum:1},qo={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},Zs=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Hs={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},sl={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},ds={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},Ko={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},_o={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},ps={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},ll={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},kl={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Rl={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Cs={"*":{type:"string"}},pi={$version:Ur,$root:ln,sources:$r,source:At,source_vector:or,source_raster:Dr,source_raster_dem:un,source_geojson:Rn,source_video:jn,source_image:Un,layer:cn,layout:In,layout_background:xi,layout_fill:Ea,layout_circle:Pi,layout_heatmap:Xi,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:uo,layout_symbol:so,layout_raster:Eo,layout_hillshade:vi,filter:ns,filter_operator:Xo,geometry_type:Ys,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:vs,expression:es,light:qo,paint:Zs,paint_fill:Hs,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:sl,paint_circle:ds,paint_heatmap:Ko,paint_symbol:_o,paint_raster:ps,paint_hillshade:ll,paint_background:kl,transition:Rl,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:Cs},no=function(C,X,se,we){this.message=(C?C+": ":"")+se,we&&(this.identifier=we),X!=null&&X.__line__&&(this.line=X.__line__)};function Cl(k){var C=k.key,X=k.value;return X?[new no(C,X,"constants have been deprecated as of v8")]:[]}function Ds(k){for(var C=[],X=arguments.length-1;X-- >0;)C[X]=arguments[X+1];for(var se=0,we=C;se":k.itemType.kind==="value"?"array":"array<"+C+">"}else return k.kind}var Hu=[xu,eo,_s,as,Hl,Bs,Gl,Bl(Do),wl];function uf(k,C){if(C.kind==="error")return null;if(k.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!uf(k.itemType,C.itemType))&&(typeof k.N!="number"||k.N===C.N))return null}else{if(k.kind===C.kind)return null;if(k.kind==="value")for(var X=0,se=Hu;X255?255:tr}function we(tr){return tr<0?0:tr>1?1:tr}function De(tr){return tr[tr.length-1]==="%"?se(parseFloat(tr)/100*255):se(parseInt(tr))}function He(tr){return tr[tr.length-1]==="%"?we(parseFloat(tr)/100):we(parseFloat(tr))}function mt(tr,fr,Or){return Or<0?Or+=1:Or>1&&(Or-=1),Or*6<1?tr+(fr-tr)*Or*6:Or*2<1?fr:Or*3<2?tr+(fr-tr)*(2/3-Or)*6:tr}function jt(tr){var fr=tr.replace(/ /g,"").toLowerCase();if(fr in X)return X[fr].slice();if(fr[0]==="#"){if(fr.length===4){var Or=parseInt(fr.substr(1),16);return Or>=0&&Or<=4095?[(Or&3840)>>4|(Or&3840)>>8,Or&240|(Or&240)>>4,Or&15|(Or&15)<<4,1]:null}else if(fr.length===7){var Or=parseInt(fr.substr(1),16);return Or>=0&&Or<=16777215?[(Or&16711680)>>16,(Or&65280)>>8,Or&255,1]:null}return null}var en=fr.indexOf("("),Kr=fr.indexOf(")");if(en!==-1&&Kr+1===fr.length){var xn=fr.substr(0,en),$n=fr.substr(en+1,Kr-(en+1)).split(","),ja=1;switch(xn){case"rgba":if($n.length!==4)return null;ja=He($n.pop());case"rgb":return $n.length!==3?null:[De($n[0]),De($n[1]),De($n[2]),ja];case"hsla":if($n.length!==4)return null;ja=He($n.pop());case"hsl":if($n.length!==3)return null;var ba=(parseFloat($n[0])%360+360)%360/360,_i=He($n[1]),Qa=He($n[2]),gi=Qa<=.5?Qa*(_i+1):Qa+_i-Qa*_i,Li=Qa*2-gi;return[se(mt(Li,gi,ba+1/3)*255),se(mt(Li,gi,ba)*255),se(mt(Li,gi,ba-1/3)*255),ja];default:return null}}return null}try{C.parseCSSColor=jt}catch{}}),yh=Lh.parseCSSColor,Tl=function(C,X,se,we){we===void 0&&(we=1),this.r=C,this.g=X,this.b=se,this.a=we};Tl.parse=function(C){if(C){if(C instanceof Tl)return C;if(typeof C=="string"){var X=yh(C);if(X)return new Tl(X[0]/255*X[3],X[1]/255*X[3],X[2]/255*X[3],X[3])}}},Tl.prototype.toString=function(){var C=this.toArray(),X=C[0],se=C[1],we=C[2],De=C[3];return"rgba("+Math.round(X)+","+Math.round(se)+","+Math.round(we)+","+De+")"},Tl.prototype.toArray=function(){var C=this,X=C.r,se=C.g,we=C.b,De=C.a;return De===0?[0,0,0,0]:[X*255/De,se*255/De,we*255/De,De]},Tl.black=new Tl(0,0,0,1),Tl.white=new Tl(1,1,1,1),Tl.transparent=new Tl(0,0,0,0),Tl.red=new Tl(1,0,0,1);var Lc=function(C,X,se){C?this.sensitivity=X?"variant":"case":this.sensitivity=X?"accent":"base",this.locale=se,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Lc.prototype.compare=function(C,X){return this.collator.compare(C,X)},Lc.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Ph=function(C,X,se,we,De){this.text=C,this.image=X,this.scale=se,this.fontStack=we,this.textColor=De},nc=function(C){this.sections=C};nc.fromString=function(C){return new nc([new Ph(C,null,null,null,null)])},nc.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(C){return C.text.length!==0||C.image&&C.image.name.length!==0})},nc.factory=function(C){return C instanceof nc?C:nc.fromString(C)},nc.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(C){return C.text}).join("")},nc.prototype.serialize=function(){for(var C=["format"],X=0,se=this.sections;X=0&&k<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof X=="number"&&X>=0&&X<=255)){var we=typeof se=="number"?[k,C,X,se]:[k,C,X];return"Invalid rgba value ["+we.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof se>"u"||typeof se=="number"&&se>=0&&se<=1?null:"Invalid rgba value ["+[k,C,X,se].join(", ")+"]: 'a' must be between 0 and 1."}function ef(k){if(k===null)return!0;if(typeof k=="string")return!0;if(typeof k=="boolean")return!0;if(typeof k=="number")return!0;if(k instanceof Tl)return!0;if(k instanceof Lc)return!0;if(k instanceof nc)return!0;if(k instanceof Gu)return!0;if(Array.isArray(k)){for(var C=0,X=k;C2){var mt=C[1];if(typeof mt!="string"||!(mt in wf)||mt==="object")return X.error('The item type argument of "array" must be one of string, number, boolean',1);He=wf[mt],se++}else He=Do;var jt;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return X.error('The length argument to "array" must be a positive integer literal',2);jt=C[2],se++}we=Bl(He,jt)}else we=wf[De];for(var tr=[];se1)&&X.push(we)}}return X.concat(this.args.map(function(De){return De.serialize()}))};var If=function(C){this.type=Bs,this.sections=C};If.parse=function(C,X){if(C.length<2)return X.error("Expected at least one argument.");var se=C[1];if(!Array.isArray(se)&&typeof se=="object")return X.error("First argument must be an image or text section.");for(var we=[],De=!1,He=1;He<=C.length-1;++He){var mt=C[He];if(De&&typeof mt=="object"&&!Array.isArray(mt)){De=!1;var jt=null;if(mt["font-scale"]&&(jt=X.parse(mt["font-scale"],1,eo),!jt))return null;var tr=null;if(mt["text-font"]&&(tr=X.parse(mt["text-font"],1,Bl(_s)),!tr))return null;var fr=null;if(mt["text-color"]&&(fr=X.parse(mt["text-color"],1,Hl),!fr))return null;var Or=we[we.length-1];Or.scale=jt,Or.font=tr,Or.textColor=fr}else{var en=X.parse(C[He],1,Do);if(!en)return null;var Kr=en.type.kind;if(Kr!=="string"&&Kr!=="value"&&Kr!=="null"&&Kr!=="resolvedImage")return X.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");De=!0,we.push({content:en,scale:null,font:null,textColor:null})}}return new If(we)},If.prototype.evaluate=function(C){var X=function(se){var we=se.content.evaluate(C);return Kl(we)===wl?new Ph("",we,null,null,null):new Ph(Xu(we),null,se.scale?se.scale.evaluate(C):null,se.font?se.font.evaluate(C).join(","):null,se.textColor?se.textColor.evaluate(C):null)};return new nc(this.sections.map(X))},If.prototype.eachChild=function(C){for(var X=0,se=this.sections;X-1),se},lu.prototype.eachChild=function(C){C(this.input)},lu.prototype.outputDefined=function(){return!1},lu.prototype.serialize=function(){return["image",this.input.serialize()]};var bv={"to-boolean":as,"to-color":Hl,"to-number":eo,"to-string":_s},Ns=function(C,X){this.type=C,this.args=X};Ns.parse=function(C,X){if(C.length<2)return X.error("Expected at least one argument.");var se=C[0];if((se==="to-boolean"||se==="to-string")&&C.length!==2)return X.error("Expected one argument.");for(var we=bv[se],De=[],He=1;He4?se="Invalid rbga value "+JSON.stringify(X)+": expected an array containing either three or four numeric values.":se=ac(X[0],X[1],X[2],X[3]),!se))return new Tl(X[0]/255,X[1]/255,X[2]/255,X[3])}throw new Dl(se||"Could not parse color from value '"+(typeof X=="string"?X:String(JSON.stringify(X)))+"'")}else if(this.type.kind==="number"){for(var jt=null,tr=0,fr=this.args;tr=C[2]||k[1]<=C[1]||k[3]>=C[3])}function sv(k,C){var X=Df(k[0]),se=ih(k[1]),we=Math.pow(2,C.z);return[Math.round(X*we*Iu),Math.round(se*we*Iu)]}function Uh(k,C,X){var se=k[0]-C[0],we=k[1]-C[1],De=k[0]-X[0],He=k[1]-X[1];return se*He-De*we===0&&se*De<=0&&we*He<=0}function oh(k,C,X){return C[1]>k[1]!=X[1]>k[1]&&k[0]<(X[0]-C[0])*(k[1]-C[1])/(X[1]-C[1])+C[0]}function zf(k,C){for(var X=!1,se=0,we=C.length;se0&&Or<0||fr<0&&Or>0}function jh(k,C,X,se){var we=[C[0]-k[0],C[1]-k[1]],De=[se[0]-X[0],se[1]-X[1]];return Dh(De,we)===0?!1:!!(rf(k,C,X,se)&&rf(X,se,k,C))}function Tf(k,C,X){for(var se=0,we=X;seX[2]){var we=se*.5,De=k[0]-X[0]>we?-se:X[0]-k[0]>we?se:0;De===0&&(De=k[0]-X[2]>we?-se:X[2]-k[0]>we?se:0),k[0]+=De}Rh(C,k)}function _h(k){k[0]=k[1]=1/0,k[2]=k[3]=-1/0}function wv(k,C,X,se){for(var we=Math.pow(2,se.z)*Iu,De=[se.x*Iu,se.y*Iu],He=[],mt=0,jt=k;mt=0)return!1;var X=!0;return k.eachChild(function(se){X&&!Rc(se,C)&&(X=!1)}),X}var Of=function(C,X){this.type=X.type,this.name=C,this.boundExpression=X};Of.parse=function(C,X){if(C.length!==2||typeof C[1]!="string")return X.error("'var' expression requires exactly one string literal argument.");var se=C[1];return X.scope.has(se)?new Of(se,X.scope.get(se)):X.error('Unknown variable "'+se+'". Make sure "'+se+'" has been bound in an enclosing "let" expression before using it.',1)},Of.prototype.evaluate=function(C){return this.boundExpression.evaluate(C)},Of.prototype.eachChild=function(){},Of.prototype.outputDefined=function(){return!1},Of.prototype.serialize=function(){return["var",this.name]};var $l=function(C,X,se,we,De){X===void 0&&(X=[]),we===void 0&&(we=new ul),De===void 0&&(De=[]),this.registry=C,this.path=X,this.key=X.map(function(He){return"["+He+"]"}).join(""),this.scope=we,this.errors=De,this.expectedType=se};$l.prototype.parse=function(C,X,se,we,De){return De===void 0&&(De={}),X?this.concat(X,se,we)._parse(C,De):this._parse(C,De)},$l.prototype._parse=function(C,X){(C===null||typeof C=="string"||typeof C=="boolean"||typeof C=="number")&&(C=["literal",C]);function se(fr,Or,en){return en==="assert"?new yc(Or,[fr]):en==="coerce"?new Ns(Or,[fr]):fr}if(Array.isArray(C)){if(C.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var we=C[0];if(typeof we!="string")return this.error("Expression name must be a string, but found "+typeof we+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var De=this.registry[we];if(De){var He=De.parse(C,this);if(!He)return null;if(this.expectedType){var mt=this.expectedType,jt=He.type;if((mt.kind==="string"||mt.kind==="number"||mt.kind==="boolean"||mt.kind==="object"||mt.kind==="array")&&jt.kind==="value")He=se(He,mt,X.typeAnnotation||"assert");else if((mt.kind==="color"||mt.kind==="formatted"||mt.kind==="resolvedImage")&&(jt.kind==="value"||jt.kind==="string"))He=se(He,mt,X.typeAnnotation||"coerce");else if(this.checkSubtype(mt,jt))return null}if(!(He instanceof Gs)&&He.type.kind!=="resolvedImage"&&Af(He)){var tr=new dl;try{He=new Gs(He.type,He.evaluate(tr))}catch(fr){return this.error(fr.message),null}}return He}return this.error('Unknown expression "'+we+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof C>"u"?this.error("'undefined' value invalid. Use null instead."):typeof C=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof C+" instead.")},$l.prototype.concat=function(C,X,se){var we=typeof C=="number"?this.path.concat(C):this.path,De=se?this.scope.concat(se):this.scope;return new $l(this.registry,we,X||null,De,this.errors)},$l.prototype.error=function(C){for(var X=[],se=arguments.length-1;se-- >0;)X[se]=arguments[se+1];var we=""+this.key+X.map(function(De){return"["+De+"]"}).join("");this.errors.push(new Ws(we,C))},$l.prototype.checkSubtype=function(C,X){var se=uf(C,X);return se&&this.error(se),se};function Af(k){if(k instanceof Of)return Af(k.boundExpression);if(k instanceof Bo&&k.name==="error")return!1;if(k instanceof tf)return!1;if(k instanceof Pc)return!1;var C=k instanceof Ns||k instanceof yc,X=!0;return k.eachChild(function(se){C?X=X&&Af(se):X=X&&se instanceof Gs}),X?Hh(k)&&Rc(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function vc(k,C){for(var X=k.length-1,se=0,we=X,De=0,He,mt;se<=we;)if(De=Math.floor((se+we)/2),He=k[De],mt=k[De+1],He<=C){if(De===X||CC)we=De-1;else throw new Dl("Input is not a number.");return 0}var Ic=function(C,X,se){this.type=C,this.input=X,this.labels=[],this.outputs=[];for(var we=0,De=se;we=mt)return X.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',tr);var Or=X.parse(jt,fr,De);if(!Or)return null;De=De||Or.type,we.push([mt,Or])}return new Ic(De,se,we)},Ic.prototype.evaluate=function(C){var X=this.labels,se=this.outputs;if(X.length===1)return se[0].evaluate(C);var we=this.input.evaluate(C);if(we<=X[0])return se[0].evaluate(C);var De=X.length;if(we>=X[De-1])return se[De-1].evaluate(C);var He=vc(X,we);return se[He].evaluate(C)},Ic.prototype.eachChild=function(C){C(this.input);for(var X=0,se=this.outputs;X0&&C.push(this.labels[X]),C.push(this.outputs[X].serialize());return C};function uu(k,C,X){return k*(1-X)+C*X}function $f(k,C,X){return new Tl(uu(k.r,C.r,X),uu(k.g,C.g,X),uu(k.b,C.b,X),uu(k.a,C.a,X))}function ff(k,C,X){return k.map(function(se,we){return uu(se,C[we],X)})}var Ff=Object.freeze({__proto__:null,number:uu,color:$f,array:ff}),xh=.95047,Tv=1,Zv=1.08883,Jf=4/29,bh=6/29,Vc=3*bh*bh,wh=bh*bh*bh,ic=Math.PI/180,Qf=180/Math.PI;function Gh(k){return k>wh?Math.pow(k,1/3):k/Vc+Jf}function eh(k){return k>bh?k*k*k:Vc*(k-Jf)}function tu(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function Dc(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function nf(k){var C=Dc(k.r),X=Dc(k.g),se=Dc(k.b),we=Gh((.4124564*C+.3575761*X+.1804375*se)/xh),De=Gh((.2126729*C+.7151522*X+.072175*se)/Tv),He=Gh((.0193339*C+.119192*X+.9503041*se)/Zv);return{l:116*De-16,a:500*(we-De),b:200*(De-He),alpha:k.a}}function Oh(k){var C=(k.l+16)/116,X=isNaN(k.a)?C:C+k.a/500,se=isNaN(k.b)?C:C-k.b/200;return C=Tv*eh(C),X=xh*eh(X),se=Zv*eh(se),new Tl(tu(3.2404542*X-1.5371385*C-.4985314*se),tu(-.969266*X+1.8760108*C+.041556*se),tu(.0556434*X-.2040259*C+1.0572252*se),k.alpha)}function iu(k,C,X){return{l:uu(k.l,C.l,X),a:uu(k.a,C.a,X),b:uu(k.b,C.b,X),alpha:uu(k.alpha,C.alpha,X)}}function lh(k){var C=nf(k),X=C.l,se=C.a,we=C.b,De=Math.atan2(we,se)*Qf;return{h:De<0?De+360:De,c:Math.sqrt(se*se+we*we),l:X,alpha:k.a}}function Bf(k){var C=k.h*ic,X=k.c,se=k.l;return Oh({l:se,a:Math.cos(C)*X,b:Math.sin(C)*X,alpha:k.alpha})}function Hc(k,C,X){var se=C-k;return k+X*(se>180||se<-180?se-360*Math.round(se/360):se)}function uh(k,C,X){return{h:Hc(k.h,C.h,X),c:uu(k.c,C.c,X),l:uu(k.l,C.l,X),alpha:uu(k.alpha,C.alpha,X)}}var hf={forward:nf,reverse:Oh,interpolate:iu},ch={forward:lh,reverse:Bf,interpolate:uh},Av=Object.freeze({__proto__:null,lab:hf,hcl:ch}),lc=function(C,X,se,we,De){this.type=C,this.operator=X,this.interpolation=se,this.input=we,this.labels=[],this.outputs=[];for(var He=0,mt=De;He1}))return X.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);we={name:"cubic-bezier",controlPoints:jt}}else return X.error("Unknown interpolation type "+String(we[0]),1,0);if(C.length-1<4)return X.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return X.error("Expected an even number of arguments.");if(De=X.parse(De,2,eo),!De)return null;var tr=[],fr=null;se==="interpolate-hcl"||se==="interpolate-lab"?fr=Hl:X.expectedType&&X.expectedType.kind!=="value"&&(fr=X.expectedType);for(var Or=0;Or=en)return X.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',xn);var ja=X.parse(Kr,$n,fr);if(!ja)return null;fr=fr||ja.type,tr.push([en,ja])}return fr.kind!=="number"&&fr.kind!=="color"&&!(fr.kind==="array"&&fr.itemType.kind==="number"&&typeof fr.N=="number")?X.error("Type "+jl(fr)+" is not interpolatable."):new lc(fr,se,we,De,tr)},lc.prototype.evaluate=function(C){var X=this.labels,se=this.outputs;if(X.length===1)return se[0].evaluate(C);var we=this.input.evaluate(C);if(we<=X[0])return se[0].evaluate(C);var De=X.length;if(we>=X[De-1])return se[De-1].evaluate(C);var He=vc(X,we),mt=X[He],jt=X[He+1],tr=lc.interpolationFactor(this.interpolation,we,mt,jt),fr=se[He].evaluate(C),Or=se[He+1].evaluate(C);return this.operator==="interpolate"?Ff[this.type.kind.toLowerCase()](fr,Or,tr):this.operator==="interpolate-hcl"?ch.reverse(ch.interpolate(ch.forward(fr),ch.forward(Or),tr)):hf.reverse(hf.interpolate(hf.forward(fr),hf.forward(Or),tr))},lc.prototype.eachChild=function(C){C(this.input);for(var X=0,se=this.outputs;X=se.length)throw new Dl("Array index out of bounds: "+X+" > "+(se.length-1)+".");if(X!==Math.floor(X))throw new Dl("Array index must be an integer, but found "+X+" instead.");return se[X]},vf.prototype.eachChild=function(C){C(this.index),C(this.input)},vf.prototype.outputDefined=function(){return!1},vf.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var bu=function(C,X){this.type=as,this.needle=C,this.haystack=X};bu.parse=function(C,X){if(C.length!==3)return X.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1,Do),we=X.parse(C[2],2,Do);return!se||!we?null:qc(se.type,[as,_s,eo,xu,Do])?new bu(se,we):X.error("Expected first argument to be of type boolean, string, number or null, but found "+jl(se.type)+" instead")},bu.prototype.evaluate=function(C){var X=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!se)return!1;if(!Qc(X,["boolean","string","number","null"]))throw new Dl("Expected first argument to be of type boolean, string, number or null, but found "+jl(Kl(X))+" instead.");if(!Qc(se,["string","array"]))throw new Dl("Expected second argument to be of type array or string, but found "+jl(Kl(se))+" instead.");return se.indexOf(X)>=0},bu.prototype.eachChild=function(C){C(this.needle),C(this.haystack)},bu.prototype.outputDefined=function(){return!0},bu.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var _c=function(C,X,se){this.type=eo,this.needle=C,this.haystack=X,this.fromIndex=se};_c.parse=function(C,X){if(C.length<=2||C.length>=5)return X.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1,Do),we=X.parse(C[2],2,Do);if(!se||!we)return null;if(!qc(se.type,[as,_s,eo,xu,Do]))return X.error("Expected first argument to be of type boolean, string, number or null, but found "+jl(se.type)+" instead");if(C.length===4){var De=X.parse(C[3],3,eo);return De?new _c(se,we,De):null}else return new _c(se,we)},_c.prototype.evaluate=function(C){var X=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!Qc(X,["boolean","string","number","null"]))throw new Dl("Expected first argument to be of type boolean, string, number or null, but found "+jl(Kl(X))+" instead.");if(!Qc(se,["string","array"]))throw new Dl("Expected second argument to be of type array or string, but found "+jl(Kl(se))+" instead.");if(this.fromIndex){var we=this.fromIndex.evaluate(C);return se.indexOf(X,we)}return se.indexOf(X)},_c.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},_c.prototype.outputDefined=function(){return!1},_c.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var C=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),C]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var hu=function(C,X,se,we,De,He){this.inputType=C,this.type=X,this.input=se,this.cases=we,this.outputs=De,this.otherwise=He};hu.parse=function(C,X){if(C.length<5)return X.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if(C.length%2!==1)return X.error("Expected an even number of arguments.");var se,we;X.expectedType&&X.expectedType.kind!=="value"&&(we=X.expectedType);for(var De={},He=[],mt=2;mtNumber.MAX_SAFE_INTEGER)return fr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Kr=="number"&&Math.floor(Kr)!==Kr)return fr.error("Numeric branch labels must be integer values.");if(!se)se=Kl(Kr);else if(fr.checkSubtype(se,Kl(Kr)))return null;if(typeof De[String(Kr)]<"u")return fr.error("Branch labels must be unique.");De[String(Kr)]=He.length}var xn=X.parse(tr,mt,we);if(!xn)return null;we=we||xn.type,He.push(xn)}var $n=X.parse(C[1],1,Do);if(!$n)return null;var ja=X.parse(C[C.length-1],C.length-1,we);return!ja||$n.type.kind!=="value"&&X.concat(1).checkSubtype(se,$n.type)?null:new hu(se,we,$n,De,He,ja)},hu.prototype.evaluate=function(C){var X=this.input.evaluate(C),se=Kl(X)===this.inputType&&this.outputs[this.cases[X]]||this.otherwise;return se.evaluate(C)},hu.prototype.eachChild=function(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)},hu.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})&&this.otherwise.outputDefined()},hu.prototype.serialize=function(){for(var C=this,X=["match",this.input.serialize()],se=Object.keys(this.cases).sort(),we=[],De={},He=0,mt=se;He=5)return X.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1,Do),we=X.parse(C[2],2,eo);if(!se||!we)return null;if(!qc(se.type,[Bl(Do),_s,Do]))return X.error("Expected first argument to be of type array or string, but found "+jl(se.type)+" instead");if(C.length===4){var De=X.parse(C[3],3,eo);return De?new df(se.type,se,we,De):null}else return new df(se.type,se,we)},df.prototype.evaluate=function(C){var X=this.input.evaluate(C),se=this.beginIndex.evaluate(C);if(!Qc(X,["string","array"]))throw new Dl("Expected first argument to be of type array or string, but found "+jl(Kl(X))+" instead.");if(this.endIndex){var we=this.endIndex.evaluate(C);return X.slice(se,we)}return X.slice(se)},df.prototype.eachChild=function(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)},df.prototype.outputDefined=function(){return!1},df.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var C=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),C]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function Fh(k,C){return k==="=="||k==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function ur(k,C,X){return C===X}function Pr(k,C,X){return C!==X}function dn(k,C,X){return CX}function On(k,C,X){return C<=X}function Ta(k,C,X){return C>=X}function xa(k,C,X,se){return se.compare(C,X)===0}function ri(k,C,X,se){return!xa(k,C,X,se)}function fi(k,C,X,se){return se.compare(C,X)<0}function Ni(k,C,X,se){return se.compare(C,X)>0}function Va(k,C,X,se){return se.compare(C,X)<=0}function Ai(k,C,X,se){return se.compare(C,X)>=0}function ei(k,C,X){var se=k!=="=="&&k!=="!=";return(function(){function we(De,He,mt){this.type=as,this.lhs=De,this.rhs=He,this.collator=mt,this.hasUntypedArgument=De.type.kind==="value"||He.type.kind==="value"}return we.parse=function(He,mt){if(He.length!==3&&He.length!==4)return mt.error("Expected two or three arguments.");var jt=He[0],tr=mt.parse(He[1],1,Do);if(!tr)return null;if(!Fh(jt,tr.type))return mt.concat(1).error('"'+jt+`" comparisons are not supported for type '`+jl(tr.type)+"'.");var fr=mt.parse(He[2],2,Do);if(!fr)return null;if(!Fh(jt,fr.type))return mt.concat(2).error('"'+jt+`" comparisons are not supported for type '`+jl(fr.type)+"'.");if(tr.type.kind!==fr.type.kind&&tr.type.kind!=="value"&&fr.type.kind!=="value")return mt.error("Cannot compare types '"+jl(tr.type)+"' and '"+jl(fr.type)+"'.");se&&(tr.type.kind==="value"&&fr.type.kind!=="value"?tr=new yc(fr.type,[tr]):tr.type.kind!=="value"&&fr.type.kind==="value"&&(fr=new yc(tr.type,[fr])));var Or=null;if(He.length===4){if(tr.type.kind!=="string"&&fr.type.kind!=="string"&&tr.type.kind!=="value"&&fr.type.kind!=="value")return mt.error("Cannot use collator to compare non-string types.");if(Or=mt.parse(He[3],3,fu),!Or)return null}return new we(tr,fr,Or)},we.prototype.evaluate=function(He){var mt=this.lhs.evaluate(He),jt=this.rhs.evaluate(He);if(se&&this.hasUntypedArgument){var tr=Kl(mt),fr=Kl(jt);if(tr.kind!==fr.kind||!(tr.kind==="string"||tr.kind==="number"))throw new Dl('Expected arguments for "'+k+'" to be (string, string) or (number, number), but found ('+tr.kind+", "+fr.kind+") instead.")}if(this.collator&&!se&&this.hasUntypedArgument){var Or=Kl(mt),en=Kl(jt);if(Or.kind!=="string"||en.kind!=="string")return C(He,mt,jt)}return this.collator?X(He,mt,jt,this.collator.evaluate(He)):C(He,mt,jt)},we.prototype.eachChild=function(He){He(this.lhs),He(this.rhs),this.collator&&He(this.collator)},we.prototype.outputDefined=function(){return!0},we.prototype.serialize=function(){var He=[k];return this.eachChild(function(mt){He.push(mt.serialize())}),He},we})()}var Na=ei("==",ur,xa),Zi=ei("!=",Pr,ri),jo=ei("<",dn,fi),Fo=ei(">",nn,Ni),Yo=ei("<=",On,Va),Vo=ei(">=",Ta,Ai),Ki=function(C,X,se,we,De){this.type=_s,this.number=C,this.locale=X,this.currency=se,this.minFractionDigits=we,this.maxFractionDigits=De};Ki.parse=function(C,X){if(C.length!==3)return X.error("Expected two arguments.");var se=X.parse(C[1],1,eo);if(!se)return null;var we=C[2];if(typeof we!="object"||Array.isArray(we))return X.error("NumberFormat options argument must be an object.");var De=null;if(we.locale&&(De=X.parse(we.locale,1,_s),!De))return null;var He=null;if(we.currency&&(He=X.parse(we.currency,1,_s),!He))return null;var mt=null;if(we["min-fraction-digits"]&&(mt=X.parse(we["min-fraction-digits"],1,eo),!mt))return null;var jt=null;return we["max-fraction-digits"]&&(jt=X.parse(we["max-fraction-digits"],1,eo),!jt)?null:new Ki(se,De,He,mt,jt)},Ki.prototype.evaluate=function(C){return new Intl.NumberFormat(this.locale?this.locale.evaluate(C):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(C):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(C):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(C):void 0}).format(this.number.evaluate(C))},Ki.prototype.eachChild=function(C){C(this.number),this.locale&&C(this.locale),this.currency&&C(this.currency),this.minFractionDigits&&C(this.minFractionDigits),this.maxFractionDigits&&C(this.maxFractionDigits)},Ki.prototype.outputDefined=function(){return!1},Ki.prototype.serialize=function(){var C={};return this.locale&&(C.locale=this.locale.serialize()),this.currency&&(C.currency=this.currency.serialize()),this.minFractionDigits&&(C["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(C["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),C]};var Ri=function(C){this.type=eo,this.input=C};Ri.parse=function(C,X){if(C.length!==2)return X.error("Expected 1 argument, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1);return se?se.type.kind!=="array"&&se.type.kind!=="string"&&se.type.kind!=="value"?X.error("Expected argument of type string or array, but found "+jl(se.type)+" instead."):new Ri(se):null},Ri.prototype.evaluate=function(C){var X=this.input.evaluate(C);if(typeof X=="string")return X.length;if(Array.isArray(X))return X.length;throw new Dl("Expected value to be of type string or array, but found "+jl(Kl(X))+" instead.")},Ri.prototype.eachChild=function(C){C(this.input)},Ri.prototype.outputDefined=function(){return!1},Ri.prototype.serialize=function(){var C=["length"];return this.eachChild(function(X){C.push(X.serialize())}),C};var is={"==":Na,"!=":Zi,">":Fo,"<":jo,">=":Vo,"<=":Yo,array:yc,at:vf,boolean:yc,case:Nf,coalesce:Gc,collator:tf,format:If,image:lu,in:bu,"index-of":_c,interpolate:lc,"interpolate-hcl":lc,"interpolate-lab":lc,length:Ri,let:Sf,literal:Gs,match:hu,number:yc,"number-format":Ki,object:yc,slice:df,step:Ic,string:yc,"to-boolean":Ns,"to-color":Ns,"to-number":Ns,"to-string":Ns,var:Of,within:Pc};function Us(k,C){var X=C[0],se=C[1],we=C[2],De=C[3];X=X.evaluate(k),se=se.evaluate(k),we=we.evaluate(k);var He=De?De.evaluate(k):1,mt=ac(X,se,we,He);if(mt)throw new Dl(mt);return new Tl(X/255*He,se/255*He,we/255*He,He)}function Al(k,C){return k in C}function Xl(k,C){var X=C[k];return typeof X>"u"?null:X}function Ml(k,C,X,se){for(;X<=se;){var we=X+se>>1;if(C[we]===k)return!0;C[we]>k?se=we-1:X=we+1}return!1}function Yl(k){return{type:k}}Bo.register(is,{error:[su,[_s],function(k,C){var X=C[0];throw new Dl(X.evaluate(k))}],typeof:[_s,[Do],function(k,C){var X=C[0];return jl(Kl(X.evaluate(k)))}],"to-rgba":[Bl(eo,4),[Hl],function(k,C){var X=C[0];return X.evaluate(k).toArray()}],rgb:[Hl,[eo,eo,eo],Us],rgba:[Hl,[eo,eo,eo,eo],Us],has:{type:as,overloads:[[[_s],function(k,C){var X=C[0];return Al(X.evaluate(k),k.properties())}],[[_s,Gl],function(k,C){var X=C[0],se=C[1];return Al(X.evaluate(k),se.evaluate(k))}]]},get:{type:Do,overloads:[[[_s],function(k,C){var X=C[0];return Xl(X.evaluate(k),k.properties())}],[[_s,Gl],function(k,C){var X=C[0],se=C[1];return Xl(X.evaluate(k),se.evaluate(k))}]]},"feature-state":[Do,[_s],function(k,C){var X=C[0];return Xl(X.evaluate(k),k.featureState||{})}],properties:[Gl,[],function(k){return k.properties()}],"geometry-type":[_s,[],function(k){return k.geometryType()}],id:[Do,[],function(k){return k.id()}],zoom:[eo,[],function(k){return k.globals.zoom}],"heatmap-density":[eo,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[eo,[],function(k){return k.globals.lineProgress||0}],accumulated:[Do,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[eo,Yl(eo),function(k,C){for(var X=0,se=0,we=C;se":[as,[_s,Do],function(k,C){var X=C[0],se=C[1],we=k.properties()[X.value],De=se.value;return typeof we==typeof De&&we>De}],"filter-id->":[as,[Do],function(k,C){var X=C[0],se=k.id(),we=X.value;return typeof se==typeof we&&se>we}],"filter-<=":[as,[_s,Do],function(k,C){var X=C[0],se=C[1],we=k.properties()[X.value],De=se.value;return typeof we==typeof De&&we<=De}],"filter-id-<=":[as,[Do],function(k,C){var X=C[0],se=k.id(),we=X.value;return typeof se==typeof we&&se<=we}],"filter->=":[as,[_s,Do],function(k,C){var X=C[0],se=C[1],we=k.properties()[X.value],De=se.value;return typeof we==typeof De&&we>=De}],"filter-id->=":[as,[Do],function(k,C){var X=C[0],se=k.id(),we=X.value;return typeof se==typeof we&&se>=we}],"filter-has":[as,[Do],function(k,C){var X=C[0];return X.value in k.properties()}],"filter-has-id":[as,[],function(k){return k.id()!==null&&k.id()!==void 0}],"filter-type-in":[as,[Bl(_s)],function(k,C){var X=C[0];return X.value.indexOf(k.geometryType())>=0}],"filter-id-in":[as,[Bl(Do)],function(k,C){var X=C[0];return X.value.indexOf(k.id())>=0}],"filter-in-small":[as,[_s,Bl(Do)],function(k,C){var X=C[0],se=C[1];return se.value.indexOf(k.properties()[X.value])>=0}],"filter-in-large":[as,[_s,Bl(Do)],function(k,C){var X=C[0],se=C[1];return Ml(k.properties()[X.value],se.value,0,se.value.length-1)}],all:{type:as,overloads:[[[as,as],function(k,C){var X=C[0],se=C[1];return X.evaluate(k)&&se.evaluate(k)}],[Yl(as),function(k,C){for(var X=0,se=C;X-1}function bo(k){return!!k.expression&&k.expression.interpolated}function xs(k){return k instanceof Number?"number":k instanceof String?"string":k instanceof Boolean?"boolean":Array.isArray(k)?"array":k===null?"null":typeof k}function zl(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function pl(k){return k}function dc(k,C){var X=C.type==="color",se=k.stops&&typeof k.stops[0][0]=="object",we=se||k.property!==void 0,De=se||!we,He=k.type||(bo(C)?"exponential":"interval");if(X&&(k=Ds({},k),k.stops&&(k.stops=k.stops.map(function(xo){return[xo[0],Tl.parse(xo[1])]})),k.default?k.default=Tl.parse(k.default):k.default=Tl.parse(C.default)),k.colorSpace&&k.colorSpace!=="rgb"&&!Av[k.colorSpace])throw new Error("Unknown color space: "+k.colorSpace);var mt,jt,tr;if(He==="exponential")mt=mc;else if(He==="interval")mt=Gf;else if(He==="categorical"){mt=xc,jt=Object.create(null);for(var fr=0,Or=k.stops;fr=k.stops[se-1][0])return k.stops[se-1][1];var we=vc(k.stops.map(function(De){return De[0]}),X);return k.stops[we][1]}function mc(k,C,X){var se=k.base!==void 0?k.base:1;if(xs(X)!=="number")return pc(k.default,C.default);var we=k.stops.length;if(we===1||X<=k.stops[0][0])return k.stops[0][1];if(X>=k.stops[we-1][0])return k.stops[we-1][1];var De=vc(k.stops.map(function(Or){return Or[0]}),X),He=Mu(X,se,k.stops[De][0],k.stops[De+1][0]),mt=k.stops[De][1],jt=k.stops[De+1][1],tr=Ff[C.type]||pl;if(k.colorSpace&&k.colorSpace!=="rgb"){var fr=Av[k.colorSpace];tr=function(Or,en){return fr.reverse(fr.interpolate(fr.forward(Or),fr.forward(en),He))}}return typeof mt.evaluate=="function"?{evaluate:function(){for(var en=[],Kr=arguments.length;Kr--;)en[Kr]=arguments[Kr];var xn=mt.evaluate.apply(void 0,en),$n=jt.evaluate.apply(void 0,en);if(!(xn===void 0||$n===void 0))return tr(xn,$n,He)}}:tr(mt,jt,He)}function Mf(k,C,X){return C.type==="color"?X=Tl.parse(X):C.type==="formatted"?X=nc.fromString(X.toString()):C.type==="resolvedImage"?X=Gu.fromString(X.toString()):xs(X)!==C.type&&(C.type!=="enum"||!C.values[X])&&(X=void 0),pc(X,k.default,C.default)}function Mu(k,C,X,se){var we=se-X,De=k-X;return we===0?0:C===1?De/we:(Math.pow(C,De)-1)/(Math.pow(C,we)-1)}var Ef=function(C,X){this.expression=C,this._warningHistory={},this._evaluator=new dl,this._defaultValue=X?ke(X):null,this._enumValues=X&&X.type==="enum"?X.values:null};Ef.prototype.evaluateWithoutErrorHandling=function(C,X,se,we,De,He){return this._evaluator.globals=C,this._evaluator.feature=X,this._evaluator.featureState=se,this._evaluator.canonical=we,this._evaluator.availableImages=De||null,this._evaluator.formattedSection=He,this.expression.evaluate(this._evaluator)},Ef.prototype.evaluate=function(C,X,se,we,De,He){this._evaluator.globals=C,this._evaluator.feature=X||null,this._evaluator.featureState=se||null,this._evaluator.canonical=we,this._evaluator.availableImages=De||null,this._evaluator.formattedSection=He||null;try{var mt=this.expression.evaluate(this._evaluator);if(mt==null||typeof mt=="number"&&mt!==mt)return this._defaultValue;if(this._enumValues&&!(mt in this._enumValues))throw new Dl("Expected value to be one of "+Object.keys(this._enumValues).map(function(jt){return JSON.stringify(jt)}).join(", ")+", but found "+JSON.stringify(mt)+" instead.");return mt}catch(jt){return this._warningHistory[jt.message]||(this._warningHistory[jt.message]=!0,typeof console<"u"&&console.warn(jt.message)),this._defaultValue}};function Zo(k){return Array.isArray(k)&&k.length>0&&typeof k[0]=="string"&&k[0]in is}function ss(k,C){var X=new $l(is,[],C?Se(C):void 0),se=X.parse(k,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return se?rl(new Ef(se,C)):Su(X.errors)}var kf=function(C,X){this.kind=C,this._styleExpression=X,this.isStateDependent=C!=="constant"&&!yu(X.expression)};kf.prototype.evaluateWithoutErrorHandling=function(C,X,se,we,De,He){return this._styleExpression.evaluateWithoutErrorHandling(C,X,se,we,De,He)},kf.prototype.evaluate=function(C,X,se,we,De,He){return this._styleExpression.evaluate(C,X,se,we,De,He)};var Xc=function(C,X,se,we){this.kind=C,this.zoomStops=se,this._styleExpression=X,this.isStateDependent=C!=="camera"&&!yu(X.expression),this.interpolationType=we};Xc.prototype.evaluateWithoutErrorHandling=function(C,X,se,we,De,He){return this._styleExpression.evaluateWithoutErrorHandling(C,X,se,we,De,He)},Xc.prototype.evaluate=function(C,X,se,we,De,He){return this._styleExpression.evaluate(C,X,se,we,De,He)},Xc.prototype.interpolationFactor=function(C,X,se){return this.interpolationType?lc.interpolationFactor(this.interpolationType,C,X,se):0};function zc(k,C){if(k=ss(k,C),k.result==="error")return k;var X=k.value.expression,se=Hh(X);if(!se&&!wu(C))return Su([new Ws("","data expressions not supported")]);var we=Rc(X,["zoom"]);if(!we&&!ql(C))return Su([new Ws("","zoom expressions not supported")]);var De=oe(X);if(!De&&!we)return Su([new Ws("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(De instanceof Ws)return Su([De]);if(De instanceof lc&&!bo(C))return Su([new Ws("",'"interpolate" expressions cannot be used with this property')]);if(!De)return rl(se?new kf("constant",k.value):new kf("source",k.value));var He=De instanceof lc?De.interpolation:void 0;return rl(se?new Xc("camera",k.value,De.labels,He):new Xc("composite",k.value,De.labels,He))}var Ue=function(C,X){this._parameters=C,this._specification=X,Ds(this,dc(this._parameters,this._specification))};Ue.deserialize=function(C){return new Ue(C._parameters,C._specification)},Ue.serialize=function(C){return{_parameters:C._parameters,_specification:C._specification}};function P(k,C){if(zl(k))return new Ue(k,C);if(Zo(k)){var X=zc(k,C);if(X.result==="error")throw new Error(X.value.map(function(we){return we.key+": "+we.message}).join(", "));return X.value}else{var se=k;return typeof k=="string"&&C.type==="color"&&(se=Tl.parse(k)),{kind:"constant",evaluate:function(){return se}}}}function oe(k){var C=null;if(k instanceof Sf)C=oe(k.result);else if(k instanceof Gc)for(var X=0,se=k.args;Xse.maximum?[new no(C,X,X+" is greater than the maximum value "+se.maximum)]:[]}function Gt(k){var C=k.valueSpec,X=No(k.value.type),se,we={},De,He,mt=X!=="categorical"&&k.value.property===void 0,jt=!mt,tr=xs(k.value.stops)==="array"&&xs(k.value.stops[0])==="array"&&xs(k.value.stops[0][0])==="object",fr=Be({key:k.key,value:k.value,valueSpec:k.styleSpec.function,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{stops:Or,default:xn}});return X==="identity"&&mt&&fr.push(new no(k.key,k.value,'missing required property "property"')),X!=="identity"&&!k.value.stops&&fr.push(new no(k.key,k.value,'missing required property "stops"')),X==="exponential"&&k.valueSpec.expression&&!bo(k.valueSpec)&&fr.push(new no(k.key,k.value,"exponential functions not supported")),k.styleSpec.$version>=8&&(jt&&!wu(k.valueSpec)?fr.push(new no(k.key,k.value,"property functions not supported")):mt&&!ql(k.valueSpec)&&fr.push(new no(k.key,k.value,"zoom functions not supported"))),(X==="categorical"||tr)&&k.value.property===void 0&&fr.push(new no(k.key,k.value,'"property" property is required')),fr;function Or($n){if(X==="identity")return[new no($n.key,$n.value,'identity function may not have a "stops" property')];var ja=[],ba=$n.value;return ja=ja.concat(gt({key:$n.key,value:ba,valueSpec:$n.valueSpec,style:$n.style,styleSpec:$n.styleSpec,arrayElementValidator:en})),xs(ba)==="array"&&ba.length===0&&ja.push(new no($n.key,ba,"array must have at least one stop")),ja}function en($n){var ja=[],ba=$n.value,_i=$n.key;if(xs(ba)!=="array")return[new no(_i,ba,"array expected, "+xs(ba)+" found")];if(ba.length!==2)return[new no(_i,ba,"array length 2 expected, length "+ba.length+" found")];if(tr){if(xs(ba[0])!=="object")return[new no(_i,ba,"object expected, "+xs(ba[0])+" found")];if(ba[0].zoom===void 0)return[new no(_i,ba,"object stop key must have zoom")];if(ba[0].value===void 0)return[new no(_i,ba,"object stop key must have value")];if(He&&He>No(ba[0].zoom))return[new no(_i,ba[0].zoom,"stop zoom values must appear in ascending order")];No(ba[0].zoom)!==He&&(He=No(ba[0].zoom),De=void 0,we={}),ja=ja.concat(Be({key:_i+"[0]",value:ba[0],valueSpec:{zoom:{}},style:$n.style,styleSpec:$n.styleSpec,objectElementValidators:{zoom:kt,value:Kr}}))}else ja=ja.concat(Kr({key:_i+"[0]",value:ba[0],style:$n.style,styleSpec:$n.styleSpec},ba));return Zo(Il(ba[1]))?ja.concat([new no(_i+"[1]",ba[1],"expressions are not allowed in function stops.")]):ja.concat(Qs({key:_i+"[1]",value:ba[1],valueSpec:C,style:$n.style,styleSpec:$n.styleSpec}))}function Kr($n,ja){var ba=xs($n.value),_i=No($n.value),Qa=$n.value!==null?$n.value:ja;if(!se)se=ba;else if(ba!==se)return[new no($n.key,Qa,ba+" stop domain type must match previous stop domain type "+se)];if(ba!=="number"&&ba!=="string"&&ba!=="boolean")return[new no($n.key,Qa,"stop domain value must be a number, string, or boolean")];if(ba!=="number"&&X!=="categorical"){var gi="number expected, "+ba+" found";return wu(C)&&X===void 0&&(gi+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new no($n.key,Qa,gi)]}return X==="categorical"&&ba==="number"&&(!isFinite(_i)||Math.floor(_i)!==_i)?[new no($n.key,Qa,"integer expected, found "+_i)]:X!=="categorical"&&ba==="number"&&De!==void 0&&_i=2&&k[1]!=="$id"&&k[1]!=="$type";case"in":return k.length>=3&&(typeof k[1]!="string"||Array.isArray(k[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return k.length!==3||Array.isArray(k[1])||Array.isArray(k[2]);case"any":case"all":for(var C=0,X=k.slice(1);CC?1:0}function _t(k){if(!Array.isArray(k))return!1;if(k[0]==="within")return!0;for(var C=1;C"||C==="<="||C===">="?Et(k[1],k[2],C):C==="any"?Ut(k.slice(1)):C==="all"?["all"].concat(k.slice(1).map(zt)):C==="none"?["all"].concat(k.slice(1).map(zt).map(Lr)):C==="in"?mr(k[1],k.slice(2)):C==="!in"?Lr(mr(k[1],k.slice(2))):C==="has"?Tr(k[1]):C==="!has"?Lr(Tr(k[1])):C==="within"?k:!0;return X}function Et(k,C,X){switch(k){case"$type":return["filter-type-"+X,C];case"$id":return["filter-id-"+X,C];default:return["filter-"+X,k,C]}}function Ut(k){return["any"].concat(k.map(zt))}function mr(k,C){if(C.length===0)return!1;switch(k){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some(function(X){return typeof X!=typeof C[0]})?["filter-in-large",k,["literal",C.sort(ht)]]:["filter-in-small",k,["literal",C]]}}function Tr(k){switch(k){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",k]}}function Lr(k){return["!",k]}function Gr(k){return _n(Il(k.value))?cr(Ds({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):on(k)}function on(k){var C=k.value,X=k.key;if(xs(C)!=="array")return[new no(X,C,"array expected, "+xs(C)+" found")];var se=k.styleSpec,we,De=[];if(C.length<1)return[new no(X,C,"filter array must have at least 1 element")];switch(De=De.concat(Qr({key:X+"[0]",value:C[0],valueSpec:se.filter_operator,style:k.style,styleSpec:k.styleSpec})),No(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&No(C[1])==="$type"&&De.push(new no(X,C,'"$type" cannot be use with operator "'+C[0]+'"'));case"==":case"!=":C.length!==3&&De.push(new no(X,C,'filter array for operator "'+C[0]+'" must have 3 elements'));case"in":case"!in":C.length>=2&&(we=xs(C[1]),we!=="string"&&De.push(new no(X+"[1]",C[1],"string expected, "+we+" found")));for(var He=2;He=fr[Kr+0]&&se>=fr[Kr+1])?(He[en]=!0,De.push(tr[en])):He[en]=!1}}},tt.prototype._forEachCell=function(k,C,X,se,we,De,He,mt){for(var jt=this._convertToCellCoord(k),tr=this._convertToCellCoord(C),fr=this._convertToCellCoord(X),Or=this._convertToCellCoord(se),en=jt;en<=fr;en++)for(var Kr=tr;Kr<=Or;Kr++){var xn=this.d*Kr+en;if(!(mt&&!mt(this._convertFromCellCoord(en),this._convertFromCellCoord(Kr),this._convertFromCellCoord(en+1),this._convertFromCellCoord(Kr+1)))&&we.call(this,k,C,X,se,xn,De,He,mt))return}},tt.prototype._convertFromCellCoord=function(k){return(k-this.padding)/this.scale},tt.prototype._convertToCellCoord=function(k){return Math.max(0,Math.min(this.d-1,Math.floor(k*this.scale)+this.padding))},tt.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var k=this.cells,C=Oe+this.cells.length+1+1,X=0,se=0;se=0)){var Or=k[fr];tr[fr]=It[jt].shallow.indexOf(fr)>=0?Or:Hr(Or,C)}k instanceof Error&&(tr.message=k.message)}if(tr.$name)throw new Error("$name property is reserved for worker serialization logic.");return jt!=="Object"&&(tr.$name=jt),tr}throw new Error("can't serialize object of type "+typeof k)}function hn(k){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp||yr(k)||Xr(k)||ArrayBuffer.isView(k)||k instanceof xt)return k;if(Array.isArray(k))return k.map(hn);if(typeof k=="object"){var C=k.$name||"Object",X=It[C],se=X.klass;if(!se)throw new Error("can't deserialize unregistered class "+C);if(se.deserialize)return se.deserialize(k);for(var we=Object.create(se.prototype),De=0,He=Object.keys(k);De=0?jt:hn(jt)}}return we}throw new Error("can't deserialize object of type "+typeof k)}var An=function(){this.first=!0};An.prototype.update=function(C,X){var se=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=se,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=se,!0):(this.lastFloorZoom>se?(this.lastIntegerZoom=se+1,this.lastIntegerZoomTime=X):this.lastFloorZoom=128&&k<=255},Arabic:function(k){return k>=1536&&k<=1791},"Arabic Supplement":function(k){return k>=1872&&k<=1919},"Arabic Extended-A":function(k){return k>=2208&&k<=2303},"Hangul Jamo":function(k){return k>=4352&&k<=4607},"Unified Canadian Aboriginal Syllabics":function(k){return k>=5120&&k<=5759},Khmer:function(k){return k>=6016&&k<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(k){return k>=6320&&k<=6399},"General Punctuation":function(k){return k>=8192&&k<=8303},"Letterlike Symbols":function(k){return k>=8448&&k<=8527},"Number Forms":function(k){return k>=8528&&k<=8591},"Miscellaneous Technical":function(k){return k>=8960&&k<=9215},"Control Pictures":function(k){return k>=9216&&k<=9279},"Optical Character Recognition":function(k){return k>=9280&&k<=9311},"Enclosed Alphanumerics":function(k){return k>=9312&&k<=9471},"Geometric Shapes":function(k){return k>=9632&&k<=9727},"Miscellaneous Symbols":function(k){return k>=9728&&k<=9983},"Miscellaneous Symbols and Arrows":function(k){return k>=11008&&k<=11263},"CJK Radicals Supplement":function(k){return k>=11904&&k<=12031},"Kangxi Radicals":function(k){return k>=12032&&k<=12255},"Ideographic Description Characters":function(k){return k>=12272&&k<=12287},"CJK Symbols and Punctuation":function(k){return k>=12288&&k<=12351},Hiragana:function(k){return k>=12352&&k<=12447},Katakana:function(k){return k>=12448&&k<=12543},Bopomofo:function(k){return k>=12544&&k<=12591},"Hangul Compatibility Jamo":function(k){return k>=12592&&k<=12687},Kanbun:function(k){return k>=12688&&k<=12703},"Bopomofo Extended":function(k){return k>=12704&&k<=12735},"CJK Strokes":function(k){return k>=12736&&k<=12783},"Katakana Phonetic Extensions":function(k){return k>=12784&&k<=12799},"Enclosed CJK Letters and Months":function(k){return k>=12800&&k<=13055},"CJK Compatibility":function(k){return k>=13056&&k<=13311},"CJK Unified Ideographs Extension A":function(k){return k>=13312&&k<=19903},"Yijing Hexagram Symbols":function(k){return k>=19904&&k<=19967},"CJK Unified Ideographs":function(k){return k>=19968&&k<=40959},"Yi Syllables":function(k){return k>=40960&&k<=42127},"Yi Radicals":function(k){return k>=42128&&k<=42191},"Hangul Jamo Extended-A":function(k){return k>=43360&&k<=43391},"Hangul Syllables":function(k){return k>=44032&&k<=55215},"Hangul Jamo Extended-B":function(k){return k>=55216&&k<=55295},"Private Use Area":function(k){return k>=57344&&k<=63743},"CJK Compatibility Ideographs":function(k){return k>=63744&&k<=64255},"Arabic Presentation Forms-A":function(k){return k>=64336&&k<=65023},"Vertical Forms":function(k){return k>=65040&&k<=65055},"CJK Compatibility Forms":function(k){return k>=65072&&k<=65103},"Small Form Variants":function(k){return k>=65104&&k<=65135},"Arabic Presentation Forms-B":function(k){return k>=65136&&k<=65279},"Halfwidth and Fullwidth Forms":function(k){return k>=65280&&k<=65519}};function La(k){for(var C=0,X=k;C=65097&&k<=65103)||kn["CJK Compatibility Ideographs"](k)||kn["CJK Compatibility"](k)||kn["CJK Radicals Supplement"](k)||kn["CJK Strokes"](k)||kn["CJK Symbols and Punctuation"](k)&&!(k>=12296&&k<=12305)&&!(k>=12308&&k<=12319)&&k!==12336||kn["CJK Unified Ideographs Extension A"](k)||kn["CJK Unified Ideographs"](k)||kn["Enclosed CJK Letters and Months"](k)||kn["Hangul Compatibility Jamo"](k)||kn["Hangul Jamo Extended-A"](k)||kn["Hangul Jamo Extended-B"](k)||kn["Hangul Jamo"](k)||kn["Hangul Syllables"](k)||kn.Hiragana(k)||kn["Ideographic Description Characters"](k)||kn.Kanbun(k)||kn["Kangxi Radicals"](k)||kn["Katakana Phonetic Extensions"](k)||kn.Katakana(k)&&k!==12540||kn["Halfwidth and Fullwidth Forms"](k)&&k!==65288&&k!==65289&&k!==65293&&!(k>=65306&&k<=65310)&&k!==65339&&k!==65341&&k!==65343&&!(k>=65371&&k<=65503)&&k!==65507&&!(k>=65512&&k<=65519)||kn["Small Form Variants"](k)&&!(k>=65112&&k<=65118)&&!(k>=65123&&k<=65126)||kn["Unified Canadian Aboriginal Syllabics"](k)||kn["Unified Canadian Aboriginal Syllabics Extended"](k)||kn["Vertical Forms"](k)||kn["Yijing Hexagram Symbols"](k)||kn["Yi Syllables"](k)||kn["Yi Radicals"](k))}function Ra(k){return!!(kn["Latin-1 Supplement"](k)&&(k===167||k===169||k===174||k===177||k===188||k===189||k===190||k===215||k===247)||kn["General Punctuation"](k)&&(k===8214||k===8224||k===8225||k===8240||k===8241||k===8251||k===8252||k===8258||k===8263||k===8264||k===8265||k===8273)||kn["Letterlike Symbols"](k)||kn["Number Forms"](k)||kn["Miscellaneous Technical"](k)&&(k>=8960&&k<=8967||k>=8972&&k<=8991||k>=8996&&k<=9e3||k===9003||k>=9085&&k<=9114||k>=9150&&k<=9165||k===9167||k>=9169&&k<=9179||k>=9186&&k<=9215)||kn["Control Pictures"](k)&&k!==9251||kn["Optical Character Recognition"](k)||kn["Enclosed Alphanumerics"](k)||kn["Geometric Shapes"](k)||kn["Miscellaneous Symbols"](k)&&!(k>=9754&&k<=9759)||kn["Miscellaneous Symbols and Arrows"](k)&&(k>=11026&&k<=11055||k>=11088&&k<=11097||k>=11192&&k<=11243)||kn["CJK Symbols and Punctuation"](k)||kn.Katakana(k)||kn["Private Use Area"](k)||kn["CJK Compatibility Forms"](k)||kn["Small Form Variants"](k)||kn["Halfwidth and Fullwidth Forms"](k)||k===8734||k===8756||k===8757||k>=9984&&k<=10087||k>=10102&&k<=10131||k===65532||k===65533)}function ia(k){return!(Aa(k)||Ra(k))}function oi(k){return kn.Arabic(k)||kn["Arabic Supplement"](k)||kn["Arabic Extended-A"](k)||kn["Arabic Presentation Forms-A"](k)||kn["Arabic Presentation Forms-B"](k)}function Wi(k){return k>=1424&&k<=2303||kn["Arabic Presentation Forms-A"](k)||kn["Arabic Presentation Forms-B"](k)}function zi(k,C){return!(!C&&Wi(k)||k>=2304&&k<=3583||k>=3840&&k<=4255||kn.Khmer(k))}function Gi(k){for(var C=0,X=k;C-1&&(Ro=ko.error),Ks&&Ks(k)};function Lu(){Jl.fire(new Nr("pluginStateChange",{pluginStatus:Ro,pluginURL:us}))}var Jl=new Ir,co=function(){return Ro},Is=function(k){return k({pluginStatus:Ro,pluginURL:us}),Jl.on("pluginStateChange",k),k},el=function(k,C,X){if(X===void 0&&(X=!1),Ro===ko.deferred||Ro===ko.loading||Ro===ko.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");us=Ae.resolveURL(k),Ro=ko.deferred,Ks=C,Lu(),X||Zl()},Zl=function(){if(Ro!==ko.deferred||!us)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ro=ko.loading,Lu(),us&&mn({url:us},function(k){k?nl(k):(Ro=ko.loaded,Lu())})},Ol={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Ro===ko.loaded||Ol.applyArabicShaping!=null},isLoading:function(){return Ro===ko.loading},setState:function(C){Ro=C.pluginStatus,us=C.pluginURL},isParsed:function(){return Ol.applyArabicShaping!=null&&Ol.processBidirectionalText!=null&&Ol.processStyledBidirectionalText!=null},getPluginURL:function(){return us}},bc=function(){!Ol.isLoading()&&!Ol.isLoaded()&&co()==="deferred"&&Zl()},El=function(C,X){this.zoom=C,X?(this.now=X.now,this.fadeDuration=X.fadeDuration,this.zoomHistory=X.zoomHistory,this.transition=X.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new An,this.transition={})};El.prototype.isSupportedScript=function(C){return wo(C,Ol.isLoaded())},El.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},El.prototype.getCrossfadeParameters=function(){var C=this.zoom,X=C-Math.floor(C),se=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:X+(1-X)*se}:{fromScale:.5,toScale:1,t:1-(1-se)*X}};var Wl=function(C,X){this.property=C,this.value=X,this.expression=P(X===void 0?C.specification.default:X,C.specification)};Wl.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Wl.prototype.possiblyEvaluate=function(C,X,se){return this.property.possiblyEvaluate(this,C,X,se)};var Yc=function(C){this.property=C,this.value=new Wl(C,void 0)};Yc.prototype.transitioned=function(C,X){return new dt(this.property,this.value,X,_({},C.transition,this.transition),C.now)},Yc.prototype.untransitioned=function(){return new dt(this.property,this.value,null,{},0)};var Eu=function(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)};Eu.prototype.getValue=function(C){return B(this._values[C].value.value)},Eu.prototype.setValue=function(C,X){this._values.hasOwnProperty(C)||(this._values[C]=new Yc(this._values[C].property)),this._values[C].value=new Wl(this._values[C].property,X===null?void 0:B(X))},Eu.prototype.getTransition=function(C){return B(this._values[C].transition)},Eu.prototype.setTransition=function(C,X){this._values.hasOwnProperty(C)||(this._values[C]=new Yc(this._values[C].property)),this._values[C].transition=B(X)||void 0},Eu.prototype.serialize=function(){for(var C={},X=0,se=Object.keys(this._values);Xthis.end)return this.prior=null,De;if(this.value.isDataDriven())return this.prior=null,De;if(weHe.zoomHistory.lastIntegerZoom?{from:se,to:we}:{from:De,to:we}},C.prototype.interpolate=function(se){return se},C})(pn),Ia=function(C){this.specification=C};Ia.prototype.possiblyEvaluate=function(C,X,se,we){if(C.value!==void 0)if(C.expression.kind==="constant"){var De=C.expression.evaluate(X,null,{},se,we);return this._calculate(De,De,De,X)}else return this._calculate(C.expression.evaluate(new El(Math.floor(X.zoom-1),X)),C.expression.evaluate(new El(Math.floor(X.zoom),X)),C.expression.evaluate(new El(Math.floor(X.zoom+1),X)),X)},Ia.prototype._calculate=function(C,X,se,we){var De=we.zoom;return De>we.zoomHistory.lastIntegerZoom?{from:C,to:X}:{from:se,to:X}},Ia.prototype.interpolate=function(C){return C};var Da=function(C){this.specification=C};Da.prototype.possiblyEvaluate=function(C,X,se,we){return!!C.expression.evaluate(X,null,{},se,we)},Da.prototype.interpolate=function(){return!1};var Wa=function(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var X in C){var se=C[X];se.specification.overridable&&this.overridableProperties.push(X);var we=this.defaultPropertyValues[X]=new Wl(se,void 0),De=this.defaultTransitionablePropertyValues[X]=new Yc(se);this.defaultTransitioningPropertyValues[X]=De.untransitioned(),this.defaultPossiblyEvaluatedValues[X]=we.possiblyEvaluate({})}};Qt("DataDrivenProperty",pn),Qt("DataConstantProperty",gn),Qt("CrossFadedDataDrivenProperty",za),Qt("CrossFadedProperty",Ia),Qt("ColorRampProperty",Da);var Bi="-transition",bi=(function(k){function C(X,se){if(k.call(this),this.id=X.id,this.type=X.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},X.type!=="custom"&&(X=X,this.metadata=X.metadata,this.minzoom=X.minzoom,this.maxzoom=X.maxzoom,X.type!=="background"&&(this.source=X.source,this.sourceLayer=X["source-layer"],this.filter=X.filter),se.layout&&(this._unevaluatedLayout=new wr(se.layout)),se.paint)){this._transitionablePaint=new Eu(se.paint);for(var we in X.paint)this.setPaintProperty(we,X.paint[we],{validate:!1});for(var De in X.layout)this.setLayoutProperty(De,X.layout[De],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ua(se.paint)}}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},C.prototype.getLayoutProperty=function(se){return se==="visibility"?this.visibility:this._unevaluatedLayout.getValue(se)},C.prototype.setLayoutProperty=function(se,we,De){if(De===void 0&&(De={}),we!=null){var He="layers."+this.id+".layout."+se;if(this._validate(oc,He,se,we,De))return}if(se==="visibility"){this.visibility=we;return}this._unevaluatedLayout.setValue(se,we)},C.prototype.getPaintProperty=function(se){return z(se,Bi)?this._transitionablePaint.getTransition(se.slice(0,-Bi.length)):this._transitionablePaint.getValue(se)},C.prototype.setPaintProperty=function(se,we,De){if(De===void 0&&(De={}),we!=null){var He="layers."+this.id+".paint."+se;if(this._validate(Cu,He,se,we,De))return!1}if(z(se,Bi))return this._transitionablePaint.setTransition(se.slice(0,-Bi.length),we||void 0),!1;var mt=this._transitionablePaint._values[se],jt=mt.property.specification["property-type"]==="cross-faded-data-driven",tr=mt.value.isDataDriven(),fr=mt.value;this._transitionablePaint.setValue(se,we),this._handleSpecialPaintPropertyUpdate(se);var Or=this._transitionablePaint._values[se].value,en=Or.isDataDriven();return en||tr||jt||this._handleOverridablePaintPropertyUpdate(se,fr,Or)},C.prototype._handleSpecialPaintPropertyUpdate=function(se){},C.prototype._handleOverridablePaintPropertyUpdate=function(se,we,De){return!1},C.prototype.isHidden=function(se){return this.minzoom&&se=this.maxzoom?!0:this.visibility==="none"},C.prototype.updateTransitions=function(se){this._transitioningPaint=this._transitionablePaint.transitioned(se,this._transitioningPaint)},C.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},C.prototype.recalculate=function(se,we){se.getCrossfadeParameters&&(this._crossfadeParameters=se.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(se,void 0,we)),this.paint=this._transitioningPaint.possiblyEvaluate(se,void 0,we)},C.prototype.serialize=function(){var se={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(se.layout=se.layout||{},se.layout.visibility=this.visibility),N(se,function(we,De){return we!==void 0&&!(De==="layout"&&!Object.keys(we).length)&&!(De==="paint"&&!Object.keys(we).length)})},C.prototype._validate=function(se,we,De,He,mt){return mt===void 0&&(mt={}),mt&&mt.validate===!1?!1:Oc(this,se.call(Ps,{key:we,layerType:this.type,objectKey:De,value:He,styleSpec:pi,style:{glyphs:!0,sprite:!0}}))},C.prototype.is3D=function(){return!1},C.prototype.isTileClipped=function(){return!1},C.prototype.hasOffscreenPass=function(){return!1},C.prototype.resize=function(){},C.prototype.isStateDependent=function(){for(var se in this.paint._values){var we=this.paint.get(se);if(!(!(we instanceof Cn)||!wu(we.property.specification))&&(we.value.kind==="source"||we.value.kind==="composite")&&we.value.isStateDependent)return!0}return!1},C})(Ir),Ha={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ga=function(C,X){this._structArray=C,this._pos1=X*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},rn=128,Fn=5,ea=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};ea.serialize=function(C,X){return C._trim(),X&&(C.isTransferred=!0,X.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}},ea.deserialize=function(C){var X=Object.create(this.prototype);return X.arrayBuffer=C.arrayBuffer,X.length=C.length,X.capacity=C.arrayBuffer.byteLength/X.bytesPerElement,X._refreshViews(),X},ea.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ea.prototype.clear=function(){this.length=0},ea.prototype.resize=function(C){this.reserve(C),this.length=C},ea.prototype.reserve=function(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(this.capacity*Fn),rn),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var X=this.uint8;this._refreshViews(),X&&this.uint8.set(X)}},ea.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function ya(k,C){C===void 0&&(C=1);var X=0,se=0,we=k.map(function(He){var mt=na(He.type),jt=X=di(X,Math.max(C,mt)),tr=He.components||1;return se=Math.max(se,mt),X+=mt*tr,{name:He.name,type:He.type,components:tr,offset:jt}}),De=di(X,Math.max(se,C));return{members:we,size:De,alignment:C}}function na(k){return Ha[k].BYTES_PER_ELEMENT}function di(k,C){return Math.ceil(k/C)*C}var Ua=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we){var De=this.length;return this.resize(De+1),this.emplace(De,se,we)},C.prototype.emplace=function(se,we,De){var He=se*2;return this.int16[He+0]=we,this.int16[He+1]=De,se},C})(ea);Ua.prototype.bytesPerElement=4,Qt("StructArrayLayout2i4",Ua);var Di=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He){var mt=this.length;return this.resize(mt+1),this.emplace(mt,se,we,De,He)},C.prototype.emplace=function(se,we,De,He,mt){var jt=se*4;return this.int16[jt+0]=we,this.int16[jt+1]=De,this.int16[jt+2]=He,this.int16[jt+3]=mt,se},C})(ea);Di.prototype.bytesPerElement=8,Qt("StructArrayLayout4i8",Di);var aa=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt){var tr=this.length;return this.resize(tr+1),this.emplace(tr,se,we,De,He,mt,jt)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr){var fr=se*6;return this.int16[fr+0]=we,this.int16[fr+1]=De,this.int16[fr+2]=He,this.int16[fr+3]=mt,this.int16[fr+4]=jt,this.int16[fr+5]=tr,se},C})(ea);aa.prototype.bytesPerElement=12,Qt("StructArrayLayout2i4i12",aa);var Zn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt){var tr=this.length;return this.resize(tr+1),this.emplace(tr,se,we,De,He,mt,jt)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr){var fr=se*4,Or=se*8;return this.int16[fr+0]=we,this.int16[fr+1]=De,this.uint8[Or+4]=He,this.uint8[Or+5]=mt,this.uint8[Or+6]=jt,this.uint8[Or+7]=tr,se},C})(ea);Zn.prototype.bytesPerElement=8,Qt("StructArrayLayout2i4ub8",Zn);var li=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we){var De=this.length;return this.resize(De+1),this.emplace(De,se,we)},C.prototype.emplace=function(se,we,De){var He=se*2;return this.float32[He+0]=we,this.float32[He+1]=De,se},C})(ea);li.prototype.bytesPerElement=8,Qt("StructArrayLayout2f8",li);var Dn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt,tr,fr,Or,en){var Kr=this.length;return this.resize(Kr+1),this.emplace(Kr,se,we,De,He,mt,jt,tr,fr,Or,en)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr,fr,Or,en,Kr){var xn=se*10;return this.uint16[xn+0]=we,this.uint16[xn+1]=De,this.uint16[xn+2]=He,this.uint16[xn+3]=mt,this.uint16[xn+4]=jt,this.uint16[xn+5]=tr,this.uint16[xn+6]=fr,this.uint16[xn+7]=Or,this.uint16[xn+8]=en,this.uint16[xn+9]=Kr,se},C})(ea);Dn.prototype.bytesPerElement=20,Qt("StructArrayLayout10ui20",Dn);var $a=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt,tr,fr,Or,en,Kr,xn){var $n=this.length;return this.resize($n+1),this.emplace($n,se,we,De,He,mt,jt,tr,fr,Or,en,Kr,xn)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr,fr,Or,en,Kr,xn,$n){var ja=se*12;return this.int16[ja+0]=we,this.int16[ja+1]=De,this.int16[ja+2]=He,this.int16[ja+3]=mt,this.uint16[ja+4]=jt,this.uint16[ja+5]=tr,this.uint16[ja+6]=fr,this.uint16[ja+7]=Or,this.int16[ja+8]=en,this.int16[ja+9]=Kr,this.int16[ja+10]=xn,this.int16[ja+11]=$n,se},C})(ea);$a.prototype.bytesPerElement=24,Qt("StructArrayLayout4i4ui4i24",$a);var Oa=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,we,De)},C.prototype.emplace=function(se,we,De,He){var mt=se*3;return this.float32[mt+0]=we,this.float32[mt+1]=De,this.float32[mt+2]=He,se},C})(ea);Oa.prototype.bytesPerElement=12,Qt("StructArrayLayout3f12",Oa);var Oi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var we=this.length;return this.resize(we+1),this.emplace(we,se)},C.prototype.emplace=function(se,we){var De=se*1;return this.uint32[De+0]=we,se},C})(ea);Oi.prototype.bytesPerElement=4,Qt("StructArrayLayout1ul4",Oi);var Po=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt,tr,fr,Or){var en=this.length;return this.resize(en+1),this.emplace(en,se,we,De,He,mt,jt,tr,fr,Or)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr,fr,Or,en){var Kr=se*10,xn=se*5;return this.int16[Kr+0]=we,this.int16[Kr+1]=De,this.int16[Kr+2]=He,this.int16[Kr+3]=mt,this.int16[Kr+4]=jt,this.int16[Kr+5]=tr,this.uint32[xn+3]=fr,this.uint16[Kr+8]=Or,this.uint16[Kr+9]=en,se},C})(ea);Po.prototype.bytesPerElement=20,Qt("StructArrayLayout6i1ul2ui20",Po);var wi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt){var tr=this.length;return this.resize(tr+1),this.emplace(tr,se,we,De,He,mt,jt)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr){var fr=se*6;return this.int16[fr+0]=we,this.int16[fr+1]=De,this.int16[fr+2]=He,this.int16[fr+3]=mt,this.int16[fr+4]=jt,this.int16[fr+5]=tr,se},C})(ea);wi.prototype.bytesPerElement=12,Qt("StructArrayLayout2i2i2i12",wi);var ji=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt){var jt=this.length;return this.resize(jt+1),this.emplace(jt,se,we,De,He,mt)},C.prototype.emplace=function(se,we,De,He,mt,jt){var tr=se*4,fr=se*8;return this.float32[tr+0]=we,this.float32[tr+1]=De,this.float32[tr+2]=He,this.int16[fr+6]=mt,this.int16[fr+7]=jt,se},C})(ea);ji.prototype.bytesPerElement=16,Qt("StructArrayLayout2f1f2i16",ji);var Ya=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He){var mt=this.length;return this.resize(mt+1),this.emplace(mt,se,we,De,He)},C.prototype.emplace=function(se,we,De,He,mt){var jt=se*12,tr=se*3;return this.uint8[jt+0]=we,this.uint8[jt+1]=De,this.float32[tr+1]=He,this.float32[tr+2]=mt,se},C})(ea);Ya.prototype.bytesPerElement=12,Qt("StructArrayLayout2ub2f12",Ya);var Mo=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,we,De)},C.prototype.emplace=function(se,we,De,He){var mt=se*3;return this.uint16[mt+0]=we,this.uint16[mt+1]=De,this.uint16[mt+2]=He,se},C})(ea);Mo.prototype.bytesPerElement=6,Qt("StructArrayLayout3ui6",Mo);var Ho=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt,tr,fr,Or,en,Kr,xn,$n,ja,ba,_i,Qa){var gi=this.length;return this.resize(gi+1),this.emplace(gi,se,we,De,He,mt,jt,tr,fr,Or,en,Kr,xn,$n,ja,ba,_i,Qa)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr,fr,Or,en,Kr,xn,$n,ja,ba,_i,Qa,gi){var Li=se*24,Ji=se*12,To=se*48;return this.int16[Li+0]=we,this.int16[Li+1]=De,this.uint16[Li+2]=He,this.uint16[Li+3]=mt,this.uint32[Ji+2]=jt,this.uint32[Ji+3]=tr,this.uint32[Ji+4]=fr,this.uint16[Li+10]=Or,this.uint16[Li+11]=en,this.uint16[Li+12]=Kr,this.float32[Ji+7]=xn,this.float32[Ji+8]=$n,this.uint8[To+36]=ja,this.uint8[To+37]=ba,this.uint8[To+38]=_i,this.uint32[Ji+10]=Qa,this.int16[Li+22]=gi,se},C})(ea);Ho.prototype.bytesPerElement=48,Qt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ho);var ts=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He,mt,jt,tr,fr,Or,en,Kr,xn,$n,ja,ba,_i,Qa,gi,Li,Ji,To,xo,cs,Uo,Qo,vl,fs,ys){var Vl=this.length;return this.resize(Vl+1),this.emplace(Vl,se,we,De,He,mt,jt,tr,fr,Or,en,Kr,xn,$n,ja,ba,_i,Qa,gi,Li,Ji,To,xo,cs,Uo,Qo,vl,fs,ys)},C.prototype.emplace=function(se,we,De,He,mt,jt,tr,fr,Or,en,Kr,xn,$n,ja,ba,_i,Qa,gi,Li,Ji,To,xo,cs,Uo,Qo,vl,fs,ys,Vl){var il=se*34,Ou=se*17;return this.int16[il+0]=we,this.int16[il+1]=De,this.int16[il+2]=He,this.int16[il+3]=mt,this.int16[il+4]=jt,this.int16[il+5]=tr,this.int16[il+6]=fr,this.int16[il+7]=Or,this.uint16[il+8]=en,this.uint16[il+9]=Kr,this.uint16[il+10]=xn,this.uint16[il+11]=$n,this.uint16[il+12]=ja,this.uint16[il+13]=ba,this.uint16[il+14]=_i,this.uint16[il+15]=Qa,this.uint16[il+16]=gi,this.uint16[il+17]=Li,this.uint16[il+18]=Ji,this.uint16[il+19]=To,this.uint16[il+20]=xo,this.uint16[il+21]=cs,this.uint16[il+22]=Uo,this.uint32[Ou+12]=Qo,this.float32[Ou+13]=vl,this.float32[Ou+14]=fs,this.float32[Ou+15]=ys,this.float32[Ou+16]=Vl,se},C})(ea);ts.prototype.bytesPerElement=68,Qt("StructArrayLayout8i15ui1ul4f68",ts);var cl=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var we=this.length;return this.resize(we+1),this.emplace(we,se)},C.prototype.emplace=function(se,we){var De=se*1;return this.float32[De+0]=we,se},C})(ea);cl.prototype.bytesPerElement=4,Qt("StructArrayLayout1f4",cl);var rs=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,we,De)},C.prototype.emplace=function(se,we,De,He){var mt=se*3;return this.int16[mt+0]=we,this.int16[mt+1]=De,this.int16[mt+2]=He,se},C})(ea);rs.prototype.bytesPerElement=6,Qt("StructArrayLayout3i6",rs);var Tu=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,we,De)},C.prototype.emplace=function(se,we,De,He){var mt=se*2,jt=se*4;return this.uint32[mt+0]=we,this.uint16[jt+2]=De,this.uint16[jt+3]=He,se},C})(ea);Tu.prototype.bytesPerElement=8,Qt("StructArrayLayout1ul2ui8",Tu);var tl=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we){var De=this.length;return this.resize(De+1),this.emplace(De,se,we)},C.prototype.emplace=function(se,we,De){var He=se*2;return this.uint16[He+0]=we,this.uint16[He+1]=De,se},C})(ea);tl.prototype.bytesPerElement=4,Qt("StructArrayLayout2ui4",tl);var du=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var we=this.length;return this.resize(we+1),this.emplace(we,se)},C.prototype.emplace=function(se,we){var De=se*1;return this.uint16[De+0]=we,se},C})(ea);du.prototype.bytesPerElement=2,Qt("StructArrayLayout1ui2",du);var Du=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,we,De,He){var mt=this.length;return this.resize(mt+1),this.emplace(mt,se,we,De,He)},C.prototype.emplace=function(se,we,De,He,mt){var jt=se*4;return this.float32[jt+0]=we,this.float32[jt+1]=De,this.float32[jt+2]=He,this.float32[jt+3]=mt,se},C})(ea);Du.prototype.bytesPerElement=16,Qt("StructArrayLayout4f16",Du);var Wu=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return X.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},X.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},X.x1.get=function(){return this._structArray.int16[this._pos2+2]},X.y1.get=function(){return this._structArray.int16[this._pos2+3]},X.x2.get=function(){return this._structArray.int16[this._pos2+4]},X.y2.get=function(){return this._structArray.int16[this._pos2+5]},X.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},X.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},X.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},X.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(C.prototype,X),C})(ga);Wu.prototype.size=20;var pf=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new Wu(this,se)},C})(Po);Qt("CollisionBoxArray",pf);var Ql=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return X.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},X.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},X.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},X.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},X.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},X.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},X.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},X.segment.get=function(){return this._structArray.uint16[this._pos2+10]},X.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},X.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},X.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},X.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},X.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},X.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},X.placedOrientation.set=function(se){this._structArray.uint8[this._pos1+37]=se},X.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},X.hidden.set=function(se){this._structArray.uint8[this._pos1+38]=se},X.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},X.crossTileID.set=function(se){this._structArray.uint32[this._pos4+10]=se},X.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(C.prototype,X),C})(ga);Ql.prototype.size=48;var cu=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new Ql(this,se)},C})(Ho);Qt("PlacedSymbolArray",cu);var vo=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return X.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},X.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},X.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},X.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},X.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},X.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},X.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},X.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},X.key.get=function(){return this._structArray.uint16[this._pos2+8]},X.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},X.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},X.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},X.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},X.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},X.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},X.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},X.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},X.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},X.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},X.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},X.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},X.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},X.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},X.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},X.crossTileID.set=function(se){this._structArray.uint32[this._pos4+12]=se},X.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},X.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},X.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},X.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(C.prototype,X),C})(ga);vo.prototype.size=68;var Ku=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new vo(this,se)},C})(ts);Qt("SymbolInstanceArray",Ku);var Vs=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getoffsetX=function(se){return this.float32[se*1+0]},C})(cl);Qt("GlyphOffsetArray",Vs);var Fl=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getx=function(se){return this.int16[se*3+0]},C.prototype.gety=function(se){return this.int16[se*3+1]},C.prototype.gettileUnitDistanceFromAnchor=function(se){return this.int16[se*3+2]},C})(rs);Qt("SymbolLineVertexArray",Fl);var uc=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return X.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},X.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},X.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(C.prototype,X),C})(ga);uc.prototype.size=8;var cc=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new uc(this,se)},C})(Tu);Qt("FeatureIndexArray",cc);var Co=ya([{name:"a_pos",components:2,type:"Int16"}],4),ms=Co.members,bs=function(C){C===void 0&&(C=[]),this.segments=C};bs.prototype.prepareSegment=function(C,X,se,we){var De=this.segments[this.segments.length-1];return C>bs.MAX_VERTEX_ARRAY_LENGTH&&j("Max vertices per segment is "+bs.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+C),(!De||De.vertexLength+C>bs.MAX_VERTEX_ARRAY_LENGTH||De.sortKey!==we)&&(De={vertexOffset:X.length,primitiveOffset:se.length,vertexLength:0,primitiveLength:0},we!==void 0&&(De.sortKey=we),this.segments.push(De)),De},bs.prototype.get=function(){return this.segments},bs.prototype.destroy=function(){for(var C=0,X=this.segments;C>>16)*jt&65535)<<16)&4294967295,fr=fr<<15|fr>>>17,fr=(fr&65535)*tr+(((fr>>>16)*tr&65535)<<16)&4294967295,He^=fr,He=He<<13|He>>>19,mt=(He&65535)*5+(((He>>>16)*5&65535)<<16)&4294967295,He=(mt&65535)+27492+(((mt>>>16)+58964&65535)<<16);switch(fr=0,we){case 3:fr^=(X.charCodeAt(Or+2)&255)<<16;case 2:fr^=(X.charCodeAt(Or+1)&255)<<8;case 1:fr^=X.charCodeAt(Or)&255,fr=(fr&65535)*jt+(((fr>>>16)*jt&65535)<<16)&4294967295,fr=fr<<15|fr>>>17,fr=(fr&65535)*tr+(((fr>>>16)*tr&65535)<<16)&4294967295,He^=fr}return He^=X.length,He^=He>>>16,He=(He&65535)*2246822507+(((He>>>16)*2246822507&65535)<<16)&4294967295,He^=He>>>13,He=(He&65535)*3266489909+(((He>>>16)*3266489909&65535)<<16)&4294967295,He^=He>>>16,He>>>0}k.exports=C}),J=t(function(k){function C(X,se){for(var we=X.length,De=se^we,He=0,mt;we>=4;)mt=X.charCodeAt(He)&255|(X.charCodeAt(++He)&255)<<8|(X.charCodeAt(++He)&255)<<16|(X.charCodeAt(++He)&255)<<24,mt=(mt&65535)*1540483477+(((mt>>>16)*1540483477&65535)<<16),mt^=mt>>>24,mt=(mt&65535)*1540483477+(((mt>>>16)*1540483477&65535)<<16),De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16)^mt,we-=4,++He;switch(we){case 3:De^=(X.charCodeAt(He+2)&255)<<16;case 2:De^=(X.charCodeAt(He+1)&255)<<8;case 1:De^=X.charCodeAt(He)&255,De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16)}return De^=De>>>13,De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16),De^=De>>>15,De>>>0}k.exports=C}),_e=he,qe=he,lt=J;_e.murmur3=qe,_e.murmur2=lt;var vt=function(){this.ids=[],this.positions=[],this.indexed=!1};vt.prototype.add=function(C,X,se,we){this.ids.push(at(C)),this.positions.push(X,se,we)},vt.prototype.getPositions=function(C){for(var X=at(C),se=0,we=this.ids.length-1;se>1;this.ids[De]>=X?we=De:se=De+1}for(var He=[];this.ids[se]===X;){var mt=this.positions[3*se],jt=this.positions[3*se+1],tr=this.positions[3*se+2];He.push({index:mt,start:jt,end:tr}),se++}return He},vt.serialize=function(C,X){var se=new Float64Array(C.ids),we=new Uint32Array(C.positions);return bt(se,we,0,se.length-1),X&&X.push(se.buffer,we.buffer),{ids:se,positions:we}},vt.deserialize=function(C){var X=new vt;return X.ids=C.ids,X.positions=C.positions,X.indexed=!0,X};var Ke=Math.pow(2,53)-1;function at(k){var C=+k;return!isNaN(C)&&C<=Ke?C:_e(String(k))}function bt(k,C,X,se){for(;X>1],De=X-1,He=se+1;;){do De++;while(k[De]we);if(De>=He)break;Zt(k,De,He),Zt(C,3*De,3*He),Zt(C,3*De+1,3*He+1),Zt(C,3*De+2,3*He+2)}He-XHe.x+1||jtHe.y+1)&&j("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return X}function _l(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?fl(k):[]}}function yl(k,C,X,se,we){k.emplaceBack(C*2+(se+1)/2,X*2+(we+1)/2)}var $u=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(X){return X.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Ua,this.indexArray=new Mo,this.segments=new bs,this.programConfigurations=new ca(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(X){return X.isStateDependent()}).map(function(X){return X.id})};$u.prototype.populate=function(C,X,se){var we=this.layers[0],De=[],He=null;we.type==="circle"&&(He=we.layout.get("circle-sort-key"));for(var mt=0,jt=C;mt=Hi||en<0||en>=Hi)){var Kr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),xn=Kr.vertexLength;yl(this.layoutVertexArray,Or,en,-1,-1),yl(this.layoutVertexArray,Or,en,1,-1),yl(this.layoutVertexArray,Or,en,1,1),yl(this.layoutVertexArray,Or,en,-1,1),this.indexArray.emplaceBack(xn,xn+1,xn+2),this.indexArray.emplaceBack(xn,xn+3,xn+2),Kr.vertexLength+=4,Kr.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,se,{},we)},Qt("CircleBucket",$u,{omit:["layers"]});function ol(k,C){for(var X=0;X=3){for(var De=0;De1){if(Nd(k,C))return!0;for(var se=0;se1?k.distSqr(X):k.distSqr(X.sub(C)._mult(we)._add(C))}function xp(k,C){for(var X=!1,se,we,De,He=0;HeC.y!=De.y>C.y&&C.x<(De.x-we.x)*(C.y-we.y)/(De.y-we.y)+we.x&&(X=!X)}return X}function Kv(k,C){for(var X=!1,se=0,we=k.length-1;seC.y!=He.y>C.y&&C.x<(He.x-De.x)*(C.y-De.y)/(He.y-De.y)+De.x&&(X=!X)}return X}function bp(k,C,X,se,we){for(var De=0,He=k;De=mt.x&&we>=mt.y)return!0}var jt=[new i(C,X),new i(C,we),new i(se,we),new i(se,X)];if(k.length>2)for(var tr=0,fr=jt;trwe.x&&C.x>we.x||k.ywe.y&&C.y>we.y)return!1;var De=Z(k,C,X[0]);return De!==Z(k,C,X[1])||De!==Z(k,C,X[2])||De!==Z(k,C,X[3])}function $v(k,C,X){var se=C.paint.get(k).value;return se.kind==="constant"?se.value:X.programConfigurations.get(C.id).getMaxValue(k)}function Ud(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1])}function sp(k,C,X,se,we){if(!C[0]&&!C[1])return k;var De=i.convert(C)._mult(we);X==="viewport"&&De._rotate(-se);for(var He=[],mt=0;mt0&&(De=1/Math.sqrt(De)),k[0]=C[0]*De,k[1]=C[1]*De,k[2]=C[2]*De,k}function XE(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function YE(k,C,X){var se=C[0],we=C[1],De=C[2],He=X[0],mt=X[1],jt=X[2];return k[0]=we*jt-De*mt,k[1]=De*He-se*jt,k[2]=se*mt-we*He,k}function ZE(k,C,X){var se=C[0],we=C[1],De=C[2];return k[0]=se*X[0]+we*X[3]+De*X[6],k[1]=se*X[1]+we*X[4]+De*X[7],k[2]=se*X[2]+we*X[5]+De*X[8],k}var WE=Nm;(function(){var k=Bm();return function(C,X,se,we,De,He){var mt,jt;for(X||(X=3),se||(se=0),we?jt=Math.min(we*X+se,C.length):jt=C.length,mt=se;mtk.width||we.height>k.height||X.x>k.width-we.width||X.y>k.height-we.height)throw new RangeError("out of range source coordinates for image copy");if(we.width>C.width||we.height>C.height||se.x>C.width-we.width||se.y>C.height-we.height)throw new RangeError("out of range destination coordinates for image copy");for(var He=k.data,mt=C.data,jt=0;jt80*X){mt=tr=k[0],jt=fr=k[1];for(var xn=X;xntr&&(tr=Or),en>fr&&(fr=en);Kr=Math.max(tr-mt,fr-jt),Kr=Kr!==0?1/Kr:0}return Ng(De,He,X,mt,jt,Kr),He}function H3(k,C,X,se,we){var De,He;if(we===K3(k,C,X,se)>0)for(De=C;De=C;De-=se)He=fS(De,k[De],k[De+1],He);return He&&Jy(He,He.next)&&(H_(He),He=He.next),He}function $0(k,C){if(!k)return k;C||(C=k);var X=k,se;do if(se=!1,!X.steiner&&(Jy(X,X.next)||th(X.prev,X,X.next)===0)){if(H_(X),X=C=X.prev,X===X.next)break;se=!0}else X=X.next;while(se||X!==C);return C}function Ng(k,C,X,se,we,De,He){if(k){!He&&De&&X3(k,se,we,De);for(var mt=k,jt,tr;k.prev!==k.next;){if(jt=k.prev,tr=k.next,De?r6(k,se,we,De):G3(k)){C.push(jt.i/X),C.push(k.i/X),C.push(tr.i/X),H_(k),k=tr.next,mt=tr.next;continue}if(k=tr,k===mt){He?He===1?(k=n6($0(k),C,X),Ng(k,C,X,se,we,De,2)):He===2&&lS(k,C,X,se,we,De):Ng($0(k),C,X,se,we,De,1);break}}}}function G3(k){var C=k.prev,X=k,se=k.next;if(th(C,X,se)>=0)return!1;for(var we=k.next.next;we!==k.prev;){if(qm(C.x,C.y,X.x,X.y,se.x,se.y,we.x,we.y)&&th(we.prev,we,we.next)>=0)return!1;we=we.next}return!0}function r6(k,C,X,se){var we=k.prev,De=k,He=k.next;if(th(we,De,He)>=0)return!1;for(var mt=we.xDe.x?we.x>He.x?we.x:He.x:De.x>He.x?De.x:He.x,fr=we.y>De.y?we.y>He.y?we.y:He.y:De.y>He.y?De.y:He.y,Or=Y3(mt,jt,C,X,se),en=Y3(tr,fr,C,X,se),Kr=k.prevZ,xn=k.nextZ;Kr&&Kr.z>=Or&&xn&&xn.z<=en;){if(Kr!==k.prev&&Kr!==k.next&&qm(we.x,we.y,De.x,De.y,He.x,He.y,Kr.x,Kr.y)&&th(Kr.prev,Kr,Kr.next)>=0||(Kr=Kr.prevZ,xn!==k.prev&&xn!==k.next&&qm(we.x,we.y,De.x,De.y,He.x,He.y,xn.x,xn.y)&&th(xn.prev,xn,xn.next)>=0))return!1;xn=xn.nextZ}for(;Kr&&Kr.z>=Or;){if(Kr!==k.prev&&Kr!==k.next&&qm(we.x,we.y,De.x,De.y,He.x,He.y,Kr.x,Kr.y)&&th(Kr.prev,Kr,Kr.next)>=0)return!1;Kr=Kr.prevZ}for(;xn&&xn.z<=en;){if(xn!==k.prev&&xn!==k.next&&qm(we.x,we.y,De.x,De.y,He.x,He.y,xn.x,xn.y)&&th(xn.prev,xn,xn.next)>=0)return!1;xn=xn.nextZ}return!0}function n6(k,C,X){var se=k;do{var we=se.prev,De=se.next.next;!Jy(we,De)&&Ug(we,se,se.next,De)&&Qy(we,De)&&Qy(De,we)&&(C.push(we.i/X),C.push(se.i/X),C.push(De.i/X),H_(se),H_(se.next),se=k=De),se=se.next}while(se!==k);return $0(se)}function lS(k,C,X,se,we,De){var He=k;do{for(var mt=He.next.next;mt!==He.prev;){if(He.i!==mt.i&&i6(He,mt)){var jt=W3(He,mt);He=$0(He,He.next),jt=$0(jt,jt.next),Ng(He,C,X,se,we,De),Ng(jt,C,X,se,we,De);return}mt=mt.next}He=He.next}while(He!==k)}function uS(k,C,X,se){var we=[],De,He,mt,jt,tr;for(De=0,He=C.length;De=X.next.y&&X.next.y!==X.y){var mt=X.x+(we-X.y)*(X.next.x-X.x)/(X.next.y-X.y);if(mt<=se&&mt>De){if(De=mt,mt===se){if(we===X.y)return X;if(we===X.next.y)return X.next}He=X.x=X.x&&X.x>=tr&&se!==X.x&&qm(weHe.x||X.x===He.x&&cS(He,X)))&&(He=X,Or=en)),X=X.next;while(X!==jt);return He}function cS(k,C){return th(k.prev,k,C.prev)<0&&th(C.next,k,k.next)<0}function X3(k,C,X,se){var we=k;do we.z===null&&(we.z=Y3(we.x,we.y,C,X,se)),we.prevZ=we.prev,we.nextZ=we.next,we=we.next;while(we!==k);we.prevZ.nextZ=null,we.prevZ=null,a6(we)}function a6(k){var C,X,se,we,De,He,mt,jt,tr=1;do{for(X=k,k=null,De=null,He=0;X;){for(He++,se=X,mt=0,C=0;C0||jt>0&&se;)mt!==0&&(jt===0||!se||X.z<=se.z)?(we=X,X=X.nextZ,mt--):(we=se,se=se.nextZ,jt--),De?De.nextZ=we:k=we,we.prevZ=De,De=we;X=se}De.nextZ=null,tr*=2}while(He>1);return k}function Y3(k,C,X,se,we){return k=32767*(k-X)*we,C=32767*(C-se)*we,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,k|C<<1}function sw(k){var C=k,X=k;do(C.x=0&&(k-He)*(se-mt)-(X-He)*(C-mt)>=0&&(X-He)*(De-mt)-(we-He)*(se-mt)>=0}function i6(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!Z3(k,C)&&(Qy(k,C)&&Qy(C,k)&&lw(k,C)&&(th(k.prev,k,C.prev)||th(k,C.prev,C))||Jy(k,C)&&th(k.prev,k,k.next)>0&&th(C.prev,C,C.next)>0)}function th(k,C,X){return(C.y-k.y)*(X.x-C.x)-(C.x-k.x)*(X.y-C.y)}function Jy(k,C){return k.x===C.x&&k.y===C.y}function Ug(k,C,X,se){var we=V_(th(k,C,X)),De=V_(th(k,C,se)),He=V_(th(X,se,k)),mt=V_(th(X,se,C));return!!(we!==De&&He!==mt||we===0&&q_(k,X,C)||De===0&&q_(k,se,C)||He===0&&q_(X,k,se)||mt===0&&q_(X,C,se))}function q_(k,C,X){return C.x<=Math.max(k.x,X.x)&&C.x>=Math.min(k.x,X.x)&&C.y<=Math.max(k.y,X.y)&&C.y>=Math.min(k.y,X.y)}function V_(k){return k>0?1:k<0?-1:0}function Z3(k,C){var X=k;do{if(X.i!==k.i&&X.next.i!==k.i&&X.i!==C.i&&X.next.i!==C.i&&Ug(X,X.next,k,C))return!0;X=X.next}while(X!==k);return!1}function Qy(k,C){return th(k.prev,k,k.next)<0?th(k,C,k.next)>=0&&th(k,k.prev,C)>=0:th(k,C,k.prev)<0||th(k,k.next,C)<0}function lw(k,C){var X=k,se=!1,we=(k.x+C.x)/2,De=(k.y+C.y)/2;do X.y>De!=X.next.y>De&&X.next.y!==X.y&&we<(X.next.x-X.x)*(De-X.y)/(X.next.y-X.y)+X.x&&(se=!se),X=X.next;while(X!==k);return se}function W3(k,C){var X=new uw(k.i,k.x,k.y),se=new uw(C.i,C.x,C.y),we=k.next,De=C.prev;return k.next=C,C.prev=k,X.next=we,we.prev=X,se.next=X,X.prev=se,De.next=se,se.prev=De,se}function fS(k,C,X,se){var we=new uw(k,C,X);return se?(we.next=se.next,we.prev=se,se.next.prev=we,se.next=we):(we.prev=we,we.next=we),we}function H_(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function uw(k,C,X){this.i=k,this.x=C,this.y=X,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}ow.deviation=function(k,C,X,se){var we=C&&C.length,De=we?C[0]*X:k.length,He=Math.abs(K3(k,0,De,X));if(we)for(var mt=0,jt=C.length;mt0&&(se+=k[we-1].length,X.holes.push(se))}return X},iw.default=sS;function o6(k,C,X,se,we){hS(k,C,X,se||k.length-1,we||$3)}function hS(k,C,X,se,we){for(;se>X;){if(se-X>600){var De=se-X+1,He=C-X+1,mt=Math.log(De),jt=.5*Math.exp(2*mt/3),tr=.5*Math.sqrt(mt*jt*(De-jt)/De)*(He-De/2<0?-1:1),fr=Math.max(X,Math.floor(C-He*jt/De+tr)),Or=Math.min(se,Math.floor(C+(De-He)*jt/De+tr));hS(k,C,fr,Or,we)}var en=k[C],Kr=X,xn=se;for(G_(k,X,C),we(k[se],en)>0&&G_(k,X,se);Kr0;)xn--}we(k[X],en)===0?G_(k,X,xn):(xn++,G_(k,xn,se)),xn<=C&&(X=xn+1),C<=xn&&(se=xn-1)}}function G_(k,C,X){var se=k[C];k[C]=k[X],k[X]=se}function $3(k,C){return kC?1:0}function x0(k,C){var X=k.length;if(X<=1)return[k];for(var se=[],we,De,He=0;He1)for(var jt=0;jt>3}if(se--,X===1||X===2)we+=k.readSVarint(),De+=k.readSVarint(),X===1&&(mt&&He.push(mt),mt=[]),mt.push(new i(we,De));else if(X===7)mt&&mt.push(mt[0].clone());else throw new Error("unknown command "+X)}return mt&&He.push(mt),He},jg.prototype.bbox=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,X=1,se=0,we=0,De=0,He=1/0,mt=-1/0,jt=1/0,tr=-1/0;k.pos>3}if(se--,X===1||X===2)we+=k.readSVarint(),De+=k.readSVarint(),wemt&&(mt=we),Detr&&(tr=De);else if(X!==7)throw new Error("unknown command "+X)}return[He,jt,mt,tr]},jg.prototype.toGeoJSON=function(k,C,X){var se=this.extent*Math.pow(2,X),we=this.extent*k,De=this.extent*C,He=this.loadGeometry(),mt=jg.types[this.type],jt,tr;function fr(Kr){for(var xn=0;xn>3;C=se===1?k.readString():se===2?k.readFloat():se===3?k.readDouble():se===4?k.readVarint64():se===5?k.readVarint():se===6?k.readSVarint():se===7?k.readBoolean():null}return C}bS.prototype.feature=function(k){if(k<0||k>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[k];var C=this._pbf.readVarint()+this._pbf.pos;return new e1(this._pbf,C,this.extent,this._keys,this._values)};var TS=AS;function AS(k,C){this.layers=k.readFields(SS,{},C)}function SS(k,C,X){if(k===3){var se=new eT(X,X.readVarint()+X.pos);se.length&&(C[se.name]=se)}}var MS=TS,s6=e1,l6=eT,qg={VectorTile:MS,VectorTileFeature:s6,VectorTileLayer:l6},t1=qg.VectorTileFeature.types,ES=500,r1=Math.pow(2,13);function n1(k,C,X,se,we,De,He,mt){k.emplaceBack(C,X,Math.floor(se*r1)*2+He,we*r1*2,De*r1*2,Math.round(mt))}var Vd=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(X){return X.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new aa,this.indexArray=new Mo,this.programConfigurations=new ca(C.layers,C.zoom),this.segments=new bs,this.stateDependentLayerIds=this.layers.filter(function(X){return X.isStateDependent()}).map(function(X){return X.id})};Vd.prototype.populate=function(C,X,se){this.features=[],this.hasPattern=cw("fill-extrusion",this.layers,X);for(var we=0,De=C;we=1){var gi=ja[_i-1];if(!hw(Qa,gi)){Kr.vertexLength+4>bs.MAX_VERTEX_ARRAY_LENGTH&&(Kr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Li=Qa.sub(gi)._perp()._unit(),Ji=gi.dist(Qa);ba+Ji>32768&&(ba=0),n1(this.layoutVertexArray,Qa.x,Qa.y,Li.x,Li.y,0,0,ba),n1(this.layoutVertexArray,Qa.x,Qa.y,Li.x,Li.y,0,1,ba),ba+=Ji,n1(this.layoutVertexArray,gi.x,gi.y,Li.x,Li.y,0,0,ba),n1(this.layoutVertexArray,gi.x,gi.y,Li.x,Li.y,0,1,ba);var To=Kr.vertexLength;this.indexArray.emplaceBack(To,To+2,To+1),this.indexArray.emplaceBack(To+1,To+2,To+3),Kr.vertexLength+=4,Kr.primitiveLength+=2}}}}if(Kr.vertexLength+tr>bs.MAX_VERTEX_ARRAY_LENGTH&&(Kr=this.segments.prepareSegment(tr,this.layoutVertexArray,this.indexArray)),t1[C.type]==="Polygon"){for(var xo=[],cs=[],Uo=Kr.vertexLength,Qo=0,vl=jt;QoHi)||k.y===C.y&&(k.y<0||k.y>Hi)}function vw(k){return k.every(function(C){return C.x<0})||k.every(function(C){return C.x>Hi})||k.every(function(C){return C.y<0})||k.every(function(C){return C.y>Hi})}var u6=new Wa({"fill-extrusion-opacity":new gn(pi["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new pn(pi["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new gn(pi["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new gn(pi["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new za(pi["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new pn(pi["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new pn(pi["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new gn(pi["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),c6={paint:u6},f6=(function(k){function C(X){k.call(this,X,c6)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(se){return new Vd(se)},C.prototype.queryRadius=function(){return Ud(this.paint.get("fill-extrusion-translate"))},C.prototype.is3D=function(){return!0},C.prototype.queryIntersectsFeature=function(se,we,De,He,mt,jt,tr,fr){var Or=sp(se,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),jt.angle,tr),en=this.paint.get("fill-extrusion-height").evaluate(we,De),Kr=this.paint.get("fill-extrusion-base").evaluate(we,De),xn=kS(Or,fr,jt,0),$n=tT(He,Kr,en,fr),ja=$n[0],ba=$n[1];return Hm(ja,ba,xn)},C})(bi);function b0(k,C){return k.x*C.x+k.y*C.y}function Mv(k,C){if(k.length===1){for(var X=0,se=C[X++],we;!we||se.equals(we);)if(we=C[X++],!we)return 1/0;for(;X=2&&C[tr-1].equals(C[tr-2]);)tr--;for(var fr=0;fr0;if(xo&&_i>fr){var Uo=Kr.dist(xn);if(Uo>2*Or){var Qo=Kr.sub(Kr.sub(xn)._mult(Or/Uo)._round());this.updateDistance(xn,Qo),this.addCurrentVertex(Qo,ja,0,0,en),xn=Qo}}var vl=xn&&$n,fs=vl?se:jt?"butt":we;if(vl&&fs==="round"&&(JiDe&&(fs="bevel"),fs==="bevel"&&(Ji>2&&(fs="flipbevel"),Ji100)Qa=ba.mult(-1);else{var ys=Ji*ja.add(ba).mag()/ja.sub(ba).mag();Qa._perp()._mult(ys*(cs?-1:1))}this.addCurrentVertex(Kr,Qa,0,0,en),this.addCurrentVertex(Kr,Qa.mult(-1),0,0,en)}else if(fs==="bevel"||fs==="fakeround"){var Vl=-Math.sqrt(Ji*Ji-1),il=cs?Vl:0,Ou=cs?0:Vl;if(xn&&this.addCurrentVertex(Kr,ja,il,Ou,en),fs==="fakeround")for(var Nc=Math.round(To*180/Math.PI/aT),Fu=1;Fu2*Or){var Qh=Kr.add($n.sub(Kr)._mult(Or/Lv)._round());this.updateDistance(Kr,Qh),this.addCurrentVertex(Qh,ba,0,0,en),Kr=Qh}}}}},Uv.prototype.addCurrentVertex=function(C,X,se,we,De,He){He===void 0&&(He=!1);var mt=X.x+X.y*se,jt=X.y-X.x*se,tr=-X.x+X.y*we,fr=-X.y-X.x*we;this.addHalfVertex(C,mt,jt,He,!1,se,De),this.addHalfVertex(C,tr,fr,He,!0,-we,De),this.distance>dw/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(C,X,se,we,De,He))},Uv.prototype.addHalfVertex=function(C,X,se,we,De,He,mt){var jt=C.x,tr=C.y,fr=this.lineClips?this.scaledDistance*(dw-1):this.scaledDistance,Or=fr*a1;if(this.layoutVertexArray.emplaceBack((jt<<1)+(we?1:0),(tr<<1)+(De?1:0),Math.round(RS*X)+128,Math.round(RS*se)+128,(He===0?0:He<0?-1:1)+1|(Or&63)<<2,Or>>6),this.lineClips){var en=this.scaledDistance-this.lineClips.start,Kr=this.lineClips.end-this.lineClips.start,xn=en/Kr;this.layoutVertexArray2.emplaceBack(xn,this.lineClipsArray.length)}var $n=mt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,$n),mt.primitiveLength++),De?this.e2=$n:this.e1=$n},Uv.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Uv.prototype.updateDistance=function(C,X){this.distance+=C.dist(X),this.updateScaledDistance()},Qt("LineBucket",Uv,{omit:["layers","patternFeatures"]});var iT=new Wa({"line-cap":new gn(pi.layout_line["line-cap"]),"line-join":new pn(pi.layout_line["line-join"]),"line-miter-limit":new gn(pi.layout_line["line-miter-limit"]),"line-round-limit":new gn(pi.layout_line["line-round-limit"]),"line-sort-key":new pn(pi.layout_line["line-sort-key"])}),pw=new Wa({"line-opacity":new pn(pi.paint_line["line-opacity"]),"line-color":new pn(pi.paint_line["line-color"]),"line-translate":new gn(pi.paint_line["line-translate"]),"line-translate-anchor":new gn(pi.paint_line["line-translate-anchor"]),"line-width":new pn(pi.paint_line["line-width"]),"line-gap-width":new pn(pi.paint_line["line-gap-width"]),"line-offset":new pn(pi.paint_line["line-offset"]),"line-blur":new pn(pi.paint_line["line-blur"]),"line-dasharray":new Ia(pi.paint_line["line-dasharray"]),"line-pattern":new za(pi.paint_line["line-pattern"]),"line-gradient":new Da(pi.paint_line["line-gradient"])}),i1={paint:pw,layout:iT},oT=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(se,we){return we=new El(Math.floor(we.zoom),{now:we.now,fadeDuration:we.fadeDuration,zoomHistory:we.zoomHistory,transition:we.transition}),k.prototype.possiblyEvaluate.call(this,se,we)},C.prototype.evaluate=function(se,we,De,He){return we=_({},we,{zoom:Math.floor(we.zoom)}),k.prototype.evaluate.call(this,se,we,De,He)},C})(pn),mw=new oT(i1.paint.properties["line-width"].specification);mw.useIntegerZoom=!0;var sT=(function(k){function C(X){k.call(this,X,i1),this.gradientVersion=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._handleSpecialPaintPropertyUpdate=function(se){if(se==="line-gradient"){var we=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=we._styleExpression.expression instanceof Ic,this.gradientVersion=(this.gradientVersion+1)%c}},C.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},C.prototype.recalculate=function(se,we){k.prototype.recalculate.call(this,se,we),this.paint._values["line-floorwidth"]=mw.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,se)},C.prototype.createBucket=function(se){return new Uv(se)},C.prototype.queryRadius=function(se){var we=se,De=zS($v("line-width",this,we),$v("line-gap-width",this,we)),He=$v("line-offset",this,we);return De/2+Math.abs(He)+Ud(this.paint.get("line-translate"))},C.prototype.queryIntersectsFeature=function(se,we,De,He,mt,jt,tr){var fr=sp(se,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),jt.angle,tr),Or=tr/2*zS(this.paint.get("line-width").evaluate(we,De),this.paint.get("line-gap-width").evaluate(we,De)),en=this.paint.get("line-offset").evaluate(we,De);return en&&(He=Y(He,en*tr)),Th(fr,He,Or)},C.prototype.isTileClipped=function(){return!0},C})(bi);function zS(k,C){return C>0?C+2*k:k}function Y(k,C){for(var X=[],se=new i(0,0),we=0;we":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function dr(k){for(var C="",X=0;X>1,fr=-7,Or=X?we-1:0,en=X?-1:1,Kr=k[C+Or];for(Or+=en,De=Kr&(1<<-fr)-1,Kr>>=-fr,fr+=mt;fr>0;De=De*256+k[C+Or],Or+=en,fr-=8);for(He=De&(1<<-fr)-1,De>>=-fr,fr+=se;fr>0;He=He*256+k[C+Or],Or+=en,fr-=8);if(De===0)De=1-tr;else{if(De===jt)return He?NaN:(Kr?-1:1)*(1/0);He=He+Math.pow(2,se),De=De-tr}return(Kr?-1:1)*He*Math.pow(2,De-se)},Jr=function(k,C,X,se,we,De){var He,mt,jt,tr=De*8-we-1,fr=(1<>1,en=we===23?Math.pow(2,-24)-Math.pow(2,-77):0,Kr=se?0:De-1,xn=se?1:-1,$n=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(mt=isNaN(C)?1:0,He=fr):(He=Math.floor(Math.log(C)/Math.LN2),C*(jt=Math.pow(2,-He))<1&&(He--,jt*=2),He+Or>=1?C+=en/jt:C+=en*Math.pow(2,1-Or),C*jt>=2&&(He++,jt/=2),He+Or>=fr?(mt=0,He=fr):He+Or>=1?(mt=(C*jt-1)*Math.pow(2,we),He=He+Or):(mt=C*Math.pow(2,Or-1)*Math.pow(2,we),He=0));we>=8;k[X+Kr]=mt&255,Kr+=xn,mt/=256,we-=8);for(He=He<0;k[X+Kr]=He&255,Kr+=xn,He/=256,tr-=8);k[X+Kr-xn]|=$n*128},vn={read:qr,write:Jr},Tn=Bn;function Bn(k){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(k)?k:new Uint8Array(k||0),this.pos=0,this.type=0,this.length=this.buf.length}Bn.Varint=0,Bn.Fixed64=1,Bn.Bytes=2,Bn.Fixed32=5;var da=65536*65536,ui=1/da,Ba=12,ti=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Bn.prototype={destroy:function(){this.buf=null},readFields:function(k,C,X){for(X=X||this.length;this.pos>3,De=this.pos;this.type=se&7,k(we,C,this),this.pos===De&&this.skip(se)}return C},readMessage:function(k,C){return this.readFields(k,C,this.readVarint()+this.pos)},readFixed32:function(){var k=_d(this.buf,this.pos);return this.pos+=4,k},readSFixed32:function(){var k=Wh(this.buf,this.pos);return this.pos+=4,k},readFixed64:function(){var k=_d(this.buf,this.pos)+_d(this.buf,this.pos+4)*da;return this.pos+=8,k},readSFixed64:function(){var k=_d(this.buf,this.pos)+Wh(this.buf,this.pos+4)*da;return this.pos+=8,k},readFloat:function(){var k=vn.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=vn.read(this.buf,this.pos,!0,52,8);return this.pos+=8,k},readVarint:function(k){var C=this.buf,X,se;return se=C[this.pos++],X=se&127,se<128||(se=C[this.pos++],X|=(se&127)<<7,se<128)||(se=C[this.pos++],X|=(se&127)<<14,se<128)||(se=C[this.pos++],X|=(se&127)<<21,se<128)?X:(se=C[this.pos],X|=(se&15)<<28,Fi(X,k,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var k=this.readVarint();return k%2===1?(k+1)/-2:k/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var k=this.readVarint()+this.pos,C=this.pos;return this.pos=k,k-C>=Ba&&ti?cd(this.buf,C,k):ud(this.buf,C,k)},readBytes:function(){var k=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,k);return this.pos=k,C},readPackedVarint:function(k,C){if(this.type!==Bn.Bytes)return k.push(this.readVarint(C));var X=ho(this);for(k=k||[];this.pos127;);else if(C===Bn.Bytes)this.pos=this.readVarint()+this.pos;else if(C===Bn.Fixed32)this.pos+=4;else if(C===Bn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+C)},writeTag:function(k,C){this.writeVarint(k<<3|C)},realloc:function(k){for(var C=this.length||16;C268435455||k<0){hl(k,this);return}this.realloc(4),this.buf[this.pos++]=k&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=k>>>7&127)))},writeSVarint:function(k){this.writeVarint(k<0?-k*2-1:k*2)},writeBoolean:function(k){this.writeVarint(!!k)},writeString:function(k){k=String(k),this.realloc(k.length*4),this.pos++;var C=this.pos;this.pos=fd(this.buf,k,this.pos);var X=this.pos-C;X>=128&&zs(C,X,this),this.pos=C-1,this.writeVarint(X),this.pos+=X},writeFloat:function(k){this.realloc(4),vn.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),vn.write(this.buf,k,this.pos,!0,52,8),this.pos+=8},writeBytes:function(k){var C=k.length;this.writeVarint(C),this.realloc(C);for(var X=0;X=128&&zs(X,se,this),this.pos=X-1,this.writeVarint(se),this.pos+=se},writeMessage:function(k,C,X){this.writeTag(k,Bn.Bytes),this.writeRawMessage(C,X)},writePackedVarint:function(k,C){C.length&&this.writeMessage(k,Es,C)},writePackedSVarint:function(k,C){C.length&&this.writeMessage(k,Ts,C)},writePackedBoolean:function(k,C){C.length&&this.writeMessage(k,Os,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,to,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,Xs,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,Pl,C)},writePackedSFixed32:function(k,C){C.length&&this.writeMessage(k,af,C)},writePackedFixed64:function(k,C){C.length&&this.writeMessage(k,Zc,C)},writePackedSFixed64:function(k,C){C.length&&this.writeMessage(k,lv,C)},writeBytesField:function(k,C){this.writeTag(k,Bn.Bytes),this.writeBytes(C)},writeFixed32Field:function(k,C){this.writeTag(k,Bn.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(k,C){this.writeTag(k,Bn.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(k,C){this.writeTag(k,Bn.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(k,C){this.writeTag(k,Bn.Fixed64),this.writeSFixed64(C)},writeVarintField:function(k,C){this.writeTag(k,Bn.Varint),this.writeVarint(C)},writeSVarintField:function(k,C){this.writeTag(k,Bn.Varint),this.writeSVarint(C)},writeStringField:function(k,C){this.writeTag(k,Bn.Bytes),this.writeString(C)},writeFloatField:function(k,C){this.writeTag(k,Bn.Fixed32),this.writeFloat(C)},writeDoubleField:function(k,C){this.writeTag(k,Bn.Fixed64),this.writeDouble(C)},writeBooleanField:function(k,C){this.writeVarintField(k,!!C)}};function Fi(k,C,X){var se=X.buf,we,De;if(De=se[X.pos++],we=(De&112)>>4,De<128||(De=se[X.pos++],we|=(De&127)<<3,De<128)||(De=se[X.pos++],we|=(De&127)<<10,De<128)||(De=se[X.pos++],we|=(De&127)<<17,De<128)||(De=se[X.pos++],we|=(De&127)<<24,De<128)||(De=se[X.pos++],we|=(De&1)<<31,De<128))return Jo(k,we,C);throw new Error("Expected varint not more than 10 bytes")}function ho(k){return k.type===Bn.Bytes?k.readVarint()+k.pos:k.pos+1}function Jo(k,C,X){return X?C*4294967296+(k>>>0):(C>>>0)*4294967296+(k>>>0)}function hl(k,C){var X,se;if(k>=0?(X=k%4294967296|0,se=k/4294967296|0):(X=~(-k%4294967296),se=~(-k/4294967296),X^4294967295?X=X+1|0:(X=0,se=se+1|0)),k>=18446744073709552e3||k<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");C.realloc(10),ls(X,se,C),Wo(se,C)}function ls(k,C,X){X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos]=k&127}function Wo(k,C){var X=(k&7)<<4;C.buf[C.pos++]|=X|((k>>>=3)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127)))))}function zs(k,C,X){var se=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(Math.LN2*7));X.realloc(se);for(var we=X.pos-1;we>=k;we--)X.buf[we+se]=X.buf[we]}function Es(k,C){for(var X=0;X>>8,k[X+2]=C>>>16,k[X+3]=C>>>24}function Wh(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+(k[C+3]<<24)}function ud(k,C,X){for(var se="",we=C;we239?4:De>223?3:De>191?2:1;if(we+mt>X)break;var jt,tr,fr;mt===1?De<128&&(He=De):mt===2?(jt=k[we+1],(jt&192)===128&&(He=(De&31)<<6|jt&63,He<=127&&(He=null))):mt===3?(jt=k[we+1],tr=k[we+2],(jt&192)===128&&(tr&192)===128&&(He=(De&15)<<12|(jt&63)<<6|tr&63,(He<=2047||He>=55296&&He<=57343)&&(He=null))):mt===4&&(jt=k[we+1],tr=k[we+2],fr=k[we+3],(jt&192)===128&&(tr&192)===128&&(fr&192)===128&&(He=(De&15)<<18|(jt&63)<<12|(tr&63)<<6|fr&63,(He<=65535||He>=1114112)&&(He=null))),He===null?(He=65533,mt=1):He>65535&&(He-=65536,se+=String.fromCharCode(He>>>10&1023|55296),He=56320|He&1023),se+=String.fromCharCode(He),we+=mt}return se}function cd(k,C,X){return ti.decode(k.subarray(C,X))}function fd(k,C,X){for(var se=0,we,De;se55295&&we<57344)if(De)if(we<56320){k[X++]=239,k[X++]=191,k[X++]=189,De=we;continue}else we=De-55296<<10|we-56320|65536,De=null;else{we>56319||se+1===C.length?(k[X++]=239,k[X++]=191,k[X++]=189):De=we;continue}else De&&(k[X++]=239,k[X++]=191,k[X++]=189,De=null);we<128?k[X++]=we:(we<2048?k[X++]=we>>6|192:(we<65536?k[X++]=we>>12|224:(k[X++]=we>>18|240,k[X++]=we>>12&63|128),k[X++]=we>>6&63|128),k[X++]=we&63|128)}return X}var Yf=3;function uv(k,C,X){k===1&&X.readMessage(Qv,C)}function Qv(k,C,X){if(k===3){var se=X.readMessage(jv,{}),we=se.id,De=se.bitmap,He=se.width,mt=se.height,jt=se.left,tr=se.top,fr=se.advance;C.push({id:we,bitmap:new Zh({width:He+2*Yf,height:mt+2*Yf},De),metrics:{width:He,height:mt,left:jt,top:tr,advance:fr}})}}function jv(k,C,X){k===1?C.id=X.readVarint():k===2?C.bitmap=X.readBytes():k===3?C.width=X.readVarint():k===4?C.height=X.readVarint():k===5?C.left=X.readSVarint():k===6?C.top=X.readSVarint():k===7&&(C.advance=X.readVarint())}function hd(k){return new Tn(k).readFields(uv,[])}var Ev=Yf;function Hd(k){for(var C=0,X=0,se=0,we=k;se=0;Kr--){var xn=mt[Kr];if(!(en.w>xn.w||en.h>xn.h)){if(en.x=xn.x,en.y=xn.y,tr=Math.max(tr,en.y+en.h),jt=Math.max(jt,en.x+en.w),en.w===xn.w&&en.h===xn.h){var $n=mt.pop();Kr=0&&we>=C&&Gd[this.text.charCodeAt(we)];we--)se--;this.text=this.text.substring(C,se),this.sectionIndex=this.sectionIndex.slice(C,se)},of.prototype.substring=function(C,X){var se=new of;return se.text=this.text.substring(C,X),se.sectionIndex=this.sectionIndex.slice(C,X),se.sections=this.sections,se},of.prototype.toString=function(){return this.text},of.prototype.getMaxScale=function(){var C=this;return this.sectionIndex.reduce(function(X,se){return Math.max(X,C.sections[se].scale)},0)},of.prototype.addTextSection=function(C,X){this.text+=C.text,this.sections.push(ed.forText(C.scale,C.fontStack||X));for(var se=this.sections.length-1,we=0;we=Kp?null:++this.imageSectionID:(this.imageSectionID=Wp,this.imageSectionID)};function kv(k,C){for(var X=[],se=k.text,we=0,De=0,He=C;De=0,fr=0,Or=0;Or0&&Qh>cs&&(cs=Qh)}else{var Bu=X[Qo.fontStack],Pu=Bu&&Bu[fs];if(Pu&&Pu.rect)il=Pu.rect,Vl=Pu.metrics;else{var sf=C[Qo.fontStack],_f=sf&&sf[fs];if(!_f)continue;Vl=_f.metrics}ys=(Li-Qo.scale)*xr}Fu?(k.verticalizable=!0,xo.push({glyph:fs,imageName:Ou,x:en,y:Kr+ys,vertical:Fu,scale:Qo.scale,fontStack:Qo.fontStack,sectionIndex:vl,metrics:Vl,rect:il}),en+=Nc*Qo.scale+tr):(xo.push({glyph:fs,imageName:Ou,x:en,y:Kr+ys,vertical:Fu,scale:Qo.scale,fontStack:Qo.fontStack,sectionIndex:vl,metrics:Vl,rect:il}),en+=Vl.advance*Qo.scale+tr)}if(xo.length!==0){var dd=en-tr;xn=Math.max(dd,xn),d6(xo,0,xo.length-1,ja,cs)}en=0;var pd=De*Li+cs;To.lineOffset=Math.max(cs,Ji),Kr+=pd,$n=Math.max(pd,$n),++ba}var Pv=Kr-yf,xd=vT(He),bd=xd.horizontalAlign,cv=xd.verticalAlign;p6(k.positionedLines,ja,bd,cv,xn,$n,De,Pv,we.length),k.top+=-cv*Pv,k.bottom=k.top+Pv,k.left+=-bd*xn,k.right=k.left+xn}function d6(k,C,X,se,we){if(!(!se&&!we))for(var De=k[X],He=De.metrics.advance*De.scale,mt=(k[X].x+He)*se,jt=C;jt<=X;jt++)k[jt].x-=mt,k[jt].y+=we}function p6(k,C,X,se,we,De,He,mt,jt){var tr=(C-X)*we,fr=0;De!==He?fr=-mt*se-yf:fr=(-se*jt+.5)*He;for(var Or=0,en=k;Or-X/2;){if(He--,He<0)return!1;mt-=k[He].dist(De),De=k[He]}mt+=k[He].dist(k[He+1]),He++;for(var jt=[],tr=0;mtse;)tr-=jt.shift().angleDelta;if(tr>we)return!1;He++,mt+=Or.dist(en)}return!0}function qv(k){for(var C=0,X=0;Xtr){var xn=(tr-jt)/Kr,$n=uu(Or.x,en.x,xn),ja=uu(Or.y,en.y,xn),ba=new s1($n,ja,en.angleTo(Or),fr);return ba._round(),!He||BS(k,ba,mt,He,C)?ba:void 0}jt+=Kr}}function Vg(k,C,X,se,we,De,He,mt,jt){var tr=Xd(se,De,He),fr=Gm(se,we),Or=fr*He,en=k[0].x===0||k[0].x===jt||k[0].y===0||k[0].y===jt;C-Or=0&&gi=0&&Li=0&&en+tr<=fr){var Ji=new s1(gi,Li,_i,xn);Ji._round(),(!se||BS(k,Ji,De,se,we))&&Kr.push(Ji)}}Or+=ba}return!mt&&!Kr.length&&!He&&(Kr=Jp(k,Or/2,X,se,we,De,He,!0,jt)),Kr}function CL(k,C,X,se,we){for(var De=[],He=0;He=se&&Or.x>=se)&&(fr.x>=se?fr=new i(se,fr.y+(Or.y-fr.y)*((se-fr.x)/(Or.x-fr.x)))._round():Or.x>=se&&(Or=new i(se,fr.y+(Or.y-fr.y)*((se-fr.x)/(Or.x-fr.x)))._round()),!(fr.y>=we&&Or.y>=we)&&(fr.y>=we?fr=new i(fr.x+(Or.x-fr.x)*((we-fr.y)/(Or.y-fr.y)),we)._round():Or.y>=we&&(Or=new i(fr.x+(Or.x-fr.x)*((we-fr.y)/(Or.y-fr.y)),we)._round()),(!jt||!fr.equals(jt[jt.length-1]))&&(jt=[fr],De.push(jt)),jt.push(Or)))))}return De}var yw=gf;function LL(k,C,X,se){var we=[],De=k.image,He=De.pixelRatio,mt=De.paddedRect.w-2*yw,jt=De.paddedRect.h-2*yw,tr=k.right-k.left,fr=k.bottom-k.top,Or=De.stretchX||[[0,mt]],en=De.stretchY||[[0,jt]],Kr=function(Bu,Pu){return Bu+Pu[1]-Pu[0]},xn=Or.reduce(Kr,0),$n=en.reduce(Kr,0),ja=mt-xn,ba=jt-$n,_i=0,Qa=xn,gi=0,Li=$n,Ji=0,To=ja,xo=0,cs=ba;if(De.content&&se){var Uo=De.content;_i=NS(Or,0,Uo[0]),gi=NS(en,0,Uo[1]),Qa=NS(Or,Uo[0],Uo[2]),Li=NS(en,Uo[1],Uo[3]),Ji=Uo[0]-_i,xo=Uo[1]-gi,To=Uo[2]-Uo[0]-Qa,cs=Uo[3]-Uo[1]-Li}var Qo=function(Bu,Pu,sf,_f){var fh=US(Bu.stretch-_i,Qa,tr,k.left),Sh=jS(Bu.fixed-Ji,To,Bu.stretch,xn),Lv=US(Pu.stretch-gi,Li,fr,k.top),Qh=jS(Pu.fixed-xo,cs,Pu.stretch,$n),dd=US(sf.stretch-_i,Qa,tr,k.left),pd=jS(sf.fixed-Ji,To,sf.stretch,xn),Pv=US(_f.stretch-gi,Li,fr,k.top),xd=jS(_f.fixed-xo,cs,_f.stretch,$n),bd=new i(fh,Lv),cv=new i(dd,Lv),wd=new i(dd,Pv),Ap=new i(fh,Pv),Xg=new i(Sh/He,Qh/He),f1=new i(pd/He,xd/He),h1=C*Math.PI/180;if(h1){var v1=Math.sin(h1),Mw=Math.cos(h1),w0=[Mw,-v1,v1,Mw];bd._matMult(w0),cv._matMult(w0),Ap._matMult(w0),wd._matMult(w0)}var YS=Bu.stretch+Bu.fixed,S6=sf.stretch+sf.fixed,ZS=Pu.stretch+Pu.fixed,M6=_f.stretch+_f.fixed,Qp={x:De.paddedRect.x+yw+YS,y:De.paddedRect.y+yw+ZS,w:S6-YS,h:M6-ZS},Ew=To/He/tr,WS=cs/He/fr;return{tl:bd,tr:cv,bl:Ap,br:wd,tex:Qp,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Xg,pixelOffsetBR:f1,minFontScaleX:Ew,minFontScaleY:WS,isSDF:X}};if(!se||!De.stretchX&&!De.stretchY)we.push(Qo({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:mt+1},{fixed:0,stretch:jt+1}));else for(var vl=PL(Or,ja,xn),fs=PL(en,ba,$n),ys=0;ys0&&(xn=Math.max(10,xn),this.circleDiameter=xn)}else{var $n=He.top*mt-jt,ja=He.bottom*mt+jt,ba=He.left*mt-jt,_i=He.right*mt+jt,Qa=He.collisionPadding;if(Qa&&(ba-=Qa[0]*mt,$n-=Qa[1]*mt,_i+=Qa[2]*mt,ja+=Qa[3]*mt),fr){var gi=new i(ba,$n),Li=new i(_i,$n),Ji=new i(ba,ja),To=new i(_i,ja),xo=fr*Math.PI/180;gi._rotate(xo),Li._rotate(xo),Ji._rotate(xo),To._rotate(xo),ba=Math.min(gi.x,Li.x,Ji.x,To.x),_i=Math.max(gi.x,Li.x,Ji.x,To.x),$n=Math.min(gi.y,Li.y,Ji.y,To.y),ja=Math.max(gi.y,Li.y,Ji.y,To.y)}C.emplaceBack(X.x,X.y,ba,$n,_i,ja,se,we,De)}this.boxEndIndex=C.length},_w=function(C,X){if(C===void 0&&(C=[]),X===void 0&&(X=z9),this.data=C,this.length=this.data.length,this.compare=X,this.length>0)for(var se=(this.length>>1)-1;se>=0;se--)this._down(se)};_w.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},_w.prototype.pop=function(){if(this.length!==0){var C=this.data[0],X=this.data.pop();return this.length--,this.length>0&&(this.data[0]=X,this._down(0)),C}},_w.prototype.peek=function(){return this.data[0]},_w.prototype._up=function(C){for(var X=this,se=X.data,we=X.compare,De=se[C];C>0;){var He=C-1>>1,mt=se[He];if(we(De,mt)>=0)break;se[C]=mt,C=He}se[C]=De},_w.prototype._down=function(C){for(var X=this,se=X.data,we=X.compare,De=this.length>>1,He=se[C];C=0)break;se[C]=jt,C=mt}se[C]=He};function z9(k,C){return kC?1:0}function O9(k,C,X){X===void 0&&(X=!1);for(var se=1/0,we=1/0,De=-1/0,He=-1/0,mt=k[0],jt=0;jtDe)&&(De=tr.x),(!jt||tr.y>He)&&(He=tr.y)}var fr=De-se,Or=He-we,en=Math.min(fr,Or),Kr=en/2,xn=new _w([],F9);if(en===0)return new i(se,we);for(var $n=se;$nba.d||!ba.d)&&(ba=Qa,X&&console.log("found best %d after %d probes",Math.round(1e4*Qa.d)/1e4,_i)),!(Qa.max-ba.d<=C)&&(Kr=Qa.h/2,xn.push(new xw(Qa.p.x-Kr,Qa.p.y-Kr,Kr,k)),xn.push(new xw(Qa.p.x+Kr,Qa.p.y-Kr,Kr,k)),xn.push(new xw(Qa.p.x-Kr,Qa.p.y+Kr,Kr,k)),xn.push(new xw(Qa.p.x+Kr,Qa.p.y+Kr,Kr,k)),_i+=4)}return X&&(console.log("num probes: "+_i),console.log("best distance: "+ba.d)),ba.p}function F9(k,C){return C.max-k.max}function xw(k,C,X,se){this.p=new i(k,C),this.h=X,this.d=B9(this.p,se),this.max=this.d+this.h*Math.SQRT2}function B9(k,C){for(var X=!1,se=1/0,we=0;wek.y!=fr.y>k.y&&k.x<(fr.x-tr.x)*(k.y-tr.y)/(fr.y-tr.y)+tr.x&&(X=!X),se=Math.min(se,Z0(k,tr,fr))}return(X?1:-1)*Math.sqrt(se)}function N9(k){for(var C=0,X=0,se=0,we=k[0],De=0,He=we.length,mt=He-1;De=Hi||w0.y<0||w0.y>=Hi||q9(k,w0,Mw,X,se,we,fs,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,ba,Li,xo,jt,Qa,Ji,cs,Kr,C,De,tr,fr,He)};if(Uo==="line")for(var Vl=0,il=CL(C.geometry,0,0,Hi,Hi);Vl1){var Lv=$p(Sh,To,X.vertical||xn,se,$n,_i);Lv&&ys(Sh,Lv)}}else if(C.type==="Polygon")for(var Qh=0,dd=x0(C.geometry,0);Qhu1&&j(k.layerIds[0]+': Value for "text-size" is >= '+pT+'. Reduce your "text-size".')):ja.kind==="composite"&&(ba=[Kh*Kr.compositeTextSizes[0].evaluate(He,{},xn),Kh*Kr.compositeTextSizes[1].evaluate(He,{},xn)],(ba[0]>u1||ba[1]>u1)&&j(k.layerIds[0]+': Value for "text-size" is >= '+pT+'. Reduce your "text-size".')),k.addSymbols(k.text,$n,ba,mt,De,He,tr,C,jt.lineStartIndex,jt.lineLength,en,xn);for(var _i=0,Qa=fr;_iu1&&j(k.layerIds[0]+': Value for "icon-size" is >= '+pT+'. Reduce your "icon-size".')):bd.kind==="composite"&&(cv=[Kh*Li.compositeIconSizes[0].evaluate(gi,{},To),Kh*Li.compositeIconSizes[1].evaluate(gi,{},To)],(cv[0]>u1||cv[1]>u1)&&j(k.layerIds[0]+': Value for "icon-size" is >= '+pT+'. Reduce your "icon-size".')),k.addSymbols(k.icon,Pv,cv,Qa,_i,gi,!1,C,Uo.lineStartIndex,Uo.lineLength,-1,To),Fu=k.icon.placedSymbolArray.length-1,xd&&(il=xd.length*4,k.addSymbols(k.icon,xd,cv,Qa,_i,gi,Uf.vertical,C,Uo.lineStartIndex,Uo.lineLength,-1,To),Bu=k.icon.placedSymbolArray.length-1)}for(var wd in se.horizontal){var Ap=se.horizontal[wd];if(!Qo){sf=_e(Ap.text);var Xg=mt.layout.get("text-rotate").evaluate(gi,{},To);Qo=new qS(jt,C,tr,fr,Or,Ap,en,Kr,xn,Xg)}var f1=Ap.positionedLines.length===1;if(Ou+=IL(k,C,Ap,De,mt,xn,gi,$n,Uo,se.vertical?Uf.horizontal:Uf.horizontalOnly,f1?Object.keys(se.horizontal):[wd],Pu,Fu,Li,To),f1)break}se.vertical&&(Nc+=IL(k,C,se.vertical,De,mt,xn,gi,$n,Uo,Uf.vertical,["vertical"],Pu,Bu,Li,To));var h1=Qo?Qo.boxStartIndex:k.collisionBoxArray.length,v1=Qo?Qo.boxEndIndex:k.collisionBoxArray.length,Mw=fs?fs.boxStartIndex:k.collisionBoxArray.length,w0=fs?fs.boxEndIndex:k.collisionBoxArray.length,YS=vl?vl.boxStartIndex:k.collisionBoxArray.length,S6=vl?vl.boxEndIndex:k.collisionBoxArray.length,ZS=ys?ys.boxStartIndex:k.collisionBoxArray.length,M6=ys?ys.boxEndIndex:k.collisionBoxArray.length,Qp=-1,Ew=function(yT,KL){return yT&&yT.circleDiameter?Math.max(yT.circleDiameter,KL):KL};Qp=Ew(Qo,Qp),Qp=Ew(fs,Qp),Qp=Ew(vl,Qp),Qp=Ew(ys,Qp);var WS=Qp>-1?1:0;WS&&(Qp*=xo/xr),k.glyphOffsetArray.length>=Bc.MAX_GLYPHS&&j("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),gi.sortKey!==void 0&&k.addToSortKeyRanges(k.symbolInstances.length,gi.sortKey),k.symbolInstances.emplaceBack(C.x,C.y,Pu.right>=0?Pu.right:-1,Pu.center>=0?Pu.center:-1,Pu.left>=0?Pu.left:-1,Pu.vertical||-1,Fu,Bu,sf,h1,v1,Mw,w0,YS,S6,ZS,M6,tr,Ou,Nc,Vl,il,WS,0,en,_f,fh,Qp)}function V9(k,C,X,se){var we=k.compareText;if(!(C in we))we[C]=[];else for(var De=we[C],He=De.length-1;He>=0;He--)if(se.dist(De[He])0)&&(He.value.kind!=="constant"||He.value.value.length>0),fr=jt.value.kind!=="constant"||!!jt.value.value||Object.keys(jt.parameters).length>0,Or=De.get("symbol-sort-key");if(this.features=[],!(!tr&&!fr)){for(var en=X.iconDependencies,Kr=X.glyphDependencies,xn=X.availableImages,$n=new El(this.zoom),ja=0,ba=C;ja=0;for(var Nc=0,Fu=cs.sections;Nc=0;jt--)He[jt]={x:X[jt].x,y:X[jt].y,tileUnitDistanceFromAnchor:De},jt>0&&(De+=X[jt-1].dist(X[jt]));for(var tr=0;tr0},Bc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Bc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Bc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Bc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Bc.prototype.addIndicesForPlacedSymbol=function(C,X){for(var se=C.placedSymbolArray.get(X),we=se.vertexStartIndex+se.numGlyphs*4,De=se.vertexStartIndex;De1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(C),this.sortedAngle=C,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var se=0,we=this.symbolInstanceIndexes;se=0&&tr.indexOf(mt)===jt&&X.addIndicesForPlacedSymbol(X.text,mt)}),He.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,He.verticalPlacedTextSymbolIndex),He.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,He.placedIconSymbolIndex),He.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,He.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Qt("SymbolBucket",Bc,{omit:["layers","collisionBoxArray","features","compareText"]}),Bc.MAX_GLYPHS=65535,Bc.addDynamicAttributes=x6;function Y9(k,C){return C.replace(/{([^{}]+)}/g,function(X,se){return se in k?String(k[se]):""})}var Z9=new Wa({"symbol-placement":new gn(pi.layout_symbol["symbol-placement"]),"symbol-spacing":new gn(pi.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new gn(pi.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new pn(pi.layout_symbol["symbol-sort-key"]),"symbol-z-order":new gn(pi.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new gn(pi.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new gn(pi.layout_symbol["icon-ignore-placement"]),"icon-optional":new gn(pi.layout_symbol["icon-optional"]),"icon-rotation-alignment":new gn(pi.layout_symbol["icon-rotation-alignment"]),"icon-size":new pn(pi.layout_symbol["icon-size"]),"icon-text-fit":new gn(pi.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new gn(pi.layout_symbol["icon-text-fit-padding"]),"icon-image":new pn(pi.layout_symbol["icon-image"]),"icon-rotate":new pn(pi.layout_symbol["icon-rotate"]),"icon-padding":new gn(pi.layout_symbol["icon-padding"]),"icon-keep-upright":new gn(pi.layout_symbol["icon-keep-upright"]),"icon-offset":new pn(pi.layout_symbol["icon-offset"]),"icon-anchor":new pn(pi.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new gn(pi.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new gn(pi.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new gn(pi.layout_symbol["text-rotation-alignment"]),"text-field":new pn(pi.layout_symbol["text-field"]),"text-font":new pn(pi.layout_symbol["text-font"]),"text-size":new pn(pi.layout_symbol["text-size"]),"text-max-width":new pn(pi.layout_symbol["text-max-width"]),"text-line-height":new gn(pi.layout_symbol["text-line-height"]),"text-letter-spacing":new pn(pi.layout_symbol["text-letter-spacing"]),"text-justify":new pn(pi.layout_symbol["text-justify"]),"text-radial-offset":new pn(pi.layout_symbol["text-radial-offset"]),"text-variable-anchor":new gn(pi.layout_symbol["text-variable-anchor"]),"text-anchor":new pn(pi.layout_symbol["text-anchor"]),"text-max-angle":new gn(pi.layout_symbol["text-max-angle"]),"text-writing-mode":new gn(pi.layout_symbol["text-writing-mode"]),"text-rotate":new pn(pi.layout_symbol["text-rotate"]),"text-padding":new gn(pi.layout_symbol["text-padding"]),"text-keep-upright":new gn(pi.layout_symbol["text-keep-upright"]),"text-transform":new pn(pi.layout_symbol["text-transform"]),"text-offset":new pn(pi.layout_symbol["text-offset"]),"text-allow-overlap":new gn(pi.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new gn(pi.layout_symbol["text-ignore-placement"]),"text-optional":new gn(pi.layout_symbol["text-optional"])}),W9=new Wa({"icon-opacity":new pn(pi.paint_symbol["icon-opacity"]),"icon-color":new pn(pi.paint_symbol["icon-color"]),"icon-halo-color":new pn(pi.paint_symbol["icon-halo-color"]),"icon-halo-width":new pn(pi.paint_symbol["icon-halo-width"]),"icon-halo-blur":new pn(pi.paint_symbol["icon-halo-blur"]),"icon-translate":new gn(pi.paint_symbol["icon-translate"]),"icon-translate-anchor":new gn(pi.paint_symbol["icon-translate-anchor"]),"text-opacity":new pn(pi.paint_symbol["text-opacity"]),"text-color":new pn(pi.paint_symbol["text-color"],{runtimeType:Hl,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new pn(pi.paint_symbol["text-halo-color"]),"text-halo-width":new pn(pi.paint_symbol["text-halo-width"]),"text-halo-blur":new pn(pi.paint_symbol["text-halo-blur"]),"text-translate":new gn(pi.paint_symbol["text-translate"]),"text-translate-anchor":new gn(pi.paint_symbol["text-translate-anchor"])}),b6={paint:W9,layout:Z9},Tw=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:xu,this.defaultValue=C};Tw.prototype.evaluate=function(C){if(C.formattedSection){var X=this.defaultValue.property.overrides;if(X&&X.hasOverride(C.formattedSection))return X.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default},Tw.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var X=this.defaultValue.value;C(X._styleExpression.expression)}},Tw.prototype.outputDefined=function(){return!1},Tw.prototype.serialize=function(){return null},Qt("FormatSectionOverride",Tw,{omit:["defaultValue"]});var K9=(function(k){function C(X){k.call(this,X,b6)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(se,we){if(k.prototype.recalculate.call(this,se,we),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var De=this.layout.get("text-writing-mode");if(De){for(var He=[],mt=0,jt=De;mt",targetMapId:we,sourceMapId:He.mapId})}}},Aw.prototype.receive=function(C){var X=C.data,se=X.id;if(se&&!(X.targetMapId&&this.mapId!==X.targetMapId))if(X.type===""){delete this.tasks[se];var we=this.cancelCallbacks[se];delete this.cancelCallbacks[se],we&&we()}else le()||X.mustQueue?(this.tasks[se]=X,this.taskQueue.push(se),this.invoker.trigger()):this.processTask(se,X)},Aw.prototype.process=function(){if(this.taskQueue.length){var C=this.taskQueue.shift(),X=this.tasks[C];delete this.tasks[C],this.taskQueue.length&&this.invoker.trigger(),X&&this.processTask(C,X)}},Aw.prototype.processTask=function(C,X){var se=this;if(X.type===""){var we=this.callbacks[C];delete this.callbacks[C],we&&(X.error?we(hn(X.error)):we(null,hn(X.data)))}else{var De=!1,He=ee(this.globalScope)?void 0:[],mt=X.hasCallback?function(en,Kr){De=!0,delete se.cancelCallbacks[C],se.target.postMessage({id:C,type:"",sourceMapId:se.mapId,error:en?Hr(en):null,data:Hr(Kr,He)},He)}:function(en){De=!0},jt=null,tr=hn(X.data);if(this.parent[X.type])jt=this.parent[X.type](X.sourceMapId,tr,mt);else if(this.parent.getWorkerSource){var fr=X.type.split("."),Or=this.parent.getWorkerSource(X.sourceMapId,fr[0],tr.source);jt=Or[fr[1]](tr,mt)}else mt(new Error("Could not find function "+X.type));!De&&jt&&jt.cancel&&(this.cancelCallbacks[C]=jt.cancel)}},Aw.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function sO(k,C,X){C=Math.pow(2,X)-C-1;var se=NL(k*256,C*256,X),we=NL((k+1)*256,(C+1)*256,X);return se[0]+","+se[1]+","+we[0]+","+we[1]}function NL(k,C,X){var se=2*Math.PI*6378137/256/Math.pow(2,X),we=k*se-2*Math.PI*6378137/2,De=C*se-2*Math.PI*6378137/2;return[we,De]}var $h=function(C,X){C&&(X?this.setSouthWest(C).setNorthEast(X):C.length===4?this.setSouthWest([C[0],C[1]]).setNorthEast([C[2],C[3]]):this.setSouthWest(C[0]).setNorthEast(C[1]))};$h.prototype.setNorthEast=function(C){return this._ne=C instanceof jf?new jf(C.lng,C.lat):jf.convert(C),this},$h.prototype.setSouthWest=function(C){return this._sw=C instanceof jf?new jf(C.lng,C.lat):jf.convert(C),this},$h.prototype.extend=function(C){var X=this._sw,se=this._ne,we,De;if(C instanceof jf)we=C,De=C;else if(C instanceof $h){if(we=C._sw,De=C._ne,!we||!De)return this}else{if(Array.isArray(C))if(C.length===4||C.every(Array.isArray)){var He=C;return this.extend($h.convert(He))}else{var mt=C;return this.extend(jf.convert(mt))}return this}return!X&&!se?(this._sw=new jf(we.lng,we.lat),this._ne=new jf(De.lng,De.lat)):(X.lng=Math.min(we.lng,X.lng),X.lat=Math.min(we.lat,X.lat),se.lng=Math.max(De.lng,se.lng),se.lat=Math.max(De.lat,se.lat)),this},$h.prototype.getCenter=function(){return new jf((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},$h.prototype.getSouthWest=function(){return this._sw},$h.prototype.getNorthEast=function(){return this._ne},$h.prototype.getNorthWest=function(){return new jf(this.getWest(),this.getNorth())},$h.prototype.getSouthEast=function(){return new jf(this.getEast(),this.getSouth())},$h.prototype.getWest=function(){return this._sw.lng},$h.prototype.getSouth=function(){return this._sw.lat},$h.prototype.getEast=function(){return this._ne.lng},$h.prototype.getNorth=function(){return this._ne.lat},$h.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},$h.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},$h.prototype.isEmpty=function(){return!(this._sw&&this._ne)},$h.prototype.contains=function(C){var X=jf.convert(C),se=X.lng,we=X.lat,De=this._sw.lat<=we&&we<=this._ne.lat,He=this._sw.lng<=se&&se<=this._ne.lng;return this._sw.lng>this._ne.lng&&(He=this._sw.lng>=se&&se>=this._ne.lng),De&&He},$h.convert=function(C){return!C||C instanceof $h?C:new $h(C)};var UL=63710088e-1,jf=function(C,X){if(isNaN(C)||isNaN(X))throw new Error("Invalid LngLat object: ("+C+", "+X+")");if(this.lng=+C,this.lat=+X,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};jf.prototype.wrap=function(){return new jf(g(this.lng,-180,180),this.lat)},jf.prototype.toArray=function(){return[this.lng,this.lat]},jf.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},jf.prototype.distanceTo=function(C){var X=Math.PI/180,se=this.lat*X,we=C.lat*X,De=Math.sin(se)*Math.sin(we)+Math.cos(se)*Math.cos(we)*Math.cos((C.lng-this.lng)*X),He=UL*Math.acos(Math.min(De,1));return He},jf.prototype.toBounds=function(C){C===void 0&&(C=0);var X=40075017,se=360*C/X,we=se/Math.cos(Math.PI/180*this.lat);return new $h(new jf(this.lng-we,this.lat-se),new jf(this.lng+we,this.lat+se))},jf.convert=function(C){if(C instanceof jf)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new jf(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new jf(Number("lng"in C?C.lng:C.lon),Number(C.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var jL=2*Math.PI*UL;function qL(k){return jL*Math.cos(k*Math.PI/180)}function VL(k){return(180+k)/360}function HL(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function GL(k,C){return k/qL(C)}function lO(k){return k*360-180}function T6(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function uO(k,C){return k*qL(T6(C))}function cO(k){return 1/Math.cos(k*Math.PI/180)}var Z_=function(C,X,se){se===void 0&&(se=0),this.x=+C,this.y=+X,this.z=+se};Z_.fromLngLat=function(C,X){X===void 0&&(X=0);var se=jf.convert(C);return new Z_(VL(se.lng),HL(se.lat),GL(X,se.lat))},Z_.prototype.toLngLat=function(){return new jf(lO(this.x),T6(this.y))},Z_.prototype.toAltitude=function(){return uO(this.z,this.y)},Z_.prototype.meterInMercatorCoordinateUnits=function(){return 1/jL*cO(T6(this.y))};var W_=function(C,X,se){this.z=C,this.x=X,this.y=se,this.key=gT(0,C,C,X,se)};W_.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},W_.prototype.url=function(C,X){var se=sO(this.x,this.y,this.z),we=fO(this.z,this.x,this.y);return C[(this.x+this.y)%C.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(X==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",we).replace("{bbox-epsg-3857}",se)},W_.prototype.getTilePoint=function(C){var X=Math.pow(2,this.z);return new i((C.x*X-this.x)*Hi,(C.y*X-this.y)*Hi)},W_.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var XL=function(C,X){this.wrap=C,this.canonical=X,this.key=gT(C,X.z,X.z,X.x,X.y)},Jh=function(C,X,se,we,De){this.overscaledZ=C,this.wrap=X,this.canonical=new W_(se,+we,+De),this.key=gT(X,C,se,we,De)};Jh.prototype.equals=function(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)},Jh.prototype.scaledTo=function(C){var X=this.canonical.z-C;return C>this.canonical.z?new Jh(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Jh(C,this.wrap,C,this.canonical.x>>X,this.canonical.y>>X)},Jh.prototype.calculateScaledKey=function(C,X){var se=this.canonical.z-C;return C>this.canonical.z?gT(this.wrap*+X,C,this.canonical.z,this.canonical.x,this.canonical.y):gT(this.wrap*+X,C,C,this.canonical.x>>se,this.canonical.y>>se)},Jh.prototype.isChildOf=function(C){if(C.wrap!==this.wrap)return!1;var X=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ>X&&C.canonical.y===this.canonical.y>>X},Jh.prototype.children=function(C){if(this.overscaledZ>=C)return[new Jh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var X=this.canonical.z+1,se=this.canonical.x*2,we=this.canonical.y*2;return[new Jh(X,this.wrap,X,se,we),new Jh(X,this.wrap,X,se+1,we),new Jh(X,this.wrap,X,se,we+1),new Jh(X,this.wrap,X,se+1,we+1)]},Jh.prototype.isLessThan=function(C){return this.wrapC.wrap?!1:this.overscaledZC.overscaledZ?!1:this.canonical.xC.canonical.x?!1:this.canonical.y0;De--)we=1<=this.dim+1||X<-1||X>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(X+1)*this.stride+(C+1)},Hg.prototype._unpackMapbox=function(C,X,se){return(C*256*256+X*256+se)/10-1e4},Hg.prototype._unpackTerrarium=function(C,X,se){return C*256+X+se/256-32768},Hg.prototype.getPixels=function(){return new Nv({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Hg.prototype.backfillBorder=function(C,X,se){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");var we=X*this.dim,De=X*this.dim+this.dim,He=se*this.dim,mt=se*this.dim+this.dim;switch(X){case-1:we=De-1;break;case 1:De=we+1;break}switch(se){case-1:He=mt-1;break;case 1:mt=He+1;break}for(var jt=-X*this.dim,tr=-se*this.dim,fr=He;fr=0&&Or[3]>=0&&jt.insert(mt,Or[0],Or[1],Or[2],Or[3])}},Gg.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new qg.VectorTile(new Tn(this.rawTileData)).layers,this.sourceLayerCoder=new GS(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Gg.prototype.query=function(C,X,se,we){var De=this;this.loadVTLayers();for(var He=C.params||{},mt=Hi/C.tileSize/C.scale,jt=et(He.filter),tr=C.queryGeometry,fr=C.queryPadding*mt,Or=ZL(tr),en=this.grid.query(Or.minX-fr,Or.minY-fr,Or.maxX+fr,Or.maxY+fr),Kr=ZL(C.cameraQueryGeometry),xn=this.grid3D.query(Kr.minX-fr,Kr.minY-fr,Kr.maxX+fr,Kr.maxY+fr,function(Ji,To,xo,cs){return bp(C.cameraQueryGeometry,Ji-fr,To-fr,xo+fr,cs+fr)}),$n=0,ja=xn;$nwe)De=!1;else if(!X)De=!0;else if(this.expirationTime=Ur.maxzoom)&&Ur.visibility!=="none"){f(Ir,this.zoom,lr);var ln=pa[Ur.id]=Ur.createBucket({index:Jn.bucketLayerIDs.length,layers:Ir,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:yi,sourceID:this.source});ln.populate(Ci,ha,this.tileID.canonical),Jn.bucketLayerIDs.push(Ir.map(function(cn){return cn.id}))}}}}var $r,At,or,Dr,un=e.mapObject(ha.glyphDependencies,function(cn){return Object.keys(cn).map(Number)});Object.keys(un).length?Vr.send("getGlyphs",{uid:this.uid,stacks:un},function(cn,In){$r||($r=cn,At=In,Un.call(mn))}):At={};var Rn=Object.keys(ha.iconDependencies);Rn.length?Vr.send("getImages",{icons:Rn,source:this.source,tileID:this.tileID,type:"icons"},function(cn,In){$r||($r=cn,or=In,Un.call(mn))}):or={};var jn=Object.keys(ha.patternDependencies);jn.length?Vr.send("getImages",{icons:jn,source:this.source,tileID:this.tileID,type:"patterns"},function(cn,In){$r||($r=cn,Dr=In,Un.call(mn))}):Dr={},Un.call(this);function Un(){if($r)return sn($r);if(At&&or&&Dr){var cn=new a(At),In=new e.ImageAtlas(or,Dr);for(var xi in pa){var Ea=pa[xi];Ea instanceof e.SymbolBucket?(f(Ea.layers,this.zoom,lr),e.performSymbolLayout(Ea,At,cn.positions,or,In.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ea.hasPattern&&(Ea instanceof e.LineBucket||Ea instanceof e.FillBucket||Ea instanceof e.FillExtrusionBucket)&&(f(Ea.layers,this.zoom,lr),Ea.addFeatures(ha,this.tileID.canonical,In.patternPositions))}this.status="done",sn(null,{buckets:e.values(pa).filter(function(Pi){return!Pi.isEmpty()}),featureIndex:Jn,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:cn.image,imageAtlas:In,glyphMap:this.returnDependencies?At:null,iconMap:this.returnDependencies?or:null,glyphPositions:this.returnDependencies?cn.positions:null})}}};function f(ir,qt,ar){for(var lr=new e.EvaluationParameters(qt),Vr=0,sn=ir;Vr=0!=!!qt&&ir.reverse()}var M=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,_=function(qt){this._feature=qt,this.extent=e.EXTENT,this.type=qt.type,this.properties=qt.tags,"id"in qt&&!isNaN(qt.id)&&(this.id=parseInt(qt.id,10))};_.prototype.loadGeometry=function(){if(this._feature.type===1){for(var qt=[],ar=0,lr=this._feature.geometry;ar"u"&&(lr.push(wn),Jn=lr.length-1,sn[wn]=Jn),qt.writeVarint(Jn);var pa=ar.properties[wn],ha=typeof pa;ha!=="string"&&ha!=="boolean"&&ha!=="number"&&(pa=JSON.stringify(pa));var _a=ha+":"+pa,Ca=mn[_a];typeof Ca>"u"&&(Vr.push(pa),Ca=Vr.length-1,mn[_a]=Ca),qt.writeVarint(Ca)}}function re(ir,qt){return(qt<<3)+(ir&7)}function fe(ir){return ir<<1^ir>>31}function le(ir,qt){for(var ar=ir.loadGeometry(),lr=ir.type,Vr=0,sn=0,mn=ar.length,wn=0;wn>1;ee(ir,qt,mn,lr,Vr,sn%2),V(ir,qt,ar,lr,mn-1,sn+1),V(ir,qt,ar,mn+1,Vr,sn+1)}}function ee(ir,qt,ar,lr,Vr,sn){for(;Vr>lr;){if(Vr-lr>600){var mn=Vr-lr+1,wn=ar-lr+1,Jn=Math.log(mn),pa=.5*Math.exp(2*Jn/3),ha=.5*Math.sqrt(Jn*pa*(mn-pa)/mn)*(wn-mn/2<0?-1:1),_a=Math.max(lr,Math.floor(ar-wn*pa/mn+ha)),Ca=Math.min(Vr,Math.floor(ar+(mn-wn)*pa/mn+ha));ee(ir,qt,ar,_a,Ca,sn)}var Vn=qt[2*ar+sn],yi=lr,Ci=Vr;for(ne(ir,qt,lr,ar),qt[2*Vr+sn]>Vn&&ne(ir,qt,lr,Vr);yiVn;)Ci--}qt[2*lr+sn]===Vn?ne(ir,qt,lr,Ci):(Ci++,ne(ir,qt,Ci,Vr)),Ci<=ar&&(lr=Ci+1),ar<=Ci&&(Vr=Ci-1)}}function ne(ir,qt,ar,lr){K(ir,ar,lr),K(qt,2*ar,2*lr),K(qt,2*ar+1,2*lr+1)}function K(ir,qt,ar){var lr=ir[qt];ir[qt]=ir[ar],ir[ar]=lr}function ue(ir,qt,ar,lr,Vr,sn,mn){for(var wn=[0,ir.length-1,0],Jn=[],pa,ha;wn.length;){var _a=wn.pop(),Ca=wn.pop(),Vn=wn.pop();if(Ca-Vn<=mn){for(var yi=Vn;yi<=Ca;yi++)pa=qt[2*yi],ha=qt[2*yi+1],pa>=ar&&pa<=Vr&&ha>=lr&&ha<=sn&&Jn.push(ir[yi]);continue}var Ci=Math.floor((Vn+Ca)/2);pa=qt[2*Ci],ha=qt[2*Ci+1],pa>=ar&&pa<=Vr&&ha>=lr&&ha<=sn&&Jn.push(ir[Ci]);var Dt=(_a+1)%2;(_a===0?ar<=pa:lr<=ha)&&(wn.push(Vn),wn.push(Ci-1),wn.push(Dt)),(_a===0?Vr>=pa:sn>=ha)&&(wn.push(Ci+1),wn.push(Ca),wn.push(Dt))}return Jn}function te(ir,qt,ar,lr,Vr,sn){for(var mn=[0,ir.length-1,0],wn=[],Jn=Vr*Vr;mn.length;){var pa=mn.pop(),ha=mn.pop(),_a=mn.pop();if(ha-_a<=sn){for(var Ca=_a;Ca<=ha;Ca++)H(qt[2*Ca],qt[2*Ca+1],ar,lr)<=Jn&&wn.push(ir[Ca]);continue}var Vn=Math.floor((_a+ha)/2),yi=qt[2*Vn],Ci=qt[2*Vn+1];H(yi,Ci,ar,lr)<=Jn&&wn.push(ir[Vn]);var Dt=(pa+1)%2;(pa===0?ar-Vr<=yi:lr-Vr<=Ci)&&(mn.push(_a),mn.push(Vn-1),mn.push(Dt)),(pa===0?ar+Vr>=yi:lr+Vr>=Ci)&&(mn.push(Vn+1),mn.push(ha),mn.push(Dt))}return wn}function H(ir,qt,ar,lr){var Vr=ir-ar,sn=qt-lr;return Vr*Vr+sn*sn}var ae=function(ir){return ir[0]},ie=function(ir){return ir[1]},ve=function(qt,ar,lr,Vr,sn){ar===void 0&&(ar=ae),lr===void 0&&(lr=ie),Vr===void 0&&(Vr=64),sn===void 0&&(sn=Float64Array),this.nodeSize=Vr,this.points=qt;for(var mn=qt.length<65536?Uint16Array:Uint32Array,wn=this.ids=new mn(qt.length),Jn=this.coords=new sn(qt.length*2),pa=0;pa=Vr;ha--){var _a=+Date.now();Jn=this._cluster(Jn,ha),this.trees[ha]=new ve(Jn,pe,Ne,mn,Float32Array),lr&&console.log("z%d: %d clusters in %dms",ha,Jn.length,+Date.now()-_a)}return lr&&console.timeEnd("total time"),this},Ce.prototype.getClusters=function(qt,ar){var lr=((qt[0]+180)%360+360)%360-180,Vr=Math.max(-90,Math.min(90,qt[1])),sn=qt[2]===180?180:((qt[2]+180)%360+360)%360-180,mn=Math.max(-90,Math.min(90,qt[3]));if(qt[2]-qt[0]>=360)lr=-180,sn=180;else if(lr>sn){var wn=this.getClusters([lr,Vr,180,mn],ar),Jn=this.getClusters([-180,Vr,sn,mn],ar);return wn.concat(Jn)}for(var pa=this.trees[this._limitZoom(ar)],ha=pa.range(st(lr),nt(mn),st(sn),nt(Vr)),_a=[],Ca=0,Vn=ha;Caar&&(Ci+=Nr.numPoints||1)}if(Ci>=Jn){for(var jr=_a.x*yi,Ir=_a.y*yi,Ur=wn&&yi>1?this._map(_a,!0):null,ln=(ha<<5)+(ar+1)+this.points.length,$r=0,At=Vn;$r1)for(var Rn=0,jn=Vn;Rn>5},Ce.prototype._getOriginZoom=function(qt){return(qt-this.points.length)%32},Ce.prototype._map=function(qt,ar){if(qt.numPoints)return ar?Te({},qt.properties):qt.properties;var lr=this.points[qt.index].properties,Vr=this.options.map(lr);return ar&&Vr===lr?Te({},Vr):Vr};function Fe(ir,qt,ar,lr,Vr){return{x:ir,y:qt,zoom:1/0,id:ar,parentId:-1,numPoints:lr,properties:Vr}}function ze(ir,qt){var ar=ir.geometry.coordinates,lr=ar[0],Vr=ar[1];return{x:st(lr),y:nt(Vr),zoom:1/0,index:qt,parentId:-1}}function Ye(ir){return{type:"Feature",id:ir.id,properties:it(ir),geometry:{type:"Point",coordinates:[Qe(ir.x),Le(ir.y)]}}}function it(ir){var qt=ir.numPoints,ar=qt>=1e4?Math.round(qt/1e3)+"k":qt>=1e3?Math.round(qt/100)/10+"k":qt;return Te(Te({},ir.properties),{cluster:!0,cluster_id:ir.id,point_count:qt,point_count_abbreviated:ar})}function st(ir){return ir/360+.5}function nt(ir){var qt=Math.sin(ir*Math.PI/180),ar=.5-.25*Math.log((1+qt)/(1-qt))/Math.PI;return ar<0?0:ar>1?1:ar}function Qe(ir){return(ir-.5)*360}function Le(ir){var qt=(180-ir*360)*Math.PI/180;return 360*Math.atan(Math.exp(qt))/Math.PI-90}function Te(ir,qt){for(var ar in qt)ir[ar]=qt[ar];return ir}function pe(ir){return ir.x}function Ne(ir){return ir.y}function ot(ir,qt,ar,lr){for(var Vr=lr,sn=ar-qt>>1,mn=ar-qt,wn,Jn=ir[qt],pa=ir[qt+1],ha=ir[ar],_a=ir[ar+1],Ca=qt+3;CaVr)wn=Ca,Vr=Vn;else if(Vn===Vr){var yi=Math.abs(Ca-sn);yilr&&(wn-qt>3&&ot(ir,qt,wn,lr),ir[wn+2]=Vr,ar-wn>3&&ot(ir,wn,ar,lr))}function ft(ir,qt,ar,lr,Vr,sn){var mn=Vr-ar,wn=sn-lr;if(mn!==0||wn!==0){var Jn=((ir-ar)*mn+(qt-lr)*wn)/(mn*mn+wn*wn);Jn>1?(ar=Vr,lr=sn):Jn>0&&(ar+=mn*Jn,lr+=wn*Jn)}return mn=ir-ar,wn=qt-lr,mn*mn+wn*wn}function rt(ir,qt,ar,lr){var Vr={id:typeof ir>"u"?null:ir,type:qt,geometry:ar,tags:lr,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Ft(Vr),Vr}function Ft(ir){var qt=ir.geometry,ar=ir.type;if(ar==="Point"||ar==="MultiPoint"||ar==="LineString")Nt(ir,qt);else if(ar==="Polygon"||ar==="MultiLineString")for(var lr=0;lr0&&(lr?mn+=(Vr*pa-Jn*sn)/2:mn+=Math.sqrt(Math.pow(Jn-Vr,2)+Math.pow(pa-sn,2))),Vr=Jn,sn=pa}var ha=qt.length-3;qt[2]=1,ot(qt,0,ha,ar),qt[ha+2]=1,qt.size=Math.abs(mn),qt.start=0,qt.end=qt.size}function Wr(ir,qt,ar,lr){for(var Vr=0;Vr1?1:ar}function Mt(ir,qt,ar,lr,Vr,sn,mn,wn){if(ar/=qt,lr/=qt,sn>=ar&&mn=lr)return null;for(var Jn=[],pa=0;pa=ar&&yi=lr)continue;var Ci=[];if(Ca==="Point"||Ca==="MultiPoint")je(_a,Ci,ar,lr,Vr);else if(Ca==="LineString")$e(_a,Ci,ar,lr,Vr,!1,wn.lineMetrics);else if(Ca==="MultiLineString")xe(_a,Ci,ar,lr,Vr,!1);else if(Ca==="Polygon")xe(_a,Ci,ar,lr,Vr,!0);else if(Ca==="MultiPolygon")for(var Dt=0;Dt<_a.length;Dt++){var yt=[];xe(_a[Dt],yt,ar,lr,Vr,!0),yt.length&&Ci.push(yt)}if(Ci.length){if(wn.lineMetrics&&Ca==="LineString"){for(Dt=0;Dt=ar&&mn<=lr&&(qt.push(ir[sn]),qt.push(ir[sn+1]),qt.push(ir[sn+2]))}}function $e(ir,qt,ar,lr,Vr,sn,mn){for(var wn=Ee(ir),Jn=Vr===0?Me:Xe,pa=ir.start,ha,_a,Ca=0;Caar&&(_a=Jn(wn,Vn,yi,Dt,yt,ar),mn&&(wn.start=pa+ha*_a)):kr>lr?Nr=ar&&(_a=Jn(wn,Vn,yi,Dt,yt,ar),jr=!0),Nr>lr&&kr<=lr&&(_a=Jn(wn,Vn,yi,Dt,yt,lr),jr=!0),!sn&&jr&&(mn&&(wn.end=pa+ha*_a),qt.push(wn),wn=Ee(ir)),mn&&(pa+=ha)}var Ir=ir.length-3;Vn=ir[Ir],yi=ir[Ir+1],Ci=ir[Ir+2],kr=Vr===0?Vn:yi,kr>=ar&&kr<=lr&&ye(wn,Vn,yi,Ci),Ir=wn.length-3,sn&&Ir>=3&&(wn[Ir]!==wn[0]||wn[Ir+1]!==wn[1])&&ye(wn,wn[0],wn[1],wn[2]),wn.length&&qt.push(wn)}function Ee(ir){var qt=[];return qt.size=ir.size,qt.start=ir.start,qt.end=ir.end,qt}function xe(ir,qt,ar,lr,Vr,sn){for(var mn=0;mnmn.maxX&&(mn.maxX=ha),_a>mn.maxY&&(mn.maxY=_a)}return mn}function pr(ir,qt,ar,lr){var Vr=qt.geometry,sn=qt.type,mn=[];if(sn==="Point"||sn==="MultiPoint")for(var wn=0;wn0&&qt.size<(Vr?mn:lr)){ar.numPoints+=qt.length/3;return}for(var wn=[],Jn=0;Jnmn)&&(ar.numSimplified++,wn.push(qt[Jn]),wn.push(qt[Jn+1])),ar.numPoints++;Vr&&Fr(wn,sn),ir.push(wn)}function Fr(ir,qt){for(var ar=0,lr=0,Vr=ir.length,sn=Vr-2;lr0===qt)for(lr=0,Vr=ir.length;lr24)throw new Error("maxZoom should be in the 0-24 range");if(qt.promoteId&&qt.generateId)throw new Error("promoteId and generateId cannot be used together.");var lr=$t(ir,qt);this.tiles={},this.tileCoords=[],ar&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",qt.indexMaxZoom,qt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),lr=Je(lr,qt),lr.length&&this.splitTile(lr,0,0,0),ar&&(lr.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}Kn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Kn.prototype.splitTile=function(ir,qt,ar,lr,Vr,sn,mn){for(var wn=[ir,qt,ar,lr],Jn=this.options,pa=Jn.debug;wn.length;){lr=wn.pop(),ar=wn.pop(),qt=wn.pop(),ir=wn.pop();var ha=1<1&&console.time("creation"),Ca=this.tiles[_a]=_r(ir,qt,ar,lr,Jn),this.tileCoords.push({z:qt,x:ar,y:lr}),pa)){pa>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",qt,ar,lr,Ca.numFeatures,Ca.numPoints,Ca.numSimplified),console.timeEnd("creation"));var Vn="z"+qt;this.stats[Vn]=(this.stats[Vn]||0)+1,this.total++}if(Ca.source=ir,Vr){if(qt===Jn.maxZoom||qt===Vr)continue;var yi=1<1&&console.time("clipping");var Ci=.5*Jn.buffer/Jn.extent,Dt=.5-Ci,yt=.5+Ci,kr=1+Ci,Nr,jr,Ir,Ur,ln,$r;Nr=jr=Ir=Ur=null,ln=Mt(ir,ha,ar-Ci,ar+yt,0,Ca.minX,Ca.maxX,Jn),$r=Mt(ir,ha,ar+Dt,ar+kr,0,Ca.minX,Ca.maxX,Jn),ir=null,ln&&(Nr=Mt(ln,ha,lr-Ci,lr+yt,1,Ca.minY,Ca.maxY,Jn),jr=Mt(ln,ha,lr+Dt,lr+kr,1,Ca.minY,Ca.maxY,Jn),ln=null),$r&&(Ir=Mt($r,ha,lr-Ci,lr+yt,1,Ca.minY,Ca.maxY,Jn),Ur=Mt($r,ha,lr+Dt,lr+kr,1,Ca.minY,Ca.maxY,Jn),$r=null),pa>1&&console.timeEnd("clipping"),wn.push(Nr||[],qt+1,ar*2,lr*2),wn.push(jr||[],qt+1,ar*2,lr*2+1),wn.push(Ir||[],qt+1,ar*2+1,lr*2),wn.push(Ur||[],qt+1,ar*2+1,lr*2+1)}}},Kn.prototype.getTile=function(ir,qt,ar){var lr=this.options,Vr=lr.extent,sn=lr.debug;if(ir<0||ir>24)return null;var mn=1<1&&console.log("drilling down to z%d-%d-%d",ir,qt,ar);for(var Jn=ir,pa=qt,ha=ar,_a;!_a&&Jn>0;)Jn--,pa=Math.floor(pa/2),ha=Math.floor(ha/2),_a=this.tiles[qn(Jn,pa,ha)];return!_a||!_a.source?null:(sn>1&&console.log("found parent tile z%d-%d-%d",Jn,pa,ha),sn>1&&console.time("drilling down"),this.splitTile(_a.source,Jn,pa,ha,ir,qt,ar),sn>1&&console.timeEnd("drilling down"),this.tiles[wn]?Ot(this.tiles[wn],Vr):null)};function qn(ir,qt,ar){return((1<=0?0:be.button},r.remove=function(be){be.parentNode&&be.parentNode.removeChild(be)};function d(be,q,he){var J,_e,qe,lt=e.browser.devicePixelRatio>1?"@2x":"",vt=e.getJSON(q.transformRequest(q.normalizeSpriteURL(be,lt,".json"),e.ResourceType.SpriteJSON),function(bt,Zt){vt=null,qe||(qe=bt,J=Zt,at())}),Ke=e.getImage(q.transformRequest(q.normalizeSpriteURL(be,lt,".png"),e.ResourceType.SpriteImage),function(bt,Zt){Ke=null,qe||(qe=bt,_e=Zt,at())});function at(){if(qe)he(qe);else if(J&&_e){var bt=e.browser.getImageData(_e),Zt={};for(var Vt in J){var Kt=J[Vt],nr=Kt.width,er=Kt.height,Bt=Kt.x,Xt=Kt.y,Ht=Kt.sdf,zr=Kt.pixelRatio,Yr=Kt.stretchX,fn=Kt.stretchY,sa=Kt.content,Wn=new e.RGBAImage({width:nr,height:er});e.RGBAImage.copy(bt,Wn,{x:Bt,y:Xt},{x:0,y:0},{width:nr,height:er}),Zt[Vt]={data:Wn,pixelRatio:zr,sdf:Ht,stretchX:Yr,stretchY:fn,content:sa}}he(null,Zt)}}return{cancel:function(){vt&&(vt.cancel(),vt=null),Ke&&(Ke.cancel(),Ke=null)}}}function T(be){var q=be.userImage;if(q&&q.render){var he=q.render();if(he)return be.data.replace(new Uint8Array(q.data.buffer)),!0}return!1}var l=1,g=(function(be){function q(){be.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.isLoaded=function(){return this.loaded},q.prototype.setLoaded=function(J){if(this.loaded!==J&&(this.loaded=J,J)){for(var _e=0,qe=this.requestors;_e=0?1.2:1))}w.prototype.draw=function(be){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(be,this.buffer,this.middle);for(var q=this.ctx.getImageData(0,0,this.size,this.size),he=new Uint8ClampedArray(this.size*this.size),J=0;J65535){bt(new Error("glyphs > 65535 not supported"));return}if(Kt.ranges[er]){bt(null,{stack:Zt,id:Vt,glyph:nr});return}var Bt=Kt.requests[er];Bt||(Bt=Kt.requests[er]=[],v.loadGlyphRange(Zt,er,J.url,J.requestManager,function(Xt,Ht){if(Ht){for(var zr in Ht)J._doesCharSupportLocalGlyph(+zr)||(Kt.glyphs[+zr]=Ht[+zr]);Kt.ranges[er]=!0}for(var Yr=0,fn=Bt;Yr1&&(at=q[++Ke]);var Zt=Math.abs(bt-at.left),Vt=Math.abs(bt-at.right),Kt=Math.min(Zt,Vt),nr=void 0,er=qe/J*(_e+1);if(at.isDash){var Bt=_e-Math.abs(er);nr=Math.sqrt(Kt*Kt+Bt*Bt)}else nr=_e-Math.sqrt(Kt*Kt+er*er);this.data[vt+bt]=Math.max(0,Math.min(255,nr+128))}},F.prototype.addRegularDash=function(q){for(var he=q.length-1;he>=0;--he){var J=q[he],_e=q[he+1];J.zeroLength?q.splice(he,1):_e&&_e.isDash===J.isDash&&(_e.left=J.left,q.splice(he,1))}var qe=q[0],lt=q[q.length-1];qe.isDash===lt.isDash&&(qe.left=lt.left-this.width,lt.right=qe.right+this.width);for(var vt=this.width*this.nextRow,Ke=0,at=q[Ke],bt=0;bt1&&(at=q[++Ke]);var Zt=Math.abs(bt-at.left),Vt=Math.abs(bt-at.right),Kt=Math.min(Zt,Vt),nr=at.isDash?Kt:-Kt;this.data[vt+bt]=Math.max(0,Math.min(255,nr+128))}},F.prototype.addDash=function(q,he){var J=he?7:0,_e=2*J+1;if(this.nextRow+_e>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var qe=0,lt=0;lt=J.minX&&q.x=J.minY&&q.y0&&(bt[new e.OverscaledTileID(J.overscaledZ,vt,_e.z,lt,_e.y-1).key]={backfilled:!1},bt[new e.OverscaledTileID(J.overscaledZ,J.wrap,_e.z,_e.x,_e.y-1).key]={backfilled:!1},bt[new e.OverscaledTileID(J.overscaledZ,at,_e.z,Ke,_e.y-1).key]={backfilled:!1}),_e.y+10&&(qe.resourceTiming=J._resourceTiming,J._resourceTiming=[]),J.fire(new e.Event("data",qe))})},q.prototype.onAdd=function(J){this.map=J,this.load()},q.prototype.setData=function(J){var _e=this;return this._data=J,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(qe){if(qe){_e.fire(new e.ErrorEvent(qe));return}var lt={dataType:"source",sourceDataType:"content"};_e._collectResourceTiming&&_e._resourceTiming&&_e._resourceTiming.length>0&&(lt.resourceTiming=_e._resourceTiming,_e._resourceTiming=[]),_e.fire(new e.Event("data",lt))}),this},q.prototype.getClusterExpansionZoom=function(J,_e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:J,source:this.id},_e),this},q.prototype.getClusterChildren=function(J,_e){return this.actor.send("geojson.getClusterChildren",{clusterId:J,source:this.id},_e),this},q.prototype.getClusterLeaves=function(J,_e,qe,lt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:J,limit:_e,offset:qe},lt),this},q.prototype._updateWorkerData=function(J){var _e=this;this._loaded=!1;var qe=e.extend({},this.workerOptions),lt=this._data;typeof lt=="string"?(qe.request=this.map._requestManager.transformRequest(e.browser.resolveURL(lt),e.ResourceType.Source),qe.request.collectResourceTiming=this._collectResourceTiming):qe.data=JSON.stringify(lt),this.actor.send(this.type+".loadData",qe,function(vt,Ke){_e._removed||Ke&&Ke.abandoned||(_e._loaded=!0,Ke&&Ke.resourceTiming&&Ke.resourceTiming[_e.id]&&(_e._resourceTiming=Ke.resourceTiming[_e.id].slice(0)),_e.actor.send(_e.type+".coalesce",{source:qe.source},null),J(vt))})},q.prototype.loaded=function(){return this._loaded},q.prototype.loadTile=function(J,_e){var qe=this,lt=J.actor?"reloadTile":"loadTile";J.actor=this.actor;var vt={type:this.type,uid:J.uid,tileID:J.tileID,zoom:J.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};J.request=this.actor.send(lt,vt,function(Ke,at){return delete J.request,J.unloadVectorData(),J.aborted?_e(null):Ke?_e(Ke):(J.loadVectorData(at,qe.map.painter,lt==="reloadTile"),_e(null))})},q.prototype.abortTile=function(J){J.request&&(J.request.cancel(),delete J.request),J.aborted=!0},q.prototype.unloadTile=function(J){J.unloadVectorData(),this.actor.send("removeTile",{uid:J.uid,type:this.type,source:this.id})},q.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},q.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},q.prototype.hasTransition=function(){return!1},q})(e.Evented),fe=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),le=(function(be){function q(he,J,_e,qe){be.call(this),this.id=he,this.dispatcher=_e,this.coordinates=J.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(qe),this.options=J}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.load=function(J,_e){var qe=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),function(lt,vt){qe._loaded=!0,lt?qe.fire(new e.ErrorEvent(lt)):vt&&(qe.image=vt,J&&(qe.coordinates=J),_e&&_e(),qe._finishLoading())})},q.prototype.loaded=function(){return this._loaded},q.prototype.updateImage=function(J){var _e=this;return!this.image||!J.url?this:(this.options.url=J.url,this.load(J.coordinates,function(){_e.texture=null}),this)},q.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},q.prototype.onAdd=function(J){this.map=J,this.load()},q.prototype.setCoordinates=function(J){var _e=this;this.coordinates=J;var qe=J.map(e.MercatorCoordinate.fromLngLat);this.tileID=ce(qe),this.minzoom=this.maxzoom=this.tileID.z;var lt=qe.map(function(vt){return _e.tileID.getTilePoint(vt)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(lt[0].x,lt[0].y,0,0),this._boundsArray.emplaceBack(lt[1].x,lt[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(lt[3].x,lt[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(lt[2].x,lt[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},q.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var J=this.map.painter.context,_e=J.gl;this.boundsBuffer||(this.boundsBuffer=J.createVertexBuffer(this._boundsArray,fe.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(J,this.image,_e.RGBA),this.texture.bind(_e.LINEAR,_e.CLAMP_TO_EDGE));for(var qe in this.tiles){var lt=this.tiles[qe];lt.state!=="loaded"&&(lt.state="loaded",lt.texture=this.texture)}}},q.prototype.loadTile=function(J,_e){this.tileID&&this.tileID.equals(J.tileID.canonical)?(this.tiles[String(J.tileID.wrap)]=J,J.buckets={},_e(null)):(J.state="errored",_e(null))},q.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},q.prototype.hasTransition=function(){return!1},q})(e.Evented);function ce(be){for(var q=1/0,he=1/0,J=-1/0,_e=-1/0,qe=0,lt=be;qe_e.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+_e.start(0)+" and "+_e.end(0)+"-second mark."))):this.video.currentTime=J}},q.prototype.getVideo=function(){return this.video},q.prototype.onAdd=function(J){this.map||(this.map=J,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},q.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var J=this.map.painter.context,_e=J.gl;this.boundsBuffer||(this.boundsBuffer=J.createVertexBuffer(this._boundsArray,fe.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(_e.LINEAR,_e.CLAMP_TO_EDGE),_e.texSubImage2D(_e.TEXTURE_2D,0,0,0,_e.RGBA,_e.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(J,this.video,_e.RGBA),this.texture.bind(_e.LINEAR,_e.CLAMP_TO_EDGE));for(var qe in this.tiles){var lt=this.tiles[qe];lt.state!=="loaded"&&(lt.state="loaded",lt.texture=this.texture)}}},q.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},q.prototype.hasTransition=function(){return this.video&&!this.video.paused},q})(le),ee=(function(be){function q(he,J,_e,qe){be.call(this,he,J,_e,qe),J.coordinates?(!Array.isArray(J.coordinates)||J.coordinates.length!==4||J.coordinates.some(function(lt){return!Array.isArray(lt)||lt.length!==2||lt.some(function(vt){return typeof vt!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'missing required property "coordinates"'))),J.animate&&typeof J.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'optional "animate" property must be a boolean value'))),J.canvas?typeof J.canvas!="string"&&!(J.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'missing required property "canvas"'))),this.options=J,this.animate=J.animate!==void 0?J.animate:!0}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},q.prototype.getCanvas=function(){return this.canvas},q.prototype.onAdd=function(J){this.map=J,this.load(),this.canvas&&this.animate&&this.play()},q.prototype.onRemove=function(){this.pause()},q.prototype.prepare=function(){var J=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,J=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,J=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var _e=this.map.painter.context,qe=_e.gl;this.boundsBuffer||(this.boundsBuffer=_e.createVertexBuffer(this._boundsArray,fe.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(J||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(_e,this.canvas,qe.RGBA,{premultiply:!0});for(var lt in this.tiles){var vt=this.tiles[lt];vt.state!=="loaded"&&(vt.state="loaded",vt.texture=this.texture)}}},q.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},q.prototype.hasTransition=function(){return this._playing},q.prototype._hasInvalidDimensions=function(){for(var J=0,_e=[this.canvas.width,this.canvas.height];J<_e.length;J+=1){var qe=_e[J];if(isNaN(qe)||qe<=0)return!0}return!1},q})(le),ne={vector:U,raster:j,"raster-dem":Z,geojson:re,video:V,image:le,canvas:ee},K=function(be,q,he,J){var _e=new ne[q.type](be,q,he,J);if(_e.id!==be)throw new Error("Expected Source id to be "+be+" instead of "+_e.id);return e.bindAll(["load","abort","unload","serialize","prepare"],_e),_e},ue=function(be){return ne[be]},te=function(be,q){ne[be]=q};function H(be,q){var he=e.identity([]);return e.translate(he,he,[1,1,0]),e.scale(he,he,[be.width*.5,be.height*.5,1]),e.multiply(he,he,be.calculatePosMatrix(q.toUnwrapped()))}function ae(be,q,he){if(be)for(var J=0,_e=be;J<_e.length;J+=1){var qe=_e[J],lt=q[qe];if(lt&<.source===he&<.type==="fill-extrusion")return!0}else for(var vt in q){var Ke=q[vt];if(Ke.source===he&&Ke.type==="fill-extrusion")return!0}return!1}function ie(be,q,he,J,_e,qe){var lt=ae(_e&&_e.layers,q,be.id),vt=qe.maxPitchScaleFactor(),Ke=be.tilesIn(J,vt,lt);Ke.sort(Ce);for(var at=[],bt=0,Zt=Ke;btthis.max){var vt=this._getAndRemoveByKey(this.order[0]);vt&&this.onRemove(vt)}return this},ze.prototype.has=function(q){return q.wrapped().key in this.data},ze.prototype.getAndRemove=function(q){return this.has(q)?this._getAndRemoveByKey(q.wrapped().key):null},ze.prototype._getAndRemoveByKey=function(q){var he=this.data[q].shift();return he.timeout&&clearTimeout(he.timeout),this.data[q].length===0&&delete this.data[q],this.order.splice(this.order.indexOf(q),1),he.value},ze.prototype.getByKey=function(q){var he=this.data[q];return he?he[0].value:null},ze.prototype.get=function(q){if(!this.has(q))return null;var he=this.data[q.wrapped().key][0];return he.value},ze.prototype.remove=function(q,he){if(!this.has(q))return this;var J=q.wrapped().key,_e=he===void 0?0:this.data[J].indexOf(he),qe=this.data[J][_e];return this.data[J].splice(_e,1),qe.timeout&&clearTimeout(qe.timeout),this.data[J].length===0&&delete this.data[J],this.onRemove(qe.value),this.order.splice(this.order.indexOf(J),1),this},ze.prototype.setMaxSize=function(q){for(this.max=q;this.order.length>this.max;){var he=this._getAndRemoveByKey(this.order[0]);he&&this.onRemove(he)}return this},ze.prototype.filter=function(q){var he=[];for(var J in this.data)for(var _e=0,qe=this.data[J];_e1||(Math.abs(Zt)>1&&(Math.abs(Zt+Kt)===1?Zt+=Kt:Math.abs(Zt-Kt)===1&&(Zt-=Kt)),!(!bt.dem||!at.dem)&&(at.dem.backfillBorder(bt.dem,Zt,Vt),at.neighboringTiles&&at.neighboringTiles[nr]&&(at.neighboringTiles[nr].backfilled=!0)))}},q.prototype.getTile=function(J){return this.getTileByID(J.key)},q.prototype.getTileByID=function(J){return this._tiles[J]},q.prototype._retainLoadedChildren=function(J,_e,qe,lt){for(var vt in this._tiles){var Ke=this._tiles[vt];if(!(lt[vt]||!Ke.hasData()||Ke.tileID.overscaledZ<=_e||Ke.tileID.overscaledZ>qe)){for(var at=Ke.tileID;Ke&&Ke.tileID.overscaledZ>_e+1;){var bt=Ke.tileID.scaledTo(Ke.tileID.overscaledZ-1);Ke=this._tiles[bt.key],Ke&&Ke.hasData()&&(at=bt)}for(var Zt=at;Zt.overscaledZ>_e;)if(Zt=Zt.scaledTo(Zt.overscaledZ-1),J[Zt.key]){lt[at.key]=at;break}}}},q.prototype.findLoadedParent=function(J,_e){if(J.key in this._loadedParentTiles){var qe=this._loadedParentTiles[J.key];return qe&&qe.tileID.overscaledZ>=_e?qe:null}for(var lt=J.overscaledZ-1;lt>=_e;lt--){var vt=J.scaledTo(lt),Ke=this._getLoadedTile(vt);if(Ke)return Ke}},q.prototype._getLoadedTile=function(J){var _e=this._tiles[J.key];if(_e&&_e.hasData())return _e;var qe=this._cache.getByKey(J.wrapped().key);return qe},q.prototype.updateCacheSize=function(J){var _e=Math.ceil(J.width/this._source.tileSize)+1,qe=Math.ceil(J.height/this._source.tileSize)+1,lt=_e*qe,vt=5,Ke=Math.floor(lt*vt),at=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Ke):Ke;this._cache.setMaxSize(at)},q.prototype.handleWrapJump=function(J){var _e=this._prevLng===void 0?J:this._prevLng,qe=J-_e,lt=qe/360,vt=Math.round(lt);if(this._prevLng=J,vt){var Ke={};for(var at in this._tiles){var bt=this._tiles[at];bt.tileID=bt.tileID.unwrapTo(bt.tileID.wrap+vt),Ke[bt.tileID.key]=bt}this._tiles=Ke;for(var Zt in this._timers)clearTimeout(this._timers[Zt]),delete this._timers[Zt];for(var Vt in this._tiles){var Kt=this._tiles[Vt];this._setTileReloadTimer(Vt,Kt)}}},q.prototype.update=function(J){var _e=this;if(this.transform=J,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(J),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var qe;this.used?this._source.tileID?qe=J.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(va){return new e.OverscaledTileID(va.canonical.z,va.wrap,va.canonical.z,va.canonical.x,va.canonical.y)}):(qe=J.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(qe=qe.filter(function(va){return _e._source.hasTile(va)}))):qe=[];var lt=J.coveringZoomLevel(this._source),vt=Math.max(lt-q.maxOverzooming,this._source.minzoom),Ke=Math.max(lt+q.maxUnderzooming,this._source.minzoom),at=this._updateRetainedTiles(qe,lt);if(Jn(this._source.type)){for(var bt={},Zt={},Vt=Object.keys(at),Kt=0,nr=Vt;Ktthis._source.maxzoom){var Ht=Bt.children(this._source.maxzoom)[0],zr=this.getTile(Ht);if(zr&&zr.hasData()){qe[Ht.key]=Ht;continue}}else{var Yr=Bt.children(this._source.maxzoom);if(qe[Yr[0].key]&&qe[Yr[1].key]&&qe[Yr[2].key]&&qe[Yr[3].key])continue}for(var fn=Xt.wasRequested(),sa=Bt.overscaledZ-1;sa>=vt;--sa){var Wn=Bt.scaledTo(sa);if(lt[Wn.key]||(lt[Wn.key]=!0,Xt=this.getTile(Wn),!Xt&&fn&&(Xt=this._addTile(Wn)),Xt&&(qe[Wn.key]=Wn,fn=Xt.wasRequested(),Xt.hasData())))break}}}return qe},q.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var J in this._tiles){for(var _e=[],qe=void 0,lt=this._tiles[J].tileID;lt.overscaledZ>0;){if(lt.key in this._loadedParentTiles){qe=this._loadedParentTiles[lt.key];break}_e.push(lt.key);var vt=lt.scaledTo(lt.overscaledZ-1);if(qe=this._getLoadedTile(vt),qe)break;lt=vt}for(var Ke=0,at=_e;Ke0)&&(_e.hasData()&&_e.state!=="reloading"?this._cache.add(_e.tileID,_e,_e.getExpiryTimeout()):(_e.aborted=!0,this._abortTile(_e),this._unloadTile(_e))))},q.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var J in this._tiles)this._removeTile(J);this._cache.reset()},q.prototype.tilesIn=function(J,_e,qe){var lt=this,vt=[],Ke=this.transform;if(!Ke)return vt;for(var at=qe?Ke.getCameraQueryGeometry(J):J,bt=J.map(function(sa){return Ke.pointCoordinate(sa)}),Zt=at.map(function(sa){return Ke.pointCoordinate(sa)}),Vt=this.getIds(),Kt=1/0,nr=1/0,er=-1/0,Bt=-1/0,Xt=0,Ht=Zt;Xt=0&&Pa[1].y+va>=0){var ca=bt.map(function(Ja){return Hn.getTilePoint(Ja)}),Fa=Zt.map(function(Ja){return Hn.getTilePoint(Ja)});vt.push({tile:Wn,tileID:Hn,queryGeometry:ca,cameraQueryGeometry:Fa,scale:la})}}},fn=0;fn=e.browser.now())return!0}return!1},q.prototype.setFeatureState=function(J,_e,qe){J=J||"_geojsonTileLayer",this._state.updateState(J,_e,qe)},q.prototype.removeFeatureState=function(J,_e,qe){J=J||"_geojsonTileLayer",this._state.removeFeatureState(J,_e,qe)},q.prototype.getFeatureState=function(J,_e){return J=J||"_geojsonTileLayer",this._state.getState(J,_e)},q.prototype.setDependencies=function(J,_e,qe){var lt=this._tiles[J];lt&<.setDependencies(_e,qe)},q.prototype.reloadTilesForDependencies=function(J,_e){for(var qe in this._tiles){var lt=this._tiles[qe];lt.hasDependency(J,_e)&&this._reloadTile(qe,"reloading")}this._cache.filter(function(vt){return!vt.hasDependency(J,_e)})},q})(e.Evented);mn.maxOverzooming=10,mn.maxUnderzooming=3;function wn(be,q){var he=Math.abs(be.wrap*2)-+(be.wrap<0),J=Math.abs(q.wrap*2)-+(q.wrap<0);return be.overscaledZ-q.overscaledZ||J-he||q.canonical.y-be.canonical.y||q.canonical.x-be.canonical.x}function Jn(be){return be==="raster"||be==="image"||be==="video"}function pa(){return new e.window.Worker(bs.workerUrl)}var ha="mapboxgl_preloaded_worker_pool",_a=function(){this.active={}};_a.prototype.acquire=function(q){if(!this.workers)for(this.workers=[];this.workers.length<_a.workerCount;)this.workers.push(new pa);return this.active[q]=!0,this.workers.slice()},_a.prototype.release=function(q){delete this.active[q],this.numActive()===0&&(this.workers.forEach(function(he){he.terminate()}),this.workers=null)},_a.prototype.isPreloaded=function(){return!!this.active[ha]},_a.prototype.numActive=function(){return Object.keys(this.active).length};var Ca=Math.floor(e.browser.hardwareConcurrency/2);_a.workerCount=Math.max(Math.min(Ca,6),1);var Vn;function yi(){return Vn||(Vn=new _a),Vn}function Ci(){var be=yi();be.acquire(ha)}function Dt(){var be=Vn;be&&(be.isPreloaded()&&be.numActive()===1?(be.release(ha),Vn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))}function yt(be,q){var he={};for(var J in be)J!=="ref"&&(he[J]=be[J]);return e.refProperties.forEach(function(_e){_e in q&&(he[_e]=q[_e])}),he}function kr(be){be=be.slice();for(var q=Object.create(null),he=0;he0?(_e-lt)/vt:0;return this.points[qe].mult(1-Ke).add(this.points[he].mult(Ke))};var cn=function(q,he,J){var _e=this.boxCells=[],qe=this.circleCells=[];this.xCellCount=Math.ceil(q/J),this.yCellCount=Math.ceil(he/J);for(var lt=0;ltthis.width||_e<0||he>this.height)return qe?!1:[];var vt=[];if(q<=0&&he<=0&&this.width<=J&&this.height<=_e){if(qe)return!0;for(var Ke=0;Ke0:vt}},cn.prototype._queryCircle=function(q,he,J,_e,qe){var lt=q-J,vt=q+J,Ke=he-J,at=he+J;if(vt<0||lt>this.width||at<0||Ke>this.height)return _e?!1:[];var bt=[],Zt={hitTest:_e,circle:{x:q,y:he,radius:J},seenUids:{box:{},circle:{}}};return this._forEachCell(lt,Ke,vt,at,this._queryCellCircle,bt,Zt,qe),_e?bt.length>0:bt},cn.prototype.query=function(q,he,J,_e,qe){return this._query(q,he,J,_e,!1,qe)},cn.prototype.hitTest=function(q,he,J,_e,qe){return this._query(q,he,J,_e,!0,qe)},cn.prototype.hitTestCircle=function(q,he,J,_e){return this._queryCircle(q,he,J,!0,_e)},cn.prototype._queryCell=function(q,he,J,_e,qe,lt,vt,Ke){var at=vt.seenUids,bt=this.boxCells[qe];if(bt!==null)for(var Zt=this.bboxes,Vt=0,Kt=bt;Vt=Zt[er+0]&&_e>=Zt[er+1]&&(!Ke||Ke(this.boxKeys[nr]))){if(vt.hitTest)return lt.push(!0),!0;lt.push({key:this.boxKeys[nr],x1:Zt[er],y1:Zt[er+1],x2:Zt[er+2],y2:Zt[er+3]})}}}var Bt=this.circleCells[qe];if(Bt!==null)for(var Xt=this.circles,Ht=0,zr=Bt;Htvt*vt+Ke*Ke},cn.prototype._circleAndRectCollide=function(q,he,J,_e,qe,lt,vt){var Ke=(lt-_e)/2,at=Math.abs(q-(_e+Ke));if(at>Ke+J)return!1;var bt=(vt-qe)/2,Zt=Math.abs(he-(qe+bt));if(Zt>bt+J)return!1;if(at<=Ke||Zt<=bt)return!0;var Vt=at-Ke,Kt=Zt-bt;return Vt*Vt+Kt*Kt<=J*J};function In(be,q,he,J,_e){var qe=e.create();return q?(e.scale(qe,qe,[1/_e,1/_e,1]),he||e.rotateZ(qe,qe,J.angle)):e.multiply(qe,J.labelPlaneMatrix,be),qe}function xi(be,q,he,J,_e){if(q){var qe=e.clone(be);return e.scale(qe,qe,[_e,_e,1]),he||e.rotateZ(qe,qe,-J.angle),qe}else return J.glCoordMatrix}function Ea(be,q){var he=[be.x,be.y,0,1];es(he,he,q);var J=he[3];return{point:new e.Point(he[0]/J,he[1]/J),signedDistanceFromCamera:J}}function Pi(be,q){return .5+.5*(be/q)}function Xi(be,q){var he=be[0]/be[3],J=be[1]/be[3],_e=he>=-q[0]&&he<=q[0]&&J>=-q[1]&&J<=q[1];return _e}function uo(be,q,he,J,_e,qe,lt,vt){var Ke=J?be.textSizeData:be.iconSizeData,at=e.evaluateSizeForZoom(Ke,he.transform.zoom),bt=[256/he.width*2+1,256/he.height*2+1],Zt=J?be.text.dynamicLayoutVertexArray:be.icon.dynamicLayoutVertexArray;Zt.clear();for(var Vt=be.lineVertexArray,Kt=J?be.text.placedSymbolArray:be.icon.placedSymbolArray,nr=he.transform.width/he.transform.height,er=!1,Bt=0;Btqe)return{useVertical:!0}}return(be===e.WritingMode.vertical?q.yhe.x)?{needsFlipping:!0}:null}function vi(be,q,he,J,_e,qe,lt,vt,Ke,at,bt,Zt,Vt,Kt){var nr=q/24,er=be.lineOffsetX*nr,Bt=be.lineOffsetY*nr,Xt;if(be.numGlyphs>1){var Ht=be.glyphStartIndex+be.numGlyphs,zr=be.lineStartIndex,Yr=be.lineStartIndex+be.lineLength,fn=so(nr,vt,er,Bt,he,bt,Zt,be,Ke,qe,Vt);if(!fn)return{notEnoughRoom:!0};var sa=Ea(fn.first.point,lt).point,Wn=Ea(fn.last.point,lt).point;if(J&&!he){var Hn=Eo(be.writingMode,sa,Wn,Kt);if(Hn)return Hn}Xt=[fn.first];for(var la=be.glyphStartIndex+1;la0?Fa.point:ns(Zt,ca,va,1,_e),Ei=Eo(be.writingMode,va,Ja,Kt);if(Ei)return Ei}var Hi=Xo(nr*vt.getoffsetX(be.glyphStartIndex),er,Bt,he,bt,Zt,be.segment,be.lineStartIndex,be.lineStartIndex+be.lineLength,Ke,qe,Vt);if(!Hi)return{notEnoughRoom:!0};Xt=[Hi]}for(var ws=0,gs=Xt;ws0?1:-1,nr=0;J&&(Kt*=-1,nr=Math.PI),Kt<0&&(nr+=Math.PI);for(var er=Kt>0?vt+lt:vt+lt+1,Bt=_e,Xt=_e,Ht=0,zr=0,Yr=Math.abs(Vt),fn=[];Ht+zr<=Yr;){if(er+=Kt,er=Ke)return null;if(Xt=Bt,fn.push(Bt),Bt=Zt[er],Bt===void 0){var sa=new e.Point(at.getx(er),at.gety(er)),Wn=Ea(sa,bt);if(Wn.signedDistanceFromCamera>0)Bt=Zt[er]=Wn.point;else{var Hn=er-Kt,la=Ht===0?qe:new e.Point(at.getx(Hn),at.gety(Hn));Bt=ns(la,sa,Xt,Yr-Ht+1,bt)}}Ht+=zr,zr=Xt.dist(Bt)}var va=(Yr-Ht)/zr,Pa=Bt.sub(Xt),ca=Pa.mult(va)._add(Xt);ca._add(Pa._unit()._perp()._mult(he*Kt));var Fa=nr+Math.atan2(Bt.y-Xt.y,Bt.x-Xt.x);return fn.push(ca),{point:ca,angle:Fa,path:fn}}var Ys=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function vs(be,q){for(var he=0;he=1;ml--)gs.push(Hi.path[ml]);for(var fl=1;fl0){for(var ol=gs[0].clone(),_u=gs[0].clone(),Xf=1;Xf=Fa.x&&_u.x<=Ja.x&&ol.y>=Fa.y&&_u.y<=Ja.y?$u=[gs]:_u.xJa.x||_u.yJa.y?$u=[]:$u=e.clipLine([gs],Fa.x,Fa.y,Ja.x,Ja.y)}for(var Th=0,Bd=$u;Th=this.screenRightBoundary||_ethis.screenBottomBoundary},Zs.prototype.isInsideGrid=function(q,he,J,_e){return J>=0&&q=0&&he0){var Yr;return this.prevPlacement&&this.prevPlacement.variableOffsets[Vt.crossTileID]&&this.prevPlacement.placements[Vt.crossTileID]&&this.prevPlacement.placements[Vt.crossTileID].text&&(Yr=this.prevPlacement.variableOffsets[Vt.crossTileID].anchor),this.variableOffsets[Vt.crossTileID]={textOffset:Bt,width:J,height:_e,anchor:q,textBoxScale:qe,prevAnchor:Yr},this.markUsedJustification(Kt,q,Vt,nr),Kt.allowVerticalPlacement&&(this.markUsedOrientation(Kt,nr,Vt),this.placedOrientations[Vt.crossTileID]=nr),{shift:Xt,placedGlyphBoxes:Ht}}},Cs.prototype.placeLayerBucketPart=function(q,he,J){var _e=this,qe=q.parameters,lt=qe.bucket,vt=qe.layout,Ke=qe.posMatrix,at=qe.textLabelPlaneMatrix,bt=qe.labelToScreenMatrix,Zt=qe.textPixelRatio,Vt=qe.holdingForFade,Kt=qe.collisionBoxArray,nr=qe.partiallyEvaluatedTextSize,er=qe.collisionGroup,Bt=vt.get("text-optional"),Xt=vt.get("icon-optional"),Ht=vt.get("text-allow-overlap"),zr=vt.get("icon-allow-overlap"),Yr=vt.get("text-rotation-alignment")==="map",fn=vt.get("text-pitch-alignment")==="map",sa=vt.get("icon-text-fit")!=="none",Wn=vt.get("symbol-z-order")==="viewport-y",Hn=Ht&&(zr||!lt.hasIconData()||Xt),la=zr&&(Ht||!lt.hasTextData()||Bt);!lt.collisionArrays&&Kt&<.deserializeCollisionBoxes(Kt);var va=function(Hi,ws){if(!he[Hi.crossTileID]){if(Vt){_e.placements[Hi.crossTileID]=new Ko(!1,!1,!1);return}var gs=!1,ml=!1,fl=!0,_l=null,yl={box:null,offscreen:null},$u={box:null},ol=null,_u=null,Xf=null,Th=0,Bd=0,Nd=0;ws.textFeatureIndex?Th=ws.textFeatureIndex:Hi.useRuntimeCollisionCircles&&(Th=Hi.featureIndex),ws.verticalTextFeatureIndex&&(Bd=ws.verticalTextFeatureIndex);var Wv=ws.textBox;if(Wv){var op=function(mf){var fc=e.WritingMode.horizontal;if(lt.allowVerticalPlacement&&!mf&&_e.prevPlacement){var Jv=_e.prevPlacement.placedOrientations[Hi.crossTileID];Jv&&(_e.placedOrientations[Hi.crossTileID]=Jv,fc=Jv,_e.markUsedOrientation(lt,fc,Hi))}return fc},Z0=function(mf,fc){if(lt.allowVerticalPlacement&&Hi.numVerticalGlyphVertices>0&&ws.verticalTextBox)for(var Jv=0,Bg=lt.writingModes;Jv0&&(ld=ld.filter(function(mf){return mf!==$v.anchor}),ld.unshift($v.anchor))}var Ud=function(mf,fc,Jv){for(var Bg=mf.x2-mf.x1,Zy=mf.y2-mf.y1,wc=Hi.textBoxScale,B_=sa&&!zr?fc:null,Bm={box:[],offscreen:!1},$b=Ht?ld.length*2:ld.length,qd=0;qd<$b;++qd){var Nm=ld[qd%ld.length],Jb=qd>=ld.length,N_=_e.attemptAnchorPlacement(Nm,mf,Bg,Zy,wc,Yr,fn,Zt,Ke,er,Jb,Hi,lt,Jv,B_);if(N_&&(Bm=N_.placedGlyphBoxes,Bm&&Bm.box&&Bm.box.length)){gs=!0,_l=N_.shift;break}}return Bm},sp=function(){return Ud(Wv,ws.iconBox,e.WritingMode.horizontal)},jd=function(){var mf=ws.verticalTextBox,fc=yl&&yl.box&&yl.box.length;return lt.allowVerticalPlacement&&!fc&&Hi.numVerticalGlyphVertices>0&&mf?Ud(mf,ws.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};Z0(sp,jd),yl&&(gs=yl.box,fl=yl.offscreen);var zg=op(yl&&yl.box);if(!gs&&_e.prevPlacement){var W0=_e.prevPlacement.variableOffsets[Hi.crossTileID];W0&&(_e.variableOffsets[Hi.crossTileID]=W0,_e.markUsedJustification(lt,W0.anchor,Hi,zg))}}else{var xp=function(mf,fc){var Jv=_e.collisionIndex.placeCollisionBox(mf,Ht,Zt,Ke,er.predicate);return Jv&&Jv.box&&Jv.box.length&&(_e.markUsedOrientation(lt,fc,Hi),_e.placedOrientations[Hi.crossTileID]=fc),Jv},Kv=function(){return xp(Wv,e.WritingMode.horizontal)},bp=function(){var mf=ws.verticalTextBox;return lt.allowVerticalPlacement&&Hi.numVerticalGlyphVertices>0&&mf?xp(mf,e.WritingMode.vertical):{box:null,offscreen:null}};Z0(Kv,bp),op(yl&&yl.box&&yl.box.length)}}if(ol=yl,gs=ol&&ol.box&&ol.box.length>0,fl=ol&&ol.offscreen,Hi.useRuntimeCollisionCircles){var Yh=lt.text.placedSymbolArray.get(Hi.centerJustifiedTextSymbolIndex),K0=e.evaluateSizeForFeature(lt.textSizeData,nr,Yh),Og=vt.get("text-padding"),Sv=Hi.collisionCircleDiameter;_u=_e.collisionIndex.placeCollisionCircles(Ht,Yh,lt.lineVertexArray,lt.glyphOffsetArray,K0,Ke,at,bt,J,fn,er.predicate,Sv,Og),gs=Ht||_u.circles.length>0&&!_u.collisionDetected,fl=fl&&_u.offscreen}if(ws.iconFeatureIndex&&(Nd=ws.iconFeatureIndex),ws.iconBox){var zm=function(mf){var fc=sa&&_l?Rl(mf,_l.x,_l.y,Yr,fn,_e.transform.angle):mf;return _e.collisionIndex.placeCollisionBox(fc,zr,Zt,Ke,er.predicate)};$u&&$u.box&&$u.box.length&&ws.verticalIconBox?(Xf=zm(ws.verticalIconBox),ml=Xf.box.length>0):(Xf=zm(ws.iconBox),ml=Xf.box.length>0),fl=fl&&Xf.offscreen}var Xy=Bt||Hi.numHorizontalGlyphVertices===0&&Hi.numVerticalGlyphVertices===0,Yy=Xt||Hi.numIconVertices===0;if(!Xy&&!Yy?ml=gs=ml&&gs:Yy?Xy||(ml=ml&&gs):gs=ml&&gs,gs&&ol&&ol.box&&($u&&$u.box&&Bd?_e.collisionIndex.insertCollisionBox(ol.box,vt.get("text-ignore-placement"),lt.bucketInstanceId,Bd,er.ID):_e.collisionIndex.insertCollisionBox(ol.box,vt.get("text-ignore-placement"),lt.bucketInstanceId,Th,er.ID)),ml&&Xf&&_e.collisionIndex.insertCollisionBox(Xf.box,vt.get("icon-ignore-placement"),lt.bucketInstanceId,Nd,er.ID),_u&&(gs&&_e.collisionIndex.insertCollisionCircles(_u.circles,vt.get("text-ignore-placement"),lt.bucketInstanceId,Th,er.ID),J)){var Fg=lt.bucketInstanceId,Om=_e.collisionCircleArrays[Fg];Om===void 0&&(Om=_e.collisionCircleArrays[Fg]=new _o);for(var Fm=0;Fm<_u.circles.length;Fm+=4)Om.circles.push(_u.circles[Fm+0]),Om.circles.push(_u.circles[Fm+1]),Om.circles.push(_u.circles[Fm+2]),Om.circles.push(_u.collisionDetected?1:0)}_e.placements[Hi.crossTileID]=new Ko(gs||Hn,ml||la,fl||lt.justReloaded),he[Hi.crossTileID]=!0}};if(Wn)for(var Pa=lt.getSortedSymbolIndexes(this.transform.angle),ca=Pa.length-1;ca>=0;--ca){var Fa=Pa[ca];va(lt.symbolInstances.get(Fa),lt.collisionArrays[Fa])}else for(var Ja=q.symbolInstanceStart;Ja=0&&(lt>=0&&bt!==lt?q.text.placedSymbolArray.get(bt).crossTileID=0:q.text.placedSymbolArray.get(bt).crossTileID=J.crossTileID)}},Cs.prototype.markUsedOrientation=function(q,he,J){for(var _e=he===e.WritingMode.horizontal||he===e.WritingMode.horizontalOnly?he:0,qe=he===e.WritingMode.vertical?he:0,lt=[J.leftJustifiedTextSymbolIndex,J.centerJustifiedTextSymbolIndex,J.rightJustifiedTextSymbolIndex],vt=0,Ke=lt;vt0||fn>0,va=zr.numIconVertices>0,Pa=_e.placedOrientations[zr.crossTileID],ca=Pa===e.WritingMode.vertical,Fa=Pa===e.WritingMode.horizontal||Pa===e.WritingMode.horizontalOnly;if(la){var Ja=xu(Hn.text),Ei=ca?eo:Ja;nr(q.text,Yr,Ei);var Hi=Fa?eo:Ja;nr(q.text,fn,Hi);var ws=Hn.text.isHidden();[zr.rightJustifiedTextSymbolIndex,zr.centerJustifiedTextSymbolIndex,zr.leftJustifiedTextSymbolIndex].forEach(function(Nd){Nd>=0&&(q.text.placedSymbolArray.get(Nd).hidden=ws||ca?1:0)}),zr.verticalPlacedTextSymbolIndex>=0&&(q.text.placedSymbolArray.get(zr.verticalPlacedTextSymbolIndex).hidden=ws||Fa?1:0);var gs=_e.variableOffsets[zr.crossTileID];gs&&_e.markUsedJustification(q,gs.anchor,zr,Pa);var ml=_e.placedOrientations[zr.crossTileID];ml&&(_e.markUsedJustification(q,"left",zr,ml),_e.markUsedOrientation(q,ml,zr))}if(va){var fl=xu(Hn.icon),_l=!(Vt&&zr.verticalPlacedIconSymbolIndex&&ca);if(zr.placedIconSymbolIndex>=0){var yl=_l?fl:eo;nr(q.icon,zr.numIconVertices,yl),q.icon.placedSymbolArray.get(zr.placedIconSymbolIndex).hidden=Hn.icon.isHidden()}if(zr.verticalPlacedIconSymbolIndex>=0){var $u=_l?eo:fl;nr(q.icon,zr.numVerticalIconVertices,$u),q.icon.placedSymbolArray.get(zr.verticalPlacedIconSymbolIndex).hidden=Hn.icon.isHidden()}}if(q.hasIconCollisionBoxData()||q.hasTextCollisionBoxData()){var ol=q.collisionArrays[Ht];if(ol){var _u=new e.Point(0,0);if(ol.textBox||ol.verticalTextBox){var Xf=!0;if(at){var Th=_e.variableOffsets[sa];Th?(_u=kl(Th.anchor,Th.width,Th.height,Th.textOffset,Th.textBoxScale),bt&&_u._rotate(Zt?_e.transform.angle:-_e.transform.angle)):Xf=!1}ol.textBox&&pi(q.textCollisionBox.collisionVertexArray,Hn.text.placed,!Xf||ca,_u.x,_u.y),ol.verticalTextBox&&pi(q.textCollisionBox.collisionVertexArray,Hn.text.placed,!Xf||Fa,_u.x,_u.y)}var Bd=!!(!Fa&&ol.verticalIconBox);ol.iconBox&&pi(q.iconCollisionBox.collisionVertexArray,Hn.icon.placed,Bd,Vt?_u.x:0,Vt?_u.y:0),ol.verticalIconBox&&pi(q.iconCollisionBox.collisionVertexArray,Hn.icon.placed,!Bd,Vt?_u.x:0,Vt?_u.y:0)}}},Bt=0;Btq},Cs.prototype.setStale=function(){this.stale=!0};function pi(be,q,he,J,_e){be.emplaceBack(q?1:0,he?1:0,J||0,_e||0),be.emplaceBack(q?1:0,he?1:0,J||0,_e||0),be.emplaceBack(q?1:0,he?1:0,J||0,_e||0),be.emplaceBack(q?1:0,he?1:0,J||0,_e||0)}var no=Math.pow(2,25),Cl=Math.pow(2,24),Ds=Math.pow(2,17),No=Math.pow(2,16),Il=Math.pow(2,9),Ws=Math.pow(2,8),ul=Math.pow(2,1);function xu(be){if(be.opacity===0&&!be.placed)return 0;if(be.opacity===1&&be.placed)return 4294967295;var q=be.placed?1:0,he=Math.floor(be.opacity*127);return he*no+q*Cl+he*Ds+q*No+he*Il+q*Ws+he*ul+q}var eo=0,_s=function(q){this._sortAcrossTiles=q.layout.get("symbol-z-order")!=="viewport-y"&&q.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};_s.prototype.continuePlacement=function(q,he,J,_e,qe){for(var lt=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var vt=q[this._currentPlacementIndex],Ke=he[vt],at=this.placement.collisionIndex.transform.zoom;if(Ke.type==="symbol"&&(!Ke.minzoom||Ke.minzoom<=at)&&(!Ke.maxzoom||Ke.maxzoom>at)){this._inProgressLayer||(this._inProgressLayer=new _s(Ke));var bt=this._inProgressLayer.continuePlacement(J[Ke.source],this.placement,this._showCollisionBoxes,Ke,lt);if(bt)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},as.prototype.commit=function(q){return this.placement.commit(q),this.placement};var Hl=512/e.EXTENT/2,Gl=function(q,he,J){this.tileID=q,this.indexedSymbolInstances={},this.bucketInstanceId=J;for(var _e=0;_eq.overscaledZ)for(var at in Ke){var bt=Ke[at];bt.tileID.isChildOf(q)&&bt.findMatches(he.symbolInstances,q,lt)}else{var Zt=q.scaledTo(Number(vt)),Vt=Ke[Zt.key];Vt&&Vt.findMatches(he.symbolInstances,q,lt)}}for(var Kt=0;Kt0)throw new Error("Unimplemented: "+lt.map(function(vt){return vt.command}).join(", ")+".");return qe.forEach(function(vt){vt.command!=="setTransition"&&_e[vt.command].apply(_e,vt.args)}),this.stylesheet=J,!0},q.prototype.addImage=function(J,_e){if(this.getImage(J))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(J,_e),this._afterImageUpdated(J)},q.prototype.updateImage=function(J,_e){this.imageManager.updateImage(J,_e)},q.prototype.getImage=function(J){return this.imageManager.getImage(J)},q.prototype.removeImage=function(J){if(!this.getImage(J))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(J),this._afterImageUpdated(J)},q.prototype._afterImageUpdated=function(J){this._availableImages=this.imageManager.listImages(),this._changedImages[J]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},q.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},q.prototype.addSource=function(J,_e,qe){var lt=this;if(qe===void 0&&(qe={}),this._checkLoaded(),this.sourceCaches[J]!==void 0)throw new Error("There is already a source with this ID");if(!_e.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(_e).join(", ")+".");var vt=["vector","raster","geojson","video","image"],Ke=vt.indexOf(_e.type)>=0;if(!(Ke&&this._validate(e.validateStyle.source,"sources."+J,_e,null,qe))){this.map&&this.map._collectResourceTiming&&(_e.collectResourceTiming=!0);var at=this.sourceCaches[J]=new mn(J,_e,this.dispatcher);at.style=this,at.setEventedParent(this,function(){return{isSourceLoaded:lt.loaded(),source:at.serialize(),sourceId:J}}),at.onAdd(this.map),this._changed=!0}},q.prototype.removeSource=function(J){if(this._checkLoaded(),this.sourceCaches[J]===void 0)throw new Error("There is no source with this ID");for(var _e in this._layers)if(this._layers[_e].source===J)return this.fire(new e.ErrorEvent(new Error('Source "'+J+'" cannot be removed while layer "'+_e+'" is using it.')));var qe=this.sourceCaches[J];delete this.sourceCaches[J],delete this._updatedSources[J],qe.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:J})),qe.setEventedParent(null),qe.clearTiles(),qe.onRemove&&qe.onRemove(this.map),this._changed=!0},q.prototype.setGeoJSONSourceData=function(J,_e){this._checkLoaded();var qe=this.sourceCaches[J].getSource();qe.setData(_e),this._changed=!0},q.prototype.getSource=function(J){return this.sourceCaches[J]&&this.sourceCaches[J].getSource()},q.prototype.addLayer=function(J,_e,qe){qe===void 0&&(qe={}),this._checkLoaded();var lt=J.id;if(this.getLayer(lt)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+lt+'" already exists on this map')));return}var vt;if(J.type==="custom"){if(Bs(this,e.validateCustomStyleLayer(J)))return;vt=e.createStyleLayer(J)}else{if(typeof J.source=="object"&&(this.addSource(lt,J.source),J=e.clone$1(J),J=e.extend(J,{source:lt})),this._validate(e.validateStyle.layer,"layers."+lt,J,{arrayIndex:-1},qe))return;vt=e.createStyleLayer(J),this._validateLayer(vt),vt.setEventedParent(this,{layer:{id:lt}}),this._serializedLayers[vt.id]=vt.serialize()}var Ke=_e?this._order.indexOf(_e):this._order.length;if(_e&&Ke===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+_e+'" does not exist on this map.')));return}if(this._order.splice(Ke,0,lt),this._layerOrderChanged=!0,this._layers[lt]=vt,this._removedLayers[lt]&&vt.source&&vt.type!=="custom"){var at=this._removedLayers[lt];delete this._removedLayers[lt],at.type!==vt.type?this._updatedSources[vt.source]="clear":(this._updatedSources[vt.source]="reload",this.sourceCaches[vt.source].pause())}this._updateLayer(vt),vt.onAdd&&vt.onAdd(this.map)},q.prototype.moveLayer=function(J,_e){this._checkLoaded(),this._changed=!0;var qe=this._layers[J];if(!qe){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be moved.")));return}if(J!==_e){var lt=this._order.indexOf(J);this._order.splice(lt,1);var vt=_e?this._order.indexOf(_e):this._order.length;if(_e&&vt===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+_e+'" does not exist on this map.')));return}this._order.splice(vt,0,J),this._layerOrderChanged=!0}},q.prototype.removeLayer=function(J){this._checkLoaded();var _e=this._layers[J];if(!_e){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be removed.")));return}_e.setEventedParent(null);var qe=this._order.indexOf(J);this._order.splice(qe,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[J]=_e,delete this._layers[J],delete this._serializedLayers[J],delete this._updatedLayers[J],delete this._updatedPaintProps[J],_e.onRemove&&_e.onRemove(this.map)},q.prototype.getLayer=function(J){return this._layers[J]},q.prototype.hasLayer=function(J){return J in this._layers},q.prototype.setLayerZoomRange=function(J,_e,qe){this._checkLoaded();var lt=this.getLayer(J);if(!lt){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot have zoom extent.")));return}lt.minzoom===_e&<.maxzoom===qe||(_e!=null&&(lt.minzoom=_e),qe!=null&&(lt.maxzoom=qe),this._updateLayer(lt))},q.prototype.setFilter=function(J,_e,qe){qe===void 0&&(qe={}),this._checkLoaded();var lt=this.getLayer(J);if(!lt){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(lt.filter,_e)){if(_e==null){lt.filter=void 0,this._updateLayer(lt);return}this._validate(e.validateStyle.filter,"layers."+lt.id+".filter",_e,null,qe)||(lt.filter=e.clone$1(_e),this._updateLayer(lt))}},q.prototype.getFilter=function(J){return e.clone$1(this.getLayer(J).filter)},q.prototype.setLayoutProperty=function(J,_e,qe,lt){lt===void 0&&(lt={}),this._checkLoaded();var vt=this.getLayer(J);if(!vt){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual(vt.getLayoutProperty(_e),qe)||(vt.setLayoutProperty(_e,qe,lt),this._updateLayer(vt))},q.prototype.getLayoutProperty=function(J,_e){var qe=this.getLayer(J);if(!qe){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style.")));return}return qe.getLayoutProperty(_e)},q.prototype.setPaintProperty=function(J,_e,qe,lt){lt===void 0&&(lt={}),this._checkLoaded();var vt=this.getLayer(J);if(!vt){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual(vt.getPaintProperty(_e),qe)){var Ke=vt.setPaintProperty(_e,qe,lt);Ke&&this._updateLayer(vt),this._changed=!0,this._updatedPaintProps[J]=!0}},q.prototype.getPaintProperty=function(J,_e){return this.getLayer(J).getPaintProperty(_e)},q.prototype.setFeatureState=function(J,_e){this._checkLoaded();var qe=J.source,lt=J.sourceLayer,vt=this.sourceCaches[qe];if(vt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+qe+"' does not exist in the map's style.")));return}var Ke=vt.getSource().type;if(Ke==="geojson"&<){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(Ke==="vector"&&!lt){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}J.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),vt.setFeatureState(lt,J.id,_e)},q.prototype.removeFeatureState=function(J,_e){this._checkLoaded();var qe=J.source,lt=this.sourceCaches[qe];if(lt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+qe+"' does not exist in the map's style.")));return}var vt=lt.getSource().type,Ke=vt==="vector"?J.sourceLayer:void 0;if(vt==="vector"&&!Ke){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(_e&&typeof J.id!="string"&&typeof J.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}lt.removeFeatureState(Ke,J.id,_e)},q.prototype.getFeatureState=function(J){this._checkLoaded();var _e=J.source,qe=J.sourceLayer,lt=this.sourceCaches[_e];if(lt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+_e+"' does not exist in the map's style.")));return}var vt=lt.getSource().type;if(vt==="vector"&&!qe){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return J.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),lt.getFeatureState(qe,J.id)},q.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},q.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,function(J){return J.serialize()}),layers:this._serializeLayers(this._order)},function(J){return J!==void 0})},q.prototype._updateLayer=function(J){this._updatedLayers[J.id]=!0,J.source&&!this._updatedSources[J.source]&&this.sourceCaches[J.source].getSource().type!=="raster"&&(this._updatedSources[J.source]="reload",this.sourceCaches[J.source].pause()),this._changed=!0},q.prototype._flattenAndSortRenderedFeatures=function(J){for(var _e=this,qe=function(Fa){return _e._layers[Fa].type==="fill-extrusion"},lt={},vt=[],Ke=this._order.length-1;Ke>=0;Ke--){var at=this._order[Ke];if(qe(at)){lt[at]=Ke;for(var bt=0,Zt=J;bt=0;Ht--){var zr=this._order[Ht];if(qe(zr))for(var Yr=vt.length-1;Yr>=0;Yr--){var fn=vt[Yr].feature;if(lt[fn.layer.id] .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}}),cS=Ge({"src/plots/mapbox/layout_attributes.js"(K,G){var h=_n(),b=go().defaultLine,S=Cc().attributes,E=Us(),e=Gc().textposition,t=Hc().overrideAll,r=_u().templatedArray,o=Wy(),n=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[h.counterRegex("mapbox",".layers",!0)],domain:S({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:o.styleValuesMapbox.concat(o.styleValuesNonMapbox),dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:b},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:b}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:h.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),ZE=Ge({"src/traces/scattermapbox/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=cv(),e=Wb(),t=Gc(),r=cS(),o=Jl(),n=zu(),i=Ji().extendFlat,a=Hc().overrideAll,s=cS(),f=e.line,c=e.marker;G.exports=a({lon:e.lon,lat:e.lat,cluster:{enabled:{valType:"boolean"},maxzoom:i({},s.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:i({},c.opacity,{dflt:1})},mode:i({},t.mode,{dflt:"markers"}),text:i({},t.text,{}),texttemplate:b({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:i({},t.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:t.connectgaps,marker:i({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},n("marker")),fill:e.fill,fillcolor:E(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:i({},o.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:h(),hovertemplatefallback:S()},"calc","nested")}}),bL=Ge({"src/traces/scattermapbox/constants.js"(K,G){var h=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];G.exports={isSupportedFont:function(b){return h.indexOf(b)!==-1}}}}),e7=Ge({"src/traces/scattermapbox/defaults.js"(K,G){var h=_n(),b=uu(),S=Jd(),E=Hp(),e=op(),t=Nd(),r=ZE(),o=bL().isSupportedFont;G.exports=function(a,s,f,c){function p(d,y){return h.coerce(a,s,r,d,y)}function v(d,y){return h.coerce2(a,s,r,d,y)}var T=n(a,s,p);if(!T){s.visible=!1;return}if(p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback"),p("mode"),p("below"),b.hasMarkers(s)){S(a,s,f,c,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var l=s.marker;l.symbol!=="circle"&&(h.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),h.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}b.hasLines(s)&&(E(a,s,f,c,p,{noDash:!0}),p("connectgaps"));var g=v("cluster.maxzoom"),x=v("cluster.step"),A=v("cluster.color",s.marker&&s.marker.color||f),M=v("cluster.size"),_=v("cluster.opacity"),w=g!==!1||x!==!1||A!==!1||M!==!1||_!==!1,m=p("cluster.enabled",w);if(m||b.hasText(s)){var u=c.font.family;e(a,s,c,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:c.font.weight,style:c.font.style,size:c.font.size,color:c.font.color}})}p("fill"),s.fill!=="none"&&t(a,s,f,p),h.coerceSelectionMarkerOpacity(s,p)};function n(i,a,s){var f=s("lon")||[],c=s("lat")||[],p=Math.min(f.length,c.length);return a._length=p,p}}}),wL=Ge({"src/traces/scattermapbox/format_labels.js"(K,G){var h=Ts();G.exports=function(S,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,n=S.lonlat;return t.lonLabel=h.tickText(o,o.c2l(n[0]),!0).text,t.latLabel=h.tickText(o,o.c2l(n[1]),!0).text,t}}}),TL=Ge({"src/plots/mapbox/convert_text_opts.js"(K,G){var h=_n();G.exports=function(S,E){var e=S.split(" "),t=e[0],r=e[1],o=h.isArrayOrTypedArray(E)?h.mean(E):E,n=.5+o/100,i=1.5+o/100,a=["",""],s=[0,0];switch(t){case"top":a[0]="top",s[1]=-i;break;case"bottom":a[0]="bottom",s[1]=i;break}switch(r){case"left":a[1]="right",s[0]=-n;break;case"right":a[1]="left",s[0]=n;break}var f;return a[0]&&a[1]?f=a.join("-"):a[0]?f=a[0]:a[1]?f=a[1]:f="center",{anchor:f,offset:s}}}}),t7=Ge({"src/traces/scattermapbox/convert.js"(K,G){var h=Ei(),b=_n(),S=Ii().BADNUM,E=O_(),e=kc(),t=As(),r=Bp(),o=uu(),n=bL().isSupportedFont,i=TL(),a=Kd().appendArrayPointValue,s=nc().NEWLINES,f=nc().BR_TAG_ALL;G.exports=function(_,w){var m=w[0].trace,u=m.visible===!0&&m._length!==0,d=m.fill!=="none",y=o.hasLines(m),I=o.hasMarkers(m),L=o.hasText(m),z=I&&m.marker.symbol==="circle",F=I&&m.marker.symbol!=="circle",N=m.cluster&&m.cluster.enabled,B=c("fill"),R=c("line"),U=c("circle"),j=c("symbol"),Z={fill:B,line:R,circle:U,symbol:j};if(!u)return Z;var re;if((d||y)&&(re=E.calcTraceToLineCoords(w)),d&&(B.geojson=E.makePolygon(re),B.layout.visibility="visible",b.extendFlat(B.paint,{"fill-color":m.fillcolor})),y&&(R.geojson=E.makeLine(re),R.layout.visibility="visible",b.extendFlat(R.paint,{"line-width":m.line.width,"line-color":m.line.color,"line-opacity":m.opacity})),z){var fe=p(w);U.geojson=fe.geojson,U.layout.visibility="visible",N&&(U.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(m.cluster.color,m.cluster.step),"circle-radius":x(m.cluster.size,m.cluster.step),"circle-opacity":x(m.cluster.opacity,m.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":A(m),"text-size":12}}),b.extendFlat(U.paint,{"circle-color":fe.mcc,"circle-radius":fe.mrc,"circle-opacity":fe.mo})}if(z&&N&&(U.filter=["!",["has","point_count"]]),(F||L)&&(j.geojson=v(w,_),b.extendFlat(j.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(b.extendFlat(j.layout,{"icon-size":m.marker.size/10}),"angle"in m.marker&&m.marker.angle!=="auto"&&b.extendFlat(j.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),j.layout["icon-allow-overlap"]=m.marker.allowoverlap,b.extendFlat(j.paint,{"icon-opacity":m.opacity*m.marker.opacity,"icon-color":m.marker.color})),L)){var le=(m.marker||{}).size,ce=i(m.textposition,le);b.extendFlat(j.layout,{"text-size":m.textfont.size,"text-anchor":ce.anchor,"text-offset":ce.offset,"text-font":A(m)}),b.extendFlat(j.paint,{"text-color":m.textfont.color,"text-opacity":m.opacity})}return Z};function c(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function p(M){var _=M[0].trace,w=_.marker,m=_.selectedpoints,u=b.isArrayOrTypedArray(w.color),d=b.isArrayOrTypedArray(w.size),y=b.isArrayOrTypedArray(w.opacity),I;function L(le){return _.opacity*le}function z(le){return le/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=b.identity);var N;d&&(N=r(_));var B;y&&(B=function(le){var ce=h(le)?+b.constrain(le,0,1):0;return L(ce)});var R=[];for(I=0;I850?I+=" Black":u>750?I+=" Extra Bold":u>650?I+=" Bold":u>550?I+=" Semi Bold":u>450?I+=" Medium":u>350?I+=" Regular":u>250?I+=" Light":u>150?I+=" Extra Light":I+=" Thin"):d.slice(0,2).join(" ")==="Open Sans"?(I="Open Sans",u>750?I+=" Extrabold":u>650?I+=" Bold":u>550?I+=" Semibold":u>350?I+=" Regular":I+=" Light"):d.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(I="Klokantech Noto Sans",d[3]==="CJK"&&(I+=" CJK"),I+=u>500?" Bold":" Regular")),y&&(I+=" Italic"),I==="Open Sans Regular Italic"?I="Open Sans Italic":I==="Open Sans Regular Bold"?I="Open Sans Bold":I==="Open Sans Regular Bold Italic"?I="Open Sans Bold Italic":I==="Klokantech Noto Sans Regular Italic"&&(I="Klokantech Noto Sans Italic"),n(I)||(I=w);var L=I.split(", ");return L}}}),r7=Ge({"src/traces/scattermapbox/plot.js"(K,G){var h=_n(),b=t7(),S=Wy().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,n,i){this.type="scattermapbox",this.subplot=r,this.uid=o,this.clusterEnabled=n,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:S+o+"-fill",line:S+o+"-line",circle:S+o+"-circle",symbol:S+o+"-symbol",cluster:S+o+"-cluster",clusterCount:S+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,n){var i={type:"geojson",data:o.geojson};n&&n.enabled&&h.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[r]);a?a.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,n){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var a=this.layerIds[r],s,f=this.subplot.getMapLayers(),c=0;c=0;y--){var I=d[y];a.removeLayer(v.layerIds[I])}u||a.removeSource(v.sourceIds.circle)}function g(u){for(var d=E.nonCluster,y=0;y=0;y--){var I=d[y];a.removeLayer(v.layerIds[I]),u||a.removeSource(v.sourceIds[I])}}function A(u){p?l(u):x(u)}function M(u){c?T(u):g(u)}function _(){for(var u=c?E.cluster:E.nonCluster,d=0;d=0;i--){var a=n[i];o.removeLayer(this.layerIds[a]),o.removeSource(this.sourceIds[a])}},G.exports=function(o,n){var i=n[0].trace,a=i.cluster&&i.cluster.enabled,s=i.visible!==!0,f=new e(o,i.uid,a,s),c=b(o.gd,n),p=f.below=o.belowLookup["trace-"+i.uid],v,T,l;if(a)for(f.addSource("circle",c.circle,i.cluster),v=0;v=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=A*360,_=i-M;function w(N){var B=N.lonlat;if(B[0]===e||g&&T.indexOf(N.i+1)===-1)return 1/0;var R=b.modHalf(B[0],360),U=B[1],j=v.project([R,U]),Z=j.x-c.c2p([_,U]),re=j.y-p.c2p([R,a]),fe=Math.max(3,N.mrc||0);return Math.max(Math.sqrt(Z*Z+re*re)-fe,1-3/fe)}if(h.getClosest(s,w,n),n.index!==!1){var m=s[n.index],u=m.lonlat,d=[b.modHalf(u[0],360)+M,u[1]],y=c.c2p(d),I=p.c2p(d),L=m.mrc||1;n.x0=y-L,n.x1=y+L,n.y0=I-L,n.y1=I+L;var z={};z[f.subplot]={_subplot:v};var F=f._module.formatLabels(m,f,z);return n.lonLabel=F.lonLabel,n.latLabel=F.latLabel,n.color=S(f,m),n.extraText=o(f,m,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function o(n,i,a){if(n.hovertemplate)return;var s=i.hi||n.hoverinfo,f=s.split("+"),c=f.indexOf("all")!==-1,p=f.indexOf("lon")!==-1,v=f.indexOf("lat")!==-1,T=i.lonlat,l=[];function g(x){return x+"°"}return c||p&&v?l.push("("+g(T[1])+", "+g(T[0])+")"):p?l.push(a.lon+g(T[0])):v&&l.push(a.lat+g(T[1])),(c||f.indexOf("text")!==-1)&&E(i,n,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),n7=Ge({"src/traces/scattermapbox/event_data.js"(K,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b}}}),a7=Ge({"src/traces/scattermapbox/select.js"(K,G){var h=_n(),b=uu(),S=Ii().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,n=e.yaxis,i=[],a=r[0].trace,s;if(!b.hasMarkers(a))return[];if(t===!1)for(s=0;s"u"&&(C=1e-6);var X,se,Te,De,He;for(Te=k,He=0;He<8;He++){if(De=this.sampleCurveX(Te)-k,Math.abs(De)se)return se;for(;XDe?X=Te:se=Te,Te=(se-X)*.5+X}return Te},n.prototype.solve=function(k,C){return this.sampleCurveY(this.solveCurveX(k,C))};var i=a;function a(k,C){this.x=k,this.y=C}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(k){return this.clone()._add(k)},sub:function(k){return this.clone()._sub(k)},multByPoint:function(k){return this.clone()._multByPoint(k)},divByPoint:function(k){return this.clone()._divByPoint(k)},mult:function(k){return this.clone()._mult(k)},div:function(k){return this.clone()._div(k)},rotate:function(k){return this.clone()._rotate(k)},rotateAround:function(k,C){return this.clone()._rotateAround(k,C)},matMult:function(k){return this.clone()._matMult(k)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(k){return this.x===k.x&&this.y===k.y},dist:function(k){return Math.sqrt(this.distSqr(k))},distSqr:function(k){var C=k.x-this.x,X=k.y-this.y;return C*C+X*X},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(k){return Math.atan2(this.y-k.y,this.x-k.x)},angleWith:function(k){return this.angleWithSep(k.x,k.y)},angleWithSep:function(k,C){return Math.atan2(this.x*C-this.y*k,this.x*k+this.y*C)},_matMult:function(k){var C=k[0]*this.x+k[1]*this.y,X=k[2]*this.x+k[3]*this.y;return this.x=C,this.y=X,this},_add:function(k){return this.x+=k.x,this.y+=k.y,this},_sub:function(k){return this.x-=k.x,this.y-=k.y,this},_mult:function(k){return this.x*=k,this.y*=k,this},_div:function(k){return this.x/=k,this.y/=k,this},_multByPoint:function(k){return this.x*=k.x,this.y*=k.y,this},_divByPoint:function(k){return this.x/=k.x,this.y/=k.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var k=this.y;return this.y=this.x,this.x=-k,this},_rotate:function(k){var C=Math.cos(k),X=Math.sin(k),se=C*this.x-X*this.y,Te=X*this.x+C*this.y;return this.x=se,this.y=Te,this},_rotateAround:function(k,C){var X=Math.cos(k),se=Math.sin(k),Te=C.x+X*(this.x-C.x)-se*(this.y-C.y),De=C.y+se*(this.x-C.x)+X*(this.y-C.y);return this.x=Te,this.y=De,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(k){return k instanceof a?k:Array.isArray(k)?new a(k[0],k[1]):k};var s=typeof self<"u"?self:{};function f(k,C){if(Array.isArray(k)){if(!Array.isArray(C)||k.length!==C.length)return!1;for(var X=0;X=1)return 1;var C=k*k,X=C*k;return 4*(k<.5?X:3*(k-C)+X-.75)}function v(k,C,X,se){var Te=new o(k,C,X,se);return function(De){return Te.solve(De)}}var T=v(.25,.1,.25,1);function l(k,C,X){return Math.min(X,Math.max(C,k))}function g(k,C,X){var se=X-C,Te=((k-C)%se+se)%se+C;return Te===C?X:Te}function x(k,C,X){if(!k.length)return X(null,[]);var se=k.length,Te=new Array(k.length),De=null;k.forEach(function(He,yt){C(He,function(qt,nr){qt&&(De=qt),Te[yt]=nr,--se===0&&X(De,Te)})})}function A(k){var C=[];for(var X in k)C.push(k[X]);return C}function M(k,C){var X=[];for(var se in k)se in C||X.push(se);return X}function _(k){for(var C=[],X=arguments.length-1;X-- >0;)C[X]=arguments[X+1];for(var se=0,Te=C;se>C/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,k)}return k()}function y(k){return k<=1?1:Math.pow(2,Math.ceil(Math.log(k)/Math.LN2))}function I(k){return k?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(k):!1}function L(k,C){k.forEach(function(X){C[X]&&(C[X]=C[X].bind(C))})}function z(k,C){return k.indexOf(C,k.length-C.length)!==-1}function F(k,C,X){var se={};for(var Te in k)se[Te]=C.call(X||this,k[Te],Te,k);return se}function N(k,C,X){var se={};for(var Te in k)C.call(X||this,k[Te],Te,k)&&(se[Te]=k[Te]);return se}function B(k){return Array.isArray(k)?k.map(B):typeof k=="object"&&k?F(k,B):k}function R(k,C){for(var X=0;X=0)return!0;return!1}var U={};function j(k){U[k]||(typeof console<"u"&&console.warn(k),U[k]=!0)}function Z(k,C,X){return(X.y-k.y)*(C.x-k.x)>(C.y-k.y)*(X.x-k.x)}function re(k){for(var C=0,X=0,se=k.length,Te=se-1,De=void 0,He=void 0;X@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,X={};if(k.replace(C,function(Te,De,He,yt){var qt=He||yt;return X[De]=qt?qt.toLowerCase():!0,""}),X["max-age"]){var se=parseInt(X["max-age"],10);isNaN(se)?delete X["max-age"]:X["max-age"]=se}return X}var V=null;function ee(k){if(V==null){var C=k.navigator?k.navigator.userAgent:null;V=!!k.safari||!!(C&&(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return V}function ne(k){try{var C=s[k];return C.setItem("_mapbox_test_",1),C.removeItem("_mapbox_test_"),!0}catch{return!1}}function $(k){return s.btoa(encodeURIComponent(k).replace(/%([0-9A-F]{2})/g,function(C,X){return String.fromCharCode(+("0x"+X))}))}function ue(k){return decodeURIComponent(s.atob(k).split("").map(function(C){return"%"+("00"+C.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var te=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),H=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,ae=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,ie,de,Se={now:te,frame:function(C){var X=H(C);return{cancel:function(){return ae(X)}}},getImageData:function(C,X){X===void 0&&(X=0);var se=s.document.createElement("canvas"),Te=se.getContext("2d");if(!Te)throw new Error("failed to create canvas 2d context");return se.width=C.width,se.height=C.height,Te.drawImage(C,0,0,C.width,C.height),Te.getImageData(-X,-X,C.width+2*X,C.height+2*X)},resolveURL:function(C){return ie||(ie=s.document.createElement("a")),ie.href=C,ie.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(de==null&&(de=s.matchMedia("(prefers-reduced-motion: reduce)")),de.matches):!1}},Le={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Fe={supported:!1,testSupport:at},ze,Ye=!1,st,ct=!1;s.document&&(st=s.document.createElement("img"),st.onload=function(){ze&&et(ze),ze=null,ct=!0},st.onerror=function(){Ye=!0,ze=null},st.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function at(k){Ye||!st||(ct?et(k):ze=k)}function et(k){var C=k.createTexture();k.bindTexture(k.TEXTURE_2D,C);try{if(k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,st),k.isContextLost())return;Fe.supported=!0}catch{}k.deleteTexture(C),Ye=!0}var Pe="01";function Ae(){for(var k="1",C="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",X="",se=0;se<10;se++)X+=C[Math.floor(Math.random()*62)];var Te=720*60*1e3,De=[k,Pe,X].join(""),He=Date.now()+Te;return{token:De,tokenExpiresAt:He}}var pe=function(C,X){this._transformRequestFn=C,this._customAccessToken=X,this._createSkuToken()};pe.prototype._createSkuToken=function(){var C=Ae();this._skuToken=C.token,this._skuTokenExpiresAt=C.tokenExpiresAt},pe.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},pe.prototype.transformRequest=function(C,X){return this._transformRequestFn?this._transformRequestFn(C,X)||{url:C}:{url:C}},pe.prototype.normalizeStyleURL=function(C,X){if(!Ne(C))return C;var se=Qt(C);return se.path="/styles/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||X)},pe.prototype.normalizeGlyphsURL=function(C,X){if(!Ne(C))return C;var se=Qt(C);return se.path="/fonts/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||X)},pe.prototype.normalizeSourceURL=function(C,X){if(!Ne(C))return C;var se=Qt(C);return se.path="/v4/"+se.authority+".json",se.params.push("secure"),this._makeAPIURL(se,this._customAccessToken||X)},pe.prototype.normalizeSpriteURL=function(C,X,se,Te){var De=Qt(C);return Ne(C)?(De.path="/styles/v1"+De.path+"/sprite"+X+se,this._makeAPIURL(De,this._customAccessToken||Te)):(De.path+=""+X+se,ar(De))},pe.prototype.normalizeTileURL=function(C,X){if(this._isSkuTokenExpired()&&this._createSkuToken(),C&&!Ne(C))return C;var se=Qt(C),Te=/(\.(png|jpg)\d*)(?=$)/,De=/^.+\/v4\//,He=Se.devicePixelRatio>=2||X===512?"@2x":"",yt=Fe.supported?".webp":"$1";se.path=se.path.replace(Te,""+He+yt),se.path=se.path.replace(De,"/"),se.path="/v4"+se.path;var qt=this._customAccessToken||Ft(se.params)||Le.ACCESS_TOKEN;return Le.REQUIRE_ACCESS_TOKEN&&qt&&this._skuToken&&se.params.push("sku="+this._skuToken),this._makeAPIURL(se,qt)},pe.prototype.canonicalizeTileURL=function(C,X){var se="/v4/",Te=/\.[\w]+$/,De=Qt(C);if(!De.path.match(/(^\/v4\/)/)||!De.path.match(Te))return C;var He="mapbox://tiles/";He+=De.path.replace(se,"");var yt=De.params;return X&&(yt=yt.filter(function(qt){return!qt.match(/^access_token=/)})),yt.length&&(He+="?"+yt.join("&")),He},pe.prototype.canonicalizeTileset=function(C,X){for(var se=X?Ne(X):!1,Te=[],De=0,He=C.tiles||[];De=0&&C.params.splice(De,1)}if(Te.path!=="/"&&(C.path=""+Te.path+C.path),!Le.REQUIRE_ACCESS_TOKEN)return ar(C);if(X=X||Le.ACCESS_TOKEN,!X)throw new Error("An API access token is required to use Mapbox GL. "+se);if(X[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+se);return C.params=C.params.filter(function(He){return He.indexOf("access_token")===-1}),C.params.push("access_token="+X),ar(C)};function Ne(k){return k.indexOf("mapbox:")===0}var ut=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function dt(k){return ut.test(k)}function nt(k){return k.indexOf("sku=")>0&&dt(k)}function Ft(k){for(var C=0,X=k;C=1&&s.localStorage.setItem(X,JSON.stringify(this.eventData))}catch{j("Unable to write to LocalStorage")}},$r.prototype.processRequests=function(C){},$r.prototype.postEvent=function(C,X,se,Te){var De=this;if(Le.EVENTS_URL){var He=Qt(Le.EVENTS_URL);He.params.push("access_token="+(Te||Le.ACCESS_TOKEN||""));var yt={event:this.type,created:new Date(C).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:Pe,userId:this.anonId},qt=X?_(yt,X):yt,nr={url:ar(He),headers:{"Content-Type":"text/plain"},body:JSON.stringify([qt])};this.pendingRequest=An(nr,function(dr){De.pendingRequest=null,se(dr),De.saveEventData(),De.processRequests(Te)})}},$r.prototype.queueRequest=function(C,X){this.queue.push(C),this.processRequests(X)};var Sr=(function(k){function C(){k.call(this,"map.load"),this.success={},this.skuToken=""}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postMapLoadEvent=function(se,Te,De,He){this.skuToken=De,(Le.EVENTS_URL&&He||Le.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(yt){return Ne(yt)||dt(yt)}))&&this.queueRequest({id:Te,timestamp:Date.now()},He)},C.prototype.processRequests=function(se){var Te=this;if(!(this.pendingRequest||this.queue.length===0)){var De=this.queue.shift(),He=De.id,yt=De.timestamp;He&&this.success[He]||(this.anonId||this.fetchEventData(),I(this.anonId)||(this.anonId=d()),this.postEvent(yt,{skuToken:this.skuToken},function(qt){qt||He&&(Te.success[He]=!0)},se))}},C})($r),Ur=(function(k){function C(X){k.call(this,"appUserTurnstile"),this._customAccessToken=X}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postTurnstileEvent=function(se,Te){Le.EVENTS_URL&&Le.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(De){return Ne(De)||dt(De)})&&this.queueRequest(Date.now(),Te)},C.prototype.processRequests=function(se){var Te=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var De=Er(Le.ACCESS_TOKEN),He=De?De.u:Le.ACCESS_TOKEN,yt=He!==this.eventData.tokenU;I(this.anonId)||(this.anonId=d(),yt=!0);var qt=this.queue.shift();if(this.eventData.lastSuccess){var nr=new Date(this.eventData.lastSuccess),dr=new Date(qt),Fr=(qt-this.eventData.lastSuccess)/(1440*60*1e3);yt=yt||Fr>=1||Fr<-1||nr.getDate()!==dr.getDate()}else yt=!0;if(!yt)return this.processRequests();this.postEvent(qt,{"enabled.telemetry":!1},function(rn){rn||(Te.eventData.lastSuccess=qt,Te.eventData.tokenU=He)},se)}},C})($r),Mt=new Ur,je=Mt.postTurnstileEvent.bind(Mt),Je=new Sr,ke=Je.postMapLoadEvent.bind(Je),xe="mapbox-tiles",ye=500,Ee=50,Xe=1e3*60*7,Qe;function Lt(){s.caches&&!Qe&&(Qe=s.caches.open(xe))}var Ct;function Ot(k,C){if(Ct===void 0)try{new Response(new ReadableStream),Ct=!0}catch{Ct=!1}Ct?C(k.body):k.blob().then(C)}function Kt(k,C,X){if(Lt(),!!Qe){var se={status:C.status,statusText:C.statusText,headers:new s.Headers};C.headers.forEach(function(He,yt){return se.headers.set(yt,He)});var Te=ce(C.headers.get("Cache-Control")||"");if(!Te["no-store"]){Te["max-age"]&&se.headers.set("Expires",new Date(X+Te["max-age"]*1e3).toUTCString());var De=new Date(se.headers.get("Expires")).getTime()-X;DeDate.now()&&!X["no-cache"]}var Nr=1/0;function kn(k){Nr++,Nr>Ee&&(k.getActor().send("enforceCacheSizeLimit",ye),Nr=0)}function $n(k){Lt(),Qe&&Qe.then(function(C){C.keys().then(function(X){for(var se=0;se=200&&X.status<300||X.status===0)&&X.response!==null){var Te=X.response;if(k.type==="json")try{Te=JSON.parse(X.response)}catch(De){return C(De)}C(null,Te,X.getResponseHeader("Cache-Control"),X.getResponseHeader("Expires"))}else C(new Va(X.statusText,X.status,k.url))},X.send(k.body),{cancel:function(){return X.abort()}}}var Gr=function(k,C){if(!Vt(k.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return or(k,C);if(le()&&self.worker&&self.worker.actor){var X=!0;return self.worker.actor.send("getResource",k,C,void 0,X)}}return ur(k,C)},ln=function(k,C){return Gr(_(k,{type:"json"}),C)},gn=function(k,C){return Gr(_(k,{type:"arrayBuffer"}),C)},An=function(k,C){return Gr(_(k,{method:"POST"}),C)};function Qn(k){var C=s.document.createElement("a");return C.href=k,C.protocol===s.document.location.protocol&&C.host===s.document.location.host}var pa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function ha(k,C,X,se){var Te=new s.Image,De=s.URL;Te.onload=function(){C(null,Te),De.revokeObjectURL(Te.src),Te.onload=null,s.requestAnimationFrame(function(){Te.src=pa})},Te.onerror=function(){return C(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var He=new s.Blob([new Uint8Array(k)],{type:"image/png"});Te.cacheControl=X,Te.expires=se,Te.src=k.byteLength?De.createObjectURL(He):pa}function _a(k,C){var X=new s.Blob([new Uint8Array(k)],{type:"image/png"});s.createImageBitmap(X).then(function(se){C(null,se)}).catch(function(se){C(new Error("Could not load image because of "+se.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var Ca,Hn,pi=function(){Ca=[],Hn=0};pi();var Si=function(k,C){if(Fe.supported&&(k.headers||(k.headers={}),k.headers.accept="image/webp,*/*"),Hn>=Le.MAX_PARALLEL_IMAGE_REQUESTS){var X={requestParameters:k,callback:C,cancelled:!1,cancel:function(){this.cancelled=!0}};return Ca.push(X),X}Hn++;var se=!1,Te=function(){if(!se)for(se=!0,Hn--;Ca.length&&Hn0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)},Dr.prototype.setEventedParent=function(C,X){return this._eventedParent=C,this._eventedParentData=X,this};var qr=8,un={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Jr={"*":{type:"source"}},At=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],lr={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},zr={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},cn={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Rn={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},qn={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},jn={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},fn={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},In=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],gi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ea={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ci={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Xi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},so={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},io={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Mo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ui={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ts={type:"array",value:"*"},Ho={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},Xs={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},cs={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Jo={type:"array",value:"*",minimum:1},Uo={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},Ys=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Vs={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},ll={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},fs={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},Zo={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},po={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},hs={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},ul={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},kl={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Rl={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Ms={"*":{type:"string"}},fi={$version:qr,$root:un,sources:Jr,source:At,source_vector:lr,source_raster:zr,source_raster_dem:cn,source_geojson:Rn,source_video:qn,source_image:jn,layer:fn,layout:In,layout_background:gi,layout_fill:Ea,layout_circle:Ci,layout_heatmap:Xi,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:so,layout_symbol:io,layout_raster:Mo,layout_hillshade:ui,filter:ts,filter_operator:Ho,geometry_type:Xs,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:cs,expression:Jo,light:Uo,paint:Ys,paint_fill:Vs,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:ll,paint_circle:fs,paint_heatmap:Zo,paint_symbol:po,paint_raster:hs,paint_hillshade:ul,paint_background:kl,transition:Rl,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:Ms},to=function(C,X,se,Te){this.message=(C?C+": ":"")+se,Te&&(this.identifier=Te),X!=null&&X.__line__&&(this.line=X.__line__)};function Cl(k){var C=k.key,X=k.value;return X?[new to(C,X,"constants have been deprecated as of v8")]:[]}function Ps(k){for(var C=[],X=arguments.length-1;X-- >0;)C[X]=arguments[X+1];for(var se=0,Te=C;se":k.itemType.kind==="value"?"array":"array<"+C+">"}else return k.kind}var Zu=[Au,Qi,gs,rs,Xl,Os,Yl,Nl(Io),wl];function df(k,C){if(C.kind==="error")return null;if(k.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!df(k.itemType,C.itemType))&&(typeof k.N!="number"||k.N===C.N))return null}else{if(k.kind===C.kind)return null;if(k.kind==="value")for(var X=0,se=Zu;X255?255:nr}function Te(nr){return nr<0?0:nr>1?1:nr}function De(nr){return nr[nr.length-1]==="%"?se(parseFloat(nr)/100*255):se(parseInt(nr))}function He(nr){return nr[nr.length-1]==="%"?Te(parseFloat(nr)/100):Te(parseFloat(nr))}function yt(nr,dr,Fr){return Fr<0?Fr+=1:Fr>1&&(Fr-=1),Fr*6<1?nr+(dr-nr)*Fr*6:Fr*2<1?dr:Fr*3<2?nr+(dr-nr)*(2/3-Fr)*6:nr}function qt(nr){var dr=nr.replace(/ /g,"").toLowerCase();if(dr in X)return X[dr].slice();if(dr[0]==="#"){if(dr.length===4){var Fr=parseInt(dr.substr(1),16);return Fr>=0&&Fr<=4095?[(Fr&3840)>>4|(Fr&3840)>>8,Fr&240|(Fr&240)>>4,Fr&15|(Fr&15)<<4,1]:null}else if(dr.length===7){var Fr=parseInt(dr.substr(1),16);return Fr>=0&&Fr<=16777215?[(Fr&16711680)>>16,(Fr&65280)>>8,Fr&255,1]:null}return null}var rn=dr.indexOf("("),Kr=dr.indexOf(")");if(rn!==-1&&Kr+1===dr.length){var bn=dr.substr(0,rn),Kn=dr.substr(rn+1,Kr-(rn+1)).split(","),ja=1;switch(bn){case"rgba":if(Kn.length!==4)return null;ja=He(Kn.pop());case"rgb":return Kn.length!==3?null:[De(Kn[0]),De(Kn[1]),De(Kn[2]),ja];case"hsla":if(Kn.length!==4)return null;ja=He(Kn.pop());case"hsl":if(Kn.length!==3)return null;var wa=(parseFloat(Kn[0])%360+360)%360/360,mi=He(Kn[1]),Ja=He(Kn[2]),vi=Ja<=.5?Ja*(mi+1):Ja+mi-Ja*mi,Mi=Ja*2-vi;return[se(yt(Mi,vi,wa+1/3)*255),se(yt(Mi,vi,wa)*255),se(yt(Mi,vi,wa-1/3)*255),ja];default:return null}}return null}try{C.parseCSSColor=qt}catch{}}),wh=Dh.parseCSSColor,Tl=function(C,X,se,Te){Te===void 0&&(Te=1),this.r=C,this.g=X,this.b=se,this.a=Te};Tl.parse=function(C){if(C){if(C instanceof Tl)return C;if(typeof C=="string"){var X=wh(C);if(X)return new Tl(X[0]/255*X[3],X[1]/255*X[3],X[2]/255*X[3],X[3])}}},Tl.prototype.toString=function(){var C=this.toArray(),X=C[0],se=C[1],Te=C[2],De=C[3];return"rgba("+Math.round(X)+","+Math.round(se)+","+Math.round(Te)+","+De+")"},Tl.prototype.toArray=function(){var C=this,X=C.r,se=C.g,Te=C.b,De=C.a;return De===0?[0,0,0,0]:[X*255/De,se*255/De,Te*255/De,De]},Tl.black=new Tl(0,0,0,1),Tl.white=new Tl(1,1,1,1),Tl.transparent=new Tl(0,0,0,0),Tl.red=new Tl(1,0,0,1);var Dc=function(C,X,se){C?this.sensitivity=X?"variant":"case":this.sensitivity=X?"accent":"base",this.locale=se,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Dc.prototype.compare=function(C,X){return this.collator.compare(C,X)},Dc.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var zh=function(C,X,se,Te,De){this.text=C,this.image=X,this.scale=se,this.fontStack=Te,this.textColor=De},oc=function(C){this.sections=C};oc.fromString=function(C){return new oc([new zh(C,null,null,null,null)])},oc.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(C){return C.text.length!==0||C.image&&C.image.name.length!==0})},oc.factory=function(C){return C instanceof oc?C:oc.fromString(C)},oc.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(C){return C.text}).join("")},oc.prototype.serialize=function(){for(var C=["format"],X=0,se=this.sections;X=0&&k<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof X=="number"&&X>=0&&X<=255)){var Te=typeof se=="number"?[k,C,X,se]:[k,C,X];return"Invalid rgba value ["+Te.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof se>"u"||typeof se=="number"&&se>=0&&se<=1?null:"Invalid rgba value ["+[k,C,X,se].join(", ")+"]: 'a' must be between 0 and 1."}function nf(k){if(k===null)return!0;if(typeof k=="string")return!0;if(typeof k=="boolean")return!0;if(typeof k=="number")return!0;if(k instanceof Tl)return!0;if(k instanceof Dc)return!0;if(k instanceof oc)return!0;if(k instanceof Wu)return!0;if(Array.isArray(k)){for(var C=0,X=k;C2){var yt=C[1];if(typeof yt!="string"||!(yt in Mf)||yt==="object")return X.error('The item type argument of "array" must be one of string, number, boolean',1);He=Mf[yt],se++}else He=Io;var qt;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return X.error('The length argument to "array" must be a positive integer literal',2);qt=C[2],se++}Te=Nl(He,qt)}else Te=Mf[De];for(var nr=[];se1)&&X.push(Te)}}return X.concat(this.args.map(function(De){return De.serialize()}))};var Ff=function(C){this.type=Os,this.sections=C};Ff.parse=function(C,X){if(C.length<2)return X.error("Expected at least one argument.");var se=C[1];if(!Array.isArray(se)&&typeof se=="object")return X.error("First argument must be an image or text section.");for(var Te=[],De=!1,He=1;He<=C.length-1;++He){var yt=C[He];if(De&&typeof yt=="object"&&!Array.isArray(yt)){De=!1;var qt=null;if(yt["font-scale"]&&(qt=X.parse(yt["font-scale"],1,Qi),!qt))return null;var nr=null;if(yt["text-font"]&&(nr=X.parse(yt["text-font"],1,Nl(gs)),!nr))return null;var dr=null;if(yt["text-color"]&&(dr=X.parse(yt["text-color"],1,Xl),!dr))return null;var Fr=Te[Te.length-1];Fr.scale=qt,Fr.font=nr,Fr.textColor=dr}else{var rn=X.parse(C[He],1,Io);if(!rn)return null;var Kr=rn.type.kind;if(Kr!=="string"&&Kr!=="value"&&Kr!=="null"&&Kr!=="resolvedImage")return X.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");De=!0,Te.push({content:rn,scale:null,font:null,textColor:null})}}return new Ff(Te)},Ff.prototype.evaluate=function(C){var X=function(se){var Te=se.content.evaluate(C);return eu(Te)===wl?new zh("",Te,null,null,null):new zh($u(Te),null,se.scale?se.scale.evaluate(C):null,se.font?se.font.evaluate(C).join(","):null,se.textColor?se.textColor.evaluate(C):null)};return new oc(this.sections.map(X))},Ff.prototype.eachChild=function(C){for(var X=0,se=this.sections;X-1),se},fu.prototype.eachChild=function(C){C(this.input)},fu.prototype.outputDefined=function(){return!1},fu.prototype.serialize=function(){return["image",this.input.serialize()]};var Sd={"to-boolean":rs,"to-color":Xl,"to-number":Qi,"to-string":gs},Fs=function(C,X){this.type=C,this.args=X};Fs.parse=function(C,X){if(C.length<2)return X.error("Expected at least one argument.");var se=C[0];if((se==="to-boolean"||se==="to-string")&&C.length!==2)return X.error("Expected one argument.");for(var Te=Sd[se],De=[],He=1;He4?se="Invalid rbga value "+JSON.stringify(X)+": expected an array containing either three or four numeric values.":se=sc(X[0],X[1],X[2],X[3]),!se))return new Tl(X[0]/255,X[1]/255,X[2]/255,X[3])}throw new Dl(se||"Could not parse color from value '"+(typeof X=="string"?X:String(JSON.stringify(X)))+"'")}else if(this.type.kind==="number"){for(var qt=null,nr=0,dr=this.args;nr=C[2]||k[1]<=C[1]||k[3]>=C[3])}function fd(k,C){var X=Bf(k[0]),se=uh(k[1]),Te=Math.pow(2,C.z);return[Math.round(X*Te*Ou),Math.round(se*Te*Ou)]}function Hh(k,C,X){var se=k[0]-C[0],Te=k[1]-C[1],De=k[0]-X[0],He=k[1]-X[1];return se*He-De*Te===0&&se*De<=0&&Te*He<=0}function ch(k,C,X){return C[1]>k[1]!=X[1]>k[1]&&k[0]<(X[0]-C[0])*(k[1]-C[1])/(X[1]-C[1])+C[0]}function Nf(k,C){for(var X=!1,se=0,Te=C.length;se0&&Fr<0||dr<0&&Fr>0}function Gh(k,C,X,se){var Te=[C[0]-k[0],C[1]-k[1]],De=[se[0]-X[0],se[1]-X[1]];return Bh(De,Te)===0?!1:!!(of(k,C,X,se)&&of(X,se,k,C))}function Ef(k,C,X){for(var se=0,Te=X;seX[2]){var Te=se*.5,De=k[0]-X[0]>Te?-se:X[0]-k[0]>Te?se:0;De===0&&(De=k[0]-X[2]>Te?-se:X[2]-k[0]>Te?se:0),k[0]+=De}Oh(C,k)}function Th(k){k[0]=k[1]=1/0,k[2]=k[3]=-1/0}function Md(k,C,X,se){for(var Te=Math.pow(2,se.z)*Ou,De=[se.x*Ou,se.y*Ou],He=[],yt=0,qt=k;yt=0)return!1;var X=!0;return k.eachChild(function(se){X&&!Oc(se,C)&&(X=!1)}),X}var Uf=function(C,X){this.type=X.type,this.name=C,this.boundExpression=X};Uf.parse=function(C,X){if(C.length!==2||typeof C[1]!="string")return X.error("'var' expression requires exactly one string literal argument.");var se=C[1];return X.scope.has(se)?new Uf(se,X.scope.get(se)):X.error('Unknown variable "'+se+'". Make sure "'+se+'" has been bound in an enclosing "let" expression before using it.',1)},Uf.prototype.evaluate=function(C){return this.boundExpression.evaluate(C)},Uf.prototype.eachChild=function(){},Uf.prototype.outputDefined=function(){return!1},Uf.prototype.serialize=function(){return["var",this.name]};var tu=function(C,X,se,Te,De){X===void 0&&(X=[]),Te===void 0&&(Te=new cl),De===void 0&&(De=[]),this.registry=C,this.path=X,this.key=X.map(function(He){return"["+He+"]"}).join(""),this.scope=Te,this.errors=De,this.expectedType=se};tu.prototype.parse=function(C,X,se,Te,De){return De===void 0&&(De={}),X?this.concat(X,se,Te)._parse(C,De):this._parse(C,De)},tu.prototype._parse=function(C,X){(C===null||typeof C=="string"||typeof C=="boolean"||typeof C=="number")&&(C=["literal",C]);function se(dr,Fr,rn){return rn==="assert"?new wc(Fr,[dr]):rn==="coerce"?new Fs(Fr,[dr]):dr}if(Array.isArray(C)){if(C.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var Te=C[0];if(typeof Te!="string")return this.error("Expression name must be a string, but found "+typeof Te+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var De=this.registry[Te];if(De){var He=De.parse(C,this);if(!He)return null;if(this.expectedType){var yt=this.expectedType,qt=He.type;if((yt.kind==="string"||yt.kind==="number"||yt.kind==="boolean"||yt.kind==="object"||yt.kind==="array")&&qt.kind==="value")He=se(He,yt,X.typeAnnotation||"assert");else if((yt.kind==="color"||yt.kind==="formatted"||yt.kind==="resolvedImage")&&(qt.kind==="value"||qt.kind==="string"))He=se(He,yt,X.typeAnnotation||"coerce");else if(this.checkSubtype(yt,qt))return null}if(!(He instanceof Hs)&&He.type.kind!=="resolvedImage"&&kf(He)){var nr=new pl;try{He=new Hs(He.type,He.evaluate(nr))}catch(dr){return this.error(dr.message),null}}return He}return this.error('Unknown expression "'+Te+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof C>"u"?this.error("'undefined' value invalid. Use null instead."):typeof C=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof C+" instead.")},tu.prototype.concat=function(C,X,se){var Te=typeof C=="number"?this.path.concat(C):this.path,De=se?this.scope.concat(se):this.scope;return new tu(this.registry,Te,X||null,De,this.errors)},tu.prototype.error=function(C){for(var X=[],se=arguments.length-1;se-- >0;)X[se]=arguments[se+1];var Te=""+this.key+X.map(function(De){return"["+De+"]"}).join("");this.errors.push(new Zs(Te,C))},tu.prototype.checkSubtype=function(C,X){var se=df(C,X);return se&&this.error(se),se};function kf(k){if(k instanceof Uf)return kf(k.boundExpression);if(k instanceof Oo&&k.name==="error")return!1;if(k instanceof af)return!1;if(k instanceof zc)return!1;var C=k instanceof Fs||k instanceof wc,X=!0;return k.eachChild(function(se){C?X=X&&kf(se):X=X&&se instanceof Hs}),X?Zh(k)&&Oc(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function gc(k,C){for(var X=k.length-1,se=0,Te=X,De=0,He,yt;se<=Te;)if(De=Math.floor((se+Te)/2),He=k[De],yt=k[De+1],He<=C){if(De===X||CC)Te=De-1;else throw new Dl("Input is not a number.");return 0}var Fc=function(C,X,se){this.type=C,this.input=X,this.labels=[],this.outputs=[];for(var Te=0,De=se;Te=yt)return X.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',nr);var Fr=X.parse(qt,dr,De);if(!Fr)return null;De=De||Fr.type,Te.push([yt,Fr])}return new Fc(De,se,Te)},Fc.prototype.evaluate=function(C){var X=this.labels,se=this.outputs;if(X.length===1)return se[0].evaluate(C);var Te=this.input.evaluate(C);if(Te<=X[0])return se[0].evaluate(C);var De=X.length;if(Te>=X[De-1])return se[De-1].evaluate(C);var He=gc(X,Te);return se[He].evaluate(C)},Fc.prototype.eachChild=function(C){C(this.input);for(var X=0,se=this.outputs;X0&&C.push(this.labels[X]),C.push(this.outputs[X].serialize());return C};function hu(k,C,X){return k*(1-X)+C*X}function rh(k,C,X){return new Tl(hu(k.r,C.r,X),hu(k.g,C.g,X),hu(k.b,C.b,X),hu(k.a,C.a,X))}function pf(k,C,X){return k.map(function(se,Te){return hu(se,C[Te],X)})}var jf=Object.freeze({__proto__:null,number:hu,color:rh,array:pf}),Ah=.95047,Ed=1,tv=1.08883,nh=4/29,Sh=6/29,Yc=3*Sh*Sh,Mh=Sh*Sh*Sh,lc=Math.PI/180,ah=180/Math.PI;function Wh(k){return k>Mh?Math.pow(k,1/3):k/Yc+nh}function ih(k){return k>Sh?k*k*k:Yc*(k-nh)}function iu(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function Bc(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function sf(k){var C=Bc(k.r),X=Bc(k.g),se=Bc(k.b),Te=Wh((.4124564*C+.3575761*X+.1804375*se)/Ah),De=Wh((.2126729*C+.7151522*X+.072175*se)/Ed),He=Wh((.0193339*C+.119192*X+.9503041*se)/tv);return{l:116*De-16,a:500*(Te-De),b:200*(De-He),alpha:k.a}}function Uh(k){var C=(k.l+16)/116,X=isNaN(k.a)?C:C+k.a/500,se=isNaN(k.b)?C:C-k.b/200;return C=Ed*ih(C),X=Ah*ih(X),se=tv*ih(se),new Tl(iu(3.2404542*X-1.5371385*C-.4985314*se),iu(-.969266*X+1.8760108*C+.041556*se),iu(.0556434*X-.2040259*C+1.0572252*se),k.alpha)}function lu(k,C,X){return{l:hu(k.l,C.l,X),a:hu(k.a,C.a,X),b:hu(k.b,C.b,X),alpha:hu(k.alpha,C.alpha,X)}}function hh(k){var C=sf(k),X=C.l,se=C.a,Te=C.b,De=Math.atan2(Te,se)*ah;return{h:De<0?De+360:De,c:Math.sqrt(se*se+Te*Te),l:X,alpha:k.a}}function qf(k){var C=k.h*lc,X=k.c,se=k.l;return Uh({l:se,a:Math.cos(C)*X,b:Math.sin(C)*X,alpha:k.alpha})}function Zc(k,C,X){var se=C-k;return k+X*(se>180||se<-180?se-360*Math.round(se/360):se)}function dh(k,C,X){return{h:Zc(k.h,C.h,X),c:hu(k.c,C.c,X),l:hu(k.l,C.l,X),alpha:hu(k.alpha,C.alpha,X)}}var mf={forward:sf,reverse:Uh,interpolate:lu},vh={forward:hh,reverse:qf,interpolate:dh},kd=Object.freeze({__proto__:null,lab:mf,hcl:vh}),hc=function(C,X,se,Te,De){this.type=C,this.operator=X,this.interpolation=se,this.input=Te,this.labels=[],this.outputs=[];for(var He=0,yt=De;He1}))return X.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Te={name:"cubic-bezier",controlPoints:qt}}else return X.error("Unknown interpolation type "+String(Te[0]),1,0);if(C.length-1<4)return X.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return X.error("Expected an even number of arguments.");if(De=X.parse(De,2,Qi),!De)return null;var nr=[],dr=null;se==="interpolate-hcl"||se==="interpolate-lab"?dr=Xl:X.expectedType&&X.expectedType.kind!=="value"&&(dr=X.expectedType);for(var Fr=0;Fr=rn)return X.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',bn);var ja=X.parse(Kr,Kn,dr);if(!ja)return null;dr=dr||ja.type,nr.push([rn,ja])}return dr.kind!=="number"&&dr.kind!=="color"&&!(dr.kind==="array"&&dr.itemType.kind==="number"&&typeof dr.N=="number")?X.error("Type "+Vl(dr)+" is not interpolatable."):new hc(dr,se,Te,De,nr)},hc.prototype.evaluate=function(C){var X=this.labels,se=this.outputs;if(X.length===1)return se[0].evaluate(C);var Te=this.input.evaluate(C);if(Te<=X[0])return se[0].evaluate(C);var De=X.length;if(Te>=X[De-1])return se[De-1].evaluate(C);var He=gc(X,Te),yt=X[He],qt=X[He+1],nr=hc.interpolationFactor(this.interpolation,Te,yt,qt),dr=se[He].evaluate(C),Fr=se[He+1].evaluate(C);return this.operator==="interpolate"?jf[this.type.kind.toLowerCase()](dr,Fr,nr):this.operator==="interpolate-hcl"?vh.reverse(vh.interpolate(vh.forward(dr),vh.forward(Fr),nr)):mf.reverse(mf.interpolate(mf.forward(dr),mf.forward(Fr),nr))},hc.prototype.eachChild=function(C){C(this.input);for(var X=0,se=this.outputs;X=se.length)throw new Dl("Array index out of bounds: "+X+" > "+(se.length-1)+".");if(X!==Math.floor(X))throw new Dl("Array index must be an integer, but found "+X+" instead.");return se[X]},gf.prototype.eachChild=function(C){C(this.index),C(this.input)},gf.prototype.outputDefined=function(){return!1},gf.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Su=function(C,X){this.type=rs,this.needle=C,this.haystack=X};Su.parse=function(C,X){if(C.length!==3)return X.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1,Io),Te=X.parse(C[2],2,Io);return!se||!Te?null:Xc(se.type,[rs,gs,Qi,Au,Io])?new Su(se,Te):X.error("Expected first argument to be of type boolean, string, number or null, but found "+Vl(se.type)+" instead")},Su.prototype.evaluate=function(C){var X=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!se)return!1;if(!rf(X,["boolean","string","number","null"]))throw new Dl("Expected first argument to be of type boolean, string, number or null, but found "+Vl(eu(X))+" instead.");if(!rf(se,["string","array"]))throw new Dl("Expected second argument to be of type array or string, but found "+Vl(eu(se))+" instead.");return se.indexOf(X)>=0},Su.prototype.eachChild=function(C){C(this.needle),C(this.haystack)},Su.prototype.outputDefined=function(){return!0},Su.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Tc=function(C,X,se){this.type=Qi,this.needle=C,this.haystack=X,this.fromIndex=se};Tc.parse=function(C,X){if(C.length<=2||C.length>=5)return X.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1,Io),Te=X.parse(C[2],2,Io);if(!se||!Te)return null;if(!Xc(se.type,[rs,gs,Qi,Au,Io]))return X.error("Expected first argument to be of type boolean, string, number or null, but found "+Vl(se.type)+" instead");if(C.length===4){var De=X.parse(C[3],3,Qi);return De?new Tc(se,Te,De):null}else return new Tc(se,Te)},Tc.prototype.evaluate=function(C){var X=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!rf(X,["boolean","string","number","null"]))throw new Dl("Expected first argument to be of type boolean, string, number or null, but found "+Vl(eu(X))+" instead.");if(!rf(se,["string","array"]))throw new Dl("Expected second argument to be of type array or string, but found "+Vl(eu(se))+" instead.");if(this.fromIndex){var Te=this.fromIndex.evaluate(C);return se.indexOf(X,Te)}return se.indexOf(X)},Tc.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},Tc.prototype.outputDefined=function(){return!1},Tc.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var C=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),C]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pu=function(C,X,se,Te,De,He){this.inputType=C,this.type=X,this.input=se,this.cases=Te,this.outputs=De,this.otherwise=He};pu.parse=function(C,X){if(C.length<5)return X.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if(C.length%2!==1)return X.error("Expected an even number of arguments.");var se,Te;X.expectedType&&X.expectedType.kind!=="value"&&(Te=X.expectedType);for(var De={},He=[],yt=2;ytNumber.MAX_SAFE_INTEGER)return dr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Kr=="number"&&Math.floor(Kr)!==Kr)return dr.error("Numeric branch labels must be integer values.");if(!se)se=eu(Kr);else if(dr.checkSubtype(se,eu(Kr)))return null;if(typeof De[String(Kr)]<"u")return dr.error("Branch labels must be unique.");De[String(Kr)]=He.length}var bn=X.parse(nr,yt,Te);if(!bn)return null;Te=Te||bn.type,He.push(bn)}var Kn=X.parse(C[1],1,Io);if(!Kn)return null;var ja=X.parse(C[C.length-1],C.length-1,Te);return!ja||Kn.type.kind!=="value"&&X.concat(1).checkSubtype(se,Kn.type)?null:new pu(se,Te,Kn,De,He,ja)},pu.prototype.evaluate=function(C){var X=this.input.evaluate(C),se=eu(X)===this.inputType&&this.outputs[this.cases[X]]||this.otherwise;return se.evaluate(C)},pu.prototype.eachChild=function(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)},pu.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})&&this.otherwise.outputDefined()},pu.prototype.serialize=function(){for(var C=this,X=["match",this.input.serialize()],se=Object.keys(this.cases).sort(),Te=[],De={},He=0,yt=se;He=5)return X.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1,Io),Te=X.parse(C[2],2,Qi);if(!se||!Te)return null;if(!Xc(se.type,[Nl(Io),gs,Io]))return X.error("Expected first argument to be of type array or string, but found "+Vl(se.type)+" instead");if(C.length===4){var De=X.parse(C[3],3,Qi);return De?new yf(se.type,se,Te,De):null}else return new yf(se.type,se,Te)},yf.prototype.evaluate=function(C){var X=this.input.evaluate(C),se=this.beginIndex.evaluate(C);if(!rf(X,["string","array"]))throw new Dl("Expected first argument to be of type array or string, but found "+Vl(eu(X))+" instead.");if(this.endIndex){var Te=this.endIndex.evaluate(C);return X.slice(se,Te)}return X.slice(se)},yf.prototype.eachChild=function(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)},yf.prototype.outputDefined=function(){return!1},yf.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var C=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),C]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function jh(k,C){return k==="=="||k==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function cr(k,C,X){return C===X}function Rr(k,C,X){return C!==X}function pn(k,C,X){return CX}function On(k,C,X){return C<=X}function Aa(k,C,X){return C>=X}function xa(k,C,X,se){return se.compare(C,X)===0}function ti(k,C,X,se){return!xa(k,C,X,se)}function li(k,C,X,se){return se.compare(C,X)<0}function Ni(k,C,X,se){return se.compare(C,X)>0}function Ha(k,C,X,se){return se.compare(C,X)<=0}function bi(k,C,X,se){return se.compare(C,X)>=0}function Qa(k,C,X){var se=k!=="=="&&k!=="!=";return(function(){function Te(De,He,yt){this.type=rs,this.lhs=De,this.rhs=He,this.collator=yt,this.hasUntypedArgument=De.type.kind==="value"||He.type.kind==="value"}return Te.parse=function(He,yt){if(He.length!==3&&He.length!==4)return yt.error("Expected two or three arguments.");var qt=He[0],nr=yt.parse(He[1],1,Io);if(!nr)return null;if(!jh(qt,nr.type))return yt.concat(1).error('"'+qt+`" comparisons are not supported for type '`+Vl(nr.type)+"'.");var dr=yt.parse(He[2],2,Io);if(!dr)return null;if(!jh(qt,dr.type))return yt.concat(2).error('"'+qt+`" comparisons are not supported for type '`+Vl(dr.type)+"'.");if(nr.type.kind!==dr.type.kind&&nr.type.kind!=="value"&&dr.type.kind!=="value")return yt.error("Cannot compare types '"+Vl(nr.type)+"' and '"+Vl(dr.type)+"'.");se&&(nr.type.kind==="value"&&dr.type.kind!=="value"?nr=new wc(dr.type,[nr]):nr.type.kind!=="value"&&dr.type.kind==="value"&&(dr=new wc(nr.type,[dr])));var Fr=null;if(He.length===4){if(nr.type.kind!=="string"&&dr.type.kind!=="string"&&nr.type.kind!=="value"&&dr.type.kind!=="value")return yt.error("Cannot use collator to compare non-string types.");if(Fr=yt.parse(He[3],3,vu),!Fr)return null}return new Te(nr,dr,Fr)},Te.prototype.evaluate=function(He){var yt=this.lhs.evaluate(He),qt=this.rhs.evaluate(He);if(se&&this.hasUntypedArgument){var nr=eu(yt),dr=eu(qt);if(nr.kind!==dr.kind||!(nr.kind==="string"||nr.kind==="number"))throw new Dl('Expected arguments for "'+k+'" to be (string, string) or (number, number), but found ('+nr.kind+", "+dr.kind+") instead.")}if(this.collator&&!se&&this.hasUntypedArgument){var Fr=eu(yt),rn=eu(qt);if(Fr.kind!=="string"||rn.kind!=="string")return C(He,yt,qt)}return this.collator?X(He,yt,qt,this.collator.evaluate(He)):C(He,yt,qt)},Te.prototype.eachChild=function(He){He(this.lhs),He(this.rhs),this.collator&&He(this.collator)},Te.prototype.outputDefined=function(){return!0},Te.prototype.serialize=function(){var He=[k];return this.eachChild(function(yt){He.push(yt.serialize())}),He},Te})()}var Na=Qa("==",cr,xa),Yi=Qa("!=",Rr,ti),No=Qa("<",pn,li),Do=Qa(">",an,Ni),Go=Qa("<=",On,Ha),jo=Qa(">=",Aa,bi),Wi=function(C,X,se,Te,De){this.type=gs,this.number=C,this.locale=X,this.currency=se,this.minFractionDigits=Te,this.maxFractionDigits=De};Wi.parse=function(C,X){if(C.length!==3)return X.error("Expected two arguments.");var se=X.parse(C[1],1,Qi);if(!se)return null;var Te=C[2];if(typeof Te!="object"||Array.isArray(Te))return X.error("NumberFormat options argument must be an object.");var De=null;if(Te.locale&&(De=X.parse(Te.locale,1,gs),!De))return null;var He=null;if(Te.currency&&(He=X.parse(Te.currency,1,gs),!He))return null;var yt=null;if(Te["min-fraction-digits"]&&(yt=X.parse(Te["min-fraction-digits"],1,Qi),!yt))return null;var qt=null;return Te["max-fraction-digits"]&&(qt=X.parse(Te["max-fraction-digits"],1,Qi),!qt)?null:new Wi(se,De,He,yt,qt)},Wi.prototype.evaluate=function(C){return new Intl.NumberFormat(this.locale?this.locale.evaluate(C):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(C):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(C):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(C):void 0}).format(this.number.evaluate(C))},Wi.prototype.eachChild=function(C){C(this.number),this.locale&&C(this.locale),this.currency&&C(this.currency),this.minFractionDigits&&C(this.minFractionDigits),this.maxFractionDigits&&C(this.maxFractionDigits)},Wi.prototype.outputDefined=function(){return!1},Wi.prototype.serialize=function(){var C={};return this.locale&&(C.locale=this.locale.serialize()),this.currency&&(C.currency=this.currency.serialize()),this.minFractionDigits&&(C["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(C["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),C]};var Li=function(C){this.type=Qi,this.input=C};Li.parse=function(C,X){if(C.length!==2)return X.error("Expected 1 argument, but found "+(C.length-1)+" instead.");var se=X.parse(C[1],1);return se?se.type.kind!=="array"&&se.type.kind!=="string"&&se.type.kind!=="value"?X.error("Expected argument of type string or array, but found "+Vl(se.type)+" instead."):new Li(se):null},Li.prototype.evaluate=function(C){var X=this.input.evaluate(C);if(typeof X=="string")return X.length;if(Array.isArray(X))return X.length;throw new Dl("Expected value to be of type string or array, but found "+Vl(eu(X))+" instead.")},Li.prototype.eachChild=function(C){C(this.input)},Li.prototype.outputDefined=function(){return!1},Li.prototype.serialize=function(){var C=["length"];return this.eachChild(function(X){C.push(X.serialize())}),C};var ns={"==":Na,"!=":Yi,">":Do,"<":No,">=":jo,"<=":Go,array:wc,at:gf,boolean:wc,case:Vf,coalesce:Wc,collator:af,format:Ff,image:fu,in:Su,"index-of":Tc,interpolate:hc,"interpolate-hcl":hc,"interpolate-lab":hc,length:Li,let:Cf,literal:Hs,match:pu,number:wc,"number-format":Wi,object:wc,slice:yf,step:Fc,string:wc,"to-boolean":Fs,"to-color":Fs,"to-number":Fs,"to-string":Fs,var:Uf,within:zc};function Bs(k,C){var X=C[0],se=C[1],Te=C[2],De=C[3];X=X.evaluate(k),se=se.evaluate(k),Te=Te.evaluate(k);var He=De?De.evaluate(k):1,yt=sc(X,se,Te,He);if(yt)throw new Dl(yt);return new Tl(X/255*He,se/255*He,Te/255*He,He)}function Al(k,C){return k in C}function Zl(k,C){var X=C[k];return typeof X>"u"?null:X}function Ml(k,C,X,se){for(;X<=se;){var Te=X+se>>1;if(C[Te]===k)return!0;C[Te]>k?se=Te-1:X=Te+1}return!1}function Wl(k){return{type:k}}Oo.register(ns,{error:[cu,[gs],function(k,C){var X=C[0];throw new Dl(X.evaluate(k))}],typeof:[gs,[Io],function(k,C){var X=C[0];return Vl(eu(X.evaluate(k)))}],"to-rgba":[Nl(Qi,4),[Xl],function(k,C){var X=C[0];return X.evaluate(k).toArray()}],rgb:[Xl,[Qi,Qi,Qi],Bs],rgba:[Xl,[Qi,Qi,Qi,Qi],Bs],has:{type:rs,overloads:[[[gs],function(k,C){var X=C[0];return Al(X.evaluate(k),k.properties())}],[[gs,Yl],function(k,C){var X=C[0],se=C[1];return Al(X.evaluate(k),se.evaluate(k))}]]},get:{type:Io,overloads:[[[gs],function(k,C){var X=C[0];return Zl(X.evaluate(k),k.properties())}],[[gs,Yl],function(k,C){var X=C[0],se=C[1];return Zl(X.evaluate(k),se.evaluate(k))}]]},"feature-state":[Io,[gs],function(k,C){var X=C[0];return Zl(X.evaluate(k),k.featureState||{})}],properties:[Yl,[],function(k){return k.properties()}],"geometry-type":[gs,[],function(k){return k.geometryType()}],id:[Io,[],function(k){return k.id()}],zoom:[Qi,[],function(k){return k.globals.zoom}],"heatmap-density":[Qi,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[Qi,[],function(k){return k.globals.lineProgress||0}],accumulated:[Io,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[Qi,Wl(Qi),function(k,C){for(var X=0,se=0,Te=C;se":[rs,[gs,Io],function(k,C){var X=C[0],se=C[1],Te=k.properties()[X.value],De=se.value;return typeof Te==typeof De&&Te>De}],"filter-id->":[rs,[Io],function(k,C){var X=C[0],se=k.id(),Te=X.value;return typeof se==typeof Te&&se>Te}],"filter-<=":[rs,[gs,Io],function(k,C){var X=C[0],se=C[1],Te=k.properties()[X.value],De=se.value;return typeof Te==typeof De&&Te<=De}],"filter-id-<=":[rs,[Io],function(k,C){var X=C[0],se=k.id(),Te=X.value;return typeof se==typeof Te&&se<=Te}],"filter->=":[rs,[gs,Io],function(k,C){var X=C[0],se=C[1],Te=k.properties()[X.value],De=se.value;return typeof Te==typeof De&&Te>=De}],"filter-id->=":[rs,[Io],function(k,C){var X=C[0],se=k.id(),Te=X.value;return typeof se==typeof Te&&se>=Te}],"filter-has":[rs,[Io],function(k,C){var X=C[0];return X.value in k.properties()}],"filter-has-id":[rs,[],function(k){return k.id()!==null&&k.id()!==void 0}],"filter-type-in":[rs,[Nl(gs)],function(k,C){var X=C[0];return X.value.indexOf(k.geometryType())>=0}],"filter-id-in":[rs,[Nl(Io)],function(k,C){var X=C[0];return X.value.indexOf(k.id())>=0}],"filter-in-small":[rs,[gs,Nl(Io)],function(k,C){var X=C[0],se=C[1];return se.value.indexOf(k.properties()[X.value])>=0}],"filter-in-large":[rs,[gs,Nl(Io)],function(k,C){var X=C[0],se=C[1];return Ml(k.properties()[X.value],se.value,0,se.value.length-1)}],all:{type:rs,overloads:[[[rs,rs],function(k,C){var X=C[0],se=C[1];return X.evaluate(k)&&se.evaluate(k)}],[Wl(rs),function(k,C){for(var X=0,se=C;X-1}function yo(k){return!!k.expression&&k.expression.interpolated}function ys(k){return k instanceof Number?"number":k instanceof String?"string":k instanceof Boolean?"boolean":Array.isArray(k)?"array":k===null?"null":typeof k}function zl(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function ml(k){return k}function yc(k,C){var X=C.type==="color",se=k.stops&&typeof k.stops[0][0]=="object",Te=se||k.property!==void 0,De=se||!Te,He=k.type||(yo(C)?"exponential":"interval");if(X&&(k=Ps({},k),k.stops&&(k.stops=k.stops.map(function(mo){return[mo[0],Tl.parse(mo[1])]})),k.default?k.default=Tl.parse(k.default):k.default=Tl.parse(C.default)),k.colorSpace&&k.colorSpace!=="rgb"&&!kd[k.colorSpace])throw new Error("Unknown color space: "+k.colorSpace);var yt,qt,nr;if(He==="exponential")yt=xc;else if(He==="interval")yt=$f;else if(He==="categorical"){yt=Ac,qt=Object.create(null);for(var dr=0,Fr=k.stops;dr=k.stops[se-1][0])return k.stops[se-1][1];var Te=gc(k.stops.map(function(De){return De[0]}),X);return k.stops[Te][1]}function xc(k,C,X){var se=k.base!==void 0?k.base:1;if(ys(X)!=="number")return _c(k.default,C.default);var Te=k.stops.length;if(Te===1||X<=k.stops[0][0])return k.stops[0][1];if(X>=k.stops[Te-1][0])return k.stops[Te-1][1];var De=gc(k.stops.map(function(Fr){return Fr[0]}),X),He=Lu(X,se,k.stops[De][0],k.stops[De+1][0]),yt=k.stops[De][1],qt=k.stops[De+1][1],nr=jf[C.type]||ml;if(k.colorSpace&&k.colorSpace!=="rgb"){var dr=kd[k.colorSpace];nr=function(Fr,rn){return dr.reverse(dr.interpolate(dr.forward(Fr),dr.forward(rn),He))}}return typeof yt.evaluate=="function"?{evaluate:function(){for(var rn=[],Kr=arguments.length;Kr--;)rn[Kr]=arguments[Kr];var bn=yt.evaluate.apply(void 0,rn),Kn=qt.evaluate.apply(void 0,rn);if(!(bn===void 0||Kn===void 0))return nr(bn,Kn,He)}}:nr(yt,qt,He)}function Lf(k,C,X){return C.type==="color"?X=Tl.parse(X):C.type==="formatted"?X=oc.fromString(X.toString()):C.type==="resolvedImage"?X=Wu.fromString(X.toString()):ys(X)!==C.type&&(C.type!=="enum"||!C.values[X])&&(X=void 0),_c(X,k.default,C.default)}function Lu(k,C,X,se){var Te=se-X,De=k-X;return Te===0?0:C===1?De/Te:(Math.pow(C,De)-1)/(Math.pow(C,Te)-1)}var Pf=function(C,X){this.expression=C,this._warningHistory={},this._evaluator=new pl,this._defaultValue=X?Ce(X):null,this._enumValues=X&&X.type==="enum"?X.values:null};Pf.prototype.evaluateWithoutErrorHandling=function(C,X,se,Te,De,He){return this._evaluator.globals=C,this._evaluator.feature=X,this._evaluator.featureState=se,this._evaluator.canonical=Te,this._evaluator.availableImages=De||null,this._evaluator.formattedSection=He,this.expression.evaluate(this._evaluator)},Pf.prototype.evaluate=function(C,X,se,Te,De,He){this._evaluator.globals=C,this._evaluator.feature=X||null,this._evaluator.featureState=se||null,this._evaluator.canonical=Te,this._evaluator.availableImages=De||null,this._evaluator.formattedSection=He||null;try{var yt=this.expression.evaluate(this._evaluator);if(yt==null||typeof yt=="number"&&yt!==yt)return this._defaultValue;if(this._enumValues&&!(yt in this._enumValues))throw new Dl("Expected value to be one of "+Object.keys(this._enumValues).map(function(qt){return JSON.stringify(qt)}).join(", ")+", but found "+JSON.stringify(yt)+" instead.");return yt}catch(qt){return this._warningHistory[qt.message]||(this._warningHistory[qt.message]=!0,typeof console<"u"&&console.warn(qt.message)),this._defaultValue}};function Xo(k){return Array.isArray(k)&&k.length>0&&typeof k[0]=="string"&&k[0]in ns}function as(k,C){var X=new tu(ns,[],C?Me(C):void 0),se=X.parse(k,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return se?rl(new Pf(se,C)):Cu(X.errors)}var Rf=function(C,X){this.kind=C,this._styleExpression=X,this.isStateDependent=C!=="constant"&&!wu(X.expression)};Rf.prototype.evaluateWithoutErrorHandling=function(C,X,se,Te,De,He){return this._styleExpression.evaluateWithoutErrorHandling(C,X,se,Te,De,He)},Rf.prototype.evaluate=function(C,X,se,Te,De,He){return this._styleExpression.evaluate(C,X,se,Te,De,He)};var $c=function(C,X,se,Te){this.kind=C,this.zoomStops=se,this._styleExpression=X,this.isStateDependent=C!=="camera"&&!wu(X.expression),this.interpolationType=Te};$c.prototype.evaluateWithoutErrorHandling=function(C,X,se,Te,De,He){return this._styleExpression.evaluateWithoutErrorHandling(C,X,se,Te,De,He)},$c.prototype.evaluate=function(C,X,se,Te,De,He){return this._styleExpression.evaluate(C,X,se,Te,De,He)},$c.prototype.interpolationFactor=function(C,X,se){return this.interpolationType?hc.interpolationFactor(this.interpolationType,C,X,se):0};function Nc(k,C){if(k=as(k,C),k.result==="error")return k;var X=k.value.expression,se=Zh(X);if(!se&&!Mu(C))return Cu([new Zs("","data expressions not supported")]);var Te=Oc(X,["zoom"]);if(!Te&&!Hl(C))return Cu([new Zs("","zoom expressions not supported")]);var De=oe(X);if(!De&&!Te)return Cu([new Zs("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(De instanceof Zs)return Cu([De]);if(De instanceof hc&&!yo(C))return Cu([new Zs("",'"interpolate" expressions cannot be used with this property')]);if(!De)return rl(se?new Rf("constant",k.value):new Rf("source",k.value));var He=De instanceof hc?De.interpolation:void 0;return rl(se?new $c("camera",k.value,De.labels,He):new $c("composite",k.value,De.labels,He))}var Ue=function(C,X){this._parameters=C,this._specification=X,Ps(this,yc(this._parameters,this._specification))};Ue.deserialize=function(C){return new Ue(C._parameters,C._specification)},Ue.serialize=function(C){return{_parameters:C._parameters,_specification:C._specification}};function P(k,C){if(zl(k))return new Ue(k,C);if(Xo(k)){var X=Nc(k,C);if(X.result==="error")throw new Error(X.value.map(function(Te){return Te.key+": "+Te.message}).join(", "));return X.value}else{var se=k;return typeof k=="string"&&C.type==="color"&&(se=Tl.parse(k)),{kind:"constant",evaluate:function(){return se}}}}function oe(k){var C=null;if(k instanceof Cf)C=oe(k.result);else if(k instanceof Wc)for(var X=0,se=k.args;Xse.maximum?[new to(C,X,X+" is greater than the maximum value "+se.maximum)]:[]}function Xt(k){var C=k.valueSpec,X=Fo(k.value.type),se,Te={},De,He,yt=X!=="categorical"&&k.value.property===void 0,qt=!yt,nr=ys(k.value.stops)==="array"&&ys(k.value.stops[0])==="array"&&ys(k.value.stops[0][0])==="object",dr=Be({key:k.key,value:k.value,valueSpec:k.styleSpec.function,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{stops:Fr,default:bn}});return X==="identity"&&yt&&dr.push(new to(k.key,k.value,'missing required property "property"')),X!=="identity"&&!k.value.stops&&dr.push(new to(k.key,k.value,'missing required property "stops"')),X==="exponential"&&k.valueSpec.expression&&!yo(k.valueSpec)&&dr.push(new to(k.key,k.value,"exponential functions not supported")),k.styleSpec.$version>=8&&(qt&&!Mu(k.valueSpec)?dr.push(new to(k.key,k.value,"property functions not supported")):yt&&!Hl(k.valueSpec)&&dr.push(new to(k.key,k.value,"zoom functions not supported"))),(X==="categorical"||nr)&&k.value.property===void 0&&dr.push(new to(k.key,k.value,'"property" property is required')),dr;function Fr(Kn){if(X==="identity")return[new to(Kn.key,Kn.value,'identity function may not have a "stops" property')];var ja=[],wa=Kn.value;return ja=ja.concat(_t({key:Kn.key,value:wa,valueSpec:Kn.valueSpec,style:Kn.style,styleSpec:Kn.styleSpec,arrayElementValidator:rn})),ys(wa)==="array"&&wa.length===0&&ja.push(new to(Kn.key,wa,"array must have at least one stop")),ja}function rn(Kn){var ja=[],wa=Kn.value,mi=Kn.key;if(ys(wa)!=="array")return[new to(mi,wa,"array expected, "+ys(wa)+" found")];if(wa.length!==2)return[new to(mi,wa,"array length 2 expected, length "+wa.length+" found")];if(nr){if(ys(wa[0])!=="object")return[new to(mi,wa,"object expected, "+ys(wa[0])+" found")];if(wa[0].zoom===void 0)return[new to(mi,wa,"object stop key must have zoom")];if(wa[0].value===void 0)return[new to(mi,wa,"object stop key must have value")];if(He&&He>Fo(wa[0].zoom))return[new to(mi,wa[0].zoom,"stop zoom values must appear in ascending order")];Fo(wa[0].zoom)!==He&&(He=Fo(wa[0].zoom),De=void 0,Te={}),ja=ja.concat(Be({key:mi+"[0]",value:wa[0],valueSpec:{zoom:{}},style:Kn.style,styleSpec:Kn.styleSpec,objectElementValidators:{zoom:kt,value:Kr}}))}else ja=ja.concat(Kr({key:mi+"[0]",value:wa[0],style:Kn.style,styleSpec:Kn.styleSpec},wa));return Xo(Il(wa[1]))?ja.concat([new to(mi+"[1]",wa[1],"expressions are not allowed in function stops.")]):ja.concat(Js({key:mi+"[1]",value:wa[1],valueSpec:C,style:Kn.style,styleSpec:Kn.styleSpec}))}function Kr(Kn,ja){var wa=ys(Kn.value),mi=Fo(Kn.value),Ja=Kn.value!==null?Kn.value:ja;if(!se)se=wa;else if(wa!==se)return[new to(Kn.key,Ja,wa+" stop domain type must match previous stop domain type "+se)];if(wa!=="number"&&wa!=="string"&&wa!=="boolean")return[new to(Kn.key,Ja,"stop domain value must be a number, string, or boolean")];if(wa!=="number"&&X!=="categorical"){var vi="number expected, "+wa+" found";return Mu(C)&&X===void 0&&(vi+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new to(Kn.key,Ja,vi)]}return X==="categorical"&&wa==="number"&&(!isFinite(mi)||Math.floor(mi)!==mi)?[new to(Kn.key,Ja,"integer expected, found "+mi)]:X!=="categorical"&&wa==="number"&&De!==void 0&&mi=2&&k[1]!=="$id"&&k[1]!=="$type";case"in":return k.length>=3&&(typeof k[1]!="string"||Array.isArray(k[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return k.length!==3||Array.isArray(k[1])||Array.isArray(k[2]);case"any":case"all":for(var C=0,X=k.slice(1);CC?1:0}function bt(k){if(!Array.isArray(k))return!1;if(k[0]==="within")return!0;for(var C=1;C"||C==="<="||C===">="?Et(k[1],k[2],C):C==="any"?Ut(k.slice(1)):C==="all"?["all"].concat(k.slice(1).map(zt)):C==="none"?["all"].concat(k.slice(1).map(zt).map(Pr)):C==="in"?gr(k[1],k.slice(2)):C==="!in"?Pr(gr(k[1],k.slice(2))):C==="has"?Tr(k[1]):C==="!has"?Pr(Tr(k[1])):C==="within"?k:!0;return X}function Et(k,C,X){switch(k){case"$type":return["filter-type-"+X,C];case"$id":return["filter-id-"+X,C];default:return["filter-"+X,k,C]}}function Ut(k){return["any"].concat(k.map(zt))}function gr(k,C){if(C.length===0)return!1;switch(k){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some(function(X){return typeof X!=typeof C[0]})?["filter-in-large",k,["literal",C.sort(vt)]]:["filter-in-small",k,["literal",C]]}}function Tr(k){switch(k){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",k]}}function Pr(k){return["!",k]}function Yr(k){return xn(Il(k.value))?fr(Ps({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):sn(k)}function sn(k){var C=k.value,X=k.key;if(ys(C)!=="array")return[new to(X,C,"array expected, "+ys(C)+" found")];var se=k.styleSpec,Te,De=[];if(C.length<1)return[new to(X,C,"filter array must have at least 1 element")];switch(De=De.concat(tn({key:X+"[0]",value:C[0],valueSpec:se.filter_operator,style:k.style,styleSpec:k.styleSpec})),Fo(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&Fo(C[1])==="$type"&&De.push(new to(X,C,'"$type" cannot be use with operator "'+C[0]+'"'));case"==":case"!=":C.length!==3&&De.push(new to(X,C,'filter array for operator "'+C[0]+'" must have 3 elements'));case"in":case"!in":C.length>=2&&(Te=ys(C[1]),Te!=="string"&&De.push(new to(X+"[1]",C[1],"string expected, "+Te+" found")));for(var He=2;He=dr[Kr+0]&&se>=dr[Kr+1])?(He[rn]=!0,De.push(nr[rn])):He[rn]=!1}}},rt.prototype._forEachCell=function(k,C,X,se,Te,De,He,yt){for(var qt=this._convertToCellCoord(k),nr=this._convertToCellCoord(C),dr=this._convertToCellCoord(X),Fr=this._convertToCellCoord(se),rn=qt;rn<=dr;rn++)for(var Kr=nr;Kr<=Fr;Kr++){var bn=this.d*Kr+rn;if(!(yt&&!yt(this._convertFromCellCoord(rn),this._convertFromCellCoord(Kr),this._convertFromCellCoord(rn+1),this._convertFromCellCoord(Kr+1)))&&Te.call(this,k,C,X,se,bn,De,He,yt))return}},rt.prototype._convertFromCellCoord=function(k){return(k-this.padding)/this.scale},rt.prototype._convertToCellCoord=function(k){return Math.max(0,Math.min(this.d-1,Math.floor(k*this.scale)+this.padding))},rt.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var k=this.cells,C=Oe+this.cells.length+1+1,X=0,se=0;se=0)){var Fr=k[dr];nr[dr]=It[qt].shallow.indexOf(dr)>=0?Fr:Xr(Fr,C)}k instanceof Error&&(nr.message=k.message)}if(nr.$name)throw new Error("$name property is reserved for worker serialization logic.");return qt!=="Object"&&(nr.$name=qt),nr}throw new Error("can't serialize object of type "+typeof k)}function dn(k){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp||_r(k)||Zr(k)||ArrayBuffer.isView(k)||k instanceof wt)return k;if(Array.isArray(k))return k.map(dn);if(typeof k=="object"){var C=k.$name||"Object",X=It[C],se=X.klass;if(!se)throw new Error("can't deserialize unregistered class "+C);if(se.deserialize)return se.deserialize(k);for(var Te=Object.create(se.prototype),De=0,He=Object.keys(k);De=0?qt:dn(qt)}}return Te}throw new Error("can't deserialize object of type "+typeof k)}var Mn=function(){this.first=!0};Mn.prototype.update=function(C,X){var se=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=se,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=se,!0):(this.lastFloorZoom>se?(this.lastIntegerZoom=se+1,this.lastIntegerZoomTime=X):this.lastFloorZoom=128&&k<=255},Arabic:function(k){return k>=1536&&k<=1791},"Arabic Supplement":function(k){return k>=1872&&k<=1919},"Arabic Extended-A":function(k){return k>=2208&&k<=2303},"Hangul Jamo":function(k){return k>=4352&&k<=4607},"Unified Canadian Aboriginal Syllabics":function(k){return k>=5120&&k<=5759},Khmer:function(k){return k>=6016&&k<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(k){return k>=6320&&k<=6399},"General Punctuation":function(k){return k>=8192&&k<=8303},"Letterlike Symbols":function(k){return k>=8448&&k<=8527},"Number Forms":function(k){return k>=8528&&k<=8591},"Miscellaneous Technical":function(k){return k>=8960&&k<=9215},"Control Pictures":function(k){return k>=9216&&k<=9279},"Optical Character Recognition":function(k){return k>=9280&&k<=9311},"Enclosed Alphanumerics":function(k){return k>=9312&&k<=9471},"Geometric Shapes":function(k){return k>=9632&&k<=9727},"Miscellaneous Symbols":function(k){return k>=9728&&k<=9983},"Miscellaneous Symbols and Arrows":function(k){return k>=11008&&k<=11263},"CJK Radicals Supplement":function(k){return k>=11904&&k<=12031},"Kangxi Radicals":function(k){return k>=12032&&k<=12255},"Ideographic Description Characters":function(k){return k>=12272&&k<=12287},"CJK Symbols and Punctuation":function(k){return k>=12288&&k<=12351},Hiragana:function(k){return k>=12352&&k<=12447},Katakana:function(k){return k>=12448&&k<=12543},Bopomofo:function(k){return k>=12544&&k<=12591},"Hangul Compatibility Jamo":function(k){return k>=12592&&k<=12687},Kanbun:function(k){return k>=12688&&k<=12703},"Bopomofo Extended":function(k){return k>=12704&&k<=12735},"CJK Strokes":function(k){return k>=12736&&k<=12783},"Katakana Phonetic Extensions":function(k){return k>=12784&&k<=12799},"Enclosed CJK Letters and Months":function(k){return k>=12800&&k<=13055},"CJK Compatibility":function(k){return k>=13056&&k<=13311},"CJK Unified Ideographs Extension A":function(k){return k>=13312&&k<=19903},"Yijing Hexagram Symbols":function(k){return k>=19904&&k<=19967},"CJK Unified Ideographs":function(k){return k>=19968&&k<=40959},"Yi Syllables":function(k){return k>=40960&&k<=42127},"Yi Radicals":function(k){return k>=42128&&k<=42191},"Hangul Jamo Extended-A":function(k){return k>=43360&&k<=43391},"Hangul Syllables":function(k){return k>=44032&&k<=55215},"Hangul Jamo Extended-B":function(k){return k>=55216&&k<=55295},"Private Use Area":function(k){return k>=57344&&k<=63743},"CJK Compatibility Ideographs":function(k){return k>=63744&&k<=64255},"Arabic Presentation Forms-A":function(k){return k>=64336&&k<=65023},"Vertical Forms":function(k){return k>=65040&&k<=65055},"CJK Compatibility Forms":function(k){return k>=65072&&k<=65103},"Small Form Variants":function(k){return k>=65104&&k<=65135},"Arabic Presentation Forms-B":function(k){return k>=65136&&k<=65279},"Halfwidth and Fullwidth Forms":function(k){return k>=65280&&k<=65519}};function La(k){for(var C=0,X=k;C=65097&&k<=65103)||Cn["CJK Compatibility Ideographs"](k)||Cn["CJK Compatibility"](k)||Cn["CJK Radicals Supplement"](k)||Cn["CJK Strokes"](k)||Cn["CJK Symbols and Punctuation"](k)&&!(k>=12296&&k<=12305)&&!(k>=12308&&k<=12319)&&k!==12336||Cn["CJK Unified Ideographs Extension A"](k)||Cn["CJK Unified Ideographs"](k)||Cn["Enclosed CJK Letters and Months"](k)||Cn["Hangul Compatibility Jamo"](k)||Cn["Hangul Jamo Extended-A"](k)||Cn["Hangul Jamo Extended-B"](k)||Cn["Hangul Jamo"](k)||Cn["Hangul Syllables"](k)||Cn.Hiragana(k)||Cn["Ideographic Description Characters"](k)||Cn.Kanbun(k)||Cn["Kangxi Radicals"](k)||Cn["Katakana Phonetic Extensions"](k)||Cn.Katakana(k)&&k!==12540||Cn["Halfwidth and Fullwidth Forms"](k)&&k!==65288&&k!==65289&&k!==65293&&!(k>=65306&&k<=65310)&&k!==65339&&k!==65341&&k!==65343&&!(k>=65371&&k<=65503)&&k!==65507&&!(k>=65512&&k<=65519)||Cn["Small Form Variants"](k)&&!(k>=65112&&k<=65118)&&!(k>=65123&&k<=65126)||Cn["Unified Canadian Aboriginal Syllabics"](k)||Cn["Unified Canadian Aboriginal Syllabics Extended"](k)||Cn["Vertical Forms"](k)||Cn["Yijing Hexagram Symbols"](k)||Cn["Yi Syllables"](k)||Cn["Yi Radicals"](k))}function Ra(k){return!!(Cn["Latin-1 Supplement"](k)&&(k===167||k===169||k===174||k===177||k===188||k===189||k===190||k===215||k===247)||Cn["General Punctuation"](k)&&(k===8214||k===8224||k===8225||k===8240||k===8241||k===8251||k===8252||k===8258||k===8263||k===8264||k===8265||k===8273)||Cn["Letterlike Symbols"](k)||Cn["Number Forms"](k)||Cn["Miscellaneous Technical"](k)&&(k>=8960&&k<=8967||k>=8972&&k<=8991||k>=8996&&k<=9e3||k===9003||k>=9085&&k<=9114||k>=9150&&k<=9165||k===9167||k>=9169&&k<=9179||k>=9186&&k<=9215)||Cn["Control Pictures"](k)&&k!==9251||Cn["Optical Character Recognition"](k)||Cn["Enclosed Alphanumerics"](k)||Cn["Geometric Shapes"](k)||Cn["Miscellaneous Symbols"](k)&&!(k>=9754&&k<=9759)||Cn["Miscellaneous Symbols and Arrows"](k)&&(k>=11026&&k<=11055||k>=11088&&k<=11097||k>=11192&&k<=11243)||Cn["CJK Symbols and Punctuation"](k)||Cn.Katakana(k)||Cn["Private Use Area"](k)||Cn["CJK Compatibility Forms"](k)||Cn["Small Form Variants"](k)||Cn["Halfwidth and Fullwidth Forms"](k)||k===8734||k===8756||k===8757||k>=9984&&k<=10087||k>=10102&&k<=10131||k===65532||k===65533)}function oa(k){return!(Sa(k)||Ra(k))}function ai(k){return Cn.Arabic(k)||Cn["Arabic Supplement"](k)||Cn["Arabic Extended-A"](k)||Cn["Arabic Presentation Forms-A"](k)||Cn["Arabic Presentation Forms-B"](k)}function Zi(k){return k>=1424&&k<=2303||Cn["Arabic Presentation Forms-A"](k)||Cn["Arabic Presentation Forms-B"](k)}function Di(k,C){return!(!C&&Zi(k)||k>=2304&&k<=3583||k>=3840&&k<=4255||Cn.Khmer(k))}function Vi(k){for(var C=0,X=k;C-1&&(Po=ko.error),Ws&&Ws(k)};function Iu(){ru.fire(new jr("pluginStateChange",{pluginStatus:Po,pluginURL:os}))}var ru=new Dr,lo=function(){return Po},Ls=function(k){return k({pluginStatus:Po,pluginURL:os}),ru.on("pluginStateChange",k),k},Qs=function(k,C,X){if(X===void 0&&(X=!1),Po===ko.deferred||Po===ko.loading||Po===ko.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");os=Se.resolveURL(k),Po=ko.deferred,Ws=C,Iu(),X||$l()},$l=function(){if(Po!==ko.deferred||!os)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Po=ko.loading,Iu(),os&&gn({url:os},function(k){k?nl(k):(Po=ko.loaded,Iu())})},Ol={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Po===ko.loaded||Ol.applyArabicShaping!=null},isLoading:function(){return Po===ko.loading},setState:function(C){Po=C.pluginStatus,os=C.pluginURL},isParsed:function(){return Ol.applyArabicShaping!=null&&Ol.processBidirectionalText!=null&&Ol.processStyledBidirectionalText!=null},getPluginURL:function(){return os}},Sc=function(){!Ol.isLoading()&&!Ol.isLoaded()&&lo()==="deferred"&&$l()},El=function(C,X){this.zoom=C,X?(this.now=X.now,this.fadeDuration=X.fadeDuration,this.zoomHistory=X.zoomHistory,this.transition=X.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Mn,this.transition={})};El.prototype.isSupportedScript=function(C){return _o(C,Ol.isLoaded())},El.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},El.prototype.getCrossfadeParameters=function(){var C=this.zoom,X=C-Math.floor(C),se=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:X+(1-X)*se}:{fromScale:.5,toScale:1,t:1-(1-se)*X}};var Kl=function(C,X){this.property=C,this.value=X,this.expression=P(X===void 0?C.specification.default:X,C.specification)};Kl.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Kl.prototype.possiblyEvaluate=function(C,X,se){return this.property.possiblyEvaluate(this,C,X,se)};var Kc=function(C){this.property=C,this.value=new Kl(C,void 0)};Kc.prototype.transitioned=function(C,X){return new mt(this.property,this.value,X,_({},C.transition,this.transition),C.now)},Kc.prototype.untransitioned=function(){return new mt(this.property,this.value,null,{},0)};var Pu=function(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)};Pu.prototype.getValue=function(C){return B(this._values[C].value.value)},Pu.prototype.setValue=function(C,X){this._values.hasOwnProperty(C)||(this._values[C]=new Kc(this._values[C].property)),this._values[C].value=new Kl(this._values[C].property,X===null?void 0:B(X))},Pu.prototype.getTransition=function(C){return B(this._values[C].transition)},Pu.prototype.setTransition=function(C,X){this._values.hasOwnProperty(C)||(this._values[C]=new Kc(this._values[C].property)),this._values[C].transition=B(X)||void 0},Pu.prototype.serialize=function(){for(var C={},X=0,se=Object.keys(this._values);Xthis.end)return this.prior=null,De;if(this.value.isDataDriven())return this.prior=null,De;if(TeHe.zoomHistory.lastIntegerZoom?{from:se,to:Te}:{from:De,to:Te}},C.prototype.interpolate=function(se){return se},C})(mn),Ia=function(C){this.specification=C};Ia.prototype.possiblyEvaluate=function(C,X,se,Te){if(C.value!==void 0)if(C.expression.kind==="constant"){var De=C.expression.evaluate(X,null,{},se,Te);return this._calculate(De,De,De,X)}else return this._calculate(C.expression.evaluate(new El(Math.floor(X.zoom-1),X)),C.expression.evaluate(new El(Math.floor(X.zoom),X)),C.expression.evaluate(new El(Math.floor(X.zoom+1),X)),X)},Ia.prototype._calculate=function(C,X,se,Te){var De=Te.zoom;return De>Te.zoomHistory.lastIntegerZoom?{from:C,to:X}:{from:se,to:X}},Ia.prototype.interpolate=function(C){return C};var Da=function(C){this.specification=C};Da.prototype.possiblyEvaluate=function(C,X,se,Te){return!!C.expression.evaluate(X,null,{},se,Te)},Da.prototype.interpolate=function(){return!1};var Za=function(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var X in C){var se=C[X];se.specification.overridable&&this.overridableProperties.push(X);var Te=this.defaultPropertyValues[X]=new Kl(se,void 0),De=this.defaultTransitionablePropertyValues[X]=new Kc(se);this.defaultTransitioningPropertyValues[X]=De.untransitioned(),this.defaultPossiblyEvaluatedValues[X]=Te.possiblyEvaluate({})}};tr("DataDrivenProperty",mn),tr("DataConstantProperty",yn),tr("CrossFadedDataDrivenProperty",za),tr("CrossFadedProperty",Ia),tr("ColorRampProperty",Da);var Fi="-transition",yi=(function(k){function C(X,se){if(k.call(this),this.id=X.id,this.type=X.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},X.type!=="custom"&&(X=X,this.metadata=X.metadata,this.minzoom=X.minzoom,this.maxzoom=X.maxzoom,X.type!=="background"&&(this.source=X.source,this.sourceLayer=X["source-layer"],this.filter=X.filter),se.layout&&(this._unevaluatedLayout=new wr(se.layout)),se.paint)){this._transitionablePaint=new Pu(se.paint);for(var Te in X.paint)this.setPaintProperty(Te,X.paint[Te],{validate:!1});for(var De in X.layout)this.setLayoutProperty(De,X.layout[De],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ca(se.paint)}}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},C.prototype.getLayoutProperty=function(se){return se==="visibility"?this.visibility:this._unevaluatedLayout.getValue(se)},C.prototype.setLayoutProperty=function(se,Te,De){if(De===void 0&&(De={}),Te!=null){var He="layers."+this.id+".layout."+se;if(this._validate(uc,He,se,Te,De))return}if(se==="visibility"){this.visibility=Te;return}this._unevaluatedLayout.setValue(se,Te)},C.prototype.getPaintProperty=function(se){return z(se,Fi)?this._transitionablePaint.getTransition(se.slice(0,-Fi.length)):this._transitionablePaint.getValue(se)},C.prototype.setPaintProperty=function(se,Te,De){if(De===void 0&&(De={}),Te!=null){var He="layers."+this.id+".paint."+se;if(this._validate(Ru,He,se,Te,De))return!1}if(z(se,Fi))return this._transitionablePaint.setTransition(se.slice(0,-Fi.length),Te||void 0),!1;var yt=this._transitionablePaint._values[se],qt=yt.property.specification["property-type"]==="cross-faded-data-driven",nr=yt.value.isDataDriven(),dr=yt.value;this._transitionablePaint.setValue(se,Te),this._handleSpecialPaintPropertyUpdate(se);var Fr=this._transitionablePaint._values[se].value,rn=Fr.isDataDriven();return rn||nr||qt||this._handleOverridablePaintPropertyUpdate(se,dr,Fr)},C.prototype._handleSpecialPaintPropertyUpdate=function(se){},C.prototype._handleOverridablePaintPropertyUpdate=function(se,Te,De){return!1},C.prototype.isHidden=function(se){return this.minzoom&&se=this.maxzoom?!0:this.visibility==="none"},C.prototype.updateTransitions=function(se){this._transitioningPaint=this._transitionablePaint.transitioned(se,this._transitioningPaint)},C.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},C.prototype.recalculate=function(se,Te){se.getCrossfadeParameters&&(this._crossfadeParameters=se.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(se,void 0,Te)),this.paint=this._transitioningPaint.possiblyEvaluate(se,void 0,Te)},C.prototype.serialize=function(){var se={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(se.layout=se.layout||{},se.layout.visibility=this.visibility),N(se,function(Te,De){return Te!==void 0&&!(De==="layout"&&!Object.keys(Te).length)&&!(De==="paint"&&!Object.keys(Te).length)})},C.prototype._validate=function(se,Te,De,He,yt){return yt===void 0&&(yt={}),yt&&yt.validate===!1?!1:Uc(this,se.call(ks,{key:Te,layerType:this.type,objectKey:De,value:He,styleSpec:fi,style:{glyphs:!0,sprite:!0}}))},C.prototype.is3D=function(){return!1},C.prototype.isTileClipped=function(){return!1},C.prototype.hasOffscreenPass=function(){return!1},C.prototype.resize=function(){},C.prototype.isStateDependent=function(){for(var se in this.paint._values){var Te=this.paint.get(se);if(!(!(Te instanceof Ln)||!Mu(Te.property.specification))&&(Te.value.kind==="source"||Te.value.kind==="composite")&&Te.value.isStateDependent)return!0}return!1},C})(Dr),Ga={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ma=function(C,X){this._structArray=C,this._pos1=X*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},nn=128,Fn=5,ta=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};ta.serialize=function(C,X){return C._trim(),X&&(C.isTransferred=!0,X.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}},ta.deserialize=function(C){var X=Object.create(this.prototype);return X.arrayBuffer=C.arrayBuffer,X.length=C.length,X.capacity=C.arrayBuffer.byteLength/X.bytesPerElement,X._refreshViews(),X},ta.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ta.prototype.clear=function(){this.length=0},ta.prototype.resize=function(C){this.reserve(C),this.length=C},ta.prototype.reserve=function(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(this.capacity*Fn),nn),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var X=this.uint8;this._refreshViews(),X&&this.uint8.set(X)}},ta.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function ya(k,C){C===void 0&&(C=1);var X=0,se=0,Te=k.map(function(He){var yt=aa(He.type),qt=X=ci(X,Math.max(C,yt)),nr=He.components||1;return se=Math.max(se,yt),X+=yt*nr,{name:He.name,type:He.type,components:nr,offset:qt}}),De=ci(X,Math.max(se,C));return{members:Te,size:De,alignment:C}}function aa(k){return Ga[k].BYTES_PER_ELEMENT}function ci(k,C){return Math.ceil(k/C)*C}var Ua=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te){var De=this.length;return this.resize(De+1),this.emplace(De,se,Te)},C.prototype.emplace=function(se,Te,De){var He=se*2;return this.int16[He+0]=Te,this.int16[He+1]=De,se},C})(ta);Ua.prototype.bytesPerElement=4,tr("StructArrayLayout2i4",Ua);var Ri=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He){var yt=this.length;return this.resize(yt+1),this.emplace(yt,se,Te,De,He)},C.prototype.emplace=function(se,Te,De,He,yt){var qt=se*4;return this.int16[qt+0]=Te,this.int16[qt+1]=De,this.int16[qt+2]=He,this.int16[qt+3]=yt,se},C})(ta);Ri.prototype.bytesPerElement=8,tr("StructArrayLayout4i8",Ri);var ia=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He,yt,qt){var nr=this.length;return this.resize(nr+1),this.emplace(nr,se,Te,De,He,yt,qt)},C.prototype.emplace=function(se,Te,De,He,yt,qt,nr){var dr=se*6;return this.int16[dr+0]=Te,this.int16[dr+1]=De,this.int16[dr+2]=He,this.int16[dr+3]=yt,this.int16[dr+4]=qt,this.int16[dr+5]=nr,se},C})(ta);ia.prototype.bytesPerElement=12,tr("StructArrayLayout2i4i12",ia);var Yn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He,yt,qt){var nr=this.length;return this.resize(nr+1),this.emplace(nr,se,Te,De,He,yt,qt)},C.prototype.emplace=function(se,Te,De,He,yt,qt,nr){var dr=se*4,Fr=se*8;return this.int16[dr+0]=Te,this.int16[dr+1]=De,this.uint8[Fr+4]=He,this.uint8[Fr+5]=yt,this.uint8[Fr+6]=qt,this.uint8[Fr+7]=nr,se},C})(ta);Yn.prototype.bytesPerElement=8,tr("StructArrayLayout2i4ub8",Yn);var ii=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te){var De=this.length;return this.resize(De+1),this.emplace(De,se,Te)},C.prototype.emplace=function(se,Te,De){var He=se*2;return this.float32[He+0]=Te,this.float32[He+1]=De,se},C})(ta);ii.prototype.bytesPerElement=8,tr("StructArrayLayout2f8",ii);var Dn=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He,yt,qt,nr,dr,Fr,rn){var Kr=this.length;return this.resize(Kr+1),this.emplace(Kr,se,Te,De,He,yt,qt,nr,dr,Fr,rn)},C.prototype.emplace=function(se,Te,De,He,yt,qt,nr,dr,Fr,rn,Kr){var bn=se*10;return this.uint16[bn+0]=Te,this.uint16[bn+1]=De,this.uint16[bn+2]=He,this.uint16[bn+3]=yt,this.uint16[bn+4]=qt,this.uint16[bn+5]=nr,this.uint16[bn+6]=dr,this.uint16[bn+7]=Fr,this.uint16[bn+8]=rn,this.uint16[bn+9]=Kr,se},C})(ta);Dn.prototype.bytesPerElement=20,tr("StructArrayLayout10ui20",Dn);var $a=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He,yt,qt,nr,dr,Fr,rn,Kr,bn){var Kn=this.length;return this.resize(Kn+1),this.emplace(Kn,se,Te,De,He,yt,qt,nr,dr,Fr,rn,Kr,bn)},C.prototype.emplace=function(se,Te,De,He,yt,qt,nr,dr,Fr,rn,Kr,bn,Kn){var ja=se*12;return this.int16[ja+0]=Te,this.int16[ja+1]=De,this.int16[ja+2]=He,this.int16[ja+3]=yt,this.uint16[ja+4]=qt,this.uint16[ja+5]=nr,this.uint16[ja+6]=dr,this.uint16[ja+7]=Fr,this.int16[ja+8]=rn,this.int16[ja+9]=Kr,this.int16[ja+10]=bn,this.int16[ja+11]=Kn,se},C})(ta);$a.prototype.bytesPerElement=24,tr("StructArrayLayout4i4ui4i24",$a);var Oa=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,Te,De)},C.prototype.emplace=function(se,Te,De,He){var yt=se*3;return this.float32[yt+0]=Te,this.float32[yt+1]=De,this.float32[yt+2]=He,se},C})(ta);Oa.prototype.bytesPerElement=12,tr("StructArrayLayout3f12",Oa);var zi=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var Te=this.length;return this.resize(Te+1),this.emplace(Te,se)},C.prototype.emplace=function(se,Te){var De=se*1;return this.uint32[De+0]=Te,se},C})(ta);zi.prototype.bytesPerElement=4,tr("StructArrayLayout1ul4",zi);var Lo=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He,yt,qt,nr,dr,Fr){var rn=this.length;return this.resize(rn+1),this.emplace(rn,se,Te,De,He,yt,qt,nr,dr,Fr)},C.prototype.emplace=function(se,Te,De,He,yt,qt,nr,dr,Fr,rn){var Kr=se*10,bn=se*5;return this.int16[Kr+0]=Te,this.int16[Kr+1]=De,this.int16[Kr+2]=He,this.int16[Kr+3]=yt,this.int16[Kr+4]=qt,this.int16[Kr+5]=nr,this.uint32[bn+3]=dr,this.uint16[Kr+8]=Fr,this.uint16[Kr+9]=rn,se},C})(ta);Lo.prototype.bytesPerElement=20,tr("StructArrayLayout6i1ul2ui20",Lo);var _i=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He,yt,qt){var nr=this.length;return this.resize(nr+1),this.emplace(nr,se,Te,De,He,yt,qt)},C.prototype.emplace=function(se,Te,De,He,yt,qt,nr){var dr=se*6;return this.int16[dr+0]=Te,this.int16[dr+1]=De,this.int16[dr+2]=He,this.int16[dr+3]=yt,this.int16[dr+4]=qt,this.int16[dr+5]=nr,se},C})(ta);_i.prototype.bytesPerElement=12,tr("StructArrayLayout2i2i2i12",_i);var ji=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He,yt){var qt=this.length;return this.resize(qt+1),this.emplace(qt,se,Te,De,He,yt)},C.prototype.emplace=function(se,Te,De,He,yt,qt){var nr=se*4,dr=se*8;return this.float32[nr+0]=Te,this.float32[nr+1]=De,this.float32[nr+2]=He,this.int16[dr+6]=yt,this.int16[dr+7]=qt,se},C})(ta);ji.prototype.bytesPerElement=16,tr("StructArrayLayout2f1f2i16",ji);var Ya=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He){var yt=this.length;return this.resize(yt+1),this.emplace(yt,se,Te,De,He)},C.prototype.emplace=function(se,Te,De,He,yt){var qt=se*12,nr=se*3;return this.uint8[qt+0]=Te,this.uint8[qt+1]=De,this.float32[nr+1]=He,this.float32[nr+2]=yt,se},C})(ta);Ya.prototype.bytesPerElement=12,tr("StructArrayLayout2ub2f12",Ya);var To=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,Te,De)},C.prototype.emplace=function(se,Te,De,He){var yt=se*3;return this.uint16[yt+0]=Te,this.uint16[yt+1]=De,this.uint16[yt+2]=He,se},C})(ta);To.prototype.bytesPerElement=6,tr("StructArrayLayout3ui6",To);var qo=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He,yt,qt,nr,dr,Fr,rn,Kr,bn,Kn,ja,wa,mi,Ja){var vi=this.length;return this.resize(vi+1),this.emplace(vi,se,Te,De,He,yt,qt,nr,dr,Fr,rn,Kr,bn,Kn,ja,wa,mi,Ja)},C.prototype.emplace=function(se,Te,De,He,yt,qt,nr,dr,Fr,rn,Kr,bn,Kn,ja,wa,mi,Ja,vi){var Mi=se*24,Ki=se*12,xo=se*48;return this.int16[Mi+0]=Te,this.int16[Mi+1]=De,this.uint16[Mi+2]=He,this.uint16[Mi+3]=yt,this.uint32[Ki+2]=qt,this.uint32[Ki+3]=nr,this.uint32[Ki+4]=dr,this.uint16[Mi+10]=Fr,this.uint16[Mi+11]=rn,this.uint16[Mi+12]=Kr,this.float32[Ki+7]=bn,this.float32[Ki+8]=Kn,this.uint8[xo+36]=ja,this.uint8[xo+37]=wa,this.uint8[xo+38]=mi,this.uint32[Ki+10]=Ja,this.int16[Mi+22]=vi,se},C})(ta);qo.prototype.bytesPerElement=48,tr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",qo);var Qo=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He,yt,qt,nr,dr,Fr,rn,Kr,bn,Kn,ja,wa,mi,Ja,vi,Mi,Ki,xo,mo,ss,Bo,Ko,vl,ls,ms){var Gl=this.length;return this.resize(Gl+1),this.emplace(Gl,se,Te,De,He,yt,qt,nr,dr,Fr,rn,Kr,bn,Kn,ja,wa,mi,Ja,vi,Mi,Ki,xo,mo,ss,Bo,Ko,vl,ls,ms)},C.prototype.emplace=function(se,Te,De,He,yt,qt,nr,dr,Fr,rn,Kr,bn,Kn,ja,wa,mi,Ja,vi,Mi,Ki,xo,mo,ss,Bo,Ko,vl,ls,ms,Gl){var ol=se*34,Nu=se*17;return this.int16[ol+0]=Te,this.int16[ol+1]=De,this.int16[ol+2]=He,this.int16[ol+3]=yt,this.int16[ol+4]=qt,this.int16[ol+5]=nr,this.int16[ol+6]=dr,this.int16[ol+7]=Fr,this.uint16[ol+8]=rn,this.uint16[ol+9]=Kr,this.uint16[ol+10]=bn,this.uint16[ol+11]=Kn,this.uint16[ol+12]=ja,this.uint16[ol+13]=wa,this.uint16[ol+14]=mi,this.uint16[ol+15]=Ja,this.uint16[ol+16]=vi,this.uint16[ol+17]=Mi,this.uint16[ol+18]=Ki,this.uint16[ol+19]=xo,this.uint16[ol+20]=mo,this.uint16[ol+21]=ss,this.uint16[ol+22]=Bo,this.uint32[Nu+12]=Ko,this.float32[Nu+13]=vl,this.float32[Nu+14]=ls,this.float32[Nu+15]=ms,this.float32[Nu+16]=Gl,se},C})(ta);Qo.prototype.bytesPerElement=68,tr("StructArrayLayout8i15ui1ul4f68",Qo);var fl=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var Te=this.length;return this.resize(Te+1),this.emplace(Te,se)},C.prototype.emplace=function(se,Te){var De=se*1;return this.float32[De+0]=Te,se},C})(ta);fl.prototype.bytesPerElement=4,tr("StructArrayLayout1f4",fl);var es=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,Te,De)},C.prototype.emplace=function(se,Te,De,He){var yt=se*3;return this.int16[yt+0]=Te,this.int16[yt+1]=De,this.int16[yt+2]=He,se},C})(ta);es.prototype.bytesPerElement=6,tr("StructArrayLayout3i6",es);var Eu=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De){var He=this.length;return this.resize(He+1),this.emplace(He,se,Te,De)},C.prototype.emplace=function(se,Te,De,He){var yt=se*2,qt=se*4;return this.uint32[yt+0]=Te,this.uint16[qt+2]=De,this.uint16[qt+3]=He,se},C})(ta);Eu.prototype.bytesPerElement=8,tr("StructArrayLayout1ul2ui8",Eu);var el=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te){var De=this.length;return this.resize(De+1),this.emplace(De,se,Te)},C.prototype.emplace=function(se,Te,De){var He=se*2;return this.uint16[He+0]=Te,this.uint16[He+1]=De,se},C})(ta);el.prototype.bytesPerElement=4,tr("StructArrayLayout2ui4",el);var gu=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var Te=this.length;return this.resize(Te+1),this.emplace(Te,se)},C.prototype.emplace=function(se,Te){var De=se*1;return this.uint16[De+0]=Te,se},C})(ta);gu.prototype.bytesPerElement=2,tr("StructArrayLayout1ui2",gu);var Fu=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,Te,De,He){var yt=this.length;return this.resize(yt+1),this.emplace(yt,se,Te,De,He)},C.prototype.emplace=function(se,Te,De,He,yt){var qt=se*4;return this.float32[qt+0]=Te,this.float32[qt+1]=De,this.float32[qt+2]=He,this.float32[qt+3]=yt,se},C})(ta);Fu.prototype.bytesPerElement=16,tr("StructArrayLayout4f16",Fu);var Qu=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return X.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},X.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},X.x1.get=function(){return this._structArray.int16[this._pos2+2]},X.y1.get=function(){return this._structArray.int16[this._pos2+3]},X.x2.get=function(){return this._structArray.int16[this._pos2+4]},X.y2.get=function(){return this._structArray.int16[this._pos2+5]},X.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},X.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},X.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},X.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(C.prototype,X),C})(ma);Qu.prototype.size=20;var _f=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new Qu(this,se)},C})(Lo);tr("CollisionBoxArray",_f);var nu=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return X.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},X.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},X.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},X.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},X.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},X.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},X.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},X.segment.get=function(){return this._structArray.uint16[this._pos2+10]},X.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},X.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},X.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},X.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},X.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},X.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},X.placedOrientation.set=function(se){this._structArray.uint8[this._pos1+37]=se},X.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},X.hidden.set=function(se){this._structArray.uint8[this._pos1+38]=se},X.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},X.crossTileID.set=function(se){this._structArray.uint32[this._pos4+10]=se},X.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(C.prototype,X),C})(ma);nu.prototype.size=48;var du=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new nu(this,se)},C})(qo);tr("PlacedSymbolArray",du);var ho=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return X.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},X.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},X.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},X.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},X.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},X.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},X.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},X.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},X.key.get=function(){return this._structArray.uint16[this._pos2+8]},X.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},X.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},X.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},X.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},X.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},X.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},X.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},X.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},X.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},X.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},X.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},X.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},X.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},X.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},X.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},X.crossTileID.set=function(se){this._structArray.uint32[this._pos4+12]=se},X.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},X.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},X.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},X.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(C.prototype,X),C})(ma);ho.prototype.size=68;var ec=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new ho(this,se)},C})(Qo);tr("SymbolInstanceArray",ec);var qs=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getoffsetX=function(se){return this.float32[se*1+0]},C})(fl);tr("GlyphOffsetArray",qs);var Fl=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getx=function(se){return this.int16[se*3+0]},C.prototype.gety=function(se){return this.int16[se*3+1]},C.prototype.gettileUnitDistanceFromAnchor=function(se){return this.int16[se*3+2]},C})(es);tr("SymbolLineVertexArray",Fl);var dc=(function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var X={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return X.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},X.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},X.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(C.prototype,X),C})(ma);dc.prototype.size=8;var vc=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new dc(this,se)},C})(Eu);tr("FeatureIndexArray",vc);var Co=ya([{name:"a_pos",components:2,type:"Int16"}],4),ds=Co.members,_s=function(C){C===void 0&&(C=[]),this.segments=C};_s.prototype.prepareSegment=function(C,X,se,Te){var De=this.segments[this.segments.length-1];return C>_s.MAX_VERTEX_ARRAY_LENGTH&&j("Max vertices per segment is "+_s.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+C),(!De||De.vertexLength+C>_s.MAX_VERTEX_ARRAY_LENGTH||De.sortKey!==Te)&&(De={vertexOffset:X.length,primitiveOffset:se.length,vertexLength:0,primitiveLength:0},Te!==void 0&&(De.sortKey=Te),this.segments.push(De)),De},_s.prototype.get=function(){return this.segments},_s.prototype.destroy=function(){for(var C=0,X=this.segments;C>>16)*qt&65535)<<16)&4294967295,dr=dr<<15|dr>>>17,dr=(dr&65535)*nr+(((dr>>>16)*nr&65535)<<16)&4294967295,He^=dr,He=He<<13|He>>>19,yt=(He&65535)*5+(((He>>>16)*5&65535)<<16)&4294967295,He=(yt&65535)+27492+(((yt>>>16)+58964&65535)<<16);switch(dr=0,Te){case 3:dr^=(X.charCodeAt(Fr+2)&255)<<16;case 2:dr^=(X.charCodeAt(Fr+1)&255)<<8;case 1:dr^=X.charCodeAt(Fr)&255,dr=(dr&65535)*qt+(((dr>>>16)*qt&65535)<<16)&4294967295,dr=dr<<15|dr>>>17,dr=(dr&65535)*nr+(((dr>>>16)*nr&65535)<<16)&4294967295,He^=dr}return He^=X.length,He^=He>>>16,He=(He&65535)*2246822507+(((He>>>16)*2246822507&65535)<<16)&4294967295,He^=He>>>13,He=(He&65535)*3266489909+(((He>>>16)*3266489909&65535)<<16)&4294967295,He^=He>>>16,He>>>0}k.exports=C}),J=t(function(k){function C(X,se){for(var Te=X.length,De=se^Te,He=0,yt;Te>=4;)yt=X.charCodeAt(He)&255|(X.charCodeAt(++He)&255)<<8|(X.charCodeAt(++He)&255)<<16|(X.charCodeAt(++He)&255)<<24,yt=(yt&65535)*1540483477+(((yt>>>16)*1540483477&65535)<<16),yt^=yt>>>24,yt=(yt&65535)*1540483477+(((yt>>>16)*1540483477&65535)<<16),De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16)^yt,Te-=4,++He;switch(Te){case 3:De^=(X.charCodeAt(He+2)&255)<<16;case 2:De^=(X.charCodeAt(He+1)&255)<<8;case 1:De^=X.charCodeAt(He)&255,De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16)}return De^=De>>>13,De=(De&65535)*1540483477+(((De>>>16)*1540483477&65535)<<16),De^=De>>>15,De>>>0}k.exports=C}),_e=he,qe=he,ft=J;_e.murmur3=qe,_e.murmur2=ft;var pt=function(){this.ids=[],this.positions=[],this.indexed=!1};pt.prototype.add=function(C,X,se,Te){this.ids.push(it(C)),this.positions.push(X,se,Te)},pt.prototype.getPositions=function(C){for(var X=it(C),se=0,Te=this.ids.length-1;se>1;this.ids[De]>=X?Te=De:se=De+1}for(var He=[];this.ids[se]===X;){var yt=this.positions[3*se],qt=this.positions[3*se+1],nr=this.positions[3*se+2];He.push({index:yt,start:qt,end:nr}),se++}return He},pt.serialize=function(C,X){var se=new Float64Array(C.ids),Te=new Uint32Array(C.positions);return Tt(se,Te,0,se.length-1),X&&X.push(se.buffer,Te.buffer),{ids:se,positions:Te}},pt.deserialize=function(C){var X=new pt;return X.ids=C.ids,X.positions=C.positions,X.indexed=!0,X};var $e=Math.pow(2,53)-1;function it(k){var C=+k;return!isNaN(C)&&C<=$e?C:_e(String(k))}function Tt(k,C,X,se){for(;X>1],De=X-1,He=se+1;;){do De++;while(k[De]Te);if(De>=He)break;$t(k,De,He),$t(C,3*De,3*He),$t(C,3*De+1,3*He+1),$t(C,3*De+2,3*He+2)}He-XHe.x+1||qtHe.y+1)&&j("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return X}function xl(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?hl(k):[]}}function _l(k,C,X,se,Te){k.emplaceBack(C*2+(se+1)/2,X*2+(Te+1)/2)}var tc=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(X){return X.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Ua,this.indexArray=new To,this.segments=new _s,this.programConfigurations=new fa(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(X){return X.isStateDependent()}).map(function(X){return X.id})};tc.prototype.populate=function(C,X,se){var Te=this.layers[0],De=[],He=null;Te.type==="circle"&&(He=Te.layout.get("circle-sort-key"));for(var yt=0,qt=C;yt=qi||rn<0||rn>=qi)){var Kr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),bn=Kr.vertexLength;_l(this.layoutVertexArray,Fr,rn,-1,-1),_l(this.layoutVertexArray,Fr,rn,1,-1),_l(this.layoutVertexArray,Fr,rn,1,1),_l(this.layoutVertexArray,Fr,rn,-1,1),this.indexArray.emplaceBack(bn,bn+1,bn+2),this.indexArray.emplaceBack(bn,bn+3,bn+2),Kr.vertexLength+=4,Kr.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,se,{},Te)},tr("CircleBucket",tc,{omit:["layers"]});function sl(k,C){for(var X=0;X=3){for(var De=0;De1){if(Gv(k,C))return!0;for(var se=0;se1?k.distSqr(X):k.distSqr(X.sub(C)._mult(Te)._add(C))}function Mp(k,C){for(var X=!1,se,Te,De,He=0;HeC.y!=De.y>C.y&&C.x<(De.x-Te.x)*(C.y-Te.y)/(De.y-Te.y)+Te.x&&(X=!X)}return X}function nv(k,C){for(var X=!1,se=0,Te=k.length-1;seC.y!=He.y>C.y&&C.x<(He.x-De.x)*(C.y-De.y)/(He.y-De.y)+De.x&&(X=!X)}return X}function Ep(k,C,X,se,Te){for(var De=0,He=k;De=yt.x&&Te>=yt.y)return!0}var qt=[new i(C,X),new i(C,Te),new i(se,Te),new i(se,X)];if(k.length>2)for(var nr=0,dr=qt;nrTe.x&&C.x>Te.x||k.yTe.y&&C.y>Te.y)return!1;var De=Z(k,C,X[0]);return De!==Z(k,C,X[1])||De!==Z(k,C,X[2])||De!==Z(k,C,X[3])}function av(k,C,X){var se=C.paint.get(k).value;return se.kind==="constant"?se.value:X.programConfigurations.get(C.id).getMaxValue(k)}function Xv(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1])}function dp(k,C,X,se,Te){if(!C[0]&&!C[1])return k;var De=i.convert(C)._mult(Te);X==="viewport"&&De._rotate(-se);for(var He=[],yt=0;yt0&&(De=1/Math.sqrt(De)),k[0]=C[0]*De,k[1]=C[1]*De,k[2]=C[2]*De,k}function c6(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function f6(k,C,X){var se=C[0],Te=C[1],De=C[2],He=X[0],yt=X[1],qt=X[2];return k[0]=Te*qt-De*yt,k[1]=De*He-se*qt,k[2]=se*yt-Te*He,k}function h6(k,C,X){var se=C[0],Te=C[1],De=C[2];return k[0]=se*X[0]+Te*X[3]+De*X[6],k[1]=se*X[1]+Te*X[4]+De*X[7],k[2]=se*X[2]+Te*X[5]+De*X[8],k}var d6=Hm;(function(){var k=Vm();return function(C,X,se,Te,De,He){var yt,qt;for(X||(X=3),se||(se=0),Te?qt=Math.min(Te*X+se,C.length):qt=C.length,yt=se;ytk.width||Te.height>k.height||X.x>k.width-Te.width||X.y>k.height-Te.height)throw new RangeError("out of range source coordinates for image copy");if(Te.width>C.width||Te.height>C.height||se.x>C.width-Te.width||se.y>C.height-Te.height)throw new RangeError("out of range destination coordinates for image copy");for(var He=k.data,yt=C.data,qt=0;qt80*X){yt=nr=k[0],qt=dr=k[1];for(var bn=X;bnnr&&(nr=Fr),rn>dr&&(dr=rn);Kr=Math.max(nr-yt,dr-qt),Kr=Kr!==0?1/Kr:0}return qg(De,He,X,yt,qt,Kr),He}function W3(k,C,X,se,Te){var De,He;if(Te===tT(k,C,X,se)>0)for(De=C;De=C;De-=se)He=xS(De,k[De],k[De+1],He);return He&&r1(He,He.next)&&(Z_(He),He=He.next),He}function tm(k,C){if(!k)return k;C||(C=k);var X=k,se;do if(se=!1,!X.steiner&&(r1(X,X.next)||oh(X.prev,X,X.next)===0)){if(Z_(X),X=C=X.prev,X===X.next)break;se=!0}else X=X.next;while(se||X!==C);return C}function qg(k,C,X,se,Te,De,He){if(k){!He&&De&&K3(k,se,Te,De);for(var yt=k,qt,nr;k.prev!==k.next;){if(qt=k.prev,nr=k.next,De?x6(k,se,Te,De):$3(k)){C.push(qt.i/X),C.push(k.i/X),C.push(nr.i/X),Z_(k),k=nr.next,yt=nr.next;continue}if(k=nr,k===yt){He?He===1?(k=b6(tm(k),C,X),qg(k,C,X,se,Te,De,2)):He===2&&gS(k,C,X,se,Te,De):qg(tm(k),C,X,se,Te,De,1);break}}}}function $3(k){var C=k.prev,X=k,se=k.next;if(oh(C,X,se)>=0)return!1;for(var Te=k.next.next;Te!==k.prev;){if(Ym(C.x,C.y,X.x,X.y,se.x,se.y,Te.x,Te.y)&&oh(Te.prev,Te,Te.next)>=0)return!1;Te=Te.next}return!0}function x6(k,C,X,se){var Te=k.prev,De=k,He=k.next;if(oh(Te,De,He)>=0)return!1;for(var yt=Te.xDe.x?Te.x>He.x?Te.x:He.x:De.x>He.x?De.x:He.x,dr=Te.y>De.y?Te.y>He.y?Te.y:He.y:De.y>He.y?De.y:He.y,Fr=J3(yt,qt,C,X,se),rn=J3(nr,dr,C,X,se),Kr=k.prevZ,bn=k.nextZ;Kr&&Kr.z>=Fr&&bn&&bn.z<=rn;){if(Kr!==k.prev&&Kr!==k.next&&Ym(Te.x,Te.y,De.x,De.y,He.x,He.y,Kr.x,Kr.y)&&oh(Kr.prev,Kr,Kr.next)>=0||(Kr=Kr.prevZ,bn!==k.prev&&bn!==k.next&&Ym(Te.x,Te.y,De.x,De.y,He.x,He.y,bn.x,bn.y)&&oh(bn.prev,bn,bn.next)>=0))return!1;bn=bn.nextZ}for(;Kr&&Kr.z>=Fr;){if(Kr!==k.prev&&Kr!==k.next&&Ym(Te.x,Te.y,De.x,De.y,He.x,He.y,Kr.x,Kr.y)&&oh(Kr.prev,Kr,Kr.next)>=0)return!1;Kr=Kr.prevZ}for(;bn&&bn.z<=rn;){if(bn!==k.prev&&bn!==k.next&&Ym(Te.x,Te.y,De.x,De.y,He.x,He.y,bn.x,bn.y)&&oh(bn.prev,bn,bn.next)>=0)return!1;bn=bn.nextZ}return!0}function b6(k,C,X){var se=k;do{var Te=se.prev,De=se.next.next;!r1(Te,De)&&Vg(Te,se,se.next,De)&&n1(Te,De)&&n1(De,Te)&&(C.push(Te.i/X),C.push(se.i/X),C.push(De.i/X),Z_(se),Z_(se.next),se=k=De),se=se.next}while(se!==k);return tm(se)}function gS(k,C,X,se,Te,De){var He=k;do{for(var yt=He.next.next;yt!==He.prev;){if(He.i!==yt.i&&T6(He,yt)){var qt=eT(He,yt);He=tm(He,He.next),qt=tm(qt,qt.next),qg(He,C,X,se,Te,De),qg(qt,C,X,se,Te,De);return}yt=yt.next}He=He.next}while(He!==k)}function yS(k,C,X,se){var Te=[],De,He,yt,qt,nr;for(De=0,He=C.length;De=X.next.y&&X.next.y!==X.y){var yt=X.x+(Te-X.y)*(X.next.x-X.x)/(X.next.y-X.y);if(yt<=se&&yt>De){if(De=yt,yt===se){if(Te===X.y)return X;if(Te===X.next.y)return X.next}He=X.x=X.x&&X.x>=nr&&se!==X.x&&Ym(TeHe.x||X.x===He.x&&_S(He,X)))&&(He=X,Fr=rn)),X=X.next;while(X!==qt);return He}function _S(k,C){return oh(k.prev,k,C.prev)<0&&oh(C.next,k,k.next)<0}function K3(k,C,X,se){var Te=k;do Te.z===null&&(Te.z=J3(Te.x,Te.y,C,X,se)),Te.prevZ=Te.prev,Te.nextZ=Te.next,Te=Te.next;while(Te!==k);Te.prevZ.nextZ=null,Te.prevZ=null,w6(Te)}function w6(k){var C,X,se,Te,De,He,yt,qt,nr=1;do{for(X=k,k=null,De=null,He=0;X;){for(He++,se=X,yt=0,C=0;C0||qt>0&&se;)yt!==0&&(qt===0||!se||X.z<=se.z)?(Te=X,X=X.nextZ,yt--):(Te=se,se=se.nextZ,qt--),De?De.nextZ=Te:k=Te,Te.prevZ=De,De=Te;X=se}De.nextZ=null,nr*=2}while(He>1);return k}function J3(k,C,X,se,Te){return k=32767*(k-X)*Te,C=32767*(C-se)*Te,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,k|C<<1}function cw(k){var C=k,X=k;do(C.x=0&&(k-He)*(se-yt)-(X-He)*(C-yt)>=0&&(X-He)*(De-yt)-(Te-He)*(se-yt)>=0}function T6(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!Q3(k,C)&&(n1(k,C)&&n1(C,k)&&fw(k,C)&&(oh(k.prev,k,C.prev)||oh(k,C.prev,C))||r1(k,C)&&oh(k.prev,k,k.next)>0&&oh(C.prev,C,C.next)>0)}function oh(k,C,X){return(C.y-k.y)*(X.x-C.x)-(C.x-k.x)*(X.y-C.y)}function r1(k,C){return k.x===C.x&&k.y===C.y}function Vg(k,C,X,se){var Te=Y_(oh(k,C,X)),De=Y_(oh(k,C,se)),He=Y_(oh(X,se,k)),yt=Y_(oh(X,se,C));return!!(Te!==De&&He!==yt||Te===0&&X_(k,X,C)||De===0&&X_(k,se,C)||He===0&&X_(X,k,se)||yt===0&&X_(X,C,se))}function X_(k,C,X){return C.x<=Math.max(k.x,X.x)&&C.x>=Math.min(k.x,X.x)&&C.y<=Math.max(k.y,X.y)&&C.y>=Math.min(k.y,X.y)}function Y_(k){return k>0?1:k<0?-1:0}function Q3(k,C){var X=k;do{if(X.i!==k.i&&X.next.i!==k.i&&X.i!==C.i&&X.next.i!==C.i&&Vg(X,X.next,k,C))return!0;X=X.next}while(X!==k);return!1}function n1(k,C){return oh(k.prev,k,k.next)<0?oh(k,C,k.next)>=0&&oh(k,k.prev,C)>=0:oh(k,C,k.prev)<0||oh(k,k.next,C)<0}function fw(k,C){var X=k,se=!1,Te=(k.x+C.x)/2,De=(k.y+C.y)/2;do X.y>De!=X.next.y>De&&X.next.y!==X.y&&Te<(X.next.x-X.x)*(De-X.y)/(X.next.y-X.y)+X.x&&(se=!se),X=X.next;while(X!==k);return se}function eT(k,C){var X=new hw(k.i,k.x,k.y),se=new hw(C.i,C.x,C.y),Te=k.next,De=C.prev;return k.next=C,C.prev=k,X.next=Te,Te.prev=X,se.next=X,X.prev=se,De.next=se,se.prev=De,se}function xS(k,C,X,se){var Te=new hw(k,C,X);return se?(Te.next=se.next,Te.prev=se,se.next.prev=Te,se.next=Te):(Te.prev=Te,Te.next=Te),Te}function Z_(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function hw(k,C,X){this.i=k,this.x=C,this.y=X,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}uw.deviation=function(k,C,X,se){var Te=C&&C.length,De=Te?C[0]*X:k.length,He=Math.abs(tT(k,0,De,X));if(Te)for(var yt=0,qt=C.length;yt0&&(se+=k[Te-1].length,X.holes.push(se))}return X},lw.default=mS;function A6(k,C,X,se,Te){bS(k,C,X,se||k.length-1,Te||rT)}function bS(k,C,X,se,Te){for(;se>X;){if(se-X>600){var De=se-X+1,He=C-X+1,yt=Math.log(De),qt=.5*Math.exp(2*yt/3),nr=.5*Math.sqrt(yt*qt*(De-qt)/De)*(He-De/2<0?-1:1),dr=Math.max(X,Math.floor(C-He*qt/De+nr)),Fr=Math.min(se,Math.floor(C+(De-He)*qt/De+nr));bS(k,C,dr,Fr,Te)}var rn=k[C],Kr=X,bn=se;for(W_(k,X,C),Te(k[se],rn)>0&&W_(k,X,se);Kr0;)bn--}Te(k[X],rn)===0?W_(k,X,bn):(bn++,W_(k,bn,se)),bn<=C&&(X=bn+1),C<=bn&&(se=bn-1)}}function W_(k,C,X){var se=k[C];k[C]=k[X],k[X]=se}function rT(k,C){return kC?1:0}function S0(k,C){var X=k.length;if(X<=1)return[k];for(var se=[],Te,De,He=0;He1)for(var qt=0;qt>3}if(se--,X===1||X===2)Te+=k.readSVarint(),De+=k.readSVarint(),X===1&&(yt&&He.push(yt),yt=[]),yt.push(new i(Te,De));else if(X===7)yt&&yt.push(yt[0].clone());else throw new Error("unknown command "+X)}return yt&&He.push(yt),He},Hg.prototype.bbox=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,X=1,se=0,Te=0,De=0,He=1/0,yt=-1/0,qt=1/0,nr=-1/0;k.pos>3}if(se--,X===1||X===2)Te+=k.readSVarint(),De+=k.readSVarint(),Teyt&&(yt=Te),Denr&&(nr=De);else if(X!==7)throw new Error("unknown command "+X)}return[He,qt,yt,nr]},Hg.prototype.toGeoJSON=function(k,C,X){var se=this.extent*Math.pow(2,X),Te=this.extent*k,De=this.extent*C,He=this.loadGeometry(),yt=Hg.types[this.type],qt,nr;function dr(Kr){for(var bn=0;bn>3;C=se===1?k.readString():se===2?k.readFloat():se===3?k.readDouble():se===4?k.readVarint64():se===5?k.readVarint():se===6?k.readSVarint():se===7?k.readBoolean():null}return C}LS.prototype.feature=function(k){if(k<0||k>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[k];var C=this._pbf.readVarint()+this._pbf.pos;return new a1(this._pbf,C,this.extent,this._keys,this._values)};var RS=IS;function IS(k,C){this.layers=k.readFields(DS,{},C)}function DS(k,C,X){if(k===3){var se=new iT(X,X.readVarint()+X.pos);se.length&&(C[se.name]=se)}}var zS=RS,S6=a1,M6=iT,Gg={VectorTile:zS,VectorTileFeature:S6,VectorTileLayer:M6},i1=Gg.VectorTileFeature.types,OS=500,o1=Math.pow(2,13);function s1(k,C,X,se,Te,De,He,yt){k.emplaceBack(C,X,Math.floor(se*o1)*2+He,Te*o1*2,De*o1*2,Math.round(yt))}var Wv=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(X){return X.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new ia,this.indexArray=new To,this.programConfigurations=new fa(C.layers,C.zoom),this.segments=new _s,this.stateDependentLayerIds=this.layers.filter(function(X){return X.isStateDependent()}).map(function(X){return X.id})};Wv.prototype.populate=function(C,X,se){this.features=[],this.hasPattern=dw("fill-extrusion",this.layers,X);for(var Te=0,De=C;Te=1){var vi=ja[mi-1];if(!pw(Ja,vi)){Kr.vertexLength+4>_s.MAX_VERTEX_ARRAY_LENGTH&&(Kr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Mi=Ja.sub(vi)._perp()._unit(),Ki=vi.dist(Ja);wa+Ki>32768&&(wa=0),s1(this.layoutVertexArray,Ja.x,Ja.y,Mi.x,Mi.y,0,0,wa),s1(this.layoutVertexArray,Ja.x,Ja.y,Mi.x,Mi.y,0,1,wa),wa+=Ki,s1(this.layoutVertexArray,vi.x,vi.y,Mi.x,Mi.y,0,0,wa),s1(this.layoutVertexArray,vi.x,vi.y,Mi.x,Mi.y,0,1,wa);var xo=Kr.vertexLength;this.indexArray.emplaceBack(xo,xo+2,xo+1),this.indexArray.emplaceBack(xo+1,xo+2,xo+3),Kr.vertexLength+=4,Kr.primitiveLength+=2}}}}if(Kr.vertexLength+nr>_s.MAX_VERTEX_ARRAY_LENGTH&&(Kr=this.segments.prepareSegment(nr,this.layoutVertexArray,this.indexArray)),i1[C.type]==="Polygon"){for(var mo=[],ss=[],Bo=Kr.vertexLength,Ko=0,vl=qt;Koqi)||k.y===C.y&&(k.y<0||k.y>qi)}function mw(k){return k.every(function(C){return C.x<0})||k.every(function(C){return C.x>qi})||k.every(function(C){return C.y<0})||k.every(function(C){return C.y>qi})}var E6=new Za({"fill-extrusion-opacity":new yn(fi["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new mn(fi["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new yn(fi["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new yn(fi["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new za(fi["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new mn(fi["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new mn(fi["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new yn(fi["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),k6={paint:E6},C6=(function(k){function C(X){k.call(this,X,k6)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(se){return new Wv(se)},C.prototype.queryRadius=function(){return Xv(this.paint.get("fill-extrusion-translate"))},C.prototype.is3D=function(){return!0},C.prototype.queryIntersectsFeature=function(se,Te,De,He,yt,qt,nr,dr){var Fr=dp(se,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),qt.angle,nr),rn=this.paint.get("fill-extrusion-height").evaluate(Te,De),Kr=this.paint.get("fill-extrusion-base").evaluate(Te,De),bn=FS(Fr,dr,qt,0),Kn=oT(He,Kr,rn,dr),ja=Kn[0],wa=Kn[1];return Wm(ja,wa,bn)},C})(yi);function M0(k,C){return k.x*C.x+k.y*C.y}function Ld(k,C){if(k.length===1){for(var X=0,se=C[X++],Te;!Te||se.equals(Te);)if(Te=C[X++],!Te)return 1/0;for(;X=2&&C[nr-1].equals(C[nr-2]);)nr--;for(var dr=0;dr0;if(mo&&mi>dr){var Bo=Kr.dist(bn);if(Bo>2*Fr){var Ko=Kr.sub(Kr.sub(bn)._mult(Fr/Bo)._round());this.updateDistance(bn,Ko),this.addCurrentVertex(Ko,ja,0,0,rn),bn=Ko}}var vl=bn&&Kn,ls=vl?se:qt?"butt":Te;if(vl&&ls==="round"&&(KiDe&&(ls="bevel"),ls==="bevel"&&(Ki>2&&(ls="flipbevel"),Ki100)Ja=wa.mult(-1);else{var ms=Ki*ja.add(wa).mag()/ja.sub(wa).mag();Ja._perp()._mult(ms*(ss?-1:1))}this.addCurrentVertex(Kr,Ja,0,0,rn),this.addCurrentVertex(Kr,Ja.mult(-1),0,0,rn)}else if(ls==="bevel"||ls==="fakeround"){var Gl=-Math.sqrt(Ki*Ki-1),ol=ss?Gl:0,Nu=ss?0:Gl;if(bn&&this.addCurrentVertex(Kr,ja,ol,Nu,rn),ls==="fakeround")for(var Vc=Math.round(xo*180/Math.PI/uT),Uu=1;Uu2*Fr){var nd=Kr.add(Kn.sub(Kr)._mult(Fr/Dd)._round());this.updateDistance(Kr,nd),this.addCurrentVertex(nd,wa,0,0,rn),Kr=nd}}}}},Gd.prototype.addCurrentVertex=function(C,X,se,Te,De,He){He===void 0&&(He=!1);var yt=X.x+X.y*se,qt=X.y-X.x*se,nr=-X.x+X.y*Te,dr=-X.y-X.x*Te;this.addHalfVertex(C,yt,qt,He,!1,se,De),this.addHalfVertex(C,nr,dr,He,!0,-Te,De),this.distance>gw/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(C,X,se,Te,De,He))},Gd.prototype.addHalfVertex=function(C,X,se,Te,De,He,yt){var qt=C.x,nr=C.y,dr=this.lineClips?this.scaledDistance*(gw-1):this.scaledDistance,Fr=dr*l1;if(this.layoutVertexArray.emplaceBack((qt<<1)+(Te?1:0),(nr<<1)+(De?1:0),Math.round(jS*X)+128,Math.round(jS*se)+128,(He===0?0:He<0?-1:1)+1|(Fr&63)<<2,Fr>>6),this.lineClips){var rn=this.scaledDistance-this.lineClips.start,Kr=this.lineClips.end-this.lineClips.start,bn=rn/Kr;this.layoutVertexArray2.emplaceBack(bn,this.lineClipsArray.length)}var Kn=yt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Kn),yt.primitiveLength++),De?this.e2=Kn:this.e1=Kn},Gd.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Gd.prototype.updateDistance=function(C,X){this.distance+=C.dist(X),this.updateScaledDistance()},tr("LineBucket",Gd,{omit:["layers","patternFeatures"]});var cT=new Za({"line-cap":new yn(fi.layout_line["line-cap"]),"line-join":new mn(fi.layout_line["line-join"]),"line-miter-limit":new yn(fi.layout_line["line-miter-limit"]),"line-round-limit":new yn(fi.layout_line["line-round-limit"]),"line-sort-key":new mn(fi.layout_line["line-sort-key"])}),yw=new Za({"line-opacity":new mn(fi.paint_line["line-opacity"]),"line-color":new mn(fi.paint_line["line-color"]),"line-translate":new yn(fi.paint_line["line-translate"]),"line-translate-anchor":new yn(fi.paint_line["line-translate-anchor"]),"line-width":new mn(fi.paint_line["line-width"]),"line-gap-width":new mn(fi.paint_line["line-gap-width"]),"line-offset":new mn(fi.paint_line["line-offset"]),"line-blur":new mn(fi.paint_line["line-blur"]),"line-dasharray":new Ia(fi.paint_line["line-dasharray"]),"line-pattern":new za(fi.paint_line["line-pattern"]),"line-gradient":new Da(fi.paint_line["line-gradient"])}),u1={paint:yw,layout:cT},fT=(function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(se,Te){return Te=new El(Math.floor(Te.zoom),{now:Te.now,fadeDuration:Te.fadeDuration,zoomHistory:Te.zoomHistory,transition:Te.transition}),k.prototype.possiblyEvaluate.call(this,se,Te)},C.prototype.evaluate=function(se,Te,De,He){return Te=_({},Te,{zoom:Math.floor(Te.zoom)}),k.prototype.evaluate.call(this,se,Te,De,He)},C})(mn),_w=new fT(u1.paint.properties["line-width"].specification);_w.useIntegerZoom=!0;var hT=(function(k){function C(X){k.call(this,X,u1),this.gradientVersion=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._handleSpecialPaintPropertyUpdate=function(se){if(se==="line-gradient"){var Te=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=Te._styleExpression.expression instanceof Fc,this.gradientVersion=(this.gradientVersion+1)%c}},C.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},C.prototype.recalculate=function(se,Te){k.prototype.recalculate.call(this,se,Te),this.paint._values["line-floorwidth"]=_w.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,se)},C.prototype.createBucket=function(se){return new Gd(se)},C.prototype.queryRadius=function(se){var Te=se,De=HS(av("line-width",this,Te),av("line-gap-width",this,Te)),He=av("line-offset",this,Te);return De/2+Math.abs(He)+Xv(this.paint.get("line-translate"))},C.prototype.queryIntersectsFeature=function(se,Te,De,He,yt,qt,nr){var dr=dp(se,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),qt.angle,nr),Fr=nr/2*HS(this.paint.get("line-width").evaluate(Te,De),this.paint.get("line-gap-width").evaluate(Te,De)),rn=this.paint.get("line-offset").evaluate(Te,De);return rn&&(He=Y(He,rn*nr)),Eh(dr,He,Fr)},C.prototype.isTileClipped=function(){return!0},C})(yi);function HS(k,C){return C>0?C+2*k:k}function Y(k,C){for(var X=[],se=new i(0,0),Te=0;Te":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function pr(k){for(var C="",X=0;X>1,dr=-7,Fr=X?Te-1:0,rn=X?-1:1,Kr=k[C+Fr];for(Fr+=rn,De=Kr&(1<<-dr)-1,Kr>>=-dr,dr+=yt;dr>0;De=De*256+k[C+Fr],Fr+=rn,dr-=8);for(He=De&(1<<-dr)-1,De>>=-dr,dr+=se;dr>0;He=He*256+k[C+Fr],Fr+=rn,dr-=8);if(De===0)De=1-nr;else{if(De===qt)return He?NaN:(Kr?-1:1)*(1/0);He=He+Math.pow(2,se),De=De-nr}return(Kr?-1:1)*He*Math.pow(2,De-se)},Qr=function(k,C,X,se,Te,De){var He,yt,qt,nr=De*8-Te-1,dr=(1<>1,rn=Te===23?Math.pow(2,-24)-Math.pow(2,-77):0,Kr=se?0:De-1,bn=se?1:-1,Kn=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(yt=isNaN(C)?1:0,He=dr):(He=Math.floor(Math.log(C)/Math.LN2),C*(qt=Math.pow(2,-He))<1&&(He--,qt*=2),He+Fr>=1?C+=rn/qt:C+=rn*Math.pow(2,1-Fr),C*qt>=2&&(He++,qt/=2),He+Fr>=dr?(yt=0,He=dr):He+Fr>=1?(yt=(C*qt-1)*Math.pow(2,Te),He=He+Fr):(yt=C*Math.pow(2,Fr-1)*Math.pow(2,Te),He=0));Te>=8;k[X+Kr]=yt&255,Kr+=bn,yt/=256,Te-=8);for(He=He<0;k[X+Kr]=He&255,Kr+=bn,He/=256,nr-=8);k[X+Kr-bn]|=Kn*128},vn={read:Hr,write:Qr},Sn=Nn;function Nn(k){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(k)?k:new Uint8Array(k||0),this.pos=0,this.type=0,this.length=this.buf.length}Nn.Varint=0,Nn.Fixed64=1,Nn.Bytes=2,Nn.Fixed32=5;var va=65536*65536,oi=1/va,Ba=12,ei=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Nn.prototype={destroy:function(){this.buf=null},readFields:function(k,C,X){for(X=X||this.length;this.pos>3,De=this.pos;this.type=se&7,k(Te,C,this),this.pos===De&&this.skip(se)}return C},readMessage:function(k,C){return this.readFields(k,C,this.readVarint()+this.pos)},readFixed32:function(){var k=Av(this.buf,this.pos);return this.pos+=4,k},readSFixed32:function(){var k=Qh(this.buf,this.pos);return this.pos+=4,k},readFixed64:function(){var k=Av(this.buf,this.pos)+Av(this.buf,this.pos+4)*va;return this.pos+=8,k},readSFixed64:function(){var k=Av(this.buf,this.pos)+Qh(this.buf,this.pos+4)*va;return this.pos+=8,k},readFloat:function(){var k=vn.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=vn.read(this.buf,this.pos,!0,52,8);return this.pos+=8,k},readVarint:function(k){var C=this.buf,X,se;return se=C[this.pos++],X=se&127,se<128||(se=C[this.pos++],X|=(se&127)<<7,se<128)||(se=C[this.pos++],X|=(se&127)<<14,se<128)||(se=C[this.pos++],X|=(se&127)<<21,se<128)?X:(se=C[this.pos],X|=(se&15)<<28,Oi(X,k,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var k=this.readVarint();return k%2===1?(k+1)/-2:k/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var k=this.readVarint()+this.pos,C=this.pos;return this.pos=k,k-C>=Ba&&ei?mv(this.buf,C,k):pv(this.buf,C,k)},readBytes:function(){var k=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,k);return this.pos=k,C},readPackedVarint:function(k,C){if(this.type!==Nn.Bytes)return k.push(this.readVarint(C));var X=fo(this);for(k=k||[];this.pos127;);else if(C===Nn.Bytes)this.pos=this.readVarint()+this.pos;else if(C===Nn.Fixed32)this.pos+=4;else if(C===Nn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+C)},writeTag:function(k,C){this.writeVarint(k<<3|C)},realloc:function(k){for(var C=this.length||16;C268435455||k<0){dl(k,this);return}this.realloc(4),this.buf[this.pos++]=k&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=k>>>7&127)))},writeSVarint:function(k){this.writeVarint(k<0?-k*2-1:k*2)},writeBoolean:function(k){this.writeVarint(!!k)},writeString:function(k){k=String(k),this.realloc(k.length*4),this.pos++;var C=this.pos;this.pos=gv(this.buf,k,this.pos);var X=this.pos-C;X>=128&&Is(C,X,this),this.pos=C-1,this.writeVarint(X),this.pos+=X},writeFloat:function(k){this.realloc(4),vn.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),vn.write(this.buf,k,this.pos,!0,52,8),this.pos+=8},writeBytes:function(k){var C=k.length;this.writeVarint(C),this.realloc(C);for(var X=0;X=128&&Is(X,se,this),this.pos=X-1,this.writeVarint(se),this.pos+=se},writeMessage:function(k,C,X){this.writeTag(k,Nn.Bytes),this.writeRawMessage(C,X)},writePackedVarint:function(k,C){C.length&&this.writeMessage(k,Ss,C)},writePackedSVarint:function(k,C){C.length&&this.writeMessage(k,bs,C)},writePackedBoolean:function(k,C){C.length&&this.writeMessage(k,Ds,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,eo,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,Gs,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,Pl,C)},writePackedSFixed32:function(k,C){C.length&&this.writeMessage(k,lf,C)},writePackedFixed64:function(k,C){C.length&&this.writeMessage(k,Jc,C)},writePackedSFixed64:function(k,C){C.length&&this.writeMessage(k,hd,C)},writeBytesField:function(k,C){this.writeTag(k,Nn.Bytes),this.writeBytes(C)},writeFixed32Field:function(k,C){this.writeTag(k,Nn.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(k,C){this.writeTag(k,Nn.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(k,C){this.writeTag(k,Nn.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(k,C){this.writeTag(k,Nn.Fixed64),this.writeSFixed64(C)},writeVarintField:function(k,C){this.writeTag(k,Nn.Varint),this.writeVarint(C)},writeSVarintField:function(k,C){this.writeTag(k,Nn.Varint),this.writeSVarint(C)},writeStringField:function(k,C){this.writeTag(k,Nn.Bytes),this.writeString(C)},writeFloatField:function(k,C){this.writeTag(k,Nn.Fixed32),this.writeFloat(C)},writeDoubleField:function(k,C){this.writeTag(k,Nn.Fixed64),this.writeDouble(C)},writeBooleanField:function(k,C){this.writeVarintField(k,!!C)}};function Oi(k,C,X){var se=X.buf,Te,De;if(De=se[X.pos++],Te=(De&112)>>4,De<128||(De=se[X.pos++],Te|=(De&127)<<3,De<128)||(De=se[X.pos++],Te|=(De&127)<<10,De<128)||(De=se[X.pos++],Te|=(De&127)<<17,De<128)||(De=se[X.pos++],Te|=(De&127)<<24,De<128)||(De=se[X.pos++],Te|=(De&1)<<31,De<128))return $o(k,Te,C);throw new Error("Expected varint not more than 10 bytes")}function fo(k){return k.type===Nn.Bytes?k.readVarint()+k.pos:k.pos+1}function $o(k,C,X){return X?C*4294967296+(k>>>0):(C>>>0)*4294967296+(k>>>0)}function dl(k,C){var X,se;if(k>=0?(X=k%4294967296|0,se=k/4294967296|0):(X=~(-k%4294967296),se=~(-k/4294967296),X^4294967295?X=X+1|0:(X=0,se=se+1|0)),k>=18446744073709552e3||k<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");C.realloc(10),is(X,se,C),Yo(se,C)}function is(k,C,X){X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos++]=k&127|128,k>>>=7,X.buf[X.pos]=k&127}function Yo(k,C){var X=(k&7)<<4;C.buf[C.pos++]|=X|((k>>>=3)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127)))))}function Is(k,C,X){var se=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(Math.LN2*7));X.realloc(se);for(var Te=X.pos-1;Te>=k;Te--)X.buf[Te+se]=X.buf[Te]}function Ss(k,C){for(var X=0;X>>8,k[X+2]=C>>>16,k[X+3]=C>>>24}function Qh(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+(k[C+3]<<24)}function pv(k,C,X){for(var se="",Te=C;Te239?4:De>223?3:De>191?2:1;if(Te+yt>X)break;var qt,nr,dr;yt===1?De<128&&(He=De):yt===2?(qt=k[Te+1],(qt&192)===128&&(He=(De&31)<<6|qt&63,He<=127&&(He=null))):yt===3?(qt=k[Te+1],nr=k[Te+2],(qt&192)===128&&(nr&192)===128&&(He=(De&15)<<12|(qt&63)<<6|nr&63,(He<=2047||He>=55296&&He<=57343)&&(He=null))):yt===4&&(qt=k[Te+1],nr=k[Te+2],dr=k[Te+3],(qt&192)===128&&(nr&192)===128&&(dr&192)===128&&(He=(De&15)<<18|(qt&63)<<12|(nr&63)<<6|dr&63,(He<=65535||He>=1114112)&&(He=null))),He===null?(He=65533,yt=1):He>65535&&(He-=65536,se+=String.fromCharCode(He>>>10&1023|55296),He=56320|He&1023),se+=String.fromCharCode(He),Te+=yt}return se}function mv(k,C,X){return ei.decode(k.subarray(C,X))}function gv(k,C,X){for(var se=0,Te,De;se55295&&Te<57344)if(De)if(Te<56320){k[X++]=239,k[X++]=191,k[X++]=189,De=Te;continue}else Te=De-55296<<10|Te-56320|65536,De=null;else{Te>56319||se+1===C.length?(k[X++]=239,k[X++]=191,k[X++]=189):De=Te;continue}else De&&(k[X++]=239,k[X++]=191,k[X++]=189,De=null);Te<128?k[X++]=Te:(Te<2048?k[X++]=Te>>6|192:(Te<65536?k[X++]=Te>>12|224:(k[X++]=Te>>18|240,k[X++]=Te>>12&63|128),k[X++]=Te>>6&63|128),k[X++]=Te&63|128)}return X}var Jf=3;function dd(k,C,X){k===1&&X.readMessage(ov,C)}function ov(k,C,X){if(k===3){var se=X.readMessage(Xd,{}),Te=se.id,De=se.bitmap,He=se.width,yt=se.height,qt=se.left,nr=se.top,dr=se.advance;C.push({id:Te,bitmap:new Jh({width:He+2*Jf,height:yt+2*Jf},De),metrics:{width:He,height:yt,left:qt,top:nr,advance:dr}})}}function Xd(k,C,X){k===1?C.id=X.readVarint():k===2?C.bitmap=X.readBytes():k===3?C.width=X.readVarint():k===4?C.height=X.readVarint():k===5?C.left=X.readSVarint():k===6?C.top=X.readSVarint():k===7&&(C.advance=X.readVarint())}function yv(k){return new Sn(k).readFields(dd,[])}var Pd=Jf;function $v(k){for(var C=0,X=0,se=0,Te=k;se=0;Kr--){var bn=yt[Kr];if(!(rn.w>bn.w||rn.h>bn.h)){if(rn.x=bn.x,rn.y=bn.y,nr=Math.max(nr,rn.y+rn.h),qt=Math.max(qt,rn.x+rn.w),rn.w===bn.w&&rn.h===bn.h){var Kn=yt.pop();Kr=0&&Te>=C&&Kv[this.text.charCodeAt(Te)];Te--)se--;this.text=this.text.substring(C,se),this.sectionIndex=this.sectionIndex.slice(C,se)},uf.prototype.substring=function(C,X){var se=new uf;return se.text=this.text.substring(C,X),se.sectionIndex=this.sectionIndex.slice(C,X),se.sections=this.sections,se},uf.prototype.toString=function(){return this.text},uf.prototype.getMaxScale=function(){var C=this;return this.sectionIndex.reduce(function(X,se){return Math.max(X,C.sections[se].scale)},0)},uf.prototype.addTextSection=function(C,X){this.text+=C.text,this.sections.push(sv.forText(C.scale,C.fontStack||X));for(var se=this.sections.length-1,Te=0;Te=n0?null:++this.imageSectionID:(this.imageSectionID=r0,this.imageSectionID)};function Rd(k,C){for(var X=[],se=k.text,Te=0,De=0,He=C;De=0,dr=0,Fr=0;Fr0&&nd>ss&&(ss=nd)}else{var ju=X[Ko.fontStack],Du=ju&&ju[ls];if(Du&&Du.rect)ol=Du.rect,Gl=Du.metrics;else{var cf=C[Ko.fontStack],Tf=cf&&cf[ls];if(!Tf)continue;Gl=Tf.metrics}ms=(Mi-Ko.scale)*br}Uu?(k.verticalizable=!0,mo.push({glyph:ls,imageName:Nu,x:rn,y:Kr+ms,vertical:Uu,scale:Ko.scale,fontStack:Ko.fontStack,sectionIndex:vl,metrics:Gl,rect:ol}),rn+=Vc*Ko.scale+nr):(mo.push({glyph:ls,imageName:Nu,x:rn,y:Kr+ms,vertical:Uu,scale:Ko.scale,fontStack:Ko.fontStack,sectionIndex:vl,metrics:Gl,rect:ol}),rn+=Gl.advance*Ko.scale+nr)}if(mo.length!==0){var xv=rn-nr;bn=Math.max(xv,bn),R6(mo,0,mo.length-1,ja,ss)}rn=0;var bv=De*Mi+ss;xo.lineOffset=Math.max(ss,Ki),Kr+=bv,Kn=Math.max(bv,Kn),++wa}var zd=Kr-wf,Sv=yT(He),Mv=Sv.horizontalAlign,vd=Sv.verticalAlign;I6(k.positionedLines,ja,Mv,vd,bn,Kn,De,zd,Te.length),k.top+=-vd*zd,k.bottom=k.top+zd,k.left+=-Mv*bn,k.right=k.left+bn}function R6(k,C,X,se,Te){if(!(!se&&!Te))for(var De=k[X],He=De.metrics.advance*De.scale,yt=(k[X].x+He)*se,qt=C;qt<=X;qt++)k[qt].x-=yt,k[qt].y+=Te}function I6(k,C,X,se,Te,De,He,yt,qt){var nr=(C-X)*Te,dr=0;De!==He?dr=-yt*se-wf:dr=(-se*qt+.5)*He;for(var Fr=0,rn=k;Fr-X/2;){if(He--,He<0)return!1;yt-=k[He].dist(De),De=k[He]}yt+=k[He].dist(k[He+1]),He++;for(var qt=[],nr=0;ytse;)nr-=qt.shift().angleDelta;if(nr>Te)return!1;He++,yt+=Fr.dist(rn)}return!0}function Yd(k){for(var C=0,X=0;Xnr){var bn=(nr-qt)/Kr,Kn=hu(Fr.x,rn.x,bn),ja=hu(Fr.y,rn.y,bn),wa=new f1(Kn,ja,rn.angleTo(Fr),dr);return wa._round(),!He||YS(k,wa,yt,He,C)?wa:void 0}qt+=Kr}}function Xg(k,C,X,se,Te,De,He,yt,qt){var nr=Jv(se,De,He),dr=$m(se,Te),Fr=dr*He,rn=k[0].x===0||k[0].x===qt||k[0].y===0||k[0].y===qt;C-Fr=0&&vi=0&&Mi=0&&rn+nr<=dr){var Ki=new f1(vi,Mi,mi,bn);Ki._round(),(!se||YS(k,Ki,De,se,Te))&&Kr.push(Ki)}}Fr+=wa}return!yt&&!Kr.length&&!He&&(Kr=i0(k,Fr/2,X,se,Te,De,He,!0,qt)),Kr}function f8(k,C,X,se,Te){for(var De=[],He=0;He=se&&Fr.x>=se)&&(dr.x>=se?dr=new i(se,dr.y+(Fr.y-dr.y)*((se-dr.x)/(Fr.x-dr.x)))._round():Fr.x>=se&&(Fr=new i(se,dr.y+(Fr.y-dr.y)*((se-dr.x)/(Fr.x-dr.x)))._round()),!(dr.y>=Te&&Fr.y>=Te)&&(dr.y>=Te?dr=new i(dr.x+(Fr.x-dr.x)*((Te-dr.y)/(Fr.y-dr.y)),Te)._round():Fr.y>=Te&&(Fr=new i(dr.x+(Fr.x-dr.x)*((Te-dr.y)/(Fr.y-dr.y)),Te)._round()),(!qt||!dr.equals(qt[qt.length-1]))&&(qt=[dr],De.push(qt)),qt.push(Fr)))))}return De}var bw=bf;function h8(k,C,X,se){var Te=[],De=k.image,He=De.pixelRatio,yt=De.paddedRect.w-2*bw,qt=De.paddedRect.h-2*bw,nr=k.right-k.left,dr=k.bottom-k.top,Fr=De.stretchX||[[0,yt]],rn=De.stretchY||[[0,qt]],Kr=function(ju,Du){return ju+Du[1]-Du[0]},bn=Fr.reduce(Kr,0),Kn=rn.reduce(Kr,0),ja=yt-bn,wa=qt-Kn,mi=0,Ja=bn,vi=0,Mi=Kn,Ki=0,xo=ja,mo=0,ss=wa;if(De.content&&se){var Bo=De.content;mi=ZS(Fr,0,Bo[0]),vi=ZS(rn,0,Bo[1]),Ja=ZS(Fr,Bo[0],Bo[2]),Mi=ZS(rn,Bo[1],Bo[3]),Ki=Bo[0]-mi,mo=Bo[1]-vi,xo=Bo[2]-Bo[0]-Ja,ss=Bo[3]-Bo[1]-Mi}var Ko=function(ju,Du,cf,Tf){var ph=WS(ju.stretch-mi,Ja,nr,k.left),Ch=$S(ju.fixed-Ki,xo,ju.stretch,bn),Dd=WS(Du.stretch-vi,Mi,dr,k.top),nd=$S(Du.fixed-mo,ss,Du.stretch,Kn),xv=WS(cf.stretch-mi,Ja,nr,k.left),bv=$S(cf.fixed-Ki,xo,cf.stretch,bn),zd=WS(Tf.stretch-vi,Mi,dr,k.top),Sv=$S(Tf.fixed-mo,ss,Tf.stretch,Kn),Mv=new i(ph,Dd),vd=new i(xv,Dd),Ev=new i(xv,zd),Lp=new i(ph,zd),Wg=new i(Ch/He,nd/He),p1=new i(bv/He,Sv/He),m1=C*Math.PI/180;if(m1){var g1=Math.sin(m1),Cw=Math.cos(m1),E0=[Cw,-g1,g1,Cw];Mv._matMult(E0),vd._matMult(E0),Lp._matMult(E0),Ev._matMult(E0)}var rM=ju.stretch+ju.fixed,V6=cf.stretch+cf.fixed,nM=Du.stretch+Du.fixed,H6=Tf.stretch+Tf.fixed,o0={x:De.paddedRect.x+bw+rM,y:De.paddedRect.y+bw+nM,w:V6-rM,h:H6-nM},Lw=xo/He/nr,aM=ss/He/dr;return{tl:Mv,tr:vd,bl:Lp,br:Ev,tex:o0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Wg,pixelOffsetBR:p1,minFontScaleX:Lw,minFontScaleY:aM,isSDF:X}};if(!se||!De.stretchX&&!De.stretchY)Te.push(Ko({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:yt+1},{fixed:0,stretch:qt+1}));else for(var vl=d8(Fr,ja,bn),ls=d8(rn,wa,Kn),ms=0;ms0&&(bn=Math.max(10,bn),this.circleDiameter=bn)}else{var Kn=He.top*yt-qt,ja=He.bottom*yt+qt,wa=He.left*yt-qt,mi=He.right*yt+qt,Ja=He.collisionPadding;if(Ja&&(wa-=Ja[0]*yt,Kn-=Ja[1]*yt,mi+=Ja[2]*yt,ja+=Ja[3]*yt),dr){var vi=new i(wa,Kn),Mi=new i(mi,Kn),Ki=new i(wa,ja),xo=new i(mi,ja),mo=dr*Math.PI/180;vi._rotate(mo),Mi._rotate(mo),Ki._rotate(mo),xo._rotate(mo),wa=Math.min(vi.x,Mi.x,Ki.x,xo.x),mi=Math.max(vi.x,Mi.x,Ki.x,xo.x),Kn=Math.min(vi.y,Mi.y,Ki.y,xo.y),ja=Math.max(vi.y,Mi.y,Ki.y,xo.y)}C.emplaceBack(X.x,X.y,wa,Kn,mi,ja,se,Te,De)}this.boxEndIndex=C.length},ww=function(C,X){if(C===void 0&&(C=[]),X===void 0&&(X=oF),this.data=C,this.length=this.data.length,this.compare=X,this.length>0)for(var se=(this.length>>1)-1;se>=0;se--)this._down(se)};ww.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},ww.prototype.pop=function(){if(this.length!==0){var C=this.data[0],X=this.data.pop();return this.length--,this.length>0&&(this.data[0]=X,this._down(0)),C}},ww.prototype.peek=function(){return this.data[0]},ww.prototype._up=function(C){for(var X=this,se=X.data,Te=X.compare,De=se[C];C>0;){var He=C-1>>1,yt=se[He];if(Te(De,yt)>=0)break;se[C]=yt,C=He}se[C]=De},ww.prototype._down=function(C){for(var X=this,se=X.data,Te=X.compare,De=this.length>>1,He=se[C];C=0)break;se[C]=qt,C=yt}se[C]=He};function oF(k,C){return kC?1:0}function sF(k,C,X){X===void 0&&(X=!1);for(var se=1/0,Te=1/0,De=-1/0,He=-1/0,yt=k[0],qt=0;qtDe)&&(De=nr.x),(!qt||nr.y>He)&&(He=nr.y)}var dr=De-se,Fr=He-Te,rn=Math.min(dr,Fr),Kr=rn/2,bn=new ww([],lF);if(rn===0)return new i(se,Te);for(var Kn=se;Knwa.d||!wa.d)&&(wa=Ja,X&&console.log("found best %d after %d probes",Math.round(1e4*Ja.d)/1e4,mi)),!(Ja.max-wa.d<=C)&&(Kr=Ja.h/2,bn.push(new Tw(Ja.p.x-Kr,Ja.p.y-Kr,Kr,k)),bn.push(new Tw(Ja.p.x+Kr,Ja.p.y-Kr,Kr,k)),bn.push(new Tw(Ja.p.x-Kr,Ja.p.y+Kr,Kr,k)),bn.push(new Tw(Ja.p.x+Kr,Ja.p.y+Kr,Kr,k)),mi+=4)}return X&&(console.log("num probes: "+mi),console.log("best distance: "+wa.d)),wa.p}function lF(k,C){return C.max-k.max}function Tw(k,C,X,se){this.p=new i(k,C),this.h=X,this.d=uF(this.p,se),this.max=this.d+this.h*Math.SQRT2}function uF(k,C){for(var X=!1,se=1/0,Te=0;Tek.y!=dr.y>k.y&&k.x<(dr.x-nr.x)*(k.y-nr.y)/(dr.y-nr.y)+nr.x&&(X=!X),se=Math.min(se,J0(k,nr,dr))}return(X?1:-1)*Math.sqrt(se)}function cF(k){for(var C=0,X=0,se=0,Te=k[0],De=0,He=Te.length,yt=He-1;De=qi||E0.y<0||E0.y>=qi||dF(k,E0,Cw,X,se,Te,ls,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,wa,Mi,mo,qt,Ja,Ki,ss,Kr,C,De,nr,dr,He)};if(Bo==="line")for(var Gl=0,ol=f8(C.geometry,0,0,qi,qi);Gl1){var Dd=a0(Ch,xo,X.vertical||bn,se,Kn,mi);Dd&&ms(Ch,Dd)}}else if(C.type==="Polygon")for(var nd=0,xv=S0(C.geometry,0);ndd1&&j(k.layerIds[0]+': Value for "text-size" is >= '+xT+'. Reduce your "text-size".')):ja.kind==="composite"&&(wa=[ed*Kr.compositeTextSizes[0].evaluate(He,{},bn),ed*Kr.compositeTextSizes[1].evaluate(He,{},bn)],(wa[0]>d1||wa[1]>d1)&&j(k.layerIds[0]+': Value for "text-size" is >= '+xT+'. Reduce your "text-size".')),k.addSymbols(k.text,Kn,wa,yt,De,He,nr,C,qt.lineStartIndex,qt.lineLength,rn,bn);for(var mi=0,Ja=dr;mid1&&j(k.layerIds[0]+': Value for "icon-size" is >= '+xT+'. Reduce your "icon-size".')):Mv.kind==="composite"&&(vd=[ed*Mi.compositeIconSizes[0].evaluate(vi,{},xo),ed*Mi.compositeIconSizes[1].evaluate(vi,{},xo)],(vd[0]>d1||vd[1]>d1)&&j(k.layerIds[0]+': Value for "icon-size" is >= '+xT+'. Reduce your "icon-size".')),k.addSymbols(k.icon,zd,vd,Ja,mi,vi,!1,C,Bo.lineStartIndex,Bo.lineLength,-1,xo),Uu=k.icon.placedSymbolArray.length-1,Sv&&(ol=Sv.length*4,k.addSymbols(k.icon,Sv,vd,Ja,mi,vi,Hf.vertical,C,Bo.lineStartIndex,Bo.lineLength,-1,xo),ju=k.icon.placedSymbolArray.length-1)}for(var Ev in se.horizontal){var Lp=se.horizontal[Ev];if(!Ko){cf=_e(Lp.text);var Wg=yt.layout.get("text-rotate").evaluate(vi,{},xo);Ko=new KS(qt,C,nr,dr,Fr,Lp,rn,Kr,bn,Wg)}var p1=Lp.positionedLines.length===1;if(Nu+=p8(k,C,Lp,De,yt,bn,vi,Kn,Bo,se.vertical?Hf.horizontal:Hf.horizontalOnly,p1?Object.keys(se.horizontal):[Ev],Du,Uu,Mi,xo),p1)break}se.vertical&&(Vc+=p8(k,C,se.vertical,De,yt,bn,vi,Kn,Bo,Hf.vertical,["vertical"],Du,ju,Mi,xo));var m1=Ko?Ko.boxStartIndex:k.collisionBoxArray.length,g1=Ko?Ko.boxEndIndex:k.collisionBoxArray.length,Cw=ls?ls.boxStartIndex:k.collisionBoxArray.length,E0=ls?ls.boxEndIndex:k.collisionBoxArray.length,rM=vl?vl.boxStartIndex:k.collisionBoxArray.length,V6=vl?vl.boxEndIndex:k.collisionBoxArray.length,nM=ms?ms.boxStartIndex:k.collisionBoxArray.length,H6=ms?ms.boxEndIndex:k.collisionBoxArray.length,o0=-1,Lw=function(TT,R8){return TT&&TT.circleDiameter?Math.max(TT.circleDiameter,R8):R8};o0=Lw(Ko,o0),o0=Lw(ls,o0),o0=Lw(vl,o0),o0=Lw(ms,o0);var aM=o0>-1?1:0;aM&&(o0*=mo/br),k.glyphOffsetArray.length>=qc.MAX_GLYPHS&&j("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),vi.sortKey!==void 0&&k.addToSortKeyRanges(k.symbolInstances.length,vi.sortKey),k.symbolInstances.emplaceBack(C.x,C.y,Du.right>=0?Du.right:-1,Du.center>=0?Du.center:-1,Du.left>=0?Du.left:-1,Du.vertical||-1,Uu,ju,cf,m1,g1,Cw,E0,rM,V6,nM,H6,nr,Nu,Vc,Gl,ol,aM,0,rn,Tf,ph,o0)}function vF(k,C,X,se){var Te=k.compareText;if(!(C in Te))Te[C]=[];else for(var De=Te[C],He=De.length-1;He>=0;He--)if(se.dist(De[He])0)&&(He.value.kind!=="constant"||He.value.value.length>0),dr=qt.value.kind!=="constant"||!!qt.value.value||Object.keys(qt.parameters).length>0,Fr=De.get("symbol-sort-key");if(this.features=[],!(!nr&&!dr)){for(var rn=X.iconDependencies,Kr=X.glyphDependencies,bn=X.availableImages,Kn=new El(this.zoom),ja=0,wa=C;ja=0;for(var Vc=0,Uu=ss.sections;Vc=0;qt--)He[qt]={x:X[qt].x,y:X[qt].y,tileUnitDistanceFromAnchor:De},qt>0&&(De+=X[qt-1].dist(X[qt]));for(var nr=0;nr0},qc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},qc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},qc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},qc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},qc.prototype.addIndicesForPlacedSymbol=function(C,X){for(var se=C.placedSymbolArray.get(X),Te=se.vertexStartIndex+se.numGlyphs*4,De=se.vertexStartIndex;De1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(C),this.sortedAngle=C,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var se=0,Te=this.symbolInstanceIndexes;se=0&&nr.indexOf(yt)===qt&&X.addIndicesForPlacedSymbol(X.text,yt)}),He.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,He.verticalPlacedTextSymbolIndex),He.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,He.placedIconSymbolIndex),He.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,He.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},tr("SymbolBucket",qc,{omit:["layers","collisionBoxArray","features","compareText"]}),qc.MAX_GLYPHS=65535,qc.addDynamicAttributes=B6;function yF(k,C){return C.replace(/{([^{}]+)}/g,function(X,se){return se in k?String(k[se]):""})}var _F=new Za({"symbol-placement":new yn(fi.layout_symbol["symbol-placement"]),"symbol-spacing":new yn(fi.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new yn(fi.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new mn(fi.layout_symbol["symbol-sort-key"]),"symbol-z-order":new yn(fi.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new yn(fi.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new yn(fi.layout_symbol["icon-ignore-placement"]),"icon-optional":new yn(fi.layout_symbol["icon-optional"]),"icon-rotation-alignment":new yn(fi.layout_symbol["icon-rotation-alignment"]),"icon-size":new mn(fi.layout_symbol["icon-size"]),"icon-text-fit":new yn(fi.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new yn(fi.layout_symbol["icon-text-fit-padding"]),"icon-image":new mn(fi.layout_symbol["icon-image"]),"icon-rotate":new mn(fi.layout_symbol["icon-rotate"]),"icon-padding":new yn(fi.layout_symbol["icon-padding"]),"icon-keep-upright":new yn(fi.layout_symbol["icon-keep-upright"]),"icon-offset":new mn(fi.layout_symbol["icon-offset"]),"icon-anchor":new mn(fi.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new yn(fi.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new yn(fi.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new yn(fi.layout_symbol["text-rotation-alignment"]),"text-field":new mn(fi.layout_symbol["text-field"]),"text-font":new mn(fi.layout_symbol["text-font"]),"text-size":new mn(fi.layout_symbol["text-size"]),"text-max-width":new mn(fi.layout_symbol["text-max-width"]),"text-line-height":new yn(fi.layout_symbol["text-line-height"]),"text-letter-spacing":new mn(fi.layout_symbol["text-letter-spacing"]),"text-justify":new mn(fi.layout_symbol["text-justify"]),"text-radial-offset":new mn(fi.layout_symbol["text-radial-offset"]),"text-variable-anchor":new yn(fi.layout_symbol["text-variable-anchor"]),"text-anchor":new mn(fi.layout_symbol["text-anchor"]),"text-max-angle":new yn(fi.layout_symbol["text-max-angle"]),"text-writing-mode":new yn(fi.layout_symbol["text-writing-mode"]),"text-rotate":new mn(fi.layout_symbol["text-rotate"]),"text-padding":new yn(fi.layout_symbol["text-padding"]),"text-keep-upright":new yn(fi.layout_symbol["text-keep-upright"]),"text-transform":new mn(fi.layout_symbol["text-transform"]),"text-offset":new mn(fi.layout_symbol["text-offset"]),"text-allow-overlap":new yn(fi.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new yn(fi.layout_symbol["text-ignore-placement"]),"text-optional":new yn(fi.layout_symbol["text-optional"])}),xF=new Za({"icon-opacity":new mn(fi.paint_symbol["icon-opacity"]),"icon-color":new mn(fi.paint_symbol["icon-color"]),"icon-halo-color":new mn(fi.paint_symbol["icon-halo-color"]),"icon-halo-width":new mn(fi.paint_symbol["icon-halo-width"]),"icon-halo-blur":new mn(fi.paint_symbol["icon-halo-blur"]),"icon-translate":new yn(fi.paint_symbol["icon-translate"]),"icon-translate-anchor":new yn(fi.paint_symbol["icon-translate-anchor"]),"text-opacity":new mn(fi.paint_symbol["text-opacity"]),"text-color":new mn(fi.paint_symbol["text-color"],{runtimeType:Xl,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new mn(fi.paint_symbol["text-halo-color"]),"text-halo-width":new mn(fi.paint_symbol["text-halo-width"]),"text-halo-blur":new mn(fi.paint_symbol["text-halo-blur"]),"text-translate":new yn(fi.paint_symbol["text-translate"]),"text-translate-anchor":new yn(fi.paint_symbol["text-translate-anchor"])}),N6={paint:xF,layout:_F},Mw=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:Au,this.defaultValue=C};Mw.prototype.evaluate=function(C){if(C.formattedSection){var X=this.defaultValue.property.overrides;if(X&&X.hasOverride(C.formattedSection))return X.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default},Mw.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var X=this.defaultValue.value;C(X._styleExpression.expression)}},Mw.prototype.outputDefined=function(){return!1},Mw.prototype.serialize=function(){return null},tr("FormatSectionOverride",Mw,{omit:["defaultValue"]});var bF=(function(k){function C(X){k.call(this,X,N6)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(se,Te){if(k.prototype.recalculate.call(this,se,Te),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var De=this.layout.get("text-writing-mode");if(De){for(var He=[],yt=0,qt=De;yt",targetMapId:Te,sourceMapId:He.mapId})}}},Ew.prototype.receive=function(C){var X=C.data,se=X.id;if(se&&!(X.targetMapId&&this.mapId!==X.targetMapId))if(X.type===""){delete this.tasks[se];var Te=this.cancelCallbacks[se];delete this.cancelCallbacks[se],Te&&Te()}else le()||X.mustQueue?(this.tasks[se]=X,this.taskQueue.push(se),this.invoker.trigger()):this.processTask(se,X)},Ew.prototype.process=function(){if(this.taskQueue.length){var C=this.taskQueue.shift(),X=this.tasks[C];delete this.tasks[C],this.taskQueue.length&&this.invoker.trigger(),X&&this.processTask(C,X)}},Ew.prototype.processTask=function(C,X){var se=this;if(X.type===""){var Te=this.callbacks[C];delete this.callbacks[C],Te&&(X.error?Te(dn(X.error)):Te(null,dn(X.data)))}else{var De=!1,He=ee(this.globalScope)?void 0:[],yt=X.hasCallback?function(rn,Kr){De=!0,delete se.cancelCallbacks[C],se.target.postMessage({id:C,type:"",sourceMapId:se.mapId,error:rn?Xr(rn):null,data:Xr(Kr,He)},He)}:function(rn){De=!0},qt=null,nr=dn(X.data);if(this.parent[X.type])qt=this.parent[X.type](X.sourceMapId,nr,yt);else if(this.parent.getWorkerSource){var dr=X.type.split("."),Fr=this.parent.getWorkerSource(X.sourceMapId,dr[0],nr.source);qt=Fr[dr[1]](nr,yt)}else yt(new Error("Could not find function "+X.type));!De&&qt&&qt.cancel&&(this.cancelCallbacks[C]=qt.cancel)}},Ew.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function RF(k,C,X){C=Math.pow(2,X)-C-1;var se=b8(k*256,C*256,X),Te=b8((k+1)*256,(C+1)*256,X);return se[0]+","+se[1]+","+Te[0]+","+Te[1]}function b8(k,C,X){var se=2*Math.PI*6378137/256/Math.pow(2,X),Te=k*se-2*Math.PI*6378137/2,De=C*se-2*Math.PI*6378137/2;return[Te,De]}var td=function(C,X){C&&(X?this.setSouthWest(C).setNorthEast(X):C.length===4?this.setSouthWest([C[0],C[1]]).setNorthEast([C[2],C[3]]):this.setSouthWest(C[0]).setNorthEast(C[1]))};td.prototype.setNorthEast=function(C){return this._ne=C instanceof Gf?new Gf(C.lng,C.lat):Gf.convert(C),this},td.prototype.setSouthWest=function(C){return this._sw=C instanceof Gf?new Gf(C.lng,C.lat):Gf.convert(C),this},td.prototype.extend=function(C){var X=this._sw,se=this._ne,Te,De;if(C instanceof Gf)Te=C,De=C;else if(C instanceof td){if(Te=C._sw,De=C._ne,!Te||!De)return this}else{if(Array.isArray(C))if(C.length===4||C.every(Array.isArray)){var He=C;return this.extend(td.convert(He))}else{var yt=C;return this.extend(Gf.convert(yt))}return this}return!X&&!se?(this._sw=new Gf(Te.lng,Te.lat),this._ne=new Gf(De.lng,De.lat)):(X.lng=Math.min(Te.lng,X.lng),X.lat=Math.min(Te.lat,X.lat),se.lng=Math.max(De.lng,se.lng),se.lat=Math.max(De.lat,se.lat)),this},td.prototype.getCenter=function(){return new Gf((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},td.prototype.getSouthWest=function(){return this._sw},td.prototype.getNorthEast=function(){return this._ne},td.prototype.getNorthWest=function(){return new Gf(this.getWest(),this.getNorth())},td.prototype.getSouthEast=function(){return new Gf(this.getEast(),this.getSouth())},td.prototype.getWest=function(){return this._sw.lng},td.prototype.getSouth=function(){return this._sw.lat},td.prototype.getEast=function(){return this._ne.lng},td.prototype.getNorth=function(){return this._ne.lat},td.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},td.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},td.prototype.isEmpty=function(){return!(this._sw&&this._ne)},td.prototype.contains=function(C){var X=Gf.convert(C),se=X.lng,Te=X.lat,De=this._sw.lat<=Te&&Te<=this._ne.lat,He=this._sw.lng<=se&&se<=this._ne.lng;return this._sw.lng>this._ne.lng&&(He=this._sw.lng>=se&&se>=this._ne.lng),De&&He},td.convert=function(C){return!C||C instanceof td?C:new td(C)};var w8=63710088e-1,Gf=function(C,X){if(isNaN(C)||isNaN(X))throw new Error("Invalid LngLat object: ("+C+", "+X+")");if(this.lng=+C,this.lat=+X,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Gf.prototype.wrap=function(){return new Gf(g(this.lng,-180,180),this.lat)},Gf.prototype.toArray=function(){return[this.lng,this.lat]},Gf.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Gf.prototype.distanceTo=function(C){var X=Math.PI/180,se=this.lat*X,Te=C.lat*X,De=Math.sin(se)*Math.sin(Te)+Math.cos(se)*Math.cos(Te)*Math.cos((C.lng-this.lng)*X),He=w8*Math.acos(Math.min(De,1));return He},Gf.prototype.toBounds=function(C){C===void 0&&(C=0);var X=40075017,se=360*C/X,Te=se/Math.cos(Math.PI/180*this.lat);return new td(new Gf(this.lng-Te,this.lat-se),new Gf(this.lng+Te,this.lat+se))},Gf.convert=function(C){if(C instanceof Gf)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new Gf(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new Gf(Number("lng"in C?C.lng:C.lon),Number(C.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var T8=2*Math.PI*w8;function A8(k){return T8*Math.cos(k*Math.PI/180)}function S8(k){return(180+k)/360}function M8(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function E8(k,C){return k/A8(C)}function IF(k){return k*360-180}function j6(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function DF(k,C){return k*A8(j6(C))}function zF(k){return 1/Math.cos(k*Math.PI/180)}var J_=function(C,X,se){se===void 0&&(se=0),this.x=+C,this.y=+X,this.z=+se};J_.fromLngLat=function(C,X){X===void 0&&(X=0);var se=Gf.convert(C);return new J_(S8(se.lng),M8(se.lat),E8(X,se.lat))},J_.prototype.toLngLat=function(){return new Gf(IF(this.x),j6(this.y))},J_.prototype.toAltitude=function(){return DF(this.z,this.y)},J_.prototype.meterInMercatorCoordinateUnits=function(){return 1/T8*zF(j6(this.y))};var Q_=function(C,X,se){this.z=C,this.x=X,this.y=se,this.key=wT(0,C,C,X,se)};Q_.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},Q_.prototype.url=function(C,X){var se=RF(this.x,this.y,this.z),Te=OF(this.z,this.x,this.y);return C[(this.x+this.y)%C.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(X==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",Te).replace("{bbox-epsg-3857}",se)},Q_.prototype.getTilePoint=function(C){var X=Math.pow(2,this.z);return new i((C.x*X-this.x)*qi,(C.y*X-this.y)*qi)},Q_.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var k8=function(C,X){this.wrap=C,this.canonical=X,this.key=wT(C,X.z,X.z,X.x,X.y)},rd=function(C,X,se,Te,De){this.overscaledZ=C,this.wrap=X,this.canonical=new Q_(se,+Te,+De),this.key=wT(X,C,se,Te,De)};rd.prototype.equals=function(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)},rd.prototype.scaledTo=function(C){var X=this.canonical.z-C;return C>this.canonical.z?new rd(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new rd(C,this.wrap,C,this.canonical.x>>X,this.canonical.y>>X)},rd.prototype.calculateScaledKey=function(C,X){var se=this.canonical.z-C;return C>this.canonical.z?wT(this.wrap*+X,C,this.canonical.z,this.canonical.x,this.canonical.y):wT(this.wrap*+X,C,C,this.canonical.x>>se,this.canonical.y>>se)},rd.prototype.isChildOf=function(C){if(C.wrap!==this.wrap)return!1;var X=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ>X&&C.canonical.y===this.canonical.y>>X},rd.prototype.children=function(C){if(this.overscaledZ>=C)return[new rd(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var X=this.canonical.z+1,se=this.canonical.x*2,Te=this.canonical.y*2;return[new rd(X,this.wrap,X,se,Te),new rd(X,this.wrap,X,se+1,Te),new rd(X,this.wrap,X,se,Te+1),new rd(X,this.wrap,X,se+1,Te+1)]},rd.prototype.isLessThan=function(C){return this.wrapC.wrap?!1:this.overscaledZC.overscaledZ?!1:this.canonical.xC.canonical.x?!1:this.canonical.y0;De--)Te=1<=this.dim+1||X<-1||X>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(X+1)*this.stride+(C+1)},Yg.prototype._unpackMapbox=function(C,X,se){return(C*256*256+X*256+se)/10-1e4},Yg.prototype._unpackTerrarium=function(C,X,se){return C*256+X+se/256-32768},Yg.prototype.getPixels=function(){return new Hd({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Yg.prototype.backfillBorder=function(C,X,se){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");var Te=X*this.dim,De=X*this.dim+this.dim,He=se*this.dim,yt=se*this.dim+this.dim;switch(X){case-1:Te=De-1;break;case 1:De=Te+1;break}switch(se){case-1:He=yt-1;break;case 1:yt=He+1;break}for(var qt=-X*this.dim,nr=-se*this.dim,dr=He;dr=0&&Fr[3]>=0&&qt.insert(yt,Fr[0],Fr[1],Fr[2],Fr[3])}},Zg.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Gg.VectorTile(new Sn(this.rawTileData)).layers,this.sourceLayerCoder=new eM(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Zg.prototype.query=function(C,X,se,Te){var De=this;this.loadVTLayers();for(var He=C.params||{},yt=qi/C.tileSize/C.scale,qt=tt(He.filter),nr=C.queryGeometry,dr=C.queryPadding*yt,Fr=L8(nr),rn=this.grid.query(Fr.minX-dr,Fr.minY-dr,Fr.maxX+dr,Fr.maxY+dr),Kr=L8(C.cameraQueryGeometry),bn=this.grid3D.query(Kr.minX-dr,Kr.minY-dr,Kr.maxX+dr,Kr.maxY+dr,function(Ki,xo,mo,ss){return Ep(C.cameraQueryGeometry,Ki-dr,xo-dr,mo+dr,ss+dr)}),Kn=0,ja=bn;KnTe)De=!1;else if(!X)De=!0;else if(this.expirationTime=qr.maxzoom)&&qr.visibility!=="none"){f(Dr,this.zoom,ur);var un=pa[qr.id]=qr.createBucket({index:Qn.bucketLayerIDs.length,layers:Dr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:pi,sourceID:this.source});un.populate(Si,ha,this.tileID.canonical),Qn.bucketLayerIDs.push(Dr.map(function(fn){return fn.id}))}}}}var Jr,At,lr,zr,cn=e.mapObject(ha.glyphDependencies,function(fn){return Object.keys(fn).map(Number)});Object.keys(cn).length?Gr.send("getGlyphs",{uid:this.uid,stacks:cn},function(fn,In){Jr||(Jr=fn,At=In,jn.call(gn))}):At={};var Rn=Object.keys(ha.iconDependencies);Rn.length?Gr.send("getImages",{icons:Rn,source:this.source,tileID:this.tileID,type:"icons"},function(fn,In){Jr||(Jr=fn,lr=In,jn.call(gn))}):lr={};var qn=Object.keys(ha.patternDependencies);qn.length?Gr.send("getImages",{icons:qn,source:this.source,tileID:this.tileID,type:"patterns"},function(fn,In){Jr||(Jr=fn,zr=In,jn.call(gn))}):zr={},jn.call(this);function jn(){if(Jr)return ln(Jr);if(At&&lr&&zr){var fn=new a(At),In=new e.ImageAtlas(lr,zr);for(var gi in pa){var Ea=pa[gi];Ea instanceof e.SymbolBucket?(f(Ea.layers,this.zoom,ur),e.performSymbolLayout(Ea,At,fn.positions,lr,In.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ea.hasPattern&&(Ea instanceof e.LineBucket||Ea instanceof e.FillBucket||Ea instanceof e.FillExtrusionBucket)&&(f(Ea.layers,this.zoom,ur),Ea.addFeatures(ha,this.tileID.canonical,In.patternPositions))}this.status="done",ln(null,{buckets:e.values(pa).filter(function(Ci){return!Ci.isEmpty()}),featureIndex:Qn,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:fn.image,imageAtlas:In,glyphMap:this.returnDependencies?At:null,iconMap:this.returnDependencies?lr:null,glyphPositions:this.returnDependencies?fn.positions:null})}}};function f(sr,Vt,or){for(var ur=new e.EvaluationParameters(Vt),Gr=0,ln=sr;Gr=0!=!!Vt&&sr.reverse()}var M=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,_=function(Vt){this._feature=Vt,this.extent=e.EXTENT,this.type=Vt.type,this.properties=Vt.tags,"id"in Vt&&!isNaN(Vt.id)&&(this.id=parseInt(Vt.id,10))};_.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Vt=[],or=0,ur=this._feature.geometry;or"u"&&(ur.push(An),Qn=ur.length-1,ln[An]=Qn),Vt.writeVarint(Qn);var pa=or.properties[An],ha=typeof pa;ha!=="string"&&ha!=="boolean"&&ha!=="number"&&(pa=JSON.stringify(pa));var _a=ha+":"+pa,Ca=gn[_a];typeof Ca>"u"&&(Gr.push(pa),Ca=Gr.length-1,gn[_a]=Ca),Vt.writeVarint(Ca)}}function re(sr,Vt){return(Vt<<3)+(sr&7)}function fe(sr){return sr<<1^sr>>31}function le(sr,Vt){for(var or=sr.loadGeometry(),ur=sr.type,Gr=0,ln=0,gn=or.length,An=0;An>1;ee(sr,Vt,gn,ur,Gr,ln%2),V(sr,Vt,or,ur,gn-1,ln+1),V(sr,Vt,or,gn+1,Gr,ln+1)}}function ee(sr,Vt,or,ur,Gr,ln){for(;Gr>ur;){if(Gr-ur>600){var gn=Gr-ur+1,An=or-ur+1,Qn=Math.log(gn),pa=.5*Math.exp(2*Qn/3),ha=.5*Math.sqrt(Qn*pa*(gn-pa)/gn)*(An-gn/2<0?-1:1),_a=Math.max(ur,Math.floor(or-An*pa/gn+ha)),Ca=Math.min(Gr,Math.floor(or+(gn-An)*pa/gn+ha));ee(sr,Vt,or,_a,Ca,ln)}var Hn=Vt[2*or+ln],pi=ur,Si=Gr;for(ne(sr,Vt,ur,or),Vt[2*Gr+ln]>Hn&&ne(sr,Vt,ur,Gr);piHn;)Si--}Vt[2*ur+ln]===Hn?ne(sr,Vt,ur,Si):(Si++,ne(sr,Vt,Si,Gr)),Si<=or&&(ur=Si+1),or<=Si&&(Gr=Si-1)}}function ne(sr,Vt,or,ur){$(sr,or,ur),$(Vt,2*or,2*ur),$(Vt,2*or+1,2*ur+1)}function $(sr,Vt,or){var ur=sr[Vt];sr[Vt]=sr[or],sr[or]=ur}function ue(sr,Vt,or,ur,Gr,ln,gn){for(var An=[0,sr.length-1,0],Qn=[],pa,ha;An.length;){var _a=An.pop(),Ca=An.pop(),Hn=An.pop();if(Ca-Hn<=gn){for(var pi=Hn;pi<=Ca;pi++)pa=Vt[2*pi],ha=Vt[2*pi+1],pa>=or&&pa<=Gr&&ha>=ur&&ha<=ln&&Qn.push(sr[pi]);continue}var Si=Math.floor((Hn+Ca)/2);pa=Vt[2*Si],ha=Vt[2*Si+1],pa>=or&&pa<=Gr&&ha>=ur&&ha<=ln&&Qn.push(sr[Si]);var Dt=(_a+1)%2;(_a===0?or<=pa:ur<=ha)&&(An.push(Hn),An.push(Si-1),An.push(Dt)),(_a===0?Gr>=pa:ln>=ha)&&(An.push(Si+1),An.push(Ca),An.push(Dt))}return Qn}function te(sr,Vt,or,ur,Gr,ln){for(var gn=[0,sr.length-1,0],An=[],Qn=Gr*Gr;gn.length;){var pa=gn.pop(),ha=gn.pop(),_a=gn.pop();if(ha-_a<=ln){for(var Ca=_a;Ca<=ha;Ca++)H(Vt[2*Ca],Vt[2*Ca+1],or,ur)<=Qn&&An.push(sr[Ca]);continue}var Hn=Math.floor((_a+ha)/2),pi=Vt[2*Hn],Si=Vt[2*Hn+1];H(pi,Si,or,ur)<=Qn&&An.push(sr[Hn]);var Dt=(pa+1)%2;(pa===0?or-Gr<=pi:ur-Gr<=Si)&&(gn.push(_a),gn.push(Hn-1),gn.push(Dt)),(pa===0?or+Gr>=pi:ur+Gr>=Si)&&(gn.push(Hn+1),gn.push(ha),gn.push(Dt))}return An}function H(sr,Vt,or,ur){var Gr=sr-or,ln=Vt-ur;return Gr*Gr+ln*ln}var ae=function(sr){return sr[0]},ie=function(sr){return sr[1]},de=function(Vt,or,ur,Gr,ln){or===void 0&&(or=ae),ur===void 0&&(ur=ie),Gr===void 0&&(Gr=64),ln===void 0&&(ln=Float64Array),this.nodeSize=Gr,this.points=Vt;for(var gn=Vt.length<65536?Uint16Array:Uint32Array,An=this.ids=new gn(Vt.length),Qn=this.coords=new ln(Vt.length*2),pa=0;pa=Gr;ha--){var _a=+Date.now();Qn=this._cluster(Qn,ha),this.trees[ha]=new de(Qn,pe,Ne,gn,Float32Array),ur&&console.log("z%d: %d clusters in %dms",ha,Qn.length,+Date.now()-_a)}return ur&&console.timeEnd("total time"),this},Le.prototype.getClusters=function(Vt,or){var ur=((Vt[0]+180)%360+360)%360-180,Gr=Math.max(-90,Math.min(90,Vt[1])),ln=Vt[2]===180?180:((Vt[2]+180)%360+360)%360-180,gn=Math.max(-90,Math.min(90,Vt[3]));if(Vt[2]-Vt[0]>=360)ur=-180,ln=180;else if(ur>ln){var An=this.getClusters([ur,Gr,180,gn],or),Qn=this.getClusters([-180,Gr,ln,gn],or);return An.concat(Qn)}for(var pa=this.trees[this._limitZoom(or)],ha=pa.range(ct(ur),at(gn),ct(ln),at(Gr)),_a=[],Ca=0,Hn=ha;Caor&&(Si+=jr.numPoints||1)}if(Si>=Qn){for(var Vr=_a.x*pi,Dr=_a.y*pi,qr=An&&pi>1?this._map(_a,!0):null,un=(ha<<5)+(or+1)+this.points.length,Jr=0,At=Hn;Jr1)for(var Rn=0,qn=Hn;Rn>5},Le.prototype._getOriginZoom=function(Vt){return(Vt-this.points.length)%32},Le.prototype._map=function(Vt,or){if(Vt.numPoints)return or?Ae({},Vt.properties):Vt.properties;var ur=this.points[Vt.index].properties,Gr=this.options.map(ur);return or&&Gr===ur?Ae({},Gr):Gr};function Fe(sr,Vt,or,ur,Gr){return{x:sr,y:Vt,zoom:1/0,id:or,parentId:-1,numPoints:ur,properties:Gr}}function ze(sr,Vt){var or=sr.geometry.coordinates,ur=or[0],Gr=or[1];return{x:ct(ur),y:at(Gr),zoom:1/0,index:Vt,parentId:-1}}function Ye(sr){return{type:"Feature",id:sr.id,properties:st(sr),geometry:{type:"Point",coordinates:[et(sr.x),Pe(sr.y)]}}}function st(sr){var Vt=sr.numPoints,or=Vt>=1e4?Math.round(Vt/1e3)+"k":Vt>=1e3?Math.round(Vt/100)/10+"k":Vt;return Ae(Ae({},sr.properties),{cluster:!0,cluster_id:sr.id,point_count:Vt,point_count_abbreviated:or})}function ct(sr){return sr/360+.5}function at(sr){var Vt=Math.sin(sr*Math.PI/180),or=.5-.25*Math.log((1+Vt)/(1-Vt))/Math.PI;return or<0?0:or>1?1:or}function et(sr){return(sr-.5)*360}function Pe(sr){var Vt=(180-sr*360)*Math.PI/180;return 360*Math.atan(Math.exp(Vt))/Math.PI-90}function Ae(sr,Vt){for(var or in Vt)sr[or]=Vt[or];return sr}function pe(sr){return sr.x}function Ne(sr){return sr.y}function ut(sr,Vt,or,ur){for(var Gr=ur,ln=or-Vt>>1,gn=or-Vt,An,Qn=sr[Vt],pa=sr[Vt+1],ha=sr[or],_a=sr[or+1],Ca=Vt+3;CaGr)An=Ca,Gr=Hn;else if(Hn===Gr){var pi=Math.abs(Ca-ln);piur&&(An-Vt>3&&ut(sr,Vt,An,ur),sr[An+2]=Gr,or-An>3&&ut(sr,An,or,ur))}function dt(sr,Vt,or,ur,Gr,ln){var gn=Gr-or,An=ln-ur;if(gn!==0||An!==0){var Qn=((sr-or)*gn+(Vt-ur)*An)/(gn*gn+An*An);Qn>1?(or=Gr,ur=ln):Qn>0&&(or+=gn*Qn,ur+=An*Qn)}return gn=sr-or,An=Vt-ur,gn*gn+An*An}function nt(sr,Vt,or,ur){var Gr={id:typeof sr>"u"?null:sr,type:Vt,geometry:or,tags:ur,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Ft(Gr),Gr}function Ft(sr){var Vt=sr.geometry,or=sr.type;if(or==="Point"||or==="MultiPoint"||or==="LineString")Nt(sr,Vt);else if(or==="Polygon"||or==="MultiLineString")for(var ur=0;ur0&&(ur?gn+=(Gr*pa-Qn*ln)/2:gn+=Math.sqrt(Math.pow(Qn-Gr,2)+Math.pow(pa-ln,2))),Gr=Qn,ln=pa}var ha=Vt.length-3;Vt[2]=1,ut(Vt,0,ha,or),Vt[ha+2]=1,Vt.size=Math.abs(gn),Vt.start=0,Vt.end=Vt.size}function $r(sr,Vt,or,ur){for(var Gr=0;Gr1?1:or}function Mt(sr,Vt,or,ur,Gr,ln,gn,An){if(or/=Vt,ur/=Vt,ln>=or&&gn=ur)return null;for(var Qn=[],pa=0;pa=or&&pi=ur)continue;var Si=[];if(Ca==="Point"||Ca==="MultiPoint")je(_a,Si,or,ur,Gr);else if(Ca==="LineString")Je(_a,Si,or,ur,Gr,!1,An.lineMetrics);else if(Ca==="MultiLineString")xe(_a,Si,or,ur,Gr,!1);else if(Ca==="Polygon")xe(_a,Si,or,ur,Gr,!0);else if(Ca==="MultiPolygon")for(var Dt=0;Dt<_a.length;Dt++){var xt=[];xe(_a[Dt],xt,or,ur,Gr,!0),xt.length&&Si.push(xt)}if(Si.length){if(An.lineMetrics&&Ca==="LineString"){for(Dt=0;Dt=or&&gn<=ur&&(Vt.push(sr[ln]),Vt.push(sr[ln+1]),Vt.push(sr[ln+2]))}}function Je(sr,Vt,or,ur,Gr,ln,gn){for(var An=ke(sr),Qn=Gr===0?Ee:Xe,pa=sr.start,ha,_a,Ca=0;Caor&&(_a=Qn(An,Hn,pi,Dt,xt,or),gn&&(An.start=pa+ha*_a)):Cr>ur?jr=or&&(_a=Qn(An,Hn,pi,Dt,xt,or),Vr=!0),jr>ur&&Cr<=ur&&(_a=Qn(An,Hn,pi,Dt,xt,ur),Vr=!0),!ln&&Vr&&(gn&&(An.end=pa+ha*_a),Vt.push(An),An=ke(sr)),gn&&(pa+=ha)}var Dr=sr.length-3;Hn=sr[Dr],pi=sr[Dr+1],Si=sr[Dr+2],Cr=Gr===0?Hn:pi,Cr>=or&&Cr<=ur&&ye(An,Hn,pi,Si),Dr=An.length-3,ln&&Dr>=3&&(An[Dr]!==An[0]||An[Dr+1]!==An[1])&&ye(An,An[0],An[1],An[2]),An.length&&Vt.push(An)}function ke(sr){var Vt=[];return Vt.size=sr.size,Vt.start=sr.start,Vt.end=sr.end,Vt}function xe(sr,Vt,or,ur,Gr,ln){for(var gn=0;gngn.maxX&&(gn.maxX=ha),_a>gn.maxY&&(gn.maxY=_a)}return gn}function mr(sr,Vt,or,ur){var Gr=Vt.geometry,ln=Vt.type,gn=[];if(ln==="Point"||ln==="MultiPoint")for(var An=0;An0&&Vt.size<(Gr?gn:ur)){or.numPoints+=Vt.length/3;return}for(var An=[],Qn=0;Qngn)&&(or.numSimplified++,An.push(Vt[Qn]),An.push(Vt[Qn+1])),or.numPoints++;Gr&&Nr(An,ln),sr.push(An)}function Nr(sr,Vt){for(var or=0,ur=0,Gr=sr.length,ln=Gr-2;ur0===Vt)for(ur=0,Gr=sr.length;ur24)throw new Error("maxZoom should be in the 0-24 range");if(Vt.promoteId&&Vt.generateId)throw new Error("promoteId and generateId cannot be used together.");var ur=Qt(sr,Vt);this.tiles={},this.tileCoords=[],or&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Vt.indexMaxZoom,Vt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),ur=Qe(ur,Vt),ur.length&&this.splitTile(ur,0,0,0),or&&(ur.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}$n.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},$n.prototype.splitTile=function(sr,Vt,or,ur,Gr,ln,gn){for(var An=[sr,Vt,or,ur],Qn=this.options,pa=Qn.debug;An.length;){ur=An.pop(),or=An.pop(),Vt=An.pop(),sr=An.pop();var ha=1<1&&console.time("creation"),Ca=this.tiles[_a]=xr(sr,Vt,or,ur,Qn),this.tileCoords.push({z:Vt,x:or,y:ur}),pa)){pa>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Vt,or,ur,Ca.numFeatures,Ca.numPoints,Ca.numSimplified),console.timeEnd("creation"));var Hn="z"+Vt;this.stats[Hn]=(this.stats[Hn]||0)+1,this.total++}if(Ca.source=sr,Gr){if(Vt===Qn.maxZoom||Vt===Gr)continue;var pi=1<1&&console.time("clipping");var Si=.5*Qn.buffer/Qn.extent,Dt=.5-Si,xt=.5+Si,Cr=1+Si,jr,Vr,Dr,qr,un,Jr;jr=Vr=Dr=qr=null,un=Mt(sr,ha,or-Si,or+xt,0,Ca.minX,Ca.maxX,Qn),Jr=Mt(sr,ha,or+Dt,or+Cr,0,Ca.minX,Ca.maxX,Qn),sr=null,un&&(jr=Mt(un,ha,ur-Si,ur+xt,1,Ca.minY,Ca.maxY,Qn),Vr=Mt(un,ha,ur+Dt,ur+Cr,1,Ca.minY,Ca.maxY,Qn),un=null),Jr&&(Dr=Mt(Jr,ha,ur-Si,ur+xt,1,Ca.minY,Ca.maxY,Qn),qr=Mt(Jr,ha,ur+Dt,ur+Cr,1,Ca.minY,Ca.maxY,Qn),Jr=null),pa>1&&console.timeEnd("clipping"),An.push(jr||[],Vt+1,or*2,ur*2),An.push(Vr||[],Vt+1,or*2,ur*2+1),An.push(Dr||[],Vt+1,or*2+1,ur*2),An.push(qr||[],Vt+1,or*2+1,ur*2+1)}}},$n.prototype.getTile=function(sr,Vt,or){var ur=this.options,Gr=ur.extent,ln=ur.debug;if(sr<0||sr>24)return null;var gn=1<1&&console.log("drilling down to z%d-%d-%d",sr,Vt,or);for(var Qn=sr,pa=Vt,ha=or,_a;!_a&&Qn>0;)Qn--,pa=Math.floor(pa/2),ha=Math.floor(ha/2),_a=this.tiles[Vn(Qn,pa,ha)];return!_a||!_a.source?null:(ln>1&&console.log("found parent tile z%d-%d-%d",Qn,pa,ha),ln>1&&console.time("drilling down"),this.splitTile(_a.source,Qn,pa,ha,sr,Vt,or),ln>1&&console.timeEnd("drilling down"),this.tiles[An]?Ot(this.tiles[An],Gr):null)};function Vn(sr,Vt,or){return((1<=0?0:be.button},r.remove=function(be){be.parentNode&&be.parentNode.removeChild(be)};function v(be,q,he){var J,_e,qe,ft=e.browser.devicePixelRatio>1?"@2x":"",pt=e.getJSON(q.transformRequest(q.normalizeSpriteURL(be,ft,".json"),e.ResourceType.SpriteJSON),function(Tt,$t){pt=null,qe||(qe=Tt,J=$t,it())}),$e=e.getImage(q.transformRequest(q.normalizeSpriteURL(be,ft,".png"),e.ResourceType.SpriteImage),function(Tt,$t){$e=null,qe||(qe=Tt,_e=$t,it())});function it(){if(qe)he(qe);else if(J&&_e){var Tt=e.browser.getImageData(_e),$t={};for(var Ht in J){var Jt=J[Ht],ir=Jt.width,rr=Jt.height,Bt=Jt.x,Zt=Jt.y,Gt=Jt.sdf,Or=Jt.pixelRatio,Wr=Jt.stretchX,hn=Jt.stretchY,la=Jt.content,Zn=new e.RGBAImage({width:ir,height:rr});e.RGBAImage.copy(Tt,Zn,{x:Bt,y:Zt},{x:0,y:0},{width:ir,height:rr}),$t[Ht]={data:Zn,pixelRatio:Or,sdf:Gt,stretchX:Wr,stretchY:hn,content:la}}he(null,$t)}}return{cancel:function(){pt&&(pt.cancel(),pt=null),$e&&($e.cancel(),$e=null)}}}function T(be){var q=be.userImage;if(q&&q.render){var he=q.render();if(he)return be.data.replace(new Uint8Array(q.data.buffer)),!0}return!1}var l=1,g=(function(be){function q(){be.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.isLoaded=function(){return this.loaded},q.prototype.setLoaded=function(J){if(this.loaded!==J&&(this.loaded=J,J)){for(var _e=0,qe=this.requestors;_e=0?1.2:1))}w.prototype.draw=function(be){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(be,this.buffer,this.middle);for(var q=this.ctx.getImageData(0,0,this.size,this.size),he=new Uint8ClampedArray(this.size*this.size),J=0;J65535){Tt(new Error("glyphs > 65535 not supported"));return}if(Jt.ranges[rr]){Tt(null,{stack:$t,id:Ht,glyph:ir});return}var Bt=Jt.requests[rr];Bt||(Bt=Jt.requests[rr]=[],d.loadGlyphRange($t,rr,J.url,J.requestManager,function(Zt,Gt){if(Gt){for(var Or in Gt)J._doesCharSupportLocalGlyph(+Or)||(Jt.glyphs[+Or]=Gt[+Or]);Jt.ranges[rr]=!0}for(var Wr=0,hn=Bt;Wr1&&(it=q[++$e]);var $t=Math.abs(Tt-it.left),Ht=Math.abs(Tt-it.right),Jt=Math.min($t,Ht),ir=void 0,rr=qe/J*(_e+1);if(it.isDash){var Bt=_e-Math.abs(rr);ir=Math.sqrt(Jt*Jt+Bt*Bt)}else ir=_e-Math.sqrt(Jt*Jt+rr*rr);this.data[pt+Tt]=Math.max(0,Math.min(255,ir+128))}},F.prototype.addRegularDash=function(q){for(var he=q.length-1;he>=0;--he){var J=q[he],_e=q[he+1];J.zeroLength?q.splice(he,1):_e&&_e.isDash===J.isDash&&(_e.left=J.left,q.splice(he,1))}var qe=q[0],ft=q[q.length-1];qe.isDash===ft.isDash&&(qe.left=ft.left-this.width,ft.right=qe.right+this.width);for(var pt=this.width*this.nextRow,$e=0,it=q[$e],Tt=0;Tt1&&(it=q[++$e]);var $t=Math.abs(Tt-it.left),Ht=Math.abs(Tt-it.right),Jt=Math.min($t,Ht),ir=it.isDash?Jt:-Jt;this.data[pt+Tt]=Math.max(0,Math.min(255,ir+128))}},F.prototype.addDash=function(q,he){var J=he?7:0,_e=2*J+1;if(this.nextRow+_e>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var qe=0,ft=0;ft=J.minX&&q.x=J.minY&&q.y0&&(Tt[new e.OverscaledTileID(J.overscaledZ,pt,_e.z,ft,_e.y-1).key]={backfilled:!1},Tt[new e.OverscaledTileID(J.overscaledZ,J.wrap,_e.z,_e.x,_e.y-1).key]={backfilled:!1},Tt[new e.OverscaledTileID(J.overscaledZ,it,_e.z,$e,_e.y-1).key]={backfilled:!1}),_e.y+10&&(qe.resourceTiming=J._resourceTiming,J._resourceTiming=[]),J.fire(new e.Event("data",qe))})},q.prototype.onAdd=function(J){this.map=J,this.load()},q.prototype.setData=function(J){var _e=this;return this._data=J,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(qe){if(qe){_e.fire(new e.ErrorEvent(qe));return}var ft={dataType:"source",sourceDataType:"content"};_e._collectResourceTiming&&_e._resourceTiming&&_e._resourceTiming.length>0&&(ft.resourceTiming=_e._resourceTiming,_e._resourceTiming=[]),_e.fire(new e.Event("data",ft))}),this},q.prototype.getClusterExpansionZoom=function(J,_e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:J,source:this.id},_e),this},q.prototype.getClusterChildren=function(J,_e){return this.actor.send("geojson.getClusterChildren",{clusterId:J,source:this.id},_e),this},q.prototype.getClusterLeaves=function(J,_e,qe,ft){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:J,limit:_e,offset:qe},ft),this},q.prototype._updateWorkerData=function(J){var _e=this;this._loaded=!1;var qe=e.extend({},this.workerOptions),ft=this._data;typeof ft=="string"?(qe.request=this.map._requestManager.transformRequest(e.browser.resolveURL(ft),e.ResourceType.Source),qe.request.collectResourceTiming=this._collectResourceTiming):qe.data=JSON.stringify(ft),this.actor.send(this.type+".loadData",qe,function(pt,$e){_e._removed||$e&&$e.abandoned||(_e._loaded=!0,$e&&$e.resourceTiming&&$e.resourceTiming[_e.id]&&(_e._resourceTiming=$e.resourceTiming[_e.id].slice(0)),_e.actor.send(_e.type+".coalesce",{source:qe.source},null),J(pt))})},q.prototype.loaded=function(){return this._loaded},q.prototype.loadTile=function(J,_e){var qe=this,ft=J.actor?"reloadTile":"loadTile";J.actor=this.actor;var pt={type:this.type,uid:J.uid,tileID:J.tileID,zoom:J.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};J.request=this.actor.send(ft,pt,function($e,it){return delete J.request,J.unloadVectorData(),J.aborted?_e(null):$e?_e($e):(J.loadVectorData(it,qe.map.painter,ft==="reloadTile"),_e(null))})},q.prototype.abortTile=function(J){J.request&&(J.request.cancel(),delete J.request),J.aborted=!0},q.prototype.unloadTile=function(J){J.unloadVectorData(),this.actor.send("removeTile",{uid:J.uid,type:this.type,source:this.id})},q.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},q.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},q.prototype.hasTransition=function(){return!1},q})(e.Evented),fe=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),le=(function(be){function q(he,J,_e,qe){be.call(this),this.id=he,this.dispatcher=_e,this.coordinates=J.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(qe),this.options=J}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.load=function(J,_e){var qe=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),function(ft,pt){qe._loaded=!0,ft?qe.fire(new e.ErrorEvent(ft)):pt&&(qe.image=pt,J&&(qe.coordinates=J),_e&&_e(),qe._finishLoading())})},q.prototype.loaded=function(){return this._loaded},q.prototype.updateImage=function(J){var _e=this;return!this.image||!J.url?this:(this.options.url=J.url,this.load(J.coordinates,function(){_e.texture=null}),this)},q.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},q.prototype.onAdd=function(J){this.map=J,this.load()},q.prototype.setCoordinates=function(J){var _e=this;this.coordinates=J;var qe=J.map(e.MercatorCoordinate.fromLngLat);this.tileID=ce(qe),this.minzoom=this.maxzoom=this.tileID.z;var ft=qe.map(function(pt){return _e.tileID.getTilePoint(pt)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(ft[0].x,ft[0].y,0,0),this._boundsArray.emplaceBack(ft[1].x,ft[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(ft[3].x,ft[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(ft[2].x,ft[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},q.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var J=this.map.painter.context,_e=J.gl;this.boundsBuffer||(this.boundsBuffer=J.createVertexBuffer(this._boundsArray,fe.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(J,this.image,_e.RGBA),this.texture.bind(_e.LINEAR,_e.CLAMP_TO_EDGE));for(var qe in this.tiles){var ft=this.tiles[qe];ft.state!=="loaded"&&(ft.state="loaded",ft.texture=this.texture)}}},q.prototype.loadTile=function(J,_e){this.tileID&&this.tileID.equals(J.tileID.canonical)?(this.tiles[String(J.tileID.wrap)]=J,J.buckets={},_e(null)):(J.state="errored",_e(null))},q.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},q.prototype.hasTransition=function(){return!1},q})(e.Evented);function ce(be){for(var q=1/0,he=1/0,J=-1/0,_e=-1/0,qe=0,ft=be;qe_e.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+_e.start(0)+" and "+_e.end(0)+"-second mark."))):this.video.currentTime=J}},q.prototype.getVideo=function(){return this.video},q.prototype.onAdd=function(J){this.map||(this.map=J,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},q.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var J=this.map.painter.context,_e=J.gl;this.boundsBuffer||(this.boundsBuffer=J.createVertexBuffer(this._boundsArray,fe.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(_e.LINEAR,_e.CLAMP_TO_EDGE),_e.texSubImage2D(_e.TEXTURE_2D,0,0,0,_e.RGBA,_e.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(J,this.video,_e.RGBA),this.texture.bind(_e.LINEAR,_e.CLAMP_TO_EDGE));for(var qe in this.tiles){var ft=this.tiles[qe];ft.state!=="loaded"&&(ft.state="loaded",ft.texture=this.texture)}}},q.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},q.prototype.hasTransition=function(){return this.video&&!this.video.paused},q})(le),ee=(function(be){function q(he,J,_e,qe){be.call(this,he,J,_e,qe),J.coordinates?(!Array.isArray(J.coordinates)||J.coordinates.length!==4||J.coordinates.some(function(ft){return!Array.isArray(ft)||ft.length!==2||ft.some(function(pt){return typeof pt!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'missing required property "coordinates"'))),J.animate&&typeof J.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'optional "animate" property must be a boolean value'))),J.canvas?typeof J.canvas!="string"&&!(J.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+he,null,'missing required property "canvas"'))),this.options=J,this.animate=J.animate!==void 0?J.animate:!0}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},q.prototype.getCanvas=function(){return this.canvas},q.prototype.onAdd=function(J){this.map=J,this.load(),this.canvas&&this.animate&&this.play()},q.prototype.onRemove=function(){this.pause()},q.prototype.prepare=function(){var J=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,J=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,J=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var _e=this.map.painter.context,qe=_e.gl;this.boundsBuffer||(this.boundsBuffer=_e.createVertexBuffer(this._boundsArray,fe.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(J||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(_e,this.canvas,qe.RGBA,{premultiply:!0});for(var ft in this.tiles){var pt=this.tiles[ft];pt.state!=="loaded"&&(pt.state="loaded",pt.texture=this.texture)}}},q.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},q.prototype.hasTransition=function(){return this._playing},q.prototype._hasInvalidDimensions=function(){for(var J=0,_e=[this.canvas.width,this.canvas.height];J<_e.length;J+=1){var qe=_e[J];if(isNaN(qe)||qe<=0)return!0}return!1},q})(le),ne={vector:U,raster:j,"raster-dem":Z,geojson:re,video:V,image:le,canvas:ee},$=function(be,q,he,J){var _e=new ne[q.type](be,q,he,J);if(_e.id!==be)throw new Error("Expected Source id to be "+be+" instead of "+_e.id);return e.bindAll(["load","abort","unload","serialize","prepare"],_e),_e},ue=function(be){return ne[be]},te=function(be,q){ne[be]=q};function H(be,q){var he=e.identity([]);return e.translate(he,he,[1,1,0]),e.scale(he,he,[be.width*.5,be.height*.5,1]),e.multiply(he,he,be.calculatePosMatrix(q.toUnwrapped()))}function ae(be,q,he){if(be)for(var J=0,_e=be;J<_e.length;J+=1){var qe=_e[J],ft=q[qe];if(ft&&ft.source===he&&ft.type==="fill-extrusion")return!0}else for(var pt in q){var $e=q[pt];if($e.source===he&&$e.type==="fill-extrusion")return!0}return!1}function ie(be,q,he,J,_e,qe){var ft=ae(_e&&_e.layers,q,be.id),pt=qe.maxPitchScaleFactor(),$e=be.tilesIn(J,pt,ft);$e.sort(Le);for(var it=[],Tt=0,$t=$e;Tt<$t.length;Tt+=1){var Ht=$t[Tt];it.push({wrappedTileID:Ht.tileID.wrapped().key,queryResults:Ht.tile.queryRenderedFeatures(q,he,be._state,Ht.queryGeometry,Ht.cameraQueryGeometry,Ht.scale,_e,qe,pt,H(be.transform,Ht.tileID))})}var Jt=Fe(it);for(var ir in Jt)Jt[ir].forEach(function(rr){var Bt=rr.feature,Zt=be.getFeatureState(Bt.layer["source-layer"],Bt.id);Bt.source=Bt.layer.source,Bt.layer["source-layer"]&&(Bt.sourceLayer=Bt.layer["source-layer"]),Bt.state=Zt});return Jt}function de(be,q,he,J,_e,qe,ft){for(var pt={},$e=qe.queryRenderedSymbols(J),it=[],Tt=0,$t=Object.keys($e).map(Number);Tt<$t.length;Tt+=1){var Ht=$t[Tt];it.push(ft[Ht])}it.sort(Le);for(var Jt=function(){var Gt=rr[ir],Or=Gt.featureIndex.lookupSymbolFeatures($e[Gt.bucketInstanceId],q,Gt.bucketIndex,Gt.sourceLayerIndex,_e.filter,_e.layers,_e.availableImages,be);for(var Wr in Or){var hn=pt[Wr]=pt[Wr]||[],la=Or[Wr];la.sort(function(da,Pa){var fa=Gt.featureSortOrder;if(fa){var Fa=fa.indexOf(da.featureIndex),Ka=fa.indexOf(Pa.featureIndex);return Ka-Fa}else return Pa.featureIndex-da.featureIndex});for(var Zn=0,Gn=la;Znthis.max){var pt=this._getAndRemoveByKey(this.order[0]);pt&&this.onRemove(pt)}return this},ze.prototype.has=function(q){return q.wrapped().key in this.data},ze.prototype.getAndRemove=function(q){return this.has(q)?this._getAndRemoveByKey(q.wrapped().key):null},ze.prototype._getAndRemoveByKey=function(q){var he=this.data[q].shift();return he.timeout&&clearTimeout(he.timeout),this.data[q].length===0&&delete this.data[q],this.order.splice(this.order.indexOf(q),1),he.value},ze.prototype.getByKey=function(q){var he=this.data[q];return he?he[0].value:null},ze.prototype.get=function(q){if(!this.has(q))return null;var he=this.data[q.wrapped().key][0];return he.value},ze.prototype.remove=function(q,he){if(!this.has(q))return this;var J=q.wrapped().key,_e=he===void 0?0:this.data[J].indexOf(he),qe=this.data[J][_e];return this.data[J].splice(_e,1),qe.timeout&&clearTimeout(qe.timeout),this.data[J].length===0&&delete this.data[J],this.onRemove(qe.value),this.order.splice(this.order.indexOf(J),1),this},ze.prototype.setMaxSize=function(q){for(this.max=q;this.order.length>this.max;){var he=this._getAndRemoveByKey(this.order[0]);he&&this.onRemove(he)}return this},ze.prototype.filter=function(q){var he=[];for(var J in this.data)for(var _e=0,qe=this.data[J];_e1||(Math.abs($t)>1&&(Math.abs($t+Jt)===1?$t+=Jt:Math.abs($t-Jt)===1&&($t-=Jt)),!(!Tt.dem||!it.dem)&&(it.dem.backfillBorder(Tt.dem,$t,Ht),it.neighboringTiles&&it.neighboringTiles[ir]&&(it.neighboringTiles[ir].backfilled=!0)))}},q.prototype.getTile=function(J){return this.getTileByID(J.key)},q.prototype.getTileByID=function(J){return this._tiles[J]},q.prototype._retainLoadedChildren=function(J,_e,qe,ft){for(var pt in this._tiles){var $e=this._tiles[pt];if(!(ft[pt]||!$e.hasData()||$e.tileID.overscaledZ<=_e||$e.tileID.overscaledZ>qe)){for(var it=$e.tileID;$e&&$e.tileID.overscaledZ>_e+1;){var Tt=$e.tileID.scaledTo($e.tileID.overscaledZ-1);$e=this._tiles[Tt.key],$e&&$e.hasData()&&(it=Tt)}for(var $t=it;$t.overscaledZ>_e;)if($t=$t.scaledTo($t.overscaledZ-1),J[$t.key]){ft[it.key]=it;break}}}},q.prototype.findLoadedParent=function(J,_e){if(J.key in this._loadedParentTiles){var qe=this._loadedParentTiles[J.key];return qe&&qe.tileID.overscaledZ>=_e?qe:null}for(var ft=J.overscaledZ-1;ft>=_e;ft--){var pt=J.scaledTo(ft),$e=this._getLoadedTile(pt);if($e)return $e}},q.prototype._getLoadedTile=function(J){var _e=this._tiles[J.key];if(_e&&_e.hasData())return _e;var qe=this._cache.getByKey(J.wrapped().key);return qe},q.prototype.updateCacheSize=function(J){var _e=Math.ceil(J.width/this._source.tileSize)+1,qe=Math.ceil(J.height/this._source.tileSize)+1,ft=_e*qe,pt=5,$e=Math.floor(ft*pt),it=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,$e):$e;this._cache.setMaxSize(it)},q.prototype.handleWrapJump=function(J){var _e=this._prevLng===void 0?J:this._prevLng,qe=J-_e,ft=qe/360,pt=Math.round(ft);if(this._prevLng=J,pt){var $e={};for(var it in this._tiles){var Tt=this._tiles[it];Tt.tileID=Tt.tileID.unwrapTo(Tt.tileID.wrap+pt),$e[Tt.tileID.key]=Tt}this._tiles=$e;for(var $t in this._timers)clearTimeout(this._timers[$t]),delete this._timers[$t];for(var Ht in this._tiles){var Jt=this._tiles[Ht];this._setTileReloadTimer(Ht,Jt)}}},q.prototype.update=function(J){var _e=this;if(this.transform=J,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(J),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var qe;this.used?this._source.tileID?qe=J.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(da){return new e.OverscaledTileID(da.canonical.z,da.wrap,da.canonical.z,da.canonical.x,da.canonical.y)}):(qe=J.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(qe=qe.filter(function(da){return _e._source.hasTile(da)}))):qe=[];var ft=J.coveringZoomLevel(this._source),pt=Math.max(ft-q.maxOverzooming,this._source.minzoom),$e=Math.max(ft+q.maxUnderzooming,this._source.minzoom),it=this._updateRetainedTiles(qe,ft);if(Qn(this._source.type)){for(var Tt={},$t={},Ht=Object.keys(it),Jt=0,ir=Ht;Jtthis._source.maxzoom){var Gt=Bt.children(this._source.maxzoom)[0],Or=this.getTile(Gt);if(Or&&Or.hasData()){qe[Gt.key]=Gt;continue}}else{var Wr=Bt.children(this._source.maxzoom);if(qe[Wr[0].key]&&qe[Wr[1].key]&&qe[Wr[2].key]&&qe[Wr[3].key])continue}for(var hn=Zt.wasRequested(),la=Bt.overscaledZ-1;la>=pt;--la){var Zn=Bt.scaledTo(la);if(ft[Zn.key]||(ft[Zn.key]=!0,Zt=this.getTile(Zn),!Zt&&hn&&(Zt=this._addTile(Zn)),Zt&&(qe[Zn.key]=Zn,hn=Zt.wasRequested(),Zt.hasData())))break}}}return qe},q.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var J in this._tiles){for(var _e=[],qe=void 0,ft=this._tiles[J].tileID;ft.overscaledZ>0;){if(ft.key in this._loadedParentTiles){qe=this._loadedParentTiles[ft.key];break}_e.push(ft.key);var pt=ft.scaledTo(ft.overscaledZ-1);if(qe=this._getLoadedTile(pt),qe)break;ft=pt}for(var $e=0,it=_e;$e0)&&(_e.hasData()&&_e.state!=="reloading"?this._cache.add(_e.tileID,_e,_e.getExpiryTimeout()):(_e.aborted=!0,this._abortTile(_e),this._unloadTile(_e))))},q.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var J in this._tiles)this._removeTile(J);this._cache.reset()},q.prototype.tilesIn=function(J,_e,qe){var ft=this,pt=[],$e=this.transform;if(!$e)return pt;for(var it=qe?$e.getCameraQueryGeometry(J):J,Tt=J.map(function(la){return $e.pointCoordinate(la)}),$t=it.map(function(la){return $e.pointCoordinate(la)}),Ht=this.getIds(),Jt=1/0,ir=1/0,rr=-1/0,Bt=-1/0,Zt=0,Gt=$t;Zt=0&&Pa[1].y+da>=0){var fa=Tt.map(function(Ka){return Gn.getTilePoint(Ka)}),Fa=$t.map(function(Ka){return Gn.getTilePoint(Ka)});pt.push({tile:Zn,tileID:Gn,queryGeometry:fa,cameraQueryGeometry:Fa,scale:ua})}}},hn=0;hn=e.browser.now())return!0}return!1},q.prototype.setFeatureState=function(J,_e,qe){J=J||"_geojsonTileLayer",this._state.updateState(J,_e,qe)},q.prototype.removeFeatureState=function(J,_e,qe){J=J||"_geojsonTileLayer",this._state.removeFeatureState(J,_e,qe)},q.prototype.getFeatureState=function(J,_e){return J=J||"_geojsonTileLayer",this._state.getState(J,_e)},q.prototype.setDependencies=function(J,_e,qe){var ft=this._tiles[J];ft&&ft.setDependencies(_e,qe)},q.prototype.reloadTilesForDependencies=function(J,_e){for(var qe in this._tiles){var ft=this._tiles[qe];ft.hasDependency(J,_e)&&this._reloadTile(qe,"reloading")}this._cache.filter(function(pt){return!pt.hasDependency(J,_e)})},q})(e.Evented);gn.maxOverzooming=10,gn.maxUnderzooming=3;function An(be,q){var he=Math.abs(be.wrap*2)-+(be.wrap<0),J=Math.abs(q.wrap*2)-+(q.wrap<0);return be.overscaledZ-q.overscaledZ||J-he||q.canonical.y-be.canonical.y||q.canonical.x-be.canonical.x}function Qn(be){return be==="raster"||be==="image"||be==="video"}function pa(){return new e.window.Worker(_s.workerUrl)}var ha="mapboxgl_preloaded_worker_pool",_a=function(){this.active={}};_a.prototype.acquire=function(q){if(!this.workers)for(this.workers=[];this.workers.length<_a.workerCount;)this.workers.push(new pa);return this.active[q]=!0,this.workers.slice()},_a.prototype.release=function(q){delete this.active[q],this.numActive()===0&&(this.workers.forEach(function(he){he.terminate()}),this.workers=null)},_a.prototype.isPreloaded=function(){return!!this.active[ha]},_a.prototype.numActive=function(){return Object.keys(this.active).length};var Ca=Math.floor(e.browser.hardwareConcurrency/2);_a.workerCount=Math.max(Math.min(Ca,6),1);var Hn;function pi(){return Hn||(Hn=new _a),Hn}function Si(){var be=pi();be.acquire(ha)}function Dt(){var be=Hn;be&&(be.isPreloaded()&&be.numActive()===1?(be.release(ha),Hn=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))}function xt(be,q){var he={};for(var J in be)J!=="ref"&&(he[J]=be[J]);return e.refProperties.forEach(function(_e){_e in q&&(he[_e]=q[_e])}),he}function Cr(be){be=be.slice();for(var q=Object.create(null),he=0;he0?(_e-ft)/pt:0;return this.points[qe].mult(1-$e).add(this.points[he].mult($e))};var fn=function(q,he,J){var _e=this.boxCells=[],qe=this.circleCells=[];this.xCellCount=Math.ceil(q/J),this.yCellCount=Math.ceil(he/J);for(var ft=0;ftthis.width||_e<0||he>this.height)return qe?!1:[];var pt=[];if(q<=0&&he<=0&&this.width<=J&&this.height<=_e){if(qe)return!0;for(var $e=0;$e0:pt}},fn.prototype._queryCircle=function(q,he,J,_e,qe){var ft=q-J,pt=q+J,$e=he-J,it=he+J;if(pt<0||ft>this.width||it<0||$e>this.height)return _e?!1:[];var Tt=[],$t={hitTest:_e,circle:{x:q,y:he,radius:J},seenUids:{box:{},circle:{}}};return this._forEachCell(ft,$e,pt,it,this._queryCellCircle,Tt,$t,qe),_e?Tt.length>0:Tt},fn.prototype.query=function(q,he,J,_e,qe){return this._query(q,he,J,_e,!1,qe)},fn.prototype.hitTest=function(q,he,J,_e,qe){return this._query(q,he,J,_e,!0,qe)},fn.prototype.hitTestCircle=function(q,he,J,_e){return this._queryCircle(q,he,J,!0,_e)},fn.prototype._queryCell=function(q,he,J,_e,qe,ft,pt,$e){var it=pt.seenUids,Tt=this.boxCells[qe];if(Tt!==null)for(var $t=this.bboxes,Ht=0,Jt=Tt;Ht=$t[rr+0]&&_e>=$t[rr+1]&&(!$e||$e(this.boxKeys[ir]))){if(pt.hitTest)return ft.push(!0),!0;ft.push({key:this.boxKeys[ir],x1:$t[rr],y1:$t[rr+1],x2:$t[rr+2],y2:$t[rr+3]})}}}var Bt=this.circleCells[qe];if(Bt!==null)for(var Zt=this.circles,Gt=0,Or=Bt;Gtpt*pt+$e*$e},fn.prototype._circleAndRectCollide=function(q,he,J,_e,qe,ft,pt){var $e=(ft-_e)/2,it=Math.abs(q-(_e+$e));if(it>$e+J)return!1;var Tt=(pt-qe)/2,$t=Math.abs(he-(qe+Tt));if($t>Tt+J)return!1;if(it<=$e||$t<=Tt)return!0;var Ht=it-$e,Jt=$t-Tt;return Ht*Ht+Jt*Jt<=J*J};function In(be,q,he,J,_e){var qe=e.create();return q?(e.scale(qe,qe,[1/_e,1/_e,1]),he||e.rotateZ(qe,qe,J.angle)):e.multiply(qe,J.labelPlaneMatrix,be),qe}function gi(be,q,he,J,_e){if(q){var qe=e.clone(be);return e.scale(qe,qe,[_e,_e,1]),he||e.rotateZ(qe,qe,-J.angle),qe}else return J.glCoordMatrix}function Ea(be,q){var he=[be.x,be.y,0,1];Jo(he,he,q);var J=he[3];return{point:new e.Point(he[0]/J,he[1]/J),signedDistanceFromCamera:J}}function Ci(be,q){return .5+.5*(be/q)}function Xi(be,q){var he=be[0]/be[3],J=be[1]/be[3],_e=he>=-q[0]&&he<=q[0]&&J>=-q[1]&&J<=q[1];return _e}function so(be,q,he,J,_e,qe,ft,pt){var $e=J?be.textSizeData:be.iconSizeData,it=e.evaluateSizeForZoom($e,he.transform.zoom),Tt=[256/he.width*2+1,256/he.height*2+1],$t=J?be.text.dynamicLayoutVertexArray:be.icon.dynamicLayoutVertexArray;$t.clear();for(var Ht=be.lineVertexArray,Jt=J?be.text.placedSymbolArray:be.icon.placedSymbolArray,ir=he.transform.width/he.transform.height,rr=!1,Bt=0;Btqe)return{useVertical:!0}}return(be===e.WritingMode.vertical?q.yhe.x)?{needsFlipping:!0}:null}function ui(be,q,he,J,_e,qe,ft,pt,$e,it,Tt,$t,Ht,Jt){var ir=q/24,rr=be.lineOffsetX*ir,Bt=be.lineOffsetY*ir,Zt;if(be.numGlyphs>1){var Gt=be.glyphStartIndex+be.numGlyphs,Or=be.lineStartIndex,Wr=be.lineStartIndex+be.lineLength,hn=io(ir,pt,rr,Bt,he,Tt,$t,be,$e,qe,Ht);if(!hn)return{notEnoughRoom:!0};var la=Ea(hn.first.point,ft).point,Zn=Ea(hn.last.point,ft).point;if(J&&!he){var Gn=Mo(be.writingMode,la,Zn,Jt);if(Gn)return Gn}Zt=[hn.first];for(var ua=be.glyphStartIndex+1;ua0?Fa.point:ts($t,fa,da,1,_e),wi=Mo(be.writingMode,da,Ka,Jt);if(wi)return wi}var qi=Ho(ir*pt.getoffsetX(be.glyphStartIndex),rr,Bt,he,Tt,$t,be.segment,be.lineStartIndex,be.lineStartIndex+be.lineLength,$e,qe,Ht);if(!qi)return{notEnoughRoom:!0};Zt=[qi]}for(var xs=0,ps=Zt;xs0?1:-1,ir=0;J&&(Jt*=-1,ir=Math.PI),Jt<0&&(ir+=Math.PI);for(var rr=Jt>0?pt+ft:pt+ft+1,Bt=_e,Zt=_e,Gt=0,Or=0,Wr=Math.abs(Ht),hn=[];Gt+Or<=Wr;){if(rr+=Jt,rr=$e)return null;if(Zt=Bt,hn.push(Bt),Bt=$t[rr],Bt===void 0){var la=new e.Point(it.getx(rr),it.gety(rr)),Zn=Ea(la,Tt);if(Zn.signedDistanceFromCamera>0)Bt=$t[rr]=Zn.point;else{var Gn=rr-Jt,ua=Gt===0?qe:new e.Point(it.getx(Gn),it.gety(Gn));Bt=ts(ua,la,Zt,Wr-Gt+1,Tt)}}Gt+=Or,Or=Zt.dist(Bt)}var da=(Wr-Gt)/Or,Pa=Bt.sub(Zt),fa=Pa.mult(da)._add(Zt);fa._add(Pa._unit()._perp()._mult(he*Jt));var Fa=ir+Math.atan2(Bt.y-Zt.y,Bt.x-Zt.x);return hn.push(fa),{point:fa,angle:Fa,path:hn}}var Xs=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function cs(be,q){for(var he=0;he=1;yl--)ps.push(qi.path[yl]);for(var hl=1;hl0){for(var sl=ps[0].clone(),Tu=ps[0].clone(),Kf=1;Kf=Fa.x&&Tu.x<=Ka.x&&sl.y>=Fa.y&&Tu.y<=Ka.y?tc=[ps]:Tu.xKa.x||Tu.yKa.y?tc=[]:tc=e.clipLine([ps],Fa.x,Fa.y,Ka.x,Ka.y)}for(var Eh=0,Hv=tc;Eh=this.screenRightBoundary||_ethis.screenBottomBoundary},Ys.prototype.isInsideGrid=function(q,he,J,_e){return J>=0&&q=0&&he0){var Wr;return this.prevPlacement&&this.prevPlacement.variableOffsets[Ht.crossTileID]&&this.prevPlacement.placements[Ht.crossTileID]&&this.prevPlacement.placements[Ht.crossTileID].text&&(Wr=this.prevPlacement.variableOffsets[Ht.crossTileID].anchor),this.variableOffsets[Ht.crossTileID]={textOffset:Bt,width:J,height:_e,anchor:q,textBoxScale:qe,prevAnchor:Wr},this.markUsedJustification(Jt,q,Ht,ir),Jt.allowVerticalPlacement&&(this.markUsedOrientation(Jt,ir,Ht),this.placedOrientations[Ht.crossTileID]=ir),{shift:Zt,placedGlyphBoxes:Gt}}},Ms.prototype.placeLayerBucketPart=function(q,he,J){var _e=this,qe=q.parameters,ft=qe.bucket,pt=qe.layout,$e=qe.posMatrix,it=qe.textLabelPlaneMatrix,Tt=qe.labelToScreenMatrix,$t=qe.textPixelRatio,Ht=qe.holdingForFade,Jt=qe.collisionBoxArray,ir=qe.partiallyEvaluatedTextSize,rr=qe.collisionGroup,Bt=pt.get("text-optional"),Zt=pt.get("icon-optional"),Gt=pt.get("text-allow-overlap"),Or=pt.get("icon-allow-overlap"),Wr=pt.get("text-rotation-alignment")==="map",hn=pt.get("text-pitch-alignment")==="map",la=pt.get("icon-text-fit")!=="none",Zn=pt.get("symbol-z-order")==="viewport-y",Gn=Gt&&(Or||!ft.hasIconData()||Zt),ua=Or&&(Gt||!ft.hasTextData()||Bt);!ft.collisionArrays&&Jt&&ft.deserializeCollisionBoxes(Jt);var da=function(qi,xs){if(!he[qi.crossTileID]){if(Ht){_e.placements[qi.crossTileID]=new Zo(!1,!1,!1);return}var ps=!1,yl=!1,hl=!0,xl=null,_l={box:null,offscreen:null},tc={box:null},sl=null,Tu=null,Kf=null,Eh=0,Hv=0,Gv=0;xs.textFeatureIndex?Eh=xs.textFeatureIndex:qi.useRuntimeCollisionCircles&&(Eh=qi.featureIndex),xs.verticalTextFeatureIndex&&(Hv=xs.verticalTextFeatureIndex);var rv=xs.textBox;if(rv){var hp=function(xf){var pc=e.WritingMode.horizontal;if(ft.allowVerticalPlacement&&!xf&&_e.prevPlacement){var iv=_e.prevPlacement.placedOrientations[qi.crossTileID];iv&&(_e.placedOrientations[qi.crossTileID]=iv,pc=iv,_e.markUsedOrientation(ft,pc,qi))}return pc},J0=function(xf,pc){if(ft.allowVerticalPlacement&&qi.numVerticalGlyphVertices>0&&xs.verticalTextBox)for(var iv=0,jg=ft.writingModes;iv0&&(vv=vv.filter(function(xf){return xf!==av.anchor}),vv.unshift(av.anchor))}var Xv=function(xf,pc,iv){for(var jg=xf.x2-xf.x1,Jy=xf.y2-xf.y1,Mc=qi.textBoxScale,q_=la&&!Or?pc:null,Vm={box:[],offscreen:!1},ew=Gt?vv.length*2:vv.length,Zv=0;Zv=vv.length,V_=_e.attemptAnchorPlacement(Hm,xf,jg,Jy,Mc,Wr,hn,$t,$e,rr,tw,qi,ft,iv,q_);if(V_&&(Vm=V_.placedGlyphBoxes,Vm&&Vm.box&&Vm.box.length)){ps=!0,xl=V_.shift;break}}return Vm},dp=function(){return Xv(rv,xs.iconBox,e.WritingMode.horizontal)},Yv=function(){var xf=xs.verticalTextBox,pc=_l&&_l.box&&_l.box.length;return ft.allowVerticalPlacement&&!pc&&qi.numVerticalGlyphVertices>0&&xf?Xv(xf,xs.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};J0(dp,Yv),_l&&(ps=_l.box,hl=_l.offscreen);var Bg=hp(_l&&_l.box);if(!ps&&_e.prevPlacement){var Q0=_e.prevPlacement.variableOffsets[qi.crossTileID];Q0&&(_e.variableOffsets[qi.crossTileID]=Q0,_e.markUsedJustification(ft,Q0.anchor,qi,Bg))}}else{var Mp=function(xf,pc){var iv=_e.collisionIndex.placeCollisionBox(xf,Gt,$t,$e,rr.predicate);return iv&&iv.box&&iv.box.length&&(_e.markUsedOrientation(ft,pc,qi),_e.placedOrientations[qi.crossTileID]=pc),iv},nv=function(){return Mp(rv,e.WritingMode.horizontal)},Ep=function(){var xf=xs.verticalTextBox;return ft.allowVerticalPlacement&&qi.numVerticalGlyphVertices>0&&xf?Mp(xf,e.WritingMode.vertical):{box:null,offscreen:null}};J0(nv,Ep),hp(_l&&_l.box&&_l.box.length)}}if(sl=_l,ps=sl&&sl.box&&sl.box.length>0,hl=sl&&sl.offscreen,qi.useRuntimeCollisionCircles){var Kh=ft.text.placedSymbolArray.get(qi.centerJustifiedTextSymbolIndex),em=e.evaluateSizeForFeature(ft.textSizeData,ir,Kh),Ng=pt.get("text-padding"),Cd=qi.collisionCircleDiameter;Tu=_e.collisionIndex.placeCollisionCircles(Gt,Kh,ft.lineVertexArray,ft.glyphOffsetArray,em,$e,it,Tt,J,hn,rr.predicate,Cd,Ng),ps=Gt||Tu.circles.length>0&&!Tu.collisionDetected,hl=hl&&Tu.offscreen}if(xs.iconFeatureIndex&&(Gv=xs.iconFeatureIndex),xs.iconBox){var Um=function(xf){var pc=la&&xl?Rl(xf,xl.x,xl.y,Wr,hn,_e.transform.angle):xf;return _e.collisionIndex.placeCollisionBox(pc,Or,$t,$e,rr.predicate)};tc&&tc.box&&tc.box.length&&xs.verticalIconBox?(Kf=Um(xs.verticalIconBox),yl=Kf.box.length>0):(Kf=Um(xs.iconBox),yl=Kf.box.length>0),hl=hl&&Kf.offscreen}var $y=Bt||qi.numHorizontalGlyphVertices===0&&qi.numVerticalGlyphVertices===0,Ky=Zt||qi.numIconVertices===0;if(!$y&&!Ky?yl=ps=yl&&ps:Ky?$y||(yl=yl&&ps):ps=yl&&ps,ps&&sl&&sl.box&&(tc&&tc.box&&Hv?_e.collisionIndex.insertCollisionBox(sl.box,pt.get("text-ignore-placement"),ft.bucketInstanceId,Hv,rr.ID):_e.collisionIndex.insertCollisionBox(sl.box,pt.get("text-ignore-placement"),ft.bucketInstanceId,Eh,rr.ID)),yl&&Kf&&_e.collisionIndex.insertCollisionBox(Kf.box,pt.get("icon-ignore-placement"),ft.bucketInstanceId,Gv,rr.ID),Tu&&(ps&&_e.collisionIndex.insertCollisionCircles(Tu.circles,pt.get("text-ignore-placement"),ft.bucketInstanceId,Eh,rr.ID),J)){var Ug=ft.bucketInstanceId,jm=_e.collisionCircleArrays[Ug];jm===void 0&&(jm=_e.collisionCircleArrays[Ug]=new po);for(var qm=0;qm=0;--fa){var Fa=Pa[fa];da(ft.symbolInstances.get(Fa),ft.collisionArrays[Fa])}else for(var Ka=q.symbolInstanceStart;Ka=0&&(ft>=0&&Tt!==ft?q.text.placedSymbolArray.get(Tt).crossTileID=0:q.text.placedSymbolArray.get(Tt).crossTileID=J.crossTileID)}},Ms.prototype.markUsedOrientation=function(q,he,J){for(var _e=he===e.WritingMode.horizontal||he===e.WritingMode.horizontalOnly?he:0,qe=he===e.WritingMode.vertical?he:0,ft=[J.leftJustifiedTextSymbolIndex,J.centerJustifiedTextSymbolIndex,J.rightJustifiedTextSymbolIndex],pt=0,$e=ft;pt<$e.length;pt+=1){var it=$e[pt];q.text.placedSymbolArray.get(it).placedOrientation=_e}J.verticalPlacedTextSymbolIndex&&(q.text.placedSymbolArray.get(J.verticalPlacedTextSymbolIndex).placedOrientation=qe)},Ms.prototype.commit=function(q){this.commitTime=q,this.zoomAtLastRecencyCheck=this.transform.zoom;var he=this.prevPlacement,J=!1;this.prevZoomAdjustment=he?he.zoomAdjustment(this.transform.zoom):0;var _e=he?he.symbolFadeChange(q):1,qe=he?he.opacities:{},ft=he?he.variableOffsets:{},pt=he?he.placedOrientations:{};for(var $e in this.placements){var it=this.placements[$e],Tt=qe[$e];Tt?(this.opacities[$e]=new fs(Tt,_e,it.text,it.icon),J=J||it.text!==Tt.text.placed||it.icon!==Tt.icon.placed):(this.opacities[$e]=new fs(null,_e,it.text,it.icon,it.skipFade),J=J||it.text||it.icon)}for(var $t in qe){var Ht=qe[$t];if(!this.opacities[$t]){var Jt=new fs(Ht,_e,!1,!1);Jt.isHidden()||(this.opacities[$t]=Jt,J=J||Ht.text.placed||Ht.icon.placed)}}for(var ir in ft)!this.variableOffsets[ir]&&this.opacities[ir]&&!this.opacities[ir].isHidden()&&(this.variableOffsets[ir]=ft[ir]);for(var rr in pt)!this.placedOrientations[rr]&&this.opacities[rr]&&!this.opacities[rr].isHidden()&&(this.placedOrientations[rr]=pt[rr]);J?this.lastPlacementChangeTime=q:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=he?he.lastPlacementChangeTime:q)},Ms.prototype.updateLayerOpacities=function(q,he){for(var J={},_e=0,qe=he;_e0||hn>0,da=Or.numIconVertices>0,Pa=_e.placedOrientations[Or.crossTileID],fa=Pa===e.WritingMode.vertical,Fa=Pa===e.WritingMode.horizontal||Pa===e.WritingMode.horizontalOnly;if(ua){var Ka=Au(Gn.text),wi=fa?Qi:Ka;ir(q.text,Wr,wi);var qi=Fa?Qi:Ka;ir(q.text,hn,qi);var xs=Gn.text.isHidden();[Or.rightJustifiedTextSymbolIndex,Or.centerJustifiedTextSymbolIndex,Or.leftJustifiedTextSymbolIndex].forEach(function(Gv){Gv>=0&&(q.text.placedSymbolArray.get(Gv).hidden=xs||fa?1:0)}),Or.verticalPlacedTextSymbolIndex>=0&&(q.text.placedSymbolArray.get(Or.verticalPlacedTextSymbolIndex).hidden=xs||Fa?1:0);var ps=_e.variableOffsets[Or.crossTileID];ps&&_e.markUsedJustification(q,ps.anchor,Or,Pa);var yl=_e.placedOrientations[Or.crossTileID];yl&&(_e.markUsedJustification(q,"left",Or,yl),_e.markUsedOrientation(q,yl,Or))}if(da){var hl=Au(Gn.icon),xl=!(Ht&&Or.verticalPlacedIconSymbolIndex&&fa);if(Or.placedIconSymbolIndex>=0){var _l=xl?hl:Qi;ir(q.icon,Or.numIconVertices,_l),q.icon.placedSymbolArray.get(Or.placedIconSymbolIndex).hidden=Gn.icon.isHidden()}if(Or.verticalPlacedIconSymbolIndex>=0){var tc=xl?Qi:hl;ir(q.icon,Or.numVerticalIconVertices,tc),q.icon.placedSymbolArray.get(Or.verticalPlacedIconSymbolIndex).hidden=Gn.icon.isHidden()}}if(q.hasIconCollisionBoxData()||q.hasTextCollisionBoxData()){var sl=q.collisionArrays[Gt];if(sl){var Tu=new e.Point(0,0);if(sl.textBox||sl.verticalTextBox){var Kf=!0;if(it){var Eh=_e.variableOffsets[la];Eh?(Tu=kl(Eh.anchor,Eh.width,Eh.height,Eh.textOffset,Eh.textBoxScale),Tt&&Tu._rotate($t?_e.transform.angle:-_e.transform.angle)):Kf=!1}sl.textBox&&fi(q.textCollisionBox.collisionVertexArray,Gn.text.placed,!Kf||fa,Tu.x,Tu.y),sl.verticalTextBox&&fi(q.textCollisionBox.collisionVertexArray,Gn.text.placed,!Kf||Fa,Tu.x,Tu.y)}var Hv=!!(!Fa&&sl.verticalIconBox);sl.iconBox&&fi(q.iconCollisionBox.collisionVertexArray,Gn.icon.placed,Hv,Ht?Tu.x:0,Ht?Tu.y:0),sl.verticalIconBox&&fi(q.iconCollisionBox.collisionVertexArray,Gn.icon.placed,!Hv,Ht?Tu.x:0,Ht?Tu.y:0)}}},Bt=0;Btq},Ms.prototype.setStale=function(){this.stale=!0};function fi(be,q,he,J,_e){be.emplaceBack(q?1:0,he?1:0,J||0,_e||0),be.emplaceBack(q?1:0,he?1:0,J||0,_e||0),be.emplaceBack(q?1:0,he?1:0,J||0,_e||0),be.emplaceBack(q?1:0,he?1:0,J||0,_e||0)}var to=Math.pow(2,25),Cl=Math.pow(2,24),Ps=Math.pow(2,17),Fo=Math.pow(2,16),Il=Math.pow(2,9),Zs=Math.pow(2,8),cl=Math.pow(2,1);function Au(be){if(be.opacity===0&&!be.placed)return 0;if(be.opacity===1&&be.placed)return 4294967295;var q=be.placed?1:0,he=Math.floor(be.opacity*127);return he*to+q*Cl+he*Ps+q*Fo+he*Il+q*Zs+he*cl+q}var Qi=0,gs=function(q){this._sortAcrossTiles=q.layout.get("symbol-z-order")!=="viewport-y"&&q.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};gs.prototype.continuePlacement=function(q,he,J,_e,qe){for(var ft=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var pt=q[this._currentPlacementIndex],$e=he[pt],it=this.placement.collisionIndex.transform.zoom;if($e.type==="symbol"&&(!$e.minzoom||$e.minzoom<=it)&&(!$e.maxzoom||$e.maxzoom>it)){this._inProgressLayer||(this._inProgressLayer=new gs($e));var Tt=this._inProgressLayer.continuePlacement(J[$e.source],this.placement,this._showCollisionBoxes,$e,ft);if(Tt)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},rs.prototype.commit=function(q){return this.placement.commit(q),this.placement};var Xl=512/e.EXTENT/2,Yl=function(q,he,J){this.tileID=q,this.indexedSymbolInstances={},this.bucketInstanceId=J;for(var _e=0;_eq.overscaledZ)for(var it in $e){var Tt=$e[it];Tt.tileID.isChildOf(q)&&Tt.findMatches(he.symbolInstances,q,ft)}else{var $t=q.scaledTo(Number(pt)),Ht=$e[$t.key];Ht&&Ht.findMatches(he.symbolInstances,q,ft)}}for(var Jt=0;Jt0)throw new Error("Unimplemented: "+ft.map(function(pt){return pt.command}).join(", ")+".");return qe.forEach(function(pt){pt.command!=="setTransition"&&_e[pt.command].apply(_e,pt.args)}),this.stylesheet=J,!0},q.prototype.addImage=function(J,_e){if(this.getImage(J))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(J,_e),this._afterImageUpdated(J)},q.prototype.updateImage=function(J,_e){this.imageManager.updateImage(J,_e)},q.prototype.getImage=function(J){return this.imageManager.getImage(J)},q.prototype.removeImage=function(J){if(!this.getImage(J))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(J),this._afterImageUpdated(J)},q.prototype._afterImageUpdated=function(J){this._availableImages=this.imageManager.listImages(),this._changedImages[J]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},q.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},q.prototype.addSource=function(J,_e,qe){var ft=this;if(qe===void 0&&(qe={}),this._checkLoaded(),this.sourceCaches[J]!==void 0)throw new Error("There is already a source with this ID");if(!_e.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(_e).join(", ")+".");var pt=["vector","raster","geojson","video","image"],$e=pt.indexOf(_e.type)>=0;if(!($e&&this._validate(e.validateStyle.source,"sources."+J,_e,null,qe))){this.map&&this.map._collectResourceTiming&&(_e.collectResourceTiming=!0);var it=this.sourceCaches[J]=new gn(J,_e,this.dispatcher);it.style=this,it.setEventedParent(this,function(){return{isSourceLoaded:ft.loaded(),source:it.serialize(),sourceId:J}}),it.onAdd(this.map),this._changed=!0}},q.prototype.removeSource=function(J){if(this._checkLoaded(),this.sourceCaches[J]===void 0)throw new Error("There is no source with this ID");for(var _e in this._layers)if(this._layers[_e].source===J)return this.fire(new e.ErrorEvent(new Error('Source "'+J+'" cannot be removed while layer "'+_e+'" is using it.')));var qe=this.sourceCaches[J];delete this.sourceCaches[J],delete this._updatedSources[J],qe.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:J})),qe.setEventedParent(null),qe.clearTiles(),qe.onRemove&&qe.onRemove(this.map),this._changed=!0},q.prototype.setGeoJSONSourceData=function(J,_e){this._checkLoaded();var qe=this.sourceCaches[J].getSource();qe.setData(_e),this._changed=!0},q.prototype.getSource=function(J){return this.sourceCaches[J]&&this.sourceCaches[J].getSource()},q.prototype.addLayer=function(J,_e,qe){qe===void 0&&(qe={}),this._checkLoaded();var ft=J.id;if(this.getLayer(ft)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+ft+'" already exists on this map')));return}var pt;if(J.type==="custom"){if(Os(this,e.validateCustomStyleLayer(J)))return;pt=e.createStyleLayer(J)}else{if(typeof J.source=="object"&&(this.addSource(ft,J.source),J=e.clone$1(J),J=e.extend(J,{source:ft})),this._validate(e.validateStyle.layer,"layers."+ft,J,{arrayIndex:-1},qe))return;pt=e.createStyleLayer(J),this._validateLayer(pt),pt.setEventedParent(this,{layer:{id:ft}}),this._serializedLayers[pt.id]=pt.serialize()}var $e=_e?this._order.indexOf(_e):this._order.length;if(_e&&$e===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+_e+'" does not exist on this map.')));return}if(this._order.splice($e,0,ft),this._layerOrderChanged=!0,this._layers[ft]=pt,this._removedLayers[ft]&&pt.source&&pt.type!=="custom"){var it=this._removedLayers[ft];delete this._removedLayers[ft],it.type!==pt.type?this._updatedSources[pt.source]="clear":(this._updatedSources[pt.source]="reload",this.sourceCaches[pt.source].pause())}this._updateLayer(pt),pt.onAdd&&pt.onAdd(this.map)},q.prototype.moveLayer=function(J,_e){this._checkLoaded(),this._changed=!0;var qe=this._layers[J];if(!qe){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be moved.")));return}if(J!==_e){var ft=this._order.indexOf(J);this._order.splice(ft,1);var pt=_e?this._order.indexOf(_e):this._order.length;if(_e&&pt===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+_e+'" does not exist on this map.')));return}this._order.splice(pt,0,J),this._layerOrderChanged=!0}},q.prototype.removeLayer=function(J){this._checkLoaded();var _e=this._layers[J];if(!_e){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be removed.")));return}_e.setEventedParent(null);var qe=this._order.indexOf(J);this._order.splice(qe,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[J]=_e,delete this._layers[J],delete this._serializedLayers[J],delete this._updatedLayers[J],delete this._updatedPaintProps[J],_e.onRemove&&_e.onRemove(this.map)},q.prototype.getLayer=function(J){return this._layers[J]},q.prototype.hasLayer=function(J){return J in this._layers},q.prototype.setLayerZoomRange=function(J,_e,qe){this._checkLoaded();var ft=this.getLayer(J);if(!ft){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot have zoom extent.")));return}ft.minzoom===_e&&ft.maxzoom===qe||(_e!=null&&(ft.minzoom=_e),qe!=null&&(ft.maxzoom=qe),this._updateLayer(ft))},q.prototype.setFilter=function(J,_e,qe){qe===void 0&&(qe={}),this._checkLoaded();var ft=this.getLayer(J);if(!ft){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(ft.filter,_e)){if(_e==null){ft.filter=void 0,this._updateLayer(ft);return}this._validate(e.validateStyle.filter,"layers."+ft.id+".filter",_e,null,qe)||(ft.filter=e.clone$1(_e),this._updateLayer(ft))}},q.prototype.getFilter=function(J){return e.clone$1(this.getLayer(J).filter)},q.prototype.setLayoutProperty=function(J,_e,qe,ft){ft===void 0&&(ft={}),this._checkLoaded();var pt=this.getLayer(J);if(!pt){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual(pt.getLayoutProperty(_e),qe)||(pt.setLayoutProperty(_e,qe,ft),this._updateLayer(pt))},q.prototype.getLayoutProperty=function(J,_e){var qe=this.getLayer(J);if(!qe){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style.")));return}return qe.getLayoutProperty(_e)},q.prototype.setPaintProperty=function(J,_e,qe,ft){ft===void 0&&(ft={}),this._checkLoaded();var pt=this.getLayer(J);if(!pt){this.fire(new e.ErrorEvent(new Error("The layer '"+J+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual(pt.getPaintProperty(_e),qe)){var $e=pt.setPaintProperty(_e,qe,ft);$e&&this._updateLayer(pt),this._changed=!0,this._updatedPaintProps[J]=!0}},q.prototype.getPaintProperty=function(J,_e){return this.getLayer(J).getPaintProperty(_e)},q.prototype.setFeatureState=function(J,_e){this._checkLoaded();var qe=J.source,ft=J.sourceLayer,pt=this.sourceCaches[qe];if(pt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+qe+"' does not exist in the map's style.")));return}var $e=pt.getSource().type;if($e==="geojson"&&ft){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if($e==="vector"&&!ft){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}J.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),pt.setFeatureState(ft,J.id,_e)},q.prototype.removeFeatureState=function(J,_e){this._checkLoaded();var qe=J.source,ft=this.sourceCaches[qe];if(ft===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+qe+"' does not exist in the map's style.")));return}var pt=ft.getSource().type,$e=pt==="vector"?J.sourceLayer:void 0;if(pt==="vector"&&!$e){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(_e&&typeof J.id!="string"&&typeof J.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}ft.removeFeatureState($e,J.id,_e)},q.prototype.getFeatureState=function(J){this._checkLoaded();var _e=J.source,qe=J.sourceLayer,ft=this.sourceCaches[_e];if(ft===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+_e+"' does not exist in the map's style.")));return}var pt=ft.getSource().type;if(pt==="vector"&&!qe){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return J.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),ft.getFeatureState(qe,J.id)},q.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},q.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,function(J){return J.serialize()}),layers:this._serializeLayers(this._order)},function(J){return J!==void 0})},q.prototype._updateLayer=function(J){this._updatedLayers[J.id]=!0,J.source&&!this._updatedSources[J.source]&&this.sourceCaches[J.source].getSource().type!=="raster"&&(this._updatedSources[J.source]="reload",this.sourceCaches[J.source].pause()),this._changed=!0},q.prototype._flattenAndSortRenderedFeatures=function(J){for(var _e=this,qe=function(Fa){return _e._layers[Fa].type==="fill-extrusion"},ft={},pt=[],$e=this._order.length-1;$e>=0;$e--){var it=this._order[$e];if(qe(it)){ft[it]=$e;for(var Tt=0,$t=J;Tt<$t.length;Tt+=1){var Ht=$t[Tt],Jt=Ht[it];if(Jt)for(var ir=0,rr=Jt;ir=0;Gt--){var Or=this._order[Gt];if(qe(Or))for(var Wr=pt.length-1;Wr>=0;Wr--){var hn=pt[Wr].feature;if(ft[hn.layer.id] 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`,Yu=`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`,Ku=`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from @@ -2909,7 +2909,7 @@ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,sv=`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +}`,fd=`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from @@ -2925,20 +2925,20 @@ void main() { #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`,Uh=`#ifdef GL_ES +: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`,Hh=`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,oh="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",zf=`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; +}`,ch="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",Nf=`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Ih="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",Dh=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +}`,Fh="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",Bh=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity @@ -2950,7 +2950,7 @@ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_rati #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,rf=` +}`,of=` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; #pragma mapbox: define highp vec4 color @@ -2966,7 +2966,7 @@ void main() { #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,jh=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,Gh=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { @@ -2976,7 +2976,7 @@ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_rati #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Tf=` +}`,Ef=` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur @@ -2990,7 +2990,7 @@ void main() { #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,cf=`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,vf=`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from @@ -3008,7 +3008,7 @@ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Zu=` +}`,Ju=` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; @@ -3033,7 +3033,7 @@ void main() { #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`,Hf=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`,Wf=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity @@ -3049,7 +3049,7 @@ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_rati #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,zh=` +}`,Nh=` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; @@ -3068,11 +3068,11 @@ void main() { #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`,Nl=`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`,Ul=`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,_h="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",wv=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +}`,Th="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",Md=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity @@ -3080,13 +3080,13 @@ lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)* #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,qh=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; +}`,Xh=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`,sh=`#define SDF_PX 8.0 +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`,fh=`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color @@ -3103,7 +3103,7 @@ float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scal #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Vh=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; +}`,Yh=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity @@ -3117,7 +3117,7 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`,Pc=`#define SDF_PX 8.0 +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`,zc=`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; @@ -3140,7 +3140,7 @@ return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float ga #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Hh=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; +}`,Zh=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity @@ -3154,58 +3154,58 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`,yu=iu(qc,Qc),Rc=iu(Lh,yh),Of=iu(Tl,Lc),$l=iu(Ph,nc),Af=iu(Gu,ac),vc=iu(ef,Kl),Ic=iu(Xu,Gs),uu=iu(Dl,wf),$f=iu(yc,If),ff=iu(lu,bv),Ff=iu(Ns,Bv),xh=iu(dl,Bo),Tv=iu(Kf,tf),Zv=iu(Iu,Rh),Jf=iu(Df,ih),bh=iu(Yu,sv),Vc=iu(Uh,oh),wh=iu(zf,Ih),ic=iu(Dh,rf),Qf=iu(jh,Tf),Gh=iu(cf,Zu),eh=iu(Hf,zh),tu=iu(Nl,_h),Dc=iu(wv,qh),nf=iu(sh,Vh),Oh=iu(Pc,Hh);function iu(be,q){var he=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,J=q.match(/attribute ([\w]+) ([\w]+)/g),_e=be.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),qe=q.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),lt=qe?qe.concat(_e):_e,vt={};return be=be.replace(he,function(Ke,at,bt,Zt,Vt){return vt[Vt]=!0,at==="define"?` -#ifndef HAS_UNIFORM_u_`+Vt+` -varying `+bt+" "+Zt+" "+Vt+`; +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`,wu=lu(Xc,rf),Oc=lu(Dh,wh),Uf=lu(Tl,Dc),tu=lu(zh,oc),kf=lu(Wu,sc),gc=lu(nf,eu),Fc=lu($u,Hs),hu=lu(Dl,Mf),rh=lu(wc,Ff),pf=lu(fu,Sd),jf=lu(Fs,Vd),Ah=lu(pl,Oo),Ed=lu(th,af),tv=lu(Ou,Oh),nh=lu(Bf,uh),Sh=lu(Ku,fd),Yc=lu(Hh,ch),Mh=lu(Nf,Fh),lc=lu(Bh,of),ah=lu(Gh,Ef),Wh=lu(vf,Ju),ih=lu(Wf,Nh),iu=lu(Ul,Th),Bc=lu(Md,Xh),sf=lu(fh,Yh),Uh=lu(zc,Zh);function lu(be,q){var he=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,J=q.match(/attribute ([\w]+) ([\w]+)/g),_e=be.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),qe=q.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ft=qe?qe.concat(_e):_e,pt={};return be=be.replace(he,function($e,it,Tt,$t,Ht){return pt[Ht]=!0,it==="define"?` +#ifndef HAS_UNIFORM_u_`+Ht+` +varying `+Tt+" "+$t+" "+Ht+`; #else -uniform `+bt+" "+Zt+" u_"+Vt+`; +uniform `+Tt+" "+$t+" u_"+Ht+`; #endif `:` -#ifdef HAS_UNIFORM_u_`+Vt+` - `+bt+" "+Zt+" "+Vt+" = u_"+Vt+`; -#endif -`}),q=q.replace(he,function(Ke,at,bt,Zt,Vt){var Kt=Zt==="float"?"vec2":"vec4",nr=Vt.match(/color/)?"color":Kt;return vt[Vt]?at==="define"?` -#ifndef HAS_UNIFORM_u_`+Vt+` -uniform lowp float u_`+Vt+`_t; -attribute `+bt+" "+Kt+" a_"+Vt+`; -varying `+bt+" "+Zt+" "+Vt+`; +#ifdef HAS_UNIFORM_u_`+Ht+` + `+Tt+" "+$t+" "+Ht+" = u_"+Ht+`; +#endif +`}),q=q.replace(he,function($e,it,Tt,$t,Ht){var Jt=$t==="float"?"vec2":"vec4",ir=Ht.match(/color/)?"color":Jt;return pt[Ht]?it==="define"?` +#ifndef HAS_UNIFORM_u_`+Ht+` +uniform lowp float u_`+Ht+`_t; +attribute `+Tt+" "+Jt+" a_"+Ht+`; +varying `+Tt+" "+$t+" "+Ht+`; #else -uniform `+bt+" "+Zt+" u_"+Vt+`; +uniform `+Tt+" "+$t+" u_"+Ht+`; #endif -`:nr==="vec4"?` -#ifndef HAS_UNIFORM_u_`+Vt+` - `+Vt+" = a_"+Vt+`; +`:ir==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Ht+` + `+Ht+" = a_"+Ht+`; #else - `+bt+" "+Zt+" "+Vt+" = u_"+Vt+`; + `+Tt+" "+$t+" "+Ht+" = u_"+Ht+`; #endif `:` -#ifndef HAS_UNIFORM_u_`+Vt+` - `+Vt+" = unpack_mix_"+nr+"(a_"+Vt+", u_"+Vt+`_t); +#ifndef HAS_UNIFORM_u_`+Ht+` + `+Ht+" = unpack_mix_"+ir+"(a_"+Ht+", u_"+Ht+`_t); #else - `+bt+" "+Zt+" "+Vt+" = u_"+Vt+`; + `+Tt+" "+$t+" "+Ht+" = u_"+Ht+`; #endif -`:at==="define"?` -#ifndef HAS_UNIFORM_u_`+Vt+` -uniform lowp float u_`+Vt+`_t; -attribute `+bt+" "+Kt+" a_"+Vt+`; +`:it==="define"?` +#ifndef HAS_UNIFORM_u_`+Ht+` +uniform lowp float u_`+Ht+`_t; +attribute `+Tt+" "+Jt+" a_"+Ht+`; #else -uniform `+bt+" "+Zt+" u_"+Vt+`; +uniform `+Tt+" "+$t+" u_"+Ht+`; #endif -`:nr==="vec4"?` -#ifndef HAS_UNIFORM_u_`+Vt+` - `+bt+" "+Zt+" "+Vt+" = a_"+Vt+`; +`:ir==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Ht+` + `+Tt+" "+$t+" "+Ht+" = a_"+Ht+`; #else - `+bt+" "+Zt+" "+Vt+" = u_"+Vt+`; + `+Tt+" "+$t+" "+Ht+" = u_"+Ht+`; #endif `:` -#ifndef HAS_UNIFORM_u_`+Vt+` - `+bt+" "+Zt+" "+Vt+" = unpack_mix_"+nr+"(a_"+Vt+", u_"+Vt+`_t); +#ifndef HAS_UNIFORM_u_`+Ht+` + `+Tt+" "+$t+" "+Ht+" = unpack_mix_"+ir+"(a_"+Ht+", u_"+Ht+`_t); #else - `+bt+" "+Zt+" "+Vt+" = u_"+Vt+`; + `+Tt+" "+$t+" "+Ht+" = u_"+Ht+`; #endif -`}),{fragmentSource:be,vertexSource:q,staticAttributes:J,staticUniforms:lt}}var lh=Object.freeze({__proto__:null,prelude:yu,background:Rc,backgroundPattern:Of,circle:$l,clippingMask:Af,heatmap:vc,heatmapTexture:Ic,collisionBox:uu,collisionCircle:$f,debug:ff,fill:Ff,fillOutline:xh,fillOutlinePattern:Tv,fillPattern:Zv,fillExtrusion:Jf,fillExtrusionPattern:bh,hillshadePrepare:Vc,hillshade:wh,line:ic,lineGradient:Qf,linePattern:Gh,lineSDF:eh,raster:tu,symbolIcon:Dc,symbolSDF:nf,symbolTextAndIcon:Oh}),Bf=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};Bf.prototype.bind=function(q,he,J,_e,qe,lt,vt,Ke){this.context=q;for(var at=this.boundPaintVertexBuffers.length!==_e.length,bt=0;!at&&bt<_e.length;bt++)this.boundPaintVertexBuffers[bt]!==_e[bt]&&(at=!0);var Zt=!this.vao||this.boundProgram!==he||this.boundLayoutVertexBuffer!==J||at||this.boundIndexBuffer!==qe||this.boundVertexOffset!==lt||this.boundDynamicVertexBuffer!==vt||this.boundDynamicVertexBuffer2!==Ke;!q.extVertexArrayObject||Zt?this.freshBind(he,J,_e,qe,lt,vt,Ke):(q.bindVertexArrayOES.set(this.vao),vt&&vt.bind(),qe&&qe.dynamicDraw&&qe.bind(),Ke&&Ke.bind())},Bf.prototype.freshBind=function(q,he,J,_e,qe,lt,vt){var Ke,at=q.numAttributes,bt=this.context,Zt=bt.gl;if(bt.extVertexArrayObject)this.vao&&this.destroy(),this.vao=bt.extVertexArrayObject.createVertexArrayOES(),bt.bindVertexArrayOES.set(this.vao),Ke=0,this.boundProgram=q,this.boundLayoutVertexBuffer=he,this.boundPaintVertexBuffers=J,this.boundIndexBuffer=_e,this.boundVertexOffset=qe,this.boundDynamicVertexBuffer=lt,this.boundDynamicVertexBuffer2=vt;else{Ke=bt.currentNumAttributes||0;for(var Vt=at;Vt>16,vt>>16],u_pixel_coord_lower:[lt&65535,vt&65535]}}function ch(be,q,he,J){var _e=he.imageManager.getPattern(be.from.toString()),qe=he.imageManager.getPattern(be.to.toString()),lt=he.imageManager.getPixelSize(),vt=lt.width,Ke=lt.height,at=Math.pow(2,J.tileID.overscaledZ),bt=J.tileSize*Math.pow(2,he.transform.tileZoom)/at,Zt=bt*(J.tileID.canonical.x+J.tileID.wrap*at),Vt=bt*J.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:_e.tl,u_pattern_br_a:_e.br,u_pattern_tl_b:qe.tl,u_pattern_br_b:qe.br,u_texsize:[vt,Ke],u_mix:q.t,u_pattern_size_a:_e.displaySize,u_pattern_size_b:qe.displaySize,u_scale_a:q.fromScale,u_scale_b:q.toScale,u_tile_units_to_pixels:1/Hs(J,1,he.transform.tileZoom),u_pixel_coord_upper:[Zt>>16,Vt>>16],u_pixel_coord_lower:[Zt&65535,Vt&65535]}}var Av=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_lightpos:new e.Uniform3f(be,q.u_lightpos),u_lightintensity:new e.Uniform1f(be,q.u_lightintensity),u_lightcolor:new e.Uniform3f(be,q.u_lightcolor),u_vertical_gradient:new e.Uniform1f(be,q.u_vertical_gradient),u_opacity:new e.Uniform1f(be,q.u_opacity)}},lc=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_lightpos:new e.Uniform3f(be,q.u_lightpos),u_lightintensity:new e.Uniform1f(be,q.u_lightintensity),u_lightcolor:new e.Uniform3f(be,q.u_lightcolor),u_vertical_gradient:new e.Uniform1f(be,q.u_vertical_gradient),u_height_factor:new e.Uniform1f(be,q.u_height_factor),u_image:new e.Uniform1i(be,q.u_image),u_texsize:new e.Uniform2f(be,q.u_texsize),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade),u_opacity:new e.Uniform1f(be,q.u_opacity)}},Xh=function(be,q,he,J){var _e=q.style.light,qe=_e.properties.get("position"),lt=[qe.x,qe.y,qe.z],vt=e.create$1();_e.properties.get("anchor")==="viewport"&&e.fromRotation(vt,-q.transform.angle),e.transformMat3(lt,lt,vt);var Ke=_e.properties.get("color");return{u_matrix:be,u_lightpos:lt,u_lightintensity:_e.properties.get("intensity"),u_lightcolor:[Ke.r,Ke.g,Ke.b],u_vertical_gradient:+he,u_opacity:J}},Gc=function(be,q,he,J,_e,qe,lt){return e.extend(Xh(be,q,he,J),hf(qe,q,lt),{u_height_factor:-Math.pow(2,_e.overscaledZ)/lt.tileSize/8})},Sf=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},vf=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_image:new e.Uniform1i(be,q.u_image),u_texsize:new e.Uniform2f(be,q.u_texsize),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade)}},bu=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_world:new e.Uniform2f(be,q.u_world)}},_c=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_world:new e.Uniform2f(be,q.u_world),u_image:new e.Uniform1i(be,q.u_image),u_texsize:new e.Uniform2f(be,q.u_texsize),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade)}},hu=function(be){return{u_matrix:be}},Nf=function(be,q,he,J){return e.extend(hu(be),hf(he,q,J))},df=function(be,q){return{u_matrix:be,u_world:q}},Fh=function(be,q,he,J,_e){return e.extend(Nf(be,q,he,J),{u_world:_e})},ur=function(be,q){return{u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(be,q.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(be,q.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},Pr=function(be,q,he,J){var _e=be.transform,qe,lt;if(J.paint.get("circle-pitch-alignment")==="map"){var vt=Hs(he,1,_e.zoom);qe=!0,lt=[vt,vt]}else qe=!1,lt=_e.pixelsToGLUnits;return{u_camera_to_center_distance:_e.cameraToCenterDistance,u_scale_with_map:+(J.paint.get("circle-pitch-scale")==="map"),u_matrix:be.translatePosMatrix(q.posMatrix,he,J.paint.get("circle-translate"),J.paint.get("circle-translate-anchor")),u_pitch_with_map:+qe,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:lt}},dn=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(be,q.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(be,q.u_extrude_scale),u_overscale_factor:new e.Uniform1f(be,q.u_overscale_factor)}},nn=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_inv_matrix:new e.UniformMatrix4f(be,q.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(be,q.u_viewport_size)}},On=function(be,q,he){var J=Hs(he,1,q.zoom),_e=Math.pow(2,q.zoom-he.tileID.overscaledZ),qe=he.tileID.overscaleFactor();return{u_matrix:be,u_camera_to_center_distance:q.cameraToCenterDistance,u_pixels_to_tile_units:J,u_extrude_scale:[q.pixelsToGLUnits[0]/(J*_e),q.pixelsToGLUnits[1]/(J*_e)],u_overscale_factor:qe}},Ta=function(be,q,he){return{u_matrix:be,u_inv_matrix:q,u_camera_to_center_distance:he.cameraToCenterDistance,u_viewport_size:[he.width,he.height]}},xa=function(be,q){return{u_color:new e.UniformColor(be,q.u_color),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_overlay:new e.Uniform1i(be,q.u_overlay),u_overlay_scale:new e.Uniform1f(be,q.u_overlay_scale)}},ri=function(be,q,he){return he===void 0&&(he=1),{u_matrix:be,u_color:q,u_overlay:0,u_overlay_scale:he}},fi=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},Ni=function(be){return{u_matrix:be}},Va=function(be,q){return{u_extrude_scale:new e.Uniform1f(be,q.u_extrude_scale),u_intensity:new e.Uniform1f(be,q.u_intensity),u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},Ai=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_world:new e.Uniform2f(be,q.u_world),u_image:new e.Uniform1i(be,q.u_image),u_color_ramp:new e.Uniform1i(be,q.u_color_ramp),u_opacity:new e.Uniform1f(be,q.u_opacity)}},ei=function(be,q,he,J){return{u_matrix:be,u_extrude_scale:Hs(q,1,he),u_intensity:J}},Na=function(be,q,he,J){var _e=e.create();e.ortho(_e,0,be.width,be.height,0,0,1);var qe=be.context.gl;return{u_matrix:_e,u_world:[qe.drawingBufferWidth,qe.drawingBufferHeight],u_image:he,u_color_ramp:J,u_opacity:q.paint.get("heatmap-opacity")}},Zi=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_image:new e.Uniform1i(be,q.u_image),u_latrange:new e.Uniform2f(be,q.u_latrange),u_light:new e.Uniform2f(be,q.u_light),u_shadow:new e.UniformColor(be,q.u_shadow),u_highlight:new e.UniformColor(be,q.u_highlight),u_accent:new e.UniformColor(be,q.u_accent)}},jo=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_image:new e.Uniform1i(be,q.u_image),u_dimension:new e.Uniform2f(be,q.u_dimension),u_zoom:new e.Uniform1f(be,q.u_zoom),u_unpack:new e.Uniform4f(be,q.u_unpack)}},Fo=function(be,q,he){var J=he.paint.get("hillshade-shadow-color"),_e=he.paint.get("hillshade-highlight-color"),qe=he.paint.get("hillshade-accent-color"),lt=he.paint.get("hillshade-illumination-direction")*(Math.PI/180);he.paint.get("hillshade-illumination-anchor")==="viewport"&&(lt-=be.transform.angle);var vt=!be.options.moving;return{u_matrix:be.transform.calculatePosMatrix(q.tileID.toUnwrapped(),vt),u_image:0,u_latrange:Vo(be,q.tileID),u_light:[he.paint.get("hillshade-exaggeration"),lt],u_shadow:J,u_highlight:_e,u_accent:qe}},Yo=function(be,q){var he=q.stride,J=e.create();return e.ortho(J,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(J,J,[0,-e.EXTENT,0]),{u_matrix:J,u_image:1,u_dimension:[he,he],u_zoom:be.overscaledZ,u_unpack:q.getUnpackVector()}};function Vo(be,q){var he=Math.pow(2,q.canonical.z),J=q.canonical.y;return[new e.MercatorCoordinate(0,J/he).toLngLat().lat,new e.MercatorCoordinate(0,(J+1)/he).toLngLat().lat]}var Ki=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels)}},Ri=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels),u_image:new e.Uniform1i(be,q.u_image),u_image_height:new e.Uniform1f(be,q.u_image_height)}},is=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_texsize:new e.Uniform2f(be,q.u_texsize),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_image:new e.Uniform1i(be,q.u_image),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade)}},Us=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(be,q.u_patternscale_a),u_patternscale_b:new e.Uniform2f(be,q.u_patternscale_b),u_sdfgamma:new e.Uniform1f(be,q.u_sdfgamma),u_image:new e.Uniform1i(be,q.u_image),u_tex_y_a:new e.Uniform1f(be,q.u_tex_y_a),u_tex_y_b:new e.Uniform1f(be,q.u_tex_y_b),u_mix:new e.Uniform1f(be,q.u_mix)}},Al=function(be,q,he){var J=be.transform;return{u_matrix:Su(be,q,he),u_ratio:1/Hs(q,1,J.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/J.pixelsToGLUnits[0],1/J.pixelsToGLUnits[1]]}},Xl=function(be,q,he,J){return e.extend(Al(be,q,he),{u_image:0,u_image_height:J})},Ml=function(be,q,he,J){var _e=be.transform,qe=rl(q,_e);return{u_matrix:Su(be,q,he),u_texsize:q.imageAtlasTexture.size,u_ratio:1/Hs(q,1,_e.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[qe,J.fromScale,J.toScale],u_fade:J.t,u_units_to_pixels:[1/_e.pixelsToGLUnits[0],1/_e.pixelsToGLUnits[1]]}},Yl=function(be,q,he,J,_e){var qe=be.transform,lt=be.lineAtlas,vt=rl(q,qe),Ke=he.layout.get("line-cap")==="round",at=lt.getDash(J.from,Ke),bt=lt.getDash(J.to,Ke),Zt=at.width*_e.fromScale,Vt=bt.width*_e.toScale;return e.extend(Al(be,q,he),{u_patternscale_a:[vt/Zt,-at.height/2],u_patternscale_b:[vt/Vt,-bt.height/2],u_sdfgamma:lt.width/(Math.min(Zt,Vt)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:at.y,u_tex_y_b:bt.y,u_mix:_e.t})};function rl(be,q){return 1/Hs(be,1,q.tileZoom)}function Su(be,q,he){return be.translatePosMatrix(q.tileID.posMatrix,q,he.paint.get("line-translate"),he.paint.get("line-translate-anchor"))}var wu=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_tl_parent:new e.Uniform2f(be,q.u_tl_parent),u_scale_parent:new e.Uniform1f(be,q.u_scale_parent),u_buffer_scale:new e.Uniform1f(be,q.u_buffer_scale),u_fade_t:new e.Uniform1f(be,q.u_fade_t),u_opacity:new e.Uniform1f(be,q.u_opacity),u_image0:new e.Uniform1i(be,q.u_image0),u_image1:new e.Uniform1i(be,q.u_image1),u_brightness_low:new e.Uniform1f(be,q.u_brightness_low),u_brightness_high:new e.Uniform1f(be,q.u_brightness_high),u_saturation_factor:new e.Uniform1f(be,q.u_saturation_factor),u_contrast_factor:new e.Uniform1f(be,q.u_contrast_factor),u_spin_weights:new e.Uniform3f(be,q.u_spin_weights)}},ql=function(be,q,he,J,_e){return{u_matrix:be,u_tl_parent:q,u_scale_parent:he,u_buffer_scale:1,u_fade_t:J.mix,u_opacity:J.opacity*_e.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:_e.paint.get("raster-brightness-min"),u_brightness_high:_e.paint.get("raster-brightness-max"),u_saturation_factor:zl(_e.paint.get("raster-saturation")),u_contrast_factor:xs(_e.paint.get("raster-contrast")),u_spin_weights:bo(_e.paint.get("raster-hue-rotate"))}};function bo(be){be*=Math.PI/180;var q=Math.sin(be),he=Math.cos(be);return[(2*he+1)/3,(-Math.sqrt(3)*q-he+1)/3,(Math.sqrt(3)*q-he+1)/3]}function xs(be){return be>0?1/(1-be):1+be}function zl(be){return be>0?1-1/(1.001-be):-be}var pl=function(be,q){return{u_is_size_zoom_constant:new e.Uniform1i(be,q.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(be,q.u_is_size_feature_constant),u_size_t:new e.Uniform1f(be,q.u_size_t),u_size:new e.Uniform1f(be,q.u_size),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pitch:new e.Uniform1f(be,q.u_pitch),u_rotate_symbol:new e.Uniform1i(be,q.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(be,q.u_aspect_ratio),u_fade_change:new e.Uniform1f(be,q.u_fade_change),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(be,q.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(be,q.u_coord_matrix),u_is_text:new e.Uniform1i(be,q.u_is_text),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_texsize:new e.Uniform2f(be,q.u_texsize),u_texture:new e.Uniform1i(be,q.u_texture)}},dc=function(be,q){return{u_is_size_zoom_constant:new e.Uniform1i(be,q.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(be,q.u_is_size_feature_constant),u_size_t:new e.Uniform1f(be,q.u_size_t),u_size:new e.Uniform1f(be,q.u_size),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pitch:new e.Uniform1f(be,q.u_pitch),u_rotate_symbol:new e.Uniform1i(be,q.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(be,q.u_aspect_ratio),u_fade_change:new e.Uniform1f(be,q.u_fade_change),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(be,q.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(be,q.u_coord_matrix),u_is_text:new e.Uniform1i(be,q.u_is_text),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_texsize:new e.Uniform2f(be,q.u_texsize),u_texture:new e.Uniform1i(be,q.u_texture),u_gamma_scale:new e.Uniform1f(be,q.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(be,q.u_is_halo)}},pc=function(be,q){return{u_is_size_zoom_constant:new e.Uniform1i(be,q.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(be,q.u_is_size_feature_constant),u_size_t:new e.Uniform1f(be,q.u_size_t),u_size:new e.Uniform1f(be,q.u_size),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pitch:new e.Uniform1f(be,q.u_pitch),u_rotate_symbol:new e.Uniform1i(be,q.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(be,q.u_aspect_ratio),u_fade_change:new e.Uniform1f(be,q.u_fade_change),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(be,q.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(be,q.u_coord_matrix),u_is_text:new e.Uniform1i(be,q.u_is_text),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_texsize:new e.Uniform2f(be,q.u_texsize),u_texsize_icon:new e.Uniform2f(be,q.u_texsize_icon),u_texture:new e.Uniform1i(be,q.u_texture),u_texture_icon:new e.Uniform1i(be,q.u_texture_icon),u_gamma_scale:new e.Uniform1f(be,q.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(be,q.u_is_halo)}},xc=function(be,q,he,J,_e,qe,lt,vt,Ke,at){var bt=_e.transform;return{u_is_size_zoom_constant:+(be==="constant"||be==="source"),u_is_size_feature_constant:+(be==="constant"||be==="camera"),u_size_t:q?q.uSizeT:0,u_size:q?q.uSize:0,u_camera_to_center_distance:bt.cameraToCenterDistance,u_pitch:bt.pitch/360*2*Math.PI,u_rotate_symbol:+he,u_aspect_ratio:bt.width/bt.height,u_fade_change:_e.options.fadeDuration?_e.symbolFadeChange:1,u_matrix:qe,u_label_plane_matrix:lt,u_coord_matrix:vt,u_is_text:+Ke,u_pitch_with_map:+J,u_texsize:at,u_texture:0}},Gf=function(be,q,he,J,_e,qe,lt,vt,Ke,at,bt){var Zt=_e.transform;return e.extend(xc(be,q,he,J,_e,qe,lt,vt,Ke,at),{u_gamma_scale:J?Math.cos(Zt._pitch)*Zt.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:1})},mc=function(be,q,he,J,_e,qe,lt,vt,Ke,at){return e.extend(Gf(be,q,he,J,_e,qe,lt,vt,!0,Ke),{u_texsize_icon:at,u_texture_icon:1})},Mf=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_opacity:new e.Uniform1f(be,q.u_opacity),u_color:new e.UniformColor(be,q.u_color)}},Mu=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_opacity:new e.Uniform1f(be,q.u_opacity),u_image:new e.Uniform1i(be,q.u_image),u_pattern_tl_a:new e.Uniform2f(be,q.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(be,q.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(be,q.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(be,q.u_pattern_br_b),u_texsize:new e.Uniform2f(be,q.u_texsize),u_mix:new e.Uniform1f(be,q.u_mix),u_pattern_size_a:new e.Uniform2f(be,q.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(be,q.u_pattern_size_b),u_scale_a:new e.Uniform1f(be,q.u_scale_a),u_scale_b:new e.Uniform1f(be,q.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(be,q.u_tile_units_to_pixels)}},Ef=function(be,q,he){return{u_matrix:be,u_opacity:q,u_color:he}},Zo=function(be,q,he,J,_e,qe){return e.extend(ch(J,qe,he,_e),{u_matrix:be,u_opacity:q})},ss={fillExtrusion:Av,fillExtrusionPattern:lc,fill:Sf,fillPattern:vf,fillOutline:bu,fillOutlinePattern:_c,circle:ur,collisionBox:dn,collisionCircle:nn,debug:xa,clippingMask:fi,heatmap:Va,heatmapTexture:Ai,hillshade:Zi,hillshadePrepare:jo,line:Ki,lineGradient:Ri,linePattern:is,lineSDF:Us,raster:wu,symbolIcon:pl,symbolSDF:dc,symbolTextAndIcon:pc,background:Mf,backgroundPattern:Mu},kf;function Xc(be,q,he,J,_e,qe,lt){for(var vt=be.context,Ke=vt.gl,at=be.useProgram("collisionBox"),bt=[],Zt=0,Vt=0,Kt=0;Kt0){var Yr=e.create(),fn=Xt;e.mul(Yr,Bt.placementInvProjMatrix,be.transform.glCoordMatrix),e.mul(Yr,Yr,Bt.placementViewportMatrix),bt.push({circleArray:zr,circleOffset:Vt,transform:fn,invTransform:Yr}),Zt+=zr.length/4,Vt=Zt}Ht&&at.draw(vt,Ke.LINES,qn.disabled,Nn.disabled,be.colorModeForRenderPass(),Vr.disabled,On(Xt,be.transform,er),he.id,Ht.layoutVertexBuffer,Ht.indexBuffer,Ht.segments,null,be.transform.zoom,null,null,Ht.collisionVertexBuffer)}}if(!(!lt||!bt.length)){var sa=be.useProgram("collisionCircle"),Wn=new e.StructArrayLayout2f1f2i16;Wn.resize(Zt*4),Wn._trim();for(var Hn=0,la=0,va=bt;la=0&&(nr[Bt.associatedIconIndex]={shiftedAnchor:Fa,angle:Ja})}}if(bt){Kt.clear();for(var Hi=be.icon.placedSymbolArray,ws=0;ws0){var lt=e.browser.now(),vt=(lt-be.timeAdded)/qe,Ke=q?(lt-q.timeAdded)/qe:-1,at=he.getSource(),bt=_e.coveringZoomLevel({tileSize:at.tileSize,roundZoom:at.roundZoom}),Zt=!q||Math.abs(q.tileID.overscaledZ-bt)>Math.abs(be.tileID.overscaledZ-bt),Vt=Zt&&be.refreshedUponExpiration?1:e.clamp(Zt?vt:1-Ke,0,1);return be.refreshedUponExpiration&&vt>=1&&(be.refreshedUponExpiration=!1),q?{opacity:1,mix:1-Vt}:{opacity:Vt,mix:0}}else return{opacity:1,mix:0}}function Lr(be,q,he){var J=he.paint.get("background-color"),_e=he.paint.get("background-opacity");if(_e!==0){var qe=be.context,lt=qe.gl,vt=be.transform,Ke=vt.tileSize,at=he.paint.get("background-pattern");if(!be.isPatternMissing(at)){var bt=!at&&J.a===1&&_e===1&&be.opaquePassEnabledForLayer()?"opaque":"translucent";if(be.renderPass===bt){var Zt=Nn.disabled,Vt=be.depthModeForSublayer(0,bt==="opaque"?qn.ReadWrite:qn.ReadOnly),Kt=be.colorModeForRenderPass(),nr=be.useProgram(at?"backgroundPattern":"background"),er=vt.coveringTiles({tileSize:Ke});at&&(qe.activeTexture.set(lt.TEXTURE0),be.imageManager.bind(be.context));for(var Bt=he.getCrossfadeParameters(),Xt=0,Ht=er;Xt "+he.overscaledZ);var Xt=Bt+" "+Kt+"kb";$o(be,Xt),lt.draw(J,_e.TRIANGLES,vt,Ke,qt.alphaBlended,Vr.disabled,ri(qe,e.Color.transparent,er),bt,be.debugBuffer,be.quadTriangleIndexBuffer,be.debugSegments)}function $o(be,q){be.initDebugOverlayCanvas();var he=be.debugOverlayCanvas,J=be.context.gl,_e=be.debugOverlayCanvas.getContext("2d");_e.clearRect(0,0,he.width,he.height),_e.shadowColor="white",_e.shadowBlur=2,_e.lineWidth=1.5,_e.strokeStyle="white",_e.textBaseline="top",_e.font="bold 36px Open Sans, sans-serif",_e.fillText(q,5,5),_e.strokeText(q,5,5),be.debugOverlayTexture.update(he),be.debugOverlayTexture.bind(J.LINEAR,J.CLAMP_TO_EDGE)}function Js(be,q,he){var J=be.context,_e=he.implementation;if(be.renderPass==="offscreen"){var qe=_e.prerender;qe&&(be.setCustomLayerDefaults(),J.setColorMode(be.colorModeForRenderPass()),qe.call(_e,J.gl,be.transform.customLayerMatrix()),J.setDirty(),be.setBaseState())}else if(be.renderPass==="translucent"){be.setCustomLayerDefaults(),J.setColorMode(be.colorModeForRenderPass()),J.setStencilMode(Nn.disabled);var lt=_e.renderingMode==="3d"?new qn(be.context.gl.LEQUAL,qn.ReadWrite,be.depthRangeFor3D):be.depthModeForSublayer(0,qn.ReadOnly);J.setDepthMode(lt),_e.render(J.gl,be.transform.customLayerMatrix()),J.setDirty(),be.setBaseState(),J.bindFramebuffer.set(null)}}var Qs={symbol:P,circle:Gt,heatmap:cr,line:_n,fill:Ze,"fill-extrusion":ht,hillshade:zt,raster:mr,background:Lr,debug:Ao,custom:Js},Ls=function(q,he){this.context=new sn(q),this.transform=he,this._tileTextures={},this.setup(),this.numSublayers=mn.maxUnderzooming+mn.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new fu,this.gpuTimers={}};Ls.prototype.resize=function(q,he){if(this.width=q*e.browser.devicePixelRatio,this.height=he*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var J=0,_e=this.style._order;J<_e.length;J+=1){var qe=_e[J];this.style._layers[qe].resize()}},Ls.prototype.setup=function(){var q=this.context,he=new e.StructArrayLayout2i4;he.emplaceBack(0,0),he.emplaceBack(e.EXTENT,0),he.emplaceBack(0,e.EXTENT),he.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=q.createVertexBuffer(he,uf.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);var J=new e.StructArrayLayout2i4;J.emplaceBack(0,0),J.emplaceBack(e.EXTENT,0),J.emplaceBack(0,e.EXTENT),J.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=q.createVertexBuffer(J,uf.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);var _e=new e.StructArrayLayout4i8;_e.emplaceBack(0,0,0,0),_e.emplaceBack(e.EXTENT,0,e.EXTENT,0),_e.emplaceBack(0,e.EXTENT,0,e.EXTENT),_e.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.rasterBoundsBuffer=q.createVertexBuffer(_e,fe.members),this.rasterBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);var qe=new e.StructArrayLayout2i4;qe.emplaceBack(0,0),qe.emplaceBack(1,0),qe.emplaceBack(0,1),qe.emplaceBack(1,1),this.viewportBuffer=q.createVertexBuffer(qe,uf.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);var lt=new e.StructArrayLayout1ui2;lt.emplaceBack(0),lt.emplaceBack(1),lt.emplaceBack(3),lt.emplaceBack(2),lt.emplaceBack(0),this.tileBorderIndexBuffer=q.createIndexBuffer(lt);var vt=new e.StructArrayLayout3ui6;vt.emplaceBack(0,1,2),vt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=q.createIndexBuffer(vt),this.emptyTexture=new e.Texture(q,{width:1,height:1,data:new Uint8Array([0,0,0,0])},q.gl.RGBA);var Ke=this.context.gl;this.stencilClearMode=new Nn({func:Ke.ALWAYS,mask:0},0,255,Ke.ZERO,Ke.ZERO,Ke.ZERO)},Ls.prototype.clearStencil=function(){var q=this.context,he=q.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var J=e.create();e.ortho(J,0,this.width,this.height,0,0,1),e.scale(J,J,[he.drawingBufferWidth,he.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(q,he.TRIANGLES,qn.disabled,this.stencilClearMode,qt.disabled,Vr.disabled,Ni(J),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Ls.prototype._renderTileClippingMasks=function(q,he){if(!(this.currentStencilSource===q.source||!q.isTileClipped()||!he||!he.length)){this.currentStencilSource=q.source;var J=this.context,_e=J.gl;this.nextStencilID+he.length>256&&this.clearStencil(),J.setColorMode(qt.disabled),J.setDepthMode(qn.disabled);var qe=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var lt=0,vt=he;lt256&&this.clearStencil();var q=this.nextStencilID++,he=this.context.gl;return new Nn({func:he.NOTEQUAL,mask:255},q,255,he.KEEP,he.KEEP,he.REPLACE)},Ls.prototype.stencilModeForClipping=function(q){var he=this.context.gl;return new Nn({func:he.EQUAL,mask:255},this._tileClippingMaskIDs[q.key],0,he.KEEP,he.KEEP,he.REPLACE)},Ls.prototype.stencilConfigForOverlap=function(q){var he,J=this.context.gl,_e=q.sort(function(at,bt){return bt.overscaledZ-at.overscaledZ}),qe=_e[_e.length-1].overscaledZ,lt=_e[0].overscaledZ-qe+1;if(lt>1){this.currentStencilSource=void 0,this.nextStencilID+lt>256&&this.clearStencil();for(var vt={},Ke=0;Ke=0;this.currentLayer--){var Yr=this.style._layers[_e[this.currentLayer]],fn=qe[Yr.source],sa=Ke[Yr.source];this._renderTileClippingMasks(Yr,sa),this.renderLayer(this,fn,Yr,sa)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<_e.length;this.currentLayer++){var Wn=this.style._layers[_e[this.currentLayer]],Hn=qe[Wn.source],la=(Wn.type==="symbol"?bt:at)[Wn.source];this._renderTileClippingMasks(Wn,Ke[Wn.source]),this.renderLayer(this,Hn,Wn,la)}if(this.options.showTileBoundaries){var va,Pa,ca=e.values(this.style._layers);ca.forEach(function(Fa){Fa.source&&!Fa.isHidden(J.transform.zoom)&&(Fa.source!==(Pa&&Pa.id)&&(Pa=J.style.sourceCaches[Fa.source]),(!va||va.getSource().maxzoom0?he.pop():null},Ls.prototype.isPatternMissing=function(q){if(!q)return!1;if(!q.from||!q.to)return!0;var he=this.imageManager.getPattern(q.from.toString()),J=this.imageManager.getPattern(q.to.toString());return!he||!J},Ls.prototype.useProgram=function(q,he){this.cache=this.cache||{};var J=""+q+(he?he.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[J]||(this.cache[J]=new uh(this.context,q,lh[q],he,ss[q],this._showOverdrawInspector)),this.cache[J]},Ls.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Ls.prototype.setBaseState=function(){var q=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(q.FUNC_ADD)},Ls.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var q=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,q.RGBA)}},Ls.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var al=function(q,he){this.points=q,this.planes=he};al.fromInvProjectionMatrix=function(q,he,J){var _e=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],qe=Math.pow(2,J),lt=_e.map(function(at){return e.transformMat4([],at,q)}).map(function(at){return e.scale$1([],at,1/at[3]/he*qe)}),vt=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],Ke=vt.map(function(at){var bt=e.sub([],lt[at[0]],lt[at[1]]),Zt=e.sub([],lt[at[2]],lt[at[1]]),Vt=e.normalize([],e.cross([],bt,Zt)),Kt=-e.dot(Vt,lt[at[1]]);return Vt.concat(Kt)});return new al(lt,Ke)};var vu=function(q,he){this.min=q,this.max=he,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};vu.prototype.quadrant=function(q){for(var he=[q%2===0,q<2],J=e.clone$2(this.min),_e=e.clone$2(this.max),qe=0;qe=0;if(lt===0)return 0;lt!==he.length&&(J=!1)}if(J)return 2;for(var Ke=0;Ke<3;Ke++){for(var at=Number.MAX_VALUE,bt=-Number.MAX_VALUE,Zt=0;Ztthis.max[Ke]-this.min[Ke])return 0}return 1};var ru=function(q,he,J,_e){if(q===void 0&&(q=0),he===void 0&&(he=0),J===void 0&&(J=0),_e===void 0&&(_e=0),isNaN(q)||q<0||isNaN(he)||he<0||isNaN(J)||J<0||isNaN(_e)||_e<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=q,this.bottom=he,this.left=J,this.right=_e};ru.prototype.interpolate=function(q,he,J){return he.top!=null&&q.top!=null&&(this.top=e.number(q.top,he.top,J)),he.bottom!=null&&q.bottom!=null&&(this.bottom=e.number(q.bottom,he.bottom,J)),he.left!=null&&q.left!=null&&(this.left=e.number(q.left,he.left,J)),he.right!=null&&q.right!=null&&(this.right=e.number(q.right,he.right,J)),this},ru.prototype.getCenter=function(q,he){var J=e.clamp((this.left+q-this.right)/2,0,q),_e=e.clamp((this.top+he-this.bottom)/2,0,he);return new e.Point(J,_e)},ru.prototype.equals=function(q){return this.top===q.top&&this.bottom===q.bottom&&this.left===q.left&&this.right===q.right},ru.prototype.clone=function(){return new ru(this.top,this.bottom,this.left,this.right)},ru.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Ps=function(q,he,J,_e,qe){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=qe===void 0?!0:qe,this._minZoom=q||0,this._maxZoom=he||22,this._minPitch=J??0,this._maxPitch=_e??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ru,this._posMatrixCache={},this._alignedPosMatrixCache={}},Rs={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Ps.prototype.clone=function(){var q=new Ps(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return q.tileSize=this.tileSize,q.latRange=this.latRange,q.width=this.width,q.height=this.height,q._center=this._center,q.zoom=this.zoom,q.angle=this.angle,q._fov=this._fov,q._pitch=this._pitch,q._unmodified=this._unmodified,q._edgeInsets=this._edgeInsets.clone(),q._calcMatrices(),q},Rs.minZoom.get=function(){return this._minZoom},Rs.minZoom.set=function(be){this._minZoom!==be&&(this._minZoom=be,this.zoom=Math.max(this.zoom,be))},Rs.maxZoom.get=function(){return this._maxZoom},Rs.maxZoom.set=function(be){this._maxZoom!==be&&(this._maxZoom=be,this.zoom=Math.min(this.zoom,be))},Rs.minPitch.get=function(){return this._minPitch},Rs.minPitch.set=function(be){this._minPitch!==be&&(this._minPitch=be,this.pitch=Math.max(this.pitch,be))},Rs.maxPitch.get=function(){return this._maxPitch},Rs.maxPitch.set=function(be){this._maxPitch!==be&&(this._maxPitch=be,this.pitch=Math.min(this.pitch,be))},Rs.renderWorldCopies.get=function(){return this._renderWorldCopies},Rs.renderWorldCopies.set=function(be){be===void 0?be=!0:be===null&&(be=!1),this._renderWorldCopies=be},Rs.worldSize.get=function(){return this.tileSize*this.scale},Rs.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Rs.size.get=function(){return new e.Point(this.width,this.height)},Rs.bearing.get=function(){return-this.angle/Math.PI*180},Rs.bearing.set=function(be){var q=-e.wrap(be,-180,180)*Math.PI/180;this.angle!==q&&(this._unmodified=!1,this.angle=q,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Rs.pitch.get=function(){return this._pitch/Math.PI*180},Rs.pitch.set=function(be){var q=e.clamp(be,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==q&&(this._unmodified=!1,this._pitch=q,this._calcMatrices())},Rs.fov.get=function(){return this._fov/Math.PI*180},Rs.fov.set=function(be){be=Math.max(.01,Math.min(60,be)),this._fov!==be&&(this._unmodified=!1,this._fov=be/180*Math.PI,this._calcMatrices())},Rs.zoom.get=function(){return this._zoom},Rs.zoom.set=function(be){var q=Math.min(Math.max(be,this.minZoom),this.maxZoom);this._zoom!==q&&(this._unmodified=!1,this._zoom=q,this.scale=this.zoomScale(q),this.tileZoom=Math.floor(q),this.zoomFraction=q-this.tileZoom,this._constrain(),this._calcMatrices())},Rs.center.get=function(){return this._center},Rs.center.set=function(be){be.lat===this._center.lat&&be.lng===this._center.lng||(this._unmodified=!1,this._center=be,this._constrain(),this._calcMatrices())},Rs.padding.get=function(){return this._edgeInsets.toJSON()},Rs.padding.set=function(be){this._edgeInsets.equals(be)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,be,1),this._calcMatrices())},Rs.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Ps.prototype.isPaddingEqual=function(q){return this._edgeInsets.equals(q)},Ps.prototype.interpolatePadding=function(q,he,J){this._unmodified=!1,this._edgeInsets.interpolate(q,he,J),this._constrain(),this._calcMatrices()},Ps.prototype.coveringZoomLevel=function(q){var he=(q.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/q.tileSize));return Math.max(0,he)},Ps.prototype.getVisibleUnwrappedCoordinates=function(q){var he=[new e.UnwrappedTileID(0,q)];if(this._renderWorldCopies)for(var J=this.pointCoordinate(new e.Point(0,0)),_e=this.pointCoordinate(new e.Point(this.width,0)),qe=this.pointCoordinate(new e.Point(this.width,this.height)),lt=this.pointCoordinate(new e.Point(0,this.height)),vt=Math.floor(Math.min(J.x,_e.x,qe.x,lt.x)),Ke=Math.floor(Math.max(J.x,_e.x,qe.x,lt.x)),at=1,bt=vt-at;bt<=Ke+at;bt++)bt!==0&&he.push(new e.UnwrappedTileID(bt,q));return he},Ps.prototype.coveringTiles=function(q){var he=this.coveringZoomLevel(q),J=he;if(q.minzoom!==void 0&&heq.maxzoom&&(he=q.maxzoom);var _e=e.MercatorCoordinate.fromLngLat(this.center),qe=Math.pow(2,he),lt=[qe*_e.x,qe*_e.y,0],vt=al.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,he),Ke=q.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(Ke=he);var at=3,bt=function(ca){return{aabb:new vu([ca*qe,0,0],[(ca+1)*qe,qe,0]),zoom:0,x:0,y:0,wrap:ca,fullyVisible:!1}},Zt=[],Vt=[],Kt=he,nr=q.reparseOverscaled?J:he;if(this._renderWorldCopies)for(var er=1;er<=3;er++)Zt.push(bt(-er)),Zt.push(bt(er));for(Zt.push(bt(0));Zt.length>0;){var Bt=Zt.pop(),Xt=Bt.x,Ht=Bt.y,zr=Bt.fullyVisible;if(!zr){var Yr=Bt.aabb.intersects(vt);if(Yr===0)continue;zr=Yr===2}var fn=Bt.aabb.distanceX(lt),sa=Bt.aabb.distanceY(lt),Wn=Math.max(Math.abs(fn),Math.abs(sa)),Hn=at+(1<Hn&&Bt.zoom>=Ke){Vt.push({tileID:new e.OverscaledTileID(Bt.zoom===Kt?nr:Bt.zoom,Bt.wrap,Bt.zoom,Xt,Ht),distanceSq:e.sqrLen([lt[0]-.5-Xt,lt[1]-.5-Ht])});continue}for(var la=0;la<4;la++){var va=(Xt<<1)+la%2,Pa=(Ht<<1)+(la>>1);Zt.push({aabb:Bt.aabb.quadrant(la),zoom:Bt.zoom+1,x:va,y:Pa,wrap:Bt.wrap,fullyVisible:zr})}}return Vt.sort(function(ca,Fa){return ca.distanceSq-Fa.distanceSq}).map(function(ca){return ca.tileID})},Ps.prototype.resize=function(q,he){this.width=q,this.height=he,this.pixelsToGLUnits=[2/q,-2/he],this._constrain(),this._calcMatrices()},Rs.unmodified.get=function(){return this._unmodified},Ps.prototype.zoomScale=function(q){return Math.pow(2,q)},Ps.prototype.scaleZoom=function(q){return Math.log(q)/Math.LN2},Ps.prototype.project=function(q){var he=e.clamp(q.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(q.lng)*this.worldSize,e.mercatorYfromLat(he)*this.worldSize)},Ps.prototype.unproject=function(q){return new e.MercatorCoordinate(q.x/this.worldSize,q.y/this.worldSize).toLngLat()},Rs.point.get=function(){return this.project(this.center)},Ps.prototype.setLocationAtPoint=function(q,he){var J=this.pointCoordinate(he),_e=this.pointCoordinate(this.centerPoint),qe=this.locationCoordinate(q),lt=new e.MercatorCoordinate(qe.x-(J.x-_e.x),qe.y-(J.y-_e.y));this.center=this.coordinateLocation(lt),this._renderWorldCopies&&(this.center=this.center.wrap())},Ps.prototype.locationPoint=function(q){return this.coordinatePoint(this.locationCoordinate(q))},Ps.prototype.pointLocation=function(q){return this.coordinateLocation(this.pointCoordinate(q))},Ps.prototype.locationCoordinate=function(q){return e.MercatorCoordinate.fromLngLat(q)},Ps.prototype.coordinateLocation=function(q){return q.toLngLat()},Ps.prototype.pointCoordinate=function(q){var he=0,J=[q.x,q.y,0,1],_e=[q.x,q.y,1,1];e.transformMat4(J,J,this.pixelMatrixInverse),e.transformMat4(_e,_e,this.pixelMatrixInverse);var qe=J[3],lt=_e[3],vt=J[0]/qe,Ke=_e[0]/lt,at=J[1]/qe,bt=_e[1]/lt,Zt=J[2]/qe,Vt=_e[2]/lt,Kt=Zt===Vt?0:(he-Zt)/(Vt-Zt);return new e.MercatorCoordinate(e.number(vt,Ke,Kt)/this.worldSize,e.number(at,bt,Kt)/this.worldSize)},Ps.prototype.coordinatePoint=function(q){var he=[q.x*this.worldSize,q.y*this.worldSize,0,1];return e.transformMat4(he,he,this.pixelMatrix),new e.Point(he[0]/he[3],he[1]/he[3])},Ps.prototype.getBounds=function(){return new e.LngLatBounds().extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},Ps.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},Ps.prototype.setMaxBounds=function(q){q?(this.lngRange=[q.getWest(),q.getEast()],this.latRange=[q.getSouth(),q.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Ps.prototype.calculatePosMatrix=function(q,he){he===void 0&&(he=!1);var J=q.key,_e=he?this._alignedPosMatrixCache:this._posMatrixCache;if(_e[J])return _e[J];var qe=q.canonical,lt=this.worldSize/this.zoomScale(qe.z),vt=qe.x+Math.pow(2,qe.z)*q.wrap,Ke=e.identity(new Float64Array(16));return e.translate(Ke,Ke,[vt*lt,qe.y*lt,0]),e.scale(Ke,Ke,[lt/e.EXTENT,lt/e.EXTENT,1]),e.multiply(Ke,he?this.alignedProjMatrix:this.projMatrix,Ke),_e[J]=new Float32Array(Ke),_e[J]},Ps.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Ps.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var q=-90,he=90,J=-180,_e=180,qe,lt,vt,Ke,at=this.size,bt=this._unmodified;if(this.latRange){var Zt=this.latRange;q=e.mercatorYfromLat(Zt[1])*this.worldSize,he=e.mercatorYfromLat(Zt[0])*this.worldSize,qe=he-qhe&&(Ke=he-Bt)}if(this.lngRange){var Xt=Kt.x,Ht=at.x/2;Xt-Ht_e&&(vt=_e-Ht)}(vt!==void 0||Ke!==void 0)&&(this.center=this.unproject(new e.Point(vt!==void 0?vt:Kt.x,Ke!==void 0?Ke:Kt.y))),this._unmodified=bt,this._constraining=!1}},Ps.prototype._calcMatrices=function(){if(this.height){var q=this._fov/2,he=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(q)*this.height;var J=Math.PI/2+this._pitch,_e=this._fov*(.5+he.y/this.height),qe=Math.sin(_e)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-J-_e,.01,Math.PI-.01)),lt=this.point,vt=lt.x,Ke=lt.y,at=Math.cos(Math.PI/2-this._pitch)*qe+this.cameraToCenterDistance,bt=at*1.01,Zt=this.height/50,Vt=new Float64Array(16);e.perspective(Vt,this._fov,this.width/this.height,Zt,bt),Vt[8]=-he.x*2/this.width,Vt[9]=he.y*2/this.height,e.scale(Vt,Vt,[1,-1,1]),e.translate(Vt,Vt,[0,0,-this.cameraToCenterDistance]),e.rotateX(Vt,Vt,this._pitch),e.rotateZ(Vt,Vt,this.angle),e.translate(Vt,Vt,[-vt,-Ke,0]),this.mercatorMatrix=e.scale([],Vt,[this.worldSize,this.worldSize,this.worldSize]),e.scale(Vt,Vt,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Vt,this.invProjMatrix=e.invert([],this.projMatrix);var Kt=this.width%2/2,nr=this.height%2/2,er=Math.cos(this.angle),Bt=Math.sin(this.angle),Xt=vt-Math.round(vt)+er*Kt+Bt*nr,Ht=Ke-Math.round(Ke)+er*nr+Bt*Kt,zr=new Float64Array(Vt);if(e.translate(zr,zr,[Xt>.5?Xt-1:Xt,Ht>.5?Ht-1:Ht,0]),this.alignedProjMatrix=zr,Vt=e.create(),e.scale(Vt,Vt,[this.width/2,-this.height/2,1]),e.translate(Vt,Vt,[1,-1,0]),this.labelPlaneMatrix=Vt,Vt=e.create(),e.scale(Vt,Vt,[1,-1,1]),e.translate(Vt,Vt,[-1,-1,0]),e.scale(Vt,Vt,[2/this.width,2/this.height,1]),this.glCoordMatrix=Vt,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),Vt=e.invert(new Float64Array(16),this.pixelMatrix),!Vt)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Vt,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Ps.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var q=this.pointCoordinate(new e.Point(0,0)),he=[q.x*this.worldSize,q.y*this.worldSize,0,1],J=e.transformMat4(he,he,this.pixelMatrix);return J[3]/this.cameraToCenterDistance},Ps.prototype.getCameraPoint=function(){var q=this._pitch,he=Math.tan(q)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,he))},Ps.prototype.getCameraQueryGeometry=function(q){var he=this.getCameraPoint();if(q.length===1)return[q[0],he];for(var J=he.x,_e=he.y,qe=he.x,lt=he.y,vt=0,Ke=q;vt=3&&!q.some(function(J){return isNaN(J)})){var he=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(q[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+q[2],+q[1]],zoom:+q[0],bearing:he,pitch:+(q[4]||0)}),!0}return!1},oc.prototype._updateHashUnthrottled=function(){var q=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,q)}catch{}};var Oc={linearity:.3,easing:e.bezier(0,0,.3,1)},ge=e.extend({deceleration:2500,maxSpeed:1400},Oc),Oe=e.extend({deceleration:20,maxSpeed:1400},Oc),tt=e.extend({deceleration:1e3,maxSpeed:360},Oc),xt=e.extend({deceleration:1e3,maxSpeed:90},Oc),St=function(q){this._map=q,this.clear()};St.prototype.clear=function(){this._inertiaBuffer=[]},St.prototype.record=function(q){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:q})},St.prototype._drainInertiaBuffer=function(){for(var q=this._inertiaBuffer,he=e.browser.now(),J=160;q.length>0&&he-q[0].time>J;)q.shift()},St.prototype._onMoveEnd=function(q){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var he={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},J=0,_e=this._inertiaBuffer;J<_e.length;J+=1){var qe=_e[J],lt=qe.settings;he.zoom+=lt.zoomDelta||0,he.bearing+=lt.bearingDelta||0,he.pitch+=lt.pitchDelta||0,lt.panDelta&&he.pan._add(lt.panDelta),lt.around&&(he.around=lt.around),lt.pinchAround&&(he.pinchAround=lt.pinchAround)}var vt=this._inertiaBuffer[this._inertiaBuffer.length-1],Ke=vt.time-this._inertiaBuffer[0].time,at={};if(he.pan.mag()){var bt=Qt(he.pan.mag(),Ke,e.extend({},ge,q||{}));at.offset=he.pan.mult(bt.amount/he.pan.mag()),at.center=this._map.transform.center,It(at,bt)}if(he.zoom){var Zt=Qt(he.zoom,Ke,Oe);at.zoom=this._map.transform.zoom+Zt.amount,It(at,Zt)}if(he.bearing){var Vt=Qt(he.bearing,Ke,tt);at.bearing=this._map.transform.bearing+e.clamp(Vt.amount,-179,179),It(at,Vt)}if(he.pitch){var Kt=Qt(he.pitch,Ke,xt);at.pitch=this._map.transform.pitch+Kt.amount,It(at,Kt)}if(at.zoom||at.bearing){var nr=he.pinchAround===void 0?he.around:he.pinchAround;at.around=nr?this._map.unproject(nr):this._map.getCenter()}return this.clear(),e.extend(at,{noMoveStart:!0})}};function It(be,q){(!be.duration||be.duration=this._clickTolerance||this._map.fire(new Jt(q.type,this._map,q))},Hr.prototype.dblclick=function(q){return this._firePreventable(new Jt(q.type,this._map,q))},Hr.prototype.mouseover=function(q){this._map.fire(new Jt(q.type,this._map,q))},Hr.prototype.mouseout=function(q){this._map.fire(new Jt(q.type,this._map,q))},Hr.prototype.touchstart=function(q){return this._firePreventable(new yr(q.type,this._map,q))},Hr.prototype.touchmove=function(q){this._map.fire(new yr(q.type,this._map,q))},Hr.prototype.touchend=function(q){this._map.fire(new yr(q.type,this._map,q))},Hr.prototype.touchcancel=function(q){this._map.fire(new yr(q.type,this._map,q))},Hr.prototype._firePreventable=function(q){if(this._map.fire(q),q.defaultPrevented)return{}},Hr.prototype.isEnabled=function(){return!0},Hr.prototype.isActive=function(){return!1},Hr.prototype.enable=function(){},Hr.prototype.disable=function(){};var hn=function(q){this._map=q};hn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},hn.prototype.mousemove=function(q){this._map.fire(new Jt(q.type,this._map,q))},hn.prototype.mousedown=function(){this._delayContextMenu=!0},hn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Jt("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},hn.prototype.contextmenu=function(q){this._delayContextMenu?this._contextMenuEvent=q:this._map.fire(new Jt(q.type,this._map,q)),this._map.listens("contextmenu")&&q.preventDefault()},hn.prototype.isEnabled=function(){return!0},hn.prototype.isActive=function(){return!1},hn.prototype.enable=function(){},hn.prototype.disable=function(){};var An=function(q,he){this._map=q,this._el=q.getCanvasContainer(),this._container=q.getContainer(),this._clickTolerance=he.clickTolerance||1};An.prototype.isEnabled=function(){return!!this._enabled},An.prototype.isActive=function(){return!!this._active},An.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},An.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},An.prototype.mousedown=function(q,he){this.isEnabled()&&q.shiftKey&&q.button===0&&(r.disableDrag(),this._startPos=this._lastPos=he,this._active=!0)},An.prototype.mousemoveWindow=function(q,he){if(this._active){var J=he;if(!(this._lastPos.equals(J)||!this._box&&J.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=q.timeStamp),J.length===this.numTouches&&(this.centroid=La(he),this.touches=kn(J,he)))},Aa.prototype.touchmove=function(q,he,J){if(!(this.aborted||!this.centroid)){var _e=kn(J,he);for(var qe in this.touches){var lt=this.touches[qe],vt=_e[qe];(!vt||vt.dist(lt)>oa)&&(this.aborted=!0)}}},Aa.prototype.touchend=function(q,he,J){if((!this.centroid||q.timeStamp-this.startTime>Qn)&&(this.aborted=!0),J.length===0){var _e=!this.aborted&&this.centroid;if(this.reset(),_e)return _e}};var Ra=function(q){this.singleTap=new Aa(q),this.numTaps=q.numTaps,this.reset()};Ra.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ra.prototype.touchstart=function(q,he,J){this.singleTap.touchstart(q,he,J)},Ra.prototype.touchmove=function(q,he,J){this.singleTap.touchmove(q,he,J)},Ra.prototype.touchend=function(q,he,J){var _e=this.singleTap.touchend(q,he,J);if(_e){var qe=q.timeStamp-this.lastTime0&&(this._active=!0);var _e=kn(J,he),qe=new e.Point(0,0),lt=new e.Point(0,0),vt=0;for(var Ke in _e){var at=_e[Ke],bt=this._touches[Ke];bt&&(qe._add(at),lt._add(at.sub(bt)),vt++,_e[Ke]=at)}if(this._touches=_e,!(vtMath.abs(be.x)}var El=100,Wl=(function(be){function q(){be.apply(this,arguments)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.reset=function(){be.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},q.prototype._start=function(J){this._lastPoints=J,bc(J[0].sub(J[1]))&&(this._valid=!1)},q.prototype._move=function(J,_e,qe){var lt=J[0].sub(this._lastPoints[0]),vt=J[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(lt,vt,qe.timeStamp),!!this._valid){this._lastPoints=J,this._active=!0;var Ke=(lt.y+vt.y)/2,at=-.5;return{pitchDelta:Ke*at}}},q.prototype.gestureBeginsVertically=function(J,_e,qe){if(this._valid!==void 0)return this._valid;var lt=2,vt=J.mag()>=lt,Ke=_e.mag()>=lt;if(!(!vt&&!Ke)){if(!vt||!Ke)return this._firstMove===void 0&&(this._firstMove=qe),qe-this._firstMove0==_e.y>0;return bc(J)&&bc(_e)&&at}},q})(nl),Yc={panStep:100,bearingStep:15,pitchStep:10},Eu=function(){var q=Yc;this._panStep=q.panStep,this._bearingStep=q.bearingStep,this._pitchStep=q.pitchStep,this._rotationDisabled=!1};Eu.prototype.reset=function(){this._active=!1},Eu.prototype.keydown=function(q){var he=this;if(!(q.altKey||q.ctrlKey||q.metaKey)){var J=0,_e=0,qe=0,lt=0,vt=0;switch(q.keyCode){case 61:case 107:case 171:case 187:J=1;break;case 189:case 109:case 173:J=-1;break;case 37:q.shiftKey?_e=-1:(q.preventDefault(),lt=-1);break;case 39:q.shiftKey?_e=1:(q.preventDefault(),lt=1);break;case 38:q.shiftKey?qe=1:(q.preventDefault(),vt=-1);break;case 40:q.shiftKey?qe=-1:(q.preventDefault(),vt=1);break;default:return}return this._rotationDisabled&&(_e=0,qe=0),{cameraAnimation:function(Ke){var at=Ke.getZoom();Ke.easeTo({duration:300,easeId:"keyboardHandler",easing:dt,zoom:J?Math.round(at)+J*(q.shiftKey?2:1):at,bearing:Ke.getBearing()+_e*he._bearingStep,pitch:Ke.getPitch()+qe*he._pitchStep,offset:[-lt*he._panStep,-vt*he._panStep],center:Ke.getCenter()},{originalEvent:q})}}}},Eu.prototype.enable=function(){this._enabled=!0},Eu.prototype.disable=function(){this._enabled=!1,this.reset()},Eu.prototype.isEnabled=function(){return this._enabled},Eu.prototype.isActive=function(){return this._active},Eu.prototype.disableRotation=function(){this._rotationDisabled=!0},Eu.prototype.enableRotation=function(){this._rotationDisabled=!1};function dt(be){return be*(2-be)}var gr=4.000244140625,wr=1/100,Cn=1/450,ua=2,gn=function(q,he){this._map=q,this._el=q.getCanvasContainer(),this._handler=he,this._delta=0,this._defaultZoomRate=wr,this._wheelZoomRate=Cn,e.bindAll(["_onTimeout"],this)};gn.prototype.setZoomRate=function(q){this._defaultZoomRate=q},gn.prototype.setWheelZoomRate=function(q){this._wheelZoomRate=q},gn.prototype.isEnabled=function(){return!!this._enabled},gn.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},gn.prototype.isZooming=function(){return!!this._zooming},gn.prototype.enable=function(q){this.isEnabled()||(this._enabled=!0,this._aroundCenter=q&&q.around==="center")},gn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},gn.prototype.wheel=function(q){if(this.isEnabled()){var he=q.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?q.deltaY*40:q.deltaY,J=e.browser.now(),_e=J-(this._lastWheelEventTime||0);this._lastWheelEventTime=J,he!==0&&he%gr===0?this._type="wheel":he!==0&&Math.abs(he)<4?this._type="trackpad":_e>400?(this._type=null,this._lastValue=he,this._timeout=setTimeout(this._onTimeout,40,q)):this._type||(this._type=Math.abs(_e*he)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,he+=this._lastValue)),q.shiftKey&&he&&(he=he/4),this._type&&(this._lastWheelEvent=q,this._delta-=he,this._active||this._start(q)),q.preventDefault()}},gn.prototype._onTimeout=function(q){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(q)},gn.prototype._start=function(q){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var he=r.mousePos(this._el,q);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(he)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},gn.prototype.renderFrame=function(){var q=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var he=this._map.transform;if(this._delta!==0){var J=this._type==="wheel"&&Math.abs(this._delta)>gr?this._wheelZoomRate:this._defaultZoomRate,_e=ua/(1+Math.exp(-Math.abs(this._delta*J)));this._delta<0&&_e!==0&&(_e=1/_e);var qe=typeof this._targetZoom=="number"?he.zoomScale(this._targetZoom):he.scale;this._targetZoom=Math.min(he.maxZoom,Math.max(he.minZoom,he.scaleZoom(qe*_e))),this._type==="wheel"&&(this._startZoom=he.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var lt=typeof this._targetZoom=="number"?this._targetZoom:he.zoom,vt=this._startZoom,Ke=this._easing,at=!1,bt;if(this._type==="wheel"&&vt&&Ke){var Zt=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),Vt=Ke(Zt);bt=e.number(vt,lt,Vt),Zt<1?this._frameId||(this._frameId=!0):at=!0}else bt=lt,at=!0;return this._active=!0,at&&(this._active=!1,this._finishTimeout=setTimeout(function(){q._zooming=!1,q._handler._triggerRenderFrame(),delete q._targetZoom,delete q._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!at,zoomDelta:bt-he.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},gn.prototype._smoothOutEasing=function(q){var he=e.ease;if(this._prevEase){var J=this._prevEase,_e=(e.browser.now()-J.start)/J.duration,qe=J.easing(_e+.01)-J.easing(_e),lt=.27/Math.sqrt(qe*qe+1e-4)*.01,vt=Math.sqrt(.27*.27-lt*lt);he=e.bezier(lt,vt,.25,1)}return this._prevEase={start:e.browser.now(),duration:q,easing:he},he},gn.prototype.reset=function(){this._active=!1};var pn=function(q,he){this._clickZoom=q,this._tapZoom=he};pn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},pn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},pn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},pn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var za=function(){this.reset()};za.prototype.reset=function(){this._active=!1},za.prototype.dblclick=function(q,he){return q.preventDefault(),{cameraAnimation:function(J){J.easeTo({duration:300,zoom:J.getZoom()+(q.shiftKey?-1:1),around:J.unproject(he)},{originalEvent:q})}}},za.prototype.enable=function(){this._enabled=!0},za.prototype.disable=function(){this._enabled=!1,this.reset()},za.prototype.isEnabled=function(){return this._enabled},za.prototype.isActive=function(){return this._active};var Ia=function(){this._tap=new Ra({numTouches:1,numTaps:1}),this.reset()};Ia.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Ia.prototype.touchstart=function(q,he,J){this._swipePoint||(this._tapTime&&q.timeStamp-this._tapTime>zn&&this.reset(),this._tapTime?J.length>0&&(this._swipePoint=he[0],this._swipeTouch=J[0].identifier):this._tap.touchstart(q,he,J))},Ia.prototype.touchmove=function(q,he,J){if(!this._tapTime)this._tap.touchmove(q,he,J);else if(this._swipePoint){if(J[0].identifier!==this._swipeTouch)return;var _e=he[0],qe=_e.y-this._swipePoint.y;return this._swipePoint=_e,q.preventDefault(),this._active=!0,{zoomDelta:qe/128}}},Ia.prototype.touchend=function(q,he,J){if(this._tapTime)this._swipePoint&&J.length===0&&this.reset();else{var _e=this._tap.touchend(q,he,J);_e&&(this._tapTime=q.timeStamp)}},Ia.prototype.touchcancel=function(){this.reset()},Ia.prototype.enable=function(){this._enabled=!0},Ia.prototype.disable=function(){this._enabled=!1,this.reset()},Ia.prototype.isEnabled=function(){return this._enabled},Ia.prototype.isActive=function(){return this._active};var Da=function(q,he,J){this._el=q,this._mousePan=he,this._touchPan=J};Da.prototype.enable=function(q){this._inertiaOptions=q||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Da.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Da.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Da.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Wa=function(q,he,J){this._pitchWithRotate=q.pitchWithRotate,this._mouseRotate=he,this._mousePitch=J};Wa.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Wa.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Wa.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Wa.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Bi=function(q,he,J,_e){this._el=q,this._touchZoom=he,this._touchRotate=J,this._tapDragZoom=_e,this._rotationDisabled=!1,this._enabled=!0};Bi.prototype.enable=function(q){this._touchZoom.enable(q),this._rotationDisabled||this._touchRotate.enable(q),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Bi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Bi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Bi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Bi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Bi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var bi=function(be){return be.zoom||be.drag||be.pitch||be.rotate},Ha=(function(be){function q(){be.apply(this,arguments)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q})(e.Event);function ga(be){return be.panDelta&&be.panDelta.mag()||be.zoomDelta||be.bearingDelta||be.pitchDelta}var rn=function(q,he){this._map=q,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new St(q),this._bearingSnap=he.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(he),e.bindAll(["handleEvent","handleWindowEvent"],this);var J=this._el;this._listeners=[[J,"touchstart",{passive:!0}],[J,"touchmove",{passive:!1}],[J,"touchend",void 0],[J,"touchcancel",void 0],[J,"mousedown",void 0],[J,"mousemove",void 0],[J,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[J,"mouseover",void 0],[J,"mouseout",void 0],[J,"dblclick",void 0],[J,"click",void 0],[J,"keydown",{capture:!1}],[J,"keyup",void 0],[J,"wheel",{passive:!1}],[J,"contextmenu",void 0],[e.window,"blur",void 0]];for(var _e=0,qe=this._listeners;_evt?Math.min(2,fn):Math.max(.5,fn),ca=Math.pow(Pa,1-la),Fa=lt.unproject(zr.add(Yr.mult(la*ca)).mult(va));lt.setLocationAtPoint(lt.renderWorldCopies?Fa.wrap():Fa,Bt)}qe._fireMoveEvents(_e)},function(la){qe._afterEase(_e,la)},J),this},q.prototype._prepareEase=function(J,_e,qe){qe===void 0&&(qe={}),this._moving=!0,!_e&&!qe.moving&&this.fire(new e.Event("movestart",J)),this._zooming&&!qe.zooming&&this.fire(new e.Event("zoomstart",J)),this._rotating&&!qe.rotating&&this.fire(new e.Event("rotatestart",J)),this._pitching&&!qe.pitching&&this.fire(new e.Event("pitchstart",J))},q.prototype._fireMoveEvents=function(J){this.fire(new e.Event("move",J)),this._zooming&&this.fire(new e.Event("zoom",J)),this._rotating&&this.fire(new e.Event("rotate",J)),this._pitching&&this.fire(new e.Event("pitch",J))},q.prototype._afterEase=function(J,_e){if(!(this._easeId&&_e&&this._easeId===_e)){delete this._easeId;var qe=this._zooming,lt=this._rotating,vt=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,qe&&this.fire(new e.Event("zoomend",J)),lt&&this.fire(new e.Event("rotateend",J)),vt&&this.fire(new e.Event("pitchend",J)),this.fire(new e.Event("moveend",J))}},q.prototype.flyTo=function(J,_e){var qe=this;if(!J.essential&&e.browser.prefersReducedMotion){var lt=e.pick(J,["center","zoom","bearing","pitch","around"]);return this.jumpTo(lt,_e)}this.stop(),J=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},J);var vt=this.transform,Ke=this.getZoom(),at=this.getBearing(),bt=this.getPitch(),Zt=this.getPadding(),Vt="zoom"in J?e.clamp(+J.zoom,vt.minZoom,vt.maxZoom):Ke,Kt="bearing"in J?this._normalizeBearing(J.bearing,at):at,nr="pitch"in J?+J.pitch:bt,er="padding"in J?J.padding:vt.padding,Bt=vt.zoomScale(Vt-Ke),Xt=e.Point.convert(J.offset),Ht=vt.centerPoint.add(Xt),zr=vt.pointLocation(Ht),Yr=e.LngLat.convert(J.center||zr);this._normalizeCenter(Yr);var fn=vt.project(zr),sa=vt.project(Yr).sub(fn),Wn=J.curve,Hn=Math.max(vt.width,vt.height),la=Hn/Bt,va=sa.mag();if("minZoom"in J){var Pa=e.clamp(Math.min(J.minZoom,Ke,Vt),vt.minZoom,vt.maxZoom),ca=Hn/vt.zoomScale(Pa-Ke);Wn=Math.sqrt(ca/va*2)}var Fa=Wn*Wn;function Ja(ol){var _u=(la*la-Hn*Hn+(ol?-1:1)*Fa*Fa*va*va)/(2*(ol?la:Hn)*Fa*va);return Math.log(Math.sqrt(_u*_u+1)-_u)}function Ei(ol){return(Math.exp(ol)-Math.exp(-ol))/2}function Hi(ol){return(Math.exp(ol)+Math.exp(-ol))/2}function ws(ol){return Ei(ol)/Hi(ol)}var gs=Ja(0),ml=function(ol){return Hi(gs)/Hi(gs+Wn*ol)},fl=function(ol){return Hn*((Hi(gs)*ws(gs+Wn*ol)-Ei(gs))/Fa)/va},_l=(Ja(1)-gs)/Wn;if(Math.abs(va)<1e-6||!isFinite(_l)){if(Math.abs(Hn-la)<1e-6)return this.easeTo(J,_e);var yl=laJ.maxDuration&&(J.duration=0),this._zooming=!0,this._rotating=at!==Kt,this._pitching=nr!==bt,this._padding=!vt.isPaddingEqual(er),this._prepareEase(_e,!1),this._ease(function(ol){var _u=ol*_l,Xf=1/ml(_u);vt.zoom=ol===1?Vt:Ke+vt.scaleZoom(Xf),qe._rotating&&(vt.bearing=e.number(at,Kt,ol)),qe._pitching&&(vt.pitch=e.number(bt,nr,ol)),qe._padding&&(vt.interpolatePadding(Zt,er,ol),Ht=vt.centerPoint.add(Xt));var Th=ol===1?Yr:vt.unproject(fn.add(sa.mult(fl(_u))).mult(Xf));vt.setLocationAtPoint(vt.renderWorldCopies?Th.wrap():Th,Ht),qe._fireMoveEvents(_e)},function(){return qe._afterEase(_e)},J),this},q.prototype.isEasing=function(){return!!this._easeFrameId},q.prototype.stop=function(){return this._stop()},q.prototype._stop=function(J,_e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var qe=this._onEaseEnd;delete this._onEaseEnd,qe.call(this,_e)}if(!J){var lt=this.handlers;lt&<.stop(!1)}return this},q.prototype._ease=function(J,_e,qe){qe.animate===!1||qe.duration===0?(J(1),_e()):(this._easeStart=e.browser.now(),this._easeOptions=qe,this._onEaseFrame=J,this._onEaseEnd=_e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},q.prototype._renderFrameCallback=function(){var J=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(J)),J<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},q.prototype._normalizeBearing=function(J,_e){J=e.wrap(J,-180,180);var qe=Math.abs(J-_e);return Math.abs(J-360-_e)180?-360:qe<-180?360:0}},q})(e.Evented),ea=function(q){q===void 0&&(q={}),this.options=q,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};ea.prototype.getDefaultPosition=function(){return"bottom-right"},ea.prototype.onAdd=function(q){var he=this.options&&this.options.compact;return this._map=q,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),he&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),he===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},ea.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},ea.prototype._setElementTitle=function(q,he){var J=this._map._getUIString("AttributionControl."+he);q.title=J,q.setAttribute("aria-label",J)},ea.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},ea.prototype._updateEditLink=function(){var q=this._editLink;q||(q=this._editLink=this._container.querySelector(".mapbox-improve-map"));var he=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(q){var J=he.reduce(function(_e,qe,lt){return qe.value&&(_e+=qe.key+"="+qe.value+(lt=0)return!1;return!0});var vt=q.join(" | ");vt!==this._attribHTML&&(this._attribHTML=vt,q.length?(this._innerContainer.innerHTML=vt,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},ea.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var ya=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};ya.prototype.onAdd=function(q){this._map=q,this._container=r.create("div","mapboxgl-ctrl");var he=r.create("a","mapboxgl-ctrl-logo");return he.target="_blank",he.rel="noopener nofollow",he.href="https://www.mapbox.com/",he.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),he.setAttribute("rel","noopener nofollow"),this._container.appendChild(he),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ya.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ya.prototype.getDefaultPosition=function(){return"bottom-left"},ya.prototype._updateLogo=function(q){(!q||q.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},ya.prototype._logoRequired=function(){if(this._map.style){var q=this._map.style.sourceCaches;for(var he in q){var J=q[he].getSource();if(J.mapbox_logo)return!0}return!1}},ya.prototype._updateCompact=function(){var q=this._container.children;if(q.length){var he=q[0];this._map.getCanvasContainer().offsetWidth<250?he.classList.add("mapboxgl-compact"):he.classList.remove("mapboxgl-compact")}};var na=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};na.prototype.add=function(q){var he=++this._id,J=this._queue;return J.push({callback:q,id:he,cancelled:!1}),he},na.prototype.remove=function(q){for(var he=this._currentlyRunning,J=he?this._queue.concat(he):this._queue,_e=0,qe=J;_eJ.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(J.minPitch!=null&&J.maxPitch!=null&&J.minPitch>J.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(J.minPitch!=null&&J.minPitch$a)throw new Error("maxPitch must be less than or equal to "+$a);var qe=new Ps(J.minZoom,J.maxZoom,J.minPitch,J.maxPitch,J.renderWorldCopies);if(be.call(this,qe,J),this._interactive=J.interactive,this._maxTileCacheSize=J.maxTileCacheSize,this._failIfMajorPerformanceCaveat=J.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=J.preserveDrawingBuffer,this._antialias=J.antialias,this._trackResize=J.trackResize,this._bearingSnap=J.bearingSnap,this._refreshExpiredTiles=J.refreshExpiredTiles,this._fadeDuration=J.fadeDuration,this._crossSourceCollisions=J.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=J.collectResourceTiming,this._renderTaskQueue=new na,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},di,J.locale),this._clickTolerance=J.clickTolerance,this._requestManager=new e.RequestManager(J.transformRequest,J.accessToken),typeof J.container=="string"){if(this._container=e.window.document.getElementById(J.container),!this._container)throw new Error("Container '"+J.container+"' not found.")}else if(J.container instanceof Di)this._container=J.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(J.maxBounds&&this.setMaxBounds(J.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return _e._update(!1)}),this.on("moveend",function(){return _e._update(!1)}),this.on("zoom",function(){return _e._update(!0)}),typeof e.window<"u"&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new rn(this,J);var lt=typeof J.hash=="string"&&J.hash||void 0;this._hash=J.hash&&new oc(lt).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:J.center,zoom:J.zoom,bearing:J.bearing,pitch:J.pitch}),J.bounds&&(this.resize(),this.fitBounds(J.bounds,e.extend({},J.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=J.localIdeographFontFamily,J.style&&this.setStyle(J.style,{localIdeographFontFamily:J.localIdeographFontFamily}),J.attributionControl&&this.addControl(new ea({customAttribution:J.customAttribution})),this.addControl(new ya,J.logoPosition),this.on("style.load",function(){_e.transform.unmodified&&_e.jumpTo(_e.style.stylesheet)}),this.on("data",function(vt){_e._update(vt.dataType==="style"),_e.fire(new e.Event(vt.dataType+"data",vt))}),this.on("dataloading",function(vt){_e.fire(new e.Event(vt.dataType+"dataloading",vt))})}be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q;var he={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return q.prototype._getMapId=function(){return this._mapId},q.prototype.addControl=function(_e,qe){if(qe===void 0&&(_e.getDefaultPosition?qe=_e.getDefaultPosition():qe="top-right"),!_e||!_e.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var lt=_e.onAdd(this);this._controls.push(_e);var vt=this._controlPositions[qe];return qe.indexOf("bottom")!==-1?vt.insertBefore(lt,vt.firstChild):vt.appendChild(lt),this},q.prototype.removeControl=function(_e){if(!_e||!_e.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var qe=this._controls.indexOf(_e);return qe>-1&&this._controls.splice(qe,1),_e.onRemove(this),this},q.prototype.hasControl=function(_e){return this._controls.indexOf(_e)>-1},q.prototype.resize=function(_e){var qe=this._containerDimensions(),lt=qe[0],vt=qe[1];this._resizeCanvas(lt,vt),this.transform.resize(lt,vt),this.painter.resize(lt,vt);var Ke=!this._moving;return Ke&&(this.stop(),this.fire(new e.Event("movestart",_e)).fire(new e.Event("move",_e))),this.fire(new e.Event("resize",_e)),Ke&&this.fire(new e.Event("moveend",_e)),this},q.prototype.getBounds=function(){return this.transform.getBounds()},q.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},q.prototype.setMaxBounds=function(_e){return this.transform.setMaxBounds(e.LngLatBounds.convert(_e)),this._update()},q.prototype.setMinZoom=function(_e){if(_e=_e??Zn,_e>=Zn&&_e<=this.transform.maxZoom)return this.transform.minZoom=_e,this._update(),this.getZoom()<_e&&this.setZoom(_e),this;throw new Error("minZoom must be between "+Zn+" and the current maxZoom, inclusive")},q.prototype.getMinZoom=function(){return this.transform.minZoom},q.prototype.setMaxZoom=function(_e){if(_e=_e??li,_e>=this.transform.minZoom)return this.transform.maxZoom=_e,this._update(),this.getZoom()>_e&&this.setZoom(_e),this;throw new Error("maxZoom must be greater than the current minZoom")},q.prototype.getMaxZoom=function(){return this.transform.maxZoom},q.prototype.setMinPitch=function(_e){if(_e=_e??Dn,_e=Dn&&_e<=this.transform.maxPitch)return this.transform.minPitch=_e,this._update(),this.getPitch()<_e&&this.setPitch(_e),this;throw new Error("minPitch must be between "+Dn+" and the current maxPitch, inclusive")},q.prototype.getMinPitch=function(){return this.transform.minPitch},q.prototype.setMaxPitch=function(_e){if(_e=_e??$a,_e>$a)throw new Error("maxPitch must be less than or equal to "+$a);if(_e>=this.transform.minPitch)return this.transform.maxPitch=_e,this._update(),this.getPitch()>_e&&this.setPitch(_e),this;throw new Error("maxPitch must be greater than the current minPitch")},q.prototype.getMaxPitch=function(){return this.transform.maxPitch},q.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},q.prototype.setRenderWorldCopies=function(_e){return this.transform.renderWorldCopies=_e,this._update()},q.prototype.project=function(_e){return this.transform.locationPoint(e.LngLat.convert(_e))},q.prototype.unproject=function(_e){return this.transform.pointLocation(e.Point.convert(_e))},q.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},q.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},q.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},q.prototype._createDelegatedListener=function(_e,qe,lt){var vt=this,Ke;if(_e==="mouseenter"||_e==="mouseover"){var at=!1,bt=function(Bt){var Xt=vt.getLayer(qe)?vt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Xt.length?at||(at=!0,lt.call(vt,new Jt(_e,vt,Bt.originalEvent,{features:Xt}))):at=!1},Zt=function(){at=!1};return{layer:qe,listener:lt,delegates:{mousemove:bt,mouseout:Zt}}}else if(_e==="mouseleave"||_e==="mouseout"){var Vt=!1,Kt=function(Bt){var Xt=vt.getLayer(qe)?vt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Xt.length?Vt=!0:Vt&&(Vt=!1,lt.call(vt,new Jt(_e,vt,Bt.originalEvent)))},nr=function(Bt){Vt&&(Vt=!1,lt.call(vt,new Jt(_e,vt,Bt.originalEvent)))};return{layer:qe,listener:lt,delegates:{mousemove:Kt,mouseout:nr}}}else{var er=function(Bt){var Xt=vt.getLayer(qe)?vt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Xt.length&&(Bt.features=Xt,lt.call(vt,Bt),delete Bt.features)};return{layer:qe,listener:lt,delegates:(Ke={},Ke[_e]=er,Ke)}}},q.prototype.on=function(_e,qe,lt){if(lt===void 0)return be.prototype.on.call(this,_e,qe);var vt=this._createDelegatedListener(_e,qe,lt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[_e]=this._delegatedListeners[_e]||[],this._delegatedListeners[_e].push(vt);for(var Ke in vt.delegates)this.on(Ke,vt.delegates[Ke]);return this},q.prototype.once=function(_e,qe,lt){if(lt===void 0)return be.prototype.once.call(this,_e,qe);var vt=this._createDelegatedListener(_e,qe,lt);for(var Ke in vt.delegates)this.once(Ke,vt.delegates[Ke]);return this},q.prototype.off=function(_e,qe,lt){var vt=this;if(lt===void 0)return be.prototype.off.call(this,_e,qe);var Ke=function(at){for(var bt=at[_e],Zt=0;Zt180;){var lt=he.locationPoint(be);if(lt.x>=0&<.y>=0&<.x<=he.width&<.y<=he.height)break;be.lng>he.center.lng?be.lng-=360:be.lng+=360}return be}var Ho={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function ts(be,q,he){var J=be.classList;for(var _e in Ho)J.remove("mapboxgl-"+he+"-anchor-"+_e);J.add("mapboxgl-"+he+"-anchor-"+q)}var cl=(function(be){function q(he,J){if(be.call(this),(he instanceof e.window.HTMLElement||J)&&(he=e.extend({element:he},J)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=he&&he.anchor||"center",this._color=he&&he.color||"#3FB1CE",this._scale=he&&he.scale||1,this._draggable=he&&he.draggable||!1,this._clickTolerance=he&&he.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=he&&he.rotation||0,this._rotationAlignment=he&&he.rotationAlignment||"auto",this._pitchAlignment=he&&he.pitchAlignment&&he.pitchAlignment!=="auto"?he.pitchAlignment:this._rotationAlignment,!he||!he.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var _e=r.createNS("http://www.w3.org/2000/svg","svg"),qe=41,lt=27;_e.setAttributeNS(null,"display","block"),_e.setAttributeNS(null,"height",qe+"px"),_e.setAttributeNS(null,"width",lt+"px"),_e.setAttributeNS(null,"viewBox","0 0 "+lt+" "+qe);var vt=r.createNS("http://www.w3.org/2000/svg","g");vt.setAttributeNS(null,"stroke","none"),vt.setAttributeNS(null,"stroke-width","1"),vt.setAttributeNS(null,"fill","none"),vt.setAttributeNS(null,"fill-rule","evenodd");var Ke=r.createNS("http://www.w3.org/2000/svg","g");Ke.setAttributeNS(null,"fill-rule","nonzero");var at=r.createNS("http://www.w3.org/2000/svg","g");at.setAttributeNS(null,"transform","translate(3.0, 29.0)"),at.setAttributeNS(null,"fill","#000000");for(var bt=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],Zt=0,Vt=bt;Zt=_e}this._isDragging&&(this._pos=J.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},q.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.Event("dragend")),this._state="inactive"},q.prototype._addDragHandler=function(J){this._element.contains(J.originalEvent.target)&&(J.preventDefault(),this._positionDelta=J.point.sub(this._pos).add(this._offset),this._pointerdownPos=J.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},q.prototype.setDraggable=function(J){return this._draggable=!!J,this._map&&(J?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},q.prototype.isDraggable=function(){return this._draggable},q.prototype.setRotation=function(J){return this._rotation=J||0,this._update(),this},q.prototype.getRotation=function(){return this._rotation},q.prototype.setRotationAlignment=function(J){return this._rotationAlignment=J||"auto",this._update(),this},q.prototype.getRotationAlignment=function(){return this._rotationAlignment},q.prototype.setPitchAlignment=function(J){return this._pitchAlignment=J&&J!=="auto"?J:this._rotationAlignment,this._update(),this},q.prototype.getPitchAlignment=function(){return this._pitchAlignment},q})(e.Evented),rs={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Tu;function tl(be){Tu!==void 0?be(Tu):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(q){Tu=q.state!=="denied",be(Tu)}):(Tu=!!e.window.navigator.geolocation,be(Tu))}var du=0,Du=!1,Wu=(function(be){function q(he){be.call(this),this.options=e.extend({},rs,he),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.onAdd=function(J){return this._map=J,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),tl(this._setupUI),this._container},q.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,du=0,Du=!1},q.prototype._isOutOfMapMaxBounds=function(J){var _e=this._map.getMaxBounds(),qe=J.coords;return _e&&(qe.longitude<_e.getWest()||qe.longitude>_e.getEast()||qe.latitude<_e.getSouth()||qe.latitude>_e.getNorth())},q.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},q.prototype._onSuccess=function(J){if(this._map){if(this._isOutOfMapMaxBounds(J)){this._setErrorState(),this.fire(new e.Event("outofmaxbounds",J)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=J,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(J),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(J),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",J)),this._finish()}},q.prototype._updateCamera=function(J){var _e=new e.LngLat(J.coords.longitude,J.coords.latitude),qe=J.coords.accuracy,lt=this._map.getBearing(),vt=e.extend({bearing:lt},this.options.fitBoundsOptions);this._map.fitBounds(_e.toBounds(qe),vt,{geolocateSource:!0})},q.prototype._updateMarker=function(J){if(J){var _e=new e.LngLat(J.coords.longitude,J.coords.latitude);this._accuracyCircleMarker.setLngLat(_e).addTo(this._map),this._userLocationDotMarker.setLngLat(_e).addTo(this._map),this._accuracy=J.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},q.prototype._updateCircleRadius=function(){var J=this._map._container.clientHeight/2,_e=this._map.unproject([0,J]),qe=this._map.unproject([1,J]),lt=_e.distanceTo(qe),vt=Math.ceil(2*this._accuracy/lt);this._circleElement.style.width=vt+"px",this._circleElement.style.height=vt+"px"},q.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},q.prototype._onError=function(J){if(this._map){if(this.options.trackUserLocation)if(J.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var _e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=_e,this._geolocateButton.setAttribute("aria-label",_e),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(J.code===3&&Du)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",J)),this._finish()}},q.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},q.prototype._setupUI=function(J){var _e=this;if(this._container.addEventListener("contextmenu",function(vt){return vt.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",J===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var qe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=qe,this._geolocateButton.setAttribute("aria-label",qe)}else{var lt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=lt,this._geolocateButton.setAttribute("aria-label",lt)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new cl(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new cl({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(vt){var Ke=vt.originalEvent&&vt.originalEvent.type==="resize";!vt.geolocateSource&&_e._watchState==="ACTIVE_LOCK"&&!Ke&&(_e._watchState="BACKGROUND",_e._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),_e._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),_e.fire(new e.Event("trackuserlocationend")))})},q.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":du--,Du=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),du++;var J;du>1?(J={maximumAge:6e5,timeout:0},Du=!0):(J=this.options.positionOptions,Du=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,J)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},q.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},q})(e.Evented),pf={maxWidth:100,unit:"metric"},Ql=function(q){this.options=e.extend({},pf,q),e.bindAll(["_onMove","setUnit"],this)};Ql.prototype.getDefaultPosition=function(){return"bottom-left"},Ql.prototype._onMove=function(){cu(this._map,this._container,this.options)},Ql.prototype.onAdd=function(q){return this._map=q,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",q.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ql.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ql.prototype.setUnit=function(q){this.options.unit=q,cu(this._map,this._container,this.options)};function cu(be,q,he){var J=he&&he.maxWidth||100,_e=be._container.clientHeight/2,qe=be.unproject([0,_e]),lt=be.unproject([J,_e]),vt=qe.distanceTo(lt);if(he&&he.unit==="imperial"){var Ke=3.2808*vt;if(Ke>5280){var at=Ke/5280;vo(q,J,at,be._getUIString("ScaleControl.Miles"))}else vo(q,J,Ke,be._getUIString("ScaleControl.Feet"))}else if(he&&he.unit==="nautical"){var bt=vt/1852;vo(q,J,bt,be._getUIString("ScaleControl.NauticalMiles"))}else vt>=1e3?vo(q,J,vt/1e3,be._getUIString("ScaleControl.Kilometers")):vo(q,J,vt,be._getUIString("ScaleControl.Meters"))}function vo(be,q,he,J){var _e=Vs(he),qe=_e/he;be.style.width=q*qe+"px",be.innerHTML=_e+" "+J}function Ku(be){var q=Math.pow(10,Math.ceil(-Math.log(be)/Math.LN10));return Math.round(be*q)/q}function Vs(be){var q=Math.pow(10,(""+Math.floor(be)).length-1),he=be/q;return he=he>=10?10:he>=5?5:he>=3?3:he>=2?2:he>=1?1:Ku(he),q*he}var Fl=function(q){this._fullscreen=!1,q&&q.container&&(q.container instanceof e.window.HTMLElement?this._container=q.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};Fl.prototype.onAdd=function(q){return this._map=q,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Fl.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Fl.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Fl.prototype._setupUI=function(){var q=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",q).setAttribute("aria-hidden",!0),q.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Fl.prototype._updateTitle=function(){var q=this._getTitle();this._fullscreenButton.setAttribute("aria-label",q),this._fullscreenButton.title=q},Fl.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Fl.prototype._isFullscreen=function(){return this._fullscreen},Fl.prototype._changeIcon=function(){var q=e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement;q===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Fl.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var uc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},cc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Co=(function(be){function q(he){be.call(this),this.options=e.extend(Object.create(uc),he),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.addTo=function(J){return this._map&&this.remove(),this._map=J,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},q.prototype.isOpen=function(){return!!this._map},q.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},q.prototype.getLngLat=function(){return this._lngLat},q.prototype.setLngLat=function(J){return this._lngLat=e.LngLat.convert(J),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},q.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},q.prototype.getElement=function(){return this._container},q.prototype.setText=function(J){return this.setDOMContent(e.window.document.createTextNode(J))},q.prototype.setHTML=function(J){var _e=e.window.document.createDocumentFragment(),qe=e.window.document.createElement("body"),lt;for(qe.innerHTML=J;lt=qe.firstChild,!!lt;)_e.appendChild(lt);return this.setDOMContent(_e)},q.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},q.prototype.setMaxWidth=function(J){return this.options.maxWidth=J,this._update(),this},q.prototype.setDOMContent=function(J){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(J),this._createCloseButton(),this._update(),this._focusFirstElement(),this},q.prototype.addClassName=function(J){this._container&&this._container.classList.add(J)},q.prototype.removeClassName=function(J){this._container&&this._container.classList.remove(J)},q.prototype.setOffset=function(J){return this.options.offset=J,this._update(),this},q.prototype.toggleClassName=function(J){if(this._container)return this._container.classList.toggle(J)},q.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},q.prototype._onMouseUp=function(J){this._update(J.point)},q.prototype._onMouseMove=function(J){this._update(J.point)},q.prototype._onDrag=function(J){this._update(J.point)},q.prototype._update=function(J){var _e=this,qe=this._lngLat||this._trackPointer;if(!(!this._map||!qe||!this._content)&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(Kt){return _e._container.classList.add(Kt)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Mo(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!J))){var lt=this._pos=this._trackPointer&&J?J:this._map.project(this._lngLat),vt=this.options.anchor,Ke=ms(this.options.offset);if(!vt){var at=this._container.offsetWidth,bt=this._container.offsetHeight,Zt;lt.y+Ke.bottom.ythis._map.transform.height-bt?Zt=["bottom"]:Zt=[],lt.xthis._map.transform.width-at/2&&Zt.push("right"),Zt.length===0?vt="bottom":vt=Zt.join("-")}var Vt=lt.add(Ke[vt]).round();r.setTransform(this._container,Ho[vt]+" translate("+Vt.x+"px,"+Vt.y+"px)"),ts(this._container,vt,"popup")}},q.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var J=this._container.querySelector(cc);J&&J.focus()}},q.prototype._onClose=function(){this.remove()},q})(e.Evented);function ms(be){if(be)if(typeof be=="number"){var q=Math.round(Math.sqrt(.5*Math.pow(be,2)));return{center:new e.Point(0,0),top:new e.Point(0,be),"top-left":new e.Point(q,q),"top-right":new e.Point(-q,q),bottom:new e.Point(0,-be),"bottom-left":new e.Point(q,-q),"bottom-right":new e.Point(-q,-q),left:new e.Point(be,0),right:new e.Point(-be,0)}}else if(be instanceof e.Point||Array.isArray(be)){var he=e.Point.convert(be);return{center:he,top:he,"top-left":he,"top-right":he,bottom:he,"bottom-left":he,"bottom-right":he,left:he,right:he}}else return{center:e.Point.convert(be.center||[0,0]),top:e.Point.convert(be.top||[0,0]),"top-left":e.Point.convert(be["top-left"]||[0,0]),"top-right":e.Point.convert(be["top-right"]||[0,0]),bottom:e.Point.convert(be.bottom||[0,0]),"bottom-left":e.Point.convert(be["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(be["bottom-right"]||[0,0]),left:e.Point.convert(be.left||[0,0]),right:e.Point.convert(be.right||[0,0])};else return ms(new e.Point(0,0))}var bs={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:Oi,NavigationControl:ji,GeolocateControl:Wu,AttributionControl:ea,ScaleControl:Ql,FullscreenControl:Fl,Popup:Co,Marker:cl,Style:Hu,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Ci,clearPrewarmedResources:Dt,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(be){e.config.ACCESS_TOKEN=be},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(be){e.config.API_URL=be},get workerCount(){return _a.workerCount},set workerCount(be){_a.workerCount=be},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(be){e.config.MAX_PARALLEL_IMAGE_REQUESTS=be},clearStorage:function(q){e.clearTileCache(q)},workerUrl:""};return bs}),S})}}),DD=Ge({"src/plots/mapbox/layers.js"($,G){var h=yn(),b=ec().sanitizeHTML,S=jC(),E=Gy();function e(i,a){this.subplot=i,this.uid=i.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(a){this.visible?this.needsNewImage(a)?this.updateImage(a):this.needsNewSource(a)?(this.removeLayer(),this.updateSource(a),this.updateLayer(a)):this.needsNewLayer(a)?this.updateLayer(a):this.updateStyle(a):(this.updateSource(a),this.updateLayer(a)),this.visible=r(a)},t.needsNewImage=function(i){var a=this.subplot.map;return a.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var a=this.subplot.map;a.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var a=this.subplot.map;if(a.getSource(this.idSource)&&a.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=n(i);a.addSource(this.idSource,s)}},t.findFollowingMapboxLayerId=function(i){if(i==="traces")for(var a=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var a={},s={};switch(i.type){case"circle":h.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":h.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":h.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var f=i.symbol,c=S(f.textposition,f.iconsize);h.extendFlat(a,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":f.placement}),h.extendFlat(s,{"icon-color":i.color,"text-color":f.textfont.color,"text-opacity":i.opacity});break;case"raster":h.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:a,paint:s}}function n(i){var a=i.sourcetype,s=i.source,f={type:a},c;return a==="geojson"?c="data":a==="vector"?c=typeof s=="string"?"url":"tiles":a==="raster"?(c="tiles",f.tileSize=256):a==="image"&&(c="url",f.coordinates=i.coordinates),f[c]=s,i.sourceattribution&&(f.attribution=b(i.sourceattribution)),f}G.exports=function(a,s,f){var c=new e(a,s);return c.update(f),c}}}),zD=Ge({"src/plots/mapbox/mapbox.js"($,G){var h=qC(),b=yn(),S=I_(),E=Io(),e=Ss(),t=nd(),r=qf(),o=Dp(),n=o.drawMode,i=o.selectMode,a=Zf().prepSelect,s=Zf().clearOutline,f=Zf().clearSelectionsCache,c=Zf().selectOnClick,p=Gy(),d=DD();function T(_,w){this.id=w,this.gd=_;var m=_._fullLayout,u=_._context;this.container=m._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=m._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(m),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(_,w,m){var u=this,v=w[u.id];u.map&&v.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var y;u.map?y=new Promise(function(I,L){u.updateMap(_,w,I,L)}):y=new Promise(function(I,L){u.createMap(_,w,I,L)}),m.push(y)},l.createMap=function(_,w,m,u){var v=this,y=w[v.id],I=v.styleObj=x(y.style,w);v.accessToken=y.accesstoken;var L=y.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=v.map=new h.Map({container:v.div,style:I.style,center:M(y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch,maxBounds:z,interactive:!v.isStatic,preserveDrawingBuffer:v.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new h.AttributionControl({compact:!0}));F._canvas.style.left="0px",F._canvas.style.top="0px",v.rejectOnError(u),v.isStatic||v.initFx(_,w);var N=[];N.push(new Promise(function(B){F.once("load",B)})),N=N.concat(S.fetchTraceGeoData(_)),Promise.all(N).then(function(){v.fillBelowLookup(_,w),v.updateData(_),v.updateLayout(w),v.resolveOnRender(m)}).catch(u)},l.updateMap=function(_,w,m,u){var v=this,y=v.map,I=w[this.id];v.rejectOnError(u);var L=[],z=x(I.style,w);JSON.stringify(v.styleObj)!==JSON.stringify(z)&&(v.styleObj=z,y.setStyle(z.style),v.traceHash={},L.push(new Promise(function(F){y.once("styledata",F)}))),L=L.concat(S.fetchTraceGeoData(_)),Promise.all(L).then(function(){v.fillBelowLookup(_,w),v.updateData(_),v.updateLayout(w),v.resolveOnRender(m)}).catch(u)},l.fillBelowLookup=function(_,w){var m=w[this.id],u=m.layers,v,y,I=this.belowLookup={},L=!1;for(v=0;v<_.length;v++){var z=_[v][0].trace,F=z._module;typeof z.below=="string"?y=z.below:F.getBelow&&(y=F.getBelow(z,this)),y===""&&(L=!0),I["trace-"+z.uid]=y||""}for(v=0;v1)for(v=0;v-1&&c(z.originalEvent,u,[m.xaxis],[m.yaxis],m.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,m=w.map,u=w.gd;if(w.isStatic)return;function v(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var y=_.dragmode,I;I=function(z,F){if(F.isRect){var N=z.range={};N[w.id]=[v([F.xmin,F.ymin]),v([F.xmax,F.ymax])]}else{var B=z.lassoPoints={};B[w.id]=F.map(v)}};var L=w.dragOptions;w.dragOptions=b.extendDeep(L||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:I},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),m.off("click",w.onClickInPanHandler),i(y)||n(y)?(m.dragPan.disable(),m.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,N){a(z,F,N,w.dragOptions,y)},t.init(w.dragOptions)):(m.dragPan.enable(),m.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),m.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,m=_._size,u=this.div.style;u.width=m.w*(w.x[1]-w.x[0])+"px",u.height=m.h*(w.y[1]-w.y[0])+"px",u.left=m.l+w.x[0]*m.w+"px",u.top=m.t+(1-w.y[1])*m.h+"px",this.xaxis._offset=m.l+w.x[0]*m.w,this.xaxis._length=m.w*(w.x[1]-w.x[0]),this.yaxis._offset=m.t+(1-w.y[1])*m.h,this.yaxis._length=m.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],m=w.layers,u=this.layerList,v;if(m.length!==u.length){for(v=0;vN/2){var B=I.split("|").join("
");z.text(B).attr("data-unformatted",B).call(o.convertToTspans,d),F=r.bBox(z.node())}z.attr("transform",b(-3,-F.height+8)),L.insert("rect",".static-attribution").attr({x:-F.width-6,y:-F.height-3,width:F.width+6,height:F.height+3,fill:"rgba(255, 255, 255, 0.75)"});var R=1;F.width+6>N&&(R=N/(F.width+6));var U=[g.l+g.w*M.x[1],g.t+g.h*(1-M.y[0])];L.attr("transform",b(U[0],U[1])+S(R))}};function c(d,T){var l=d._fullLayout,g=d._context;if(g.mapboxAccessToken==="")return"";for(var x=[],A=[],M=!1,_=!1,w=0;w1&&h.warn(a.multipleTokensErrorMsg),x[0]):(A.length&&h.log(["Listed mapbox access token(s)",A.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function p(d){return typeof d=="string"&&(a.styleValuesMapbox.indexOf(d)!==-1||d.indexOf("mapbox://")===0||d.indexOf("stamen")===0)}$.updateFx=function(d){for(var T=d._fullLayout,l=T._subplots[i],g=0;g=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var n=o[0].trace,i=new E(r,n.uid),a=i.sourceId,s=h(o),f=i.below=r.belowLookup["trace-"+n.uid];return r.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,f),o[0].trace._glTrace=i,i}}}),jD=Ge({"src/traces/choroplethmapbox/index.js"($,G){G.exports={attributes:VC(),supplyDefaults:ND(),colorbar:xm(),calc:dE(),plot:UD(),hoverPoints:mE(),eventData:gE(),selectPoints:yE(),styleOnSelect:function(h,b){if(b){var S=b[0].trace;S._glTrace.updateOnSelect(b)}},getBelow:function(h,b){for(var S=b.getMapLayers(),E=S.length-2;E>=0;E--){var e=S[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+d[c]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:A})}}var _=E.extractOpts(n),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,m=w[0][1],u=S.opacity(m)<1?m:S.addOpacity(m,0),v=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,n=new S(t,o.uid),i=n.sourceId,a=h(r),s=n.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:a.geojson}),n._addLayers(a,s),n}}}),YD=Ge({"src/traces/densitymapbox/hover.js"($,G){var h=Ss(),b=PE().hoverPoints,S=PE().getExtraText;G.exports=function(e,t,r){var o=b(e,t,r);if(o){var n=o[0],i=n.cd,a=i[0].trace,s=i[n.index];if(delete n.color,"z"in s){var f=n.subplot.mockAxis;n.z=s.z,n.zLabel=h.tickText(f,f.c2l(s.z),"hover").text}return n.extraText=S(a,s,i[0].t.labels),[n]}}}}),ZD=Ge({"src/traces/densitymapbox/event_data.js"($,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b.z=S.z,b}}}),WD=Ge({"src/traces/densitymapbox/index.js"($,G){G.exports={attributes:GC(),supplyDefaults:VD(),colorbar:xm(),formatLabels:UC(),calc:HD(),plot:XD(),hoverPoints:YD(),eventData:ZD(),getBelow:function(h,b){for(var S=b.getMapLayers(),E=0;EESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} +`}),{fragmentSource:be,vertexSource:q,staticAttributes:J,staticUniforms:ft}}var hh=Object.freeze({__proto__:null,prelude:wu,background:Oc,backgroundPattern:Uf,circle:tu,clippingMask:kf,heatmap:gc,heatmapTexture:Fc,collisionBox:hu,collisionCircle:rh,debug:pf,fill:jf,fillOutline:Ah,fillOutlinePattern:Ed,fillPattern:tv,fillExtrusion:nh,fillExtrusionPattern:Sh,hillshadePrepare:Yc,hillshade:Mh,line:lc,lineGradient:ah,linePattern:Wh,lineSDF:ih,raster:iu,symbolIcon:Bc,symbolSDF:sf,symbolTextAndIcon:Uh}),qf=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};qf.prototype.bind=function(q,he,J,_e,qe,ft,pt,$e){this.context=q;for(var it=this.boundPaintVertexBuffers.length!==_e.length,Tt=0;!it&&Tt<_e.length;Tt++)this.boundPaintVertexBuffers[Tt]!==_e[Tt]&&(it=!0);var $t=!this.vao||this.boundProgram!==he||this.boundLayoutVertexBuffer!==J||it||this.boundIndexBuffer!==qe||this.boundVertexOffset!==ft||this.boundDynamicVertexBuffer!==pt||this.boundDynamicVertexBuffer2!==$e;!q.extVertexArrayObject||$t?this.freshBind(he,J,_e,qe,ft,pt,$e):(q.bindVertexArrayOES.set(this.vao),pt&&pt.bind(),qe&&qe.dynamicDraw&&qe.bind(),$e&&$e.bind())},qf.prototype.freshBind=function(q,he,J,_e,qe,ft,pt){var $e,it=q.numAttributes,Tt=this.context,$t=Tt.gl;if(Tt.extVertexArrayObject)this.vao&&this.destroy(),this.vao=Tt.extVertexArrayObject.createVertexArrayOES(),Tt.bindVertexArrayOES.set(this.vao),$e=0,this.boundProgram=q,this.boundLayoutVertexBuffer=he,this.boundPaintVertexBuffers=J,this.boundIndexBuffer=_e,this.boundVertexOffset=qe,this.boundDynamicVertexBuffer=ft,this.boundDynamicVertexBuffer2=pt;else{$e=Tt.currentNumAttributes||0;for(var Ht=it;Ht<$e;Ht++)$t.disableVertexAttribArray(Ht)}he.enableAttributes($t,q);for(var Jt=0,ir=J;Jt>16,pt>>16],u_pixel_coord_lower:[ft&65535,pt&65535]}}function vh(be,q,he,J){var _e=he.imageManager.getPattern(be.from.toString()),qe=he.imageManager.getPattern(be.to.toString()),ft=he.imageManager.getPixelSize(),pt=ft.width,$e=ft.height,it=Math.pow(2,J.tileID.overscaledZ),Tt=J.tileSize*Math.pow(2,he.transform.tileZoom)/it,$t=Tt*(J.tileID.canonical.x+J.tileID.wrap*it),Ht=Tt*J.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:_e.tl,u_pattern_br_a:_e.br,u_pattern_tl_b:qe.tl,u_pattern_br_b:qe.br,u_texsize:[pt,$e],u_mix:q.t,u_pattern_size_a:_e.displaySize,u_pattern_size_b:qe.displaySize,u_scale_a:q.fromScale,u_scale_b:q.toScale,u_tile_units_to_pixels:1/Vs(J,1,he.transform.tileZoom),u_pixel_coord_upper:[$t>>16,Ht>>16],u_pixel_coord_lower:[$t&65535,Ht&65535]}}var kd=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_lightpos:new e.Uniform3f(be,q.u_lightpos),u_lightintensity:new e.Uniform1f(be,q.u_lightintensity),u_lightcolor:new e.Uniform3f(be,q.u_lightcolor),u_vertical_gradient:new e.Uniform1f(be,q.u_vertical_gradient),u_opacity:new e.Uniform1f(be,q.u_opacity)}},hc=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_lightpos:new e.Uniform3f(be,q.u_lightpos),u_lightintensity:new e.Uniform1f(be,q.u_lightintensity),u_lightcolor:new e.Uniform3f(be,q.u_lightcolor),u_vertical_gradient:new e.Uniform1f(be,q.u_vertical_gradient),u_height_factor:new e.Uniform1f(be,q.u_height_factor),u_image:new e.Uniform1i(be,q.u_image),u_texsize:new e.Uniform2f(be,q.u_texsize),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade),u_opacity:new e.Uniform1f(be,q.u_opacity)}},$h=function(be,q,he,J){var _e=q.style.light,qe=_e.properties.get("position"),ft=[qe.x,qe.y,qe.z],pt=e.create$1();_e.properties.get("anchor")==="viewport"&&e.fromRotation(pt,-q.transform.angle),e.transformMat3(ft,ft,pt);var $e=_e.properties.get("color");return{u_matrix:be,u_lightpos:ft,u_lightintensity:_e.properties.get("intensity"),u_lightcolor:[$e.r,$e.g,$e.b],u_vertical_gradient:+he,u_opacity:J}},Wc=function(be,q,he,J,_e,qe,ft){return e.extend($h(be,q,he,J),mf(qe,q,ft),{u_height_factor:-Math.pow(2,_e.overscaledZ)/ft.tileSize/8})},Cf=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},gf=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_image:new e.Uniform1i(be,q.u_image),u_texsize:new e.Uniform2f(be,q.u_texsize),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade)}},Su=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_world:new e.Uniform2f(be,q.u_world)}},Tc=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_world:new e.Uniform2f(be,q.u_world),u_image:new e.Uniform1i(be,q.u_image),u_texsize:new e.Uniform2f(be,q.u_texsize),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade)}},pu=function(be){return{u_matrix:be}},Vf=function(be,q,he,J){return e.extend(pu(be),mf(he,q,J))},yf=function(be,q){return{u_matrix:be,u_world:q}},jh=function(be,q,he,J,_e){return e.extend(Vf(be,q,he,J),{u_world:_e})},cr=function(be,q){return{u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(be,q.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(be,q.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},Rr=function(be,q,he,J){var _e=be.transform,qe,ft;if(J.paint.get("circle-pitch-alignment")==="map"){var pt=Vs(he,1,_e.zoom);qe=!0,ft=[pt,pt]}else qe=!1,ft=_e.pixelsToGLUnits;return{u_camera_to_center_distance:_e.cameraToCenterDistance,u_scale_with_map:+(J.paint.get("circle-pitch-scale")==="map"),u_matrix:be.translatePosMatrix(q.posMatrix,he,J.paint.get("circle-translate"),J.paint.get("circle-translate-anchor")),u_pitch_with_map:+qe,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:ft}},pn=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(be,q.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(be,q.u_extrude_scale),u_overscale_factor:new e.Uniform1f(be,q.u_overscale_factor)}},an=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_inv_matrix:new e.UniformMatrix4f(be,q.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(be,q.u_viewport_size)}},On=function(be,q,he){var J=Vs(he,1,q.zoom),_e=Math.pow(2,q.zoom-he.tileID.overscaledZ),qe=he.tileID.overscaleFactor();return{u_matrix:be,u_camera_to_center_distance:q.cameraToCenterDistance,u_pixels_to_tile_units:J,u_extrude_scale:[q.pixelsToGLUnits[0]/(J*_e),q.pixelsToGLUnits[1]/(J*_e)],u_overscale_factor:qe}},Aa=function(be,q,he){return{u_matrix:be,u_inv_matrix:q,u_camera_to_center_distance:he.cameraToCenterDistance,u_viewport_size:[he.width,he.height]}},xa=function(be,q){return{u_color:new e.UniformColor(be,q.u_color),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_overlay:new e.Uniform1i(be,q.u_overlay),u_overlay_scale:new e.Uniform1f(be,q.u_overlay_scale)}},ti=function(be,q,he){return he===void 0&&(he=1),{u_matrix:be,u_color:q,u_overlay:0,u_overlay_scale:he}},li=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},Ni=function(be){return{u_matrix:be}},Ha=function(be,q){return{u_extrude_scale:new e.Uniform1f(be,q.u_extrude_scale),u_intensity:new e.Uniform1f(be,q.u_intensity),u_matrix:new e.UniformMatrix4f(be,q.u_matrix)}},bi=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_world:new e.Uniform2f(be,q.u_world),u_image:new e.Uniform1i(be,q.u_image),u_color_ramp:new e.Uniform1i(be,q.u_color_ramp),u_opacity:new e.Uniform1f(be,q.u_opacity)}},Qa=function(be,q,he,J){return{u_matrix:be,u_extrude_scale:Vs(q,1,he),u_intensity:J}},Na=function(be,q,he,J){var _e=e.create();e.ortho(_e,0,be.width,be.height,0,0,1);var qe=be.context.gl;return{u_matrix:_e,u_world:[qe.drawingBufferWidth,qe.drawingBufferHeight],u_image:he,u_color_ramp:J,u_opacity:q.paint.get("heatmap-opacity")}},Yi=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_image:new e.Uniform1i(be,q.u_image),u_latrange:new e.Uniform2f(be,q.u_latrange),u_light:new e.Uniform2f(be,q.u_light),u_shadow:new e.UniformColor(be,q.u_shadow),u_highlight:new e.UniformColor(be,q.u_highlight),u_accent:new e.UniformColor(be,q.u_accent)}},No=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_image:new e.Uniform1i(be,q.u_image),u_dimension:new e.Uniform2f(be,q.u_dimension),u_zoom:new e.Uniform1f(be,q.u_zoom),u_unpack:new e.Uniform4f(be,q.u_unpack)}},Do=function(be,q,he){var J=he.paint.get("hillshade-shadow-color"),_e=he.paint.get("hillshade-highlight-color"),qe=he.paint.get("hillshade-accent-color"),ft=he.paint.get("hillshade-illumination-direction")*(Math.PI/180);he.paint.get("hillshade-illumination-anchor")==="viewport"&&(ft-=be.transform.angle);var pt=!be.options.moving;return{u_matrix:be.transform.calculatePosMatrix(q.tileID.toUnwrapped(),pt),u_image:0,u_latrange:jo(be,q.tileID),u_light:[he.paint.get("hillshade-exaggeration"),ft],u_shadow:J,u_highlight:_e,u_accent:qe}},Go=function(be,q){var he=q.stride,J=e.create();return e.ortho(J,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(J,J,[0,-e.EXTENT,0]),{u_matrix:J,u_image:1,u_dimension:[he,he],u_zoom:be.overscaledZ,u_unpack:q.getUnpackVector()}};function jo(be,q){var he=Math.pow(2,q.canonical.z),J=q.canonical.y;return[new e.MercatorCoordinate(0,J/he).toLngLat().lat,new e.MercatorCoordinate(0,(J+1)/he).toLngLat().lat]}var Wi=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels)}},Li=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels),u_image:new e.Uniform1i(be,q.u_image),u_image_height:new e.Uniform1f(be,q.u_image_height)}},ns=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_texsize:new e.Uniform2f(be,q.u_texsize),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_image:new e.Uniform1i(be,q.u_image),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels),u_scale:new e.Uniform3f(be,q.u_scale),u_fade:new e.Uniform1f(be,q.u_fade)}},Bs=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_ratio:new e.Uniform1f(be,q.u_ratio),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(be,q.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(be,q.u_patternscale_a),u_patternscale_b:new e.Uniform2f(be,q.u_patternscale_b),u_sdfgamma:new e.Uniform1f(be,q.u_sdfgamma),u_image:new e.Uniform1i(be,q.u_image),u_tex_y_a:new e.Uniform1f(be,q.u_tex_y_a),u_tex_y_b:new e.Uniform1f(be,q.u_tex_y_b),u_mix:new e.Uniform1f(be,q.u_mix)}},Al=function(be,q,he){var J=be.transform;return{u_matrix:Cu(be,q,he),u_ratio:1/Vs(q,1,J.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/J.pixelsToGLUnits[0],1/J.pixelsToGLUnits[1]]}},Zl=function(be,q,he,J){return e.extend(Al(be,q,he),{u_image:0,u_image_height:J})},Ml=function(be,q,he,J){var _e=be.transform,qe=rl(q,_e);return{u_matrix:Cu(be,q,he),u_texsize:q.imageAtlasTexture.size,u_ratio:1/Vs(q,1,_e.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[qe,J.fromScale,J.toScale],u_fade:J.t,u_units_to_pixels:[1/_e.pixelsToGLUnits[0],1/_e.pixelsToGLUnits[1]]}},Wl=function(be,q,he,J,_e){var qe=be.transform,ft=be.lineAtlas,pt=rl(q,qe),$e=he.layout.get("line-cap")==="round",it=ft.getDash(J.from,$e),Tt=ft.getDash(J.to,$e),$t=it.width*_e.fromScale,Ht=Tt.width*_e.toScale;return e.extend(Al(be,q,he),{u_patternscale_a:[pt/$t,-it.height/2],u_patternscale_b:[pt/Ht,-Tt.height/2],u_sdfgamma:ft.width/(Math.min($t,Ht)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:it.y,u_tex_y_b:Tt.y,u_mix:_e.t})};function rl(be,q){return 1/Vs(be,1,q.tileZoom)}function Cu(be,q,he){return be.translatePosMatrix(q.tileID.posMatrix,q,he.paint.get("line-translate"),he.paint.get("line-translate-anchor"))}var Mu=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_tl_parent:new e.Uniform2f(be,q.u_tl_parent),u_scale_parent:new e.Uniform1f(be,q.u_scale_parent),u_buffer_scale:new e.Uniform1f(be,q.u_buffer_scale),u_fade_t:new e.Uniform1f(be,q.u_fade_t),u_opacity:new e.Uniform1f(be,q.u_opacity),u_image0:new e.Uniform1i(be,q.u_image0),u_image1:new e.Uniform1i(be,q.u_image1),u_brightness_low:new e.Uniform1f(be,q.u_brightness_low),u_brightness_high:new e.Uniform1f(be,q.u_brightness_high),u_saturation_factor:new e.Uniform1f(be,q.u_saturation_factor),u_contrast_factor:new e.Uniform1f(be,q.u_contrast_factor),u_spin_weights:new e.Uniform3f(be,q.u_spin_weights)}},Hl=function(be,q,he,J,_e){return{u_matrix:be,u_tl_parent:q,u_scale_parent:he,u_buffer_scale:1,u_fade_t:J.mix,u_opacity:J.opacity*_e.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:_e.paint.get("raster-brightness-min"),u_brightness_high:_e.paint.get("raster-brightness-max"),u_saturation_factor:zl(_e.paint.get("raster-saturation")),u_contrast_factor:ys(_e.paint.get("raster-contrast")),u_spin_weights:yo(_e.paint.get("raster-hue-rotate"))}};function yo(be){be*=Math.PI/180;var q=Math.sin(be),he=Math.cos(be);return[(2*he+1)/3,(-Math.sqrt(3)*q-he+1)/3,(Math.sqrt(3)*q-he+1)/3]}function ys(be){return be>0?1/(1-be):1+be}function zl(be){return be>0?1-1/(1.001-be):-be}var ml=function(be,q){return{u_is_size_zoom_constant:new e.Uniform1i(be,q.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(be,q.u_is_size_feature_constant),u_size_t:new e.Uniform1f(be,q.u_size_t),u_size:new e.Uniform1f(be,q.u_size),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pitch:new e.Uniform1f(be,q.u_pitch),u_rotate_symbol:new e.Uniform1i(be,q.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(be,q.u_aspect_ratio),u_fade_change:new e.Uniform1f(be,q.u_fade_change),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(be,q.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(be,q.u_coord_matrix),u_is_text:new e.Uniform1i(be,q.u_is_text),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_texsize:new e.Uniform2f(be,q.u_texsize),u_texture:new e.Uniform1i(be,q.u_texture)}},yc=function(be,q){return{u_is_size_zoom_constant:new e.Uniform1i(be,q.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(be,q.u_is_size_feature_constant),u_size_t:new e.Uniform1f(be,q.u_size_t),u_size:new e.Uniform1f(be,q.u_size),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pitch:new e.Uniform1f(be,q.u_pitch),u_rotate_symbol:new e.Uniform1i(be,q.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(be,q.u_aspect_ratio),u_fade_change:new e.Uniform1f(be,q.u_fade_change),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(be,q.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(be,q.u_coord_matrix),u_is_text:new e.Uniform1i(be,q.u_is_text),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_texsize:new e.Uniform2f(be,q.u_texsize),u_texture:new e.Uniform1i(be,q.u_texture),u_gamma_scale:new e.Uniform1f(be,q.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(be,q.u_is_halo)}},_c=function(be,q){return{u_is_size_zoom_constant:new e.Uniform1i(be,q.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(be,q.u_is_size_feature_constant),u_size_t:new e.Uniform1f(be,q.u_size_t),u_size:new e.Uniform1f(be,q.u_size),u_camera_to_center_distance:new e.Uniform1f(be,q.u_camera_to_center_distance),u_pitch:new e.Uniform1f(be,q.u_pitch),u_rotate_symbol:new e.Uniform1i(be,q.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(be,q.u_aspect_ratio),u_fade_change:new e.Uniform1f(be,q.u_fade_change),u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(be,q.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(be,q.u_coord_matrix),u_is_text:new e.Uniform1i(be,q.u_is_text),u_pitch_with_map:new e.Uniform1i(be,q.u_pitch_with_map),u_texsize:new e.Uniform2f(be,q.u_texsize),u_texsize_icon:new e.Uniform2f(be,q.u_texsize_icon),u_texture:new e.Uniform1i(be,q.u_texture),u_texture_icon:new e.Uniform1i(be,q.u_texture_icon),u_gamma_scale:new e.Uniform1f(be,q.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(be,q.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(be,q.u_is_halo)}},Ac=function(be,q,he,J,_e,qe,ft,pt,$e,it){var Tt=_e.transform;return{u_is_size_zoom_constant:+(be==="constant"||be==="source"),u_is_size_feature_constant:+(be==="constant"||be==="camera"),u_size_t:q?q.uSizeT:0,u_size:q?q.uSize:0,u_camera_to_center_distance:Tt.cameraToCenterDistance,u_pitch:Tt.pitch/360*2*Math.PI,u_rotate_symbol:+he,u_aspect_ratio:Tt.width/Tt.height,u_fade_change:_e.options.fadeDuration?_e.symbolFadeChange:1,u_matrix:qe,u_label_plane_matrix:ft,u_coord_matrix:pt,u_is_text:+$e,u_pitch_with_map:+J,u_texsize:it,u_texture:0}},$f=function(be,q,he,J,_e,qe,ft,pt,$e,it,Tt){var $t=_e.transform;return e.extend(Ac(be,q,he,J,_e,qe,ft,pt,$e,it),{u_gamma_scale:J?Math.cos($t._pitch)*$t.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:1})},xc=function(be,q,he,J,_e,qe,ft,pt,$e,it){return e.extend($f(be,q,he,J,_e,qe,ft,pt,!0,$e),{u_texsize_icon:it,u_texture_icon:1})},Lf=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_opacity:new e.Uniform1f(be,q.u_opacity),u_color:new e.UniformColor(be,q.u_color)}},Lu=function(be,q){return{u_matrix:new e.UniformMatrix4f(be,q.u_matrix),u_opacity:new e.Uniform1f(be,q.u_opacity),u_image:new e.Uniform1i(be,q.u_image),u_pattern_tl_a:new e.Uniform2f(be,q.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(be,q.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(be,q.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(be,q.u_pattern_br_b),u_texsize:new e.Uniform2f(be,q.u_texsize),u_mix:new e.Uniform1f(be,q.u_mix),u_pattern_size_a:new e.Uniform2f(be,q.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(be,q.u_pattern_size_b),u_scale_a:new e.Uniform1f(be,q.u_scale_a),u_scale_b:new e.Uniform1f(be,q.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(be,q.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(be,q.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(be,q.u_tile_units_to_pixels)}},Pf=function(be,q,he){return{u_matrix:be,u_opacity:q,u_color:he}},Xo=function(be,q,he,J,_e,qe){return e.extend(vh(J,qe,he,_e),{u_matrix:be,u_opacity:q})},as={fillExtrusion:kd,fillExtrusionPattern:hc,fill:Cf,fillPattern:gf,fillOutline:Su,fillOutlinePattern:Tc,circle:cr,collisionBox:pn,collisionCircle:an,debug:xa,clippingMask:li,heatmap:Ha,heatmapTexture:bi,hillshade:Yi,hillshadePrepare:No,line:Wi,lineGradient:Li,linePattern:ns,lineSDF:Bs,raster:Mu,symbolIcon:ml,symbolSDF:yc,symbolTextAndIcon:_c,background:Lf,backgroundPattern:Lu},Rf;function $c(be,q,he,J,_e,qe,ft){for(var pt=be.context,$e=pt.gl,it=be.useProgram("collisionBox"),Tt=[],$t=0,Ht=0,Jt=0;Jt0){var Wr=e.create(),hn=Zt;e.mul(Wr,Bt.placementInvProjMatrix,be.transform.glCoordMatrix),e.mul(Wr,Wr,Bt.placementViewportMatrix),Tt.push({circleArray:Or,circleOffset:Ht,transform:hn,invTransform:Wr}),$t+=Or.length/4,Ht=$t}Gt&&it.draw(pt,$e.LINES,Vn.disabled,Un.disabled,be.colorModeForRenderPass(),Gr.disabled,On(Zt,be.transform,rr),he.id,Gt.layoutVertexBuffer,Gt.indexBuffer,Gt.segments,null,be.transform.zoom,null,null,Gt.collisionVertexBuffer)}}if(!(!ft||!Tt.length)){var la=be.useProgram("collisionCircle"),Zn=new e.StructArrayLayout2f1f2i16;Zn.resize($t*4),Zn._trim();for(var Gn=0,ua=0,da=Tt;ua=0&&(ir[Bt.associatedIconIndex]={shiftedAnchor:Fa,angle:Ka})}}if(Tt){Jt.clear();for(var qi=be.icon.placedSymbolArray,xs=0;xs0){var ft=e.browser.now(),pt=(ft-be.timeAdded)/qe,$e=q?(ft-q.timeAdded)/qe:-1,it=he.getSource(),Tt=_e.coveringZoomLevel({tileSize:it.tileSize,roundZoom:it.roundZoom}),$t=!q||Math.abs(q.tileID.overscaledZ-Tt)>Math.abs(be.tileID.overscaledZ-Tt),Ht=$t&&be.refreshedUponExpiration?1:e.clamp($t?pt:1-$e,0,1);return be.refreshedUponExpiration&&pt>=1&&(be.refreshedUponExpiration=!1),q?{opacity:1,mix:1-Ht}:{opacity:Ht,mix:0}}else return{opacity:1,mix:0}}function Pr(be,q,he){var J=he.paint.get("background-color"),_e=he.paint.get("background-opacity");if(_e!==0){var qe=be.context,ft=qe.gl,pt=be.transform,$e=pt.tileSize,it=he.paint.get("background-pattern");if(!be.isPatternMissing(it)){var Tt=!it&&J.a===1&&_e===1&&be.opaquePassEnabledForLayer()?"opaque":"translucent";if(be.renderPass===Tt){var $t=Un.disabled,Ht=be.depthModeForSublayer(0,Tt==="opaque"?Vn.ReadWrite:Vn.ReadOnly),Jt=be.colorModeForRenderPass(),ir=be.useProgram(it?"backgroundPattern":"background"),rr=pt.coveringTiles({tileSize:$e});it&&(qe.activeTexture.set(ft.TEXTURE0),be.imageManager.bind(be.context));for(var Bt=he.getCrossfadeParameters(),Zt=0,Gt=rr;Zt "+he.overscaledZ);var Zt=Bt+" "+Jt+"kb";Wo(be,Zt),ft.draw(J,_e.TRIANGLES,pt,$e,Vt.alphaBlended,Gr.disabled,ti(qe,e.Color.transparent,rr),Tt,be.debugBuffer,be.quadTriangleIndexBuffer,be.debugSegments)}function Wo(be,q){be.initDebugOverlayCanvas();var he=be.debugOverlayCanvas,J=be.context.gl,_e=be.debugOverlayCanvas.getContext("2d");_e.clearRect(0,0,he.width,he.height),_e.shadowColor="white",_e.shadowBlur=2,_e.lineWidth=1.5,_e.strokeStyle="white",_e.textBaseline="top",_e.font="bold 36px Open Sans, sans-serif",_e.fillText(q,5,5),_e.strokeText(q,5,5),be.debugOverlayTexture.update(he),be.debugOverlayTexture.bind(J.LINEAR,J.CLAMP_TO_EDGE)}function Ks(be,q,he){var J=be.context,_e=he.implementation;if(be.renderPass==="offscreen"){var qe=_e.prerender;qe&&(be.setCustomLayerDefaults(),J.setColorMode(be.colorModeForRenderPass()),qe.call(_e,J.gl,be.transform.customLayerMatrix()),J.setDirty(),be.setBaseState())}else if(be.renderPass==="translucent"){be.setCustomLayerDefaults(),J.setColorMode(be.colorModeForRenderPass()),J.setStencilMode(Un.disabled);var ft=_e.renderingMode==="3d"?new Vn(be.context.gl.LEQUAL,Vn.ReadWrite,be.depthRangeFor3D):be.depthModeForSublayer(0,Vn.ReadOnly);J.setDepthMode(ft),_e.render(J.gl,be.transform.customLayerMatrix()),J.setDirty(),be.setBaseState(),J.bindFramebuffer.set(null)}}var Js={symbol:P,circle:Xt,heatmap:fr,line:xn,fill:Ze,"fill-extrusion":vt,hillshade:zt,raster:gr,background:Pr,debug:bo,custom:Ks},Es=function(q,he){this.context=new ln(q),this.transform=he,this._tileTextures={},this.setup(),this.numSublayers=gn.maxUnderzooming+gn.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new vu,this.gpuTimers={}};Es.prototype.resize=function(q,he){if(this.width=q*e.browser.devicePixelRatio,this.height=he*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var J=0,_e=this.style._order;J<_e.length;J+=1){var qe=_e[J];this.style._layers[qe].resize()}},Es.prototype.setup=function(){var q=this.context,he=new e.StructArrayLayout2i4;he.emplaceBack(0,0),he.emplaceBack(e.EXTENT,0),he.emplaceBack(0,e.EXTENT),he.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=q.createVertexBuffer(he,df.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);var J=new e.StructArrayLayout2i4;J.emplaceBack(0,0),J.emplaceBack(e.EXTENT,0),J.emplaceBack(0,e.EXTENT),J.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=q.createVertexBuffer(J,df.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);var _e=new e.StructArrayLayout4i8;_e.emplaceBack(0,0,0,0),_e.emplaceBack(e.EXTENT,0,e.EXTENT,0),_e.emplaceBack(0,e.EXTENT,0,e.EXTENT),_e.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.rasterBoundsBuffer=q.createVertexBuffer(_e,fe.members),this.rasterBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);var qe=new e.StructArrayLayout2i4;qe.emplaceBack(0,0),qe.emplaceBack(1,0),qe.emplaceBack(0,1),qe.emplaceBack(1,1),this.viewportBuffer=q.createVertexBuffer(qe,df.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);var ft=new e.StructArrayLayout1ui2;ft.emplaceBack(0),ft.emplaceBack(1),ft.emplaceBack(3),ft.emplaceBack(2),ft.emplaceBack(0),this.tileBorderIndexBuffer=q.createIndexBuffer(ft);var pt=new e.StructArrayLayout3ui6;pt.emplaceBack(0,1,2),pt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=q.createIndexBuffer(pt),this.emptyTexture=new e.Texture(q,{width:1,height:1,data:new Uint8Array([0,0,0,0])},q.gl.RGBA);var $e=this.context.gl;this.stencilClearMode=new Un({func:$e.ALWAYS,mask:0},0,255,$e.ZERO,$e.ZERO,$e.ZERO)},Es.prototype.clearStencil=function(){var q=this.context,he=q.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var J=e.create();e.ortho(J,0,this.width,this.height,0,0,1),e.scale(J,J,[he.drawingBufferWidth,he.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(q,he.TRIANGLES,Vn.disabled,this.stencilClearMode,Vt.disabled,Gr.disabled,Ni(J),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Es.prototype._renderTileClippingMasks=function(q,he){if(!(this.currentStencilSource===q.source||!q.isTileClipped()||!he||!he.length)){this.currentStencilSource=q.source;var J=this.context,_e=J.gl;this.nextStencilID+he.length>256&&this.clearStencil(),J.setColorMode(Vt.disabled),J.setDepthMode(Vn.disabled);var qe=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var ft=0,pt=he;ft256&&this.clearStencil();var q=this.nextStencilID++,he=this.context.gl;return new Un({func:he.NOTEQUAL,mask:255},q,255,he.KEEP,he.KEEP,he.REPLACE)},Es.prototype.stencilModeForClipping=function(q){var he=this.context.gl;return new Un({func:he.EQUAL,mask:255},this._tileClippingMaskIDs[q.key],0,he.KEEP,he.KEEP,he.REPLACE)},Es.prototype.stencilConfigForOverlap=function(q){var he,J=this.context.gl,_e=q.sort(function(it,Tt){return Tt.overscaledZ-it.overscaledZ}),qe=_e[_e.length-1].overscaledZ,ft=_e[0].overscaledZ-qe+1;if(ft>1){this.currentStencilSource=void 0,this.nextStencilID+ft>256&&this.clearStencil();for(var pt={},$e=0;$e=0;this.currentLayer--){var Wr=this.style._layers[_e[this.currentLayer]],hn=qe[Wr.source],la=$e[Wr.source];this._renderTileClippingMasks(Wr,la),this.renderLayer(this,hn,Wr,la)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<_e.length;this.currentLayer++){var Zn=this.style._layers[_e[this.currentLayer]],Gn=qe[Zn.source],ua=(Zn.type==="symbol"?Tt:it)[Zn.source];this._renderTileClippingMasks(Zn,$e[Zn.source]),this.renderLayer(this,Gn,Zn,ua)}if(this.options.showTileBoundaries){var da,Pa,fa=e.values(this.style._layers);fa.forEach(function(Fa){Fa.source&&!Fa.isHidden(J.transform.zoom)&&(Fa.source!==(Pa&&Pa.id)&&(Pa=J.style.sourceCaches[Fa.source]),(!da||da.getSource().maxzoom0?he.pop():null},Es.prototype.isPatternMissing=function(q){if(!q)return!1;if(!q.from||!q.to)return!0;var he=this.imageManager.getPattern(q.from.toString()),J=this.imageManager.getPattern(q.to.toString());return!he||!J},Es.prototype.useProgram=function(q,he){this.cache=this.cache||{};var J=""+q+(he?he.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[J]||(this.cache[J]=new dh(this.context,q,hh[q],he,as[q],this._showOverdrawInspector)),this.cache[J]},Es.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Es.prototype.setBaseState=function(){var q=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(q.FUNC_ADD)},Es.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var q=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,q.RGBA)}},Es.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var il=function(q,he){this.points=q,this.planes=he};il.fromInvProjectionMatrix=function(q,he,J){var _e=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],qe=Math.pow(2,J),ft=_e.map(function(it){return e.transformMat4([],it,q)}).map(function(it){return e.scale$1([],it,1/it[3]/he*qe)}),pt=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],$e=pt.map(function(it){var Tt=e.sub([],ft[it[0]],ft[it[1]]),$t=e.sub([],ft[it[2]],ft[it[1]]),Ht=e.normalize([],e.cross([],Tt,$t)),Jt=-e.dot(Ht,ft[it[1]]);return Ht.concat(Jt)});return new il(ft,$e)};var mu=function(q,he){this.min=q,this.max=he,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};mu.prototype.quadrant=function(q){for(var he=[q%2===0,q<2],J=e.clone$2(this.min),_e=e.clone$2(this.max),qe=0;qe=0;if(ft===0)return 0;ft!==he.length&&(J=!1)}if(J)return 2;for(var $e=0;$e<3;$e++){for(var it=Number.MAX_VALUE,Tt=-Number.MAX_VALUE,$t=0;$tthis.max[$e]-this.min[$e])return 0}return 1};var ou=function(q,he,J,_e){if(q===void 0&&(q=0),he===void 0&&(he=0),J===void 0&&(J=0),_e===void 0&&(_e=0),isNaN(q)||q<0||isNaN(he)||he<0||isNaN(J)||J<0||isNaN(_e)||_e<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=q,this.bottom=he,this.left=J,this.right=_e};ou.prototype.interpolate=function(q,he,J){return he.top!=null&&q.top!=null&&(this.top=e.number(q.top,he.top,J)),he.bottom!=null&&q.bottom!=null&&(this.bottom=e.number(q.bottom,he.bottom,J)),he.left!=null&&q.left!=null&&(this.left=e.number(q.left,he.left,J)),he.right!=null&&q.right!=null&&(this.right=e.number(q.right,he.right,J)),this},ou.prototype.getCenter=function(q,he){var J=e.clamp((this.left+q-this.right)/2,0,q),_e=e.clamp((this.top+he-this.bottom)/2,0,he);return new e.Point(J,_e)},ou.prototype.equals=function(q){return this.top===q.top&&this.bottom===q.bottom&&this.left===q.left&&this.right===q.right},ou.prototype.clone=function(){return new ou(this.top,this.bottom,this.left,this.right)},ou.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var ks=function(q,he,J,_e,qe){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=qe===void 0?!0:qe,this._minZoom=q||0,this._maxZoom=he||22,this._minPitch=J??0,this._maxPitch=_e??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ou,this._posMatrixCache={},this._alignedPosMatrixCache={}},Cs={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};ks.prototype.clone=function(){var q=new ks(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return q.tileSize=this.tileSize,q.latRange=this.latRange,q.width=this.width,q.height=this.height,q._center=this._center,q.zoom=this.zoom,q.angle=this.angle,q._fov=this._fov,q._pitch=this._pitch,q._unmodified=this._unmodified,q._edgeInsets=this._edgeInsets.clone(),q._calcMatrices(),q},Cs.minZoom.get=function(){return this._minZoom},Cs.minZoom.set=function(be){this._minZoom!==be&&(this._minZoom=be,this.zoom=Math.max(this.zoom,be))},Cs.maxZoom.get=function(){return this._maxZoom},Cs.maxZoom.set=function(be){this._maxZoom!==be&&(this._maxZoom=be,this.zoom=Math.min(this.zoom,be))},Cs.minPitch.get=function(){return this._minPitch},Cs.minPitch.set=function(be){this._minPitch!==be&&(this._minPitch=be,this.pitch=Math.max(this.pitch,be))},Cs.maxPitch.get=function(){return this._maxPitch},Cs.maxPitch.set=function(be){this._maxPitch!==be&&(this._maxPitch=be,this.pitch=Math.min(this.pitch,be))},Cs.renderWorldCopies.get=function(){return this._renderWorldCopies},Cs.renderWorldCopies.set=function(be){be===void 0?be=!0:be===null&&(be=!1),this._renderWorldCopies=be},Cs.worldSize.get=function(){return this.tileSize*this.scale},Cs.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Cs.size.get=function(){return new e.Point(this.width,this.height)},Cs.bearing.get=function(){return-this.angle/Math.PI*180},Cs.bearing.set=function(be){var q=-e.wrap(be,-180,180)*Math.PI/180;this.angle!==q&&(this._unmodified=!1,this.angle=q,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Cs.pitch.get=function(){return this._pitch/Math.PI*180},Cs.pitch.set=function(be){var q=e.clamp(be,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==q&&(this._unmodified=!1,this._pitch=q,this._calcMatrices())},Cs.fov.get=function(){return this._fov/Math.PI*180},Cs.fov.set=function(be){be=Math.max(.01,Math.min(60,be)),this._fov!==be&&(this._unmodified=!1,this._fov=be/180*Math.PI,this._calcMatrices())},Cs.zoom.get=function(){return this._zoom},Cs.zoom.set=function(be){var q=Math.min(Math.max(be,this.minZoom),this.maxZoom);this._zoom!==q&&(this._unmodified=!1,this._zoom=q,this.scale=this.zoomScale(q),this.tileZoom=Math.floor(q),this.zoomFraction=q-this.tileZoom,this._constrain(),this._calcMatrices())},Cs.center.get=function(){return this._center},Cs.center.set=function(be){be.lat===this._center.lat&&be.lng===this._center.lng||(this._unmodified=!1,this._center=be,this._constrain(),this._calcMatrices())},Cs.padding.get=function(){return this._edgeInsets.toJSON()},Cs.padding.set=function(be){this._edgeInsets.equals(be)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,be,1),this._calcMatrices())},Cs.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},ks.prototype.isPaddingEqual=function(q){return this._edgeInsets.equals(q)},ks.prototype.interpolatePadding=function(q,he,J){this._unmodified=!1,this._edgeInsets.interpolate(q,he,J),this._constrain(),this._calcMatrices()},ks.prototype.coveringZoomLevel=function(q){var he=(q.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/q.tileSize));return Math.max(0,he)},ks.prototype.getVisibleUnwrappedCoordinates=function(q){var he=[new e.UnwrappedTileID(0,q)];if(this._renderWorldCopies)for(var J=this.pointCoordinate(new e.Point(0,0)),_e=this.pointCoordinate(new e.Point(this.width,0)),qe=this.pointCoordinate(new e.Point(this.width,this.height)),ft=this.pointCoordinate(new e.Point(0,this.height)),pt=Math.floor(Math.min(J.x,_e.x,qe.x,ft.x)),$e=Math.floor(Math.max(J.x,_e.x,qe.x,ft.x)),it=1,Tt=pt-it;Tt<=$e+it;Tt++)Tt!==0&&he.push(new e.UnwrappedTileID(Tt,q));return he},ks.prototype.coveringTiles=function(q){var he=this.coveringZoomLevel(q),J=he;if(q.minzoom!==void 0&&heq.maxzoom&&(he=q.maxzoom);var _e=e.MercatorCoordinate.fromLngLat(this.center),qe=Math.pow(2,he),ft=[qe*_e.x,qe*_e.y,0],pt=il.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,he),$e=q.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&($e=he);var it=3,Tt=function(fa){return{aabb:new mu([fa*qe,0,0],[(fa+1)*qe,qe,0]),zoom:0,x:0,y:0,wrap:fa,fullyVisible:!1}},$t=[],Ht=[],Jt=he,ir=q.reparseOverscaled?J:he;if(this._renderWorldCopies)for(var rr=1;rr<=3;rr++)$t.push(Tt(-rr)),$t.push(Tt(rr));for($t.push(Tt(0));$t.length>0;){var Bt=$t.pop(),Zt=Bt.x,Gt=Bt.y,Or=Bt.fullyVisible;if(!Or){var Wr=Bt.aabb.intersects(pt);if(Wr===0)continue;Or=Wr===2}var hn=Bt.aabb.distanceX(ft),la=Bt.aabb.distanceY(ft),Zn=Math.max(Math.abs(hn),Math.abs(la)),Gn=it+(1<Gn&&Bt.zoom>=$e){Ht.push({tileID:new e.OverscaledTileID(Bt.zoom===Jt?ir:Bt.zoom,Bt.wrap,Bt.zoom,Zt,Gt),distanceSq:e.sqrLen([ft[0]-.5-Zt,ft[1]-.5-Gt])});continue}for(var ua=0;ua<4;ua++){var da=(Zt<<1)+ua%2,Pa=(Gt<<1)+(ua>>1);$t.push({aabb:Bt.aabb.quadrant(ua),zoom:Bt.zoom+1,x:da,y:Pa,wrap:Bt.wrap,fullyVisible:Or})}}return Ht.sort(function(fa,Fa){return fa.distanceSq-Fa.distanceSq}).map(function(fa){return fa.tileID})},ks.prototype.resize=function(q,he){this.width=q,this.height=he,this.pixelsToGLUnits=[2/q,-2/he],this._constrain(),this._calcMatrices()},Cs.unmodified.get=function(){return this._unmodified},ks.prototype.zoomScale=function(q){return Math.pow(2,q)},ks.prototype.scaleZoom=function(q){return Math.log(q)/Math.LN2},ks.prototype.project=function(q){var he=e.clamp(q.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(q.lng)*this.worldSize,e.mercatorYfromLat(he)*this.worldSize)},ks.prototype.unproject=function(q){return new e.MercatorCoordinate(q.x/this.worldSize,q.y/this.worldSize).toLngLat()},Cs.point.get=function(){return this.project(this.center)},ks.prototype.setLocationAtPoint=function(q,he){var J=this.pointCoordinate(he),_e=this.pointCoordinate(this.centerPoint),qe=this.locationCoordinate(q),ft=new e.MercatorCoordinate(qe.x-(J.x-_e.x),qe.y-(J.y-_e.y));this.center=this.coordinateLocation(ft),this._renderWorldCopies&&(this.center=this.center.wrap())},ks.prototype.locationPoint=function(q){return this.coordinatePoint(this.locationCoordinate(q))},ks.prototype.pointLocation=function(q){return this.coordinateLocation(this.pointCoordinate(q))},ks.prototype.locationCoordinate=function(q){return e.MercatorCoordinate.fromLngLat(q)},ks.prototype.coordinateLocation=function(q){return q.toLngLat()},ks.prototype.pointCoordinate=function(q){var he=0,J=[q.x,q.y,0,1],_e=[q.x,q.y,1,1];e.transformMat4(J,J,this.pixelMatrixInverse),e.transformMat4(_e,_e,this.pixelMatrixInverse);var qe=J[3],ft=_e[3],pt=J[0]/qe,$e=_e[0]/ft,it=J[1]/qe,Tt=_e[1]/ft,$t=J[2]/qe,Ht=_e[2]/ft,Jt=$t===Ht?0:(he-$t)/(Ht-$t);return new e.MercatorCoordinate(e.number(pt,$e,Jt)/this.worldSize,e.number(it,Tt,Jt)/this.worldSize)},ks.prototype.coordinatePoint=function(q){var he=[q.x*this.worldSize,q.y*this.worldSize,0,1];return e.transformMat4(he,he,this.pixelMatrix),new e.Point(he[0]/he[3],he[1]/he[3])},ks.prototype.getBounds=function(){return new e.LngLatBounds().extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},ks.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},ks.prototype.setMaxBounds=function(q){q?(this.lngRange=[q.getWest(),q.getEast()],this.latRange=[q.getSouth(),q.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},ks.prototype.calculatePosMatrix=function(q,he){he===void 0&&(he=!1);var J=q.key,_e=he?this._alignedPosMatrixCache:this._posMatrixCache;if(_e[J])return _e[J];var qe=q.canonical,ft=this.worldSize/this.zoomScale(qe.z),pt=qe.x+Math.pow(2,qe.z)*q.wrap,$e=e.identity(new Float64Array(16));return e.translate($e,$e,[pt*ft,qe.y*ft,0]),e.scale($e,$e,[ft/e.EXTENT,ft/e.EXTENT,1]),e.multiply($e,he?this.alignedProjMatrix:this.projMatrix,$e),_e[J]=new Float32Array($e),_e[J]},ks.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},ks.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var q=-90,he=90,J=-180,_e=180,qe,ft,pt,$e,it=this.size,Tt=this._unmodified;if(this.latRange){var $t=this.latRange;q=e.mercatorYfromLat($t[1])*this.worldSize,he=e.mercatorYfromLat($t[0])*this.worldSize,qe=he-qhe&&($e=he-Bt)}if(this.lngRange){var Zt=Jt.x,Gt=it.x/2;Zt-Gt_e&&(pt=_e-Gt)}(pt!==void 0||$e!==void 0)&&(this.center=this.unproject(new e.Point(pt!==void 0?pt:Jt.x,$e!==void 0?$e:Jt.y))),this._unmodified=Tt,this._constraining=!1}},ks.prototype._calcMatrices=function(){if(this.height){var q=this._fov/2,he=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(q)*this.height;var J=Math.PI/2+this._pitch,_e=this._fov*(.5+he.y/this.height),qe=Math.sin(_e)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-J-_e,.01,Math.PI-.01)),ft=this.point,pt=ft.x,$e=ft.y,it=Math.cos(Math.PI/2-this._pitch)*qe+this.cameraToCenterDistance,Tt=it*1.01,$t=this.height/50,Ht=new Float64Array(16);e.perspective(Ht,this._fov,this.width/this.height,$t,Tt),Ht[8]=-he.x*2/this.width,Ht[9]=he.y*2/this.height,e.scale(Ht,Ht,[1,-1,1]),e.translate(Ht,Ht,[0,0,-this.cameraToCenterDistance]),e.rotateX(Ht,Ht,this._pitch),e.rotateZ(Ht,Ht,this.angle),e.translate(Ht,Ht,[-pt,-$e,0]),this.mercatorMatrix=e.scale([],Ht,[this.worldSize,this.worldSize,this.worldSize]),e.scale(Ht,Ht,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Ht,this.invProjMatrix=e.invert([],this.projMatrix);var Jt=this.width%2/2,ir=this.height%2/2,rr=Math.cos(this.angle),Bt=Math.sin(this.angle),Zt=pt-Math.round(pt)+rr*Jt+Bt*ir,Gt=$e-Math.round($e)+rr*ir+Bt*Jt,Or=new Float64Array(Ht);if(e.translate(Or,Or,[Zt>.5?Zt-1:Zt,Gt>.5?Gt-1:Gt,0]),this.alignedProjMatrix=Or,Ht=e.create(),e.scale(Ht,Ht,[this.width/2,-this.height/2,1]),e.translate(Ht,Ht,[1,-1,0]),this.labelPlaneMatrix=Ht,Ht=e.create(),e.scale(Ht,Ht,[1,-1,1]),e.translate(Ht,Ht,[-1,-1,0]),e.scale(Ht,Ht,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ht,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),Ht=e.invert(new Float64Array(16),this.pixelMatrix),!Ht)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ht,this._posMatrixCache={},this._alignedPosMatrixCache={}}},ks.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var q=this.pointCoordinate(new e.Point(0,0)),he=[q.x*this.worldSize,q.y*this.worldSize,0,1],J=e.transformMat4(he,he,this.pixelMatrix);return J[3]/this.cameraToCenterDistance},ks.prototype.getCameraPoint=function(){var q=this._pitch,he=Math.tan(q)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,he))},ks.prototype.getCameraQueryGeometry=function(q){var he=this.getCameraPoint();if(q.length===1)return[q[0],he];for(var J=he.x,_e=he.y,qe=he.x,ft=he.y,pt=0,$e=q;pt<$e.length;pt+=1){var it=$e[pt];J=Math.min(J,it.x),_e=Math.min(_e,it.y),qe=Math.max(qe,it.x),ft=Math.max(ft,it.y)}return[new e.Point(J,_e),new e.Point(qe,_e),new e.Point(qe,ft),new e.Point(J,ft),new e.Point(J,_e)]},Object.defineProperties(ks.prototype,Cs);function Ru(be,q){var he=!1,J=null,_e=function(){J=null,he&&(be(),J=setTimeout(_e,q),he=!1)};return function(){return he=!0,J||_e(),J}}var uc=function(q){this._hashName=q&&encodeURIComponent(q),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Ru(this._updateHashUnthrottled.bind(this),30*1e3/100)};uc.prototype.addTo=function(q){return this._map=q,e.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},uc.prototype.remove=function(){return e.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},uc.prototype.getHashString=function(q){var he=this._map.getCenter(),J=Math.round(this._map.getZoom()*100)/100,_e=Math.ceil((J*Math.LN2+Math.log(512/360/.5))/Math.LN10),qe=Math.pow(10,_e),ft=Math.round(he.lng*qe)/qe,pt=Math.round(he.lat*qe)/qe,$e=this._map.getBearing(),it=this._map.getPitch(),Tt="";if(q?Tt+="/"+ft+"/"+pt+"/"+J:Tt+=J+"/"+pt+"/"+ft,($e||it)&&(Tt+="/"+Math.round($e*10)/10),it&&(Tt+="/"+Math.round(it)),this._hashName){var $t=this._hashName,Ht=!1,Jt=e.window.location.hash.slice(1).split("&").map(function(ir){var rr=ir.split("=")[0];return rr===$t?(Ht=!0,rr+"="+Tt):ir}).filter(function(ir){return ir});return Ht||Jt.push($t+"="+Tt),"#"+Jt.join("&")}return"#"+Tt},uc.prototype._getCurrentHash=function(){var q=this,he=e.window.location.hash.replace("#","");if(this._hashName){var J;return he.split("&").map(function(_e){return _e.split("=")}).forEach(function(_e){_e[0]===q._hashName&&(J=_e)}),(J&&J[1]||"").split("/")}return he.split("/")},uc.prototype._onHashChange=function(){var q=this._getCurrentHash();if(q.length>=3&&!q.some(function(J){return isNaN(J)})){var he=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(q[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+q[2],+q[1]],zoom:+q[0],bearing:he,pitch:+(q[4]||0)}),!0}return!1},uc.prototype._updateHashUnthrottled=function(){var q=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,q)}catch{}};var Uc={linearity:.3,easing:e.bezier(0,0,.3,1)},ge=e.extend({deceleration:2500,maxSpeed:1400},Uc),Oe=e.extend({deceleration:20,maxSpeed:1400},Uc),rt=e.extend({deceleration:1e3,maxSpeed:360},Uc),wt=e.extend({deceleration:1e3,maxSpeed:90},Uc),St=function(q){this._map=q,this.clear()};St.prototype.clear=function(){this._inertiaBuffer=[]},St.prototype.record=function(q){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:q})},St.prototype._drainInertiaBuffer=function(){for(var q=this._inertiaBuffer,he=e.browser.now(),J=160;q.length>0&&he-q[0].time>J;)q.shift()},St.prototype._onMoveEnd=function(q){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var he={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},J=0,_e=this._inertiaBuffer;J<_e.length;J+=1){var qe=_e[J],ft=qe.settings;he.zoom+=ft.zoomDelta||0,he.bearing+=ft.bearingDelta||0,he.pitch+=ft.pitchDelta||0,ft.panDelta&&he.pan._add(ft.panDelta),ft.around&&(he.around=ft.around),ft.pinchAround&&(he.pinchAround=ft.pinchAround)}var pt=this._inertiaBuffer[this._inertiaBuffer.length-1],$e=pt.time-this._inertiaBuffer[0].time,it={};if(he.pan.mag()){var Tt=tr(he.pan.mag(),$e,e.extend({},ge,q||{}));it.offset=he.pan.mult(Tt.amount/he.pan.mag()),it.center=this._map.transform.center,It(it,Tt)}if(he.zoom){var $t=tr(he.zoom,$e,Oe);it.zoom=this._map.transform.zoom+$t.amount,It(it,$t)}if(he.bearing){var Ht=tr(he.bearing,$e,rt);it.bearing=this._map.transform.bearing+e.clamp(Ht.amount,-179,179),It(it,Ht)}if(he.pitch){var Jt=tr(he.pitch,$e,wt);it.pitch=this._map.transform.pitch+Jt.amount,It(it,Jt)}if(it.zoom||it.bearing){var ir=he.pinchAround===void 0?he.around:he.pinchAround;it.around=ir?this._map.unproject(ir):this._map.getCenter()}return this.clear(),e.extend(it,{noMoveStart:!0})}};function It(be,q){(!be.duration||be.duration=this._clickTolerance||this._map.fire(new er(q.type,this._map,q))},Xr.prototype.dblclick=function(q){return this._firePreventable(new er(q.type,this._map,q))},Xr.prototype.mouseover=function(q){this._map.fire(new er(q.type,this._map,q))},Xr.prototype.mouseout=function(q){this._map.fire(new er(q.type,this._map,q))},Xr.prototype.touchstart=function(q){return this._firePreventable(new _r(q.type,this._map,q))},Xr.prototype.touchmove=function(q){this._map.fire(new _r(q.type,this._map,q))},Xr.prototype.touchend=function(q){this._map.fire(new _r(q.type,this._map,q))},Xr.prototype.touchcancel=function(q){this._map.fire(new _r(q.type,this._map,q))},Xr.prototype._firePreventable=function(q){if(this._map.fire(q),q.defaultPrevented)return{}},Xr.prototype.isEnabled=function(){return!0},Xr.prototype.isActive=function(){return!1},Xr.prototype.enable=function(){},Xr.prototype.disable=function(){};var dn=function(q){this._map=q};dn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},dn.prototype.mousemove=function(q){this._map.fire(new er(q.type,this._map,q))},dn.prototype.mousedown=function(){this._delayContextMenu=!0},dn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new er("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},dn.prototype.contextmenu=function(q){this._delayContextMenu?this._contextMenuEvent=q:this._map.fire(new er(q.type,this._map,q)),this._map.listens("contextmenu")&&q.preventDefault()},dn.prototype.isEnabled=function(){return!0},dn.prototype.isActive=function(){return!1},dn.prototype.enable=function(){},dn.prototype.disable=function(){};var Mn=function(q,he){this._map=q,this._el=q.getCanvasContainer(),this._container=q.getContainer(),this._clickTolerance=he.clickTolerance||1};Mn.prototype.isEnabled=function(){return!!this._enabled},Mn.prototype.isActive=function(){return!!this._active},Mn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Mn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Mn.prototype.mousedown=function(q,he){this.isEnabled()&&q.shiftKey&&q.button===0&&(r.disableDrag(),this._startPos=this._lastPos=he,this._active=!0)},Mn.prototype.mousemoveWindow=function(q,he){if(this._active){var J=he;if(!(this._lastPos.equals(J)||!this._box&&J.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=q.timeStamp),J.length===this.numTouches&&(this.centroid=La(he),this.touches=Cn(J,he)))},Sa.prototype.touchmove=function(q,he,J){if(!(this.aborted||!this.centroid)){var _e=Cn(J,he);for(var qe in this.touches){var ft=this.touches[qe],pt=_e[qe];(!pt||pt.dist(ft)>sa)&&(this.aborted=!0)}}},Sa.prototype.touchend=function(q,he,J){if((!this.centroid||q.timeStamp-this.startTime>ea)&&(this.aborted=!0),J.length===0){var _e=!this.aborted&&this.centroid;if(this.reset(),_e)return _e}};var Ra=function(q){this.singleTap=new Sa(q),this.numTaps=q.numTaps,this.reset()};Ra.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ra.prototype.touchstart=function(q,he,J){this.singleTap.touchstart(q,he,J)},Ra.prototype.touchmove=function(q,he,J){this.singleTap.touchmove(q,he,J)},Ra.prototype.touchend=function(q,he,J){var _e=this.singleTap.touchend(q,he,J);if(_e){var qe=q.timeStamp-this.lastTime0&&(this._active=!0);var _e=Cn(J,he),qe=new e.Point(0,0),ft=new e.Point(0,0),pt=0;for(var $e in _e){var it=_e[$e],Tt=this._touches[$e];Tt&&(qe._add(it),ft._add(it.sub(Tt)),pt++,_e[$e]=it)}if(this._touches=_e,!(ptMath.abs(be.x)}var El=100,Kl=(function(be){function q(){be.apply(this,arguments)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.reset=function(){be.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},q.prototype._start=function(J){this._lastPoints=J,Sc(J[0].sub(J[1]))&&(this._valid=!1)},q.prototype._move=function(J,_e,qe){var ft=J[0].sub(this._lastPoints[0]),pt=J[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(ft,pt,qe.timeStamp),!!this._valid){this._lastPoints=J,this._active=!0;var $e=(ft.y+pt.y)/2,it=-.5;return{pitchDelta:$e*it}}},q.prototype.gestureBeginsVertically=function(J,_e,qe){if(this._valid!==void 0)return this._valid;var ft=2,pt=J.mag()>=ft,$e=_e.mag()>=ft;if(!(!pt&&!$e)){if(!pt||!$e)return this._firstMove===void 0&&(this._firstMove=qe),qe-this._firstMove0==_e.y>0;return Sc(J)&&Sc(_e)&&it}},q})(nl),Kc={panStep:100,bearingStep:15,pitchStep:10},Pu=function(){var q=Kc;this._panStep=q.panStep,this._bearingStep=q.bearingStep,this._pitchStep=q.pitchStep,this._rotationDisabled=!1};Pu.prototype.reset=function(){this._active=!1},Pu.prototype.keydown=function(q){var he=this;if(!(q.altKey||q.ctrlKey||q.metaKey)){var J=0,_e=0,qe=0,ft=0,pt=0;switch(q.keyCode){case 61:case 107:case 171:case 187:J=1;break;case 189:case 109:case 173:J=-1;break;case 37:q.shiftKey?_e=-1:(q.preventDefault(),ft=-1);break;case 39:q.shiftKey?_e=1:(q.preventDefault(),ft=1);break;case 38:q.shiftKey?qe=1:(q.preventDefault(),pt=-1);break;case 40:q.shiftKey?qe=-1:(q.preventDefault(),pt=1);break;default:return}return this._rotationDisabled&&(_e=0,qe=0),{cameraAnimation:function($e){var it=$e.getZoom();$e.easeTo({duration:300,easeId:"keyboardHandler",easing:mt,zoom:J?Math.round(it)+J*(q.shiftKey?2:1):it,bearing:$e.getBearing()+_e*he._bearingStep,pitch:$e.getPitch()+qe*he._pitchStep,offset:[-ft*he._panStep,-pt*he._panStep],center:$e.getCenter()},{originalEvent:q})}}}},Pu.prototype.enable=function(){this._enabled=!0},Pu.prototype.disable=function(){this._enabled=!1,this.reset()},Pu.prototype.isEnabled=function(){return this._enabled},Pu.prototype.isActive=function(){return this._active},Pu.prototype.disableRotation=function(){this._rotationDisabled=!0},Pu.prototype.enableRotation=function(){this._rotationDisabled=!1};function mt(be){return be*(2-be)}var yr=4.000244140625,wr=1/100,Ln=1/450,ca=2,yn=function(q,he){this._map=q,this._el=q.getCanvasContainer(),this._handler=he,this._delta=0,this._defaultZoomRate=wr,this._wheelZoomRate=Ln,e.bindAll(["_onTimeout"],this)};yn.prototype.setZoomRate=function(q){this._defaultZoomRate=q},yn.prototype.setWheelZoomRate=function(q){this._wheelZoomRate=q},yn.prototype.isEnabled=function(){return!!this._enabled},yn.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},yn.prototype.isZooming=function(){return!!this._zooming},yn.prototype.enable=function(q){this.isEnabled()||(this._enabled=!0,this._aroundCenter=q&&q.around==="center")},yn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},yn.prototype.wheel=function(q){if(this.isEnabled()){var he=q.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?q.deltaY*40:q.deltaY,J=e.browser.now(),_e=J-(this._lastWheelEventTime||0);this._lastWheelEventTime=J,he!==0&&he%yr===0?this._type="wheel":he!==0&&Math.abs(he)<4?this._type="trackpad":_e>400?(this._type=null,this._lastValue=he,this._timeout=setTimeout(this._onTimeout,40,q)):this._type||(this._type=Math.abs(_e*he)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,he+=this._lastValue)),q.shiftKey&&he&&(he=he/4),this._type&&(this._lastWheelEvent=q,this._delta-=he,this._active||this._start(q)),q.preventDefault()}},yn.prototype._onTimeout=function(q){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(q)},yn.prototype._start=function(q){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var he=r.mousePos(this._el,q);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(he)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},yn.prototype.renderFrame=function(){var q=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var he=this._map.transform;if(this._delta!==0){var J=this._type==="wheel"&&Math.abs(this._delta)>yr?this._wheelZoomRate:this._defaultZoomRate,_e=ca/(1+Math.exp(-Math.abs(this._delta*J)));this._delta<0&&_e!==0&&(_e=1/_e);var qe=typeof this._targetZoom=="number"?he.zoomScale(this._targetZoom):he.scale;this._targetZoom=Math.min(he.maxZoom,Math.max(he.minZoom,he.scaleZoom(qe*_e))),this._type==="wheel"&&(this._startZoom=he.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var ft=typeof this._targetZoom=="number"?this._targetZoom:he.zoom,pt=this._startZoom,$e=this._easing,it=!1,Tt;if(this._type==="wheel"&&pt&&$e){var $t=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),Ht=$e($t);Tt=e.number(pt,ft,Ht),$t<1?this._frameId||(this._frameId=!0):it=!0}else Tt=ft,it=!0;return this._active=!0,it&&(this._active=!1,this._finishTimeout=setTimeout(function(){q._zooming=!1,q._handler._triggerRenderFrame(),delete q._targetZoom,delete q._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!it,zoomDelta:Tt-he.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},yn.prototype._smoothOutEasing=function(q){var he=e.ease;if(this._prevEase){var J=this._prevEase,_e=(e.browser.now()-J.start)/J.duration,qe=J.easing(_e+.01)-J.easing(_e),ft=.27/Math.sqrt(qe*qe+1e-4)*.01,pt=Math.sqrt(.27*.27-ft*ft);he=e.bezier(ft,pt,.25,1)}return this._prevEase={start:e.browser.now(),duration:q,easing:he},he},yn.prototype.reset=function(){this._active=!1};var mn=function(q,he){this._clickZoom=q,this._tapZoom=he};mn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},mn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},mn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},mn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var za=function(){this.reset()};za.prototype.reset=function(){this._active=!1},za.prototype.dblclick=function(q,he){return q.preventDefault(),{cameraAnimation:function(J){J.easeTo({duration:300,zoom:J.getZoom()+(q.shiftKey?-1:1),around:J.unproject(he)},{originalEvent:q})}}},za.prototype.enable=function(){this._enabled=!0},za.prototype.disable=function(){this._enabled=!1,this.reset()},za.prototype.isEnabled=function(){return this._enabled},za.prototype.isActive=function(){return this._active};var Ia=function(){this._tap=new Ra({numTouches:1,numTaps:1}),this.reset()};Ia.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Ia.prototype.touchstart=function(q,he,J){this._swipePoint||(this._tapTime&&q.timeStamp-this._tapTime>zn&&this.reset(),this._tapTime?J.length>0&&(this._swipePoint=he[0],this._swipeTouch=J[0].identifier):this._tap.touchstart(q,he,J))},Ia.prototype.touchmove=function(q,he,J){if(!this._tapTime)this._tap.touchmove(q,he,J);else if(this._swipePoint){if(J[0].identifier!==this._swipeTouch)return;var _e=he[0],qe=_e.y-this._swipePoint.y;return this._swipePoint=_e,q.preventDefault(),this._active=!0,{zoomDelta:qe/128}}},Ia.prototype.touchend=function(q,he,J){if(this._tapTime)this._swipePoint&&J.length===0&&this.reset();else{var _e=this._tap.touchend(q,he,J);_e&&(this._tapTime=q.timeStamp)}},Ia.prototype.touchcancel=function(){this.reset()},Ia.prototype.enable=function(){this._enabled=!0},Ia.prototype.disable=function(){this._enabled=!1,this.reset()},Ia.prototype.isEnabled=function(){return this._enabled},Ia.prototype.isActive=function(){return this._active};var Da=function(q,he,J){this._el=q,this._mousePan=he,this._touchPan=J};Da.prototype.enable=function(q){this._inertiaOptions=q||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Da.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Da.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Da.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Za=function(q,he,J){this._pitchWithRotate=q.pitchWithRotate,this._mouseRotate=he,this._mousePitch=J};Za.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Za.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Za.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Za.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Fi=function(q,he,J,_e){this._el=q,this._touchZoom=he,this._touchRotate=J,this._tapDragZoom=_e,this._rotationDisabled=!1,this._enabled=!0};Fi.prototype.enable=function(q){this._touchZoom.enable(q),this._rotationDisabled||this._touchRotate.enable(q),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Fi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Fi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Fi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Fi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Fi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var yi=function(be){return be.zoom||be.drag||be.pitch||be.rotate},Ga=(function(be){function q(){be.apply(this,arguments)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q})(e.Event);function ma(be){return be.panDelta&&be.panDelta.mag()||be.zoomDelta||be.bearingDelta||be.pitchDelta}var nn=function(q,he){this._map=q,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new St(q),this._bearingSnap=he.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(he),e.bindAll(["handleEvent","handleWindowEvent"],this);var J=this._el;this._listeners=[[J,"touchstart",{passive:!0}],[J,"touchmove",{passive:!1}],[J,"touchend",void 0],[J,"touchcancel",void 0],[J,"mousedown",void 0],[J,"mousemove",void 0],[J,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[J,"mouseover",void 0],[J,"mouseout",void 0],[J,"dblclick",void 0],[J,"click",void 0],[J,"keydown",{capture:!1}],[J,"keyup",void 0],[J,"wheel",{passive:!1}],[J,"contextmenu",void 0],[e.window,"blur",void 0]];for(var _e=0,qe=this._listeners;_ept?Math.min(2,hn):Math.max(.5,hn),fa=Math.pow(Pa,1-ua),Fa=ft.unproject(Or.add(Wr.mult(ua*fa)).mult(da));ft.setLocationAtPoint(ft.renderWorldCopies?Fa.wrap():Fa,Bt)}qe._fireMoveEvents(_e)},function(ua){qe._afterEase(_e,ua)},J),this},q.prototype._prepareEase=function(J,_e,qe){qe===void 0&&(qe={}),this._moving=!0,!_e&&!qe.moving&&this.fire(new e.Event("movestart",J)),this._zooming&&!qe.zooming&&this.fire(new e.Event("zoomstart",J)),this._rotating&&!qe.rotating&&this.fire(new e.Event("rotatestart",J)),this._pitching&&!qe.pitching&&this.fire(new e.Event("pitchstart",J))},q.prototype._fireMoveEvents=function(J){this.fire(new e.Event("move",J)),this._zooming&&this.fire(new e.Event("zoom",J)),this._rotating&&this.fire(new e.Event("rotate",J)),this._pitching&&this.fire(new e.Event("pitch",J))},q.prototype._afterEase=function(J,_e){if(!(this._easeId&&_e&&this._easeId===_e)){delete this._easeId;var qe=this._zooming,ft=this._rotating,pt=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,qe&&this.fire(new e.Event("zoomend",J)),ft&&this.fire(new e.Event("rotateend",J)),pt&&this.fire(new e.Event("pitchend",J)),this.fire(new e.Event("moveend",J))}},q.prototype.flyTo=function(J,_e){var qe=this;if(!J.essential&&e.browser.prefersReducedMotion){var ft=e.pick(J,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ft,_e)}this.stop(),J=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},J);var pt=this.transform,$e=this.getZoom(),it=this.getBearing(),Tt=this.getPitch(),$t=this.getPadding(),Ht="zoom"in J?e.clamp(+J.zoom,pt.minZoom,pt.maxZoom):$e,Jt="bearing"in J?this._normalizeBearing(J.bearing,it):it,ir="pitch"in J?+J.pitch:Tt,rr="padding"in J?J.padding:pt.padding,Bt=pt.zoomScale(Ht-$e),Zt=e.Point.convert(J.offset),Gt=pt.centerPoint.add(Zt),Or=pt.pointLocation(Gt),Wr=e.LngLat.convert(J.center||Or);this._normalizeCenter(Wr);var hn=pt.project(Or),la=pt.project(Wr).sub(hn),Zn=J.curve,Gn=Math.max(pt.width,pt.height),ua=Gn/Bt,da=la.mag();if("minZoom"in J){var Pa=e.clamp(Math.min(J.minZoom,$e,Ht),pt.minZoom,pt.maxZoom),fa=Gn/pt.zoomScale(Pa-$e);Zn=Math.sqrt(fa/da*2)}var Fa=Zn*Zn;function Ka(sl){var Tu=(ua*ua-Gn*Gn+(sl?-1:1)*Fa*Fa*da*da)/(2*(sl?ua:Gn)*Fa*da);return Math.log(Math.sqrt(Tu*Tu+1)-Tu)}function wi(sl){return(Math.exp(sl)-Math.exp(-sl))/2}function qi(sl){return(Math.exp(sl)+Math.exp(-sl))/2}function xs(sl){return wi(sl)/qi(sl)}var ps=Ka(0),yl=function(sl){return qi(ps)/qi(ps+Zn*sl)},hl=function(sl){return Gn*((qi(ps)*xs(ps+Zn*sl)-wi(ps))/Fa)/da},xl=(Ka(1)-ps)/Zn;if(Math.abs(da)<1e-6||!isFinite(xl)){if(Math.abs(Gn-ua)<1e-6)return this.easeTo(J,_e);var _l=uaJ.maxDuration&&(J.duration=0),this._zooming=!0,this._rotating=it!==Jt,this._pitching=ir!==Tt,this._padding=!pt.isPaddingEqual(rr),this._prepareEase(_e,!1),this._ease(function(sl){var Tu=sl*xl,Kf=1/yl(Tu);pt.zoom=sl===1?Ht:$e+pt.scaleZoom(Kf),qe._rotating&&(pt.bearing=e.number(it,Jt,sl)),qe._pitching&&(pt.pitch=e.number(Tt,ir,sl)),qe._padding&&(pt.interpolatePadding($t,rr,sl),Gt=pt.centerPoint.add(Zt));var Eh=sl===1?Wr:pt.unproject(hn.add(la.mult(hl(Tu))).mult(Kf));pt.setLocationAtPoint(pt.renderWorldCopies?Eh.wrap():Eh,Gt),qe._fireMoveEvents(_e)},function(){return qe._afterEase(_e)},J),this},q.prototype.isEasing=function(){return!!this._easeFrameId},q.prototype.stop=function(){return this._stop()},q.prototype._stop=function(J,_e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var qe=this._onEaseEnd;delete this._onEaseEnd,qe.call(this,_e)}if(!J){var ft=this.handlers;ft&&ft.stop(!1)}return this},q.prototype._ease=function(J,_e,qe){qe.animate===!1||qe.duration===0?(J(1),_e()):(this._easeStart=e.browser.now(),this._easeOptions=qe,this._onEaseFrame=J,this._onEaseEnd=_e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},q.prototype._renderFrameCallback=function(){var J=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(J)),J<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},q.prototype._normalizeBearing=function(J,_e){J=e.wrap(J,-180,180);var qe=Math.abs(J-_e);return Math.abs(J-360-_e)180?-360:qe<-180?360:0}},q})(e.Evented),ta=function(q){q===void 0&&(q={}),this.options=q,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};ta.prototype.getDefaultPosition=function(){return"bottom-right"},ta.prototype.onAdd=function(q){var he=this.options&&this.options.compact;return this._map=q,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),he&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),he===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},ta.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},ta.prototype._setElementTitle=function(q,he){var J=this._map._getUIString("AttributionControl."+he);q.title=J,q.setAttribute("aria-label",J)},ta.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},ta.prototype._updateEditLink=function(){var q=this._editLink;q||(q=this._editLink=this._container.querySelector(".mapbox-improve-map"));var he=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(q){var J=he.reduce(function(_e,qe,ft){return qe.value&&(_e+=qe.key+"="+qe.value+(ft=0)return!1;return!0});var pt=q.join(" | ");pt!==this._attribHTML&&(this._attribHTML=pt,q.length?(this._innerContainer.innerHTML=pt,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},ta.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var ya=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};ya.prototype.onAdd=function(q){this._map=q,this._container=r.create("div","mapboxgl-ctrl");var he=r.create("a","mapboxgl-ctrl-logo");return he.target="_blank",he.rel="noopener nofollow",he.href="https://www.mapbox.com/",he.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),he.setAttribute("rel","noopener nofollow"),this._container.appendChild(he),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ya.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ya.prototype.getDefaultPosition=function(){return"bottom-left"},ya.prototype._updateLogo=function(q){(!q||q.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},ya.prototype._logoRequired=function(){if(this._map.style){var q=this._map.style.sourceCaches;for(var he in q){var J=q[he].getSource();if(J.mapbox_logo)return!0}return!1}},ya.prototype._updateCompact=function(){var q=this._container.children;if(q.length){var he=q[0];this._map.getCanvasContainer().offsetWidth<250?he.classList.add("mapboxgl-compact"):he.classList.remove("mapboxgl-compact")}};var aa=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};aa.prototype.add=function(q){var he=++this._id,J=this._queue;return J.push({callback:q,id:he,cancelled:!1}),he},aa.prototype.remove=function(q){for(var he=this._currentlyRunning,J=he?this._queue.concat(he):this._queue,_e=0,qe=J;_eJ.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(J.minPitch!=null&&J.maxPitch!=null&&J.minPitch>J.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(J.minPitch!=null&&J.minPitch$a)throw new Error("maxPitch must be less than or equal to "+$a);var qe=new ks(J.minZoom,J.maxZoom,J.minPitch,J.maxPitch,J.renderWorldCopies);if(be.call(this,qe,J),this._interactive=J.interactive,this._maxTileCacheSize=J.maxTileCacheSize,this._failIfMajorPerformanceCaveat=J.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=J.preserveDrawingBuffer,this._antialias=J.antialias,this._trackResize=J.trackResize,this._bearingSnap=J.bearingSnap,this._refreshExpiredTiles=J.refreshExpiredTiles,this._fadeDuration=J.fadeDuration,this._crossSourceCollisions=J.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=J.collectResourceTiming,this._renderTaskQueue=new aa,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},ci,J.locale),this._clickTolerance=J.clickTolerance,this._requestManager=new e.RequestManager(J.transformRequest,J.accessToken),typeof J.container=="string"){if(this._container=e.window.document.getElementById(J.container),!this._container)throw new Error("Container '"+J.container+"' not found.")}else if(J.container instanceof Ri)this._container=J.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(J.maxBounds&&this.setMaxBounds(J.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return _e._update(!1)}),this.on("moveend",function(){return _e._update(!1)}),this.on("zoom",function(){return _e._update(!0)}),typeof e.window<"u"&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new nn(this,J);var ft=typeof J.hash=="string"&&J.hash||void 0;this._hash=J.hash&&new uc(ft).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:J.center,zoom:J.zoom,bearing:J.bearing,pitch:J.pitch}),J.bounds&&(this.resize(),this.fitBounds(J.bounds,e.extend({},J.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=J.localIdeographFontFamily,J.style&&this.setStyle(J.style,{localIdeographFontFamily:J.localIdeographFontFamily}),J.attributionControl&&this.addControl(new ta({customAttribution:J.customAttribution})),this.addControl(new ya,J.logoPosition),this.on("style.load",function(){_e.transform.unmodified&&_e.jumpTo(_e.style.stylesheet)}),this.on("data",function(pt){_e._update(pt.dataType==="style"),_e.fire(new e.Event(pt.dataType+"data",pt))}),this.on("dataloading",function(pt){_e.fire(new e.Event(pt.dataType+"dataloading",pt))})}be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q;var he={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return q.prototype._getMapId=function(){return this._mapId},q.prototype.addControl=function(_e,qe){if(qe===void 0&&(_e.getDefaultPosition?qe=_e.getDefaultPosition():qe="top-right"),!_e||!_e.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var ft=_e.onAdd(this);this._controls.push(_e);var pt=this._controlPositions[qe];return qe.indexOf("bottom")!==-1?pt.insertBefore(ft,pt.firstChild):pt.appendChild(ft),this},q.prototype.removeControl=function(_e){if(!_e||!_e.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var qe=this._controls.indexOf(_e);return qe>-1&&this._controls.splice(qe,1),_e.onRemove(this),this},q.prototype.hasControl=function(_e){return this._controls.indexOf(_e)>-1},q.prototype.resize=function(_e){var qe=this._containerDimensions(),ft=qe[0],pt=qe[1];this._resizeCanvas(ft,pt),this.transform.resize(ft,pt),this.painter.resize(ft,pt);var $e=!this._moving;return $e&&(this.stop(),this.fire(new e.Event("movestart",_e)).fire(new e.Event("move",_e))),this.fire(new e.Event("resize",_e)),$e&&this.fire(new e.Event("moveend",_e)),this},q.prototype.getBounds=function(){return this.transform.getBounds()},q.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},q.prototype.setMaxBounds=function(_e){return this.transform.setMaxBounds(e.LngLatBounds.convert(_e)),this._update()},q.prototype.setMinZoom=function(_e){if(_e=_e??Yn,_e>=Yn&&_e<=this.transform.maxZoom)return this.transform.minZoom=_e,this._update(),this.getZoom()<_e&&this.setZoom(_e),this;throw new Error("minZoom must be between "+Yn+" and the current maxZoom, inclusive")},q.prototype.getMinZoom=function(){return this.transform.minZoom},q.prototype.setMaxZoom=function(_e){if(_e=_e??ii,_e>=this.transform.minZoom)return this.transform.maxZoom=_e,this._update(),this.getZoom()>_e&&this.setZoom(_e),this;throw new Error("maxZoom must be greater than the current minZoom")},q.prototype.getMaxZoom=function(){return this.transform.maxZoom},q.prototype.setMinPitch=function(_e){if(_e=_e??Dn,_e=Dn&&_e<=this.transform.maxPitch)return this.transform.minPitch=_e,this._update(),this.getPitch()<_e&&this.setPitch(_e),this;throw new Error("minPitch must be between "+Dn+" and the current maxPitch, inclusive")},q.prototype.getMinPitch=function(){return this.transform.minPitch},q.prototype.setMaxPitch=function(_e){if(_e=_e??$a,_e>$a)throw new Error("maxPitch must be less than or equal to "+$a);if(_e>=this.transform.minPitch)return this.transform.maxPitch=_e,this._update(),this.getPitch()>_e&&this.setPitch(_e),this;throw new Error("maxPitch must be greater than the current minPitch")},q.prototype.getMaxPitch=function(){return this.transform.maxPitch},q.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},q.prototype.setRenderWorldCopies=function(_e){return this.transform.renderWorldCopies=_e,this._update()},q.prototype.project=function(_e){return this.transform.locationPoint(e.LngLat.convert(_e))},q.prototype.unproject=function(_e){return this.transform.pointLocation(e.Point.convert(_e))},q.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},q.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},q.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},q.prototype._createDelegatedListener=function(_e,qe,ft){var pt=this,$e;if(_e==="mouseenter"||_e==="mouseover"){var it=!1,Tt=function(Bt){var Zt=pt.getLayer(qe)?pt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Zt.length?it||(it=!0,ft.call(pt,new er(_e,pt,Bt.originalEvent,{features:Zt}))):it=!1},$t=function(){it=!1};return{layer:qe,listener:ft,delegates:{mousemove:Tt,mouseout:$t}}}else if(_e==="mouseleave"||_e==="mouseout"){var Ht=!1,Jt=function(Bt){var Zt=pt.getLayer(qe)?pt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Zt.length?Ht=!0:Ht&&(Ht=!1,ft.call(pt,new er(_e,pt,Bt.originalEvent)))},ir=function(Bt){Ht&&(Ht=!1,ft.call(pt,new er(_e,pt,Bt.originalEvent)))};return{layer:qe,listener:ft,delegates:{mousemove:Jt,mouseout:ir}}}else{var rr=function(Bt){var Zt=pt.getLayer(qe)?pt.queryRenderedFeatures(Bt.point,{layers:[qe]}):[];Zt.length&&(Bt.features=Zt,ft.call(pt,Bt),delete Bt.features)};return{layer:qe,listener:ft,delegates:($e={},$e[_e]=rr,$e)}}},q.prototype.on=function(_e,qe,ft){if(ft===void 0)return be.prototype.on.call(this,_e,qe);var pt=this._createDelegatedListener(_e,qe,ft);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[_e]=this._delegatedListeners[_e]||[],this._delegatedListeners[_e].push(pt);for(var $e in pt.delegates)this.on($e,pt.delegates[$e]);return this},q.prototype.once=function(_e,qe,ft){if(ft===void 0)return be.prototype.once.call(this,_e,qe);var pt=this._createDelegatedListener(_e,qe,ft);for(var $e in pt.delegates)this.once($e,pt.delegates[$e]);return this},q.prototype.off=function(_e,qe,ft){var pt=this;if(ft===void 0)return be.prototype.off.call(this,_e,qe);var $e=function(it){for(var Tt=it[_e],$t=0;$t180;){var ft=he.locationPoint(be);if(ft.x>=0&&ft.y>=0&&ft.x<=he.width&&ft.y<=he.height)break;be.lng>he.center.lng?be.lng-=360:be.lng+=360}return be}var qo={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Qo(be,q,he){var J=be.classList;for(var _e in qo)J.remove("mapboxgl-"+he+"-anchor-"+_e);J.add("mapboxgl-"+he+"-anchor-"+q)}var fl=(function(be){function q(he,J){if(be.call(this),(he instanceof e.window.HTMLElement||J)&&(he=e.extend({element:he},J)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=he&&he.anchor||"center",this._color=he&&he.color||"#3FB1CE",this._scale=he&&he.scale||1,this._draggable=he&&he.draggable||!1,this._clickTolerance=he&&he.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=he&&he.rotation||0,this._rotationAlignment=he&&he.rotationAlignment||"auto",this._pitchAlignment=he&&he.pitchAlignment&&he.pitchAlignment!=="auto"?he.pitchAlignment:this._rotationAlignment,!he||!he.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var _e=r.createNS("http://www.w3.org/2000/svg","svg"),qe=41,ft=27;_e.setAttributeNS(null,"display","block"),_e.setAttributeNS(null,"height",qe+"px"),_e.setAttributeNS(null,"width",ft+"px"),_e.setAttributeNS(null,"viewBox","0 0 "+ft+" "+qe);var pt=r.createNS("http://www.w3.org/2000/svg","g");pt.setAttributeNS(null,"stroke","none"),pt.setAttributeNS(null,"stroke-width","1"),pt.setAttributeNS(null,"fill","none"),pt.setAttributeNS(null,"fill-rule","evenodd");var $e=r.createNS("http://www.w3.org/2000/svg","g");$e.setAttributeNS(null,"fill-rule","nonzero");var it=r.createNS("http://www.w3.org/2000/svg","g");it.setAttributeNS(null,"transform","translate(3.0, 29.0)"),it.setAttributeNS(null,"fill","#000000");for(var Tt=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],$t=0,Ht=Tt;$t=_e}this._isDragging&&(this._pos=J.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},q.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.Event("dragend")),this._state="inactive"},q.prototype._addDragHandler=function(J){this._element.contains(J.originalEvent.target)&&(J.preventDefault(),this._positionDelta=J.point.sub(this._pos).add(this._offset),this._pointerdownPos=J.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},q.prototype.setDraggable=function(J){return this._draggable=!!J,this._map&&(J?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},q.prototype.isDraggable=function(){return this._draggable},q.prototype.setRotation=function(J){return this._rotation=J||0,this._update(),this},q.prototype.getRotation=function(){return this._rotation},q.prototype.setRotationAlignment=function(J){return this._rotationAlignment=J||"auto",this._update(),this},q.prototype.getRotationAlignment=function(){return this._rotationAlignment},q.prototype.setPitchAlignment=function(J){return this._pitchAlignment=J&&J!=="auto"?J:this._rotationAlignment,this._update(),this},q.prototype.getPitchAlignment=function(){return this._pitchAlignment},q})(e.Evented),es={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Eu;function el(be){Eu!==void 0?be(Eu):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(q){Eu=q.state!=="denied",be(Eu)}):(Eu=!!e.window.navigator.geolocation,be(Eu))}var gu=0,Fu=!1,Qu=(function(be){function q(he){be.call(this),this.options=e.extend({},es,he),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.onAdd=function(J){return this._map=J,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),el(this._setupUI),this._container},q.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,gu=0,Fu=!1},q.prototype._isOutOfMapMaxBounds=function(J){var _e=this._map.getMaxBounds(),qe=J.coords;return _e&&(qe.longitude<_e.getWest()||qe.longitude>_e.getEast()||qe.latitude<_e.getSouth()||qe.latitude>_e.getNorth())},q.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},q.prototype._onSuccess=function(J){if(this._map){if(this._isOutOfMapMaxBounds(J)){this._setErrorState(),this.fire(new e.Event("outofmaxbounds",J)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=J,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(J),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(J),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",J)),this._finish()}},q.prototype._updateCamera=function(J){var _e=new e.LngLat(J.coords.longitude,J.coords.latitude),qe=J.coords.accuracy,ft=this._map.getBearing(),pt=e.extend({bearing:ft},this.options.fitBoundsOptions);this._map.fitBounds(_e.toBounds(qe),pt,{geolocateSource:!0})},q.prototype._updateMarker=function(J){if(J){var _e=new e.LngLat(J.coords.longitude,J.coords.latitude);this._accuracyCircleMarker.setLngLat(_e).addTo(this._map),this._userLocationDotMarker.setLngLat(_e).addTo(this._map),this._accuracy=J.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},q.prototype._updateCircleRadius=function(){var J=this._map._container.clientHeight/2,_e=this._map.unproject([0,J]),qe=this._map.unproject([1,J]),ft=_e.distanceTo(qe),pt=Math.ceil(2*this._accuracy/ft);this._circleElement.style.width=pt+"px",this._circleElement.style.height=pt+"px"},q.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},q.prototype._onError=function(J){if(this._map){if(this.options.trackUserLocation)if(J.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var _e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=_e,this._geolocateButton.setAttribute("aria-label",_e),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(J.code===3&&Fu)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",J)),this._finish()}},q.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},q.prototype._setupUI=function(J){var _e=this;if(this._container.addEventListener("contextmenu",function(pt){return pt.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",J===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var qe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=qe,this._geolocateButton.setAttribute("aria-label",qe)}else{var ft=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=ft,this._geolocateButton.setAttribute("aria-label",ft)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new fl(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new fl({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(pt){var $e=pt.originalEvent&&pt.originalEvent.type==="resize";!pt.geolocateSource&&_e._watchState==="ACTIVE_LOCK"&&!$e&&(_e._watchState="BACKGROUND",_e._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),_e._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),_e.fire(new e.Event("trackuserlocationend")))})},q.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":gu--,Fu=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),gu++;var J;gu>1?(J={maximumAge:6e5,timeout:0},Fu=!0):(J=this.options.positionOptions,Fu=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,J)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},q.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},q})(e.Evented),_f={maxWidth:100,unit:"metric"},nu=function(q){this.options=e.extend({},_f,q),e.bindAll(["_onMove","setUnit"],this)};nu.prototype.getDefaultPosition=function(){return"bottom-left"},nu.prototype._onMove=function(){du(this._map,this._container,this.options)},nu.prototype.onAdd=function(q){return this._map=q,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",q.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},nu.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},nu.prototype.setUnit=function(q){this.options.unit=q,du(this._map,this._container,this.options)};function du(be,q,he){var J=he&&he.maxWidth||100,_e=be._container.clientHeight/2,qe=be.unproject([0,_e]),ft=be.unproject([J,_e]),pt=qe.distanceTo(ft);if(he&&he.unit==="imperial"){var $e=3.2808*pt;if($e>5280){var it=$e/5280;ho(q,J,it,be._getUIString("ScaleControl.Miles"))}else ho(q,J,$e,be._getUIString("ScaleControl.Feet"))}else if(he&&he.unit==="nautical"){var Tt=pt/1852;ho(q,J,Tt,be._getUIString("ScaleControl.NauticalMiles"))}else pt>=1e3?ho(q,J,pt/1e3,be._getUIString("ScaleControl.Kilometers")):ho(q,J,pt,be._getUIString("ScaleControl.Meters"))}function ho(be,q,he,J){var _e=qs(he),qe=_e/he;be.style.width=q*qe+"px",be.innerHTML=_e+" "+J}function ec(be){var q=Math.pow(10,Math.ceil(-Math.log(be)/Math.LN10));return Math.round(be*q)/q}function qs(be){var q=Math.pow(10,(""+Math.floor(be)).length-1),he=be/q;return he=he>=10?10:he>=5?5:he>=3?3:he>=2?2:he>=1?1:ec(he),q*he}var Fl=function(q){this._fullscreen=!1,q&&q.container&&(q.container instanceof e.window.HTMLElement?this._container=q.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};Fl.prototype.onAdd=function(q){return this._map=q,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Fl.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Fl.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Fl.prototype._setupUI=function(){var q=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",q).setAttribute("aria-hidden",!0),q.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Fl.prototype._updateTitle=function(){var q=this._getTitle();this._fullscreenButton.setAttribute("aria-label",q),this._fullscreenButton.title=q},Fl.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Fl.prototype._isFullscreen=function(){return this._fullscreen},Fl.prototype._changeIcon=function(){var q=e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement;q===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Fl.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var dc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},vc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Co=(function(be){function q(he){be.call(this),this.options=e.extend(Object.create(dc),he),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return be&&(q.__proto__=be),q.prototype=Object.create(be&&be.prototype),q.prototype.constructor=q,q.prototype.addTo=function(J){return this._map&&this.remove(),this._map=J,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},q.prototype.isOpen=function(){return!!this._map},q.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},q.prototype.getLngLat=function(){return this._lngLat},q.prototype.setLngLat=function(J){return this._lngLat=e.LngLat.convert(J),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},q.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},q.prototype.getElement=function(){return this._container},q.prototype.setText=function(J){return this.setDOMContent(e.window.document.createTextNode(J))},q.prototype.setHTML=function(J){var _e=e.window.document.createDocumentFragment(),qe=e.window.document.createElement("body"),ft;for(qe.innerHTML=J;ft=qe.firstChild,!!ft;)_e.appendChild(ft);return this.setDOMContent(_e)},q.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},q.prototype.setMaxWidth=function(J){return this.options.maxWidth=J,this._update(),this},q.prototype.setDOMContent=function(J){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(J),this._createCloseButton(),this._update(),this._focusFirstElement(),this},q.prototype.addClassName=function(J){this._container&&this._container.classList.add(J)},q.prototype.removeClassName=function(J){this._container&&this._container.classList.remove(J)},q.prototype.setOffset=function(J){return this.options.offset=J,this._update(),this},q.prototype.toggleClassName=function(J){if(this._container)return this._container.classList.toggle(J)},q.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},q.prototype._onMouseUp=function(J){this._update(J.point)},q.prototype._onMouseMove=function(J){this._update(J.point)},q.prototype._onDrag=function(J){this._update(J.point)},q.prototype._update=function(J){var _e=this,qe=this._lngLat||this._trackPointer;if(!(!this._map||!qe||!this._content)&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(Jt){return _e._container.classList.add(Jt)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=To(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!J))){var ft=this._pos=this._trackPointer&&J?J:this._map.project(this._lngLat),pt=this.options.anchor,$e=ds(this.options.offset);if(!pt){var it=this._container.offsetWidth,Tt=this._container.offsetHeight,$t;ft.y+$e.bottom.ythis._map.transform.height-Tt?$t=["bottom"]:$t=[],ft.xthis._map.transform.width-it/2&&$t.push("right"),$t.length===0?pt="bottom":pt=$t.join("-")}var Ht=ft.add($e[pt]).round();r.setTransform(this._container,qo[pt]+" translate("+Ht.x+"px,"+Ht.y+"px)"),Qo(this._container,pt,"popup")}},q.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var J=this._container.querySelector(vc);J&&J.focus()}},q.prototype._onClose=function(){this.remove()},q})(e.Evented);function ds(be){if(be)if(typeof be=="number"){var q=Math.round(Math.sqrt(.5*Math.pow(be,2)));return{center:new e.Point(0,0),top:new e.Point(0,be),"top-left":new e.Point(q,q),"top-right":new e.Point(-q,q),bottom:new e.Point(0,-be),"bottom-left":new e.Point(q,-q),"bottom-right":new e.Point(-q,-q),left:new e.Point(be,0),right:new e.Point(-be,0)}}else if(be instanceof e.Point||Array.isArray(be)){var he=e.Point.convert(be);return{center:he,top:he,"top-left":he,"top-right":he,bottom:he,"bottom-left":he,"bottom-right":he,left:he,right:he}}else return{center:e.Point.convert(be.center||[0,0]),top:e.Point.convert(be.top||[0,0]),"top-left":e.Point.convert(be["top-left"]||[0,0]),"top-right":e.Point.convert(be["top-right"]||[0,0]),bottom:e.Point.convert(be.bottom||[0,0]),"bottom-left":e.Point.convert(be["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(be["bottom-right"]||[0,0]),left:e.Point.convert(be.left||[0,0]),right:e.Point.convert(be.right||[0,0])};else return ds(new e.Point(0,0))}var _s={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:zi,NavigationControl:ji,GeolocateControl:Qu,AttributionControl:ta,ScaleControl:nu,FullscreenControl:Fl,Popup:Co,Marker:fl,Style:Zu,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Si,clearPrewarmedResources:Dt,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(be){e.config.ACCESS_TOKEN=be},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(be){e.config.API_URL=be},get workerCount(){return _a.workerCount},set workerCount(be){_a.workerCount=be},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(be){e.config.MAX_PARALLEL_IMAGE_REQUESTS=be},clearStorage:function(q){e.clearTileCache(q)},workerUrl:""};return _s}),S})}}),i7=Ge({"src/plots/mapbox/layers.js"(K,G){var h=_n(),b=nc().sanitizeHTML,S=TL(),E=Wy();function e(i,a){this.subplot=i,this.uid=i.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(a){this.visible?this.needsNewImage(a)?this.updateImage(a):this.needsNewSource(a)?(this.removeLayer(),this.updateSource(a),this.updateLayer(a)):this.needsNewLayer(a)?this.updateLayer(a):this.updateStyle(a):(this.updateSource(a),this.updateLayer(a)),this.visible=r(a)},t.needsNewImage=function(i){var a=this.subplot.map;return a.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var a=this.subplot.map;a.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var a=this.subplot.map;if(a.getSource(this.idSource)&&a.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=n(i);a.addSource(this.idSource,s)}},t.findFollowingMapboxLayerId=function(i){if(i==="traces")for(var a=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var a={},s={};switch(i.type){case"circle":h.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":h.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":h.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var f=i.symbol,c=S(f.textposition,f.iconsize);h.extendFlat(a,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":f.placement}),h.extendFlat(s,{"icon-color":i.color,"text-color":f.textfont.color,"text-opacity":i.opacity});break;case"raster":h.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:a,paint:s}}function n(i){var a=i.sourcetype,s=i.source,f={type:a},c;return a==="geojson"?c="data":a==="vector"?c=typeof s=="string"?"url":"tiles":a==="raster"?(c="tiles",f.tileSize=256):a==="image"&&(c="url",f.coordinates=i.coordinates),f[c]=s,i.sourceattribution&&(f.attribution=b(i.sourceattribution)),f}G.exports=function(a,s,f){var c=new e(a,s);return c.update(f),c}}}),o7=Ge({"src/plots/mapbox/mapbox.js"(K,G){var h=AL(),b=_n(),S=F_(),E=Ro(),e=Ts(),t=uv(),r=Yf(),o=jp(),n=o.drawMode,i=o.selectMode,a=Qf().prepSelect,s=Qf().clearOutline,f=Qf().clearSelectionsCache,c=Qf().selectOnClick,p=Wy(),v=i7();function T(_,w){this.id=w,this.gd=_;var m=_._fullLayout,u=_._context;this.container=m._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=m._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(m),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(_,w,m){var u=this,d=w[u.id];u.map&&d.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var y;u.map?y=new Promise(function(I,L){u.updateMap(_,w,I,L)}):y=new Promise(function(I,L){u.createMap(_,w,I,L)}),m.push(y)},l.createMap=function(_,w,m,u){var d=this,y=w[d.id],I=d.styleObj=x(y.style,w);d.accessToken=y.accesstoken;var L=y.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=d.map=new h.Map({container:d.div,style:I.style,center:M(y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch,maxBounds:z,interactive:!d.isStatic,preserveDrawingBuffer:d.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new h.AttributionControl({compact:!0}));F._canvas.style.left="0px",F._canvas.style.top="0px",d.rejectOnError(u),d.isStatic||d.initFx(_,w);var N=[];N.push(new Promise(function(B){F.once("load",B)})),N=N.concat(S.fetchTraceGeoData(_)),Promise.all(N).then(function(){d.fillBelowLookup(_,w),d.updateData(_),d.updateLayout(w),d.resolveOnRender(m)}).catch(u)},l.updateMap=function(_,w,m,u){var d=this,y=d.map,I=w[this.id];d.rejectOnError(u);var L=[],z=x(I.style,w);JSON.stringify(d.styleObj)!==JSON.stringify(z)&&(d.styleObj=z,y.setStyle(z.style),d.traceHash={},L.push(new Promise(function(F){y.once("styledata",F)}))),L=L.concat(S.fetchTraceGeoData(_)),Promise.all(L).then(function(){d.fillBelowLookup(_,w),d.updateData(_),d.updateLayout(w),d.resolveOnRender(m)}).catch(u)},l.fillBelowLookup=function(_,w){var m=w[this.id],u=m.layers,d,y,I=this.belowLookup={},L=!1;for(d=0;d<_.length;d++){var z=_[d][0].trace,F=z._module;typeof z.below=="string"?y=z.below:F.getBelow&&(y=F.getBelow(z,this)),y===""&&(L=!0),I["trace-"+z.uid]=y||""}for(d=0;d1)for(d=0;d-1&&c(z.originalEvent,u,[m.xaxis],[m.yaxis],m.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,m=w.map,u=w.gd;if(w.isStatic)return;function d(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var y=_.dragmode,I;I=function(z,F){if(F.isRect){var N=z.range={};N[w.id]=[d([F.xmin,F.ymin]),d([F.xmax,F.ymax])]}else{var B=z.lassoPoints={};B[w.id]=F.map(d)}};var L=w.dragOptions;w.dragOptions=b.extendDeep(L||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:I},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),m.off("click",w.onClickInPanHandler),i(y)||n(y)?(m.dragPan.disable(),m.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,N){a(z,F,N,w.dragOptions,y)},t.init(w.dragOptions)):(m.dragPan.enable(),m.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),m.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,m=_._size,u=this.div.style;u.width=m.w*(w.x[1]-w.x[0])+"px",u.height=m.h*(w.y[1]-w.y[0])+"px",u.left=m.l+w.x[0]*m.w+"px",u.top=m.t+(1-w.y[1])*m.h+"px",this.xaxis._offset=m.l+w.x[0]*m.w,this.xaxis._length=m.w*(w.x[1]-w.x[0]),this.yaxis._offset=m.t+(1-w.y[1])*m.h,this.yaxis._length=m.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],m=w.layers,u=this.layerList,d;if(m.length!==u.length){for(d=0;dN/2){var B=I.split("|").join("
");z.text(B).attr("data-unformatted",B).call(o.convertToTspans,v),F=r.bBox(z.node())}z.attr("transform",b(-3,-F.height+8)),L.insert("rect",".static-attribution").attr({x:-F.width-6,y:-F.height-3,width:F.width+6,height:F.height+3,fill:"rgba(255, 255, 255, 0.75)"});var R=1;F.width+6>N&&(R=N/(F.width+6));var U=[g.l+g.w*M.x[1],g.t+g.h*(1-M.y[0])];L.attr("transform",b(U[0],U[1])+S(R))}};function c(v,T){var l=v._fullLayout,g=v._context;if(g.mapboxAccessToken==="")return"";for(var x=[],A=[],M=!1,_=!1,w=0;w1&&h.warn(a.multipleTokensErrorMsg),x[0]):(A.length&&h.log(["Listed mapbox access token(s)",A.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function p(v){return typeof v=="string"&&(a.styleValuesMapbox.indexOf(v)!==-1||v.indexOf("mapbox://")===0||v.indexOf("stamen")===0)}K.updateFx=function(v){for(var T=v._fullLayout,l=T._subplots[i],g=0;g=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var n=o[0].trace,i=new E(r,n.uid),a=i.sourceId,s=h(o),f=i.below=r.belowLookup["trace-"+n.uid];return r.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,f),o[0].trace._glTrace=i,i}}}),h7=Ge({"src/traces/choroplethmapbox/index.js"(K,G){G.exports={attributes:SL(),supplyDefaults:c7(),colorbar:Sm(),calc:RE(),plot:f7(),hoverPoints:DE(),eventData:zE(),selectPoints:OE(),styleOnSelect:function(h,b){if(b){var S=b[0].trace;S._glTrace.updateOnSelect(b)}},getBelow:function(h,b){for(var S=b.getMapLayers(),E=S.length-2;E>=0;E--){var e=S[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+v[c]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:A})}}var _=E.extractOpts(n),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,m=w[0][1],u=S.opacity(m)<1?m:S.addOpacity(m,0),d=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,n=new S(t,o.uid),i=n.sourceId,a=h(r),s=n.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:a.geojson}),n._addLayers(a,s),n}}}),y7=Ge({"src/traces/densitymapbox/hover.js"(K,G){var h=Ts(),b=WE().hoverPoints,S=WE().getExtraText;G.exports=function(e,t,r){var o=b(e,t,r);if(o){var n=o[0],i=n.cd,a=i[0].trace,s=i[n.index];if(delete n.color,"z"in s){var f=n.subplot.mockAxis;n.z=s.z,n.zLabel=h.tickText(f,f.c2l(s.z),"hover").text}return n.extraText=S(a,s,i[0].t.labels),[n]}}}}),_7=Ge({"src/traces/densitymapbox/event_data.js"(K,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b.z=S.z,b}}}),x7=Ge({"src/traces/densitymapbox/index.js"(K,G){G.exports={attributes:EL(),supplyDefaults:v7(),colorbar:Sm(),formatLabels:wL(),calc:p7(),plot:g7(),hoverPoints:y7(),eventData:_7(),getBelow:function(h,b){for(var S=b.getMapLayers(),E=0;EESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} {name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} @@ -3216,10 +3216,10 @@ uniform `+bt+" "+Zt+" u_"+Vt+`; {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),JD=Ge({"src/plots/map/styles/arcgis-sat.js"($,G){G.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),F_=Ge({"src/plots/map/constants.js"($,G){var h=Cp(),b=$D(),S=JD(),E='© OpenStreetMap contributors',e="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",t="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",n="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",a={basic:r,streets:r,outdoors:r,light:e,dark:t,satellite:S,"satellite-streets":b,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:E,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":e,"carto-darkmatter":t,"carto-voyager":r,"carto-positron-nolabels":o,"carto-darkmatter-nolabels":n,"carto-voyager-nolabels":i},s=h(a);G.exports={styleValueDflt:"basic",stylesMap:a,styleValuesMap:s,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",s.join(", "),"or use a tile service."].join(` -`),mapOnErrorMsg:"Map error."}}}),rS=Ge({"src/plots/map/layout_attributes.js"($,G){var h=yn(),b=So().defaultLine,S=Sc().attributes,E=Fs(),e=jc().textposition,t=Uc().overrideAll,r=mu().templatedArray,o=F_(),n=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[h.counterRegex("map",".layers",!0)],domain:S({name:"map"}),style:{valType:"any",values:o.styleValuesMap,dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:b},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:b}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:h.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),IE=Ge({"src/traces/scattermap/attributes.js"($,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=ad(),e=Xb(),t=jc(),r=rS(),o=nu(),n=Ru(),i=Qi().extendFlat,a=Uc().overrideAll,s=rS(),f=e.line,c=e.marker;G.exports=a({lon:e.lon,lat:e.lat,cluster:{enabled:{valType:"boolean"},maxzoom:i({},s.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:i({},c.opacity,{dflt:1})},mode:i({},t.mode,{dflt:"markers"}),text:i({},t.text,{}),texttemplate:b({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:i({},t.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:t.connectgaps,marker:i({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},n("marker")),fill:e.fill,fillcolor:E(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:i({},o.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:h(),hovertemplatefallback:S()},"calc","nested")}}),XC=Ge({"src/traces/scattermap/constants.js"($,G){var h=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];G.exports={isSupportedFont:function(b){return h.indexOf(b)!==-1}}}}),QD=Ge({"src/traces/scattermap/defaults.js"($,G){var h=yn(),b=ou(),S=Gv(),E=Fp(),e=ep(),t=Dv(),r=IE(),o=XC().isSupportedFont;G.exports=function(a,s,f,c){function p(v,y){return h.coerce(a,s,r,v,y)}function d(v,y){return h.coerce2(a,s,r,v,y)}var T=n(a,s,p);if(!T){s.visible=!1;return}if(p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback"),p("mode"),p("below"),b.hasMarkers(s)){S(a,s,f,c,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var l=s.marker;l.symbol!=="circle"&&(h.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),h.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}b.hasLines(s)&&(E(a,s,f,c,p,{noDash:!0}),p("connectgaps"));var g=d("cluster.maxzoom"),x=d("cluster.step"),A=d("cluster.color",s.marker&&s.marker.color||f),M=d("cluster.size"),_=d("cluster.opacity"),w=g!==!1||x!==!1||A!==!1||M!==!1||_!==!1,m=p("cluster.enabled",w);if(m||b.hasText(s)){var u=c.font.family;e(a,s,c,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:c.font.weight,style:c.font.style,size:c.font.size,color:c.font.color}})}p("fill"),s.fill!=="none"&&t(a,s,f,p),h.coerceSelectionMarkerOpacity(s,p)};function n(i,a,s){var f=s("lon")||[],c=s("lat")||[],p=Math.min(f.length,c.length);return a._length=p,p}}}),YC=Ge({"src/traces/scattermap/format_labels.js"($,G){var h=Ss();G.exports=function(S,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,n=S.lonlat;return t.lonLabel=h.tickText(o,o.c2l(n[0]),!0).text,t.latLabel=h.tickText(o,o.c2l(n[1]),!0).text,t}}}),ZC=Ge({"src/plots/map/convert_text_opts.js"($,G){var h=yn();G.exports=function(S,E){var e=S.split(" "),t=e[0],r=e[1],o=h.isArrayOrTypedArray(E)?h.mean(E):E,n=.5+o/100,i=1.5+o/100,a=["",""],s=[0,0];switch(t){case"top":a[0]="top",s[1]=-i;break;case"bottom":a[0]="bottom",s[1]=i;break}switch(r){case"left":a[1]="right",s[0]=-n;break;case"right":a[1]="left",s[0]=n;break}var f;return a[0]&&a[1]?f=a.join("-"):a[0]?f=a[0]:a[1]?f=a[1]:f="center",{anchor:f,offset:s}}}}),ez=Ge({"src/traces/scattermap/convert.js"($,G){var h=Ga(),b=yn(),S=hi().BADNUM,E=R_(),e=Ac(),t=Ms(),r=Pp(),o=ou(),n=XC().isSupportedFont,i=ZC(),a=Hv().appendArrayPointValue,s=ec().NEWLINES,f=ec().BR_TAG_ALL;G.exports=function(_,w){var m=w[0].trace,u=m.visible===!0&&m._length!==0,v=m.fill!=="none",y=o.hasLines(m),I=o.hasMarkers(m),L=o.hasText(m),z=I&&m.marker.symbol==="circle",F=I&&m.marker.symbol!=="circle",N=m.cluster&&m.cluster.enabled,B=c("fill"),R=c("line"),U=c("circle"),j=c("symbol"),Z={fill:B,line:R,circle:U,symbol:j};if(!u)return Z;var re;if((v||y)&&(re=E.calcTraceToLineCoords(w)),v&&(B.geojson=E.makePolygon(re),B.layout.visibility="visible",b.extendFlat(B.paint,{"fill-color":m.fillcolor})),y&&(R.geojson=E.makeLine(re),R.layout.visibility="visible",b.extendFlat(R.paint,{"line-width":m.line.width,"line-color":m.line.color,"line-opacity":m.opacity})),z){var fe=p(w);U.geojson=fe.geojson,U.layout.visibility="visible",N&&(U.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(m.cluster.color,m.cluster.step),"circle-radius":x(m.cluster.size,m.cluster.step),"circle-opacity":x(m.cluster.opacity,m.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":A(m),"text-size":12}}),b.extendFlat(U.paint,{"circle-color":fe.mcc,"circle-radius":fe.mrc,"circle-opacity":fe.mo})}if(z&&N&&(U.filter=["!",["has","point_count"]]),(F||L)&&(j.geojson=d(w,_),b.extendFlat(j.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(b.extendFlat(j.layout,{"icon-size":m.marker.size/10}),"angle"in m.marker&&m.marker.angle!=="auto"&&b.extendFlat(j.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),j.layout["icon-allow-overlap"]=m.marker.allowoverlap,b.extendFlat(j.paint,{"icon-opacity":m.opacity*m.marker.opacity,"icon-color":m.marker.color})),L)){var le=(m.marker||{}).size,ce=i(m.textposition,le);b.extendFlat(j.layout,{"text-size":m.textfont.size,"text-anchor":ce.anchor,"text-offset":ce.offset,"text-font":A(m)}),b.extendFlat(j.paint,{"text-color":m.textfont.color,"text-opacity":m.opacity})}return Z};function c(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function p(M){var _=M[0].trace,w=_.marker,m=_.selectedpoints,u=b.isArrayOrTypedArray(w.color),v=b.isArrayOrTypedArray(w.size),y=b.isArrayOrTypedArray(w.opacity),I;function L(le){return _.opacity*le}function z(le){return le/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=b.identity);var N;v&&(N=r(_));var B;y&&(B=function(le){var ce=h(le)?+b.constrain(le,0,1):0;return L(ce)});var R=[];for(I=0;I850?I+=" Black":u>750?I+=" Extra Bold":u>650?I+=" Bold":u>550?I+=" Semi Bold":u>450?I+=" Medium":u>350?I+=" Regular":u>250?I+=" Light":u>150?I+=" Extra Light":I+=" Thin"):v.slice(0,2).join(" ")==="Open Sans"?(I="Open Sans",u>750?I+=" Extrabold":u>650?I+=" Bold":u>550?I+=" Semibold":u>350?I+=" Regular":I+=" Light"):v.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(I="Klokantech Noto Sans",v[3]==="CJK"&&(I+=" CJK"),I+=u>500?" Bold":" Regular")),y&&(I+=" Italic"),I==="Open Sans Regular Italic"?I="Open Sans Italic":I==="Open Sans Regular Bold"?I="Open Sans Bold":I==="Open Sans Regular Bold Italic"?I="Open Sans Bold Italic":I==="Klokantech Noto Sans Regular Italic"&&(I="Klokantech Noto Sans Italic"),n(I)||(I=w);var L=I.split(", ");return L}}}),tz=Ge({"src/traces/scattermap/plot.js"($,G){var h=yn(),b=ez(),S=F_().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,n,i){this.type="scattermap",this.subplot=r,this.uid=o,this.clusterEnabled=n,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:S+o+"-fill",line:S+o+"-line",circle:S+o+"-circle",symbol:S+o+"-symbol",cluster:S+o+"-cluster",clusterCount:S+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,n){var i={type:"geojson",data:o.geojson};n&&n.enabled&&h.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[r]);a?a.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,n){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var a=this.layerIds[r],s,f=this.subplot.getMapLayers(),c=0;c=0;y--){var I=v[y];a.removeLayer(d.layerIds[I])}u||a.removeSource(d.sourceIds.circle)}function g(u){for(var v=E.nonCluster,y=0;y=0;y--){var I=v[y];a.removeLayer(d.layerIds[I]),u||a.removeSource(d.sourceIds[I])}}function A(u){p?l(u):x(u)}function M(u){c?T(u):g(u)}function _(){for(var u=c?E.cluster:E.nonCluster,v=0;v=0;i--){var a=n[i];o.removeLayer(this.layerIds[a]),o.removeSource(this.sourceIds[a])}},G.exports=function(o,n){var i=n[0].trace,a=i.cluster&&i.cluster.enabled,s=i.visible!==!0,f=new e(o,i.uid,a,s),c=b(o.gd,n),p=f.below=o.belowLookup["trace-"+i.uid],d,T,l;if(a)for(f.addSource("circle",c.circle,i.cluster),d=0;d=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=A*360,_=i-M;function w(N){var B=N.lonlat;if(B[0]===e||g&&T.indexOf(N.i+1)===-1)return 1/0;var R=b.modHalf(B[0],360),U=B[1],j=d.project([R,U]),Z=j.x-c.c2p([_,U]),re=j.y-p.c2p([R,a]),fe=Math.max(3,N.mrc||0);return Math.max(Math.sqrt(Z*Z+re*re)-fe,1-3/fe)}if(h.getClosest(s,w,n),n.index!==!1){var m=s[n.index],u=m.lonlat,v=[b.modHalf(u[0],360)+M,u[1]],y=c.c2p(v),I=p.c2p(v),L=m.mrc||1;n.x0=y-L,n.x1=y+L,n.y0=I-L,n.y1=I+L;var z={};z[f.subplot]={_subplot:d};var F=f._module.formatLabels(m,f,z);return n.lonLabel=F.lonLabel,n.latLabel=F.latLabel,n.color=S(f,m),n.extraText=o(f,m,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function o(n,i,a){if(n.hovertemplate)return;var s=i.hi||n.hoverinfo,f=s.split("+"),c=f.indexOf("all")!==-1,p=f.indexOf("lon")!==-1,d=f.indexOf("lat")!==-1,T=i.lonlat,l=[];function g(x){return x+"°"}return c||p&&d?l.push("("+g(T[1])+", "+g(T[0])+")"):p?l.push(a.lon+g(T[0])):d&&l.push(a.lat+g(T[1])),(c||f.indexOf("text")!==-1)&&E(i,n,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),rz=Ge({"src/traces/scattermap/event_data.js"($,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b}}}),nz=Ge({"src/traces/scattermap/select.js"($,G){var h=yn(),b=ou(),S=hi().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,n=e.yaxis,i=[],a=r[0].trace,s;if(!b.hasMarkers(a))return[];if(t===!1)for(s=0;s1)return 1;for(var Q=Y,me=0;me<8;me++){var Pe=this.sampleCurveX(Q)-Y;if(Math.abs(Pe)Pe?We=Q:pt=Q,Q=.5*(pt-We)+We;return Q},solve:function(Y,D){return this.sampleCurveY(this.solveCurveX(Y,D))}};var f=r(a);let c,p;function d(){return c==null&&(c=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),c}function T(){if(p==null&&(p=!1,d())){const D=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(D){for(let me=0;me<25;me++){const Pe=4*me;D.fillStyle=`rgb(${Pe},${Pe+1},${Pe+2})`,D.fillRect(me%5,Math.floor(me/5),1,1)}const Q=D.getImageData(0,0,5,5).data;for(let me=0;me<100;me++)if(me%4!=3&&Q[me]!==me){p=!0;break}}}return p||!1}function l(Y,D,Q,me){const Pe=new f(Y,D,Q,me);return Ve=>Pe.solve(Ve)}const g=l(.25,.1,.25,1);function x(Y,D,Q){return Math.min(Q,Math.max(D,Y))}function A(Y,D,Q){const me=Q-D,Pe=((Y-D)%me+me)%me+D;return Pe===D?Q:Pe}function M(Y,...D){for(const Q of D)for(const me in Q)Y[me]=Q[me];return Y}let _=1;function w(Y,D,Q){const me={};for(const Pe in Y)me[Pe]=D.call(this,Y[Pe],Pe,Y);return me}function m(Y,D,Q){const me={};for(const Pe in Y)D.call(this,Y[Pe],Pe,Y)&&(me[Pe]=Y[Pe]);return me}function u(Y){return Array.isArray(Y)?Y.map(u):typeof Y=="object"&&Y?w(Y,u):Y}const v={};function y(Y){v[Y]||(typeof console<"u"&&console.warn(Y),v[Y]=!0)}function I(Y,D,Q){return(Q.y-Y.y)*(D.x-Y.x)>(D.y-Y.y)*(Q.x-Y.x)}function L(Y){return typeof WorkerGlobalScope<"u"&&Y!==void 0&&Y instanceof WorkerGlobalScope}let z=null;function F(Y){return typeof ImageBitmap<"u"&&Y instanceof ImageBitmap}const N="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function B(Y,D,Q,me,Pe){return t(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const Ve=new VideoFrame(Y,{timestamp:0});try{const We=Ve?.format;if(!We||!We.startsWith("BGR")&&!We.startsWith("RGB"))throw new Error(`Unrecognized format ${We}`);const pt=We.startsWith("BGR"),Rt=new Uint8ClampedArray(me*Pe*4);if(yield Ve.copyTo(Rt,(function(Yt,dr,xr,qr,Jr){const vn=4*Math.max(-dr,0),Tn=(Math.max(0,xr)-xr)*qr*4+vn,Bn=4*qr,da=Math.max(0,dr),ui=Math.max(0,xr);return{rect:{x:da,y:ui,width:Math.min(Yt.width,dr+qr)-da,height:Math.min(Yt.height,xr+Jr)-ui},layout:[{offset:Tn,stride:Bn}]}})(Y,D,Q,me,Pe)),pt)for(let Yt=0;YtL(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,ee=function(Y,D){if(/:\/\//.test(Y.url)&&!/^https?:|^file:/.test(Y.url)){const me=fe(Y.url);if(me)return me(Y,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Y,targetMapId:le},D)}if(!(/^file:/.test(Q=Y.url)||/^file:/.test(V())&&!/^\w+:/.test(Q))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(me,Pe){return t(this,void 0,void 0,function*(){const Ve=new Request(me.url,{method:me.method||"GET",body:me.body,credentials:me.credentials,headers:me.headers,cache:me.cache,referrer:V(),signal:Pe.signal});me.type!=="json"||Ve.headers.has("Accept")||Ve.headers.set("Accept","application/json");const We=yield fetch(Ve);if(!We.ok){const Yt=yield We.blob();throw new ce(We.status,We.statusText,me.url,Yt)}let pt;pt=me.type==="arrayBuffer"||me.type==="image"?We.arrayBuffer():me.type==="json"?We.json():We.text();const Rt=yield pt;if(Pe.signal.aborted)throw Z();return{data:Rt,cacheControl:We.headers.get("Cache-Control"),expires:We.headers.get("Expires")}})})(Y,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Y,mustQueue:!0,targetMapId:le},D)}var Q;return(function(me,Pe){return new Promise((Ve,We)=>{var pt;const Rt=new XMLHttpRequest;Rt.open(me.method||"GET",me.url,!0),me.type!=="arrayBuffer"&&me.type!=="image"||(Rt.responseType="arraybuffer");for(const Yt in me.headers)Rt.setRequestHeader(Yt,me.headers[Yt]);me.type==="json"&&(Rt.responseType="text",!((pt=me.headers)===null||pt===void 0)&&pt.Accept||Rt.setRequestHeader("Accept","application/json")),Rt.withCredentials=me.credentials==="include",Rt.onerror=()=>{We(new Error(Rt.statusText))},Rt.onload=()=>{if(!Pe.signal.aborted)if((Rt.status>=200&&Rt.status<300||Rt.status===0)&&Rt.response!==null){let Yt=Rt.response;if(me.type==="json")try{Yt=JSON.parse(Rt.response)}catch(dr){return void We(dr)}Ve({data:Yt,cacheControl:Rt.getResponseHeader("Cache-Control"),expires:Rt.getResponseHeader("Expires")})}else{const Yt=new Blob([Rt.response],{type:Rt.getResponseHeader("Content-Type")});We(new ce(Rt.status,Rt.statusText,me.url,Yt))}},Pe.signal.addEventListener("abort",()=>{Rt.abort(),We(Z())}),Rt.send(me.body)})})(Y,D)};function ne(Y){if(!Y||Y.indexOf("://")<=0||Y.indexOf("data:image/")===0||Y.indexOf("blob:")===0)return!0;const D=new URL(Y),Q=window.location;return D.protocol===Q.protocol&&D.host===Q.host}function K(Y,D,Q){Q[Y]&&Q[Y].indexOf(D)!==-1||(Q[Y]=Q[Y]||[],Q[Y].push(D))}function ue(Y,D,Q){if(Q&&Q[Y]){const me=Q[Y].indexOf(D);me!==-1&&Q[Y].splice(me,1)}}class te{constructor(D,Q={}){M(this,Q),this.type=D}}class H extends te{constructor(D,Q={}){super("error",M({error:D},Q))}}class ae{on(D,Q){return this._listeners=this._listeners||{},K(D,Q,this._listeners),this}off(D,Q){return ue(D,Q,this._listeners),ue(D,Q,this._oneTimeListeners),this}once(D,Q){return Q?(this._oneTimeListeners=this._oneTimeListeners||{},K(D,Q,this._oneTimeListeners),this):new Promise(me=>this.once(D,me))}fire(D,Q){typeof D=="string"&&(D=new te(D,Q||{}));const me=D.type;if(this.listens(me)){D.target=this;const Pe=this._listeners&&this._listeners[me]?this._listeners[me].slice():[];for(const pt of Pe)pt.call(this,D);const Ve=this._oneTimeListeners&&this._oneTimeListeners[me]?this._oneTimeListeners[me].slice():[];for(const pt of Ve)ue(me,pt,this._oneTimeListeners),pt.call(this,D);const We=this._eventedParent;We&&(M(D,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),We.fire(D))}else D instanceof H&&console.error(D.error);return this}listens(D){return this._listeners&&this._listeners[D]&&this._listeners[D].length>0||this._oneTimeListeners&&this._oneTimeListeners[D]&&this._oneTimeListeners[D].length>0||this._eventedParent&&this._eventedParent.listens(D)}setEventedParent(D,Q){return this._eventedParent=D,this._eventedParentData=Q,this}}var ie={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const ve=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ae(Y,D){const Q={};for(const me in Y)me!=="ref"&&(Q[me]=Y[me]);return ve.forEach(me=>{me in D&&(Q[me]=D[me])}),Q}function Ce(Y,D){if(Array.isArray(Y)){if(!Array.isArray(D)||Y.length!==D.length)return!1;for(let Q=0;Q`:Y.itemType.kind==="value"?"array":`array<${D}>`}return Y.kind}const Ee=[ft,rt,Ft,Nt,$t,Wr,rr,je(Er),Sr,Br,Mt];function xe(Y,D){if(D.kind==="error")return null;if(Y.kind==="array"){if(D.kind==="array"&&(D.N===0&&D.itemType.kind==="value"||!xe(Y.itemType,D.itemType))&&(typeof Y.N!="number"||Y.N===D.N))return null}else{if(Y.kind===D.kind)return null;if(Y.kind==="value"){for(const Q of Ee)if(!xe(Q,D))return null}}return`Expected ${$e(Y)} but found ${$e(D)} instead.`}function ye(Y,D){return D.some(Q=>Q.kind===Y.kind)}function Me(Y,D){return D.some(Q=>Q==="null"?Y===null:Q==="array"?Array.isArray(Y):Q==="object"?Y&&!Array.isArray(Y)&&typeof Y=="object":Q===typeof Y)}function Xe(Y,D){return Y.kind==="array"&&D.kind==="array"?Y.itemType.kind===D.itemType.kind&&typeof Y.N=="number":Y.kind===D.kind}const Je=.96422,Lt=.82521,Ct=4/29,Ot=6/29,Wt=3*Ot*Ot,_r=Ot*Ot*Ot,pr=Math.PI/180,hr=180/Math.PI;function Fr(Y){return(Y%=360)<0&&(Y+=360),Y}function En([Y,D,Q,me]){let Pe,Ve;const We=qn((.2225045*(Y=Kn(Y))+.7168786*(D=Kn(D))+.0606169*(Q=Kn(Q)))/1);Y===D&&D===Q?Pe=Ve=We:(Pe=qn((.4360747*Y+.3850649*D+.1430804*Q)/Je),Ve=qn((.0139322*Y+.0971045*D+.7141733*Q)/Lt));const pt=116*We-16;return[pt<0?0:pt,500*(Pe-We),200*(We-Ve),me]}function Kn(Y){return Y<=.04045?Y/12.92:Math.pow((Y+.055)/1.055,2.4)}function qn(Y){return Y>_r?Math.pow(Y,1/3):Y/Wt+Ct}function ta([Y,D,Q,me]){let Pe=(Y+16)/116,Ve=isNaN(D)?Pe:Pe+D/500,We=isNaN(Q)?Pe:Pe-Q/200;return Pe=1*Nn(Pe),Ve=Je*Nn(Ve),We=Lt*Nn(We),[ra(3.1338561*Ve-1.6168667*Pe-.4906146*We),ra(-.9787684*Ve+1.9161415*Pe+.033454*We),ra(.0719453*Ve-.2289914*Pe+1.4052427*We),me]}function ra(Y){return(Y=Y<=.00304?12.92*Y:1.055*Math.pow(Y,1/2.4)-.055)<0?0:Y>1?1:Y}function Nn(Y){return Y>Ot?Y*Y*Y:Wt*(Y-Ct)}function ka(Y){return parseInt(Y.padEnd(2,Y),16)/255}function qa(Y,D){return ir(D?Y/100:Y,0,1)}function ir(Y,D,Q){return Math.min(Math.max(D,Y),Q)}function qt(Y){return!Y.some(Number.isNaN)}const ar={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]};class lr{constructor(D,Q,me,Pe=1,Ve=!0){this.r=D,this.g=Q,this.b=me,this.a=Pe,Ve||(this.r*=Pe,this.g*=Pe,this.b*=Pe,Pe||this.overwriteGetter("rgb",[D,Q,me,Pe]))}static parse(D){if(D instanceof lr)return D;if(typeof D!="string")return;const Q=(function(me){if((me=me.toLowerCase().trim())==="transparent")return[0,0,0,0];const Pe=ar[me];if(Pe){const[We,pt,Rt]=Pe;return[We/255,pt/255,Rt/255,1]}if(me.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(me)){const We=me.length<6?1:2;let pt=1;return[ka(me.slice(pt,pt+=We)),ka(me.slice(pt,pt+=We)),ka(me.slice(pt,pt+=We)),ka(me.slice(pt,pt+We)||"ff")]}if(me.startsWith("rgb")){const We=me.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(We){const[pt,Rt,Yt,dr,xr,qr,Jr,vn,Tn,Bn,da,ui]=We,Ba=[dr||" ",Jr||" ",Bn].join("");if(Ba===" "||Ba===" /"||Ba===",,"||Ba===",,,"){const ti=[Yt,qr,Tn].join(""),Fi=ti==="%%%"?100:ti===""?255:0;if(Fi){const ho=[ir(+Rt/Fi,0,1),ir(+xr/Fi,0,1),ir(+vn/Fi,0,1),da?qa(+da,ui):1];if(qt(ho))return ho}}return}}const Ve=me.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Ve){const[We,pt,Rt,Yt,dr,xr,qr,Jr,vn]=Ve,Tn=[Rt||" ",dr||" ",qr].join("");if(Tn===" "||Tn===" /"||Tn===",,"||Tn===",,,"){const Bn=[+pt,ir(+Yt,0,100),ir(+xr,0,100),Jr?qa(+Jr,vn):1];if(qt(Bn))return(function([da,ui,Ba,ti]){function Fi(ho){const Jo=(ho+da/30)%12,hl=ui*Math.min(Ba,1-Ba);return Ba-hl*Math.max(-1,Math.min(Jo-3,9-Jo,1))}return da=Fr(da),ui/=100,Ba/=100,[Fi(0),Fi(8),Fi(4),ti]})(Bn)}}})(D);return Q?new lr(...Q,!1):void 0}get rgb(){const{r:D,g:Q,b:me,a:Pe}=this,Ve=Pe||1/0;return this.overwriteGetter("rgb",[D/Ve,Q/Ve,me/Ve,Pe])}get hcl(){return this.overwriteGetter("hcl",(function(D){const[Q,me,Pe,Ve]=En(D),We=Math.sqrt(me*me+Pe*Pe);return[Math.round(1e4*We)?Fr(Math.atan2(Pe,me)*hr):NaN,We,Q,Ve]})(this.rgb))}get lab(){return this.overwriteGetter("lab",En(this.rgb))}overwriteGetter(D,Q){return Object.defineProperty(this,D,{value:Q}),Q}toString(){const[D,Q,me,Pe]=this.rgb;return`rgba(${[D,Q,me].map(Ve=>Math.round(255*Ve)).join(",")},${Pe})`}}lr.black=new lr(0,0,0,1),lr.white=new lr(1,1,1,1),lr.transparent=new lr(0,0,0,0),lr.red=new lr(1,0,0,1);class Vr{constructor(D,Q,me){this.sensitivity=D?Q?"variant":"case":Q?"accent":"base",this.locale=me,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(D,Q){return this.collator.compare(D,Q)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class sn{constructor(D,Q,me,Pe,Ve){this.text=D,this.image=Q,this.scale=me,this.fontStack=Pe,this.textColor=Ve}}class mn{constructor(D){this.sections=D}static fromString(D){return new mn([new sn(D,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(D=>D.text.length!==0||D.image&&D.image.name.length!==0)}static factory(D){return D instanceof mn?D:mn.fromString(D)}toString(){return this.sections.length===0?"":this.sections.map(D=>D.text).join("")}}class wn{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof wn)return D;if(typeof D=="number")return new wn([D,D,D,D]);if(Array.isArray(D)&&!(D.length<1||D.length>4)){for(const Q of D)if(typeof Q!="number")return;switch(D.length){case 1:D=[D[0],D[0],D[0],D[0]];break;case 2:D=[D[0],D[1],D[0],D[1]];break;case 3:D=[D[0],D[1],D[2],D[1]]}return new wn(D)}}toString(){return JSON.stringify(this.values)}}const Jn=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class pa{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof pa)return D;if(Array.isArray(D)&&!(D.length<1)&&D.length%2==0){for(let Q=0;Q=0&&Y<=255&&typeof D=="number"&&D>=0&&D<=255&&typeof Q=="number"&&Q>=0&&Q<=255?me===void 0||typeof me=="number"&&me>=0&&me<=1?null:`Invalid rgba value [${[Y,D,Q,me].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof me=="number"?[Y,D,Q,me]:[Y,D,Q]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ca(Y){if(Y===null||typeof Y=="string"||typeof Y=="boolean"||typeof Y=="number"||Y instanceof lr||Y instanceof Vr||Y instanceof mn||Y instanceof wn||Y instanceof pa||Y instanceof ha)return!0;if(Array.isArray(Y)){for(const D of Y)if(!Ca(D))return!1;return!0}if(typeof Y=="object"){for(const D in Y)if(!Ca(Y[D]))return!1;return!0}return!1}function Vn(Y){if(Y===null)return ft;if(typeof Y=="string")return Ft;if(typeof Y=="boolean")return Nt;if(typeof Y=="number")return rt;if(Y instanceof lr)return $t;if(Y instanceof Vr)return Mr;if(Y instanceof mn)return Wr;if(Y instanceof wn)return Sr;if(Y instanceof pa)return Mt;if(Y instanceof ha)return Br;if(Array.isArray(Y)){const D=Y.length;let Q;for(const me of Y){const Pe=Vn(me);if(Q){if(Q===Pe)continue;Q=Er;break}Q=Pe}return je(Q||Er,D)}return rr}function yi(Y){const D=typeof Y;return Y===null?"":D==="string"||D==="number"||D==="boolean"?String(Y):Y instanceof lr||Y instanceof mn||Y instanceof wn||Y instanceof pa||Y instanceof ha?Y.toString():JSON.stringify(Y)}class Ci{constructor(D,Q){this.type=D,this.value=Q}static parse(D,Q){if(D.length!==2)return Q.error(`'literal' expression requires exactly one argument, but found ${D.length-1} instead.`);if(!Ca(D[1]))return Q.error("invalid value");const me=D[1];let Pe=Vn(me);const Ve=Q.expectedType;return Pe.kind!=="array"||Pe.N!==0||!Ve||Ve.kind!=="array"||typeof Ve.N=="number"&&Ve.N!==0||(Pe=Ve),new Ci(Pe,me)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Dt{constructor(D){this.name="ExpressionEvaluationError",this.message=D}toJSON(){return this.message}}const yt={string:Ft,number:rt,boolean:Nt,object:rr};class kr{constructor(D,Q){this.type=D,this.args=Q}static parse(D,Q){if(D.length<2)return Q.error("Expected at least one argument.");let me,Pe=1;const Ve=D[0];if(Ve==="array"){let pt,Rt;if(D.length>2){const Yt=D[1];if(typeof Yt!="string"||!(Yt in yt)||Yt==="object")return Q.error('The item type argument of "array" must be one of string, number, boolean',1);pt=yt[Yt],Pe++}else pt=Er;if(D.length>3){if(D[2]!==null&&(typeof D[2]!="number"||D[2]<0||D[2]!==Math.floor(D[2])))return Q.error('The length argument to "array" must be a positive integer literal',2);Rt=D[2],Pe++}me=je(pt,Rt)}else{if(!yt[Ve])throw new Error(`Types doesn't contain name = ${Ve}`);me=yt[Ve]}const We=[];for(;PeD.outputDefined())}}const Nr={"to-boolean":Nt,"to-color":$t,"to-number":rt,"to-string":Ft};class jr{constructor(D,Q){this.type=D,this.args=Q}static parse(D,Q){if(D.length<2)return Q.error("Expected at least one argument.");const me=D[0];if(!Nr[me])throw new Error(`Can't parse ${me} as it is not part of the known types`);if((me==="to-boolean"||me==="to-string")&&D.length!==2)return Q.error("Expected one argument.");const Pe=Nr[me],Ve=[];for(let We=1;We4?`Invalid rbga value ${JSON.stringify(Q)}: expected an array containing either three or four numeric values.`:_a(Q[0],Q[1],Q[2],Q[3]),!me))return new lr(Q[0]/255,Q[1]/255,Q[2]/255,Q[3])}throw new Dt(me||`Could not parse color from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"padding":{let Q;for(const me of this.args){Q=me.evaluate(D);const Pe=wn.parse(Q);if(Pe)return Pe}throw new Dt(`Could not parse padding from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"variableAnchorOffsetCollection":{let Q;for(const me of this.args){Q=me.evaluate(D);const Pe=pa.parse(Q);if(Pe)return Pe}throw new Dt(`Could not parse variableAnchorOffsetCollection from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"number":{let Q=null;for(const me of this.args){if(Q=me.evaluate(D),Q===null)return 0;const Pe=Number(Q);if(!isNaN(Pe))return Pe}throw new Dt(`Could not convert ${JSON.stringify(Q)} to number.`)}case"formatted":return mn.fromString(yi(this.args[0].evaluate(D)));case"resolvedImage":return ha.fromString(yi(this.args[0].evaluate(D)));default:return yi(this.args[0].evaluate(D))}}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}const Ir=["Unknown","Point","LineString","Polygon"];class Ur{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ir[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(D){let Q=this._parseColorCache[D];return Q||(Q=this._parseColorCache[D]=lr.parse(D)),Q}}class ln{constructor(D,Q,me=[],Pe,Ve=new ot,We=[]){this.registry=D,this.path=me,this.key=me.map(pt=>`[${pt}]`).join(""),this.scope=Ve,this.errors=We,this.expectedType=Pe,this._isConstant=Q}parse(D,Q,me,Pe,Ve={}){return Q?this.concat(Q,me,Pe)._parse(D,Ve):this._parse(D,Ve)}_parse(D,Q){function me(Pe,Ve,We){return We==="assert"?new kr(Ve,[Pe]):We==="coerce"?new jr(Ve,[Pe]):Pe}if(D!==null&&typeof D!="string"&&typeof D!="boolean"&&typeof D!="number"||(D=["literal",D]),Array.isArray(D)){if(D.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const Pe=D[0];if(typeof Pe!="string")return this.error(`Expression name must be a string, but found ${typeof Pe} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const Ve=this.registry[Pe];if(Ve){let We=Ve.parse(D,this);if(!We)return null;if(this.expectedType){const pt=this.expectedType,Rt=We.type;if(pt.kind!=="string"&&pt.kind!=="number"&&pt.kind!=="boolean"&&pt.kind!=="object"&&pt.kind!=="array"||Rt.kind!=="value")if(pt.kind!=="color"&&pt.kind!=="formatted"&&pt.kind!=="resolvedImage"||Rt.kind!=="value"&&Rt.kind!=="string")if(pt.kind!=="padding"||Rt.kind!=="value"&&Rt.kind!=="number"&&Rt.kind!=="array")if(pt.kind!=="variableAnchorOffsetCollection"||Rt.kind!=="value"&&Rt.kind!=="array"){if(this.checkSubtype(pt,Rt))return null}else We=me(We,pt,Q.typeAnnotation||"coerce");else We=me(We,pt,Q.typeAnnotation||"coerce");else We=me(We,pt,Q.typeAnnotation||"coerce");else We=me(We,pt,Q.typeAnnotation||"assert")}if(!(We instanceof Ci)&&We.type.kind!=="resolvedImage"&&this._isConstant(We)){const pt=new Ur;try{We=new Ci(We.type,We.evaluate(pt))}catch(Rt){return this.error(Rt.message),null}}return We}return this.error(`Unknown expression "${Pe}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(D===void 0?"'undefined' value invalid. Use null instead.":typeof D=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof D} instead.`)}concat(D,Q,me){const Pe=typeof D=="number"?this.path.concat(D):this.path,Ve=me?this.scope.concat(me):this.scope;return new ln(this.registry,this._isConstant,Pe,Q||null,Ve,this.errors)}error(D,...Q){const me=`${this.key}${Q.map(Pe=>`[${Pe}]`).join("")}`;this.errors.push(new Ne(me,D))}checkSubtype(D,Q){const me=xe(D,Q);return me&&this.error(me),me}}class $r{constructor(D,Q){this.type=Q.type,this.bindings=[].concat(D),this.result=Q}evaluate(D){return this.result.evaluate(D)}eachChild(D){for(const Q of this.bindings)D(Q[1]);D(this.result)}static parse(D,Q){if(D.length<4)return Q.error(`Expected at least 3 arguments, but found ${D.length-1} instead.`);const me=[];for(let Ve=1;Ve=me.length)throw new Dt(`Array index out of bounds: ${Q} > ${me.length-1}.`);if(Q!==Math.floor(Q))throw new Dt(`Array index must be an integer, but found ${Q} instead.`);return me[Q]}eachChild(D){D(this.index),D(this.input)}outputDefined(){return!1}}class Dr{constructor(D,Q){this.type=Nt,this.needle=D,this.haystack=Q}static parse(D,Q){if(D.length!==3)return Q.error(`Expected 2 arguments, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1,Er),Pe=Q.parse(D[2],2,Er);return me&&Pe?ye(me.type,[Nt,Ft,rt,ft,Er])?new Dr(me,Pe):Q.error(`Expected first argument to be of type boolean, string, number or null, but found ${$e(me.type)} instead`):null}evaluate(D){const Q=this.needle.evaluate(D),me=this.haystack.evaluate(D);if(!me)return!1;if(!Me(Q,["boolean","string","number","null"]))throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${$e(Vn(Q))} instead.`);if(!Me(me,["string","array"]))throw new Dt(`Expected second argument to be of type array or string, but found ${$e(Vn(me))} instead.`);return me.indexOf(Q)>=0}eachChild(D){D(this.needle),D(this.haystack)}outputDefined(){return!0}}class un{constructor(D,Q,me){this.type=rt,this.needle=D,this.haystack=Q,this.fromIndex=me}static parse(D,Q){if(D.length<=2||D.length>=5)return Q.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1,Er),Pe=Q.parse(D[2],2,Er);if(!me||!Pe)return null;if(!ye(me.type,[Nt,Ft,rt,ft,Er]))return Q.error(`Expected first argument to be of type boolean, string, number or null, but found ${$e(me.type)} instead`);if(D.length===4){const Ve=Q.parse(D[3],3,rt);return Ve?new un(me,Pe,Ve):null}return new un(me,Pe)}evaluate(D){const Q=this.needle.evaluate(D),me=this.haystack.evaluate(D);if(!Me(Q,["boolean","string","number","null"]))throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${$e(Vn(Q))} instead.`);let Pe;if(this.fromIndex&&(Pe=this.fromIndex.evaluate(D)),Me(me,["string"])){const Ve=me.indexOf(Q,Pe);return Ve===-1?-1:[...me.slice(0,Ve)].length}if(Me(me,["array"]))return me.indexOf(Q,Pe);throw new Dt(`Expected second argument to be of type array or string, but found ${$e(Vn(me))} instead.`)}eachChild(D){D(this.needle),D(this.haystack),this.fromIndex&&D(this.fromIndex)}outputDefined(){return!1}}class Rn{constructor(D,Q,me,Pe,Ve,We){this.inputType=D,this.type=Q,this.input=me,this.cases=Pe,this.outputs=Ve,this.otherwise=We}static parse(D,Q){if(D.length<5)return Q.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if(D.length%2!=1)return Q.error("Expected an even number of arguments.");let me,Pe;Q.expectedType&&Q.expectedType.kind!=="value"&&(Pe=Q.expectedType);const Ve={},We=[];for(let Yt=2;YtNumber.MAX_SAFE_INTEGER)return qr.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof vn=="number"&&Math.floor(vn)!==vn)return qr.error("Numeric branch labels must be integer values.");if(me){if(qr.checkSubtype(me,Vn(vn)))return null}else me=Vn(vn);if(Ve[String(vn)]!==void 0)return qr.error("Branch labels must be unique.");Ve[String(vn)]=We.length}const Jr=Q.parse(xr,Yt,Pe);if(!Jr)return null;Pe=Pe||Jr.type,We.push(Jr)}const pt=Q.parse(D[1],1,Er);if(!pt)return null;const Rt=Q.parse(D[D.length-1],D.length-1,Pe);return Rt?pt.type.kind!=="value"&&Q.concat(1).checkSubtype(me,pt.type)?null:new Rn(me,Pe,pt,Ve,We,Rt):null}evaluate(D){const Q=this.input.evaluate(D);return(Vn(Q)===this.inputType&&this.outputs[this.cases[Q]]||this.otherwise).evaluate(D)}eachChild(D){D(this.input),this.outputs.forEach(D),D(this.otherwise)}outputDefined(){return this.outputs.every(D=>D.outputDefined())&&this.otherwise.outputDefined()}}class jn{constructor(D,Q,me){this.type=D,this.branches=Q,this.otherwise=me}static parse(D,Q){if(D.length<4)return Q.error(`Expected at least 3 arguments, but found only ${D.length-1}.`);if(D.length%2!=0)return Q.error("Expected an odd number of arguments.");let me;Q.expectedType&&Q.expectedType.kind!=="value"&&(me=Q.expectedType);const Pe=[];for(let We=1;WeQ.outputDefined())&&this.otherwise.outputDefined()}}class Un{constructor(D,Q,me,Pe){this.type=D,this.input=Q,this.beginIndex=me,this.endIndex=Pe}static parse(D,Q){if(D.length<=2||D.length>=5)return Q.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1,Er),Pe=Q.parse(D[2],2,rt);if(!me||!Pe)return null;if(!ye(me.type,[je(Er),Ft,Er]))return Q.error(`Expected first argument to be of type array or string, but found ${$e(me.type)} instead`);if(D.length===4){const Ve=Q.parse(D[3],3,rt);return Ve?new Un(me.type,me,Pe,Ve):null}return new Un(me.type,me,Pe)}evaluate(D){const Q=this.input.evaluate(D),me=this.beginIndex.evaluate(D);let Pe;if(this.endIndex&&(Pe=this.endIndex.evaluate(D)),Me(Q,["string"]))return[...Q].slice(me,Pe).join("");if(Me(Q,["array"]))return Q.slice(me,Pe);throw new Dt(`Expected first argument to be of type array or string, but found ${$e(Vn(Q))} instead.`)}eachChild(D){D(this.input),D(this.beginIndex),this.endIndex&&D(this.endIndex)}outputDefined(){return!1}}function cn(Y,D){const Q=Y.length-1;let me,Pe,Ve=0,We=Q,pt=0;for(;Ve<=We;)if(pt=Math.floor((Ve+We)/2),me=Y[pt],Pe=Y[pt+1],me<=D){if(pt===Q||DD))throw new Dt("Input is not a number.");We=pt-1}return 0}class In{constructor(D,Q,me){this.type=D,this.input=Q,this.labels=[],this.outputs=[];for(const[Pe,Ve]of me)this.labels.push(Pe),this.outputs.push(Ve)}static parse(D,Q){if(D.length-1<4)return Q.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return Q.error("Expected an even number of arguments.");const me=Q.parse(D[1],1,rt);if(!me)return null;const Pe=[];let Ve=null;Q.expectedType&&Q.expectedType.kind!=="value"&&(Ve=Q.expectedType);for(let We=1;We=pt)return Q.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Yt);const xr=Q.parse(Rt,dr,Ve);if(!xr)return null;Ve=Ve||xr.type,Pe.push([pt,xr])}return new In(Ve,me,Pe)}evaluate(D){const Q=this.labels,me=this.outputs;if(Q.length===1)return me[0].evaluate(D);const Pe=this.input.evaluate(D);if(Pe<=Q[0])return me[0].evaluate(D);const Ve=Q.length;return Pe>=Q[Ve-1]?me[Ve-1].evaluate(D):me[cn(Q,Pe)].evaluate(D)}eachChild(D){D(this.input);for(const Q of this.outputs)D(Q)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function xi(Y){return Y&&Y.__esModule&&Object.prototype.hasOwnProperty.call(Y,"default")?Y.default:Y}var Ea=Pi;function Pi(Y,D,Q,me){this.cx=3*Y,this.bx=3*(Q-Y)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*D,this.by=3*(me-D)-this.cy,this.ay=1-this.cy-this.by,this.p1x=Y,this.p1y=D,this.p2x=Q,this.p2y=me}Pi.prototype={sampleCurveX:function(Y){return((this.ax*Y+this.bx)*Y+this.cx)*Y},sampleCurveY:function(Y){return((this.ay*Y+this.by)*Y+this.cy)*Y},sampleCurveDerivativeX:function(Y){return(3*this.ax*Y+2*this.bx)*Y+this.cx},solveCurveX:function(Y,D){if(D===void 0&&(D=1e-6),Y<0)return 0;if(Y>1)return 1;for(var Q=Y,me=0;me<8;me++){var Pe=this.sampleCurveX(Q)-Y;if(Math.abs(Pe)Pe?We=Q:pt=Q,Q=.5*(pt-We)+We;return Q},solve:function(Y,D){return this.sampleCurveY(this.solveCurveX(Y,D))}};var Xi=xi(Ea);function uo(Y,D,Q){return Y+Q*(D-Y)}function so(Y,D,Q){return Y.map((me,Pe)=>uo(me,D[Pe],Q))}const Eo={number:uo,color:function(Y,D,Q,me="rgb"){switch(me){case"rgb":{const[Pe,Ve,We,pt]=so(Y.rgb,D.rgb,Q);return new lr(Pe,Ve,We,pt,!1)}case"hcl":{const[Pe,Ve,We,pt]=Y.hcl,[Rt,Yt,dr,xr]=D.hcl;let qr,Jr;if(isNaN(Pe)||isNaN(Rt))isNaN(Pe)?isNaN(Rt)?qr=NaN:(qr=Rt,We!==1&&We!==0||(Jr=Yt)):(qr=Pe,dr!==1&&dr!==0||(Jr=Ve));else{let ui=Rt-Pe;Rt>Pe&&ui>180?ui-=360:Rt180&&(ui+=360),qr=Pe+Q*ui}const[vn,Tn,Bn,da]=(function([ui,Ba,ti,Fi]){return ui=isNaN(ui)?0:ui*pr,ta([ti,Math.cos(ui)*Ba,Math.sin(ui)*Ba,Fi])})([qr,Jr??uo(Ve,Yt,Q),uo(We,dr,Q),uo(pt,xr,Q)]);return new lr(vn,Tn,Bn,da,!1)}case"lab":{const[Pe,Ve,We,pt]=ta(so(Y.lab,D.lab,Q));return new lr(Pe,Ve,We,pt,!1)}}},array:so,padding:function(Y,D,Q){return new wn(so(Y.values,D.values,Q))},variableAnchorOffsetCollection:function(Y,D,Q){const me=Y.values,Pe=D.values;if(me.length!==Pe.length)throw new Dt(`Cannot interpolate values of different length. from: ${Y.toString()}, to: ${D.toString()}`);const Ve=[];for(let We=0;Wetypeof dr!="number"||dr<0||dr>1))return Q.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Pe={name:"cubic-bezier",controlPoints:Yt}}}if(D.length-1<4)return Q.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return Q.error("Expected an even number of arguments.");if(Ve=Q.parse(Ve,2,rt),!Ve)return null;const pt=[];let Rt=null;me==="interpolate-hcl"||me==="interpolate-lab"?Rt=$t:Q.expectedType&&Q.expectedType.kind!=="value"&&(Rt=Q.expectedType);for(let Yt=0;Yt=dr)return Q.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',qr);const vn=Q.parse(xr,Jr,Rt);if(!vn)return null;Rt=Rt||vn.type,pt.push([dr,vn])}return Xe(Rt,rt)||Xe(Rt,$t)||Xe(Rt,Sr)||Xe(Rt,Mt)||Xe(Rt,je(rt))?new vi(Rt,me,Pe,Ve,pt):Q.error(`Type ${$e(Rt)} is not interpolatable.`)}evaluate(D){const Q=this.labels,me=this.outputs;if(Q.length===1)return me[0].evaluate(D);const Pe=this.input.evaluate(D);if(Pe<=Q[0])return me[0].evaluate(D);const Ve=Q.length;if(Pe>=Q[Ve-1])return me[Ve-1].evaluate(D);const We=cn(Q,Pe),pt=vi.interpolationFactor(this.interpolation,Pe,Q[We],Q[We+1]),Rt=me[We].evaluate(D),Yt=me[We+1].evaluate(D);switch(this.operator){case"interpolate":return Eo[this.type.kind](Rt,Yt,pt);case"interpolate-hcl":return Eo.color(Rt,Yt,pt,"hcl");case"interpolate-lab":return Eo.color(Rt,Yt,pt,"lab")}}eachChild(D){D(this.input);for(const Q of this.outputs)D(Q)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function ns(Y,D,Q,me){const Pe=me-Q,Ve=Y-Q;return Pe===0?0:D===1?Ve/Pe:(Math.pow(D,Ve)-1)/(Math.pow(D,Pe)-1)}class Xo{constructor(D,Q){this.type=D,this.args=Q}static parse(D,Q){if(D.length<2)return Q.error("Expectected at least one argument.");let me=null;const Pe=Q.expectedType;Pe&&Pe.kind!=="value"&&(me=Pe);const Ve=[];for(const pt of D.slice(1)){const Rt=Q.parse(pt,1+Ve.length,me,void 0,{typeAnnotation:"omit"});if(!Rt)return null;me=me||Rt.type,Ve.push(Rt)}if(!me)throw new Error("No output type");const We=Pe&&Ve.some(pt=>xe(Pe,pt.type));return new Xo(We?Er:me,Ve)}evaluate(D){let Q,me=null,Pe=0;for(const Ve of this.args)if(Pe++,me=Ve.evaluate(D),me&&me instanceof ha&&!me.available&&(Q||(Q=me.name),me=null,Pe===this.args.length&&(me=Q)),me!==null)break;return me}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}function Ys(Y,D){return Y==="=="||Y==="!="?D.kind==="boolean"||D.kind==="string"||D.kind==="number"||D.kind==="null"||D.kind==="value":D.kind==="string"||D.kind==="number"||D.kind==="value"}function vs(Y,D,Q,me){return me.compare(D,Q)===0}function es(Y,D,Q){const me=Y!=="=="&&Y!=="!=";return class e4{constructor(Ve,We,pt){this.type=Nt,this.lhs=Ve,this.rhs=We,this.collator=pt,this.hasUntypedArgument=Ve.type.kind==="value"||We.type.kind==="value"}static parse(Ve,We){if(Ve.length!==3&&Ve.length!==4)return We.error("Expected two or three arguments.");const pt=Ve[0];let Rt=We.parse(Ve[1],1,Er);if(!Rt)return null;if(!Ys(pt,Rt.type))return We.concat(1).error(`"${pt}" comparisons are not supported for type '${$e(Rt.type)}'.`);let Yt=We.parse(Ve[2],2,Er);if(!Yt)return null;if(!Ys(pt,Yt.type))return We.concat(2).error(`"${pt}" comparisons are not supported for type '${$e(Yt.type)}'.`);if(Rt.type.kind!==Yt.type.kind&&Rt.type.kind!=="value"&&Yt.type.kind!=="value")return We.error(`Cannot compare types '${$e(Rt.type)}' and '${$e(Yt.type)}'.`);me&&(Rt.type.kind==="value"&&Yt.type.kind!=="value"?Rt=new kr(Yt.type,[Rt]):Rt.type.kind!=="value"&&Yt.type.kind==="value"&&(Yt=new kr(Rt.type,[Yt])));let dr=null;if(Ve.length===4){if(Rt.type.kind!=="string"&&Yt.type.kind!=="string"&&Rt.type.kind!=="value"&&Yt.type.kind!=="value")return We.error("Cannot use collator to compare non-string types.");if(dr=We.parse(Ve[3],3,Mr),!dr)return null}return new e4(Rt,Yt,dr)}evaluate(Ve){const We=this.lhs.evaluate(Ve),pt=this.rhs.evaluate(Ve);if(me&&this.hasUntypedArgument){const Rt=Vn(We),Yt=Vn(pt);if(Rt.kind!==Yt.kind||Rt.kind!=="string"&&Rt.kind!=="number")throw new Dt(`Expected arguments for "${Y}" to be (string, string) or (number, number), but found (${Rt.kind}, ${Yt.kind}) instead.`)}if(this.collator&&!me&&this.hasUntypedArgument){const Rt=Vn(We),Yt=Vn(pt);if(Rt.kind!=="string"||Yt.kind!=="string")return D(Ve,We,pt)}return this.collator?Q(Ve,We,pt,this.collator.evaluate(Ve)):D(Ve,We,pt)}eachChild(Ve){Ve(this.lhs),Ve(this.rhs),this.collator&&Ve(this.collator)}outputDefined(){return!0}}}const qo=es("==",function(Y,D,Q){return D===Q},vs),Zs=es("!=",function(Y,D,Q){return D!==Q},function(Y,D,Q,me){return!vs(0,D,Q,me)}),Hs=es("<",function(Y,D,Q){return D",function(Y,D,Q){return D>Q},function(Y,D,Q,me){return me.compare(D,Q)>0}),ds=es("<=",function(Y,D,Q){return D<=Q},function(Y,D,Q,me){return me.compare(D,Q)<=0}),Ko=es(">=",function(Y,D,Q){return D>=Q},function(Y,D,Q,me){return me.compare(D,Q)>=0});class _o{constructor(D,Q,me){this.type=Mr,this.locale=me,this.caseSensitive=D,this.diacriticSensitive=Q}static parse(D,Q){if(D.length!==2)return Q.error("Expected one argument.");const me=D[1];if(typeof me!="object"||Array.isArray(me))return Q.error("Collator options argument must be an object.");const Pe=Q.parse(me["case-sensitive"]!==void 0&&me["case-sensitive"],1,Nt);if(!Pe)return null;const Ve=Q.parse(me["diacritic-sensitive"]!==void 0&&me["diacritic-sensitive"],1,Nt);if(!Ve)return null;let We=null;return me.locale&&(We=Q.parse(me.locale,1,Ft),!We)?null:new _o(Pe,Ve,We)}evaluate(D){return new Vr(this.caseSensitive.evaluate(D),this.diacriticSensitive.evaluate(D),this.locale?this.locale.evaluate(D):null)}eachChild(D){D(this.caseSensitive),D(this.diacriticSensitive),this.locale&&D(this.locale)}outputDefined(){return!1}}class ps{constructor(D,Q,me,Pe,Ve){this.type=Ft,this.number=D,this.locale=Q,this.currency=me,this.minFractionDigits=Pe,this.maxFractionDigits=Ve}static parse(D,Q){if(D.length!==3)return Q.error("Expected two arguments.");const me=Q.parse(D[1],1,rt);if(!me)return null;const Pe=D[2];if(typeof Pe!="object"||Array.isArray(Pe))return Q.error("NumberFormat options argument must be an object.");let Ve=null;if(Pe.locale&&(Ve=Q.parse(Pe.locale,1,Ft),!Ve))return null;let We=null;if(Pe.currency&&(We=Q.parse(Pe.currency,1,Ft),!We))return null;let pt=null;if(Pe["min-fraction-digits"]&&(pt=Q.parse(Pe["min-fraction-digits"],1,rt),!pt))return null;let Rt=null;return Pe["max-fraction-digits"]&&(Rt=Q.parse(Pe["max-fraction-digits"],1,rt),!Rt)?null:new ps(me,Ve,We,pt,Rt)}evaluate(D){return new Intl.NumberFormat(this.locale?this.locale.evaluate(D):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(D):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(D):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(D):void 0}).format(this.number.evaluate(D))}eachChild(D){D(this.number),this.locale&&D(this.locale),this.currency&&D(this.currency),this.minFractionDigits&&D(this.minFractionDigits),this.maxFractionDigits&&D(this.maxFractionDigits)}outputDefined(){return!1}}class ll{constructor(D){this.type=Wr,this.sections=D}static parse(D,Q){if(D.length<2)return Q.error("Expected at least one argument.");const me=D[1];if(!Array.isArray(me)&&typeof me=="object")return Q.error("First argument must be an image or text section.");const Pe=[];let Ve=!1;for(let We=1;We<=D.length-1;++We){const pt=D[We];if(Ve&&typeof pt=="object"&&!Array.isArray(pt)){Ve=!1;let Rt=null;if(pt["font-scale"]&&(Rt=Q.parse(pt["font-scale"],1,rt),!Rt))return null;let Yt=null;if(pt["text-font"]&&(Yt=Q.parse(pt["text-font"],1,je(Ft)),!Yt))return null;let dr=null;if(pt["text-color"]&&(dr=Q.parse(pt["text-color"],1,$t),!dr))return null;const xr=Pe[Pe.length-1];xr.scale=Rt,xr.font=Yt,xr.textColor=dr}else{const Rt=Q.parse(D[We],1,Er);if(!Rt)return null;const Yt=Rt.type.kind;if(Yt!=="string"&&Yt!=="value"&&Yt!=="null"&&Yt!=="resolvedImage")return Q.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Ve=!0,Pe.push({content:Rt,scale:null,font:null,textColor:null})}}return new ll(Pe)}evaluate(D){return new mn(this.sections.map(Q=>{const me=Q.content.evaluate(D);return Vn(me)===Br?new sn("",me,null,null,null):new sn(yi(me),null,Q.scale?Q.scale.evaluate(D):null,Q.font?Q.font.evaluate(D).join(","):null,Q.textColor?Q.textColor.evaluate(D):null)}))}eachChild(D){for(const Q of this.sections)D(Q.content),Q.scale&&D(Q.scale),Q.font&&D(Q.font),Q.textColor&&D(Q.textColor)}outputDefined(){return!1}}class kl{constructor(D){this.type=Br,this.input=D}static parse(D,Q){if(D.length!==2)return Q.error("Expected two arguments.");const me=Q.parse(D[1],1,Ft);return me?new kl(me):Q.error("No image name provided.")}evaluate(D){const Q=this.input.evaluate(D),me=ha.fromString(Q);return me&&D.availableImages&&(me.available=D.availableImages.indexOf(Q)>-1),me}eachChild(D){D(this.input)}outputDefined(){return!1}}class Rl{constructor(D){this.type=rt,this.input=D}static parse(D,Q){if(D.length!==2)return Q.error(`Expected 1 argument, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1);return me?me.type.kind!=="array"&&me.type.kind!=="string"&&me.type.kind!=="value"?Q.error(`Expected argument of type string or array, but found ${$e(me.type)} instead.`):new Rl(me):null}evaluate(D){const Q=this.input.evaluate(D);if(typeof Q=="string")return[...Q].length;if(Array.isArray(Q))return Q.length;throw new Dt(`Expected value to be of type string or array, but found ${$e(Vn(Q))} instead.`)}eachChild(D){D(this.input)}outputDefined(){return!1}}const Cs=8192;function pi(Y,D){const Q=(180+Y[0])/360,me=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Y[1]*Math.PI/360)))/360,Pe=Math.pow(2,D.z);return[Math.round(Q*Pe*Cs),Math.round(me*Pe*Cs)]}function no(Y,D){const Q=Math.pow(2,D.z);return[(Pe=(Y[0]/Cs+D.x)/Q,360*Pe-180),(me=(Y[1]/Cs+D.y)/Q,360/Math.PI*Math.atan(Math.exp((180-360*me)*Math.PI/180))-90)];var me,Pe}function Cl(Y,D){Y[0]=Math.min(Y[0],D[0]),Y[1]=Math.min(Y[1],D[1]),Y[2]=Math.max(Y[2],D[0]),Y[3]=Math.max(Y[3],D[1])}function Ds(Y,D){return!(Y[0]<=D[0]||Y[2]>=D[2]||Y[1]<=D[1]||Y[3]>=D[3])}function No(Y,D,Q){const me=Y[0]-D[0],Pe=Y[1]-D[1],Ve=Y[0]-Q[0],We=Y[1]-Q[1];return me*We-Ve*Pe==0&&me*Ve<=0&&Pe*We<=0}function Il(Y,D,Q,me){return(Pe=[me[0]-Q[0],me[1]-Q[1]])[0]*(Ve=[D[0]-Y[0],D[1]-Y[1]])[1]-Pe[1]*Ve[0]!=0&&!(!as(Y,D,Q,me)||!as(Q,me,Y,D));var Pe,Ve}function Ws(Y,D,Q){for(const me of Q)for(let Pe=0;Pe(Pe=Y)[1]!=(We=pt[Rt+1])[1]>Pe[1]&&Pe[0]<(We[0]-Ve[0])*(Pe[1]-Ve[1])/(We[1]-Ve[1])+Ve[0]&&(me=!me)}var Pe,Ve,We;return me}function xu(Y,D){for(const Q of D)if(ul(Y,Q))return!0;return!1}function eo(Y,D){for(const Q of Y)if(!ul(Q,D))return!1;for(let Q=0;Q0&&pt<0||We<0&&pt>0}function Hl(Y,D,Q){const me=[];for(let Pe=0;PeQ[2]){const Pe=.5*me;let Ve=Y[0]-Q[0]>Pe?-me:Q[0]-Y[0]>Pe?me:0;Ve===0&&(Ve=Y[0]-Q[2]>Pe?-me:Q[2]-Y[0]>Pe?me:0),Y[0]+=Ve}Cl(D,Y)}function su(Y,D,Q,me){const Pe=Math.pow(2,me.z)*Cs,Ve=[me.x*Cs,me.y*Cs],We=[];for(const pt of Y)for(const Rt of pt){const Yt=[Rt.x+Ve[0],Rt.y+Ve[1]];Do(Yt,D,Q,Pe),We.push(Yt)}return We}function fu(Y,D,Q,me){const Pe=Math.pow(2,me.z)*Cs,Ve=[me.x*Cs,me.y*Cs],We=[];for(const Rt of Y){const Yt=[];for(const dr of Rt){const xr=[dr.x+Ve[0],dr.y+Ve[1]];Cl(D,xr),Yt.push(xr)}We.push(Yt)}if(D[2]-D[0]<=Pe/2){(pt=D)[0]=pt[1]=1/0,pt[2]=pt[3]=-1/0;for(const Rt of We)for(const Yt of Rt)Do(Yt,D,Q,Pe)}var pt;return We}class Bs{constructor(D,Q){this.type=Nt,this.geojson=D,this.geometries=Q}static parse(D,Q){if(D.length!==2)return Q.error(`'within' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Ca(D[1])){const me=D[1];if(me.type==="FeatureCollection"){const Pe=[];for(const Ve of me.features){const{type:We,coordinates:pt}=Ve.geometry;We==="Polygon"&&Pe.push(pt),We==="MultiPolygon"&&Pe.push(...pt)}if(Pe.length)return new Bs(me,{type:"MultiPolygon",coordinates:Pe})}else if(me.type==="Feature"){const Pe=me.geometry.type;if(Pe==="Polygon"||Pe==="MultiPolygon")return new Bs(me,me.geometry)}else if(me.type==="Polygon"||me.type==="MultiPolygon")return new Bs(me,me)}return Q.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return(function(Q,me){const Pe=[1/0,1/0,-1/0,-1/0],Ve=[1/0,1/0,-1/0,-1/0],We=Q.canonicalID();if(me.type==="Polygon"){const pt=Hl(me.coordinates,Ve,We),Rt=su(Q.geometry(),Pe,Ve,We);if(!Ds(Pe,Ve))return!1;for(const Yt of Rt)if(!ul(Yt,pt))return!1}if(me.type==="MultiPolygon"){const pt=Gl(me.coordinates,Ve,We),Rt=su(Q.geometry(),Pe,Ve,We);if(!Ds(Pe,Ve))return!1;for(const Yt of Rt)if(!xu(Yt,pt))return!1}return!0})(D,this.geometries);if(D.geometryType()==="LineString")return(function(Q,me){const Pe=[1/0,1/0,-1/0,-1/0],Ve=[1/0,1/0,-1/0,-1/0],We=Q.canonicalID();if(me.type==="Polygon"){const pt=Hl(me.coordinates,Ve,We),Rt=fu(Q.geometry(),Pe,Ve,We);if(!Ds(Pe,Ve))return!1;for(const Yt of Rt)if(!eo(Yt,pt))return!1}if(me.type==="MultiPolygon"){const pt=Gl(me.coordinates,Ve,We),Rt=fu(Q.geometry(),Pe,Ve,We);if(!Ds(Pe,Ve))return!1;for(const Yt of Rt)if(!_s(Yt,pt))return!1}return!0})(D,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let wl=class{constructor(Y=[],D=(Q,me)=>Qme?1:0){if(this.data=Y,this.length=this.data.length,this.compare=D,this.length>0)for(let Q=(this.length>>1)-1;Q>=0;Q--)this._down(Q)}push(Y){this.data.push(Y),this._up(this.length++)}pop(){if(this.length===0)return;const Y=this.data[0],D=this.data.pop();return--this.length>0&&(this.data[0]=D,this._down(0)),Y}peek(){return this.data[0]}_up(Y){const{data:D,compare:Q}=this,me=D[Y];for(;Y>0;){const Pe=Y-1>>1,Ve=D[Pe];if(Q(me,Ve)>=0)break;D[Y]=Ve,Y=Pe}D[Y]=me}_down(Y){const{data:D,compare:Q}=this,me=this.length>>1,Pe=D[Y];for(;Y=0)break;D[Y]=D[Ve],Y=Ve}D[Y]=Pe}};function Bl(Y,D,Q,me,Pe){jl(Y,D,Q,me||Y.length-1,Pe||uf)}function jl(Y,D,Q,me,Pe){for(;me>Q;){if(me-Q>600){var Ve=me-Q+1,We=D-Q+1,pt=Math.log(Ve),Rt=.5*Math.exp(2*pt/3),Yt=.5*Math.sqrt(pt*Rt*(Ve-Rt)/Ve)*(We-Ve/2<0?-1:1);jl(Y,D,Math.max(Q,Math.floor(D-We*Rt/Ve+Yt)),Math.min(me,Math.floor(D+(Ve-We)*Rt/Ve+Yt)),Pe)}var dr=Y[D],xr=Q,qr=me;for(Hu(Y,Q,D),Pe(Y[me],dr)>0&&Hu(Y,Q,me);xr0;)qr--}Pe(Y[Q],dr)===0?Hu(Y,Q,qr):Hu(Y,++qr,me),qr<=D&&(Q=qr+1),D<=qr&&(me=qr-1)}}function Hu(Y,D,Q){var me=Y[D];Y[D]=Y[Q],Y[Q]=me}function uf(Y,D){return YD?1:0}function qc(Y,D){if(Y.length<=1)return[Y];const Q=[];let me,Pe;for(const Ve of Y){const We=Lh(Ve);We!==0&&(Ve.area=Math.abs(We),Pe===void 0&&(Pe=We<0),Pe===We<0?(me&&Q.push(me),me=[Ve]):me.push(Ve))}if(me&&Q.push(me),D>1)for(let Ve=0;Ve1?(Yt=D[Rt+1][0],dr=D[Rt+1][1]):Jr>0&&(Yt+=xr/this.kx*Jr,dr+=qr/this.ky*Jr)),xr=this.wrap(Q[0]-Yt)*this.kx,qr=(Q[1]-dr)*this.ky;const vn=xr*xr+qr*qr;vn180;)D-=360;return D}}function nc(Y,D){return D[0]-Y[0]}function Gu(Y){return Y[1]-Y[0]+1}function ac(Y,D){return Y[1]>=Y[0]&&Y[1]Y[1])return[null,null];const Q=Gu(Y);if(D){if(Q===2)return[Y,null];const Pe=Math.floor(Q/2);return[[Y[0],Y[0]+Pe],[Y[0]+Pe,Y[1]]]}if(Q===1)return[Y,null];const me=Math.floor(Q/2)-1;return[[Y[0],Y[0]+me],[Y[0]+me+1,Y[1]]]}function Kl(Y,D){if(!ac(D,Y.length))return[1/0,1/0,-1/0,-1/0];const Q=[1/0,1/0,-1/0,-1/0];for(let me=D[0];me<=D[1];++me)Cl(Q,Y[me]);return Q}function Xu(Y){const D=[1/0,1/0,-1/0,-1/0];for(const Q of Y)for(const me of Q)Cl(D,me);return D}function Gs(Y){return Y[0]!==-1/0&&Y[1]!==-1/0&&Y[2]!==1/0&&Y[3]!==1/0}function Dl(Y,D,Q){if(!Gs(Y)||!Gs(D))return NaN;let me=0,Pe=0;return Y[2]D[2]&&(me=Y[0]-D[2]),Y[1]>D[3]&&(Pe=Y[1]-D[3]),Y[3]=me)return me;if(Ds(Pe,Ve)){if(Bv(Y,D))return 0}else if(Bv(D,Y))return 0;let We=1/0;for(const pt of Y)for(let Rt=0,Yt=pt.length,dr=Yt-1;Rt0;){const Rt=We.pop();if(Rt[0]>=Ve)continue;const Yt=Rt[1],dr=D?50:100;if(Gu(Yt)<=dr){if(!ac(Yt,Y.length))return NaN;if(D){const xr=Ns(Y,Yt,Q,me);if(isNaN(xr)||xr===0)return xr;Ve=Math.min(Ve,xr)}else for(let xr=Yt[0];xr<=Yt[1];++xr){const qr=bv(Y[xr],Q,me);if(Ve=Math.min(Ve,qr),Ve===0)return 0}}else{const xr=ef(Yt,D);Bo(We,Ve,me,Y,pt,xr[0]),Bo(We,Ve,me,Y,pt,xr[1])}}return Ve}function Iu(Y,D,Q,me,Pe,Ve=1/0){let We=Math.min(Ve,Pe.distance(Y[0],Q[0]));if(We===0)return We;const pt=new wl([[0,[0,Y.length-1],[0,Q.length-1]]],nc);for(;pt.length>0;){const Rt=pt.pop();if(Rt[0]>=We)continue;const Yt=Rt[1],dr=Rt[2],xr=D?50:100,qr=me?50:100;if(Gu(Yt)<=xr&&Gu(dr)<=qr){if(!ac(Yt,Y.length)&&ac(dr,Q.length))return NaN;let Jr;if(D&&me)Jr=If(Y,Yt,Q,dr,Pe),We=Math.min(We,Jr);else if(D&&!me){const vn=Y.slice(Yt[0],Yt[1]+1);for(let Tn=dr[0];Tn<=dr[1];++Tn)if(Jr=wf(Q[Tn],vn,Pe),We=Math.min(We,Jr),We===0)return We}else if(!D&&me){const vn=Q.slice(dr[0],dr[1]+1);for(let Tn=Yt[0];Tn<=Yt[1];++Tn)if(Jr=wf(Y[Tn],vn,Pe),We=Math.min(We,Jr),We===0)return We}else Jr=lu(Y,Yt,Q,dr,Pe),We=Math.min(We,Jr)}else{const Jr=ef(Yt,D),vn=ef(dr,me);Kf(pt,We,Pe,Y,Q,Jr[0],vn[0]),Kf(pt,We,Pe,Y,Q,Jr[0],vn[1]),Kf(pt,We,Pe,Y,Q,Jr[1],vn[0]),Kf(pt,We,Pe,Y,Q,Jr[1],vn[1])}}return We}function Rh(Y){return Y.type==="MultiPolygon"?Y.coordinates.map(D=>({type:"Polygon",coordinates:D})):Y.type==="MultiLineString"?Y.coordinates.map(D=>({type:"LineString",coordinates:D})):Y.type==="MultiPoint"?Y.coordinates.map(D=>({type:"Point",coordinates:D})):[Y]}class Df{constructor(D,Q){this.type=rt,this.geojson=D,this.geometries=Q}static parse(D,Q){if(D.length!==2)return Q.error(`'distance' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Ca(D[1])){const me=D[1];if(me.type==="FeatureCollection")return new Df(me,me.features.map(Pe=>Rh(Pe.geometry)).flat());if(me.type==="Feature")return new Df(me,Rh(me.geometry));if("type"in me&&"coordinates"in me)return new Df(me,Rh(me))}return Q.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return(function(Q,me){const Pe=Q.geometry(),Ve=Pe.flat().map(Rt=>no([Rt.x,Rt.y],Q.canonical));if(Pe.length===0)return NaN;const We=new Ph(Ve[0][1]);let pt=1/0;for(const Rt of me){switch(Rt.type){case"Point":pt=Math.min(pt,Iu(Ve,!1,[Rt.coordinates],!1,We,pt));break;case"LineString":pt=Math.min(pt,Iu(Ve,!1,Rt.coordinates,!0,We,pt));break;case"Polygon":pt=Math.min(pt,tf(Ve,!1,Rt.coordinates,We,pt))}if(pt===0)return pt}return pt})(D,this.geometries);if(D.geometryType()==="LineString")return(function(Q,me){const Pe=Q.geometry(),Ve=Pe.flat().map(Rt=>no([Rt.x,Rt.y],Q.canonical));if(Pe.length===0)return NaN;const We=new Ph(Ve[0][1]);let pt=1/0;for(const Rt of me){switch(Rt.type){case"Point":pt=Math.min(pt,Iu(Ve,!0,[Rt.coordinates],!1,We,pt));break;case"LineString":pt=Math.min(pt,Iu(Ve,!0,Rt.coordinates,!0,We,pt));break;case"Polygon":pt=Math.min(pt,tf(Ve,!0,Rt.coordinates,We,pt))}if(pt===0)return pt}return pt})(D,this.geometries);if(D.geometryType()==="Polygon")return(function(Q,me){const Pe=Q.geometry();if(Pe.length===0||Pe[0].length===0)return NaN;const Ve=qc(Pe,0).map(Rt=>Rt.map(Yt=>Yt.map(dr=>no([dr.x,dr.y],Q.canonical)))),We=new Ph(Ve[0][0][0][1]);let pt=1/0;for(const Rt of me)for(const Yt of Ve){switch(Rt.type){case"Point":pt=Math.min(pt,tf([Rt.coordinates],!1,Yt,We,pt));break;case"LineString":pt=Math.min(pt,tf(Rt.coordinates,!0,Yt,We,pt));break;case"Polygon":pt=Math.min(pt,dl(Yt,Rt.coordinates,We,pt))}if(pt===0)return pt}return pt})(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const ih={"==":qo,"!=":Zs,">":sl,"<":Hs,">=":Ko,"<=":ds,array:kr,at:or,boolean:kr,case:jn,coalesce:Xo,collator:_o,format:ll,image:kl,in:Dr,"index-of":un,interpolate:vi,"interpolate-hcl":vi,"interpolate-lab":vi,length:Rl,let:$r,literal:Ci,match:Rn,number:kr,"number-format":ps,object:kr,slice:Un,step:In,string:kr,"to-boolean":jr,"to-color":jr,"to-number":jr,"to-string":jr,var:At,within:Bs,distance:Df};class Yu{constructor(D,Q,me,Pe){this.name=D,this.type=Q,this._evaluate=me,this.args=Pe}evaluate(D){return this._evaluate(D,this.args)}eachChild(D){this.args.forEach(D)}outputDefined(){return!1}static parse(D,Q){const me=D[0],Pe=Yu.definitions[me];if(!Pe)return Q.error(`Unknown expression "${me}". If you wanted a literal array, use ["literal", [...]].`,0);const Ve=Array.isArray(Pe)?Pe[0]:Pe.type,We=Array.isArray(Pe)?[[Pe[1],Pe[2]]]:Pe.overloads,pt=We.filter(([Yt])=>!Array.isArray(Yt)||Yt.length===D.length-1);let Rt=null;for(const[Yt,dr]of pt){Rt=new ln(Q.registry,Ih,Q.path,null,Q.scope);const xr=[];let qr=!1;for(let Jr=1;Jr{return qr=xr,Array.isArray(qr)?`(${qr.map($e).join(", ")})`:`(${$e(qr.type)}...)`;var qr}).join(" | "),dr=[];for(let xr=1;xr{Q=D?Q&&Ih(me):Q&&me instanceof Ci}),!!Q&&Dh(Y)&&jh(Y,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Dh(Y){if(Y instanceof Yu&&(Y.name==="get"&&Y.args.length===1||Y.name==="feature-state"||Y.name==="has"&&Y.args.length===1||Y.name==="properties"||Y.name==="geometry-type"||Y.name==="id"||/^filter-/.test(Y.name))||Y instanceof Bs||Y instanceof Df)return!1;let D=!0;return Y.eachChild(Q=>{D&&!Dh(Q)&&(D=!1)}),D}function rf(Y){if(Y instanceof Yu&&Y.name==="feature-state")return!1;let D=!0;return Y.eachChild(Q=>{D&&!rf(Q)&&(D=!1)}),D}function jh(Y,D){if(Y instanceof Yu&&D.indexOf(Y.name)>=0)return!1;let Q=!0;return Y.eachChild(me=>{Q&&!jh(me,D)&&(Q=!1)}),Q}function Tf(Y){return{result:"success",value:Y}}function cf(Y){return{result:"error",value:Y}}function Zu(Y){return Y["property-type"]==="data-driven"||Y["property-type"]==="cross-faded-data-driven"}function Hf(Y){return!!Y.expression&&Y.expression.parameters.indexOf("zoom")>-1}function zh(Y){return!!Y.expression&&Y.expression.interpolated}function Nl(Y){return Y instanceof Number?"number":Y instanceof String?"string":Y instanceof Boolean?"boolean":Array.isArray(Y)?"array":Y===null?"null":typeof Y}function _h(Y){return typeof Y=="object"&&Y!==null&&!Array.isArray(Y)}function wv(Y){return Y}function qh(Y,D){const Q=D.type==="color",me=Y.stops&&typeof Y.stops[0][0]=="object",Pe=me||!(me||Y.property!==void 0),Ve=Y.type||(zh(D)?"exponential":"interval");if(Q||D.type==="padding"){const dr=Q?lr.parse:wn.parse;(Y=pe({},Y)).stops&&(Y.stops=Y.stops.map(xr=>[xr[0],dr(xr[1])])),Y.default=dr(Y.default?Y.default:D.default)}if(Y.colorSpace&&(We=Y.colorSpace)!=="rgb"&&We!=="hcl"&&We!=="lab")throw new Error(`Unknown color space: "${Y.colorSpace}"`);var We;let pt,Rt,Yt;if(Ve==="exponential")pt=Hh;else if(Ve==="interval")pt=Pc;else if(Ve==="categorical"){pt=Vh,Rt=Object.create(null);for(const dr of Y.stops)Rt[dr[0]]=dr[1];Yt=typeof Y.stops[0][0]}else{if(Ve!=="identity")throw new Error(`Unknown function type "${Ve}"`);pt=yu}if(me){const dr={},xr=[];for(let vn=0;vnvn[0]),evaluate:({zoom:vn},Tn)=>Hh({stops:qr,base:Y.base},D,vn).evaluate(vn,Tn)}}if(Pe){const dr=Ve==="exponential"?{name:"exponential",base:Y.base!==void 0?Y.base:1}:null;return{kind:"camera",interpolationType:dr,interpolationFactor:vi.interpolationFactor.bind(void 0,dr),zoomStops:Y.stops.map(xr=>xr[0]),evaluate:({zoom:xr})=>pt(Y,D,xr,Rt,Yt)}}return{kind:"source",evaluate(dr,xr){const qr=xr&&xr.properties?xr.properties[Y.property]:void 0;return qr===void 0?sh(Y.default,D.default):pt(Y,D,qr,Rt,Yt)}}}function sh(Y,D,Q){return Y!==void 0?Y:D!==void 0?D:Q!==void 0?Q:void 0}function Vh(Y,D,Q,me,Pe){return sh(typeof Q===Pe?me[Q]:void 0,Y.default,D.default)}function Pc(Y,D,Q){if(Nl(Q)!=="number")return sh(Y.default,D.default);const me=Y.stops.length;if(me===1||Q<=Y.stops[0][0])return Y.stops[0][1];if(Q>=Y.stops[me-1][0])return Y.stops[me-1][1];const Pe=cn(Y.stops.map(Ve=>Ve[0]),Q);return Y.stops[Pe][1]}function Hh(Y,D,Q){const me=Y.base!==void 0?Y.base:1;if(Nl(Q)!=="number")return sh(Y.default,D.default);const Pe=Y.stops.length;if(Pe===1||Q<=Y.stops[0][0])return Y.stops[0][1];if(Q>=Y.stops[Pe-1][0])return Y.stops[Pe-1][1];const Ve=cn(Y.stops.map(dr=>dr[0]),Q),We=(function(dr,xr,qr,Jr){const vn=Jr-qr,Tn=dr-qr;return vn===0?0:xr===1?Tn/vn:(Math.pow(xr,Tn)-1)/(Math.pow(xr,vn)-1)})(Q,me,Y.stops[Ve][0],Y.stops[Ve+1][0]),pt=Y.stops[Ve][1],Rt=Y.stops[Ve+1][1],Yt=Eo[D.type]||wv;return typeof pt.evaluate=="function"?{evaluate(...dr){const xr=pt.evaluate.apply(void 0,dr),qr=Rt.evaluate.apply(void 0,dr);if(xr!==void 0&&qr!==void 0)return Yt(xr,qr,We,Y.colorSpace)}}:Yt(pt,Rt,We,Y.colorSpace)}function yu(Y,D,Q){switch(D.type){case"color":Q=lr.parse(Q);break;case"formatted":Q=mn.fromString(Q.toString());break;case"resolvedImage":Q=ha.fromString(Q.toString());break;case"padding":Q=wn.parse(Q);break;default:Nl(Q)===D.type||D.type==="enum"&&D.values[Q]||(Q=void 0)}return sh(Q,Y.default,D.default)}Yu.register(ih,{error:[{kind:"error"},[Ft],(Y,[D])=>{throw new Dt(D.evaluate(Y))}],typeof:[Ft,[Er],(Y,[D])=>$e(Vn(D.evaluate(Y)))],"to-rgba":[je(rt,4),[$t],(Y,[D])=>{const[Q,me,Pe,Ve]=D.evaluate(Y).rgb;return[255*Q,255*me,255*Pe,Ve]}],rgb:[$t,[rt,rt,rt],sv],rgba:[$t,[rt,rt,rt,rt],sv],has:{type:Nt,overloads:[[[Ft],(Y,[D])=>Uh(D.evaluate(Y),Y.properties())],[[Ft,rr],(Y,[D,Q])=>Uh(D.evaluate(Y),Q.evaluate(Y))]]},get:{type:Er,overloads:[[[Ft],(Y,[D])=>oh(D.evaluate(Y),Y.properties())],[[Ft,rr],(Y,[D,Q])=>oh(D.evaluate(Y),Q.evaluate(Y))]]},"feature-state":[Er,[Ft],(Y,[D])=>oh(D.evaluate(Y),Y.featureState||{})],properties:[rr,[],Y=>Y.properties()],"geometry-type":[Ft,[],Y=>Y.geometryType()],id:[Er,[],Y=>Y.id()],zoom:[rt,[],Y=>Y.globals.zoom],"heatmap-density":[rt,[],Y=>Y.globals.heatmapDensity||0],"line-progress":[rt,[],Y=>Y.globals.lineProgress||0],accumulated:[Er,[],Y=>Y.globals.accumulated===void 0?null:Y.globals.accumulated],"+":[rt,zf(rt),(Y,D)=>{let Q=0;for(const me of D)Q+=me.evaluate(Y);return Q}],"*":[rt,zf(rt),(Y,D)=>{let Q=1;for(const me of D)Q*=me.evaluate(Y);return Q}],"-":{type:rt,overloads:[[[rt,rt],(Y,[D,Q])=>D.evaluate(Y)-Q.evaluate(Y)],[[rt],(Y,[D])=>-D.evaluate(Y)]]},"/":[rt,[rt,rt],(Y,[D,Q])=>D.evaluate(Y)/Q.evaluate(Y)],"%":[rt,[rt,rt],(Y,[D,Q])=>D.evaluate(Y)%Q.evaluate(Y)],ln2:[rt,[],()=>Math.LN2],pi:[rt,[],()=>Math.PI],e:[rt,[],()=>Math.E],"^":[rt,[rt,rt],(Y,[D,Q])=>Math.pow(D.evaluate(Y),Q.evaluate(Y))],sqrt:[rt,[rt],(Y,[D])=>Math.sqrt(D.evaluate(Y))],log10:[rt,[rt],(Y,[D])=>Math.log(D.evaluate(Y))/Math.LN10],ln:[rt,[rt],(Y,[D])=>Math.log(D.evaluate(Y))],log2:[rt,[rt],(Y,[D])=>Math.log(D.evaluate(Y))/Math.LN2],sin:[rt,[rt],(Y,[D])=>Math.sin(D.evaluate(Y))],cos:[rt,[rt],(Y,[D])=>Math.cos(D.evaluate(Y))],tan:[rt,[rt],(Y,[D])=>Math.tan(D.evaluate(Y))],asin:[rt,[rt],(Y,[D])=>Math.asin(D.evaluate(Y))],acos:[rt,[rt],(Y,[D])=>Math.acos(D.evaluate(Y))],atan:[rt,[rt],(Y,[D])=>Math.atan(D.evaluate(Y))],min:[rt,zf(rt),(Y,D)=>Math.min(...D.map(Q=>Q.evaluate(Y)))],max:[rt,zf(rt),(Y,D)=>Math.max(...D.map(Q=>Q.evaluate(Y)))],abs:[rt,[rt],(Y,[D])=>Math.abs(D.evaluate(Y))],round:[rt,[rt],(Y,[D])=>{const Q=D.evaluate(Y);return Q<0?-Math.round(-Q):Math.round(Q)}],floor:[rt,[rt],(Y,[D])=>Math.floor(D.evaluate(Y))],ceil:[rt,[rt],(Y,[D])=>Math.ceil(D.evaluate(Y))],"filter-==":[Nt,[Ft,Er],(Y,[D,Q])=>Y.properties()[D.value]===Q.value],"filter-id-==":[Nt,[Er],(Y,[D])=>Y.id()===D.value],"filter-type-==":[Nt,[Ft],(Y,[D])=>Y.geometryType()===D.value],"filter-<":[Nt,[Ft,Er],(Y,[D,Q])=>{const me=Y.properties()[D.value],Pe=Q.value;return typeof me==typeof Pe&&me{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q":[Nt,[Ft,Er],(Y,[D,Q])=>{const me=Y.properties()[D.value],Pe=Q.value;return typeof me==typeof Pe&&me>Pe}],"filter-id->":[Nt,[Er],(Y,[D])=>{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q>me}],"filter-<=":[Nt,[Ft,Er],(Y,[D,Q])=>{const me=Y.properties()[D.value],Pe=Q.value;return typeof me==typeof Pe&&me<=Pe}],"filter-id-<=":[Nt,[Er],(Y,[D])=>{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q<=me}],"filter->=":[Nt,[Ft,Er],(Y,[D,Q])=>{const me=Y.properties()[D.value],Pe=Q.value;return typeof me==typeof Pe&&me>=Pe}],"filter-id->=":[Nt,[Er],(Y,[D])=>{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q>=me}],"filter-has":[Nt,[Er],(Y,[D])=>D.value in Y.properties()],"filter-has-id":[Nt,[],Y=>Y.id()!==null&&Y.id()!==void 0],"filter-type-in":[Nt,[je(Ft)],(Y,[D])=>D.value.indexOf(Y.geometryType())>=0],"filter-id-in":[Nt,[je(Er)],(Y,[D])=>D.value.indexOf(Y.id())>=0],"filter-in-small":[Nt,[Ft,je(Er)],(Y,[D,Q])=>Q.value.indexOf(Y.properties()[D.value])>=0],"filter-in-large":[Nt,[Ft,je(Er)],(Y,[D,Q])=>(function(me,Pe,Ve,We){for(;Ve<=We;){const pt=Ve+We>>1;if(Pe[pt]===me)return!0;Pe[pt]>me?We=pt-1:Ve=pt+1}return!1})(Y.properties()[D.value],Q.value,0,Q.value.length-1)],all:{type:Nt,overloads:[[[Nt,Nt],(Y,[D,Q])=>D.evaluate(Y)&&Q.evaluate(Y)],[zf(Nt),(Y,D)=>{for(const Q of D)if(!Q.evaluate(Y))return!1;return!0}]]},any:{type:Nt,overloads:[[[Nt,Nt],(Y,[D,Q])=>D.evaluate(Y)||Q.evaluate(Y)],[zf(Nt),(Y,D)=>{for(const Q of D)if(Q.evaluate(Y))return!0;return!1}]]},"!":[Nt,[Nt],(Y,[D])=>!D.evaluate(Y)],"is-supported-script":[Nt,[Ft],(Y,[D])=>{const Q=Y.globals&&Y.globals.isSupportedScript;return!Q||Q(D.evaluate(Y))}],upcase:[Ft,[Ft],(Y,[D])=>D.evaluate(Y).toUpperCase()],downcase:[Ft,[Ft],(Y,[D])=>D.evaluate(Y).toLowerCase()],concat:[Ft,zf(Er),(Y,D)=>D.map(Q=>yi(Q.evaluate(Y))).join("")],"resolved-locale":[Ft,[Mr],(Y,[D])=>D.evaluate(Y).resolvedLocale()]});class Rc{constructor(D,Q){var me;this.expression=D,this._warningHistory={},this._evaluator=new Ur,this._defaultValue=Q?(me=Q).type==="color"&&_h(me.default)?new lr(0,0,0,0):me.type==="color"?lr.parse(me.default)||null:me.type==="padding"?wn.parse(me.default)||null:me.type==="variableAnchorOffsetCollection"?pa.parse(me.default)||null:me.default===void 0?null:me.default:null,this._enumValues=Q&&Q.type==="enum"?Q.values:null}evaluateWithoutErrorHandling(D,Q,me,Pe,Ve,We){return this._evaluator.globals=D,this._evaluator.feature=Q,this._evaluator.featureState=me,this._evaluator.canonical=Pe,this._evaluator.availableImages=Ve||null,this._evaluator.formattedSection=We,this.expression.evaluate(this._evaluator)}evaluate(D,Q,me,Pe,Ve,We){this._evaluator.globals=D,this._evaluator.feature=Q||null,this._evaluator.featureState=me||null,this._evaluator.canonical=Pe,this._evaluator.availableImages=Ve||null,this._evaluator.formattedSection=We||null;try{const pt=this.expression.evaluate(this._evaluator);if(pt==null||typeof pt=="number"&&pt!=pt)return this._defaultValue;if(this._enumValues&&!(pt in this._enumValues))throw new Dt(`Expected value to be one of ${Object.keys(this._enumValues).map(Rt=>JSON.stringify(Rt)).join(", ")}, but found ${JSON.stringify(pt)} instead.`);return pt}catch(pt){return this._warningHistory[pt.message]||(this._warningHistory[pt.message]=!0,typeof console<"u"&&console.warn(pt.message)),this._defaultValue}}}function Of(Y){return Array.isArray(Y)&&Y.length>0&&typeof Y[0]=="string"&&Y[0]in ih}function $l(Y,D){const Q=new ln(ih,Ih,[],D?(function(Pe){const Ve={color:$t,string:Ft,number:rt,enum:Ft,boolean:Nt,formatted:Wr,padding:Sr,resolvedImage:Br,variableAnchorOffsetCollection:Mt};return Pe.type==="array"?je(Ve[Pe.value]||Er,Pe.length):Ve[Pe.type]})(D):void 0),me=Q.parse(Y,void 0,void 0,void 0,D&&D.type==="string"?{typeAnnotation:"coerce"}:void 0);return me?Tf(new Rc(me,D)):cf(Q.errors)}class Af{constructor(D,Q){this.kind=D,this._styleExpression=Q,this.isStateDependent=D!=="constant"&&!rf(Q.expression)}evaluateWithoutErrorHandling(D,Q,me,Pe,Ve,We){return this._styleExpression.evaluateWithoutErrorHandling(D,Q,me,Pe,Ve,We)}evaluate(D,Q,me,Pe,Ve,We){return this._styleExpression.evaluate(D,Q,me,Pe,Ve,We)}}class vc{constructor(D,Q,me,Pe){this.kind=D,this.zoomStops=me,this._styleExpression=Q,this.isStateDependent=D!=="camera"&&!rf(Q.expression),this.interpolationType=Pe}evaluateWithoutErrorHandling(D,Q,me,Pe,Ve,We){return this._styleExpression.evaluateWithoutErrorHandling(D,Q,me,Pe,Ve,We)}evaluate(D,Q,me,Pe,Ve,We){return this._styleExpression.evaluate(D,Q,me,Pe,Ve,We)}interpolationFactor(D,Q,me){return this.interpolationType?vi.interpolationFactor(this.interpolationType,D,Q,me):0}}function Ic(Y,D){const Q=$l(Y,D);if(Q.result==="error")return Q;const me=Q.value.expression,Pe=Dh(me);if(!Pe&&!Zu(D))return cf([new Ne("","data expressions not supported")]);const Ve=jh(me,["zoom"]);if(!Ve&&!Hf(D))return cf([new Ne("","zoom expressions not supported")]);const We=$f(me);return We||Ve?We instanceof Ne?cf([We]):We instanceof vi&&!zh(D)?cf([new Ne("",'"interpolate" expressions cannot be used with this property')]):Tf(We?new vc(Pe?"camera":"composite",Q.value,We.labels,We instanceof vi?We.interpolation:void 0):new Af(Pe?"constant":"source",Q.value)):cf([new Ne("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class uu{constructor(D,Q){this._parameters=D,this._specification=Q,pe(this,qh(this._parameters,this._specification))}static deserialize(D){return new uu(D._parameters,D._specification)}static serialize(D){return{_parameters:D._parameters,_specification:D._specification}}}function $f(Y){let D=null;if(Y instanceof $r)D=$f(Y.result);else if(Y instanceof Xo){for(const Q of Y.args)if(D=$f(Q),D)break}else(Y instanceof In||Y instanceof vi)&&Y.input instanceof Yu&&Y.input.name==="zoom"&&(D=Y);return D instanceof Ne||Y.eachChild(Q=>{const me=$f(Q);me instanceof Ne?D=me:!D&&me?D=new Ne("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&me&&D!==me&&(D=new Ne("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}function ff(Y){if(Y===!0||Y===!1)return!0;if(!Array.isArray(Y)||Y.length===0)return!1;switch(Y[0]){case"has":return Y.length>=2&&Y[1]!=="$id"&&Y[1]!=="$type";case"in":return Y.length>=3&&(typeof Y[1]!="string"||Array.isArray(Y[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return Y.length!==3||Array.isArray(Y[1])||Array.isArray(Y[2]);case"any":case"all":for(const D of Y.slice(1))if(!ff(D)&&typeof D!="boolean")return!1;return!0;default:return!0}}const Ff={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function xh(Y){if(Y==null)return{filter:()=>!0,needGeometry:!1};ff(Y)||(Y=Jf(Y));const D=$l(Y,Ff);if(D.result==="error")throw new Error(D.value.map(Q=>`${Q.key}: ${Q.message}`).join(", "));return{filter:(Q,me,Pe)=>D.value.evaluate(Q,me,{},Pe),needGeometry:Zv(Y)}}function Tv(Y,D){return YD?1:0}function Zv(Y){if(!Array.isArray(Y))return!1;if(Y[0]==="within"||Y[0]==="distance")return!0;for(let D=1;D"||D==="<="||D===">="?bh(Y[1],Y[2],D):D==="any"?(Q=Y.slice(1),["any"].concat(Q.map(Jf))):D==="all"?["all"].concat(Y.slice(1).map(Jf)):D==="none"?["all"].concat(Y.slice(1).map(Jf).map(ic)):D==="in"?Vc(Y[1],Y.slice(2)):D==="!in"?ic(Vc(Y[1],Y.slice(2))):D==="has"?wh(Y[1]):D!=="!has"||ic(wh(Y[1]));var Q}function bh(Y,D,Q){switch(Y){case"$type":return[`filter-type-${Q}`,D];case"$id":return[`filter-id-${Q}`,D];default:return[`filter-${Q}`,Y,D]}}function Vc(Y,D){if(D.length===0)return!1;switch(Y){case"$type":return["filter-type-in",["literal",D]];case"$id":return["filter-id-in",["literal",D]];default:return D.length>200&&!D.some(Q=>typeof Q!=typeof D[0])?["filter-in-large",Y,["literal",D.sort(Tv)]]:["filter-in-small",Y,["literal",D]]}}function wh(Y){switch(Y){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",Y]}}function ic(Y){return["!",Y]}function Qf(Y){const D=typeof Y;if(D==="number"||D==="boolean"||D==="string"||Y==null)return JSON.stringify(Y);if(Array.isArray(Y)){let Pe="[";for(const Ve of Y)Pe+=`${Qf(Ve)},`;return`${Pe}]`}const Q=Object.keys(Y).sort();let me="{";for(let Pe=0;Peme.maximum?[new Te(D,Q,`${Q} is greater than the maximum value ${me.maximum}`)]:[]}function lh(Y){const D=Y.valueSpec,Q=tu(Y.value.type);let me,Pe,Ve,We={};const pt=Q!=="categorical"&&Y.value.property===void 0,Rt=!pt,Yt=Nl(Y.value.stops)==="array"&&Nl(Y.value.stops[0])==="array"&&Nl(Y.value.stops[0][0])==="object",dr=nf({key:Y.key,value:Y.value,valueSpec:Y.styleSpec.function,validateSpec:Y.validateSpec,style:Y.style,styleSpec:Y.styleSpec,objectElementValidators:{stops:function(Jr){if(Q==="identity")return[new Te(Jr.key,Jr.value,'identity function may not have a "stops" property')];let vn=[];const Tn=Jr.value;return vn=vn.concat(Oh({key:Jr.key,value:Tn,valueSpec:Jr.valueSpec,validateSpec:Jr.validateSpec,style:Jr.style,styleSpec:Jr.styleSpec,arrayElementValidator:xr})),Nl(Tn)==="array"&&Tn.length===0&&vn.push(new Te(Jr.key,Tn,"array must have at least one stop")),vn},default:function(Jr){return Jr.validateSpec({key:Jr.key,value:Jr.value,valueSpec:D,validateSpec:Jr.validateSpec,style:Jr.style,styleSpec:Jr.styleSpec})}}});return Q==="identity"&&pt&&dr.push(new Te(Y.key,Y.value,'missing required property "property"')),Q==="identity"||Y.value.stops||dr.push(new Te(Y.key,Y.value,'missing required property "stops"')),Q==="exponential"&&Y.valueSpec.expression&&!zh(Y.valueSpec)&&dr.push(new Te(Y.key,Y.value,"exponential functions not supported")),Y.styleSpec.$version>=8&&(Rt&&!Zu(Y.valueSpec)?dr.push(new Te(Y.key,Y.value,"property functions not supported")):pt&&!Hf(Y.valueSpec)&&dr.push(new Te(Y.key,Y.value,"zoom functions not supported"))),Q!=="categorical"&&!Yt||Y.value.property!==void 0||dr.push(new Te(Y.key,Y.value,'"property" property is required')),dr;function xr(Jr){let vn=[];const Tn=Jr.value,Bn=Jr.key;if(Nl(Tn)!=="array")return[new Te(Bn,Tn,`array expected, ${Nl(Tn)} found`)];if(Tn.length!==2)return[new Te(Bn,Tn,`array length 2 expected, length ${Tn.length} found`)];if(Yt){if(Nl(Tn[0])!=="object")return[new Te(Bn,Tn,`object expected, ${Nl(Tn[0])} found`)];if(Tn[0].zoom===void 0)return[new Te(Bn,Tn,"object stop key must have zoom")];if(Tn[0].value===void 0)return[new Te(Bn,Tn,"object stop key must have value")];if(Ve&&Ve>tu(Tn[0].zoom))return[new Te(Bn,Tn[0].zoom,"stop zoom values must appear in ascending order")];tu(Tn[0].zoom)!==Ve&&(Ve=tu(Tn[0].zoom),Pe=void 0,We={}),vn=vn.concat(nf({key:`${Bn}[0]`,value:Tn[0],valueSpec:{zoom:{}},validateSpec:Jr.validateSpec,style:Jr.style,styleSpec:Jr.styleSpec,objectElementValidators:{zoom:iu,value:qr}}))}else vn=vn.concat(qr({key:`${Bn}[0]`,value:Tn[0],validateSpec:Jr.validateSpec,style:Jr.style,styleSpec:Jr.styleSpec},Tn));return Of(Dc(Tn[1]))?vn.concat([new Te(`${Bn}[1]`,Tn[1],"expressions are not allowed in function stops.")]):vn.concat(Jr.validateSpec({key:`${Bn}[1]`,value:Tn[1],valueSpec:D,validateSpec:Jr.validateSpec,style:Jr.style,styleSpec:Jr.styleSpec}))}function qr(Jr,vn){const Tn=Nl(Jr.value),Bn=tu(Jr.value),da=Jr.value!==null?Jr.value:vn;if(me){if(Tn!==me)return[new Te(Jr.key,da,`${Tn} stop domain type must match previous stop domain type ${me}`)]}else me=Tn;if(Tn!=="number"&&Tn!=="string"&&Tn!=="boolean")return[new Te(Jr.key,da,"stop domain value must be a number, string, or boolean")];if(Tn!=="number"&&Q!=="categorical"){let ui=`number expected, ${Tn} found`;return Zu(D)&&Q===void 0&&(ui+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Te(Jr.key,da,ui)]}return Q!=="categorical"||Tn!=="number"||isFinite(Bn)&&Math.floor(Bn)===Bn?Q!=="categorical"&&Tn==="number"&&Pe!==void 0&&Bnnew Te(`${Y.key}${me.key}`,Y.value,me.message));const Q=D.value.expression||D.value._styleExpression.expression;if(Y.expressionContext==="property"&&Y.propertyKey==="text-font"&&!Q.outputDefined())return[new Te(Y.key,Y.value,`Invalid data expression for "${Y.propertyKey}". Output values must be contained as literals within the expression.`)];if(Y.expressionContext==="property"&&Y.propertyType==="layout"&&!rf(Q))return[new Te(Y.key,Y.value,'"feature-state" data expressions are not supported with layout properties.')];if(Y.expressionContext==="filter"&&!rf(Q))return[new Te(Y.key,Y.value,'"feature-state" data expressions are not supported with filters.')];if(Y.expressionContext&&Y.expressionContext.indexOf("cluster")===0){if(!jh(Q,["zoom","feature-state"]))return[new Te(Y.key,Y.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(Y.expressionContext==="cluster-initial"&&!Dh(Q))return[new Te(Y.key,Y.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Hc(Y){const D=Y.key,Q=Y.value,me=Y.valueSpec,Pe=[];return Array.isArray(me.values)?me.values.indexOf(tu(Q))===-1&&Pe.push(new Te(D,Q,`expected one of [${me.values.join(", ")}], ${JSON.stringify(Q)} found`)):Object.keys(me.values).indexOf(tu(Q))===-1&&Pe.push(new Te(D,Q,`expected one of [${Object.keys(me.values).join(", ")}], ${JSON.stringify(Q)} found`)),Pe}function uh(Y){return ff(Dc(Y.value))?Bf(pe({},Y,{expressionContext:"filter",valueSpec:{value:"boolean"}})):hf(Y)}function hf(Y){const D=Y.value,Q=Y.key;if(Nl(D)!=="array")return[new Te(Q,D,`array expected, ${Nl(D)} found`)];const me=Y.styleSpec;let Pe,Ve=[];if(D.length<1)return[new Te(Q,D,"filter array must have at least 1 element")];switch(Ve=Ve.concat(Hc({key:`${Q}[0]`,value:D[0],valueSpec:me.filter_operator,style:Y.style,styleSpec:Y.styleSpec})),tu(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&tu(D[1])==="$type"&&Ve.push(new Te(Q,D,`"$type" cannot be use with operator "${D[0]}"`));case"==":case"!=":D.length!==3&&Ve.push(new Te(Q,D,`filter array for operator "${D[0]}" must have 3 elements`));case"in":case"!in":D.length>=2&&(Pe=Nl(D[1]),Pe!=="string"&&Ve.push(new Te(`${Q}[1]`,D[1],`string expected, ${Pe} found`)));for(let We=2;We{Yt in Q&&D.push(new Te(me,Q[Yt],`"${Yt}" is prohibited for ref layers`))}),Pe.layers.forEach(Yt=>{tu(Yt.id)===pt&&(Rt=Yt)}),Rt?Rt.ref?D.push(new Te(me,Q.ref,"ref cannot reference another ref layer")):We=tu(Rt.type):D.push(new Te(me,Q.ref,`ref layer "${pt}" not found`))}else if(We!=="background")if(Q.source){const Rt=Pe.sources&&Pe.sources[Q.source],Yt=Rt&&tu(Rt.type);Rt?Yt==="vector"&&We==="raster"?D.push(new Te(me,Q.source,`layer "${Q.id}" requires a raster source`)):Yt!=="raster-dem"&&We==="hillshade"?D.push(new Te(me,Q.source,`layer "${Q.id}" requires a raster-dem source`)):Yt==="raster"&&We!=="raster"?D.push(new Te(me,Q.source,`layer "${Q.id}" requires a vector source`)):Yt!=="vector"||Q["source-layer"]?Yt==="raster-dem"&&We!=="hillshade"?D.push(new Te(me,Q.source,"raster-dem source can only be used with layer type 'hillshade'.")):We!=="line"||!Q.paint||!Q.paint["line-gradient"]||Yt==="geojson"&&Rt.lineMetrics||D.push(new Te(me,Q,`layer "${Q.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):D.push(new Te(me,Q,`layer "${Q.id}" must specify a "source-layer"`)):D.push(new Te(me,Q.source,`source "${Q.source}" not found`))}else D.push(new Te(me,Q,'missing required property "source"'));return D=D.concat(nf({key:me,value:Q,valueSpec:Ve.layer,style:Y.style,styleSpec:Y.styleSpec,validateSpec:Y.validateSpec,objectElementValidators:{"*":()=>[],type:()=>Y.validateSpec({key:`${me}.type`,value:Q.type,valueSpec:Ve.layer.type,style:Y.style,styleSpec:Y.styleSpec,validateSpec:Y.validateSpec,object:Q,objectKey:"type"}),filter:uh,layout:Rt=>nf({layer:Q,key:Rt.key,value:Rt.value,style:Rt.style,styleSpec:Rt.styleSpec,validateSpec:Rt.validateSpec,objectElementValidators:{"*":Yt=>lc(pe({layerType:We},Yt))}}),paint:Rt=>nf({layer:Q,key:Rt.key,value:Rt.value,style:Rt.style,styleSpec:Rt.styleSpec,validateSpec:Rt.validateSpec,objectElementValidators:{"*":Yt=>Av(pe({layerType:We},Yt))}})}})),D}function Gc(Y){const D=Y.value,Q=Y.key,me=Nl(D);return me!=="string"?[new Te(Q,D,`string expected, ${me} found`)]:[]}const Sf={promoteId:function({key:Y,value:D}){if(Nl(D)==="string")return Gc({key:Y,value:D});{const Q=[];for(const me in D)Q.push(...Gc({key:`${Y}.${me}`,value:D[me]}));return Q}}};function vf(Y){const D=Y.value,Q=Y.key,me=Y.styleSpec,Pe=Y.style,Ve=Y.validateSpec;if(!D.type)return[new Te(Q,D,'"type" is required')];const We=tu(D.type);let pt;switch(We){case"vector":case"raster":return pt=nf({key:Q,value:D,valueSpec:me[`source_${We.replace("-","_")}`],style:Y.style,styleSpec:me,objectElementValidators:Sf,validateSpec:Ve}),pt;case"raster-dem":return pt=(function(Rt){var Yt;const dr=(Yt=Rt.sourceName)!==null&&Yt!==void 0?Yt:"",xr=Rt.value,qr=Rt.styleSpec,Jr=qr.source_raster_dem,vn=Rt.style;let Tn=[];const Bn=Nl(xr);if(xr===void 0)return Tn;if(Bn!=="object")return Tn.push(new Te("source_raster_dem",xr,`object expected, ${Bn} found`)),Tn;const da=tu(xr.encoding)==="custom",ui=["redFactor","greenFactor","blueFactor","baseShift"],Ba=Rt.value.encoding?`"${Rt.value.encoding}"`:"Default";for(const ti in xr)!da&&ui.includes(ti)?Tn.push(new Te(ti,xr[ti],`In "${dr}": "${ti}" is only valid when "encoding" is set to "custom". ${Ba} encoding found`)):Jr[ti]?Tn=Tn.concat(Rt.validateSpec({key:ti,value:xr[ti],valueSpec:Jr[ti],validateSpec:Rt.validateSpec,style:vn,styleSpec:qr})):Tn.push(new Te(ti,xr[ti],`unknown property "${ti}"`));return Tn})({sourceName:Q,value:D,style:Y.style,styleSpec:me,validateSpec:Ve}),pt;case"geojson":if(pt=nf({key:Q,value:D,valueSpec:me.source_geojson,style:Pe,styleSpec:me,validateSpec:Ve,objectElementValidators:Sf}),D.cluster)for(const Rt in D.clusterProperties){const[Yt,dr]=D.clusterProperties[Rt],xr=typeof Yt=="string"?[Yt,["accumulated"],["get",Rt]]:Yt;pt.push(...Bf({key:`${Q}.${Rt}.map`,value:dr,expressionContext:"cluster-map"})),pt.push(...Bf({key:`${Q}.${Rt}.reduce`,value:xr,expressionContext:"cluster-reduce"}))}return pt;case"video":return nf({key:Q,value:D,valueSpec:me.source_video,style:Pe,validateSpec:Ve,styleSpec:me});case"image":return nf({key:Q,value:D,valueSpec:me.source_image,style:Pe,validateSpec:Ve,styleSpec:me});case"canvas":return[new Te(Q,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Hc({key:`${Q}.type`,value:D.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function bu(Y){const D=Y.value,Q=Y.styleSpec,me=Q.light,Pe=Y.style;let Ve=[];const We=Nl(D);if(D===void 0)return Ve;if(We!=="object")return Ve=Ve.concat([new Te("light",D,`object expected, ${We} found`)]),Ve;for(const pt in D){const Rt=pt.match(/^(.*)-transition$/);Ve=Ve.concat(Rt&&me[Rt[1]]&&me[Rt[1]].transition?Y.validateSpec({key:pt,value:D[pt],valueSpec:Q.transition,validateSpec:Y.validateSpec,style:Pe,styleSpec:Q}):me[pt]?Y.validateSpec({key:pt,value:D[pt],valueSpec:me[pt],validateSpec:Y.validateSpec,style:Pe,styleSpec:Q}):[new Te(pt,D[pt],`unknown property "${pt}"`)])}return Ve}function _c(Y){const D=Y.value,Q=Y.styleSpec,me=Q.sky,Pe=Y.style,Ve=Nl(D);if(D===void 0)return[];if(Ve!=="object")return[new Te("sky",D,`object expected, ${Ve} found`)];let We=[];for(const pt in D)We=We.concat(me[pt]?Y.validateSpec({key:pt,value:D[pt],valueSpec:me[pt],style:Pe,styleSpec:Q}):[new Te(pt,D[pt],`unknown property "${pt}"`)]);return We}function hu(Y){const D=Y.value,Q=Y.styleSpec,me=Q.terrain,Pe=Y.style;let Ve=[];const We=Nl(D);if(D===void 0)return Ve;if(We!=="object")return Ve=Ve.concat([new Te("terrain",D,`object expected, ${We} found`)]),Ve;for(const pt in D)Ve=Ve.concat(me[pt]?Y.validateSpec({key:pt,value:D[pt],valueSpec:me[pt],validateSpec:Y.validateSpec,style:Pe,styleSpec:Q}):[new Te(pt,D[pt],`unknown property "${pt}"`)]);return Ve}function Nf(Y){let D=[];const Q=Y.value,me=Y.key;if(Array.isArray(Q)){const Pe=[],Ve=[];for(const We in Q)Q[We].id&&Pe.includes(Q[We].id)&&D.push(new Te(me,Q,`all the sprites' ids must be unique, but ${Q[We].id} is duplicated`)),Pe.push(Q[We].id),Q[We].url&&Ve.includes(Q[We].url)&&D.push(new Te(me,Q,`all the sprites' URLs must be unique, but ${Q[We].url} is duplicated`)),Ve.push(Q[We].url),D=D.concat(nf({key:`${me}[${We}]`,value:Q[We],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:Y.validateSpec}));return D}return Gc({key:me,value:Q})}const df={"*":()=>[],array:Oh,boolean:function(Y){const D=Y.value,Q=Y.key,me=Nl(D);return me!=="boolean"?[new Te(Q,D,`boolean expected, ${me} found`)]:[]},number:iu,color:function(Y){const D=Y.key,Q=Y.value,me=Nl(Q);return me!=="string"?[new Te(D,Q,`color expected, ${me} found`)]:lr.parse(String(Q))?[]:[new Te(D,Q,`color expected, "${Q}" found`)]},constants:eh,enum:Hc,filter:uh,function:lh,layer:Xh,object:nf,source:vf,light:bu,sky:_c,terrain:hu,projection:function(Y){const D=Y.value,Q=Y.styleSpec,me=Q.projection,Pe=Y.style,Ve=Nl(D);if(D===void 0)return[];if(Ve!=="object")return[new Te("projection",D,`object expected, ${Ve} found`)];let We=[];for(const pt in D)We=We.concat(me[pt]?Y.validateSpec({key:pt,value:D[pt],valueSpec:me[pt],style:Pe,styleSpec:Q}):[new Te(pt,D[pt],`unknown property "${pt}"`)]);return We},string:Gc,formatted:function(Y){return Gc(Y).length===0?[]:Bf(Y)},resolvedImage:function(Y){return Gc(Y).length===0?[]:Bf(Y)},padding:function(Y){const D=Y.key,Q=Y.value;if(Nl(Q)==="array"){if(Q.length<1||Q.length>4)return[new Te(D,Q,`padding requires 1 to 4 values; ${Q.length} values found`)];const me={type:"number"};let Pe=[];for(let Ve=0;Ve[]}})),Y.constants&&(Q=Q.concat(eh({key:"constants",value:Y.constants}))),nn(Q)}function dn(Y){return function(D){return Y(qi(ao({},D),{validateSpec:Fh}))}}function nn(Y){return[].concat(Y).sort((D,Q)=>D.line-Q.line)}function On(Y){return function(...D){return nn(Y.apply(this,D))}}Pr.source=On(dn(vf)),Pr.sprite=On(dn(Nf)),Pr.glyphs=On(dn(ur)),Pr.light=On(dn(bu)),Pr.sky=On(dn(_c)),Pr.terrain=On(dn(hu)),Pr.layer=On(dn(Xh)),Pr.filter=On(dn(uh)),Pr.paintProperty=On(dn(Av)),Pr.layoutProperty=On(dn(lc));const Ta=Pr,xa=Ta.light,ri=Ta.sky,fi=Ta.paintProperty,Ni=Ta.layoutProperty;function Va(Y,D){let Q=!1;if(D&&D.length)for(const me of D)Y.fire(new H(new Error(me.message))),Q=!0;return Q}class Ai{constructor(D,Q,me){const Pe=this.cells=[];if(D instanceof ArrayBuffer){this.arrayBuffer=D;const We=new Int32Array(this.arrayBuffer);D=We[0],this.d=(Q=We[1])+2*(me=We[2]);for(let Rt=0;Rt=xr[vn+0]&&Pe>=xr[vn+1])?(pt[Jr]=!0,We.push(dr[Jr])):pt[Jr]=!1}}}}_forEachCell(D,Q,me,Pe,Ve,We,pt,Rt){const Yt=this._convertToCellCoord(D),dr=this._convertToCellCoord(Q),xr=this._convertToCellCoord(me),qr=this._convertToCellCoord(Pe);for(let Jr=Yt;Jr<=xr;Jr++)for(let vn=dr;vn<=qr;vn++){const Tn=this.d*vn+Jr;if((!Rt||Rt(this._convertFromCellCoord(Jr),this._convertFromCellCoord(vn),this._convertFromCellCoord(Jr+1),this._convertFromCellCoord(vn+1)))&&Ve.call(this,D,Q,me,Pe,Tn,We,pt,Rt))return}}_convertFromCellCoord(D){return(D-this.padding)/this.scale}_convertToCellCoord(D){return Math.max(0,Math.min(this.d-1,Math.floor(D*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const D=this.cells,Q=3+this.cells.length+1+1;let me=0;for(let We=0;We=0)continue;const We=Y[Ve];Pe[Ve]=ei[Q].shallow.indexOf(Ve)>=0?We:Yo(We,D)}Y instanceof Error&&(Pe.message=Y.message)}if(Pe.$name)throw new Error("$name property is reserved for worker serialization logic.");return Q!=="Object"&&(Pe.$name=Q),Pe}function Vo(Y){if(Fo(Y))return Y;if(Array.isArray(Y))return Y.map(Vo);if(typeof Y!="object")throw new Error("can't deserialize object of type "+typeof Y);const D=jo(Y)||"Object";if(!ei[D])throw new Error(`can't deserialize unregistered class ${D}`);const{klass:Q}=ei[D];if(!Q)throw new Error(`can't deserialize unregistered class ${D}`);if(Q.deserialize)return Q.deserialize(Y);const me=Object.create(Q.prototype);for(const Pe of Object.keys(Y)){if(Pe==="$name")continue;const Ve=Y[Pe];me[Pe]=ei[D].shallow.indexOf(Pe)>=0?Ve:Vo(Ve)}return me}class Ki{constructor(){this.first=!0}update(D,Q){const me=Math.floor(D);return this.first?(this.first=!1,this.lastIntegerZoom=me,this.lastIntegerZoomTime=0,this.lastZoom=D,this.lastFloorZoom=me,!0):(this.lastFloorZoom>me?(this.lastIntegerZoom=me+1,this.lastIntegerZoomTime=Q):this.lastFloorZoomY>=128&&Y<=255,"Hangul Jamo":Y=>Y>=4352&&Y<=4607,Khmer:Y=>Y>=6016&&Y<=6143,"General Punctuation":Y=>Y>=8192&&Y<=8303,"Letterlike Symbols":Y=>Y>=8448&&Y<=8527,"Number Forms":Y=>Y>=8528&&Y<=8591,"Miscellaneous Technical":Y=>Y>=8960&&Y<=9215,"Control Pictures":Y=>Y>=9216&&Y<=9279,"Optical Character Recognition":Y=>Y>=9280&&Y<=9311,"Enclosed Alphanumerics":Y=>Y>=9312&&Y<=9471,"Geometric Shapes":Y=>Y>=9632&&Y<=9727,"Miscellaneous Symbols":Y=>Y>=9728&&Y<=9983,"Miscellaneous Symbols and Arrows":Y=>Y>=11008&&Y<=11263,"Ideographic Description Characters":Y=>Y>=12272&&Y<=12287,"CJK Symbols and Punctuation":Y=>Y>=12288&&Y<=12351,Katakana:Y=>Y>=12448&&Y<=12543,Kanbun:Y=>Y>=12688&&Y<=12703,"CJK Strokes":Y=>Y>=12736&&Y<=12783,"Enclosed CJK Letters and Months":Y=>Y>=12800&&Y<=13055,"CJK Compatibility":Y=>Y>=13056&&Y<=13311,"Yijing Hexagram Symbols":Y=>Y>=19904&&Y<=19967,"Private Use Area":Y=>Y>=57344&&Y<=63743,"Vertical Forms":Y=>Y>=65040&&Y<=65055,"CJK Compatibility Forms":Y=>Y>=65072&&Y<=65103,"Small Form Variants":Y=>Y>=65104&&Y<=65135,"Halfwidth and Fullwidth Forms":Y=>Y>=65280&&Y<=65519};function is(Y){for(const D of Y)if(rl(D.charCodeAt(0)))return!0;return!1}function Us(Y){for(const D of Y)if(!Ml(D.charCodeAt(0)))return!1;return!0}function Al(Y){const D=Y.map(Q=>{try{return new RegExp(`\\p{sc=${Q}}`,"u").source}catch{return null}}).filter(Q=>Q);return new RegExp(D.join("|"),"u")}const Xl=Al(["Arab","Dupl","Mong","Ougr","Syrc"]);function Ml(Y){return!Xl.test(String.fromCodePoint(Y))}const Yl=Al(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function rl(Y){return!(Y!==746&&Y!==747&&(Y<4352||!(Ri["CJK Compatibility Forms"](Y)&&!(Y>=65097&&Y<=65103)||Ri["CJK Compatibility"](Y)||Ri["CJK Strokes"](Y)||!(!Ri["CJK Symbols and Punctuation"](Y)||Y>=12296&&Y<=12305||Y>=12308&&Y<=12319||Y===12336)||Ri["Enclosed CJK Letters and Months"](Y)||Ri["Ideographic Description Characters"](Y)||Ri.Kanbun(Y)||Ri.Katakana(Y)&&Y!==12540||!(!Ri["Halfwidth and Fullwidth Forms"](Y)||Y===65288||Y===65289||Y===65293||Y>=65306&&Y<=65310||Y===65339||Y===65341||Y===65343||Y>=65371&&Y<=65503||Y===65507||Y>=65512&&Y<=65519)||!(!Ri["Small Form Variants"](Y)||Y>=65112&&Y<=65118||Y>=65123&&Y<=65126)||Ri["Vertical Forms"](Y)||Ri["Yijing Hexagram Symbols"](Y)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(Y))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(Y))||Yl.test(String.fromCodePoint(Y)))))}function Su(Y){return!(rl(Y)||(function(D){return!!(Ri["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||Ri["General Punctuation"](D)&&(D===8214||D===8224||D===8225||D===8240||D===8241||D===8251||D===8252||D===8258||D===8263||D===8264||D===8265||D===8273)||Ri["Letterlike Symbols"](D)||Ri["Number Forms"](D)||Ri["Miscellaneous Technical"](D)&&(D>=8960&&D<=8967||D>=8972&&D<=8991||D>=8996&&D<=9e3||D===9003||D>=9085&&D<=9114||D>=9150&&D<=9165||D===9167||D>=9169&&D<=9179||D>=9186&&D<=9215)||Ri["Control Pictures"](D)&&D!==9251||Ri["Optical Character Recognition"](D)||Ri["Enclosed Alphanumerics"](D)||Ri["Geometric Shapes"](D)||Ri["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||Ri["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||Ri["CJK Symbols and Punctuation"](D)||Ri.Katakana(D)||Ri["Private Use Area"](D)||Ri["CJK Compatibility Forms"](D)||Ri["Small Form Variants"](D)||Ri["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)})(Y))}const wu=Al(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function ql(Y){return wu.test(String.fromCodePoint(Y))}function bo(Y,D){return!(!D&&ql(Y)||Y>=2304&&Y<=3583||Y>=3840&&Y<=4255||Ri.Khmer(Y))}function xs(Y){for(const D of Y)if(ql(D.charCodeAt(0)))return!0;return!1}const zl=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(Y){this.pluginStatus=Y.pluginStatus,this.pluginURL=Y.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(Y){this.applyArabicShaping=Y.applyArabicShaping,this.processBidirectionalText=Y.processBidirectionalText,this.processStyledBidirectionalText=Y.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class pl{constructor(D,Q){this.zoom=D,Q?(this.now=Q.now,this.fadeDuration=Q.fadeDuration,this.zoomHistory=Q.zoomHistory,this.transition=Q.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ki,this.transition={})}isSupportedScript(D){return(function(Q,me){for(const Pe of Q)if(!bo(Pe.charCodeAt(0),me))return!1;return!0})(D,zl.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const D=this.zoom,Q=D-Math.floor(D),me=this.crossFadingFactor();return D>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:Q+(1-Q)*me}:{fromScale:.5,toScale:1,t:1-(1-me)*Q}}}class dc{constructor(D,Q){this.property=D,this.value=Q,this.expression=(function(me,Pe){if(_h(me))return new uu(me,Pe);if(Of(me)){const Ve=Ic(me,Pe);if(Ve.result==="error")throw new Error(Ve.value.map(We=>`${We.key}: ${We.message}`).join(", "));return Ve.value}{let Ve=me;return Pe.type==="color"&&typeof me=="string"?Ve=lr.parse(me):Pe.type!=="padding"||typeof me!="number"&&!Array.isArray(me)?Pe.type==="variableAnchorOffsetCollection"&&Array.isArray(me)&&(Ve=pa.parse(me)):Ve=wn.parse(me),{kind:"constant",evaluate:()=>Ve}}})(Q===void 0?D.specification.default:Q,D.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(D,Q,me){return this.property.possiblyEvaluate(this,D,Q,me)}}class pc{constructor(D){this.property=D,this.value=new dc(D,void 0)}transitioned(D,Q){return new Gf(this.property,this.value,Q,M({},D.transition,this.transition),D.now)}untransitioned(){return new Gf(this.property,this.value,null,{},0)}}class xc{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitionablePropertyValues)}getValue(D){return u(this._values[D].value.value)}setValue(D,Q){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new pc(this._values[D].property)),this._values[D].value=new dc(this._values[D].property,Q===null?void 0:u(Q))}getTransition(D){return u(this._values[D].transition)}setTransition(D,Q){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new pc(this._values[D].property)),this._values[D].transition=u(Q)||void 0}serialize(){const D={};for(const Q of Object.keys(this._values)){const me=this.getValue(Q);me!==void 0&&(D[Q]=me);const Pe=this.getTransition(Q);Pe!==void 0&&(D[`${Q}-transition`]=Pe)}return D}transitioned(D,Q){const me=new mc(this._properties);for(const Pe of Object.keys(this._values))me._values[Pe]=this._values[Pe].transitioned(D,Q._values[Pe]);return me}untransitioned(){const D=new mc(this._properties);for(const Q of Object.keys(this._values))D._values[Q]=this._values[Q].untransitioned();return D}}class Gf{constructor(D,Q,me,Pe,Ve){this.property=D,this.value=Q,this.begin=Ve+Pe.delay||0,this.end=this.begin+Pe.duration||0,D.specification.transition&&(Pe.delay||Pe.duration)&&(this.prior=me)}possiblyEvaluate(D,Q,me){const Pe=D.now||0,Ve=this.value.possiblyEvaluate(D,Q,me),We=this.prior;if(We){if(Pe>this.end)return this.prior=null,Ve;if(this.value.isDataDriven())return this.prior=null,Ve;if(Pe=1)return 1;const Yt=Rt*Rt,dr=Yt*Rt;return 4*(Rt<.5?dr:3*(Rt-Yt)+dr-.75)})(pt))}}return Ve}}class mc{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitioningPropertyValues)}possiblyEvaluate(D,Q,me){const Pe=new Ef(this._properties);for(const Ve of Object.keys(this._values))Pe._values[Ve]=this._values[Ve].possiblyEvaluate(D,Q,me);return Pe}hasTransition(){for(const D of Object.keys(this._values))if(this._values[D].prior)return!0;return!1}}class Mf{constructor(D){this._properties=D,this._values=Object.create(D.defaultPropertyValues)}hasValue(D){return this._values[D].value!==void 0}getValue(D){return u(this._values[D].value)}setValue(D,Q){this._values[D]=new dc(this._values[D].property,Q===null?void 0:u(Q))}serialize(){const D={};for(const Q of Object.keys(this._values)){const me=this.getValue(Q);me!==void 0&&(D[Q]=me)}return D}possiblyEvaluate(D,Q,me){const Pe=new Ef(this._properties);for(const Ve of Object.keys(this._values))Pe._values[Ve]=this._values[Ve].possiblyEvaluate(D,Q,me);return Pe}}class Mu{constructor(D,Q,me){this.property=D,this.value=Q,this.parameters=me}isConstant(){return this.value.kind==="constant"}constantOr(D){return this.value.kind==="constant"?this.value.value:D}evaluate(D,Q,me,Pe){return this.property.evaluate(this.value,this.parameters,D,Q,me,Pe)}}class Ef{constructor(D){this._properties=D,this._values=Object.create(D.defaultPossiblyEvaluatedValues)}get(D){return this._values[D]}}class Zo{constructor(D){this.specification=D}possiblyEvaluate(D,Q){if(D.isDataDriven())throw new Error("Value should not be data driven");return D.expression.evaluate(Q)}interpolate(D,Q,me){const Pe=Eo[this.specification.type];return Pe?Pe(D,Q,me):D}}class ss{constructor(D,Q){this.specification=D,this.overrides=Q}possiblyEvaluate(D,Q,me,Pe){return new Mu(this,D.expression.kind==="constant"||D.expression.kind==="camera"?{kind:"constant",value:D.expression.evaluate(Q,null,{},me,Pe)}:D.expression,Q)}interpolate(D,Q,me){if(D.value.kind!=="constant"||Q.value.kind!=="constant")return D;if(D.value.value===void 0||Q.value.value===void 0)return new Mu(this,{kind:"constant",value:void 0},D.parameters);const Pe=Eo[this.specification.type];if(Pe){const Ve=Pe(D.value.value,Q.value.value,me);return new Mu(this,{kind:"constant",value:Ve},D.parameters)}return D}evaluate(D,Q,me,Pe,Ve,We){return D.kind==="constant"?D.value:D.evaluate(Q,me,Pe,Ve,We)}}class kf extends ss{possiblyEvaluate(D,Q,me,Pe){if(D.value===void 0)return new Mu(this,{kind:"constant",value:void 0},Q);if(D.expression.kind==="constant"){const Ve=D.expression.evaluate(Q,null,{},me,Pe),We=D.property.specification.type==="resolvedImage"&&typeof Ve!="string"?Ve.name:Ve,pt=this._calculate(We,We,We,Q);return new Mu(this,{kind:"constant",value:pt},Q)}if(D.expression.kind==="camera"){const Ve=this._calculate(D.expression.evaluate({zoom:Q.zoom-1}),D.expression.evaluate({zoom:Q.zoom}),D.expression.evaluate({zoom:Q.zoom+1}),Q);return new Mu(this,{kind:"constant",value:Ve},Q)}return new Mu(this,D.expression,Q)}evaluate(D,Q,me,Pe,Ve,We){if(D.kind==="source"){const pt=D.evaluate(Q,me,Pe,Ve,We);return this._calculate(pt,pt,pt,Q)}return D.kind==="composite"?this._calculate(D.evaluate({zoom:Math.floor(Q.zoom)-1},me,Pe),D.evaluate({zoom:Math.floor(Q.zoom)},me,Pe),D.evaluate({zoom:Math.floor(Q.zoom)+1},me,Pe),Q):D.value}_calculate(D,Q,me,Pe){return Pe.zoom>Pe.zoomHistory.lastIntegerZoom?{from:D,to:Q}:{from:me,to:Q}}interpolate(D){return D}}class Xc{constructor(D){this.specification=D}possiblyEvaluate(D,Q,me,Pe){if(D.value!==void 0){if(D.expression.kind==="constant"){const Ve=D.expression.evaluate(Q,null,{},me,Pe);return this._calculate(Ve,Ve,Ve,Q)}return this._calculate(D.expression.evaluate(new pl(Math.floor(Q.zoom-1),Q)),D.expression.evaluate(new pl(Math.floor(Q.zoom),Q)),D.expression.evaluate(new pl(Math.floor(Q.zoom+1),Q)),Q)}}_calculate(D,Q,me,Pe){return Pe.zoom>Pe.zoomHistory.lastIntegerZoom?{from:D,to:Q}:{from:me,to:Q}}interpolate(D){return D}}class zc{constructor(D){this.specification=D}possiblyEvaluate(D,Q,me,Pe){return!!D.expression.evaluate(Q,null,{},me,Pe)}interpolate(){return!1}}class Ue{constructor(D){this.properties=D,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const Q in D){const me=D[Q];me.specification.overridable&&this.overridableProperties.push(Q);const Pe=this.defaultPropertyValues[Q]=new dc(me,void 0),Ve=this.defaultTransitionablePropertyValues[Q]=new pc(me);this.defaultTransitioningPropertyValues[Q]=Ve.untransitioned(),this.defaultPossiblyEvaluatedValues[Q]=Pe.possiblyEvaluate({})}}}Na("DataDrivenProperty",ss),Na("DataConstantProperty",Zo),Na("CrossFadedDataDrivenProperty",kf),Na("CrossFadedProperty",Xc),Na("ColorRampProperty",zc);const P="-transition";class oe extends ae{constructor(D,Q){if(super(),this.id=D.id,this.type=D.type,this._featureFilter={filter:()=>!0,needGeometry:!1},D.type!=="custom"&&(this.metadata=D.metadata,this.minzoom=D.minzoom,this.maxzoom=D.maxzoom,D.type!=="background"&&(this.source=D.source,this.sourceLayer=D["source-layer"],this.filter=D.filter),Q.layout&&(this._unevaluatedLayout=new Mf(Q.layout)),Q.paint)){this._transitionablePaint=new xc(Q.paint);for(const me in D.paint)this.setPaintProperty(me,D.paint[me],{validate:!1});for(const me in D.layout)this.setLayoutProperty(me,D.layout[me],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ef(Q.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(D){return D==="visibility"?this.visibility:this._unevaluatedLayout.getValue(D)}setLayoutProperty(D,Q,me={}){Q!=null&&this._validate(Ni,`layers.${this.id}.layout.${D}`,D,Q,me)||(D!=="visibility"?this._unevaluatedLayout.setValue(D,Q):this.visibility=Q)}getPaintProperty(D){return D.endsWith(P)?this._transitionablePaint.getTransition(D.slice(0,-11)):this._transitionablePaint.getValue(D)}setPaintProperty(D,Q,me={}){if(Q!=null&&this._validate(fi,`layers.${this.id}.paint.${D}`,D,Q,me))return!1;if(D.endsWith(P))return this._transitionablePaint.setTransition(D.slice(0,-11),Q||void 0),!1;{const Pe=this._transitionablePaint._values[D],Ve=Pe.property.specification["property-type"]==="cross-faded-data-driven",We=Pe.value.isDataDriven(),pt=Pe.value;this._transitionablePaint.setValue(D,Q),this._handleSpecialPaintPropertyUpdate(D);const Rt=this._transitionablePaint._values[D].value;return Rt.isDataDriven()||We||Ve||this._handleOverridablePaintPropertyUpdate(D,pt,Rt)}}_handleSpecialPaintPropertyUpdate(D){}_handleOverridablePaintPropertyUpdate(D,Q,me){return!1}isHidden(D){return!!(this.minzoom&&D=this.maxzoom)||this.visibility==="none"}updateTransitions(D){this._transitioningPaint=this._transitionablePaint.transitioned(D,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(D,Q){D.getCrossfadeParameters&&(this._crossfadeParameters=D.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(D,void 0,Q)),this.paint=this._transitioningPaint.possiblyEvaluate(D,void 0,Q)}serialize(){const D={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(D.layout=D.layout||{},D.layout.visibility=this.visibility),m(D,(Q,me)=>!(Q===void 0||me==="layout"&&!Object.keys(Q).length||me==="paint"&&!Object.keys(Q).length))}_validate(D,Q,me,Pe,Ve={}){return(!Ve||Ve.validate!==!1)&&Va(this,D.call(Ta,{key:Q,layerType:this.type,objectKey:me,value:Pe,styleSpec:ie,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const D in this.paint._values){const Q=this.paint.get(D);if(Q instanceof Mu&&Zu(Q.property.specification)&&(Q.value.kind==="source"||Q.value.kind==="composite")&&Q.value.isStateDependent)return!0}return!1}}const Se={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ke{constructor(D,Q){this._structArray=D,this._pos1=Q*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Be{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(D,Q){return D._trim(),Q&&(D.isTransferred=!0,Q.push(D.arrayBuffer)),{length:D.length,arrayBuffer:D.arrayBuffer}}static deserialize(D){const Q=Object.create(this.prototype);return Q.arrayBuffer=D.arrayBuffer,Q.length=D.length,Q.capacity=D.arrayBuffer.byteLength/Q.bytesPerElement,Q._refreshViews(),Q}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(D){this.reserve(D),this.length=D}reserve(D){if(D>this.capacity){this.capacity=Math.max(D,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const Q=this.uint8;this._refreshViews(),Q&&this.uint8.set(Q)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function gt(Y,D=1){let Q=0,me=0;return{members:Y.map(Pe=>{const Ve=Se[Pe.type].BYTES_PER_ELEMENT,We=Q=kt(Q,Math.max(D,Ve)),pt=Pe.components||1;return me=Math.max(me,Ve),Q+=Ve*pt,{name:Pe.name,type:Pe.type,components:pt,offset:We}}),size:kt(Q,Math.max(me,D)),alignment:D}}function kt(Y,D){return Math.ceil(Y/D)*D}class Gt extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q){const me=this.length;return this.resize(me+1),this.emplace(me,D,Q)}emplace(D,Q,me){const Pe=2*D;return this.int16[Pe+0]=Q,this.int16[Pe+1]=me,D}}Gt.prototype.bytesPerElement=4,Na("StructArrayLayout2i4",Gt);class cr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,D,Q,me)}emplace(D,Q,me,Pe){const Ve=3*D;return this.int16[Ve+0]=Q,this.int16[Ve+1]=me,this.int16[Ve+2]=Pe,D}}cr.prototype.bytesPerElement=6,Na("StructArrayLayout3i6",cr);class Ar extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe){const Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,D,Q,me,Pe)}emplace(D,Q,me,Pe,Ve){const We=4*D;return this.int16[We+0]=Q,this.int16[We+1]=me,this.int16[We+2]=Pe,this.int16[We+3]=Ve,D}}Ar.prototype.bytesPerElement=8,Na("StructArrayLayout4i8",Ar);class Cr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We){const pt=this.length;return this.resize(pt+1),this.emplace(pt,D,Q,me,Pe,Ve,We)}emplace(D,Q,me,Pe,Ve,We,pt){const Rt=6*D;return this.int16[Rt+0]=Q,this.int16[Rt+1]=me,this.int16[Rt+2]=Pe,this.int16[Rt+3]=Ve,this.int16[Rt+4]=We,this.int16[Rt+5]=pt,D}}Cr.prototype.bytesPerElement=12,Na("StructArrayLayout2i4i12",Cr);class Qr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We){const pt=this.length;return this.resize(pt+1),this.emplace(pt,D,Q,me,Pe,Ve,We)}emplace(D,Q,me,Pe,Ve,We,pt){const Rt=4*D,Yt=8*D;return this.int16[Rt+0]=Q,this.int16[Rt+1]=me,this.uint8[Yt+4]=Pe,this.uint8[Yt+5]=Ve,this.uint8[Yt+6]=We,this.uint8[Yt+7]=pt,D}}Qr.prototype.bytesPerElement=8,Na("StructArrayLayout2i4ub8",Qr);class _n extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q){const me=this.length;return this.resize(me+1),this.emplace(me,D,Q)}emplace(D,Q,me){const Pe=2*D;return this.float32[Pe+0]=Q,this.float32[Pe+1]=me,D}}_n.prototype.bytesPerElement=8,Na("StructArrayLayout2f8",_n);class Ze extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr){const xr=this.length;return this.resize(xr+1),this.emplace(xr,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr)}emplace(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr){const qr=10*D;return this.uint16[qr+0]=Q,this.uint16[qr+1]=me,this.uint16[qr+2]=Pe,this.uint16[qr+3]=Ve,this.uint16[qr+4]=We,this.uint16[qr+5]=pt,this.uint16[qr+6]=Rt,this.uint16[qr+7]=Yt,this.uint16[qr+8]=dr,this.uint16[qr+9]=xr,D}}Ze.prototype.bytesPerElement=20,Na("StructArrayLayout10ui20",Ze);class et extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr){const Jr=this.length;return this.resize(Jr+1),this.emplace(Jr,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr)}emplace(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,Jr){const vn=12*D;return this.int16[vn+0]=Q,this.int16[vn+1]=me,this.int16[vn+2]=Pe,this.int16[vn+3]=Ve,this.uint16[vn+4]=We,this.uint16[vn+5]=pt,this.uint16[vn+6]=Rt,this.uint16[vn+7]=Yt,this.int16[vn+8]=dr,this.int16[vn+9]=xr,this.int16[vn+10]=qr,this.int16[vn+11]=Jr,D}}et.prototype.bytesPerElement=24,Na("StructArrayLayout4i4ui4i24",et);class ht extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,D,Q,me)}emplace(D,Q,me,Pe){const Ve=3*D;return this.float32[Ve+0]=Q,this.float32[Ve+1]=me,this.float32[Ve+2]=Pe,D}}ht.prototype.bytesPerElement=12,Na("StructArrayLayout3f12",ht);class _t extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(D){const Q=this.length;return this.resize(Q+1),this.emplace(Q,D)}emplace(D,Q){return this.uint32[1*D+0]=Q,D}}_t.prototype.bytesPerElement=4,Na("StructArrayLayout1ul4",_t);class zt extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We,pt,Rt,Yt){const dr=this.length;return this.resize(dr+1),this.emplace(dr,D,Q,me,Pe,Ve,We,pt,Rt,Yt)}emplace(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr){const xr=10*D,qr=5*D;return this.int16[xr+0]=Q,this.int16[xr+1]=me,this.int16[xr+2]=Pe,this.int16[xr+3]=Ve,this.int16[xr+4]=We,this.int16[xr+5]=pt,this.uint32[qr+3]=Rt,this.uint16[xr+8]=Yt,this.uint16[xr+9]=dr,D}}zt.prototype.bytesPerElement=20,Na("StructArrayLayout6i1ul2ui20",zt);class Et extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We){const pt=this.length;return this.resize(pt+1),this.emplace(pt,D,Q,me,Pe,Ve,We)}emplace(D,Q,me,Pe,Ve,We,pt){const Rt=6*D;return this.int16[Rt+0]=Q,this.int16[Rt+1]=me,this.int16[Rt+2]=Pe,this.int16[Rt+3]=Ve,this.int16[Rt+4]=We,this.int16[Rt+5]=pt,D}}Et.prototype.bytesPerElement=12,Na("StructArrayLayout2i2i2i12",Et);class Ut extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve){const We=this.length;return this.resize(We+1),this.emplace(We,D,Q,me,Pe,Ve)}emplace(D,Q,me,Pe,Ve,We){const pt=4*D,Rt=8*D;return this.float32[pt+0]=Q,this.float32[pt+1]=me,this.float32[pt+2]=Pe,this.int16[Rt+6]=Ve,this.int16[Rt+7]=We,D}}Ut.prototype.bytesPerElement=16,Na("StructArrayLayout2f1f2i16",Ut);class mr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We){const pt=this.length;return this.resize(pt+1),this.emplace(pt,D,Q,me,Pe,Ve,We)}emplace(D,Q,me,Pe,Ve,We,pt){const Rt=16*D,Yt=4*D,dr=8*D;return this.uint8[Rt+0]=Q,this.uint8[Rt+1]=me,this.float32[Yt+1]=Pe,this.float32[Yt+2]=Ve,this.int16[dr+6]=We,this.int16[dr+7]=pt,D}}mr.prototype.bytesPerElement=16,Na("StructArrayLayout2ub2f2i16",mr);class Tr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,D,Q,me)}emplace(D,Q,me,Pe){const Ve=3*D;return this.uint16[Ve+0]=Q,this.uint16[Ve+1]=me,this.uint16[Ve+2]=Pe,D}}Tr.prototype.bytesPerElement=6,Na("StructArrayLayout3ui6",Tr);class Lr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,Jr,vn,Tn,Bn,da){const ui=this.length;return this.resize(ui+1),this.emplace(ui,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,Jr,vn,Tn,Bn,da)}emplace(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,Jr,vn,Tn,Bn,da,ui){const Ba=24*D,ti=12*D,Fi=48*D;return this.int16[Ba+0]=Q,this.int16[Ba+1]=me,this.uint16[Ba+2]=Pe,this.uint16[Ba+3]=Ve,this.uint32[ti+2]=We,this.uint32[ti+3]=pt,this.uint32[ti+4]=Rt,this.uint16[Ba+10]=Yt,this.uint16[Ba+11]=dr,this.uint16[Ba+12]=xr,this.float32[ti+7]=qr,this.float32[ti+8]=Jr,this.uint8[Fi+36]=vn,this.uint8[Fi+37]=Tn,this.uint8[Fi+38]=Bn,this.uint32[ti+10]=da,this.int16[Ba+22]=ui,D}}Lr.prototype.bytesPerElement=48,Na("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Lr);class Gr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,Jr,vn,Tn,Bn,da,ui,Ba,ti,Fi,ho,Jo,hl,ls,Wo,zs,Es){const Ts=this.length;return this.resize(Ts+1),this.emplace(Ts,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,Jr,vn,Tn,Bn,da,ui,Ba,ti,Fi,ho,Jo,hl,ls,Wo,zs,Es)}emplace(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,Jr,vn,Tn,Bn,da,ui,Ba,ti,Fi,ho,Jo,hl,ls,Wo,zs,Es,Ts){const to=32*D,Xs=16*D;return this.int16[to+0]=Q,this.int16[to+1]=me,this.int16[to+2]=Pe,this.int16[to+3]=Ve,this.int16[to+4]=We,this.int16[to+5]=pt,this.int16[to+6]=Rt,this.int16[to+7]=Yt,this.uint16[to+8]=dr,this.uint16[to+9]=xr,this.uint16[to+10]=qr,this.uint16[to+11]=Jr,this.uint16[to+12]=vn,this.uint16[to+13]=Tn,this.uint16[to+14]=Bn,this.uint16[to+15]=da,this.uint16[to+16]=ui,this.uint16[to+17]=Ba,this.uint16[to+18]=ti,this.uint16[to+19]=Fi,this.uint16[to+20]=ho,this.uint16[to+21]=Jo,this.uint16[to+22]=hl,this.uint32[Xs+12]=ls,this.float32[Xs+13]=Wo,this.float32[Xs+14]=zs,this.uint16[to+30]=Es,this.uint16[to+31]=Ts,D}}Gr.prototype.bytesPerElement=64,Na("StructArrayLayout8i15ui1ul2f2ui64",Gr);class on extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D){const Q=this.length;return this.resize(Q+1),this.emplace(Q,D)}emplace(D,Q){return this.float32[1*D+0]=Q,D}}on.prototype.bytesPerElement=4,Na("StructArrayLayout1f4",on);class Mn extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,D,Q,me)}emplace(D,Q,me,Pe){const Ve=3*D;return this.uint16[6*D+0]=Q,this.float32[Ve+1]=me,this.float32[Ve+2]=Pe,D}}Mn.prototype.bytesPerElement=12,Na("StructArrayLayout1ui2f12",Mn);class Pn extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Pe=this.length;return this.resize(Pe+1),this.emplace(Pe,D,Q,me)}emplace(D,Q,me,Pe){const Ve=4*D;return this.uint32[2*D+0]=Q,this.uint16[Ve+2]=me,this.uint16[Ve+3]=Pe,D}}Pn.prototype.bytesPerElement=8,Na("StructArrayLayout1ul2ui8",Pn);class Yn extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q){const me=this.length;return this.resize(me+1),this.emplace(me,D,Q)}emplace(D,Q,me){const Pe=2*D;return this.uint16[Pe+0]=Q,this.uint16[Pe+1]=me,D}}Yn.prototype.bytesPerElement=4,Na("StructArrayLayout2ui4",Yn);class wa extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D){const Q=this.length;return this.resize(Q+1),this.emplace(Q,D)}emplace(D,Q){return this.uint16[1*D+0]=Q,D}}wa.prototype.bytesPerElement=2,Na("StructArrayLayout1ui2",wa);class ni extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me,Pe){const Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,D,Q,me,Pe)}emplace(D,Q,me,Pe,Ve){const We=4*D;return this.float32[We+0]=Q,this.float32[We+1]=me,this.float32[We+2]=Pe,this.float32[We+3]=Ve,D}}ni.prototype.bytesPerElement=16,Na("StructArrayLayout4f16",ni);class Ka extends ke{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new i(this.anchorPointX,this.anchorPointY)}}Ka.prototype.size=20;class ii extends zt{get(D){return new Ka(this,D)}}Na("CollisionBoxArray",ii);class $i extends ke{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(D){this._structArray.uint8[this._pos1+37]=D}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(D){this._structArray.uint8[this._pos1+38]=D}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(D){this._structArray.uint32[this._pos4+10]=D}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}$i.prototype.size=48;class Ao extends Lr{get(D){return new $i(this,D)}}Na("PlacedSymbolArray",Ao);class mo extends ke{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(D){this._structArray.uint32[this._pos4+12]=D}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}mo.prototype.size=64;class $o extends Gr{get(D){return new mo(this,D)}}Na("SymbolInstanceArray",$o);class Js extends on{getoffsetX(D){return this.float32[1*D+0]}}Na("GlyphOffsetArray",Js);class Qs extends cr{getx(D){return this.int16[3*D+0]}gety(D){return this.int16[3*D+1]}gettileUnitDistanceFromAnchor(D){return this.int16[3*D+2]}}Na("SymbolLineVertexArray",Qs);class Ls extends ke{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Ls.prototype.size=12;class al extends Mn{get(D){return new Ls(this,D)}}Na("TextAnchorOffsetArray",al);class vu extends ke{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}vu.prototype.size=8;class ru extends Pn{get(D){return new vu(this,D)}}Na("FeatureIndexArray",ru);class Ps extends Gt{}class Rs extends Gt{}class Cu extends Gt{}class oc extends Cr{}class Oc extends Qr{}class ge extends _n{}class Oe extends Ze{}class tt extends et{}class xt extends ht{}class St extends _t{}class It extends Et{}class Qt extends mr{}class Jt extends Tr{}class yr extends Yn{}const Xr=gt([{name:"a_pos",components:2,type:"Int16"}],4),{members:Hr}=Xr;class hn{constructor(D=[]){this.segments=D}prepareSegment(D,Q,me,Pe){let Ve=this.segments[this.segments.length-1];return D>hn.MAX_VERTEX_ARRAY_LENGTH&&y(`Max vertices per segment is ${hn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${D}`),(!Ve||Ve.vertexLength+D>hn.MAX_VERTEX_ARRAY_LENGTH||Ve.sortKey!==Pe)&&(Ve={vertexOffset:Q.length,primitiveOffset:me.length,vertexLength:0,primitiveLength:0},Pe!==void 0&&(Ve.sortKey=Pe),this.segments.push(Ve)),Ve}get(){return this.segments}destroy(){for(const D of this.segments)for(const Q in D.vaos)D.vaos[Q].destroy()}static simpleSegment(D,Q,me,Pe){return new hn([{vertexOffset:D,primitiveOffset:Q,vertexLength:me,primitiveLength:Pe,vaos:{},sortKey:0}])}}function An(Y,D){return 256*(Y=x(Math.floor(Y),0,255))+x(Math.floor(D),0,255)}hn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Na("SegmentVector",hn);const kn=gt([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var La={exports:{}},zn={exports:{}};zn.exports=function(Y,D){var Q,me,Pe,Ve,We,pt,Rt,Yt;for(me=Y.length-(Q=3&Y.length),Pe=D,We=3432918353,pt=461845907,Yt=0;Yt>>16)*We&65535)<<16)&4294967295)<<15|Rt>>>17))*pt+(((Rt>>>16)*pt&65535)<<16)&4294967295)<<13|Pe>>>19))+((5*(Pe>>>16)&65535)<<16)&4294967295))+((58964+(Ve>>>16)&65535)<<16);switch(Rt=0,Q){case 3:Rt^=(255&Y.charCodeAt(Yt+2))<<16;case 2:Rt^=(255&Y.charCodeAt(Yt+1))<<8;case 1:Pe^=Rt=(65535&(Rt=(Rt=(65535&(Rt^=255&Y.charCodeAt(Yt)))*We+(((Rt>>>16)*We&65535)<<16)&4294967295)<<15|Rt>>>17))*pt+(((Rt>>>16)*pt&65535)<<16)&4294967295}return Pe^=Y.length,Pe=2246822507*(65535&(Pe^=Pe>>>16))+((2246822507*(Pe>>>16)&65535)<<16)&4294967295,Pe=3266489909*(65535&(Pe^=Pe>>>13))+((3266489909*(Pe>>>16)&65535)<<16)&4294967295,(Pe^=Pe>>>16)>>>0};var Qn=zn.exports,oa={exports:{}};oa.exports=function(Y,D){for(var Q,me=Y.length,Pe=D^me,Ve=0;me>=4;)Q=1540483477*(65535&(Q=255&Y.charCodeAt(Ve)|(255&Y.charCodeAt(++Ve))<<8|(255&Y.charCodeAt(++Ve))<<16|(255&Y.charCodeAt(++Ve))<<24))+((1540483477*(Q>>>16)&65535)<<16),Pe=1540483477*(65535&Pe)+((1540483477*(Pe>>>16)&65535)<<16)^(Q=1540483477*(65535&(Q^=Q>>>24))+((1540483477*(Q>>>16)&65535)<<16)),me-=4,++Ve;switch(me){case 3:Pe^=(255&Y.charCodeAt(Ve+2))<<16;case 2:Pe^=(255&Y.charCodeAt(Ve+1))<<8;case 1:Pe=1540483477*(65535&(Pe^=255&Y.charCodeAt(Ve)))+((1540483477*(Pe>>>16)&65535)<<16)}return Pe=1540483477*(65535&(Pe^=Pe>>>13))+((1540483477*(Pe>>>16)&65535)<<16),(Pe^=Pe>>>15)>>>0};var Aa=Qn,Ra=oa.exports;La.exports=Aa,La.exports.murmur3=Aa,La.exports.murmur2=Ra;var ia=r(La.exports);class oi{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,Q,me,Pe){this.ids.push(Wi(D)),this.positions.push(Q,me,Pe)}getPositions(D){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const Q=Wi(D);let me=0,Pe=this.ids.length-1;for(;me>1;this.ids[We]>=Q?Pe=We:me=We+1}const Ve=[];for(;this.ids[me]===Q;)Ve.push({index:this.positions[3*me],start:this.positions[3*me+1],end:this.positions[3*me+2]}),me++;return Ve}static serialize(D,Q){const me=new Float64Array(D.ids),Pe=new Uint32Array(D.positions);return zi(me,Pe,0,me.length-1),Q&&Q.push(me.buffer,Pe.buffer),{ids:me,positions:Pe}}static deserialize(D){const Q=new oi;return Q.ids=D.ids,Q.positions=D.positions,Q.indexed=!0,Q}}function Wi(Y){const D=+Y;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:ia(String(Y))}function zi(Y,D,Q,me){for(;Q>1];let Ve=Q-1,We=me+1;for(;;){do Ve++;while(Y[Ve]Pe);if(Ve>=We)break;Gi(Y,Ve,We),Gi(D,3*Ve,3*We),Gi(D,3*Ve+1,3*We+1),Gi(D,3*Ve+2,3*We+2)}We-Q`u_${Pe}`),this.type=me}setUniform(D,Q,me){D.set(me.constantOr(this.value))}getBinding(D,Q,me){return this.type==="color"?new Ro(D,Q):new ko(D,Q)}}class Jl{constructor(D,Q){this.uniformNames=Q.map(me=>`u_${me}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(D,Q){this.pixelRatioFrom=Q.pixelRatio,this.pixelRatioTo=D.pixelRatio,this.patternFrom=Q.tlbr,this.patternTo=D.tlbr}setUniform(D,Q,me,Pe){const Ve=Pe==="u_pattern_to"?this.patternTo:Pe==="u_pattern_from"?this.patternFrom:Pe==="u_pixel_ratio_to"?this.pixelRatioTo:Pe==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Ve&&D.set(Ve)}getBinding(D,Q,me){return me.substr(0,9)==="u_pattern"?new Ks(D,Q):new ko(D,Q)}}class co{constructor(D,Q,me,Pe){this.expression=D,this.type=me,this.maxValue=0,this.paintVertexAttributes=Q.map(Ve=>({name:`a_${Ve}`,type:"Float32",components:me==="color"?2:1,offset:0})),this.paintVertexArray=new Pe}populatePaintArray(D,Q,me,Pe,Ve){const We=this.paintVertexArray.length,pt=this.expression.evaluate(new pl(0),Q,{},Pe,[],Ve);this.paintVertexArray.resize(D),this._setPaintValue(We,D,pt)}updatePaintArray(D,Q,me,Pe){const Ve=this.expression.evaluate({zoom:0},me,Pe);this._setPaintValue(D,Q,Ve)}_setPaintValue(D,Q,me){if(this.type==="color"){const Pe=nl(me);for(let Ve=D;Ve`u_${pt}_t`),this.type=me,this.useIntegerZoom=Pe,this.zoom=Ve,this.maxValue=0,this.paintVertexAttributes=Q.map(pt=>({name:`a_${pt}`,type:"Float32",components:me==="color"?4:2,offset:0})),this.paintVertexArray=new We}populatePaintArray(D,Q,me,Pe,Ve){const We=this.expression.evaluate(new pl(this.zoom),Q,{},Pe,[],Ve),pt=this.expression.evaluate(new pl(this.zoom+1),Q,{},Pe,[],Ve),Rt=this.paintVertexArray.length;this.paintVertexArray.resize(D),this._setPaintValue(Rt,D,We,pt)}updatePaintArray(D,Q,me,Pe){const Ve=this.expression.evaluate({zoom:this.zoom},me,Pe),We=this.expression.evaluate({zoom:this.zoom+1},me,Pe);this._setPaintValue(D,Q,Ve,We)}_setPaintValue(D,Q,me,Pe){if(this.type==="color"){const Ve=nl(me),We=nl(Pe);for(let pt=D;pt`#define HAS_UNIFORM_${Pe}`))}return D}getBinderAttributes(){const D=[];for(const Q in this.binders){const me=this.binders[Q];if(me instanceof co||me instanceof Is)for(let Pe=0;Pe!0){this.programConfigurations={};for(const Pe of D)this.programConfigurations[Pe.id]=new Zl(Pe,Q,me);this.needsUpload=!1,this._featureMap=new oi,this._bufferOffset=0}populatePaintArrays(D,Q,me,Pe,Ve,We){for(const pt in this.programConfigurations)this.programConfigurations[pt].populatePaintArrays(D,Q,Pe,Ve,We);Q.id!==void 0&&this._featureMap.add(Q.id,me,this._bufferOffset,D),this._bufferOffset=D,this.needsUpload=!0}updatePaintArrays(D,Q,me,Pe){for(const Ve of me)this.needsUpload=this.programConfigurations[Ve.id].updatePaintArrays(D,this._featureMap,Q,Ve,Pe)||this.needsUpload}get(D){return this.programConfigurations[D]}upload(D){if(this.needsUpload){for(const Q in this.programConfigurations)this.programConfigurations[Q].upload(D);this.needsUpload=!1}}destroy(){for(const D in this.programConfigurations)this.programConfigurations[D].destroy()}}function bc(Y,D){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[Y]||[Y.replace(`${D}-`,"").replace(/-/g,"_")]}function El(Y,D,Q){const me={color:{source:_n,composite:ni},number:{source:on,composite:_n}},Pe=(function(Ve){return{"line-pattern":{source:Oe,composite:Oe},"fill-pattern":{source:Oe,composite:Oe},"fill-extrusion-pattern":{source:Oe,composite:Oe}}[Ve]})(Y);return Pe&&Pe[Q]||me[D][Q]}Na("ConstantBinder",Lu),Na("CrossFadedConstantBinder",Jl),Na("SourceExpressionBinder",co),Na("CrossFadedCompositeBinder",el),Na("CompositeExpressionBinder",Is),Na("ProgramConfiguration",Zl,{omit:["_buffers"]}),Na("ProgramConfigurationSet",Ol);const Wl=8192,Yc=Math.pow(2,14)-1,Eu=-Yc-1;function dt(Y){const D=Wl/Y.extent,Q=Y.loadGeometry();for(let me=0;meWe.x+1||RtWe.y+1)&&y("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return Q}function gr(Y,D){return{type:Y.type,id:Y.id,properties:Y.properties,geometry:D?dt(Y):[]}}function wr(Y,D,Q,me,Pe){Y.emplaceBack(2*D+(me+1)/2,2*Q+(Pe+1)/2)}class Cn{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new Rs,this.indexArray=new Jt,this.segments=new hn,this.programConfigurations=new Ol(D.layers,D.zoom),this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){const Pe=this.layers[0],Ve=[];let We=null,pt=!1;Pe.type==="circle"&&(We=Pe.layout.get("circle-sort-key"),pt=!We.isConstant());for(const{feature:Rt,id:Yt,index:dr,sourceLayerIndex:xr}of D){const qr=this.layers[0]._featureFilter.needGeometry,Jr=gr(Rt,qr);if(!this.layers[0]._featureFilter.filter(new pl(this.zoom),Jr,me))continue;const vn=pt?We.evaluate(Jr,{},me):void 0,Tn={id:Yt,properties:Rt.properties,type:Rt.type,sourceLayerIndex:xr,index:dr,geometry:qr?Jr.geometry:dt(Rt),patterns:{},sortKey:vn};Ve.push(Tn)}pt&&Ve.sort((Rt,Yt)=>Rt.sortKey-Yt.sortKey);for(const Rt of Ve){const{geometry:Yt,index:dr,sourceLayerIndex:xr}=Rt,qr=D[dr].feature;this.addFeature(Rt,Yt,dr,me),Q.featureIndex.insert(qr,Yt,dr,xr,this.index)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Hr),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(D,Q,me,Pe){for(const Ve of Q)for(const We of Ve){const pt=We.x,Rt=We.y;if(pt<0||pt>=Wl||Rt<0||Rt>=Wl)continue;const Yt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),dr=Yt.vertexLength;wr(this.layoutVertexArray,pt,Rt,-1,-1),wr(this.layoutVertexArray,pt,Rt,1,-1),wr(this.layoutVertexArray,pt,Rt,1,1),wr(this.layoutVertexArray,pt,Rt,-1,1),this.indexArray.emplaceBack(dr,dr+1,dr+2),this.indexArray.emplaceBack(dr,dr+3,dr+2),Yt.vertexLength+=4,Yt.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,me,{},Pe)}}function ua(Y,D){for(let Q=0;Q1){if(Ia(Y,D))return!0;for(let me=0;me1?Q:Q.sub(D)._mult(Pe)._add(D))}function bi(Y,D){let Q,me,Pe,Ve=!1;for(let We=0;WeD.y!=Pe.y>D.y&&D.x<(Pe.x-me.x)*(D.y-me.y)/(Pe.y-me.y)+me.x&&(Ve=!Ve)}return Ve}function Ha(Y,D){let Q=!1;for(let me=0,Pe=Y.length-1;meD.y!=We.y>D.y&&D.x<(We.x-Ve.x)*(D.y-Ve.y)/(We.y-Ve.y)+Ve.x&&(Q=!Q)}return Q}function ga(Y,D,Q){const me=Q[0],Pe=Q[2];if(Y.xPe.x&&D.x>Pe.x||Y.yPe.y&&D.y>Pe.y)return!1;const Ve=I(Y,D,Q[0]);return Ve!==I(Y,D,Q[1])||Ve!==I(Y,D,Q[2])||Ve!==I(Y,D,Q[3])}function rn(Y,D,Q){const me=D.paint.get(Y).value;return me.kind==="constant"?me.value:Q.programConfigurations.get(D.id).getMaxValue(Y)}function Fn(Y){return Math.sqrt(Y[0]*Y[0]+Y[1]*Y[1])}function ea(Y,D,Q,me,Pe){if(!D[0]&&!D[1])return Y;const Ve=i.convert(D)._mult(Pe);Q==="viewport"&&Ve._rotate(-me);const We=[];for(let pt=0;ptOi(Bn,Tn))})(Yt,Rt),Jr=xr?dr*pt:dr;for(const vn of Pe)for(const Tn of vn){const Bn=xr?Tn:Oi(Tn,Rt);let da=Jr;const ui=$a([],[Tn.x,Tn.y,0,1],Rt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?da*=ui[3]/We.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(da*=We.cameraToCenterDistance/ui[3]),gn(qr,Bn,da))return!0}return!1}}function Oi(Y,D){const Q=$a([],[Y.x,Y.y,0,1],D);return new i(Q[0]/Q[3],Q[1]/Q[3])}class Po extends Cn{}let wi;Na("HeatmapBucket",Po,{omit:["layers"]});var ji={get paint(){return wi=wi||new Ue({"heatmap-radius":new ss(ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ss(ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Zo(ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new zc(ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Zo(ie.paint_heatmap["heatmap-opacity"])})}};function Ya(Y,{width:D,height:Q},me,Pe){if(Pe){if(Pe instanceof Uint8ClampedArray)Pe=new Uint8Array(Pe.buffer);else if(Pe.length!==D*Q*me)throw new RangeError(`mismatched image size. expected: ${Pe.length} but got: ${D*Q*me}`)}else Pe=new Uint8Array(D*Q*me);return Y.width=D,Y.height=Q,Y.data=Pe,Y}function Mo(Y,{width:D,height:Q},me){if(D===Y.width&&Q===Y.height)return;const Pe=Ya({},{width:D,height:Q},me);Ho(Y,Pe,{x:0,y:0},{x:0,y:0},{width:Math.min(Y.width,D),height:Math.min(Y.height,Q)},me),Y.width=D,Y.height=Q,Y.data=Pe.data}function Ho(Y,D,Q,me,Pe,Ve){if(Pe.width===0||Pe.height===0)return D;if(Pe.width>Y.width||Pe.height>Y.height||Q.x>Y.width-Pe.width||Q.y>Y.height-Pe.height)throw new RangeError("out of range source coordinates for image copy");if(Pe.width>D.width||Pe.height>D.height||me.x>D.width-Pe.width||me.y>D.height-Pe.height)throw new RangeError("out of range destination coordinates for image copy");const We=Y.data,pt=D.data;if(We===pt)throw new Error("srcData equals dstData, so image is already copied");for(let Rt=0;Rt{D[Y.evaluationKey]=Rt;const Yt=Y.expression.evaluate(D);Pe.data[We+pt+0]=Math.floor(255*Yt.r/Yt.a),Pe.data[We+pt+1]=Math.floor(255*Yt.g/Yt.a),Pe.data[We+pt+2]=Math.floor(255*Yt.b/Yt.a),Pe.data[We+pt+3]=Math.floor(255*Yt.a)};if(Y.clips)for(let We=0,pt=0;We80*Q){pt=1/0,Rt=1/0;let dr=-1/0,xr=-1/0;for(let qr=Q;qrdr&&(dr=Jr),vn>xr&&(xr=vn)}Yt=Math.max(dr-pt,xr-Rt),Yt=Yt!==0?32767/Yt:0}return Vs(Ve,We,Q,pt,Rt,Yt,0),We}function vo(Y,D,Q,me,Pe){let Ve;if(Pe===(function(We,pt,Rt,Yt){let dr=0;for(let xr=pt,qr=Rt-Yt;xr0)for(let We=D;We=D;We-=me)Ve=Vt(We/me|0,Y[We],Y[We+1],Ve);return Ve&<(Ve,Ve.next)&&(Kt(Ve),Ve=Ve.next),Ve}function Ku(Y,D){if(!Y)return Y;D||(D=Y);let Q,me=Y;do if(Q=!1,me.steiner||!lt(me,me.next)&&qe(me.prev,me,me.next)!==0)me=me.next;else{if(Kt(me),me=D=me.prev,me===me.next)break;Q=!0}while(Q||me!==D);return D}function Vs(Y,D,Q,me,Pe,Ve,We){if(!Y)return;!We&&Ve&&(function(Rt,Yt,dr,xr){let qr=Rt;do qr.z===0&&(qr.z=q(qr.x,qr.y,Yt,dr,xr)),qr.prevZ=qr.prev,qr.nextZ=qr.next,qr=qr.next;while(qr!==Rt);qr.prevZ.nextZ=null,qr.prevZ=null,(function(Jr){let vn,Tn=1;do{let Bn,da=Jr;Jr=null;let ui=null;for(vn=0;da;){vn++;let Ba=da,ti=0;for(let ho=0;ho0||Fi>0&&Ba;)ti!==0&&(Fi===0||!Ba||da.z<=Ba.z)?(Bn=da,da=da.nextZ,ti--):(Bn=Ba,Ba=Ba.nextZ,Fi--),ui?ui.nextZ=Bn:Jr=Bn,Bn.prevZ=ui,ui=Bn;da=Ba}ui.nextZ=null,Tn*=2}while(vn>1)})(qr)})(Y,me,Pe,Ve);let pt=Y;for(;Y.prev!==Y.next;){const Rt=Y.prev,Yt=Y.next;if(Ve?uc(Y,me,Pe,Ve):Fl(Y))D.push(Rt.i,Y.i,Yt.i),Kt(Y),Y=Yt.next,pt=Yt.next;else if((Y=Yt)===pt){We?We===1?Vs(Y=cc(Ku(Y),D),D,Q,me,Pe,Ve,2):We===2&&Co(Y,D,Q,me,Pe,Ve):Vs(Ku(Y),D,Q,me,Pe,Ve,1);break}}}function Fl(Y){const D=Y.prev,Q=Y,me=Y.next;if(qe(D,Q,me)>=0)return!1;const Pe=D.x,Ve=Q.x,We=me.x,pt=D.y,Rt=Q.y,Yt=me.y,dr=PeVe?Pe>We?Pe:We:Ve>We?Ve:We,Jr=pt>Rt?pt>Yt?pt:Yt:Rt>Yt?Rt:Yt;let vn=me.next;for(;vn!==D;){if(vn.x>=dr&&vn.x<=qr&&vn.y>=xr&&vn.y<=Jr&&J(Pe,pt,Ve,Rt,We,Yt,vn.x,vn.y)&&qe(vn.prev,vn,vn.next)>=0)return!1;vn=vn.next}return!0}function uc(Y,D,Q,me){const Pe=Y.prev,Ve=Y,We=Y.next;if(qe(Pe,Ve,We)>=0)return!1;const pt=Pe.x,Rt=Ve.x,Yt=We.x,dr=Pe.y,xr=Ve.y,qr=We.y,Jr=ptRt?pt>Yt?pt:Yt:Rt>Yt?Rt:Yt,Bn=dr>xr?dr>qr?dr:qr:xr>qr?xr:qr,da=q(Jr,vn,D,Q,me),ui=q(Tn,Bn,D,Q,me);let Ba=Y.prevZ,ti=Y.nextZ;for(;Ba&&Ba.z>=da&&ti&&ti.z<=ui;){if(Ba.x>=Jr&&Ba.x<=Tn&&Ba.y>=vn&&Ba.y<=Bn&&Ba!==Pe&&Ba!==We&&J(pt,dr,Rt,xr,Yt,qr,Ba.x,Ba.y)&&qe(Ba.prev,Ba,Ba.next)>=0||(Ba=Ba.prevZ,ti.x>=Jr&&ti.x<=Tn&&ti.y>=vn&&ti.y<=Bn&&ti!==Pe&&ti!==We&&J(pt,dr,Rt,xr,Yt,qr,ti.x,ti.y)&&qe(ti.prev,ti,ti.next)>=0))return!1;ti=ti.nextZ}for(;Ba&&Ba.z>=da;){if(Ba.x>=Jr&&Ba.x<=Tn&&Ba.y>=vn&&Ba.y<=Bn&&Ba!==Pe&&Ba!==We&&J(pt,dr,Rt,xr,Yt,qr,Ba.x,Ba.y)&&qe(Ba.prev,Ba,Ba.next)>=0)return!1;Ba=Ba.prevZ}for(;ti&&ti.z<=ui;){if(ti.x>=Jr&&ti.x<=Tn&&ti.y>=vn&&ti.y<=Bn&&ti!==Pe&&ti!==We&&J(pt,dr,Rt,xr,Yt,qr,ti.x,ti.y)&&qe(ti.prev,ti,ti.next)>=0)return!1;ti=ti.nextZ}return!0}function cc(Y,D){let Q=Y;do{const me=Q.prev,Pe=Q.next.next;!lt(me,Pe)&&vt(me,Q,Q.next,Pe)&&bt(me,Pe)&&bt(Pe,me)&&(D.push(me.i,Q.i,Pe.i),Kt(Q),Kt(Q.next),Q=Y=Pe),Q=Q.next}while(Q!==Y);return Ku(Q)}function Co(Y,D,Q,me,Pe,Ve){let We=Y;do{let pt=We.next.next;for(;pt!==We.prev;){if(We.i!==pt.i&&_e(We,pt)){let Rt=Zt(We,pt);return We=Ku(We,We.next),Rt=Ku(Rt,Rt.next),Vs(We,D,Q,me,Pe,Ve,0),void Vs(Rt,D,Q,me,Pe,Ve,0)}pt=pt.next}We=We.next}while(We!==Y)}function ms(Y,D){return Y.x-D.x}function bs(Y,D){const Q=(function(Pe,Ve){let We=Ve;const pt=Pe.x,Rt=Pe.y;let Yt,dr=-1/0;do{if(Rt<=We.y&&Rt>=We.next.y&&We.next.y!==We.y){const Tn=We.x+(Rt-We.y)*(We.next.x-We.x)/(We.next.y-We.y);if(Tn<=pt&&Tn>dr&&(dr=Tn,Yt=We.x=We.x&&We.x>=qr&&pt!==We.x&&J(RtYt.x||We.x===Yt.x&&be(Yt,We)))&&(Yt=We,vn=Tn)}We=We.next}while(We!==xr);return Yt})(Y,D);if(!Q)return D;const me=Zt(Q,Y);return Ku(me,me.next),Ku(Q,Q.next)}function be(Y,D){return qe(Y.prev,Y,D.prev)<0&&qe(D.next,Y,Y.next)<0}function q(Y,D,Q,me,Pe){return(Y=1431655765&((Y=858993459&((Y=252645135&((Y=16711935&((Y=(Y-Q)*Pe|0)|Y<<8))|Y<<4))|Y<<2))|Y<<1))|(D=1431655765&((D=858993459&((D=252645135&((D=16711935&((D=(D-me)*Pe|0)|D<<8))|D<<4))|D<<2))|D<<1))<<1}function he(Y){let D=Y,Q=Y;do(D.x=(Y-We)*(Ve-pt)&&(Y-We)*(me-pt)>=(Q-We)*(D-pt)&&(Q-We)*(Ve-pt)>=(Pe-We)*(me-pt)}function _e(Y,D){return Y.next.i!==D.i&&Y.prev.i!==D.i&&!(function(Q,me){let Pe=Q;do{if(Pe.i!==Q.i&&Pe.next.i!==Q.i&&Pe.i!==me.i&&Pe.next.i!==me.i&&vt(Pe,Pe.next,Q,me))return!0;Pe=Pe.next}while(Pe!==Q);return!1})(Y,D)&&(bt(Y,D)&&bt(D,Y)&&(function(Q,me){let Pe=Q,Ve=!1;const We=(Q.x+me.x)/2,pt=(Q.y+me.y)/2;do Pe.y>pt!=Pe.next.y>pt&&Pe.next.y!==Pe.y&&We<(Pe.next.x-Pe.x)*(pt-Pe.y)/(Pe.next.y-Pe.y)+Pe.x&&(Ve=!Ve),Pe=Pe.next;while(Pe!==Q);return Ve})(Y,D)&&(qe(Y.prev,Y,D.prev)||qe(Y,D.prev,D))||lt(Y,D)&&qe(Y.prev,Y,Y.next)>0&&qe(D.prev,D,D.next)>0)}function qe(Y,D,Q){return(D.y-Y.y)*(Q.x-D.x)-(D.x-Y.x)*(Q.y-D.y)}function lt(Y,D){return Y.x===D.x&&Y.y===D.y}function vt(Y,D,Q,me){const Pe=at(qe(Y,D,Q)),Ve=at(qe(Y,D,me)),We=at(qe(Q,me,Y)),pt=at(qe(Q,me,D));return Pe!==Ve&&We!==pt||!(Pe!==0||!Ke(Y,Q,D))||!(Ve!==0||!Ke(Y,me,D))||!(We!==0||!Ke(Q,Y,me))||!(pt!==0||!Ke(Q,D,me))}function Ke(Y,D,Q){return D.x<=Math.max(Y.x,Q.x)&&D.x>=Math.min(Y.x,Q.x)&&D.y<=Math.max(Y.y,Q.y)&&D.y>=Math.min(Y.y,Q.y)}function at(Y){return Y>0?1:Y<0?-1:0}function bt(Y,D){return qe(Y.prev,Y,Y.next)<0?qe(Y,D,Y.next)>=0&&qe(Y,Y.prev,D)>=0:qe(Y,D,Y.prev)<0||qe(Y,Y.next,D)<0}function Zt(Y,D){const Q=nr(Y.i,Y.x,Y.y),me=nr(D.i,D.x,D.y),Pe=Y.next,Ve=D.prev;return Y.next=D,D.prev=Y,Q.next=Pe,Pe.prev=Q,me.next=Q,Q.prev=me,Ve.next=me,me.prev=Ve,me}function Vt(Y,D,Q,me){const Pe=nr(Y,D,Q);return me?(Pe.next=me.next,Pe.prev=me,me.next.prev=Pe,me.next=Pe):(Pe.prev=Pe,Pe.next=Pe),Pe}function Kt(Y){Y.next.prev=Y.prev,Y.prev.next=Y.next,Y.prevZ&&(Y.prevZ.nextZ=Y.nextZ),Y.nextZ&&(Y.nextZ.prevZ=Y.prevZ)}function nr(Y,D,Q){return{i:Y,x:D,y:Q,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function er(Y,D,Q){const me=Q.patternDependencies;let Pe=!1;for(const Ve of D){const We=Ve.paint.get(`${Y}-pattern`);We.isConstant()||(Pe=!0);const pt=We.constantOr(null);pt&&(Pe=!0,me[pt.to]=!0,me[pt.from]=!0)}return Pe}function Bt(Y,D,Q,me,Pe){const Ve=Pe.patternDependencies;for(const We of D){const pt=We.paint.get(`${Y}-pattern`).value;if(pt.kind!=="constant"){let Rt=pt.evaluate({zoom:me-1},Q,{},Pe.availableImages),Yt=pt.evaluate({zoom:me},Q,{},Pe.availableImages),dr=pt.evaluate({zoom:me+1},Q,{},Pe.availableImages);Rt=Rt&&Rt.name?Rt.name:Rt,Yt=Yt&&Yt.name?Yt.name:Yt,dr=dr&&dr.name?dr.name:dr,Ve[Rt]=!0,Ve[Yt]=!0,Ve[dr]=!0,Q.patterns[We.id]={min:Rt,mid:Yt,max:dr}}}return Q}class Xt{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Cu,this.indexArray=new Jt,this.indexArray2=new yr,this.programConfigurations=new Ol(D.layers,D.zoom),this.segments=new hn,this.segments2=new hn,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){this.hasPattern=er("fill",this.layers,Q);const Pe=this.layers[0].layout.get("fill-sort-key"),Ve=!Pe.isConstant(),We=[];for(const{feature:pt,id:Rt,index:Yt,sourceLayerIndex:dr}of D){const xr=this.layers[0]._featureFilter.needGeometry,qr=gr(pt,xr);if(!this.layers[0]._featureFilter.filter(new pl(this.zoom),qr,me))continue;const Jr=Ve?Pe.evaluate(qr,{},me,Q.availableImages):void 0,vn={id:Rt,properties:pt.properties,type:pt.type,sourceLayerIndex:dr,index:Yt,geometry:xr?qr.geometry:dt(pt),patterns:{},sortKey:Jr};We.push(vn)}Ve&&We.sort((pt,Rt)=>pt.sortKey-Rt.sortKey);for(const pt of We){const{geometry:Rt,index:Yt,sourceLayerIndex:dr}=pt;if(this.hasPattern){const xr=Bt("fill",this.layers,pt,this.zoom,Q);this.patternFeatures.push(xr)}else this.addFeature(pt,Rt,Yt,me,{});Q.featureIndex.insert(D[Yt].feature,Rt,Yt,dr,this.index)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}addFeatures(D,Q,me){for(const Pe of this.patternFeatures)this.addFeature(Pe,Pe.geometry,Pe.index,Q,me)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Ql),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.indexBuffer2=D.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(D,Q,me,Pe,Ve){for(const We of qc(Q,500)){let pt=0;for(const Jr of We)pt+=Jr.length;const Rt=this.segments.prepareSegment(pt,this.layoutVertexArray,this.indexArray),Yt=Rt.vertexLength,dr=[],xr=[];for(const Jr of We){if(Jr.length===0)continue;Jr!==We[0]&&xr.push(dr.length/2);const vn=this.segments2.prepareSegment(Jr.length,this.layoutVertexArray,this.indexArray2),Tn=vn.vertexLength;this.layoutVertexArray.emplaceBack(Jr[0].x,Jr[0].y),this.indexArray2.emplaceBack(Tn+Jr.length-1,Tn),dr.push(Jr[0].x),dr.push(Jr[0].y);for(let Bn=1;Bn>3}if(Pe--,me===1||me===2)Ve+=Y.readSVarint(),We+=Y.readSVarint(),me===1&&(D&&pt.push(D),D=[]),D.push(new va(Ve,We));else{if(me!==7)throw new Error("unknown command "+me);D&&D.push(D[0].clone())}}return D&&pt.push(D),pt},ca.prototype.bbox=function(){var Y=this._pbf;Y.pos=this._geometry;for(var D=Y.readVarint()+Y.pos,Q=1,me=0,Pe=0,Ve=0,We=1/0,pt=-1/0,Rt=1/0,Yt=-1/0;Y.pos>3}if(me--,Q===1||Q===2)(Pe+=Y.readSVarint())pt&&(pt=Pe),(Ve+=Y.readSVarint())Yt&&(Yt=Ve);else if(Q!==7)throw new Error("unknown command "+Q)}return[We,Rt,pt,Yt]},ca.prototype.toGeoJSON=function(Y,D,Q){var me,Pe,Ve=this.extent*Math.pow(2,Q),We=this.extent*Y,pt=this.extent*D,Rt=this.loadGeometry(),Yt=ca.types[this.type];function dr(Jr){for(var vn=0;vn>3;Pe=We===1?me.readString():We===2?me.readFloat():We===3?me.readDouble():We===4?me.readVarint64():We===5?me.readVarint():We===6?me.readSVarint():We===7?me.readBoolean():null}return Pe})(Q))}ws.prototype.feature=function(Y){if(Y<0||Y>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[Y];var D=this._pbf.readVarint()+this._pbf.pos;return new Ei(this._pbf,D,this.extent,this._keys,this._values)};var ml=Hi;function fl(Y,D,Q){if(Y===3){var me=new ml(Q,Q.readVarint()+Q.pos);me.length&&(D[me.name]=me)}}la.VectorTile=function(Y,D){this.layers=Y.readFields(fl,{},D)},la.VectorTileFeature=Pa,la.VectorTileLayer=Hi;const _l=la.VectorTileFeature.types,yl=Math.pow(2,13);function $u(Y,D,Q,me,Pe,Ve,We,pt){Y.emplaceBack(D,Q,2*Math.floor(me*yl)+We,Pe*yl*2,Ve*yl*2,Math.round(pt))}class ol{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new oc,this.centroidVertexArray=new Ps,this.indexArray=new Jt,this.programConfigurations=new Ol(D.layers,D.zoom),this.segments=new hn,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){this.features=[],this.hasPattern=er("fill-extrusion",this.layers,Q);for(const{feature:Pe,id:Ve,index:We,sourceLayerIndex:pt}of D){const Rt=this.layers[0]._featureFilter.needGeometry,Yt=gr(Pe,Rt);if(!this.layers[0]._featureFilter.filter(new pl(this.zoom),Yt,me))continue;const dr={id:Ve,sourceLayerIndex:pt,index:We,geometry:Rt?Yt.geometry:dt(Pe),properties:Pe.properties,type:Pe.type,patterns:{}};this.hasPattern?this.features.push(Bt("fill-extrusion",this.layers,dr,this.zoom,Q)):this.addFeature(dr,dr.geometry,We,me,{}),Q.featureIndex.insert(Pe,dr.geometry,We,pt,this.index,!0)}}addFeatures(D,Q,me){for(const Pe of this.features){const{geometry:Ve}=Pe;this.addFeature(Pe,Ve,Pe.index,Q,me)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Hn),this.centroidVertexBuffer=D.createVertexBuffer(this.centroidVertexArray,Wn.members,!0),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(D,Q,me,Pe,Ve){for(const We of qc(Q,500)){const pt={x:0,y:0,vertexCount:0};let Rt=0;for(const vn of We)Rt+=vn.length;let Yt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const vn of We){if(vn.length===0||Xf(vn))continue;let Tn=0;for(let Bn=0;Bn=1){const ui=vn[Bn-1];if(!_u(da,ui)){Yt.vertexLength+4>hn.MAX_VERTEX_ARRAY_LENGTH&&(Yt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ba=da.sub(ui)._perp()._unit(),ti=ui.dist(da);Tn+ti>32768&&(Tn=0),$u(this.layoutVertexArray,da.x,da.y,Ba.x,Ba.y,0,0,Tn),$u(this.layoutVertexArray,da.x,da.y,Ba.x,Ba.y,0,1,Tn),pt.x+=2*da.x,pt.y+=2*da.y,pt.vertexCount+=2,Tn+=ti,$u(this.layoutVertexArray,ui.x,ui.y,Ba.x,Ba.y,0,0,Tn),$u(this.layoutVertexArray,ui.x,ui.y,Ba.x,Ba.y,0,1,Tn),pt.x+=2*ui.x,pt.y+=2*ui.y,pt.vertexCount+=2;const Fi=Yt.vertexLength;this.indexArray.emplaceBack(Fi,Fi+2,Fi+1),this.indexArray.emplaceBack(Fi+1,Fi+2,Fi+3),Yt.vertexLength+=4,Yt.primitiveLength+=2}}}}if(Yt.vertexLength+Rt>hn.MAX_VERTEX_ARRAY_LENGTH&&(Yt=this.segments.prepareSegment(Rt,this.layoutVertexArray,this.indexArray)),_l[D.type]!=="Polygon")continue;const dr=[],xr=[],qr=Yt.vertexLength;for(const vn of We)if(vn.length!==0){vn!==We[0]&&xr.push(dr.length/2);for(let Tn=0;TnWl)||Y.y===D.y&&(Y.y<0||Y.y>Wl)}function Xf(Y){return Y.every(D=>D.x<0)||Y.every(D=>D.x>Wl)||Y.every(D=>D.y<0)||Y.every(D=>D.y>Wl)}let Th;Na("FillExtrusionBucket",ol,{omit:["layers","features"]});var Bd={get paint(){return Th=Th||new Ue({"fill-extrusion-opacity":new Zo(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ss(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Zo(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Zo(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new kf(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ss(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ss(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Zo(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Nd extends oe{constructor(D){super(D,Bd)}createBucket(D){return new ol(D)}queryRadius(){return Fn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,Q,me,Pe,Ve,We,pt,Rt){const Yt=ea(D,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),We.angle,pt),dr=this.paint.get("fill-extrusion-height").evaluate(Q,me),xr=this.paint.get("fill-extrusion-base").evaluate(Q,me),qr=(function(vn,Tn,Bn,da){const ui=[];for(const Ba of vn){const ti=[Ba.x,Ba.y,0,1];$a(ti,ti,Tn),ui.push(new i(ti[0]/ti[3],ti[1]/ti[3]))}return ui})(Yt,Rt),Jr=(function(vn,Tn,Bn,da){const ui=[],Ba=[],ti=da[8]*Tn,Fi=da[9]*Tn,ho=da[10]*Tn,Jo=da[11]*Tn,hl=da[8]*Bn,ls=da[9]*Bn,Wo=da[10]*Bn,zs=da[11]*Bn;for(const Es of vn){const Ts=[],to=[];for(const Xs of Es){const Os=Xs.x,Pl=Xs.y,af=da[0]*Os+da[4]*Pl+da[12],Zc=da[1]*Os+da[5]*Pl+da[13],lv=da[2]*Os+da[6]*Pl+da[14],_d=da[3]*Os+da[7]*Pl+da[15],Ah=lv+ho,Wh=_d+Jo,ud=af+hl,cd=Zc+ls,fd=lv+Wo,Yf=_d+zs,uv=new i((af+ti)/Wh,(Zc+Fi)/Wh);uv.z=Ah/Wh,Ts.push(uv);const Qv=new i(ud/Yf,cd/Yf);Qv.z=fd/Yf,to.push(Qv)}ui.push(Ts),Ba.push(to)}return[ui,Ba]})(Pe,xr,dr,Rt);return(function(vn,Tn,Bn){let da=1/0;pn(Bn,Tn)&&(da=op(Bn,Tn[0]));for(let ui=0;uiQ.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(Q=>{this.gradients[Q.id]={}}),this.layoutVertexArray=new Oc,this.layoutVertexArray2=new ge,this.indexArray=new Jt,this.programConfigurations=new Ol(D.layers,D.zoom),this.segments=new hn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){this.hasPattern=er("line",this.layers,Q);const Pe=this.layers[0].layout.get("line-sort-key"),Ve=!Pe.isConstant(),We=[];for(const{feature:pt,id:Rt,index:Yt,sourceLayerIndex:dr}of D){const xr=this.layers[0]._featureFilter.needGeometry,qr=gr(pt,xr);if(!this.layers[0]._featureFilter.filter(new pl(this.zoom),qr,me))continue;const Jr=Ve?Pe.evaluate(qr,{},me):void 0,vn={id:Rt,properties:pt.properties,type:pt.type,sourceLayerIndex:dr,index:Yt,geometry:xr?qr.geometry:dt(pt),patterns:{},sortKey:Jr};We.push(vn)}Ve&&We.sort((pt,Rt)=>pt.sortKey-Rt.sortKey);for(const pt of We){const{geometry:Rt,index:Yt,sourceLayerIndex:dr}=pt;if(this.hasPattern){const xr=Bt("line",this.layers,pt,this.zoom,Q);this.patternFeatures.push(xr)}else this.addFeature(pt,Rt,Yt,me,{});Q.featureIndex.insert(D[Yt].feature,Rt,Yt,dr,this.index)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}addFeatures(D,Q,me){for(const Pe of this.patternFeatures)this.addFeature(Pe,Pe.geometry,Pe.index,Q,me)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=D.createVertexBuffer(this.layoutVertexArray2,bp)),this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,xp),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(D){if(D.properties&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_end"))return{start:+D.properties.mapbox_clip_start,end:+D.properties.mapbox_clip_end}}addFeature(D,Q,me,Pe,Ve){const We=this.layers[0].layout,pt=We.get("line-join").evaluate(D,{}),Rt=We.get("line-cap"),Yt=We.get("line-miter-limit"),dr=We.get("line-round-limit");this.lineClips=this.lineFeatureClips(D);for(const xr of Q)this.addLine(xr,D,pt,Rt,Yt,dr);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,me,Ve,Pe)}addLine(D,Q,me,Pe,Ve,We){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let da=0;da=2&&D[Rt-1].equals(D[Rt-2]);)Rt--;let Yt=0;for(;Yt0;if(Jo&&da>Yt){const zs=qr.dist(Jr);if(zs>2*dr){const Es=qr.sub(qr.sub(Jr)._mult(dr/zs)._round());this.updateDistance(Jr,Es),this.addCurrentVertex(Es,Tn,0,0,xr),Jr=Es}}const ls=Jr&&vn;let Wo=ls?me:pt?"butt":Pe;if(ls&&Wo==="round"&&(FiVe&&(Wo="bevel"),Wo==="bevel"&&(Fi>2&&(Wo="flipbevel"),Fi100)ui=Bn.mult(-1);else{const zs=Fi*Tn.add(Bn).mag()/Tn.sub(Bn).mag();ui._perp()._mult(zs*(hl?-1:1))}this.addCurrentVertex(qr,ui,0,0,xr),this.addCurrentVertex(qr,ui.mult(-1),0,0,xr)}else if(Wo==="bevel"||Wo==="fakeround"){const zs=-Math.sqrt(Fi*Fi-1),Es=hl?zs:0,Ts=hl?0:zs;if(Jr&&this.addCurrentVertex(qr,Tn,Es,Ts,xr),Wo==="fakeround"){const to=Math.round(180*ho/Math.PI/20);for(let Xs=1;Xs2*dr){const Es=qr.add(vn.sub(qr)._mult(dr/zs)._round());this.updateDistance(qr,Es),this.addCurrentVertex(Es,Bn,0,0,xr),qr=Es}}}}addCurrentVertex(D,Q,me,Pe,Ve,We=!1){const pt=Q.y*Pe-Q.x,Rt=-Q.y-Q.x*Pe;this.addHalfVertex(D,Q.x+Q.y*me,Q.y-Q.x*me,We,!1,me,Ve),this.addHalfVertex(D,pt,Rt,We,!0,-Pe,Ve),this.distance>Ud/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(D,Q,me,Pe,Ve,We))}addHalfVertex({x:D,y:Q},me,Pe,Ve,We,pt,Rt){const Yt=.5*(this.lineClips?this.scaledDistance*(Ud-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((D<<1)+(Ve?1:0),(Q<<1)+(We?1:0),Math.round(63*me)+128,Math.round(63*Pe)+128,1+(pt===0?0:pt<0?-1:1)|(63&Yt)<<2,Yt>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const dr=Rt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,dr),Rt.primitiveLength++),We?this.e2=dr:this.e1=dr}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(D,Q){this.distance+=D.dist(Q),this.updateScaledDistance()}}let jd,zg;Na("LineBucket",sp,{omit:["layers","patternFeatures"]});var W0={get paint(){return zg=zg||new Ue({"line-opacity":new ss(ie.paint_line["line-opacity"]),"line-color":new ss(ie.paint_line["line-color"]),"line-translate":new Zo(ie.paint_line["line-translate"]),"line-translate-anchor":new Zo(ie.paint_line["line-translate-anchor"]),"line-width":new ss(ie.paint_line["line-width"]),"line-gap-width":new ss(ie.paint_line["line-gap-width"]),"line-offset":new ss(ie.paint_line["line-offset"]),"line-blur":new ss(ie.paint_line["line-blur"]),"line-dasharray":new Xc(ie.paint_line["line-dasharray"]),"line-pattern":new kf(ie.paint_line["line-pattern"]),"line-gradient":new zc(ie.paint_line["line-gradient"])})},get layout(){return jd=jd||new Ue({"line-cap":new Zo(ie.layout_line["line-cap"]),"line-join":new ss(ie.layout_line["line-join"]),"line-miter-limit":new Zo(ie.layout_line["line-miter-limit"]),"line-round-limit":new Zo(ie.layout_line["line-round-limit"]),"line-sort-key":new ss(ie.layout_line["line-sort-key"])})}};class Yh extends ss{possiblyEvaluate(D,Q){return Q=new pl(Math.floor(Q.zoom),{now:Q.now,fadeDuration:Q.fadeDuration,zoomHistory:Q.zoomHistory,transition:Q.transition}),super.possiblyEvaluate(D,Q)}evaluate(D,Q,me,Pe){return Q=M({},Q,{zoom:Math.floor(Q.zoom)}),super.evaluate(D,Q,me,Pe)}}let K0;class Og extends oe{constructor(D){super(D,W0),this.gradientVersion=0,K0||(K0=new Yh(W0.paint.properties["line-width"].specification),K0.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(D){if(D==="line-gradient"){const Q=this.gradientExpression();this.stepInterpolant=!!(function(me){return me._styleExpression!==void 0})(Q)&&Q._styleExpression.expression instanceof In,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(D,Q){super.recalculate(D,Q),this.paint._values["line-floorwidth"]=K0.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,D)}createBucket(D){return new sp(D)}queryRadius(D){const Q=D,me=Sv(rn("line-width",this,Q),rn("line-gap-width",this,Q)),Pe=rn("line-offset",this,Q);return me/2+Math.abs(Pe)+Fn(this.paint.get("line-translate"))}queryIntersectsFeature(D,Q,me,Pe,Ve,We,pt){const Rt=ea(D,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),We.angle,pt),Yt=pt/2*Sv(this.paint.get("line-width").evaluate(Q,me),this.paint.get("line-gap-width").evaluate(Q,me)),dr=this.paint.get("line-offset").evaluate(Q,me);return dr&&(Pe=(function(xr,qr){const Jr=[];for(let vn=0;vn=3){for(let Bn=0;Bn0?D+2*Y:Y}const zm=gt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Xy=gt([{name:"a_projected_pos",components:3,type:"Float32"}],4);gt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Yy=gt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);gt([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Fg=gt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Om=gt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Fm(Y,D,Q){return Y.sections.forEach(me=>{me.text=(function(Pe,Ve,We){const pt=Ve.layout.get("text-transform").evaluate(We,{});return pt==="uppercase"?Pe=Pe.toLocaleUpperCase():pt==="lowercase"&&(Pe=Pe.toLocaleLowerCase()),zl.applyArabicShaping&&(Pe=zl.applyArabicShaping(Pe)),Pe})(me.text,D,Q)}),Y}gt([{name:"triangle",components:3,type:"Uint16"}]),gt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),gt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),gt([{type:"Float32",name:"offsetX"}]),gt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),gt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const mf={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var fc=24,Jv=wc,Bg=function(Y,D,Q,me,Pe){var Ve,We,pt=8*Pe-me-1,Rt=(1<>1,dr=-7,xr=Pe-1,qr=-1,Jr=Y[D+xr];for(xr+=qr,Ve=Jr&(1<<-dr)-1,Jr>>=-dr,dr+=pt;dr>0;Ve=256*Ve+Y[D+xr],xr+=qr,dr-=8);for(We=Ve&(1<<-dr)-1,Ve>>=-dr,dr+=me;dr>0;We=256*We+Y[D+xr],xr+=qr,dr-=8);if(Ve===0)Ve=1-Yt;else{if(Ve===Rt)return We?NaN:1/0*(Jr?-1:1);We+=Math.pow(2,me),Ve-=Yt}return(Jr?-1:1)*We*Math.pow(2,Ve-me)},Zy=function(Y,D,Q,me,Pe,Ve){var We,pt,Rt,Yt=8*Ve-Pe-1,dr=(1<>1,qr=Pe===23?Math.pow(2,-24)-Math.pow(2,-77):0,Jr=0,vn=1,Tn=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(pt=isNaN(D)?1:0,We=dr):(We=Math.floor(Math.log(D)/Math.LN2),D*(Rt=Math.pow(2,-We))<1&&(We--,Rt*=2),(D+=We+xr>=1?qr/Rt:qr*Math.pow(2,1-xr))*Rt>=2&&(We++,Rt/=2),We+xr>=dr?(pt=0,We=dr):We+xr>=1?(pt=(D*Rt-1)*Math.pow(2,Pe),We+=xr):(pt=D*Math.pow(2,xr-1)*Math.pow(2,Pe),We=0));Pe>=8;Y[Q+Jr]=255&pt,Jr+=vn,pt/=256,Pe-=8);for(We=We<0;Y[Q+Jr]=255&We,Jr+=vn,We/=256,Yt-=8);Y[Q+Jr-vn]|=128*Tn};function wc(Y){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(Y)?Y:new Uint8Array(Y||0),this.pos=0,this.type=0,this.length=this.buf.length}wc.Varint=0,wc.Fixed64=1,wc.Bytes=2,wc.Fixed32=5;var B_=4294967296,Bm=1/B_,$b=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function qd(Y){return Y.type===wc.Bytes?Y.readVarint()+Y.pos:Y.pos+1}function Nm(Y,D,Q){return Q?4294967296*D+(Y>>>0):4294967296*(D>>>0)+(Y>>>0)}function Jb(Y,D,Q){var me=D<=16383?1:D<=2097151?2:D<=268435455?3:Math.floor(Math.log(D)/(7*Math.LN2));Q.realloc(me);for(var Pe=Q.pos-1;Pe>=Y;Pe--)Q.buf[Pe+me]=Q.buf[Pe]}function N_(Y,D){for(var Q=0;Q>>8,Y[Q+2]=D>>>16,Y[Q+3]=D>>>24}function aS(Y,D){return(Y[D]|Y[D+1]<<8|Y[D+2]<<16)+(Y[D+3]<<24)}wc.prototype={destroy:function(){this.buf=null},readFields:function(Y,D,Q){for(Q=Q||this.length;this.pos>3,Ve=this.pos;this.type=7&me,Y(Pe,D,this),this.pos===Ve&&this.skip(me)}return D},readMessage:function(Y,D){return this.readFields(Y,D,this.readVarint()+this.pos)},readFixed32:function(){var Y=ew(this.buf,this.pos);return this.pos+=4,Y},readSFixed32:function(){var Y=aS(this.buf,this.pos);return this.pos+=4,Y},readFixed64:function(){var Y=ew(this.buf,this.pos)+ew(this.buf,this.pos+4)*B_;return this.pos+=8,Y},readSFixed64:function(){var Y=ew(this.buf,this.pos)+aS(this.buf,this.pos+4)*B_;return this.pos+=8,Y},readFloat:function(){var Y=Bg(this.buf,this.pos,!0,23,4);return this.pos+=4,Y},readDouble:function(){var Y=Bg(this.buf,this.pos,!0,52,8);return this.pos+=8,Y},readVarint:function(Y){var D,Q,me=this.buf;return D=127&(Q=me[this.pos++]),Q<128?D:(D|=(127&(Q=me[this.pos++]))<<7,Q<128?D:(D|=(127&(Q=me[this.pos++]))<<14,Q<128?D:(D|=(127&(Q=me[this.pos++]))<<21,Q<128?D:(function(Pe,Ve,We){var pt,Rt,Yt=We.buf;if(pt=(112&(Rt=Yt[We.pos++]))>>4,Rt<128||(pt|=(127&(Rt=Yt[We.pos++]))<<3,Rt<128)||(pt|=(127&(Rt=Yt[We.pos++]))<<10,Rt<128)||(pt|=(127&(Rt=Yt[We.pos++]))<<17,Rt<128)||(pt|=(127&(Rt=Yt[We.pos++]))<<24,Rt<128)||(pt|=(1&(Rt=Yt[We.pos++]))<<31,Rt<128))return Nm(Pe,pt,Ve);throw new Error("Expected varint not more than 10 bytes")})(D|=(15&(Q=me[this.pos]))<<28,Y,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var Y=this.readVarint();return Y%2==1?(Y+1)/-2:Y/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var Y=this.readVarint()+this.pos,D=this.pos;return this.pos=Y,Y-D>=12&&$b?(function(Q,me,Pe){return $b.decode(Q.subarray(me,Pe))})(this.buf,D,Y):(function(Q,me,Pe){for(var Ve="",We=me;We239?4:dr>223?3:dr>191?2:1;if(We+qr>Pe)break;qr===1?dr<128&&(xr=dr):qr===2?(192&(pt=Q[We+1]))==128&&(xr=(31&dr)<<6|63&pt)<=127&&(xr=null):qr===3?(Rt=Q[We+2],(192&(pt=Q[We+1]))==128&&(192&Rt)==128&&((xr=(15&dr)<<12|(63&pt)<<6|63&Rt)<=2047||xr>=55296&&xr<=57343)&&(xr=null)):qr===4&&(Rt=Q[We+2],Yt=Q[We+3],(192&(pt=Q[We+1]))==128&&(192&Rt)==128&&(192&Yt)==128&&((xr=(15&dr)<<18|(63&pt)<<12|(63&Rt)<<6|63&Yt)<=65535||xr>=1114112)&&(xr=null)),xr===null?(xr=65533,qr=1):xr>65535&&(xr-=65536,Ve+=String.fromCharCode(xr>>>10&1023|55296),xr=56320|1023&xr),Ve+=String.fromCharCode(xr),We+=qr}return Ve})(this.buf,D,Y)},readBytes:function(){var Y=this.readVarint()+this.pos,D=this.buf.subarray(this.pos,Y);return this.pos=Y,D},readPackedVarint:function(Y,D){if(this.type!==wc.Bytes)return Y.push(this.readVarint(D));var Q=qd(this);for(Y=Y||[];this.pos127;);else if(D===wc.Bytes)this.pos=this.readVarint()+this.pos;else if(D===wc.Fixed32)this.pos+=4;else{if(D!==wc.Fixed64)throw new Error("Unimplemented type: "+D);this.pos+=8}},writeTag:function(Y,D){this.writeVarint(Y<<3|D)},realloc:function(Y){for(var D=this.length||16;D268435455||Y<0?(function(D,Q){var me,Pe;if(D>=0?(me=D%4294967296|0,Pe=D/4294967296|0):(Pe=~(-D/4294967296),4294967295^(me=~(-D%4294967296))?me=me+1|0:(me=0,Pe=Pe+1|0)),D>=18446744073709552e3||D<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");Q.realloc(10),(function(Ve,We,pt){pt.buf[pt.pos++]=127&Ve|128,Ve>>>=7,pt.buf[pt.pos++]=127&Ve|128,Ve>>>=7,pt.buf[pt.pos++]=127&Ve|128,Ve>>>=7,pt.buf[pt.pos++]=127&Ve|128,pt.buf[pt.pos]=127&(Ve>>>=7)})(me,0,Q),(function(Ve,We){var pt=(7&Ve)<<4;We.buf[We.pos++]|=pt|((Ve>>>=3)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve)))))})(Pe,Q)})(Y,this):(this.realloc(4),this.buf[this.pos++]=127&Y|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=127&(Y>>>=7)|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=127&(Y>>>=7)|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=Y>>>7&127))))},writeSVarint:function(Y){this.writeVarint(Y<0?2*-Y-1:2*Y)},writeBoolean:function(Y){this.writeVarint(!!Y)},writeString:function(Y){Y=String(Y),this.realloc(4*Y.length),this.pos++;var D=this.pos;this.pos=(function(me,Pe,Ve){for(var We,pt,Rt=0;Rt55295&&We<57344){if(!pt){We>56319||Rt+1===Pe.length?(me[Ve++]=239,me[Ve++]=191,me[Ve++]=189):pt=We;continue}if(We<56320){me[Ve++]=239,me[Ve++]=191,me[Ve++]=189,pt=We;continue}We=pt-55296<<10|We-56320|65536,pt=null}else pt&&(me[Ve++]=239,me[Ve++]=191,me[Ve++]=189,pt=null);We<128?me[Ve++]=We:(We<2048?me[Ve++]=We>>6|192:(We<65536?me[Ve++]=We>>12|224:(me[Ve++]=We>>18|240,me[Ve++]=We>>12&63|128),me[Ve++]=We>>6&63|128),me[Ve++]=63&We|128)}return Ve})(this.buf,Y,this.pos);var Q=this.pos-D;Q>=128&&Jb(D,Q,this),this.pos=D-1,this.writeVarint(Q),this.pos+=Q},writeFloat:function(Y){this.realloc(4),Zy(this.buf,Y,this.pos,!0,23,4),this.pos+=4},writeDouble:function(Y){this.realloc(8),Zy(this.buf,Y,this.pos,!0,52,8),this.pos+=8},writeBytes:function(Y){var D=Y.length;this.writeVarint(D),this.realloc(D);for(var Q=0;Q=128&&Jb(Q,me,this),this.pos=Q-1,this.writeVarint(me),this.pos+=me},writeMessage:function(Y,D,Q){this.writeTag(Y,wc.Bytes),this.writeRawMessage(D,Q)},writePackedVarint:function(Y,D){D.length&&this.writeMessage(Y,N_,D)},writePackedSVarint:function(Y,D){D.length&&this.writeMessage(Y,XE,D)},writePackedBoolean:function(Y,D){D.length&&this.writeMessage(Y,WE,D)},writePackedFloat:function(Y,D){D.length&&this.writeMessage(Y,YE,D)},writePackedDouble:function(Y,D){D.length&&this.writeMessage(Y,ZE,D)},writePackedFixed32:function(Y,D){D.length&&this.writeMessage(Y,KE,D)},writePackedSFixed32:function(Y,D){D.length&&this.writeMessage(Y,$E,D)},writePackedFixed64:function(Y,D){D.length&&this.writeMessage(Y,JE,D)},writePackedSFixed64:function(Y,D){D.length&&this.writeMessage(Y,Qb,D)},writeBytesField:function(Y,D){this.writeTag(Y,wc.Bytes),this.writeBytes(D)},writeFixed32Field:function(Y,D){this.writeTag(Y,wc.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(Y,D){this.writeTag(Y,wc.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(Y,D){this.writeTag(Y,wc.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(Y,D){this.writeTag(Y,wc.Fixed64),this.writeSFixed64(D)},writeVarintField:function(Y,D){this.writeTag(Y,wc.Varint),this.writeVarint(D)},writeSVarintField:function(Y,D){this.writeTag(Y,wc.Varint),this.writeSVarint(D)},writeStringField:function(Y,D){this.writeTag(Y,wc.Bytes),this.writeString(D)},writeFloatField:function(Y,D){this.writeTag(Y,wc.Fixed32),this.writeFloat(D)},writeDoubleField:function(Y,D){this.writeTag(Y,wc.Fixed64),this.writeDouble(D)},writeBooleanField:function(Y,D){this.writeVarintField(Y,!!D)}};var j3=r(Jv);const tw=3;function QE(Y,D,Q){Y===1&&Q.readMessage(iS,D)}function iS(Y,D,Q){if(Y===3){const{id:me,bitmap:Pe,width:Ve,height:We,left:pt,top:Rt,advance:Yt}=Q.readMessage(q3,{});D.push({id:me,bitmap:new ts({width:Ve+2*tw,height:We+2*tw},Pe),metrics:{width:Ve,height:We,left:pt,top:Rt,advance:Yt}})}}function q3(Y,D,Q){Y===1?D.id=Q.readVarint():Y===2?D.bitmap=Q.readBytes():Y===3?D.width=Q.readVarint():Y===4?D.height=Q.readVarint():Y===5?D.left=Q.readSVarint():Y===6?D.top=Q.readSVarint():Y===7&&(D.advance=Q.readVarint())}const V3=tw;function rw(Y){let D=0,Q=0;for(const We of Y)D+=We.w*We.h,Q=Math.max(Q,We.w);Y.sort((We,pt)=>pt.h-We.h);const me=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(D/.95)),Q),h:1/0}];let Pe=0,Ve=0;for(const We of Y)for(let pt=me.length-1;pt>=0;pt--){const Rt=me[pt];if(!(We.w>Rt.w||We.h>Rt.h)){if(We.x=Rt.x,We.y=Rt.y,Ve=Math.max(Ve,We.y+We.h),Pe=Math.max(Pe,We.x+We.w),We.w===Rt.w&&We.h===Rt.h){const Yt=me.pop();pt=0&&me>=D&&aw[this.text.charCodeAt(me)];me--)Q--;this.text=this.text.substring(D,Q),this.sectionIndex=this.sectionIndex.slice(D,Q)}substring(D,Q){const me=new $y;return me.text=this.text.substring(D,Q),me.sectionIndex=this.sectionIndex.slice(D,Q),me.sections=this.sections,me}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((D,Q)=>Math.max(D,this.sections[Q].scale),0)}addTextSection(D,Q){this.text+=D.text,this.sections.push(U_.forText(D.scale,D.fontStack||Q));const me=this.sections.length-1;for(let Pe=0;Pe=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function nw(Y,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,Jr,vn){const Tn=$y.fromFeature(Y,Pe);let Bn;xr===e.ah.vertical&&Tn.verticalizePunctuation();const{processBidirectionalText:da,processStyledBidirectionalText:ui}=zl;if(da&&Tn.sections.length===1){Bn=[];const Fi=da(Tn.toString(),Ng(Tn,Yt,Ve,D,me,Jr));for(const ho of Fi){const Jo=new $y;Jo.text=ho,Jo.sections=Tn.sections;for(let hl=0;hl0&&Tp>Ev&&(Ev=Tp)}else{const of=Jo[zu.fontStack],kv=of&&of[Fc];if(kv&&kv.rect)o1=kv.rect,yf=kv.metrics;else{const Tp=ho[zu.fontStack],Gd=Tp&&Tp[Fc];if(!Gd)continue;yf=Gd.metrics}Uf=(uv-zu.scale)*fc}ed?(Fi.verticalizable=!0,hd.push({glyph:Fc,imageName:Wp,x:Pl,y:af+Uf,vertical:ed,scale:zu.scale,fontStack:zu.fontStack,sectionIndex:Tc,metrics:yf,rect:o1}),Pl+=Kp*zu.scale+to):(hd.push({glyph:Fc,imageName:Wp,x:Pl,y:af+Uf,vertical:ed,scale:zu.scale,fontStack:zu.fontStack,sectionIndex:Tc,metrics:yf,rect:o1}),Pl+=yf.advance*zu.scale+to)}hd.length!==0&&(Zc=Math.max(Pl-to,Zc),r6(hd,0,hd.length-1,_d,Ev)),Pl=0;const Hd=Wo*uv+Ev;jv.lineOffset=Math.max(Ev,Qv),af+=Hd,lv=Math.max(Hd,lv),++Ah}var Wh;const ud=af-Ky,{horizontalAlign:cd,verticalAlign:fd}=G3(zs);(function(Yf,uv,Qv,jv,hd,Ev,Hd,gf,zu){const Tc=(uv-Qv)*hd;let Fc=0;Fc=Ev!==Hd?-gf*jv-Ky:(-jv*zu+.5)*Hd;for(const Uf of Yf)for(const yf of Uf.positionedGlyphs)yf.x+=Tc,yf.y+=Fc})(Fi.positionedLines,_d,cd,fd,Zc,lv,Wo,ud,ls.length),Fi.top+=-fd*ud,Fi.bottom=Fi.top+ud,Fi.left+=-cd*Zc,Fi.right=Fi.left+Zc})(ti,D,Q,me,Bn,We,pt,Rt,xr,Yt,qr,vn),!(function(Fi){for(const ho of Fi)if(ho.positionedGlyphs.length!==0)return!1;return!0})(Ba)&&ti}const aw={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},e6={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},t6={40:!0};function iw(Y,D,Q,me,Pe,Ve){if(D.imageName){const We=me[D.imageName];return We?We.displaySize[0]*D.scale*fc/Ve+Pe:0}{const We=Q[D.fontStack],pt=We&&We[Y];return pt?pt.metrics.advance*D.scale+Pe:0}}function sS(Y,D,Q,me){const Pe=Math.pow(Y-D,2);return me?Y=0;let Yt=0;for(let xr=0;xrYt){const dr=Math.ceil(Ve/Yt);Pe*=dr/We,We=dr}return{x1:me,y1:Pe,x2:me+Ve,y2:Pe+We}}function uS(Y,D,Q,me,Pe,Ve){const We=Y.image;let pt;if(We.content){const Bn=We.content,da=We.pixelRatio||1;pt=[Bn[0]/da,Bn[1]/da,We.displaySize[0]-Bn[2]/da,We.displaySize[1]-Bn[3]/da]}const Rt=D.left*Ve,Yt=D.right*Ve;let dr,xr,qr,Jr;Q==="width"||Q==="both"?(Jr=Pe[0]+Rt-me[3],xr=Pe[0]+Yt+me[1]):(Jr=Pe[0]+(Rt+Yt-We.displaySize[0])/2,xr=Jr+We.displaySize[0]);const vn=D.top*Ve,Tn=D.bottom*Ve;return Q==="height"||Q==="both"?(dr=Pe[1]+vn-me[0],qr=Pe[1]+Tn+me[2]):(dr=Pe[1]+(vn+Tn-We.displaySize[1])/2,qr=dr+We.displaySize[1]),{image:We,top:dr,right:xr,bottom:qr,left:Jr,collisionPadding:pt}}const j_=255,_0=128,jm=j_*_0;function cS(Y,D){const{expression:Q}=D;if(Q.kind==="constant")return{kind:"constant",layoutSize:Q.evaluate(new pl(Y+1))};if(Q.kind==="source")return{kind:"source"};{const{zoomStops:me,interpolationType:Pe}=Q;let Ve=0;for(;VeWe.id),this.index=D.index,this.pixelRatio=D.pixelRatio,this.sourceLayerIndex=D.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=aa([]),this.placementViewportMatrix=aa([]);const Q=this.layers[0]._unevaluatedLayout._values;this.textSizeData=cS(this.zoom,Q["text-size"]),this.iconSizeData=cS(this.zoom,Q["icon-size"]);const me=this.layers[0].layout,Pe=me.get("symbol-sort-key"),Ve=me.get("symbol-z-order");this.canOverlap=X3(me,"text-overlap","text-allow-overlap")!=="never"||X3(me,"icon-overlap","icon-allow-overlap")!=="never"||me.get("text-ignore-placement")||me.get("icon-ignore-placement"),this.sortFeaturesByKey=Ve!=="viewport-y"&&!Pe.isConstant(),this.sortFeaturesByY=(Ve==="viewport-y"||Ve==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,me.get("symbol-placement")==="point"&&(this.writingModes=me.get("text-writing-mode").map(We=>e.ah[We])),this.stateDependentLayerIds=this.layers.filter(We=>We.isStateDependent()).map(We=>We.id),this.sourceID=D.sourceID}createArrays(){this.text=new th(new Ol(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new th(new Ol(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new Js,this.lineVertexArray=new Qs,this.symbolInstances=new $o,this.textAnchorOffsets=new al}calculateGlyphDependencies(D,Q,me,Pe,Ve){for(let We=0;We0)&&(We.value.kind!=="constant"||We.value.value.length>0),dr=Rt.value.kind!=="constant"||!!Rt.value.value||Object.keys(Rt.parameters).length>0,xr=Ve.get("symbol-sort-key");if(this.features=[],!Yt&&!dr)return;const qr=Q.iconDependencies,Jr=Q.glyphDependencies,vn=Q.availableImages,Tn=new pl(this.zoom);for(const{feature:Bn,id:da,index:ui,sourceLayerIndex:Ba}of D){const ti=Pe._featureFilter.needGeometry,Fi=gr(Bn,ti);if(!Pe._featureFilter.filter(Tn,Fi,me))continue;let ho,Jo;if(ti||(Fi.geometry=dt(Bn)),Yt){const ls=Pe.getValueAndResolveTokens("text-field",Fi,me,vn),Wo=mn.factory(ls),zs=this.hasRTLText=this.hasRTLText||i6(Wo);(!zs||zl.getRTLTextPluginStatus()==="unavailable"||zs&&zl.isParsed())&&(ho=Fm(Wo,Pe,Fi))}if(dr){const ls=Pe.getValueAndResolveTokens("icon-image",Fi,me,vn);Jo=ls instanceof ha?ls:ha.fromString(ls)}if(!ho&&!Jo)continue;const hl=this.sortFeaturesByKey?xr.evaluate(Fi,{},me):void 0;if(this.features.push({id:da,text:ho,icon:Jo,index:ui,sourceLayerIndex:Ba,geometry:Fi.geometry,properties:Bn.properties,type:a6[Bn.type],sortKey:hl}),Jo&&(qr[Jo.name]=!0),ho){const ls=We.evaluate(Fi,{},me).join(","),Wo=Ve.get("text-rotation-alignment")!=="viewport"&&Ve.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(const zs of ho.sections)if(zs.image)qr[zs.image.name]=!0;else{const Es=is(ho.toString()),Ts=zs.fontStack||ls,to=Jr[Ts]=Jr[Ts]||{};this.calculateGlyphDependencies(zs.text,to,Wo,this.allowVerticalPlacement,Es)}}}Ve.get("symbol-placement")==="line"&&(this.features=(function(Bn){const da={},ui={},Ba=[];let ti=0;function Fi(ls){Ba.push(Bn[ls]),ti++}function ho(ls,Wo,zs){const Es=ui[ls];return delete ui[ls],ui[Wo]=Es,Ba[Es].geometry[0].pop(),Ba[Es].geometry[0]=Ba[Es].geometry[0].concat(zs[0]),Es}function Jo(ls,Wo,zs){const Es=da[Wo];return delete da[Wo],da[ls]=Es,Ba[Es].geometry[0].shift(),Ba[Es].geometry[0]=zs[0].concat(Ba[Es].geometry[0]),Es}function hl(ls,Wo,zs){const Es=zs?Wo[0][Wo[0].length-1]:Wo[0][0];return`${ls}:${Es.x}:${Es.y}`}for(let ls=0;lsls.geometry)})(this.features)),this.sortFeaturesByKey&&this.features.sort((Bn,da)=>Bn.sortKey-da.sortKey)}update(D,Q,me){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(D,Q,this.layers,me),this.icon.programConfigurations.updatePaintArrays(D,Q,this.layers,me))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(D){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(D),this.iconCollisionBox.upload(D)),this.text.upload(D,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(D,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(D,Q){const me=this.lineVertexArray.length;if(D.segment!==void 0){let Pe=D.dist(Q[D.segment+1]),Ve=D.dist(Q[D.segment]);const We={};for(let pt=D.segment+1;pt=0;pt--)We[pt]={x:Q[pt].x,y:Q[pt].y,tileUnitDistanceFromAnchor:Ve},pt>0&&(Ve+=Q[pt-1].dist(Q[pt]));for(let pt=0;pt0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(D,Q){const me=D.placedSymbolArray.get(Q),Pe=me.vertexStartIndex+4*me.numGlyphs;for(let Ve=me.vertexStartIndex;VePe[pt]-Pe[Rt]||Ve[Rt]-Ve[pt]),We}addToSortKeyRanges(D,Q){const me=this.sortKeyRanges[this.sortKeyRanges.length-1];me&&me.sortKey===Q?me.symbolInstanceEnd=D+1:this.sortKeyRanges.push({sortKey:Q,symbolInstanceStart:D,symbolInstanceEnd:D+1})}sortFeatures(D){if(this.sortFeaturesByY&&this.sortedAngle!==D&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(D),this.sortedAngle=D,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const Q of this.symbolInstanceIndexes){const me=this.symbolInstances.get(Q);this.featureSortOrder.push(me.featureIndex),[me.rightJustifiedTextSymbolIndex,me.centerJustifiedTextSymbolIndex,me.leftJustifiedTextSymbolIndex].forEach((Pe,Ve,We)=>{Pe>=0&&We.indexOf(Pe)===Ve&&this.addIndicesForPlacedSymbol(this.text,Pe)}),me.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,me.verticalPlacedTextSymbolIndex),me.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,me.placedIconSymbolIndex),me.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,me.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let q_,V_;Na("SymbolBucket",Ug,{omit:["layers","collisionBoxArray","features","compareText"]}),Ug.MAX_GLYPHS=65535,Ug.addDynamicAttributes=qm;var Z3={get paint(){return V_=V_||new Ue({"icon-opacity":new ss(ie.paint_symbol["icon-opacity"]),"icon-color":new ss(ie.paint_symbol["icon-color"]),"icon-halo-color":new ss(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new ss(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ss(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new Zo(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new Zo(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new ss(ie.paint_symbol["text-opacity"]),"text-color":new ss(ie.paint_symbol["text-color"],{runtimeType:$t,getOverride:Y=>Y.textColor,hasOverride:Y=>!!Y.textColor}),"text-halo-color":new ss(ie.paint_symbol["text-halo-color"]),"text-halo-width":new ss(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new ss(ie.paint_symbol["text-halo-blur"]),"text-translate":new Zo(ie.paint_symbol["text-translate"]),"text-translate-anchor":new Zo(ie.paint_symbol["text-translate-anchor"])})},get layout(){return q_=q_||new Ue({"symbol-placement":new Zo(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new Zo(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Zo(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ss(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Zo(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Zo(ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Zo(ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Zo(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new Zo(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Zo(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new ss(ie.layout_symbol["icon-size"]),"icon-text-fit":new Zo(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Zo(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new ss(ie.layout_symbol["icon-image"]),"icon-rotate":new ss(ie.layout_symbol["icon-rotate"]),"icon-padding":new ss(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new Zo(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new ss(ie.layout_symbol["icon-offset"]),"icon-anchor":new ss(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Zo(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Zo(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Zo(ie.layout_symbol["text-rotation-alignment"]),"text-field":new ss(ie.layout_symbol["text-field"]),"text-font":new ss(ie.layout_symbol["text-font"]),"text-size":new ss(ie.layout_symbol["text-size"]),"text-max-width":new ss(ie.layout_symbol["text-max-width"]),"text-line-height":new Zo(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new ss(ie.layout_symbol["text-letter-spacing"]),"text-justify":new ss(ie.layout_symbol["text-justify"]),"text-radial-offset":new ss(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Zo(ie.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new ss(ie.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new ss(ie.layout_symbol["text-anchor"]),"text-max-angle":new Zo(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new Zo(ie.layout_symbol["text-writing-mode"]),"text-rotate":new ss(ie.layout_symbol["text-rotate"]),"text-padding":new Zo(ie.layout_symbol["text-padding"]),"text-keep-upright":new Zo(ie.layout_symbol["text-keep-upright"]),"text-transform":new ss(ie.layout_symbol["text-transform"]),"text-offset":new ss(ie.layout_symbol["text-offset"]),"text-allow-overlap":new Zo(ie.layout_symbol["text-allow-overlap"]),"text-overlap":new Zo(ie.layout_symbol["text-overlap"]),"text-ignore-placement":new Zo(ie.layout_symbol["text-ignore-placement"]),"text-optional":new Zo(ie.layout_symbol["text-optional"])})}};class Qy{constructor(D){if(D.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=D.property.overrides?D.property.overrides.runtimeType:ft,this.defaultValue=D}evaluate(D){if(D.formattedSection){const Q=this.defaultValue.property.overrides;if(Q&&Q.hasOverride(D.formattedSection))return Q.getOverride(D.formattedSection)}return D.feature&&D.featureState?this.defaultValue.evaluate(D.feature,D.featureState):this.defaultValue.property.specification.default}eachChild(D){this.defaultValue.isConstant()||D(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Na("FormatSectionOverride",Qy,{omit:["defaultValue"]});class lw extends oe{constructor(D){super(D,Z3)}recalculate(D,Q){if(super.recalculate(D,Q),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const me=this.layout.get("text-writing-mode");if(me){const Pe=[];for(const Ve of me)Pe.indexOf(Ve)<0&&Pe.push(Ve);this.layout._values["text-writing-mode"]=Pe}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(D,Q,me,Pe){const Ve=this.layout.get(D).evaluate(Q,{},me,Pe),We=this._unevaluatedLayout._values[D];return We.isDataDriven()||Of(We.value)||!Ve?Ve:(function(pt,Rt){return Rt.replace(/{([^{}]+)}/g,(Yt,dr)=>pt&&dr in pt?String(pt[dr]):"")})(Q.properties,Ve)}createBucket(D){return new Ug(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const D of Z3.paint.overridableProperties){if(!lw.hasPaintOverride(this.layout,D))continue;const Q=this.paint.get(D),me=new Qy(Q),Pe=new Rc(me,Q.property.specification);let Ve=null;Ve=Q.value.kind==="constant"||Q.value.kind==="source"?new Af("source",Pe):new vc("composite",Pe,Q.value.zoomStops),this.paint._values[D]=new Mu(Q.property,Ve,Q.parameters)}}_handleOverridablePaintPropertyUpdate(D,Q,me){return!(!this.layout||Q.isDataDriven()||me.isDataDriven())&&lw.hasPaintOverride(this.layout,D)}static hasPaintOverride(D,Q){const me=D.get("text-field"),Pe=Z3.paint.properties[Q];let Ve=!1;const We=pt=>{for(const Rt of pt)if(Pe.overrides&&Pe.overrides.hasOverride(Rt))return void(Ve=!0)};if(me.value.kind==="constant"&&me.value.value instanceof mn)We(me.value.value.sections);else if(me.value.kind==="source"){const pt=Yt=>{Ve||(Yt instanceof Ci&&Vn(Yt.value)===Wr?We(Yt.value.sections):Yt instanceof ll?We(Yt.sections):Yt.eachChild(pt))},Rt=me.value;Rt._styleExpression&&pt(Rt._styleExpression.expression)}return Ve}}let W3;var fS={get paint(){return W3=W3||new Ue({"background-color":new Zo(ie.paint_background["background-color"]),"background-pattern":new Xc(ie.paint_background["background-pattern"]),"background-opacity":new Zo(ie.paint_background["background-opacity"])})}};class H_ extends oe{constructor(D){super(D,fS)}}let uw;var K3={get paint(){return uw=uw||new Ue({"raster-opacity":new Zo(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new Zo(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Zo(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Zo(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new Zo(ie.paint_raster["raster-saturation"]),"raster-contrast":new Zo(ie.paint_raster["raster-contrast"]),"raster-resampling":new Zo(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new Zo(ie.paint_raster["raster-fade-duration"])})}};class o6 extends oe{constructor(D){super(D,K3)}}class hS extends oe{constructor(D){super(D,{}),this.onAdd=Q=>{this.implementation.onAdd&&this.implementation.onAdd(Q,Q.painter.context.gl)},this.onRemove=Q=>{this.implementation.onRemove&&this.implementation.onRemove(Q,Q.painter.context.gl)},this.implementation=D}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class G_{constructor(D){this._methodToThrottle=D,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const $3=63710088e-1;class x0{constructor(D,Q){if(isNaN(D)||isNaN(Q))throw new Error(`Invalid LngLat object: (${D}, ${Q})`);if(this.lng=+D,this.lat=+Q,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new x0(A(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(D){const Q=Math.PI/180,me=this.lat*Q,Pe=D.lat*Q,Ve=Math.sin(me)*Math.sin(Pe)+Math.cos(me)*Math.cos(Pe)*Math.cos((D.lng-this.lng)*Q);return $3*Math.acos(Math.min(Ve,1))}static convert(D){if(D instanceof x0)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new x0(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new x0(Number("lng"in D?D.lng:D.lon),Number(D.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const vS=2*Math.PI*$3;function cw(Y){return vS*Math.cos(Y*Math.PI/180)}function fw(Y){return(180+Y)/360}function dS(Y){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Y*Math.PI/360)))/360}function wp(Y,D){return Y/cw(D)}function J3(Y){return 360/Math.PI*Math.atan(Math.exp((180-360*Y)*Math.PI/180))-90}class X_{constructor(D,Q,me=0){this.x=+D,this.y=+Q,this.z=+me}static fromLngLat(D,Q=0){const me=x0.convert(D);return new X_(fw(me.lng),dS(me.lat),wp(Q,me.lat))}toLngLat(){return new x0(360*this.x-180,J3(this.y))}toAltitude(){return this.z*cw(J3(this.y))}meterInMercatorCoordinateUnits(){return 1/vS*(D=J3(this.y),1/Math.cos(D*Math.PI/180));var D}}function pS(Y,D,Q){var me=2*Math.PI*6378137/256/Math.pow(2,Q);return[Y*me-2*Math.PI*6378137/2,D*me-2*Math.PI*6378137/2]}class Q3{constructor(D,Q,me){if(!(function(Pe,Ve,We){return!(Pe<0||Pe>25||We<0||We>=Math.pow(2,Pe)||Ve<0||Ve>=Math.pow(2,Pe))})(D,Q,me))throw new Error(`x=${Q}, y=${me}, z=${D} outside of bounds. 0<=x<${Math.pow(2,D)}, 0<=y<${Math.pow(2,D)} 0<=z<=25 `);this.z=D,this.x=Q,this.y=me,this.key=e1(0,D,D,Q,me)}equals(D){return this.z===D.z&&this.x===D.x&&this.y===D.y}url(D,Q,me){const Pe=(We=this.y,pt=this.z,Rt=pS(256*(Ve=this.x),256*(We=Math.pow(2,pt)-We-1),pt),Yt=pS(256*(Ve+1),256*(We+1),pt),Rt[0]+","+Rt[1]+","+Yt[0]+","+Yt[1]);var Ve,We,pt,Rt,Yt;const dr=(function(xr,qr,Jr){let vn,Tn="";for(let Bn=xr;Bn>0;Bn--)vn=1<1?"@2x":"").replace(/{quadkey}/g,dr).replace(/{bbox-epsg-3857}/g,Pe)}isChildOf(D){const Q=this.z-D.z;return Q>0&&D.x===this.x>>Q&&D.y===this.y>>Q}getTilePoint(D){const Q=Math.pow(2,this.z);return new i((D.x*Q-this.x)*Wl,(D.y*Q-this.y)*Wl)}toString(){return`${this.z}/${this.x}/${this.y}`}}class mS{constructor(D,Q){this.wrap=D,this.canonical=Q,this.key=e1(D,Q.z,Q.z,Q.x,Q.y)}}class lp{constructor(D,Q,me,Pe,Ve){if(D= z; overscaledZ = ${D}; z = ${me}`);this.overscaledZ=D,this.wrap=Q,this.canonical=new Q3(me,+Pe,+Ve),this.key=e1(Q,D,me,Pe,Ve)}clone(){return new lp(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(D){return this.overscaledZ===D.overscaledZ&&this.wrap===D.wrap&&this.canonical.equals(D.canonical)}scaledTo(D){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);const Q=this.canonical.z-D;return D>this.canonical.z?new lp(D,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new lp(D,this.wrap,D,this.canonical.x>>Q,this.canonical.y>>Q)}calculateScaledKey(D,Q){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);const me=this.canonical.z-D;return D>this.canonical.z?e1(this.wrap*+Q,D,this.canonical.z,this.canonical.x,this.canonical.y):e1(this.wrap*+Q,D,D,this.canonical.x>>me,this.canonical.y>>me)}isChildOf(D){if(D.wrap!==this.wrap)return!1;const Q=this.canonical.z-D.canonical.z;return D.overscaledZ===0||D.overscaledZ>Q&&D.canonical.y===this.canonical.y>>Q}children(D){if(this.overscaledZ>=D)return[new lp(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const Q=this.canonical.z+1,me=2*this.canonical.x,Pe=2*this.canonical.y;return[new lp(Q,this.wrap,Q,me,Pe),new lp(Q,this.wrap,Q,me+1,Pe),new lp(Q,this.wrap,Q,me,Pe+1),new lp(Q,this.wrap,Q,me+1,Pe+1)]}isLessThan(D){return this.wrapD.wrap)&&(this.overscaledZD.overscaledZ)&&(this.canonical.xD.canonical.x)&&this.canonical.ythis.max&&(this.max=xr),xr=this.dim+1||Q<-1||Q>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(Q+1)*this.stride+(D+1)}unpack(D,Q,me){return D*this.redFactor+Q*this.greenFactor+me*this.blueFactor-this.baseShift}getPixels(){return new cl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(D,Q,me){if(this.dim!==D.dim)throw new Error("dem dimension mismatch");let Pe=Q*this.dim,Ve=Q*this.dim+this.dim,We=me*this.dim,pt=me*this.dim+this.dim;switch(Q){case-1:Pe=Ve-1;break;case 1:Ve=Pe+1}switch(me){case-1:We=pt-1;break;case 1:pt=We+1}const Rt=-Q*this.dim,Yt=-me*this.dim;for(let dr=We;dr=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${D} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[D]}}class yS{constructor(D,Q,me,Pe,Ve){this.type="Feature",this._vectorTileFeature=D,D._z=Q,D._x=me,D._y=Pe,this.properties=D.properties,this.id=Ve}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(D){this._geometry=D}toJSON(){const D={geometry:this.geometry};for(const Q in this)Q!=="_geometry"&&Q!=="_vectorTileFeature"&&(D[Q]=this[Q]);return D}}class _S{constructor(D,Q){this.tileID=D,this.x=D.canonical.x,this.y=D.canonical.y,this.z=D.canonical.z,this.grid=new Ai(Wl,16,0),this.grid3D=new Ai(Wl,16,0),this.featureIndexArray=new ru,this.promoteId=Q}insert(D,Q,me,Pe,Ve,We){const pt=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(me,Pe,Ve);const Rt=We?this.grid3D:this.grid;for(let Yt=0;Yt=0&&xr[3]>=0&&Rt.insert(pt,xr[0],xr[1],xr[2],xr[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new la.VectorTile(new j3(this.rawTileData)).layers,this.sourceLayerCoder=new gS(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(D,Q,me,Pe){this.loadVTLayers();const Ve=D.params||{},We=Wl/D.tileSize/D.scale,pt=xh(Ve.filter),Rt=D.queryGeometry,Yt=D.queryPadding*We,dr=eT(Rt),xr=this.grid.query(dr.minX-Yt,dr.minY-Yt,dr.maxX+Yt,dr.maxY+Yt),qr=eT(D.cameraQueryGeometry),Jr=this.grid3D.query(qr.minX-Yt,qr.minY-Yt,qr.maxX+Yt,qr.maxY+Yt,(Bn,da,ui,Ba)=>(function(ti,Fi,ho,Jo,hl){for(const Wo of ti)if(Fi<=Wo.x&&ho<=Wo.y&&Jo>=Wo.x&&hl>=Wo.y)return!0;const ls=[new i(Fi,ho),new i(Fi,hl),new i(Jo,hl),new i(Jo,ho)];if(ti.length>2){for(const Wo of ls)if(Ha(ti,Wo))return!0}for(let Wo=0;Wo(Ba||(Ba=dt(ti)),Fi.queryIntersectsFeature(Rt,ti,ho,Ba,this.z,D.transform,We,D.pixelPosMatrix)))}return vn}loadMatchingFeature(D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr){const qr=this.bucketLayerIDs[Q];if(We&&!(function(Bn,da){for(let ui=0;ui=0)return!0;return!1})(We,qr))return;const Jr=this.sourceLayerCoder.decode(me),vn=this.vtLayers[Jr].feature(Pe);if(Ve.needGeometry){const Bn=gr(vn,!0);if(!Ve.filter(new pl(this.tileID.overscaledZ),Bn,this.tileID.canonical))return}else if(!Ve.filter(new pl(this.tileID.overscaledZ),vn))return;const Tn=this.getId(vn,Jr);for(let Bn=0;Bn{const pt=D instanceof Ef?D.get(We):null;return pt&&pt.evaluate?pt.evaluate(Q,me,Pe):pt})}function eT(Y){let D=1/0,Q=1/0,me=-1/0,Pe=-1/0;for(const Ve of Y)D=Math.min(D,Ve.x),Q=Math.min(Q,Ve.y),me=Math.max(me,Ve.x),Pe=Math.max(Pe,Ve.y);return{minX:D,minY:Q,maxX:me,maxY:Pe}}function bS(Y,D){return D-Y}function wS(Y,D,Q,me,Pe){const Ve=[];for(let We=0;We=me&&xr.x>=me||(dr.x>=me?dr=new i(me,dr.y+(me-dr.x)/(xr.x-dr.x)*(xr.y-dr.y))._round():xr.x>=me&&(xr=new i(me,dr.y+(me-dr.x)/(xr.x-dr.x)*(xr.y-dr.y))._round()),dr.y>=Pe&&xr.y>=Pe||(dr.y>=Pe?dr=new i(dr.x+(Pe-dr.y)/(xr.y-dr.y)*(xr.x-dr.x),Pe)._round():xr.y>=Pe&&(xr=new i(dr.x+(Pe-dr.y)/(xr.y-dr.y)*(xr.x-dr.x),Pe)._round()),Rt&&dr.equals(Rt[Rt.length-1])||(Rt=[dr],Ve.push(Rt)),Rt.push(xr)))))}}return Ve}Na("FeatureIndex",_S,{omit:["rawTileData","sourceLayerCoder"]});class Vm extends i{constructor(D,Q,me,Pe){super(D,Q),this.angle=me,Pe!==void 0&&(this.segment=Pe)}clone(){return new Vm(this.x,this.y,this.angle,this.segment)}}function TS(Y,D,Q,me,Pe){if(D.segment===void 0||Q===0)return!0;let Ve=D,We=D.segment+1,pt=0;for(;pt>-Q/2;){if(We--,We<0)return!1;pt-=Y[We].dist(Ve),Ve=Y[We]}pt+=Y[We].dist(Y[We+1]),We++;const Rt=[];let Yt=0;for(;ptme;)Yt-=Rt.shift().angleDelta;if(Yt>Pe)return!1;We++,pt+=dr.dist(xr)}return!0}function AS(Y){let D=0;for(let Q=0;QYt){const vn=(Yt-Rt)/Jr,Tn=Eo.number(xr.x,qr.x,vn),Bn=Eo.number(xr.y,qr.y,vn),da=new Vm(Tn,Bn,qr.angleTo(xr),dr);return da._round(),!We||TS(Y,da,pt,We,D)?da:void 0}Rt+=Jr}}function l6(Y,D,Q,me,Pe,Ve,We,pt,Rt){const Yt=SS(me,Ve,We),dr=MS(me,Pe),xr=dr*We,qr=Y[0].x===0||Y[0].x===Rt||Y[0].y===0||Y[0].y===Rt;return D-xr=0&&ti=0&&Fi=0&&qr+Yt<=dr){const ho=new Vm(ti,Fi,ui,vn);ho._round(),me&&!TS(Y,ho,Ve,me,Pe)||Jr.push(ho)}}xr+=da}return pt||Jr.length||We||(Jr=qg(Y,xr/2,Q,me,Pe,Ve,We,!0,Rt)),Jr}Na("Anchor",Vm);const t1=Zh;function ES(Y,D,Q,me){const Pe=[],Ve=Y.image,We=Ve.pixelRatio,pt=Ve.paddedRect.w-2*t1,Rt=Ve.paddedRect.h-2*t1;let Yt={x1:Y.left,y1:Y.top,x2:Y.right,y2:Y.bottom};const dr=Ve.stretchX||[[0,pt]],xr=Ve.stretchY||[[0,Rt]],qr=(to,Xs)=>to+Xs[1]-Xs[0],Jr=dr.reduce(qr,0),vn=xr.reduce(qr,0),Tn=pt-Jr,Bn=Rt-vn;let da=0,ui=Jr,Ba=0,ti=vn,Fi=0,ho=Tn,Jo=0,hl=Bn;if(Ve.content&&me){const to=Ve.content,Xs=to[2]-to[0],Os=to[3]-to[1];(Ve.textFitWidth||Ve.textFitHeight)&&(Yt=lS(Y)),da=r1(dr,0,to[0]),Ba=r1(xr,0,to[1]),ui=r1(dr,to[0],to[2]),ti=r1(xr,to[1],to[3]),Fi=to[0]-da,Jo=to[1]-Ba,ho=Xs-ui,hl=Os-ti}const ls=Yt.x1,Wo=Yt.y1,zs=Yt.x2-ls,Es=Yt.y2-Wo,Ts=(to,Xs,Os,Pl)=>{const af=Vd(to.stretch-da,ui,zs,ls),Zc=hw(to.fixed-Fi,ho,to.stretch,Jr),lv=Vd(Xs.stretch-Ba,ti,Es,Wo),_d=hw(Xs.fixed-Jo,hl,Xs.stretch,vn),Ah=Vd(Os.stretch-da,ui,zs,ls),Wh=hw(Os.fixed-Fi,ho,Os.stretch,Jr),ud=Vd(Pl.stretch-Ba,ti,Es,Wo),cd=hw(Pl.fixed-Jo,hl,Pl.stretch,vn),fd=new i(af,lv),Yf=new i(Ah,lv),uv=new i(Ah,ud),Qv=new i(af,ud),jv=new i(Zc/We,_d/We),hd=new i(Wh/We,cd/We),Ev=D*Math.PI/180;if(Ev){const zu=Math.sin(Ev),Tc=Math.cos(Ev),Fc=[Tc,-zu,zu,Tc];fd._matMult(Fc),Yf._matMult(Fc),Qv._matMult(Fc),uv._matMult(Fc)}const Hd=to.stretch+to.fixed,gf=Xs.stretch+Xs.fixed;return{tl:fd,tr:Yf,bl:Qv,br:uv,tex:{x:Ve.paddedRect.x+t1+Hd,y:Ve.paddedRect.y+t1+gf,w:Os.stretch+Os.fixed-Hd,h:Pl.stretch+Pl.fixed-gf},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:jv,pixelOffsetBR:hd,minFontScaleX:ho/We/zs,minFontScaleY:hl/We/Es,isSDF:Q}};if(me&&(Ve.stretchX||Ve.stretchY)){const to=n1(dr,Tn,Jr),Xs=n1(xr,Bn,vn);for(let Os=0;Os0&&(Tn=Math.max(10,Tn),this.circleDiameter=Tn)}else{const qr=!((xr=We.image)===null||xr===void 0)&&xr.content&&(We.image.textFitWidth||We.image.textFitHeight)?lS(We):{x1:We.left,y1:We.top,x2:We.right,y2:We.bottom};qr.y1=qr.y1*pt-Rt[0],qr.y2=qr.y2*pt+Rt[2],qr.x1=qr.x1*pt-Rt[3],qr.x2=qr.x2*pt+Rt[1];const Jr=We.collisionPadding;if(Jr&&(qr.x1-=Jr[0]*pt,qr.y1-=Jr[1]*pt,qr.x2+=Jr[2]*pt,qr.y2+=Jr[3]*pt),dr){const vn=new i(qr.x1,qr.y1),Tn=new i(qr.x2,qr.y1),Bn=new i(qr.x1,qr.y2),da=new i(qr.x2,qr.y2),ui=dr*Math.PI/180;vn._rotate(ui),Tn._rotate(ui),Bn._rotate(ui),da._rotate(ui),qr.x1=Math.min(vn.x,Tn.x,Bn.x,da.x),qr.x2=Math.max(vn.x,Tn.x,Bn.x,da.x),qr.y1=Math.min(vn.y,Tn.y,Bn.y,da.y),qr.y2=Math.max(vn.y,Tn.y,Bn.y,da.y)}D.emplaceBack(Q.x,Q.y,qr.x1,qr.y1,qr.x2,qr.y2,me,Pe,Ve)}this.boxEndIndex=D.length}}class u6{constructor(D=[],Q=(me,Pe)=>mePe?1:0){if(this.data=D,this.length=this.data.length,this.compare=Q,this.length>0)for(let me=(this.length>>1)-1;me>=0;me--)this._down(me)}push(D){this.data.push(D),this._up(this.length++)}pop(){if(this.length===0)return;const D=this.data[0],Q=this.data.pop();return--this.length>0&&(this.data[0]=Q,this._down(0)),D}peek(){return this.data[0]}_up(D){const{data:Q,compare:me}=this,Pe=Q[D];for(;D>0;){const Ve=D-1>>1,We=Q[Ve];if(me(Pe,We)>=0)break;Q[D]=We,D=Ve}Q[D]=Pe}_down(D){const{data:Q,compare:me}=this,Pe=this.length>>1,Ve=Q[D];for(;D=0)break;Q[D]=Q[We],D=We}Q[D]=Ve}}function c6(Y,D=1,Q=!1){let me=1/0,Pe=1/0,Ve=-1/0,We=-1/0;const pt=Y[0];for(let Jr=0;JrVe)&&(Ve=vn.x),(!Jr||vn.y>We)&&(We=vn.y)}const Rt=Math.min(Ve-me,We-Pe);let Yt=Rt/2;const dr=new u6([],f6);if(Rt===0)return new i(me,Pe);for(let Jr=me;Jrxr.d||!xr.d)&&(xr=Jr,Q&&console.log("found best %d after %d probes",Math.round(1e4*Jr.d)/1e4,qr)),Jr.max-xr.d<=D||(Yt=Jr.h/2,dr.push(new b0(Jr.p.x-Yt,Jr.p.y-Yt,Yt,Y)),dr.push(new b0(Jr.p.x+Yt,Jr.p.y-Yt,Yt,Y)),dr.push(new b0(Jr.p.x-Yt,Jr.p.y+Yt,Yt,Y)),dr.push(new b0(Jr.p.x+Yt,Jr.p.y+Yt,Yt,Y)),qr+=4)}return Q&&(console.log(`num probes: ${qr}`),console.log(`best distance: ${xr.d}`)),xr.p}function f6(Y,D){return D.max-Y.max}function b0(Y,D,Q,me){this.p=new i(Y,D),this.h=Q,this.d=(function(Pe,Ve){let We=!1,pt=1/0;for(let Rt=0;RtPe.y!=vn.y>Pe.y&&Pe.x<(vn.x-Jr.x)*(Pe.y-Jr.y)/(vn.y-Jr.y)+Jr.x&&(We=!We),pt=Math.min(pt,Bi(Pe,Jr,vn))}}return(We?1:-1)*Math.sqrt(pt)})(this.p,me),this.max=this.d+this.h*Math.SQRT2}var Mv;e.aq=void 0,(Mv=e.aq||(e.aq={}))[Mv.center=1]="center",Mv[Mv.left=2]="left",Mv[Mv.right=3]="right",Mv[Mv.top=4]="top",Mv[Mv.bottom=5]="bottom",Mv[Mv["top-left"]=6]="top-left",Mv[Mv["top-right"]=7]="top-right",Mv[Mv["bottom-left"]=8]="bottom-left",Mv[Mv["bottom-right"]=9]="bottom-right";const Hm=7,tT=Number.POSITIVE_INFINITY;function kS(Y,D){return D[1]!==tT?(function(Q,me,Pe){let Ve=0,We=0;switch(me=Math.abs(me),Pe=Math.abs(Pe),Q){case"top-right":case"top-left":case"top":We=Pe-Hm;break;case"bottom-right":case"bottom-left":case"bottom":We=-Pe+Hm}switch(Q){case"top-right":case"bottom-right":case"right":Ve=-me;break;case"top-left":case"bottom-left":case"left":Ve=me}return[Ve,We]})(Y,D[0],D[1]):(function(Q,me){let Pe=0,Ve=0;me<0&&(me=0);const We=me/Math.SQRT2;switch(Q){case"top-right":case"top-left":Ve=We-Hm;break;case"bottom-right":case"bottom-left":Ve=-We+Hm;break;case"bottom":Ve=-me+Hm;break;case"top":Ve=me-Hm}switch(Q){case"top-right":case"bottom-right":Pe=-We;break;case"top-left":case"bottom-left":Pe=We;break;case"left":Pe=me;break;case"right":Pe=-me}return[Pe,Ve]})(Y,D[0])}function CS(Y,D,Q){var me;const Pe=Y.layout,Ve=(me=Pe.get("text-variable-anchor-offset"))===null||me===void 0?void 0:me.evaluate(D,{},Q);if(Ve){const pt=Ve.values,Rt=[];for(let Yt=0;Ytqr*fc);dr.startsWith("top")?xr[1]-=Hm:dr.startsWith("bottom")&&(xr[1]+=Hm),Rt[Yt+1]=xr}return new pa(Rt)}const We=Pe.get("text-variable-anchor");if(We){let pt;pt=Y._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Pe.get("text-radial-offset").evaluate(D,{},Q)*fc,tT]:Pe.get("text-offset").evaluate(D,{},Q).map(Yt=>Yt*fc);const Rt=[];for(const Yt of We)Rt.push(Yt,kS(Yt,pt));return new pa(Rt)}return null}function rT(Y){switch(Y){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function h6(Y,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr){let xr=Ve.textMaxSize.evaluate(D,{});xr===void 0&&(xr=We);const qr=Y.layers[0].layout,Jr=qr.get("icon-offset").evaluate(D,{},dr),vn=PS(Q.horizontal),Tn=We/24,Bn=Y.tilePixelRatio*Tn,da=Y.tilePixelRatio*xr/24,ui=Y.tilePixelRatio*pt,Ba=Y.tilePixelRatio*qr.get("symbol-spacing"),ti=qr.get("text-padding")*Y.tilePixelRatio,Fi=(function(to,Xs,Os,Pl=1){const af=to.get("icon-padding").evaluate(Xs,{},Os),Zc=af&&af.values;return[Zc[0]*Pl,Zc[1]*Pl,Zc[2]*Pl,Zc[3]*Pl]})(qr,D,dr,Y.tilePixelRatio),ho=qr.get("text-max-angle")/180*Math.PI,Jo=qr.get("text-rotation-alignment")!=="viewport"&&qr.get("symbol-placement")!=="point",hl=qr.get("icon-rotation-alignment")==="map"&&qr.get("symbol-placement")!=="point",ls=qr.get("symbol-placement"),Wo=Ba/2,zs=qr.get("icon-text-fit");let Es;me&&zs!=="none"&&(Y.allowVerticalPlacement&&Q.vertical&&(Es=uS(me,Q.vertical,zs,qr.get("icon-text-fit-padding"),Jr,Tn)),vn&&(me=uS(me,vn,zs,qr.get("icon-text-fit-padding"),Jr,Tn)));const Ts=(to,Xs)=>{Xs.x<0||Xs.x>=Wl||Xs.y<0||Xs.y>=Wl||(function(Os,Pl,af,Zc,lv,_d,Ah,Wh,ud,cd,fd,Yf,uv,Qv,jv,hd,Ev,Hd,gf,zu,Tc,Fc,Uf,yf,o1){const Wp=Os.addToLineVertexArray(Pl,af);let Kp,ed,of,kv,Tp=0,Gd=0,vd=0,lT=0,uT=-1,gw=-1;const J0={};let cT=ia("");if(Os.allowVerticalPlacement&&Zc.vertical){const qv=Wh.layout.get("text-rotate").evaluate(Tc,{},yf)+90;of=new vw(ud,Pl,cd,fd,Yf,Zc.vertical,uv,Qv,jv,qv),Ah&&(kv=new vw(ud,Pl,cd,fd,Yf,Ah,Ev,Hd,jv,qv))}if(lv){const qv=Wh.layout.get("icon-rotate").evaluate(Tc,{}),Xd=Wh.layout.get("icon-text-fit")!=="none",Gm=ES(lv,qv,Uf,Xd),$p=Ah?ES(Ah,qv,Uf,Xd):void 0;ed=new vw(ud,Pl,cd,fd,Yf,lv,Ev,Hd,!1,qv),Tp=4*Gm.length;const Vg=Os.iconSizeData;let Jp=null;Vg.kind==="source"?(Jp=[_0*Wh.layout.get("icon-size").evaluate(Tc,{})],Jp[0]>jm&&y(`${Os.layerIds[0]}: Value for "icon-size" is >= ${j_}. Reduce your "icon-size".`)):Vg.kind==="composite"&&(Jp=[_0*Fc.compositeIconSizes[0].evaluate(Tc,{},yf),_0*Fc.compositeIconSizes[1].evaluate(Tc,{},yf)],(Jp[0]>jm||Jp[1]>jm)&&y(`${Os.layerIds[0]}: Value for "icon-size" is >= ${j_}. Reduce your "icon-size".`)),Os.addSymbols(Os.icon,Gm,Jp,zu,gf,Tc,e.ah.none,Pl,Wp.lineStartIndex,Wp.lineLength,-1,yf),uT=Os.icon.placedSymbolArray.length-1,$p&&(Gd=4*$p.length,Os.addSymbols(Os.icon,$p,Jp,zu,gf,Tc,e.ah.vertical,Pl,Wp.lineStartIndex,Wp.lineLength,-1,yf),gw=Os.icon.placedSymbolArray.length-1)}const fT=Object.keys(Zc.horizontal);for(const qv of fT){const Xd=Zc.horizontal[qv];if(!Kp){cT=ia(Xd.text);const $p=Wh.layout.get("text-rotate").evaluate(Tc,{},yf);Kp=new vw(ud,Pl,cd,fd,Yf,Xd,uv,Qv,jv,$p)}const Gm=Xd.positionedLines.length===1;if(vd+=LS(Os,Pl,Xd,_d,Wh,jv,Tc,hd,Wp,Zc.vertical?e.ah.horizontal:e.ah.horizontalOnly,Gm?fT:[qv],J0,uT,Fc,yf),Gm)break}Zc.vertical&&(lT+=LS(Os,Pl,Zc.vertical,_d,Wh,jv,Tc,hd,Wp,e.ah.vertical,["vertical"],J0,gw,Fc,yf));const hT=Kp?Kp.boxStartIndex:Os.collisionBoxArray.length,vT=Kp?Kp.boxEndIndex:Os.collisionBoxArray.length,v6=of?of.boxStartIndex:Os.collisionBoxArray.length,d6=of?of.boxEndIndex:Os.collisionBoxArray.length,p6=ed?ed.boxStartIndex:Os.collisionBoxArray.length,m6=ed?ed.boxEndIndex:Os.collisionBoxArray.length,OS=kv?kv.boxStartIndex:Os.collisionBoxArray.length,s1=kv?kv.boxEndIndex:Os.collisionBoxArray.length;let Kh=-1;const l1=(qv,Xd)=>qv&&qv.circleDiameter?Math.max(qv.circleDiameter,Xd):Xd;Kh=l1(Kp,Kh),Kh=l1(of,Kh),Kh=l1(ed,Kh),Kh=l1(kv,Kh);const dT=Kh>-1?1:0;dT&&(Kh*=o1/fc),Os.glyphOffsetArray.length>=Ug.MAX_GLYPHS&&y("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Tc.sortKey!==void 0&&Os.addToSortKeyRanges(Os.symbolInstances.length,Tc.sortKey);const FS=CS(Wh,Tc,yf),[g6,BS]=(function(qv,Xd){const Gm=qv.length,$p=Xd?.values;if($p?.length>0)for(let Vg=0;Vg<$p.length;Vg+=2){const Jp=$p[Vg+1];qv.emplaceBack(e.aq[$p[Vg]],Jp[0],Jp[1])}return[Gm,qv.length]})(Os.textAnchorOffsets,FS);Os.symbolInstances.emplaceBack(Pl.x,Pl.y,J0.right>=0?J0.right:-1,J0.center>=0?J0.center:-1,J0.left>=0?J0.left:-1,J0.vertical||-1,uT,gw,cT,hT,vT,v6,d6,p6,m6,OS,s1,cd,vd,lT,Tp,Gd,dT,0,uv,Kh,g6,BS)})(Y,Xs,to,Q,me,Pe,Es,Y.layers[0],Y.collisionBoxArray,D.index,D.sourceLayerIndex,Y.index,Bn,[ti,ti,ti,ti],Jo,Rt,ui,Fi,hl,Jr,D,Ve,Yt,dr,We)};if(ls==="line")for(const to of wS(D.geometry,0,0,Wl,Wl)){const Xs=l6(to,Ba,ho,Q.vertical||vn,me,24,da,Y.overscaling,Wl);for(const Os of Xs)vn&&RS(Y,vn.text,Wo,Os)||Ts(to,Os)}else if(ls==="line-center"){for(const to of D.geometry)if(to.length>1){const Xs=s6(to,ho,Q.vertical||vn,me,24,da);Xs&&Ts(to,Xs)}}else if(D.type==="Polygon")for(const to of qc(D.geometry,0)){const Xs=c6(to,16);Ts(to[0],new Vm(Xs.x,Xs.y,0))}else if(D.type==="LineString")for(const to of D.geometry)Ts(to,new Vm(to[0].x,to[0].y,0));else if(D.type==="Point")for(const to of D.geometry)for(const Xs of to)Ts([Xs],new Vm(Xs.x,Xs.y,0))}function LS(Y,D,Q,me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,Jr,vn){const Tn=(function(ui,Ba,ti,Fi,ho,Jo,hl,ls){const Wo=Fi.layout.get("text-rotate").evaluate(Jo,{})*Math.PI/180,zs=[];for(const Es of Ba.positionedLines)for(const Ts of Es.positionedGlyphs){if(!Ts.rect)continue;const to=Ts.rect||{};let Xs=V3+1,Os=!0,Pl=1,af=0;const Zc=(ho||ls)&&Ts.vertical,lv=Ts.metrics.advance*Ts.scale/2;if(ls&&Ba.verticalizable&&(af=Es.lineOffset/2-(Ts.imageName?-(fc-Ts.metrics.width*Ts.scale)/2:(Ts.scale-1)*fc)),Ts.imageName){const zu=hl[Ts.imageName];Os=zu.sdf,Pl=zu.pixelRatio,Xs=Zh/Pl}const _d=ho?[Ts.x+lv,Ts.y]:[0,0];let Ah=ho?[0,0]:[Ts.x+lv+ti[0],Ts.y+ti[1]-af],Wh=[0,0];Zc&&(Wh=Ah,Ah=[0,0]);const ud=Ts.metrics.isDoubleResolution?2:1,cd=(Ts.metrics.left-Xs)*Ts.scale-lv+Ah[0],fd=(-Ts.metrics.top-Xs)*Ts.scale+Ah[1],Yf=cd+to.w/ud*Ts.scale/Pl,uv=fd+to.h/ud*Ts.scale/Pl,Qv=new i(cd,fd),jv=new i(Yf,fd),hd=new i(cd,uv),Ev=new i(Yf,uv);if(Zc){const zu=new i(-lv,lv-Ky),Tc=-Math.PI/2,Fc=fc/2-lv,Uf=new i(5-Ky-Fc,-(Ts.imageName?Fc:0)),yf=new i(...Wh);Qv._rotateAround(Tc,zu)._add(Uf)._add(yf),jv._rotateAround(Tc,zu)._add(Uf)._add(yf),hd._rotateAround(Tc,zu)._add(Uf)._add(yf),Ev._rotateAround(Tc,zu)._add(Uf)._add(yf)}if(Wo){const zu=Math.sin(Wo),Tc=Math.cos(Wo),Fc=[Tc,-zu,zu,Tc];Qv._matMult(Fc),jv._matMult(Fc),hd._matMult(Fc),Ev._matMult(Fc)}const Hd=new i(0,0),gf=new i(0,0);zs.push({tl:Qv,tr:jv,bl:hd,br:Ev,tex:to,writingMode:Ba.writingMode,glyphOffset:_d,sectionIndex:Ts.sectionIndex,isSDF:Os,pixelOffsetTL:Hd,pixelOffsetBR:gf,minFontScaleX:0,minFontScaleY:0})}return zs})(0,Q,pt,Pe,Ve,We,me,Y.allowVerticalPlacement),Bn=Y.textSizeData;let da=null;Bn.kind==="source"?(da=[_0*Pe.layout.get("text-size").evaluate(We,{})],da[0]>jm&&y(`${Y.layerIds[0]}: Value for "text-size" is >= ${j_}. Reduce your "text-size".`)):Bn.kind==="composite"&&(da=[_0*Jr.compositeTextSizes[0].evaluate(We,{},vn),_0*Jr.compositeTextSizes[1].evaluate(We,{},vn)],(da[0]>jm||da[1]>jm)&&y(`${Y.layerIds[0]}: Value for "text-size" is >= ${j_}. Reduce your "text-size".`)),Y.addSymbols(Y.text,Tn,da,pt,Ve,We,Yt,D,Rt.lineStartIndex,Rt.lineLength,qr,vn);for(const ui of dr)xr[ui]=Y.text.placedSymbolArray.length-1;return 4*Tn.length}function PS(Y){for(const D in Y)return Y[D];return null}function RS(Y,D,Q,me){const Pe=Y.compareText;if(D in Pe){const Ve=Pe[D];for(let We=Ve.length-1;We>=0;We--)if(me.dist(Ve[We])>4;if(Pe!==1)throw new Error(`Got v${Pe} data when expected v1.`);const Ve=IS[15&me];if(!Ve)throw new Error("Unrecognized array type.");const[We]=new Uint16Array(D,2,1),[pt]=new Uint32Array(D,4,1);return new nT(pt,We,Ve,D)}constructor(D,Q=64,me=Float64Array,Pe){if(isNaN(D)||D<0)throw new Error(`Unpexpected numItems value: ${D}.`);this.numItems=+D,this.nodeSize=Math.min(Math.max(+Q,2),65535),this.ArrayType=me,this.IndexArrayType=D<65536?Uint16Array:Uint32Array;const Ve=IS.indexOf(this.ArrayType),We=2*D*this.ArrayType.BYTES_PER_ELEMENT,pt=D*this.IndexArrayType.BYTES_PER_ELEMENT,Rt=(8-pt%8)%8;if(Ve<0)throw new Error(`Unexpected typed array class: ${me}.`);Pe&&Pe instanceof ArrayBuffer?(this.data=Pe,this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+pt+Rt,2*D),this._pos=2*D,this._finished=!0):(this.data=new ArrayBuffer(8+We+pt+Rt),this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+pt+Rt,2*D),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Ve]),new Uint16Array(this.data,2,1)[0]=Q,new Uint32Array(this.data,4,1)[0]=D)}add(D,Q){const me=this._pos>>1;return this.ids[me]=me,this.coords[this._pos++]=D,this.coords[this._pos++]=Q,me}finish(){const D=this._pos>>1;if(D!==this.numItems)throw new Error(`Added ${D} items when expected ${this.numItems}.`);return aT(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(D,Q,me,Pe){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Ve,coords:We,nodeSize:pt}=this,Rt=[0,Ve.length-1,0],Yt=[];for(;Rt.length;){const dr=Rt.pop()||0,xr=Rt.pop()||0,qr=Rt.pop()||0;if(xr-qr<=pt){for(let Bn=qr;Bn<=xr;Bn++){const da=We[2*Bn],ui=We[2*Bn+1];da>=D&&da<=me&&ui>=Q&&ui<=Pe&&Yt.push(Ve[Bn])}continue}const Jr=qr+xr>>1,vn=We[2*Jr],Tn=We[2*Jr+1];vn>=D&&vn<=me&&Tn>=Q&&Tn<=Pe&&Yt.push(Ve[Jr]),(dr===0?D<=vn:Q<=Tn)&&(Rt.push(qr),Rt.push(Jr-1),Rt.push(1-dr)),(dr===0?me>=vn:Pe>=Tn)&&(Rt.push(Jr+1),Rt.push(xr),Rt.push(1-dr))}return Yt}within(D,Q,me){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Pe,coords:Ve,nodeSize:We}=this,pt=[0,Pe.length-1,0],Rt=[],Yt=me*me;for(;pt.length;){const dr=pt.pop()||0,xr=pt.pop()||0,qr=pt.pop()||0;if(xr-qr<=We){for(let Bn=qr;Bn<=xr;Bn++)Uv(Ve[2*Bn],Ve[2*Bn+1],D,Q)<=Yt&&Rt.push(Pe[Bn]);continue}const Jr=qr+xr>>1,vn=Ve[2*Jr],Tn=Ve[2*Jr+1];Uv(vn,Tn,D,Q)<=Yt&&Rt.push(Pe[Jr]),(dr===0?D-me<=vn:Q-me<=Tn)&&(pt.push(qr),pt.push(Jr-1),pt.push(1-dr)),(dr===0?D+me>=vn:Q+me>=Tn)&&(pt.push(Jr+1),pt.push(xr),pt.push(1-dr))}return Rt}}function aT(Y,D,Q,me,Pe,Ve){if(Pe-me<=Q)return;const We=me+Pe>>1;DS(Y,D,We,me,Pe,Ve),aT(Y,D,Q,me,We-1,1-Ve),aT(Y,D,Q,We+1,Pe,1-Ve)}function DS(Y,D,Q,me,Pe,Ve){for(;Pe>me;){if(Pe-me>600){const Yt=Pe-me+1,dr=Q-me+1,xr=Math.log(Yt),qr=.5*Math.exp(2*xr/3),Jr=.5*Math.sqrt(xr*qr*(Yt-qr)/Yt)*(dr-Yt/2<0?-1:1);DS(Y,D,Q,Math.max(me,Math.floor(Q-dr*qr/Yt+Jr)),Math.min(Pe,Math.floor(Q+(Yt-dr)*qr/Yt+Jr)),Ve)}const We=D[2*Q+Ve];let pt=me,Rt=Pe;for(a1(Y,D,me,Q),D[2*Pe+Ve]>We&&a1(Y,D,me,Pe);ptWe;)Rt--}D[2*me+Ve]===We?a1(Y,D,me,Rt):(Rt++,a1(Y,D,Rt,Pe)),Rt<=Q&&(me=Rt+1),Q<=Rt&&(Pe=Rt-1)}}function a1(Y,D,Q,me){dw(Y,Q,me),dw(D,2*Q,2*me),dw(D,2*Q+1,2*me+1)}function dw(Y,D,Q){const me=Y[D];Y[D]=Y[Q],Y[Q]=me}function Uv(Y,D,Q,me){const Pe=Y-Q,Ve=D-me;return Pe*Pe+Ve*Ve}var iT;e.bg=void 0,(iT=e.bg||(e.bg={})).create="create",iT.load="load",iT.fullLoad="fullLoad";let pw=null,i1=[];const oT=1e3/60,mw="loadTime",sT="fullLoadTime",zS={mark(Y){performance.mark(Y)},frame(Y){const D=Y;pw!=null&&i1.push(D-pw),pw=D},clearMetrics(){pw=null,i1=[],performance.clearMeasures(mw),performance.clearMeasures(sT);for(const Y in e.bg)performance.clearMarks(e.bg[Y])},getPerformanceMetrics(){performance.measure(mw,e.bg.create,e.bg.load),performance.measure(sT,e.bg.create,e.bg.fullLoad);const Y=performance.getEntriesByName(mw)[0].duration,D=performance.getEntriesByName(sT)[0].duration,Q=i1.length,me=1/(i1.reduce((Ve,We)=>Ve+We,0)/Q/1e3),Pe=i1.filter(Ve=>Ve>oT).reduce((Ve,We)=>Ve+(We-oT)/oT,0);return{loadTime:Y,fullLoadTime:D,fps:me,percentDroppedFrames:Pe/(Q+Pe)*100,totalFrames:Q}}};e.$=class extends Ar{},e.A=Di,e.B=ri,e.C=function(Y){if(z==null){const D=Y.navigator?Y.navigator.userAgent:null;z=!!Y.safari||!(!D||!(/\b(iPad|iPhone|iPod)\b/.test(D)||D.match("Safari")&&!D.match("Chrome")))}return z},e.D=Zo,e.E=ae,e.F=class{constructor(Y,D){this.target=Y,this.mapId=D,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new G_(()=>this.process()),this.subscription=(function(Q,me,Pe,Ve){return Q.addEventListener(me,Pe,!1),{unsubscribe:()=>{Q.removeEventListener(me,Pe,!1)}}})(this.target,"message",Q=>this.receive(Q)),this.globalScope=L(self)?Y:window}registerMessageHandler(Y,D){this.messageHandlers[Y]=D}sendAsync(Y,D){return new Promise((Q,me)=>{const Pe=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Pe]={resolve:Q,reject:me},D&&D.signal.addEventListener("abort",()=>{delete this.resolveRejects[Pe];const pt={id:Pe,type:"",origin:location.origin,targetMapId:Y.targetMapId,sourceMapId:this.mapId};this.target.postMessage(pt)},{once:!0});const Ve=[],We=Object.assign(Object.assign({},Y),{id:Pe,sourceMapId:this.mapId,origin:location.origin,data:Yo(Y.data,Ve)});this.target.postMessage(We,{transfer:Ve})})}receive(Y){const D=Y.data,Q=D.id;if(!(D.origin!=="file://"&&location.origin!=="file://"&&D.origin!=="resource://android"&&location.origin!=="resource://android"&&D.origin!==location.origin||D.targetMapId&&this.mapId!==D.targetMapId)){if(D.type===""){delete this.tasks[Q];const me=this.abortControllers[Q];return delete this.abortControllers[Q],void(me&&me.abort())}if(L(self)||D.mustQueue)return this.tasks[Q]=D,this.taskQueue.push(Q),void this.invoker.trigger();this.processTask(Q,D)}}process(){if(this.taskQueue.length===0)return;const Y=this.taskQueue.shift(),D=this.tasks[Y];delete this.tasks[Y],this.taskQueue.length>0&&this.invoker.trigger(),D&&this.processTask(Y,D)}processTask(Y,D){return t(this,void 0,void 0,function*(){if(D.type===""){const Pe=this.resolveRejects[Y];return delete this.resolveRejects[Y],Pe?void(D.error?Pe.reject(Vo(D.error)):Pe.resolve(Vo(D.data))):void 0}if(!this.messageHandlers[D.type])return void this.completeTask(Y,new Error(`Could not find a registered handler for ${D.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const Q=Vo(D.data),me=new AbortController;this.abortControllers[Y]=me;try{const Pe=yield this.messageHandlers[D.type](D.sourceMapId,Q,me);this.completeTask(Y,null,Pe)}catch(Pe){this.completeTask(Y,Pe)}})}completeTask(Y,D,Q){const me=[];delete this.abortControllers[Y];const Pe={id:Y,type:"",sourceMapId:this.mapId,origin:location.origin,error:D?Yo(D):null,data:Yo(Q,me)};this.target.postMessage(Pe,{transfer:me})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=le,e.H=function(){var Y=new Di(16);return Di!=Float32Array&&(Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=0,Y[6]=0,Y[7]=0,Y[8]=0,Y[9]=0,Y[11]=0,Y[12]=0,Y[13]=0,Y[14]=0),Y[0]=1,Y[5]=1,Y[10]=1,Y[15]=1,Y},e.I=Nv,e.J=function(Y,D,Q){var me,Pe,Ve,We,pt,Rt,Yt,dr,xr,qr,Jr,vn,Tn=Q[0],Bn=Q[1],da=Q[2];return D===Y?(Y[12]=D[0]*Tn+D[4]*Bn+D[8]*da+D[12],Y[13]=D[1]*Tn+D[5]*Bn+D[9]*da+D[13],Y[14]=D[2]*Tn+D[6]*Bn+D[10]*da+D[14],Y[15]=D[3]*Tn+D[7]*Bn+D[11]*da+D[15]):(Pe=D[1],Ve=D[2],We=D[3],pt=D[4],Rt=D[5],Yt=D[6],dr=D[7],xr=D[8],qr=D[9],Jr=D[10],vn=D[11],Y[0]=me=D[0],Y[1]=Pe,Y[2]=Ve,Y[3]=We,Y[4]=pt,Y[5]=Rt,Y[6]=Yt,Y[7]=dr,Y[8]=xr,Y[9]=qr,Y[10]=Jr,Y[11]=vn,Y[12]=me*Tn+pt*Bn+xr*da+D[12],Y[13]=Pe*Tn+Rt*Bn+qr*da+D[13],Y[14]=Ve*Tn+Yt*Bn+Jr*da+D[14],Y[15]=We*Tn+dr*Bn+vn*da+D[15]),Y},e.K=function(Y,D,Q){var me=Q[0],Pe=Q[1],Ve=Q[2];return Y[0]=D[0]*me,Y[1]=D[1]*me,Y[2]=D[2]*me,Y[3]=D[3]*me,Y[4]=D[4]*Pe,Y[5]=D[5]*Pe,Y[6]=D[6]*Pe,Y[7]=D[7]*Pe,Y[8]=D[8]*Ve,Y[9]=D[9]*Ve,Y[10]=D[10]*Ve,Y[11]=D[11]*Ve,Y[12]=D[12],Y[13]=D[13],Y[14]=D[14],Y[15]=D[15],Y},e.L=Zn,e.M=function(Y,D){const Q={};for(let me=0;me{const D=window.document.createElement("video");return D.muted=!0,new Promise(Q=>{D.onloadstart=()=>{Q(D)};for(const me of Y){const Pe=window.document.createElement("source");ne(me)||(D.crossOrigin="Anonymous"),Pe.src=me,D.appendChild(Pe)}})},e.a4=function(){return _++},e.a5=ii,e.a6=Ug,e.a7=xh,e.a8=gr,e.a9=yS,e.aA=function(Y){if(Y.type==="custom")return new hS(Y);switch(Y.type){case"background":return new H_(Y);case"circle":return new Oa(Y);case"fill":return new fn(Y);case"fill-extrusion":return new Nd(Y);case"heatmap":return new tl(Y);case"hillshade":return new Wu(Y);case"line":return new Og(Y);case"raster":return new o6(Y);case"symbol":return new lw(Y)}},e.aB=u,e.aC=function(Y,D){if(!Y)return[{command:"setStyle",args:[D]}];let Q=[];try{if(!Ce(Y.version,D.version))return[{command:"setStyle",args:[D]}];Ce(Y.center,D.center)||Q.push({command:"setCenter",args:[D.center]}),Ce(Y.zoom,D.zoom)||Q.push({command:"setZoom",args:[D.zoom]}),Ce(Y.bearing,D.bearing)||Q.push({command:"setBearing",args:[D.bearing]}),Ce(Y.pitch,D.pitch)||Q.push({command:"setPitch",args:[D.pitch]}),Ce(Y.sprite,D.sprite)||Q.push({command:"setSprite",args:[D.sprite]}),Ce(Y.glyphs,D.glyphs)||Q.push({command:"setGlyphs",args:[D.glyphs]}),Ce(Y.transition,D.transition)||Q.push({command:"setTransition",args:[D.transition]}),Ce(Y.light,D.light)||Q.push({command:"setLight",args:[D.light]}),Ce(Y.terrain,D.terrain)||Q.push({command:"setTerrain",args:[D.terrain]}),Ce(Y.sky,D.sky)||Q.push({command:"setSky",args:[D.sky]}),Ce(Y.projection,D.projection)||Q.push({command:"setProjection",args:[D.projection]});const me={},Pe=[];(function(We,pt,Rt,Yt){let dr;for(dr in pt=pt||{},We=We||{})Object.prototype.hasOwnProperty.call(We,dr)&&(Object.prototype.hasOwnProperty.call(pt,dr)||Ye(dr,Rt,Yt));for(dr in pt)Object.prototype.hasOwnProperty.call(pt,dr)&&(Object.prototype.hasOwnProperty.call(We,dr)?Ce(We[dr],pt[dr])||(We[dr].type==="geojson"&&pt[dr].type==="geojson"&&st(We,pt,dr)?Fe(Rt,{command:"setGeoJSONSourceData",args:[dr,pt[dr].data]}):it(dr,pt,Rt,Yt)):ze(dr,pt,Rt))})(Y.sources,D.sources,Pe,me);const Ve=[];Y.layers&&Y.layers.forEach(We=>{"source"in We&&me[We.source]?Q.push({command:"removeLayer",args:[We.id]}):Ve.push(We)}),Q=Q.concat(Pe),(function(We,pt,Rt){pt=pt||[];const Yt=(We=We||[]).map(Qe),dr=pt.map(Qe),xr=We.reduce(Le,{}),qr=pt.reduce(Le,{}),Jr=Yt.slice(),vn=Object.create(null);let Tn,Bn,da,ui,Ba;for(let ti=0,Fi=0;ti@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(Q,me,Pe,Ve)=>{const We=Pe||Ve;return D[me]=!We||We.toLowerCase(),""}),D["max-age"]){const Q=parseInt(D["max-age"],10);isNaN(Q)?delete D["max-age"]:D["max-age"]=Q}return D},e.ab=function(Y,D){const Q=[];for(const me in Y)me in D||Q.push(me);return Q},e.ac=x,e.ad=function(Y,D,Q){var me=Math.sin(Q),Pe=Math.cos(Q),Ve=D[0],We=D[1],pt=D[2],Rt=D[3],Yt=D[4],dr=D[5],xr=D[6],qr=D[7];return D!==Y&&(Y[8]=D[8],Y[9]=D[9],Y[10]=D[10],Y[11]=D[11],Y[12]=D[12],Y[13]=D[13],Y[14]=D[14],Y[15]=D[15]),Y[0]=Ve*Pe+Yt*me,Y[1]=We*Pe+dr*me,Y[2]=pt*Pe+xr*me,Y[3]=Rt*Pe+qr*me,Y[4]=Yt*Pe-Ve*me,Y[5]=dr*Pe-We*me,Y[6]=xr*Pe-pt*me,Y[7]=qr*Pe-Rt*me,Y},e.ae=function(Y){var D=new Di(16);return D[0]=Y[0],D[1]=Y[1],D[2]=Y[2],D[3]=Y[3],D[4]=Y[4],D[5]=Y[5],D[6]=Y[6],D[7]=Y[7],D[8]=Y[8],D[9]=Y[9],D[10]=Y[10],D[11]=Y[11],D[12]=Y[12],D[13]=Y[13],D[14]=Y[14],D[15]=Y[15],D},e.af=$a,e.ag=function(Y,D){let Q=0,me=0;if(Y.kind==="constant")me=Y.layoutSize;else if(Y.kind!=="source"){const{interpolationType:Pe,minZoom:Ve,maxZoom:We}=Y,pt=Pe?x(vi.interpolationFactor(Pe,D,Ve,We),0,1):0;Y.kind==="camera"?me=Eo.number(Y.minSize,Y.maxSize,pt):Q=pt}return{uSizeT:Q,uSize:me}},e.ai=function(Y,{uSize:D,uSizeT:Q},{lowerSize:me,upperSize:Pe}){return Y.kind==="source"?me/_0:Y.kind==="composite"?Eo.number(me/_0,Pe/_0,Q):D},e.aj=qm,e.ak=function(Y,D,Q,me){const Pe=D.y-Y.y,Ve=D.x-Y.x,We=me.y-Q.y,pt=me.x-Q.x,Rt=We*Ve-pt*Pe;if(Rt===0)return null;const Yt=(pt*(Y.y-Q.y)-We*(Y.x-Q.x))/Rt;return new i(Y.x+Yt*Ve,Y.y+Yt*Pe)},e.al=wS,e.am=ua,e.an=aa,e.ao=function(Y){let D=1/0,Q=1/0,me=-1/0,Pe=-1/0;for(const Ve of Y)D=Math.min(D,Ve.x),Q=Math.min(Q,Ve.y),me=Math.max(me,Ve.x),Pe=Math.max(Pe,Ve.y);return[D,Q,me,Pe]},e.ap=fc,e.ar=X3,e.as=function(Y,D){var Q=D[0],me=D[1],Pe=D[2],Ve=D[3],We=D[4],pt=D[5],Rt=D[6],Yt=D[7],dr=D[8],xr=D[9],qr=D[10],Jr=D[11],vn=D[12],Tn=D[13],Bn=D[14],da=D[15],ui=Q*pt-me*We,Ba=Q*Rt-Pe*We,ti=Q*Yt-Ve*We,Fi=me*Rt-Pe*pt,ho=me*Yt-Ve*pt,Jo=Pe*Yt-Ve*Rt,hl=dr*Tn-xr*vn,ls=dr*Bn-qr*vn,Wo=dr*da-Jr*vn,zs=xr*Bn-qr*Tn,Es=xr*da-Jr*Tn,Ts=qr*da-Jr*Bn,to=ui*Ts-Ba*Es+ti*zs+Fi*Wo-ho*ls+Jo*hl;return to?(Y[0]=(pt*Ts-Rt*Es+Yt*zs)*(to=1/to),Y[1]=(Pe*Es-me*Ts-Ve*zs)*to,Y[2]=(Tn*Jo-Bn*ho+da*Fi)*to,Y[3]=(qr*ho-xr*Jo-Jr*Fi)*to,Y[4]=(Rt*Wo-We*Ts-Yt*ls)*to,Y[5]=(Q*Ts-Pe*Wo+Ve*ls)*to,Y[6]=(Bn*ti-vn*Jo-da*Ba)*to,Y[7]=(dr*Jo-qr*ti+Jr*Ba)*to,Y[8]=(We*Es-pt*Wo+Yt*hl)*to,Y[9]=(me*Wo-Q*Es-Ve*hl)*to,Y[10]=(vn*ho-Tn*ti+da*ui)*to,Y[11]=(xr*ti-dr*ho-Jr*ui)*to,Y[12]=(pt*ls-We*zs-Rt*hl)*to,Y[13]=(Q*zs-me*ls+Pe*hl)*to,Y[14]=(Tn*Ba-vn*Fi-Bn*ui)*to,Y[15]=(dr*Fi-xr*Ba+qr*ui)*to,Y):null},e.at=rT,e.au=G3,e.av=nT,e.aw=function(){const Y={},D=ie.$version;for(const Q in ie.$root){const me=ie.$root[Q];if(me.required){let Pe=null;Pe=Q==="version"?D:me.type==="array"?[]:{},Pe!=null&&(Y[Q]=Pe)}}return Y},e.ax=Ki,e.ay=V,e.az=function(Y){Y=Y.slice();const D=Object.create(null);for(let Q=0;Q25||me<0||me>=1||Q<0||Q>=1)},e.bc=function(Y,D){return Y[0]=D[0],Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=0,Y[5]=D[1],Y[6]=0,Y[7]=0,Y[8]=0,Y[9]=0,Y[10]=D[2],Y[11]=0,Y[12]=0,Y[13]=0,Y[14]=0,Y[15]=1,Y},e.bd=class extends cr{},e.be=$3,e.bf=zS,e.bh=ce,e.bi=function(Y,D){re.REGISTERED_PROTOCOLS[Y]=D},e.bj=function(Y){delete re.REGISTERED_PROTOCOLS[Y]},e.bk=function(Y,D){const Q={};for(let Pe=0;PeTs*fc)}let ls=We?"center":Q.get("text-justify").evaluate(Yt,{},Y.canonical);const Wo=Q.get("symbol-placement")==="point"?Q.get("text-max-width").evaluate(Yt,{},Y.canonical)*fc:1/0,zs=()=>{Y.bucket.allowVerticalPlacement&&is(ti)&&(vn.vertical=nw(Tn,Y.glyphMap,Y.glyphPositions,Y.imagePositions,dr,Wo,Ve,Jo,"left",ho,da,e.ah.vertical,!0,qr,xr))};if(!We&&hl){const Es=new Set;if(ls==="auto")for(let to=0;tot(void 0,void 0,void 0,function*(){if(Y.byteLength===0)return createImageBitmap(new ImageData(1,1));const D=new Blob([new Uint8Array(Y)],{type:"image/png"});try{return createImageBitmap(D)}catch(Q){throw new Error(`Could not load image because of ${Q.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),e.e=M,e.f=Y=>new Promise((D,Q)=>{const me=new Image;me.onload=()=>{D(me),URL.revokeObjectURL(me.src),me.onload=null,window.requestAnimationFrame(()=>{me.src=N})},me.onerror=()=>Q(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const Pe=new Blob([new Uint8Array(Y)],{type:"image/png"});me.src=Y.byteLength?URL.createObjectURL(Pe):N}),e.g=fe,e.h=(Y,D)=>ee(M(Y,{type:"json"}),D),e.i=L,e.j=H,e.k=te,e.l=(Y,D)=>ee(M(Y,{type:"arrayBuffer"}),D),e.m=ee,e.n=function(Y){return new j3(Y).readFields(QE,[])},e.o=ts,e.p=rw,e.q=Ue,e.r=xa,e.s=ne,e.t=Va,e.u=Ta,e.v=ie,e.w=y,e.x=function([Y,D,Q]){return D+=90,D*=Math.PI/180,Q*=Math.PI/180,{x:Y*Math.cos(D)*Math.sin(Q),y:Y*Math.sin(D)*Math.sin(Q),z:Y*Math.cos(Q)}},e.y=Eo,e.z=pl}),S("worker",["./shared"],function(e){class t{constructor(je){this.keyCache={},je&&this.replace(je)}replace(je){this._layerConfigs={},this._layers={},this.update(je,[])}update(je,$e){for(const xe of je){this._layerConfigs[xe.id]=xe;const ye=this._layers[xe.id]=e.aA(xe);ye._featureFilter=e.a7(ye.filter),this.keyCache[xe.id]&&delete this.keyCache[xe.id]}for(const xe of $e)delete this.keyCache[xe],delete this._layerConfigs[xe],delete this._layers[xe];this.familiesBySource={};const Ee=e.bk(Object.values(this._layerConfigs),this.keyCache);for(const xe of Ee){const ye=xe.map(Ot=>this._layers[Ot.id]),Me=ye[0];if(Me.visibility==="none")continue;const Xe=Me.source||"";let Je=this.familiesBySource[Xe];Je||(Je=this.familiesBySource[Xe]={});const Lt=Me.sourceLayer||"_geojsonTileLayer";let Ct=Je[Lt];Ct||(Ct=Je[Lt]=[]),Ct.push(ye)}}}class r{constructor(je){const $e={},Ee=[];for(const Xe in je){const Je=je[Xe],Lt=$e[Xe]={};for(const Ct in Je){const Ot=Je[+Ct];if(!Ot||Ot.bitmap.width===0||Ot.bitmap.height===0)continue;const Wt={x:0,y:0,w:Ot.bitmap.width+2,h:Ot.bitmap.height+2};Ee.push(Wt),Lt[Ct]={rect:Wt,metrics:Ot.metrics}}}const{w:xe,h:ye}=e.p(Ee),Me=new e.o({width:xe||1,height:ye||1});for(const Xe in je){const Je=je[Xe];for(const Lt in Je){const Ct=Je[+Lt];if(!Ct||Ct.bitmap.width===0||Ct.bitmap.height===0)continue;const Ot=$e[Xe][Lt].rect;e.o.copy(Ct.bitmap,Me,{x:0,y:0},{x:Ot.x+1,y:Ot.y+1},Ct.bitmap)}}this.image=Me,this.positions=$e}}e.bl("GlyphAtlas",r);class o{constructor(je){this.tileID=new e.S(je.tileID.overscaledZ,je.tileID.wrap,je.tileID.canonical.z,je.tileID.canonical.x,je.tileID.canonical.y),this.uid=je.uid,this.zoom=je.zoom,this.pixelRatio=je.pixelRatio,this.tileSize=je.tileSize,this.source=je.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=je.showCollisionBoxes,this.collectResourceTiming=!!je.collectResourceTiming,this.returnDependencies=!!je.returnDependencies,this.promoteId=je.promoteId,this.inFlightDependencies=[]}parse(je,$e,Ee,xe){return e._(this,void 0,void 0,function*(){this.status="parsing",this.data=je,this.collisionBoxArray=new e.a5;const ye=new e.bm(Object.keys(je.layers).sort()),Me=new e.bn(this.tileID,this.promoteId);Me.bucketLayerIDs=[];const Xe={},Je={featureIndex:Me,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Ee},Lt=$e.familiesBySource[this.source];for(const ra in Lt){const Nn=je.layers[ra];if(!Nn)continue;Nn.version===1&&e.w(`Vector tile source "${this.source}" layer "${ra}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const ka=ye.encode(ra),qa=[];for(let ir=0;ir=qt.maxzoom||qt.visibility!=="none"&&(n(ir,this.zoom,Ee),(Xe[qt.id]=qt.createBucket({index:Me.bucketLayerIDs.length,layers:ir,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ka,sourceID:this.source})).populate(qa,Je,this.tileID.canonical),Me.bucketLayerIDs.push(ir.map(ar=>ar.id)))}}const Ct=e.aF(Je.glyphDependencies,ra=>Object.keys(ra).map(Number));this.inFlightDependencies.forEach(ra=>ra?.abort()),this.inFlightDependencies=[];let Ot=Promise.resolve({});if(Object.keys(Ct).length){const ra=new AbortController;this.inFlightDependencies.push(ra),Ot=xe.sendAsync({type:"GG",data:{stacks:Ct,source:this.source,tileID:this.tileID,type:"glyphs"}},ra)}const Wt=Object.keys(Je.iconDependencies);let _r=Promise.resolve({});if(Wt.length){const ra=new AbortController;this.inFlightDependencies.push(ra),_r=xe.sendAsync({type:"GI",data:{icons:Wt,source:this.source,tileID:this.tileID,type:"icons"}},ra)}const pr=Object.keys(Je.patternDependencies);let hr=Promise.resolve({});if(pr.length){const ra=new AbortController;this.inFlightDependencies.push(ra),hr=xe.sendAsync({type:"GI",data:{icons:pr,source:this.source,tileID:this.tileID,type:"patterns"}},ra)}const[Fr,En,Kn]=yield Promise.all([Ot,_r,hr]),qn=new r(Fr),ta=new e.bo(En,Kn);for(const ra in Xe){const Nn=Xe[ra];Nn instanceof e.a6?(n(Nn.layers,this.zoom,Ee),e.bp({bucket:Nn,glyphMap:Fr,glyphPositions:qn.positions,imageMap:En,imagePositions:ta.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Nn.hasPattern&&(Nn instanceof e.bq||Nn instanceof e.br||Nn instanceof e.bs)&&(n(Nn.layers,this.zoom,Ee),Nn.addFeatures(Je,this.tileID.canonical,ta.patternPositions))}return this.status="done",{buckets:Object.values(Xe).filter(ra=>!ra.isEmpty()),featureIndex:Me,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:qn.image,imageAtlas:ta,glyphMap:this.returnDependencies?Fr:null,iconMap:this.returnDependencies?En:null,glyphPositions:this.returnDependencies?qn.positions:null}})}}function n(Mt,je,$e){const Ee=new e.z(je);for(const xe of Mt)xe.recalculate(Ee,$e)}class i{constructor(je,$e,Ee){this.actor=je,this.layerIndex=$e,this.availableImages=Ee,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(je,$e){return e._(this,void 0,void 0,function*(){const Ee=yield e.l(je.request,$e);try{return{vectorTile:new e.bt.VectorTile(new e.bu(Ee.data)),rawData:Ee.data,cacheControl:Ee.cacheControl,expires:Ee.expires}}catch(xe){const ye=new Uint8Array(Ee.data);let Me=`Unable to parse the tile at ${je.request.url}, `;throw Me+=ye[0]===31&&ye[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${xe.message}`,new Error(Me)}})}loadTile(je){return e._(this,void 0,void 0,function*(){const $e=je.uid,Ee=!!(je&&je.request&&je.request.collectResourceTiming)&&new e.bv(je.request),xe=new o(je);this.loading[$e]=xe;const ye=new AbortController;xe.abort=ye;try{const Me=yield this.loadVectorTile(je,ye);if(delete this.loading[$e],!Me)return null;const Xe=Me.rawData,Je={};Me.expires&&(Je.expires=Me.expires),Me.cacheControl&&(Je.cacheControl=Me.cacheControl);const Lt={};if(Ee){const Ot=Ee.finish();Ot&&(Lt.resourceTiming=JSON.parse(JSON.stringify(Ot)))}xe.vectorTile=Me.vectorTile;const Ct=xe.parse(Me.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[$e]=xe,this.fetching[$e]={rawTileData:Xe,cacheControl:Je,resourceTiming:Lt};try{const Ot=yield Ct;return e.e({rawTileData:Xe.slice(0)},Ot,Je,Lt)}finally{delete this.fetching[$e]}}catch(Me){throw delete this.loading[$e],xe.status="done",this.loaded[$e]=xe,Me}})}reloadTile(je){return e._(this,void 0,void 0,function*(){const $e=je.uid;if(!this.loaded||!this.loaded[$e])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Ee=this.loaded[$e];if(Ee.showCollisionBoxes=je.showCollisionBoxes,Ee.status==="parsing"){const xe=yield Ee.parse(Ee.vectorTile,this.layerIndex,this.availableImages,this.actor);let ye;if(this.fetching[$e]){const{rawTileData:Me,cacheControl:Xe,resourceTiming:Je}=this.fetching[$e];delete this.fetching[$e],ye=e.e({rawTileData:Me.slice(0)},xe,Xe,Je)}else ye=xe;return ye}if(Ee.status==="done"&&Ee.vectorTile)return Ee.parse(Ee.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(je){return e._(this,void 0,void 0,function*(){const $e=this.loading,Ee=je.uid;$e&&$e[Ee]&&$e[Ee].abort&&($e[Ee].abort.abort(),delete $e[Ee])})}removeTile(je){return e._(this,void 0,void 0,function*(){this.loaded&&this.loaded[je.uid]&&delete this.loaded[je.uid]})}}class a{constructor(){this.loaded={}}loadTile(je){return e._(this,void 0,void 0,function*(){const{uid:$e,encoding:Ee,rawImageData:xe,redFactor:ye,greenFactor:Me,blueFactor:Xe,baseShift:Je}=je,Lt=xe.width+2,Ct=xe.height+2,Ot=e.b(xe)?new e.R({width:Lt,height:Ct},yield e.bw(xe,-1,-1,Lt,Ct)):xe,Wt=new e.bx($e,Ot,Ee,ye,Me,Xe,Je);return this.loaded=this.loaded||{},this.loaded[$e]=Wt,Wt})}removeTile(je){const $e=this.loaded,Ee=je.uid;$e&&$e[Ee]&&delete $e[Ee]}}function s(Mt,je){if(Mt.length!==0){f(Mt[0],je);for(var $e=1;$e=Math.abs(Xe)?$e-Je+Xe:Xe-Je+$e,$e=Je}$e+Ee>=0!=!!je&&Mt.reverse()}var c=e.by(function Mt(je,$e){var Ee,xe=je&&je.type;if(xe==="FeatureCollection")for(Ee=0;Ee>31}function L(Mt,je){for(var $e=Mt.loadGeometry(),Ee=Mt.type,xe=0,ye=0,Me=$e.length,Xe=0;XeMt},B=Math.fround||(R=new Float32Array(1),Mt=>(R[0]=+Mt,R[0]));var R;const U=3,j=5,Z=6;class re{constructor(je){this.options=Object.assign(Object.create(N),je),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(je){const{log:$e,minZoom:Ee,maxZoom:xe}=this.options;$e&&console.time("total time");const ye=`prepare ${je.length} points`;$e&&console.time(ye),this.points=je;const Me=[];for(let Je=0;Je=Ee;Je--){const Lt=+Date.now();Xe=this.trees[Je]=this._createTree(this._cluster(Xe,Je)),$e&&console.log("z%d: %d clusters in %dms",Je,Xe.numItems,+Date.now()-Lt)}return $e&&console.timeEnd("total time"),this}getClusters(je,$e){let Ee=((je[0]+180)%360+360)%360-180;const xe=Math.max(-90,Math.min(90,je[1]));let ye=je[2]===180?180:((je[2]+180)%360+360)%360-180;const Me=Math.max(-90,Math.min(90,je[3]));if(je[2]-je[0]>=360)Ee=-180,ye=180;else if(Ee>ye){const Ot=this.getClusters([Ee,xe,180,Me],$e),Wt=this.getClusters([-180,xe,ye,Me],$e);return Ot.concat(Wt)}const Xe=this.trees[this._limitZoom($e)],Je=Xe.range(ce(Ee),V(Me),ce(ye),V(xe)),Lt=Xe.data,Ct=[];for(const Ot of Je){const Wt=this.stride*Ot;Ct.push(Lt[Wt+j]>1?fe(Lt,Wt,this.clusterProps):this.points[Lt[Wt+U]])}return Ct}getChildren(je){const $e=this._getOriginId(je),Ee=this._getOriginZoom(je),xe="No cluster with the specified id.",ye=this.trees[Ee];if(!ye)throw new Error(xe);const Me=ye.data;if($e*this.stride>=Me.length)throw new Error(xe);const Xe=this.options.radius/(this.options.extent*Math.pow(2,Ee-1)),Je=ye.within(Me[$e*this.stride],Me[$e*this.stride+1],Xe),Lt=[];for(const Ct of Je){const Ot=Ct*this.stride;Me[Ot+4]===je&&Lt.push(Me[Ot+j]>1?fe(Me,Ot,this.clusterProps):this.points[Me[Ot+U]])}if(Lt.length===0)throw new Error(xe);return Lt}getLeaves(je,$e,Ee){const xe=[];return this._appendLeaves(xe,je,$e=$e||10,Ee=Ee||0,0),xe}getTile(je,$e,Ee){const xe=this.trees[this._limitZoom(je)],ye=Math.pow(2,je),{extent:Me,radius:Xe}=this.options,Je=Xe/Me,Lt=(Ee-Je)/ye,Ct=(Ee+1+Je)/ye,Ot={features:[]};return this._addTileFeatures(xe.range(($e-Je)/ye,Lt,($e+1+Je)/ye,Ct),xe.data,$e,Ee,ye,Ot),$e===0&&this._addTileFeatures(xe.range(1-Je/ye,Lt,1,Ct),xe.data,ye,Ee,ye,Ot),$e===ye-1&&this._addTileFeatures(xe.range(0,Lt,Je/ye,Ct),xe.data,-1,Ee,ye,Ot),Ot.features.length?Ot:null}getClusterExpansionZoom(je){let $e=this._getOriginZoom(je)-1;for(;$e<=this.options.maxZoom;){const Ee=this.getChildren(je);if($e++,Ee.length!==1)break;je=Ee[0].properties.cluster_id}return $e}_appendLeaves(je,$e,Ee,xe,ye){const Me=this.getChildren($e);for(const Xe of Me){const Je=Xe.properties;if(Je&&Je.cluster?ye+Je.point_count<=xe?ye+=Je.point_count:ye=this._appendLeaves(je,Je.cluster_id,Ee,xe,ye):ye1;let Ct,Ot,Wt;if(Lt)Ct=le($e,Je,this.clusterProps),Ot=$e[Je],Wt=$e[Je+1];else{const hr=this.points[$e[Je+U]];Ct=hr.properties;const[Fr,En]=hr.geometry.coordinates;Ot=ce(Fr),Wt=V(En)}const _r={type:1,geometry:[[Math.round(this.options.extent*(Ot*ye-Ee)),Math.round(this.options.extent*(Wt*ye-xe))]],tags:Ct};let pr;pr=Lt||this.options.generateId?$e[Je+U]:this.points[$e[Je+U]].id,pr!==void 0&&(_r.id=pr),Me.features.push(_r)}}_limitZoom(je){return Math.max(this.options.minZoom,Math.min(Math.floor(+je),this.options.maxZoom+1))}_cluster(je,$e){const{radius:Ee,extent:xe,reduce:ye,minPoints:Me}=this.options,Xe=Ee/(xe*Math.pow(2,$e)),Je=je.data,Lt=[],Ct=this.stride;for(let Ot=0;Ot$e&&(Fr+=Je[Kn+j])}if(Fr>hr&&Fr>=Me){let En,Kn=Wt*hr,qn=_r*hr,ta=-1;const ra=((Ot/Ct|0)<<5)+($e+1)+this.points.length;for(const Nn of pr){const ka=Nn*Ct;if(Je[ka+2]<=$e)continue;Je[ka+2]=$e;const qa=Je[ka+j];Kn+=Je[ka]*qa,qn+=Je[ka+1]*qa,Je[ka+4]=ra,ye&&(En||(En=this._map(Je,Ot,!0),ta=this.clusterProps.length,this.clusterProps.push(En)),ye(En,this._map(Je,ka)))}Je[Ot+4]=ra,Lt.push(Kn/Fr,qn/Fr,1/0,ra,-1,Fr),ye&&Lt.push(ta)}else{for(let En=0;En1)for(const En of pr){const Kn=En*Ct;if(!(Je[Kn+2]<=$e)){Je[Kn+2]=$e;for(let qn=0;qn>5}_getOriginZoom(je){return(je-this.points.length)%32}_map(je,$e,Ee){if(je[$e+j]>1){const Me=this.clusterProps[je[$e+Z]];return Ee?Object.assign({},Me):Me}const xe=this.points[je[$e+U]].properties,ye=this.options.map(xe);return Ee&&ye===xe?Object.assign({},ye):ye}}function fe(Mt,je,$e){return{type:"Feature",id:Mt[je+U],properties:le(Mt,je,$e),geometry:{type:"Point",coordinates:[(Ee=Mt[je],360*(Ee-.5)),ee(Mt[je+1])]}};var Ee}function le(Mt,je,$e){const Ee=Mt[je+j],xe=Ee>=1e4?`${Math.round(Ee/1e3)}k`:Ee>=1e3?Math.round(Ee/100)/10+"k":Ee,ye=Mt[je+Z],Me=ye===-1?{}:Object.assign({},$e[ye]);return Object.assign(Me,{cluster:!0,cluster_id:Mt[je+U],point_count:Ee,point_count_abbreviated:xe})}function ce(Mt){return Mt/360+.5}function V(Mt){const je=Math.sin(Mt*Math.PI/180),$e=.5-.25*Math.log((1+je)/(1-je))/Math.PI;return $e<0?0:$e>1?1:$e}function ee(Mt){const je=(180-360*Mt)*Math.PI/180;return 360*Math.atan(Math.exp(je))/Math.PI-90}function ne(Mt,je,$e,Ee){let xe=Ee;const ye=je+($e-je>>1);let Me,Xe=$e-je;const Je=Mt[je],Lt=Mt[je+1],Ct=Mt[$e],Ot=Mt[$e+1];for(let Wt=je+3;Wt<$e;Wt+=3){const _r=K(Mt[Wt],Mt[Wt+1],Je,Lt,Ct,Ot);if(_r>xe)Me=Wt,xe=_r;else if(_r===xe){const pr=Math.abs(Wt-ye);prEe&&(Me-je>3&&ne(Mt,je,Me,Ee),Mt[Me+2]=xe,$e-Me>3&&ne(Mt,Me,$e,Ee))}function K(Mt,je,$e,Ee,xe,ye){let Me=xe-$e,Xe=ye-Ee;if(Me!==0||Xe!==0){const Je=((Mt-$e)*Me+(je-Ee)*Xe)/(Me*Me+Xe*Xe);Je>1?($e=xe,Ee=ye):Je>0&&($e+=Me*Je,Ee+=Xe*Je)}return Me=Mt-$e,Xe=je-Ee,Me*Me+Xe*Xe}function ue(Mt,je,$e,Ee){const xe={id:Mt??null,type:je,geometry:$e,tags:Ee,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(je==="Point"||je==="MultiPoint"||je==="LineString")te(xe,$e);else if(je==="Polygon")te(xe,$e[0]);else if(je==="MultiLineString")for(const ye of $e)te(xe,ye);else if(je==="MultiPolygon")for(const ye of $e)te(xe,ye[0]);return xe}function te(Mt,je){for(let $e=0;$e0&&(Me+=Ee?(xe*Ct-Lt*ye)/2:Math.sqrt(Math.pow(Lt-xe,2)+Math.pow(Ct-ye,2))),xe=Lt,ye=Ct}const Xe=je.length-3;je[2]=1,ne(je,0,Xe,$e),je[Xe+2]=1,je.size=Math.abs(Me),je.start=0,je.end=je.size}function ve(Mt,je,$e,Ee){for(let xe=0;xe1?1:$e}function Fe(Mt,je,$e,Ee,xe,ye,Me,Xe){if(Ee/=je,ye>=($e/=je)&&Me=Ee)return null;const Je=[];for(const Lt of Mt){const Ct=Lt.geometry;let Ot=Lt.type;const Wt=xe===0?Lt.minX:Lt.minY,_r=xe===0?Lt.maxX:Lt.maxY;if(Wt>=$e&&_r=Ee)continue;let pr=[];if(Ot==="Point"||Ot==="MultiPoint")ze(Ct,pr,$e,Ee,xe);else if(Ot==="LineString")Ye(Ct,pr,$e,Ee,xe,!1,Xe.lineMetrics);else if(Ot==="MultiLineString")st(Ct,pr,$e,Ee,xe,!1);else if(Ot==="Polygon")st(Ct,pr,$e,Ee,xe,!0);else if(Ot==="MultiPolygon")for(const hr of Ct){const Fr=[];st(hr,Fr,$e,Ee,xe,!0),Fr.length&&pr.push(Fr)}if(pr.length){if(Xe.lineMetrics&&Ot==="LineString"){for(const hr of pr)Je.push(ue(Lt.id,Ot,hr,Lt.tags));continue}Ot!=="LineString"&&Ot!=="MultiLineString"||(pr.length===1?(Ot="LineString",pr=pr[0]):Ot="MultiLineString"),Ot!=="Point"&&Ot!=="MultiPoint"||(Ot=pr.length===3?"Point":"MultiPoint"),Je.push(ue(Lt.id,Ot,pr,Lt.tags))}}return Je.length?Je:null}function ze(Mt,je,$e,Ee,xe){for(let ye=0;ye=$e&&Me<=Ee&&nt(je,Mt[ye],Mt[ye+1],Mt[ye+2])}}function Ye(Mt,je,$e,Ee,xe,ye,Me){let Xe=it(Mt);const Je=xe===0?Qe:Le;let Lt,Ct,Ot=Mt.start;for(let Fr=0;Fr$e&&(Ct=Je(Xe,En,Kn,ta,ra,$e),Me&&(Xe.start=Ot+Lt*Ct)):Nn>Ee?ka=$e&&(Ct=Je(Xe,En,Kn,ta,ra,$e),qa=!0),ka>Ee&&Nn<=Ee&&(Ct=Je(Xe,En,Kn,ta,ra,Ee),qa=!0),!ye&&qa&&(Me&&(Xe.end=Ot+Lt*Ct),je.push(Xe),Xe=it(Mt)),Me&&(Ot+=Lt)}let Wt=Mt.length-3;const _r=Mt[Wt],pr=Mt[Wt+1],hr=xe===0?_r:pr;hr>=$e&&hr<=Ee&&nt(Xe,_r,pr,Mt[Wt+2]),Wt=Xe.length-3,ye&&Wt>=3&&(Xe[Wt]!==Xe[0]||Xe[Wt+1]!==Xe[1])&&nt(Xe,Xe[0],Xe[1],Xe[2]),Xe.length&&je.push(Xe)}function it(Mt){const je=[];return je.size=Mt.size,je.start=Mt.start,je.end=Mt.end,je}function st(Mt,je,$e,Ee,xe,ye){for(const Me of Mt)Ye(Me,je,$e,Ee,xe,ye,!1)}function nt(Mt,je,$e,Ee){Mt.push(je,$e,Ee)}function Qe(Mt,je,$e,Ee,xe,ye){const Me=(ye-je)/(Ee-je);return nt(Mt,ye,$e+(xe-$e)*Me,1),Me}function Le(Mt,je,$e,Ee,xe,ye){const Me=(ye-$e)/(xe-$e);return nt(Mt,je+(Ee-je)*Me,ye,1),Me}function Te(Mt,je){const $e=[];for(let Ee=0;Ee0&&je.size<(xe?Me:Ee))return void($e.numPoints+=je.length/3);const Xe=[];for(let Je=0;JeMe)&&($e.numSimplified++,Xe.push(je[Je],je[Je+1])),$e.numPoints++;xe&&(function(Je,Lt){let Ct=0;for(let Ot=0,Wt=Je.length,_r=Wt-2;Ot0===Lt)for(let Ot=0,Wt=Je.length;Ot24)throw new Error("maxZoom should be in the 0-24 range");if($e.promoteId&&$e.generateId)throw new Error("promoteId and generateId cannot be used together.");let xe=(function(ye,Me){const Xe=[];if(ye.type==="FeatureCollection")for(let Je=0;Je1&&console.time("creation"),_r=this.tiles[Wt]=ft(je,$e,Ee,xe,Lt),this.tileCoords.push({z:$e,x:Ee,y:xe}),Ct)){Ct>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",$e,Ee,xe,_r.numFeatures,_r.numPoints,_r.numSimplified),console.timeEnd("creation"));const qa=`z${$e}`;this.stats[qa]=(this.stats[qa]||0)+1,this.total++}if(_r.source=je,ye==null){if($e===Lt.indexMaxZoom||_r.numPoints<=Lt.indexMaxPoints)continue}else{if($e===Lt.maxZoom||$e===ye)continue;if(ye!=null){const qa=ye-$e;if(Ee!==Me>>qa||xe!==Xe>>qa)continue}}if(_r.source=null,je.length===0)continue;Ct>1&&console.time("clipping");const pr=.5*Lt.buffer/Lt.extent,hr=.5-pr,Fr=.5+pr,En=1+pr;let Kn=null,qn=null,ta=null,ra=null,Nn=Fe(je,Ot,Ee-pr,Ee+Fr,0,_r.minX,_r.maxX,Lt),ka=Fe(je,Ot,Ee+hr,Ee+En,0,_r.minX,_r.maxX,Lt);je=null,Nn&&(Kn=Fe(Nn,Ot,xe-pr,xe+Fr,1,_r.minY,_r.maxY,Lt),qn=Fe(Nn,Ot,xe+hr,xe+En,1,_r.minY,_r.maxY,Lt),Nn=null),ka&&(ta=Fe(ka,Ot,xe-pr,xe+Fr,1,_r.minY,_r.maxY,Lt),ra=Fe(ka,Ot,xe+hr,xe+En,1,_r.minY,_r.maxY,Lt),ka=null),Ct>1&&console.timeEnd("clipping"),Je.push(Kn||[],$e+1,2*Ee,2*xe),Je.push(qn||[],$e+1,2*Ee,2*xe+1),Je.push(ta||[],$e+1,2*Ee+1,2*xe),Je.push(ra||[],$e+1,2*Ee+1,2*xe+1)}}getTile(je,$e,Ee){je=+je,$e=+$e,Ee=+Ee;const xe=this.options,{extent:ye,debug:Me}=xe;if(je<0||je>24)return null;const Xe=1<1&&console.log("drilling down to z%d-%d-%d",je,$e,Ee);let Lt,Ct=je,Ot=$e,Wt=Ee;for(;!Lt&&Ct>0;)Ct--,Ot>>=1,Wt>>=1,Lt=this.tiles[rr(Ct,Ot,Wt)];return Lt&&Lt.source?(Me>1&&(console.log("found parent tile z%d-%d-%d",Ct,Ot,Wt),console.time("drilling down")),this.splitTile(Lt.source,Ct,Ot,Wt,je,$e,Ee),Me>1&&console.timeEnd("drilling down"),this.tiles[Je]?Ne(this.tiles[Je],ye):null):null}}function rr(Mt,je,$e){return 32*((1<{Ot.properties=_r;const pr={};for(const hr of Wt)pr[hr]=Je[hr].evaluate(Ct,Ot);return pr},Me.reduce=(_r,pr)=>{Ot.properties=pr;for(const hr of Wt)Ct.accumulated=_r[hr],_r[hr]=Lt[hr].evaluate(Ct,Ot)},Me})(je)).load((yield this._pendingData).features):(xe=yield this._pendingData,new $t(xe,je.geojsonVtOptions)),this.loaded={};const ye={};if(Ee){const Me=Ee.finish();Me&&(ye.resourceTiming={},ye.resourceTiming[je.source]=JSON.parse(JSON.stringify(Me)))}return ye}catch(ye){if(delete this._pendingRequest,e.bB(ye))return{abandoned:!0};throw ye}var xe})}getData(){return e._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(je){const $e=this.loaded;return $e&&$e[je.uid]?super.reloadTile(je):this.loadTile(je)}loadAndProcessGeoJSON(je,$e){return e._(this,void 0,void 0,function*(){let Ee=yield this.loadGeoJSON(je,$e);if(delete this._pendingRequest,typeof Ee!="object")throw new Error(`Input data given to '${je.source}' is not a valid GeoJSON object.`);if(c(Ee,!0),je.filter){const xe=e.bC(je.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(xe.result==="error")throw new Error(xe.value.map(Me=>`${Me.key}: ${Me.message}`).join(", "));Ee={type:"FeatureCollection",features:Ee.features.filter(Me=>xe.value.evaluate({zoom:0},Me))}}return Ee})}loadGeoJSON(je,$e){return e._(this,void 0,void 0,function*(){const{promoteId:Ee}=je;if(je.request){const xe=yield e.h(je.request,$e);return this._dataUpdateable=Mr(xe.data,Ee)?Wr(xe.data,Ee):void 0,xe.data}if(typeof je.data=="string")try{const xe=JSON.parse(je.data);return this._dataUpdateable=Mr(xe,Ee)?Wr(xe,Ee):void 0,xe}catch{throw new Error(`Input data given to '${je.source}' is not a valid GeoJSON object.`)}if(!je.dataDiff)throw new Error(`Input data given to '${je.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${je.source}`);return(function(xe,ye,Me){var Xe,Je,Lt,Ct;if(ye.removeAll&&xe.clear(),ye.remove)for(const Ot of ye.remove)xe.delete(Ot);if(ye.add)for(const Ot of ye.add){const Wt=Er(Ot,Me);Wt!=null&&xe.set(Wt,Ot)}if(ye.update)for(const Ot of ye.update){let Wt=xe.get(Ot.id);if(Wt==null)continue;const _r=!Ot.removeAllProperties&&(((Xe=Ot.removeProperties)===null||Xe===void 0?void 0:Xe.length)>0||((Je=Ot.addOrUpdateProperties)===null||Je===void 0?void 0:Je.length)>0);if((Ot.newGeometry||Ot.removeAllProperties||_r)&&(Wt=Object.assign({},Wt),xe.set(Ot.id,Wt),_r&&(Wt.properties=Object.assign({},Wt.properties))),Ot.newGeometry&&(Wt.geometry=Ot.newGeometry),Ot.removeAllProperties)Wt.properties={};else if(((Lt=Ot.removeProperties)===null||Lt===void 0?void 0:Lt.length)>0)for(const pr of Ot.removeProperties)Object.prototype.hasOwnProperty.call(Wt.properties,pr)&&delete Wt.properties[pr];if(((Ct=Ot.addOrUpdateProperties)===null||Ct===void 0?void 0:Ct.length)>0)for(const{key:pr,value:hr}of Ot.addOrUpdateProperties)Wt.properties[pr]=hr}})(this._dataUpdateable,je.dataDiff,Ee),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(je){return e._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(je){return this._geoJSONIndex.getClusterExpansionZoom(je.clusterId)}getClusterChildren(je){return this._geoJSONIndex.getChildren(je.clusterId)}getClusterLeaves(je){return this._geoJSONIndex.getLeaves(je.clusterId,je.limit,je.offset)}}class Br{constructor(je){this.self=je,this.actor=new e.F(je),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=($e,Ee)=>{if(this.externalWorkerSourceTypes[$e])throw new Error(`Worker source with name "${$e}" already registered.`);this.externalWorkerSourceTypes[$e]=Ee},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=$e=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods($e)},this.actor.registerMessageHandler("LDT",($e,Ee)=>this._getDEMWorkerSource($e,Ee.source).loadTile(Ee)),this.actor.registerMessageHandler("RDT",($e,Ee)=>e._(this,void 0,void 0,function*(){this._getDEMWorkerSource($e,Ee.source).removeTile(Ee)})),this.actor.registerMessageHandler("GCEZ",($e,Ee)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource($e,Ee.type,Ee.source).getClusterExpansionZoom(Ee)})),this.actor.registerMessageHandler("GCC",($e,Ee)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource($e,Ee.type,Ee.source).getClusterChildren(Ee)})),this.actor.registerMessageHandler("GCL",($e,Ee)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource($e,Ee.type,Ee.source).getClusterLeaves(Ee)})),this.actor.registerMessageHandler("LD",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).loadData(Ee)),this.actor.registerMessageHandler("GD",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).getData()),this.actor.registerMessageHandler("LT",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).loadTile(Ee)),this.actor.registerMessageHandler("RT",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).reloadTile(Ee)),this.actor.registerMessageHandler("AT",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).abortTile(Ee)),this.actor.registerMessageHandler("RMT",($e,Ee)=>this._getWorkerSource($e,Ee.type,Ee.source).removeTile(Ee)),this.actor.registerMessageHandler("RS",($e,Ee)=>e._(this,void 0,void 0,function*(){if(!this.workerSources[$e]||!this.workerSources[$e][Ee.type]||!this.workerSources[$e][Ee.type][Ee.source])return;const xe=this.workerSources[$e][Ee.type][Ee.source];delete this.workerSources[$e][Ee.type][Ee.source],xe.removeSource!==void 0&&xe.removeSource(Ee)})),this.actor.registerMessageHandler("RM",$e=>e._(this,void 0,void 0,function*(){delete this.layerIndexes[$e],delete this.availableImages[$e],delete this.workerSources[$e],delete this.demWorkerSources[$e]})),this.actor.registerMessageHandler("SR",($e,Ee)=>e._(this,void 0,void 0,function*(){this.referrer=Ee})),this.actor.registerMessageHandler("SRPS",($e,Ee)=>this._syncRTLPluginState($e,Ee)),this.actor.registerMessageHandler("IS",($e,Ee)=>e._(this,void 0,void 0,function*(){this.self.importScripts(Ee)})),this.actor.registerMessageHandler("SI",($e,Ee)=>this._setImages($e,Ee)),this.actor.registerMessageHandler("UL",($e,Ee)=>e._(this,void 0,void 0,function*(){this._getLayerIndex($e).update(Ee.layers,Ee.removedIds)})),this.actor.registerMessageHandler("SL",($e,Ee)=>e._(this,void 0,void 0,function*(){this._getLayerIndex($e).replace(Ee)}))}_setImages(je,$e){return e._(this,void 0,void 0,function*(){this.availableImages[je]=$e;for(const Ee in this.workerSources[je]){const xe=this.workerSources[je][Ee];for(const ye in xe)xe[ye].availableImages=$e}})}_syncRTLPluginState(je,$e){return e._(this,void 0,void 0,function*(){if(e.bD.isParsed())return e.bD.getState();if($e.pluginStatus!=="loading")return e.bD.setState($e),$e;const Ee=$e.pluginURL;if(this.self.importScripts(Ee),e.bD.isParsed()){const xe={pluginStatus:"loaded",pluginURL:Ee};return e.bD.setState(xe),xe}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Ee}`)})}_getAvailableImages(je){let $e=this.availableImages[je];return $e||($e=[]),$e}_getLayerIndex(je){let $e=this.layerIndexes[je];return $e||($e=this.layerIndexes[je]=new t),$e}_getWorkerSource(je,$e,Ee){if(this.workerSources[je]||(this.workerSources[je]={}),this.workerSources[je][$e]||(this.workerSources[je][$e]={}),!this.workerSources[je][$e][Ee]){const xe={sendAsync:(ye,Me)=>(ye.targetMapId=je,this.actor.sendAsync(ye,Me))};switch($e){case"vector":this.workerSources[je][$e][Ee]=new i(xe,this._getLayerIndex(je),this._getAvailableImages(je));break;case"geojson":this.workerSources[je][$e][Ee]=new Sr(xe,this._getLayerIndex(je),this._getAvailableImages(je));break;default:this.workerSources[je][$e][Ee]=new this.externalWorkerSourceTypes[$e](xe,this._getLayerIndex(je),this._getAvailableImages(je))}}return this.workerSources[je][$e][Ee]}_getDEMWorkerSource(je,$e){return this.demWorkerSources[je]||(this.demWorkerSources[je]={}),this.demWorkerSources[je][$e]||(this.demWorkerSources[je][$e]=new a),this.demWorkerSources[je][$e]}}return e.i(self)&&(self.worker=new Br(self)),Br}),S("index",["exports","./shared"],function(e,t){var r="4.7.1";let o,n;const i={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Ue=>new Promise((P,oe)=>{const Se=requestAnimationFrame(P);Ue.signal.addEventListener("abort",()=>{cancelAnimationFrame(Se),oe(t.c())})}),getImageData(Ue,P=0){return this.getImageCanvasContext(Ue).getImageData(-P,-P,Ue.width+2*P,Ue.height+2*P)},getImageCanvasContext(Ue){const P=window.document.createElement("canvas"),oe=P.getContext("2d",{willReadFrequently:!0});if(!oe)throw new Error("failed to create canvas 2d context");return P.width=Ue.width,P.height=Ue.height,oe.drawImage(Ue,0,0,Ue.width,Ue.height),oe},resolveURL:Ue=>(o||(o=document.createElement("a")),o.href=Ue,o.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(n==null&&(n=matchMedia("(prefers-reduced-motion: reduce)")),n.matches)}};class a{static testProp(P){if(!a.docStyle)return P[0];for(let oe=0;oe{window.removeEventListener("click",a.suppressClickInternal,!0)},0)}static getScale(P){const oe=P.getBoundingClientRect();return{x:oe.width/P.offsetWidth||1,y:oe.height/P.offsetHeight||1,boundingClientRect:oe}}static getPoint(P,oe,Se){const ke=oe.boundingClientRect;return new t.P((Se.clientX-ke.left)/oe.x-P.clientLeft,(Se.clientY-ke.top)/oe.y-P.clientTop)}static mousePos(P,oe){const Se=a.getScale(P);return a.getPoint(P,Se,oe)}static touchPos(P,oe){const Se=[],ke=a.getScale(P);for(let Be=0;Be{f&&T(f),f=null,d=!0},c.onerror=()=>{p=!0,f=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(Ue){let P,oe,Se,ke;Ue.resetRequestQueue=()=>{P=[],oe=0,Se=0,ke={}},Ue.addThrottleControl=Gt=>{const cr=Se++;return ke[cr]=Gt,cr},Ue.removeThrottleControl=Gt=>{delete ke[Gt],gt()},Ue.getImage=(Gt,cr,Ar=!0)=>new Promise((Cr,Qr)=>{s.supported&&(Gt.headers||(Gt.headers={}),Gt.headers.accept="image/webp,*/*"),t.e(Gt,{type:"image"}),P.push({abortController:cr,requestParameters:Gt,supportImageRefresh:Ar,state:"queued",onError:_n=>{Qr(_n)},onSuccess:_n=>{Cr(_n)}}),gt()});const Be=Gt=>t._(this,void 0,void 0,function*(){Gt.state="running";const{requestParameters:cr,supportImageRefresh:Ar,onError:Cr,onSuccess:Qr,abortController:_n}=Gt,Ze=Ar===!1&&!t.i(self)&&!t.g(cr.url)&&(!cr.headers||Object.keys(cr.headers).reduce((_t,zt)=>_t&&zt==="accept",!0));oe++;const et=Ze?kt(cr,_n):t.m(cr,_n);try{const _t=yield et;delete Gt.abortController,Gt.state="completed",_t.data instanceof HTMLImageElement||t.b(_t.data)?Qr(_t):_t.data&&Qr({data:yield(ht=_t.data,typeof createImageBitmap=="function"?t.d(ht):t.f(ht)),cacheControl:_t.cacheControl,expires:_t.expires})}catch(_t){delete Gt.abortController,Cr(_t)}finally{oe--,gt()}var ht}),gt=()=>{const Gt=(()=>{for(const cr of Object.keys(ke))if(ke[cr]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let cr=oe;cr0;cr++){const Ar=P.shift();Ar.abortController.signal.aborted?cr--:Be(Ar)}},kt=(Gt,cr)=>new Promise((Ar,Cr)=>{const Qr=new Image,_n=Gt.url,Ze=Gt.credentials;Ze&&Ze==="include"?Qr.crossOrigin="use-credentials":(Ze&&Ze==="same-origin"||!t.s(_n))&&(Qr.crossOrigin="anonymous"),cr.signal.addEventListener("abort",()=>{Qr.src="",Cr(t.c())}),Qr.fetchPriority="high",Qr.onload=()=>{Qr.onerror=Qr.onload=null,Ar({data:Qr})},Qr.onerror=()=>{Qr.onerror=Qr.onload=null,cr.signal.aborted||Cr(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},Qr.src=_n})})(l||(l={})),l.resetRequestQueue();class g{constructor(P){this._transformRequestFn=P}transformRequest(P,oe){return this._transformRequestFn&&this._transformRequestFn(P,oe)||{url:P}}setTransformRequest(P){this._transformRequestFn=P}}function x(Ue){var P=new t.A(3);return P[0]=Ue[0],P[1]=Ue[1],P[2]=Ue[2],P}var A,M=function(Ue,P,oe){return Ue[0]=P[0]-oe[0],Ue[1]=P[1]-oe[1],Ue[2]=P[2]-oe[2],Ue};A=new t.A(3),t.A!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0);var _=function(Ue){var P=Ue[0],oe=Ue[1];return P*P+oe*oe};function w(Ue){const P=[];if(typeof Ue=="string")P.push({id:"default",url:Ue});else if(Ue&&Ue.length>0){const oe=[];for(const{id:Se,url:ke}of Ue){const Be=`${Se}${ke}`;oe.indexOf(Be)===-1&&(oe.push(Be),P.push({id:Se,url:ke}))}}return P}function m(Ue,P,oe){const Se=Ue.split("?");return Se[0]+=`${P}${oe}`,Se.join("?")}(function(){var Ue=new t.A(2);t.A!=Float32Array&&(Ue[0]=0,Ue[1]=0)})();class u{constructor(P,oe,Se,ke){this.context=P,this.format=Se,this.texture=P.gl.createTexture(),this.update(oe,ke)}update(P,oe,Se){const{width:ke,height:Be}=P,gt=!(this.size&&this.size[0]===ke&&this.size[1]===Be||Se),{context:kt}=this,{gl:Gt}=kt;if(this.useMipmap=!!(oe&&oe.useMipmap),Gt.bindTexture(Gt.TEXTURE_2D,this.texture),kt.pixelStoreUnpackFlipY.set(!1),kt.pixelStoreUnpack.set(1),kt.pixelStoreUnpackPremultiplyAlpha.set(this.format===Gt.RGBA&&(!oe||oe.premultiply!==!1)),gt)this.size=[ke,Be],P instanceof HTMLImageElement||P instanceof HTMLCanvasElement||P instanceof HTMLVideoElement||P instanceof ImageData||t.b(P)?Gt.texImage2D(Gt.TEXTURE_2D,0,this.format,this.format,Gt.UNSIGNED_BYTE,P):Gt.texImage2D(Gt.TEXTURE_2D,0,this.format,ke,Be,0,this.format,Gt.UNSIGNED_BYTE,P.data);else{const{x:cr,y:Ar}=Se||{x:0,y:0};P instanceof HTMLImageElement||P instanceof HTMLCanvasElement||P instanceof HTMLVideoElement||P instanceof ImageData||t.b(P)?Gt.texSubImage2D(Gt.TEXTURE_2D,0,cr,Ar,Gt.RGBA,Gt.UNSIGNED_BYTE,P):Gt.texSubImage2D(Gt.TEXTURE_2D,0,cr,Ar,ke,Be,Gt.RGBA,Gt.UNSIGNED_BYTE,P.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Gt.generateMipmap(Gt.TEXTURE_2D)}bind(P,oe,Se){const{context:ke}=this,{gl:Be}=ke;Be.bindTexture(Be.TEXTURE_2D,this.texture),Se!==Be.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Se=Be.LINEAR),P!==this.filter&&(Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MAG_FILTER,P),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MIN_FILTER,Se||P),this.filter=P),oe!==this.wrap&&(Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_S,oe),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_T,oe),this.wrap=oe)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:P}=this.context;P.deleteTexture(this.texture),this.texture=null}}function v(Ue){const{userImage:P}=Ue;return!!(P&&P.render&&P.render())&&(Ue.data.replace(new Uint8Array(P.data.buffer)),!0)}class y extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(P){if(this.loaded!==P&&(this.loaded=P,P)){for(const{ids:oe,promiseResolve:Se}of this.requestors)Se(this._getImagesForIds(oe));this.requestors=[]}}getImage(P){const oe=this.images[P];if(oe&&!oe.data&&oe.spriteData){const Se=oe.spriteData;oe.data=new t.R({width:Se.width,height:Se.height},Se.context.getImageData(Se.x,Se.y,Se.width,Se.height).data),oe.spriteData=null}return oe}addImage(P,oe){if(this.images[P])throw new Error(`Image id ${P} already exist, use updateImage instead`);this._validate(P,oe)&&(this.images[P]=oe)}_validate(P,oe){let Se=!0;const ke=oe.data||oe.spriteData;return this._validateStretch(oe.stretchX,ke&&ke.width)||(this.fire(new t.j(new Error(`Image "${P}" has invalid "stretchX" value`))),Se=!1),this._validateStretch(oe.stretchY,ke&&ke.height)||(this.fire(new t.j(new Error(`Image "${P}" has invalid "stretchY" value`))),Se=!1),this._validateContent(oe.content,oe)||(this.fire(new t.j(new Error(`Image "${P}" has invalid "content" value`))),Se=!1),Se}_validateStretch(P,oe){if(!P)return!0;let Se=0;for(const ke of P){if(ke[0]{let ke=!0;if(!this.isLoaded())for(const Be of P)this.images[Be]||(ke=!1);this.isLoaded()||ke?oe(this._getImagesForIds(P)):this.requestors.push({ids:P,promiseResolve:oe})})}_getImagesForIds(P){const oe={};for(const Se of P){let ke=this.getImage(Se);ke||(this.fire(new t.k("styleimagemissing",{id:Se})),ke=this.getImage(Se)),ke?oe[Se]={data:ke.data.clone(),pixelRatio:ke.pixelRatio,sdf:ke.sdf,version:ke.version,stretchX:ke.stretchX,stretchY:ke.stretchY,content:ke.content,textFitWidth:ke.textFitWidth,textFitHeight:ke.textFitHeight,hasRenderCallback:!!(ke.userImage&&ke.userImage.render)}:t.w(`Image "${Se}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return oe}getPixelSize(){const{width:P,height:oe}=this.atlasImage;return{width:P,height:oe}}getPattern(P){const oe=this.patterns[P],Se=this.getImage(P);if(!Se)return null;if(oe&&oe.position.version===Se.version)return oe.position;if(oe)oe.position.version=Se.version;else{const ke={w:Se.data.width+2,h:Se.data.height+2,x:0,y:0},Be=new t.I(ke,Se);this.patterns[P]={bin:ke,position:Be}}return this._updatePatternAtlas(),this.patterns[P].position}bind(P){const oe=P.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u(P,this.atlasImage,oe.RGBA),this.atlasTexture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE)}_updatePatternAtlas(){const P=[];for(const Be in this.patterns)P.push(this.patterns[Be].bin);const{w:oe,h:Se}=t.p(P),ke=this.atlasImage;ke.resize({width:oe||1,height:Se||1});for(const Be in this.patterns){const{bin:gt}=this.patterns[Be],kt=gt.x+1,Gt=gt.y+1,cr=this.getImage(Be).data,Ar=cr.width,Cr=cr.height;t.R.copy(cr,ke,{x:0,y:0},{x:kt,y:Gt},{width:Ar,height:Cr}),t.R.copy(cr,ke,{x:0,y:Cr-1},{x:kt,y:Gt-1},{width:Ar,height:1}),t.R.copy(cr,ke,{x:0,y:0},{x:kt,y:Gt+Cr},{width:Ar,height:1}),t.R.copy(cr,ke,{x:Ar-1,y:0},{x:kt-1,y:Gt},{width:1,height:Cr}),t.R.copy(cr,ke,{x:0,y:0},{x:kt+Ar,y:Gt},{width:1,height:Cr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(P){for(const oe of P){if(this.callbackDispatchedThisFrame[oe])continue;this.callbackDispatchedThisFrame[oe]=!0;const Se=this.getImage(oe);Se||t.w(`Image with ID: "${oe}" was not found`),v(Se)&&this.updateImage(oe,Se)}}}const I=1e20;function L(Ue,P,oe,Se,ke,Be,gt,kt,Gt){for(let cr=P;cr-1);Gt++,Be[Gt]=kt,gt[Gt]=cr,gt[Gt+1]=I}for(let kt=0,Gt=0;kt65535)throw new Error("glyphs > 65535 not supported");if(Se.ranges[Be])return{stack:P,id:oe,glyph:ke};if(!this.url)throw new Error("glyphsUrl is not set");if(!Se.requests[Be]){const kt=F.loadGlyphRange(P,Be,this.url,this.requestManager);Se.requests[Be]=kt}const gt=yield Se.requests[Be];for(const kt in gt)this._doesCharSupportLocalGlyph(+kt)||(Se.glyphs[+kt]=gt[+kt]);return Se.ranges[Be]=!0,{stack:P,id:oe,glyph:gt[oe]||null}})}_doesCharSupportLocalGlyph(P){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(P))}_tinySDF(P,oe,Se){const ke=this.localIdeographFontFamily;if(!ke||!this._doesCharSupportLocalGlyph(Se))return;let Be=P.tinySDF;if(!Be){let kt="400";/bold/i.test(oe)?kt="900":/medium/i.test(oe)?kt="500":/light/i.test(oe)&&(kt="200"),Be=P.tinySDF=new F.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:ke,fontWeight:kt})}const gt=Be.draw(String.fromCharCode(Se));return{id:Se,bitmap:new t.o({width:gt.width||60,height:gt.height||60},gt.data),metrics:{width:gt.glyphWidth/2||24,height:gt.glyphHeight/2||24,left:gt.glyphLeft/2+.5||0,top:gt.glyphTop/2-27.5||-8,advance:gt.glyphAdvance/2||24,isDoubleResolution:!0}}}}F.loadGlyphRange=function(Ue,P,oe,Se){return t._(this,void 0,void 0,function*(){const ke=256*P,Be=ke+255,gt=Se.transformRequest(oe.replace("{fontstack}",Ue).replace("{range}",`${ke}-${Be}`),"Glyphs"),kt=yield t.l(gt,new AbortController);if(!kt||!kt.data)throw new Error(`Could not load glyph range. range: ${P}, ${ke}-${Be}`);const Gt={};for(const cr of t.n(kt.data))Gt[cr.id]=cr;return Gt})},F.TinySDF=class{constructor({fontSize:Ue=24,buffer:P=3,radius:oe=8,cutoff:Se=.25,fontFamily:ke="sans-serif",fontWeight:Be="normal",fontStyle:gt="normal"}={}){this.buffer=P,this.cutoff=Se,this.radius=oe;const kt=this.size=Ue+4*P,Gt=this._createCanvas(kt),cr=this.ctx=Gt.getContext("2d",{willReadFrequently:!0});cr.font=`${gt} ${Be} ${Ue}px ${ke}`,cr.textBaseline="alphabetic",cr.textAlign="left",cr.fillStyle="black",this.gridOuter=new Float64Array(kt*kt),this.gridInner=new Float64Array(kt*kt),this.f=new Float64Array(kt),this.z=new Float64Array(kt+1),this.v=new Uint16Array(kt)}_createCanvas(Ue){const P=document.createElement("canvas");return P.width=P.height=Ue,P}draw(Ue){const{width:P,actualBoundingBoxAscent:oe,actualBoundingBoxDescent:Se,actualBoundingBoxLeft:ke,actualBoundingBoxRight:Be}=this.ctx.measureText(Ue),gt=Math.ceil(oe),kt=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Be-ke))),Gt=Math.min(this.size-this.buffer,gt+Math.ceil(Se)),cr=kt+2*this.buffer,Ar=Gt+2*this.buffer,Cr=Math.max(cr*Ar,0),Qr=new Uint8ClampedArray(Cr),_n={data:Qr,width:cr,height:Ar,glyphWidth:kt,glyphHeight:Gt,glyphTop:gt,glyphLeft:0,glyphAdvance:P};if(kt===0||Gt===0)return _n;const{ctx:Ze,buffer:et,gridInner:ht,gridOuter:_t}=this;Ze.clearRect(et,et,kt,Gt),Ze.fillText(Ue,et,et+gt);const zt=Ze.getImageData(et,et,kt,Gt);_t.fill(I,0,Cr),ht.fill(0,0,Cr);for(let Et=0;Et0?Lr*Lr:0,ht[Tr]=Lr<0?Lr*Lr:0}}L(_t,0,0,cr,Ar,cr,this.f,this.v,this.z),L(ht,et,et,kt,Gt,cr,this.f,this.v,this.z);for(let Et=0;Et1&&(Gt=P[++kt]);const Ar=Math.abs(cr-Gt.left),Cr=Math.abs(cr-Gt.right),Qr=Math.min(Ar,Cr);let _n;const Ze=Be/Se*(ke+1);if(Gt.isDash){const et=ke-Math.abs(Ze);_n=Math.sqrt(Qr*Qr+et*et)}else _n=ke-Math.sqrt(Qr*Qr+Ze*Ze);this.data[gt+cr]=Math.max(0,Math.min(255,_n+128))}}}addRegularDash(P){for(let kt=P.length-1;kt>=0;--kt){const Gt=P[kt],cr=P[kt+1];Gt.zeroLength?P.splice(kt,1):cr&&cr.isDash===Gt.isDash&&(cr.left=Gt.left,P.splice(kt,1))}const oe=P[0],Se=P[P.length-1];oe.isDash===Se.isDash&&(oe.left=Se.left-this.width,Se.right=oe.right+this.width);const ke=this.width*this.nextRow;let Be=0,gt=P[Be];for(let kt=0;kt1&&(gt=P[++Be]);const Gt=Math.abs(kt-gt.left),cr=Math.abs(kt-gt.right),Ar=Math.min(Gt,cr);this.data[ke+kt]=Math.max(0,Math.min(255,(gt.isDash?Ar:-Ar)+128))}}addDash(P,oe){const Se=oe?7:0,ke=2*Se+1;if(this.nextRow+ke>this.height)return t.w("LineAtlas out of space"),null;let Be=0;for(let kt=0;kt{oe.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[re]}numActive(){return Object.keys(this.active).length}}const le=Math.floor(i.hardwareConcurrency/2);let ce,V;function ee(){return ce||(ce=new fe),ce}fe.workerCount=t.C(globalThis)?Math.max(Math.min(le,3),1):1;class ne{constructor(P,oe){this.workerPool=P,this.actors=[],this.currentActor=0,this.id=oe;const Se=this.workerPool.acquire(oe);for(let ke=0;ke{oe.remove()}),this.actors=[],P&&this.workerPool.release(this.id)}registerMessageHandler(P,oe){for(const Se of this.actors)Se.registerMessageHandler(P,oe)}}function K(){return V||(V=new ne(ee(),t.G),V.registerMessageHandler("GR",(Ue,P,oe)=>t.m(P,oe))),V}function ue(Ue,P){const oe=t.H();return t.J(oe,oe,[1,1,0]),t.K(oe,oe,[.5*Ue.width,.5*Ue.height,1]),t.L(oe,oe,Ue.calculatePosMatrix(P.toUnwrapped()))}function te(Ue,P,oe,Se,ke,Be){const gt=(function(Cr,Qr,_n){if(Cr)for(const Ze of Cr){const et=Qr[Ze];if(et&&et.source===_n&&et.type==="fill-extrusion")return!0}else for(const Ze in Qr){const et=Qr[Ze];if(et.source===_n&&et.type==="fill-extrusion")return!0}return!1})(ke&&ke.layers,P,Ue.id),kt=Be.maxPitchScaleFactor(),Gt=Ue.tilesIn(Se,kt,gt);Gt.sort(H);const cr=[];for(const Cr of Gt)cr.push({wrappedTileID:Cr.tileID.wrapped().key,queryResults:Cr.tile.queryRenderedFeatures(P,oe,Ue._state,Cr.queryGeometry,Cr.cameraQueryGeometry,Cr.scale,ke,Be,kt,ue(Ue.transform,Cr.tileID))});const Ar=(function(Cr){const Qr={},_n={};for(const Ze of Cr){const et=Ze.queryResults,ht=Ze.wrappedTileID,_t=_n[ht]=_n[ht]||{};for(const zt in et){const Et=et[zt],Ut=_t[zt]=_t[zt]||{},mr=Qr[zt]=Qr[zt]||[];for(const Tr of Et)Ut[Tr.featureIndex]||(Ut[Tr.featureIndex]=!0,mr.push(Tr))}}return Qr})(cr);for(const Cr in Ar)Ar[Cr].forEach(Qr=>{const _n=Qr.feature,Ze=Ue.getFeatureState(_n.layer["source-layer"],_n.id);_n.source=_n.layer.source,_n.layer["source-layer"]&&(_n.sourceLayer=_n.layer["source-layer"]),_n.state=Ze});return Ar}function H(Ue,P){const oe=Ue.tileID,Se=P.tileID;return oe.overscaledZ-Se.overscaledZ||oe.canonical.y-Se.canonical.y||oe.wrap-Se.wrap||oe.canonical.x-Se.canonical.x}function ae(Ue,P,oe){return t._(this,void 0,void 0,function*(){let Se=Ue;if(Ue.url?Se=(yield t.h(P.transformRequest(Ue.url,"Source"),oe)).data:yield i.frameAsync(oe),!Se)return null;const ke=t.M(t.e(Se,Ue),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Se&&Se.vector_layers&&(ke.vectorLayerIds=Se.vector_layers.map(Be=>Be.id)),ke})}class ie{constructor(P,oe){P&&(oe?this.setSouthWest(P).setNorthEast(oe):Array.isArray(P)&&(P.length===4?this.setSouthWest([P[0],P[1]]).setNorthEast([P[2],P[3]]):this.setSouthWest(P[0]).setNorthEast(P[1])))}setNorthEast(P){return this._ne=P instanceof t.N?new t.N(P.lng,P.lat):t.N.convert(P),this}setSouthWest(P){return this._sw=P instanceof t.N?new t.N(P.lng,P.lat):t.N.convert(P),this}extend(P){const oe=this._sw,Se=this._ne;let ke,Be;if(P instanceof t.N)ke=P,Be=P;else{if(!(P instanceof ie))return Array.isArray(P)?P.length===4||P.every(Array.isArray)?this.extend(ie.convert(P)):this.extend(t.N.convert(P)):P&&("lng"in P||"lon"in P)&&"lat"in P?this.extend(t.N.convert(P)):this;if(ke=P._sw,Be=P._ne,!ke||!Be)return this}return oe||Se?(oe.lng=Math.min(ke.lng,oe.lng),oe.lat=Math.min(ke.lat,oe.lat),Se.lng=Math.max(Be.lng,Se.lng),Se.lat=Math.max(Be.lat,Se.lat)):(this._sw=new t.N(ke.lng,ke.lat),this._ne=new t.N(Be.lng,Be.lat)),this}getCenter(){return new t.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(P){const{lng:oe,lat:Se}=t.N.convert(P);let ke=this._sw.lng<=oe&&oe<=this._ne.lng;return this._sw.lng>this._ne.lng&&(ke=this._sw.lng>=oe&&oe>=this._ne.lng),this._sw.lat<=Se&&Se<=this._ne.lat&&ke}static convert(P){return P instanceof ie?P:P&&new ie(P)}static fromLngLat(P,oe=0){const Se=360*oe/40075017,ke=Se/Math.cos(Math.PI/180*P.lat);return new ie(new t.N(P.lng-ke,P.lat-Se),new t.N(P.lng+ke,P.lat+Se))}adjustAntiMeridian(){const P=new t.N(this._sw.lng,this._sw.lat),oe=new t.N(this._ne.lng,this._ne.lat);return new ie(P,P.lng>oe.lng?new t.N(oe.lng+360,oe.lat):oe)}}class ve{constructor(P,oe,Se){this.bounds=ie.convert(this.validateBounds(P)),this.minzoom=oe||0,this.maxzoom=Se||24}validateBounds(P){return Array.isArray(P)&&P.length===4?[Math.max(-180,P[0]),Math.max(-90,P[1]),Math.min(180,P[2]),Math.min(90,P[3])]:[-180,-90,180,90]}contains(P){const oe=Math.pow(2,P.z),Se=Math.floor(t.O(this.bounds.getWest())*oe),ke=Math.floor(t.Q(this.bounds.getNorth())*oe),Be=Math.ceil(t.O(this.bounds.getEast())*oe),gt=Math.ceil(t.Q(this.bounds.getSouth())*oe);return P.x>=Se&&P.x=ke&&P.y{this._options.tiles=P}),this}setUrl(P){return this.setSourceProperty(()=>{this.url=P,this._options.url=P}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Se={request:this.map._requestManager.transformRequest(oe,"Tile"),uid:P.uid,tileID:P.tileID,zoom:P.tileID.overscaledZ,tileSize:this.tileSize*P.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Se.request.collectResourceTiming=this._collectResourceTiming;let ke="RT";if(P.actor&&P.state!=="expired"){if(P.state==="loading")return new Promise((Be,gt)=>{P.reloadPromise={resolve:Be,reject:gt}})}else P.actor=this.dispatcher.getActor(),ke="LT";P.abortController=new AbortController;try{const Be=yield P.actor.sendAsync({type:ke,data:Se},P.abortController);if(delete P.abortController,P.aborted)return;this._afterTileLoadWorkerResponse(P,Be)}catch(Be){if(delete P.abortController,P.aborted)return;if(Be&&Be.status!==404)throw Be;this._afterTileLoadWorkerResponse(P,null)}})}_afterTileLoadWorkerResponse(P,oe){if(oe&&oe.resourceTiming&&(P.resourceTiming=oe.resourceTiming),oe&&this.map._refreshExpiredTiles&&P.setExpiryData(oe),P.loadVectorData(oe,this.map.painter),P.reloadPromise){const Se=P.reloadPromise;P.reloadPromise=null,this.loadTile(P).then(Se.resolve).catch(Se.reject)}}abortTile(P){return t._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController),P.actor&&(yield P.actor.sendAsync({type:"AT",data:{uid:P.uid,type:this.type,source:this.id}}))})}unloadTile(P){return t._(this,void 0,void 0,function*(){P.unloadVectorData(),P.actor&&(yield P.actor.sendAsync({type:"RMT",data:{uid:P.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Ce extends t.E{constructor(P,oe,Se,ke){super(),this.id=P,this.dispatcher=Se,this.setEventedParent(ke),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.e({type:"raster"},oe),t.e(this,t.M(oe,["url","scheme","tileSize"]))}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const P=yield ae(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,P&&(t.e(this,P),P.bounds&&(this.tileBounds=new ve(P.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(P){this._tileJSONRequest=null,this.fire(new t.j(P))}})}loaded(){return this._loaded}onAdd(P){this.map=P,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(P){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),P(),this.load()}setTiles(P){return this.setSourceProperty(()=>{this._options.tiles=P}),this}setUrl(P){return this.setSourceProperty(()=>{this.url=P,this._options.url=P}),this}serialize(){return t.e({},this._options)}hasTile(P){return!this.tileBounds||this.tileBounds.contains(P.canonical)}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);P.abortController=new AbortController;try{const Se=yield l.getImage(this.map._requestManager.transformRequest(oe,"Tile"),P.abortController,this.map._refreshExpiredTiles);if(delete P.abortController,P.aborted)return void(P.state="unloaded");if(Se&&Se.data){this.map._refreshExpiredTiles&&Se.cacheControl&&Se.expires&&P.setExpiryData({cacheControl:Se.cacheControl,expires:Se.expires});const ke=this.map.painter.context,Be=ke.gl,gt=Se.data;P.texture=this.map.painter.getTileTexture(gt.width),P.texture?P.texture.update(gt,{useMipmap:!0}):(P.texture=new u(ke,gt,Be.RGBA,{useMipmap:!0}),P.texture.bind(Be.LINEAR,Be.CLAMP_TO_EDGE,Be.LINEAR_MIPMAP_NEAREST)),P.state="loaded"}}catch(Se){if(delete P.abortController,P.aborted)P.state="unloaded";else if(Se)throw P.state="errored",Se}})}abortTile(P){return t._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController)})}unloadTile(P){return t._(this,void 0,void 0,function*(){P.texture&&this.map.painter.saveTileTexture(P.texture)})}hasTransition(){return!1}}class Fe extends Ce{constructor(P,oe,Se,ke){super(P,oe,Se,ke),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},oe),this.encoding=oe.encoding||"mapbox",this.redFactor=oe.redFactor,this.greenFactor=oe.greenFactor,this.blueFactor=oe.blueFactor,this.baseShift=oe.baseShift}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Se=this.map._requestManager.transformRequest(oe,"Tile");P.neighboringTiles=this._getNeighboringTiles(P.tileID),P.abortController=new AbortController;try{const ke=yield l.getImage(Se,P.abortController,this.map._refreshExpiredTiles);if(delete P.abortController,P.aborted)return void(P.state="unloaded");if(ke&&ke.data){const Be=ke.data;this.map._refreshExpiredTiles&&ke.cacheControl&&ke.expires&&P.setExpiryData({cacheControl:ke.cacheControl,expires:ke.expires});const gt=t.b(Be)&&t.U()?Be:yield this.readImageNow(Be),kt={type:this.type,uid:P.uid,source:this.id,rawImageData:gt,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!P.actor||P.state==="expired"){P.actor=this.dispatcher.getActor();const Gt=yield P.actor.sendAsync({type:"LDT",data:kt});P.dem=Gt,P.needsHillshadePrepare=!0,P.needsTerrainPrepare=!0,P.state="loaded"}}}catch(ke){if(delete P.abortController,P.aborted)P.state="unloaded";else if(ke)throw P.state="errored",ke}})}readImageNow(P){return t._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&t.V()){const oe=P.width+2,Se=P.height+2;try{return new t.R({width:oe,height:Se},yield t.W(P,-1,-1,oe,Se))}catch{}}return i.getImageData(P,1)})}_getNeighboringTiles(P){const oe=P.canonical,Se=Math.pow(2,oe.z),ke=(oe.x-1+Se)%Se,Be=oe.x===0?P.wrap-1:P.wrap,gt=(oe.x+1+Se)%Se,kt=oe.x+1===Se?P.wrap+1:P.wrap,Gt={};return Gt[new t.S(P.overscaledZ,Be,oe.z,ke,oe.y).key]={backfilled:!1},Gt[new t.S(P.overscaledZ,kt,oe.z,gt,oe.y).key]={backfilled:!1},oe.y>0&&(Gt[new t.S(P.overscaledZ,Be,oe.z,ke,oe.y-1).key]={backfilled:!1},Gt[new t.S(P.overscaledZ,P.wrap,oe.z,oe.x,oe.y-1).key]={backfilled:!1},Gt[new t.S(P.overscaledZ,kt,oe.z,gt,oe.y-1).key]={backfilled:!1}),oe.y+10&&t.e(Be,{resourceTiming:ke}),this.fire(new t.k("data",Object.assign(Object.assign({},Be),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},Be),{sourceDataType:"content"})))}catch(Se){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(Se))}})}loaded(){return this._pendingLoads===0}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.actor?"RT":"LT";P.actor=this.actor;const Se={type:this.type,uid:P.uid,tileID:P.tileID,zoom:P.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};P.abortController=new AbortController;const ke=yield this.actor.sendAsync({type:oe,data:Se},P.abortController);delete P.abortController,P.unloadVectorData(),P.aborted||P.loadVectorData(ke,this.map.painter,oe==="RT")})}abortTile(P){return t._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController),P.aborted=!0})}unloadTile(P){return t._(this,void 0,void 0,function*(){P.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:P.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Ye=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class it extends t.E{constructor(P,oe,Se,ke){super(),this.id=P,this.dispatcher=Se,this.coordinates=oe.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(ke),this.options=oe}load(P){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const oe=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,oe&&oe.data&&(this.image=oe.data,P&&(this.coordinates=P),this._finishLoading())}catch(oe){this._request=null,this._loaded=!0,this.fire(new t.j(oe))}})}loaded(){return this._loaded}updateImage(P){return P.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=P.url,this.load(P.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(P){this.map=P,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(P){this.coordinates=P;const oe=P.map(t.Z.fromLngLat);this.tileID=(function(ke){let Be=1/0,gt=1/0,kt=-1/0,Gt=-1/0;for(const Qr of ke)Be=Math.min(Be,Qr.x),gt=Math.min(gt,Qr.y),kt=Math.max(kt,Qr.x),Gt=Math.max(Gt,Qr.y);const cr=Math.max(kt-Be,Gt-gt),Ar=Math.max(0,Math.floor(-Math.log(cr)/Math.LN2)),Cr=Math.pow(2,Ar);return new t.a1(Ar,Math.floor((Be+kt)/2*Cr),Math.floor((gt+Gt)/2*Cr))})(oe),this.minzoom=this.maxzoom=this.tileID.z;const Se=oe.map(ke=>this.tileID.getTilePoint(ke)._round());return this._boundsArray=new t.$,this._boundsArray.emplaceBack(Se[0].x,Se[0].y,0,0),this._boundsArray.emplaceBack(Se[1].x,Se[1].y,t.X,0),this._boundsArray.emplaceBack(Se[3].x,Se[3].y,0,t.X),this._boundsArray.emplaceBack(Se[2].x,Se[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const P=this.map.painter.context,oe=P.gl;this.boundsBuffer||(this.boundsBuffer=P.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u(P,this.image,oe.RGBA),this.texture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE));let Se=!1;for(const ke in this.tiles){const Be=this.tiles[ke];Be.state!=="loaded"&&(Be.state="loaded",Be.texture=this.texture,Se=!0)}Se&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(P){return t._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(P.tileID.canonical)?(this.tiles[String(P.tileID.wrap)]=P,P.buckets={}):P.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class st extends it{constructor(P,oe,Se,ke){super(P,oe,Se,ke),this.roundZoom=!0,this.type="video",this.options=oe}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1;const P=this.options;this.urls=[];for(const oe of P.urls)this.urls.push(this.map._requestManager.transformRequest(oe,"Source").url);try{const oe=yield t.a3(this.urls);if(this._loaded=!0,!oe)return;this.video=oe,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(oe){this.fire(new t.j(oe))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(P){if(this.video){const oe=this.video.seekable;Poe.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${oe.start(0)} and ${oe.end(0)}-second mark.`))):this.video.currentTime=P}}getVideo(){return this.video}onAdd(P){this.map||(this.map=P,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const P=this.map.painter.context,oe=P.gl;this.boundsBuffer||(this.boundsBuffer=P.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE),oe.texSubImage2D(oe.TEXTURE_2D,0,0,0,oe.RGBA,oe.UNSIGNED_BYTE,this.video)):(this.texture=new u(P,this.video,oe.RGBA),this.texture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE));let Se=!1;for(const ke in this.tiles){const Be=this.tiles[ke];Be.state!=="loaded"&&(Be.state="loaded",Be.texture=this.texture,Se=!0)}Se&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class nt extends it{constructor(P,oe,Se,ke){super(P,oe,Se,ke),oe.coordinates?Array.isArray(oe.coordinates)&&oe.coordinates.length===4&&!oe.coordinates.some(Be=>!Array.isArray(Be)||Be.length!==2||Be.some(gt=>typeof gt!="number"))||this.fire(new t.j(new t.a2(`sources.${P}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${P}`,null,'missing required property "coordinates"'))),oe.animate&&typeof oe.animate!="boolean"&&this.fire(new t.j(new t.a2(`sources.${P}`,null,'optional "animate" property must be a boolean value'))),oe.canvas?typeof oe.canvas=="string"||oe.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${P}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.j(new t.a2(`sources.${P}`,null,'missing required property "canvas"'))),this.options=oe,this.animate=oe.animate===void 0||oe.animate}load(){return t._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(P){this.map=P,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let P=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,P=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,P=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const oe=this.map.painter.context,Se=oe.gl;this.boundsBuffer||(this.boundsBuffer=oe.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(P||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u(oe,this.canvas,Se.RGBA,{premultiply:!0});let ke=!1;for(const Be in this.tiles){const gt=this.tiles[Be];gt.state!=="loaded"&&(gt.state="loaded",gt.texture=this.texture,ke=!0)}ke&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const P of[this.canvas.width,this.canvas.height])if(isNaN(P)||P<=0)return!0;return!1}}const Qe={},Le=Ue=>{switch(Ue){case"geojson":return ze;case"image":return it;case"raster":return Ce;case"raster-dem":return Fe;case"vector":return Ae;case"video":return st;case"canvas":return nt}return Qe[Ue]},Te="RTLPluginLoaded";class pe extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=K()}_syncState(P){return this.status=P,this.dispatcher.broadcast("SRPS",{pluginStatus:P,pluginURL:this.url}).catch(oe=>{throw this.status="error",oe})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(P){return t._(this,arguments,void 0,function*(oe,Se=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=i.resolveURL(oe),!this.url)throw new Error(`requested url ${oe} is invalid`);if(this.status==="unavailable"){if(!Se)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return t._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.k(Te))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Ne=null;function ot(){return Ne||(Ne=new pe),Ne}class ft{constructor(P,oe){this.timeAdded=0,this.fadeEndTime=0,this.tileID=P,this.uid=t.a4(),this.uses=0,this.tileSize=oe,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(P){const oe=P+this.timeAdded;oeBe.getLayer(cr)).filter(Boolean);if(Gt.length!==0){kt.layers=Gt,kt.stateDependentLayerIds&&(kt.stateDependentLayers=kt.stateDependentLayerIds.map(cr=>Gt.filter(Ar=>Ar.id===cr)[0]));for(const cr of Gt)gt[cr.id]=kt}}return gt})(P.buckets,oe.style),this.hasSymbolBuckets=!1;for(const ke in this.buckets){const Be=this.buckets[ke];if(Be instanceof t.a6){if(this.hasSymbolBuckets=!0,!Se)break;Be.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const ke in this.buckets){const Be=this.buckets[ke];if(Be instanceof t.a6&&Be.hasRTLText){this.hasRTLText=!0,ot().lazyLoad();break}}this.queryPadding=0;for(const ke in this.buckets){const Be=this.buckets[ke];this.queryPadding=Math.max(this.queryPadding,oe.style.getLayer(ke).queryRadius(Be))}P.imageAtlas&&(this.imageAtlas=P.imageAtlas),P.glyphAtlasImage&&(this.glyphAtlasImage=P.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(const P in this.buckets)this.buckets[P].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(P){return this.buckets[P.id]}upload(P){for(const Se in this.buckets){const ke=this.buckets[Se];ke.uploadPending()&&ke.upload(P)}const oe=P.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u(P,this.imageAtlas.image,oe.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u(P,this.glyphAtlasImage,oe.ALPHA),this.glyphAtlasImage=null)}prepare(P){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(P,this.imageAtlasTexture)}queryRenderedFeatures(P,oe,Se,ke,Be,gt,kt,Gt,cr,Ar){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:ke,cameraQueryGeometry:Be,scale:gt,tileSize:this.tileSize,pixelPosMatrix:Ar,transform:Gt,params:kt,queryPadding:this.queryPadding*cr},P,oe,Se):{}}querySourceFeatures(P,oe){const Se=this.latestFeatureIndex;if(!Se||!Se.rawTileData)return;const ke=Se.loadVTLayers(),Be=oe&&oe.sourceLayer?oe.sourceLayer:"",gt=ke._geojsonTileLayer||ke[Be];if(!gt)return;const kt=t.a7(oe&&oe.filter),{z:Gt,x:cr,y:Ar}=this.tileID.canonical,Cr={z:Gt,x:cr,y:Ar};for(let Qr=0;QrSe)ke=!1;else if(oe)if(this.expirationTime{this.remove(P,Be)},Se)),this.data[ke].push(Be),this.order.push(ke),this.order.length>this.max){const gt=this._getAndRemoveByKey(this.order[0]);gt&&this.onRemove(gt)}return this}has(P){return P.wrapped().key in this.data}getAndRemove(P){return this.has(P)?this._getAndRemoveByKey(P.wrapped().key):null}_getAndRemoveByKey(P){const oe=this.data[P].shift();return oe.timeout&&clearTimeout(oe.timeout),this.data[P].length===0&&delete this.data[P],this.order.splice(this.order.indexOf(P),1),oe.value}getByKey(P){const oe=this.data[P];return oe?oe[0].value:null}get(P){return this.has(P)?this.data[P.wrapped().key][0].value:null}remove(P,oe){if(!this.has(P))return this;const Se=P.wrapped().key,ke=oe===void 0?0:this.data[Se].indexOf(oe),Be=this.data[Se][ke];return this.data[Se].splice(ke,1),Be.timeout&&clearTimeout(Be.timeout),this.data[Se].length===0&&delete this.data[Se],this.onRemove(Be.value),this.order.splice(this.order.indexOf(Se),1),this}setMaxSize(P){for(this.max=P;this.order.length>this.max;){const oe=this._getAndRemoveByKey(this.order[0]);oe&&this.onRemove(oe)}return this}filter(P){const oe=[];for(const Se in this.data)for(const ke of this.data[Se])P(ke.value)||oe.push(ke);for(const Se of oe)this.remove(Se.value.tileID,Se)}}class Ft{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(P,oe,Se){const ke=String(oe);if(this.stateChanges[P]=this.stateChanges[P]||{},this.stateChanges[P][ke]=this.stateChanges[P][ke]||{},t.e(this.stateChanges[P][ke],Se),this.deletedStates[P]===null){this.deletedStates[P]={};for(const Be in this.state[P])Be!==ke&&(this.deletedStates[P][Be]=null)}else if(this.deletedStates[P]&&this.deletedStates[P][ke]===null){this.deletedStates[P][ke]={};for(const Be in this.state[P][ke])Se[Be]||(this.deletedStates[P][ke][Be]=null)}else for(const Be in Se)this.deletedStates[P]&&this.deletedStates[P][ke]&&this.deletedStates[P][ke][Be]===null&&delete this.deletedStates[P][ke][Be]}removeFeatureState(P,oe,Se){if(this.deletedStates[P]===null)return;const ke=String(oe);if(this.deletedStates[P]=this.deletedStates[P]||{},Se&&oe!==void 0)this.deletedStates[P][ke]!==null&&(this.deletedStates[P][ke]=this.deletedStates[P][ke]||{},this.deletedStates[P][ke][Se]=null);else if(oe!==void 0)if(this.stateChanges[P]&&this.stateChanges[P][ke])for(Se in this.deletedStates[P][ke]={},this.stateChanges[P][ke])this.deletedStates[P][ke][Se]=null;else this.deletedStates[P][ke]=null;else this.deletedStates[P]=null}getState(P,oe){const Se=String(oe),ke=t.e({},(this.state[P]||{})[Se],(this.stateChanges[P]||{})[Se]);if(this.deletedStates[P]===null)return{};if(this.deletedStates[P]){const Be=this.deletedStates[P][oe];if(Be===null)return{};for(const gt in Be)delete ke[gt]}return ke}initializeTileState(P,oe){P.setFeatureState(this.state,oe)}coalesceChanges(P,oe){const Se={};for(const ke in this.stateChanges){this.state[ke]=this.state[ke]||{};const Be={};for(const gt in this.stateChanges[ke])this.state[ke][gt]||(this.state[ke][gt]={}),t.e(this.state[ke][gt],this.stateChanges[ke][gt]),Be[gt]=this.state[ke][gt];Se[ke]=Be}for(const ke in this.deletedStates){this.state[ke]=this.state[ke]||{};const Be={};if(this.deletedStates[ke]===null)for(const gt in this.state[ke])Be[gt]={},this.state[ke][gt]={};else for(const gt in this.deletedStates[ke]){if(this.deletedStates[ke][gt]===null)this.state[ke][gt]={};else for(const kt of Object.keys(this.deletedStates[ke][gt]))delete this.state[ke][gt][kt];Be[gt]=this.state[ke][gt]}Se[ke]=Se[ke]||{},t.e(Se[ke],Be)}if(this.stateChanges={},this.deletedStates={},Object.keys(Se).length!==0)for(const ke in P)P[ke].setFeatureState(Se,oe)}}class Nt extends t.E{constructor(P,oe,Se){super(),this.id=P,this.dispatcher=Se,this.on("data",ke=>this._dataHandler(ke)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((ke,Be,gt,kt)=>{const Gt=new(Le(Be.type))(ke,Be,gt,kt);if(Gt.id!==ke)throw new Error(`Expected Source id to be ${ke} instead of ${Gt.id}`);return Gt})(P,oe,Se,this),this._tiles={},this._cache=new rt(0,ke=>this._unloadTile(ke)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ft,this._didEmitContent=!1,this._updated=!1}onAdd(P){this.map=P,this._maxTileCacheSize=P?P._maxTileCacheSize:null,this._maxTileCacheZoomLevels=P?P._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(P)}onRemove(P){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(P)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const P in this._tiles){const oe=this._tiles[P];if(oe.state!=="loaded"&&oe.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const P=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,P&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(P,oe,Se){return t._(this,void 0,void 0,function*(){try{yield this._source.loadTile(P),this._tileLoaded(P,oe,Se)}catch(ke){P.state="errored",ke.status!==404?this._source.fire(new t.j(ke,{tile:P})):this.update(this.transform,this.terrain)}})}_unloadTile(P){this._source.unloadTile&&this._source.unloadTile(P)}_abortTile(P){this._source.abortTile&&this._source.abortTile(P),this._source.fire(new t.k("dataabort",{tile:P,coord:P.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(P){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const oe in this._tiles){const Se=this._tiles[oe];Se.upload(P),Se.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(P=>P.tileID).sort($t).map(P=>P.key)}getRenderableIds(P){const oe=[];for(const Se in this._tiles)this._isIdRenderable(Se,P)&&oe.push(this._tiles[Se]);return P?oe.sort((Se,ke)=>{const Be=Se.tileID,gt=ke.tileID,kt=new t.P(Be.canonical.x,Be.canonical.y)._rotate(this.transform.angle),Gt=new t.P(gt.canonical.x,gt.canonical.y)._rotate(this.transform.angle);return Be.overscaledZ-gt.overscaledZ||Gt.y-kt.y||Gt.x-kt.x}).map(Se=>Se.tileID.key):oe.map(Se=>Se.tileID).sort($t).map(Se=>Se.key)}hasRenderableParent(P){const oe=this.findLoadedParent(P,0);return!!oe&&this._isIdRenderable(oe.tileID.key)}_isIdRenderable(P,oe){return this._tiles[P]&&this._tiles[P].hasData()&&!this._coveredTiles[P]&&(oe||!this._tiles[P].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const P in this._tiles)this._tiles[P].state!=="errored"&&this._reloadTile(P,"reloading")}}_reloadTile(P,oe){return t._(this,void 0,void 0,function*(){const Se=this._tiles[P];Se&&(Se.state!=="loading"&&(Se.state=oe),yield this._loadTile(Se,P,oe))})}_tileLoaded(P,oe,Se){P.timeAdded=i.now(),Se==="expired"&&(P.refreshedUponExpiration=!0),this._setTileReloadTimer(oe,P),this.getSource().type==="raster-dem"&&P.dem&&this._backfillDEM(P),this._state.initializeTileState(P,this.map?this.map.painter:null),P.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:P,coord:P.tileID}))}_backfillDEM(P){const oe=this.getRenderableIds();for(let ke=0;ke1||(Math.abs(gt)>1&&(Math.abs(gt+Gt)===1?gt+=Gt:Math.abs(gt-Gt)===1&&(gt-=Gt)),Be.dem&&ke.dem&&(ke.dem.backfillBorder(Be.dem,gt,kt),ke.neighboringTiles&&ke.neighboringTiles[cr]&&(ke.neighboringTiles[cr].backfilled=!0)))}}getTile(P){return this.getTileByID(P.key)}getTileByID(P){return this._tiles[P]}_retainLoadedChildren(P,oe,Se,ke){for(const Be in this._tiles){let gt=this._tiles[Be];if(ke[Be]||!gt.hasData()||gt.tileID.overscaledZ<=oe||gt.tileID.overscaledZ>Se)continue;let kt=gt.tileID;for(;gt&>.tileID.overscaledZ>oe+1;){const cr=gt.tileID.scaledTo(gt.tileID.overscaledZ-1);gt=this._tiles[cr.key],gt&>.hasData()&&(kt=cr)}let Gt=kt;for(;Gt.overscaledZ>oe;)if(Gt=Gt.scaledTo(Gt.overscaledZ-1),P[Gt.key]){ke[kt.key]=kt;break}}}findLoadedParent(P,oe){if(P.key in this._loadedParentTiles){const Se=this._loadedParentTiles[P.key];return Se&&Se.tileID.overscaledZ>=oe?Se:null}for(let Se=P.overscaledZ-1;Se>=oe;Se--){const ke=P.scaledTo(Se),Be=this._getLoadedTile(ke);if(Be)return Be}}findLoadedSibling(P){return this._getLoadedTile(P)}_getLoadedTile(P){const oe=this._tiles[P.key];return oe&&oe.hasData()?oe:this._cache.getByKey(P.wrapped().key)}updateCacheSize(P){const oe=Math.ceil(P.width/this._source.tileSize)+1,Se=Math.ceil(P.height/this._source.tileSize)+1,ke=Math.floor(oe*Se*(this._maxTileCacheZoomLevels===null?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Be=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,ke):ke;this._cache.setMaxSize(Be)}handleWrapJump(P){const oe=Math.round((P-(this._prevLng===void 0?P:this._prevLng))/360);if(this._prevLng=P,oe){const Se={};for(const ke in this._tiles){const Be=this._tiles[ke];Be.tileID=Be.tileID.unwrapTo(Be.tileID.wrap+oe),Se[Be.tileID.key]=Be}this._tiles=Se;for(const ke in this._timers)clearTimeout(this._timers[ke]),delete this._timers[ke];for(const ke in this._tiles)this._setTileReloadTimer(ke,this._tiles[ke])}}_updateCoveredAndRetainedTiles(P,oe,Se,ke,Be,gt){const kt={},Gt={},cr=Object.keys(P),Ar=i.now();for(const Cr of cr){const Qr=P[Cr],_n=this._tiles[Cr];if(!_n||_n.fadeEndTime!==0&&_n.fadeEndTime<=Ar)continue;const Ze=this.findLoadedParent(Qr,oe),et=this.findLoadedSibling(Qr),ht=Ze||et||null;ht&&(this._addTile(ht.tileID),kt[ht.tileID.key]=ht.tileID),Gt[Cr]=Qr}this._retainLoadedChildren(Gt,ke,Se,P);for(const Cr in kt)P[Cr]||(this._coveredTiles[Cr]=!0,P[Cr]=kt[Cr]);if(gt){const Cr={},Qr={};for(const _n of Be)this._tiles[_n.key].hasData()?Cr[_n.key]=_n:Qr[_n.key]=_n;for(const _n in Qr){const Ze=Qr[_n].children(this._source.maxzoom);this._tiles[Ze[0].key]&&this._tiles[Ze[1].key]&&this._tiles[Ze[2].key]&&this._tiles[Ze[3].key]&&(Cr[Ze[0].key]=P[Ze[0].key]=Ze[0],Cr[Ze[1].key]=P[Ze[1].key]=Ze[1],Cr[Ze[2].key]=P[Ze[2].key]=Ze[2],Cr[Ze[3].key]=P[Ze[3].key]=Ze[3],delete Qr[_n])}for(const _n in Qr){const Ze=Qr[_n],et=this.findLoadedParent(Ze,this._source.minzoom),ht=this.findLoadedSibling(Ze),_t=et||ht||null;if(_t){Cr[_t.tileID.key]=P[_t.tileID.key]=_t.tileID;for(const zt in Cr)Cr[zt].isChildOf(_t.tileID)&&delete Cr[zt]}}for(const _n in this._tiles)Cr[_n]||(this._coveredTiles[_n]=!0)}}update(P,oe){if(!this._sourceLoaded||this._paused)return;let Se;this.transform=P,this.terrain=oe,this.updateCacheSize(P),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Se=P.getVisibleUnwrappedCoordinates(this._source.tileID).map(Ar=>new t.S(Ar.canonical.z,Ar.wrap,Ar.canonical.z,Ar.canonical.x,Ar.canonical.y)):(Se=P.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:oe}),this._source.hasTile&&(Se=Se.filter(Ar=>this._source.hasTile(Ar)))):Se=[];const ke=P.coveringZoomLevel(this._source),Be=Math.max(ke-Nt.maxOverzooming,this._source.minzoom),gt=Math.max(ke+Nt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const Ar={};for(const Cr of Se)if(Cr.canonical.z>this._source.minzoom){const Qr=Cr.scaledTo(Cr.canonical.z-1);Ar[Qr.key]=Qr;const _n=Cr.scaledTo(Math.max(this._source.minzoom,Math.min(Cr.canonical.z,5)));Ar[_n.key]=_n}Se=Se.concat(Object.values(Ar))}const kt=Se.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,kt&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const Gt=this._updateRetainedTiles(Se,ke);rr(this._source.type)&&this._updateCoveredAndRetainedTiles(Gt,Be,gt,ke,Se,oe);for(const Ar in Gt)this._tiles[Ar].clearFadeHold();const cr=t.ab(this._tiles,Gt);for(const Ar of cr){const Cr=this._tiles[Ar];Cr.hasSymbolBuckets&&!Cr.holdingForFade()?Cr.setHoldDuration(this.map._fadeDuration):Cr.hasSymbolBuckets&&!Cr.symbolFadeFinished()||this._removeTile(Ar)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const P in this._tiles)this._tiles[P].holdingForFade()&&this._removeTile(P)}_updateRetainedTiles(P,oe){var Se;const ke={},Be={},gt=Math.max(oe-Nt.maxOverzooming,this._source.minzoom),kt=Math.max(oe+Nt.maxUnderzooming,this._source.minzoom),Gt={};for(const cr of P){const Ar=this._addTile(cr);ke[cr.key]=cr,Ar.hasData()||oethis._source.maxzoom){const Qr=cr.children(this._source.maxzoom)[0],_n=this.getTile(Qr);if(_n&&_n.hasData()){ke[Qr.key]=Qr;continue}}else{const Qr=cr.children(this._source.maxzoom);if(ke[Qr[0].key]&&ke[Qr[1].key]&&ke[Qr[2].key]&&ke[Qr[3].key])continue}let Cr=Ar.wasRequested();for(let Qr=cr.overscaledZ-1;Qr>=gt;--Qr){const _n=cr.scaledTo(Qr);if(Be[_n.key])break;if(Be[_n.key]=!0,Ar=this.getTile(_n),!Ar&&Cr&&(Ar=this._addTile(_n)),Ar){const Ze=Ar.hasData();if((Ze||!(!((Se=this.map)===null||Se===void 0)&&Se.cancelPendingTileRequestsWhileZooming)||Cr)&&(ke[_n.key]=_n),Cr=Ar.wasRequested(),Ze)break}}}return ke}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const P in this._tiles){const oe=[];let Se,ke=this._tiles[P].tileID;for(;ke.overscaledZ>0;){if(ke.key in this._loadedParentTiles){Se=this._loadedParentTiles[ke.key];break}oe.push(ke.key);const Be=ke.scaledTo(ke.overscaledZ-1);if(Se=this._getLoadedTile(Be),Se)break;ke=Be}for(const Be of oe)this._loadedParentTiles[Be]=Se}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const P in this._tiles){const oe=this._tiles[P].tileID,Se=this._getLoadedTile(oe);this._loadedSiblingTiles[oe.key]=Se}}_addTile(P){let oe=this._tiles[P.key];if(oe)return oe;oe=this._cache.getAndRemove(P),oe&&(this._setTileReloadTimer(P.key,oe),oe.tileID=P,this._state.initializeTileState(oe,this.map?this.map.painter:null),this._cacheTimers[P.key]&&(clearTimeout(this._cacheTimers[P.key]),delete this._cacheTimers[P.key],this._setTileReloadTimer(P.key,oe)));const Se=oe;return oe||(oe=new ft(P,this._source.tileSize*P.overscaleFactor()),this._loadTile(oe,P.key,oe.state)),oe.uses++,this._tiles[P.key]=oe,Se||this._source.fire(new t.k("dataloading",{tile:oe,coord:oe.tileID,dataType:"source"})),oe}_setTileReloadTimer(P,oe){P in this._timers&&(clearTimeout(this._timers[P]),delete this._timers[P]);const Se=oe.getExpiryTimeout();Se&&(this._timers[P]=setTimeout(()=>{this._reloadTile(P,"expired"),delete this._timers[P]},Se))}_removeTile(P){const oe=this._tiles[P];oe&&(oe.uses--,delete this._tiles[P],this._timers[P]&&(clearTimeout(this._timers[P]),delete this._timers[P]),oe.uses>0||(oe.hasData()&&oe.state!=="reloading"?this._cache.add(oe.tileID,oe,oe.getExpiryTimeout()):(oe.aborted=!0,this._abortTile(oe),this._unloadTile(oe))))}_dataHandler(P){const oe=P.sourceDataType;P.dataType==="source"&&oe==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&P.dataType==="source"&&oe==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const P in this._tiles)this._removeTile(P);this._cache.reset()}tilesIn(P,oe,Se){const ke=[],Be=this.transform;if(!Be)return ke;const gt=Se?Be.getCameraQueryGeometry(P):P,kt=P.map(Ze=>Be.pointCoordinate(Ze,this.terrain)),Gt=gt.map(Ze=>Be.pointCoordinate(Ze,this.terrain)),cr=this.getIds();let Ar=1/0,Cr=1/0,Qr=-1/0,_n=-1/0;for(const Ze of Gt)Ar=Math.min(Ar,Ze.x),Cr=Math.min(Cr,Ze.y),Qr=Math.max(Qr,Ze.x),_n=Math.max(_n,Ze.y);for(let Ze=0;Ze=0&&Et[1].y+zt>=0){const Ut=kt.map(Tr=>ht.getTilePoint(Tr)),mr=Gt.map(Tr=>ht.getTilePoint(Tr));ke.push({tile:et,tileID:ht,queryGeometry:Ut,cameraQueryGeometry:mr,scale:_t})}}return ke}getVisibleCoordinates(P){const oe=this.getRenderableIds(P).map(Se=>this._tiles[Se].tileID);for(const Se of oe)Se.posMatrix=this.transform.calculatePosMatrix(Se.toUnwrapped());return oe}hasTransition(){if(this._source.hasTransition())return!0;if(rr(this._source.type)){const P=i.now();for(const oe in this._tiles)if(this._tiles[oe].fadeEndTime>=P)return!0}return!1}setFeatureState(P,oe,Se){this._state.updateState(P=P||"_geojsonTileLayer",oe,Se)}removeFeatureState(P,oe,Se){this._state.removeFeatureState(P=P||"_geojsonTileLayer",oe,Se)}getFeatureState(P,oe){return this._state.getState(P=P||"_geojsonTileLayer",oe)}setDependencies(P,oe,Se){const ke=this._tiles[P];ke&&ke.setDependencies(oe,Se)}reloadTilesForDependencies(P,oe){for(const Se in this._tiles)this._tiles[Se].hasDependency(P,oe)&&this._reloadTile(Se,"reloading");this._cache.filter(Se=>!Se.hasDependency(P,oe))}}function $t(Ue,P){const oe=Math.abs(2*Ue.wrap)-+(Ue.wrap<0),Se=Math.abs(2*P.wrap)-+(P.wrap<0);return Ue.overscaledZ-P.overscaledZ||Se-oe||P.canonical.y-Ue.canonical.y||P.canonical.x-Ue.canonical.x}function rr(Ue){return Ue==="raster"||Ue==="image"||Ue==="video"}Nt.maxOverzooming=10,Nt.maxUnderzooming=3;class Er{constructor(P,oe){this.reset(P,oe)}reset(P,oe){this.points=P||[],this._distances=[0];for(let Se=1;Se0?(ke-gt)/kt:0;return this.points[Be].mult(1-Gt).add(this.points[oe].mult(Gt))}}function Mr(Ue,P){let oe=!0;return Ue==="always"||Ue!=="never"&&P!=="never"||(oe=!1),oe}class Wr{constructor(P,oe,Se){const ke=this.boxCells=[],Be=this.circleCells=[];this.xCellCount=Math.ceil(P/Se),this.yCellCount=Math.ceil(oe/Se);for(let gt=0;gtthis.width||ke<0||oe>this.height)return[];const Gt=[];if(P<=0&&oe<=0&&this.width<=Se&&this.height<=ke){if(Be)return[{key:null,x1:P,y1:oe,x2:Se,y2:ke}];for(let cr=0;cr0}hitTestCircle(P,oe,Se,ke,Be){const gt=P-Se,kt=P+Se,Gt=oe-Se,cr=oe+Se;if(kt<0||gt>this.width||cr<0||Gt>this.height)return!1;const Ar=[];return this._forEachCell(gt,Gt,kt,cr,this._queryCellCircle,Ar,{hitTest:!0,overlapMode:ke,circle:{x:P,y:oe,radius:Se},seenUids:{box:{},circle:{}}},Be),Ar.length>0}_queryCell(P,oe,Se,ke,Be,gt,kt,Gt){const{seenUids:cr,hitTest:Ar,overlapMode:Cr}=kt,Qr=this.boxCells[Be];if(Qr!==null){const Ze=this.bboxes;for(const et of Qr)if(!cr.box[et]){cr.box[et]=!0;const ht=4*et,_t=this.boxKeys[et];if(P<=Ze[ht+2]&&oe<=Ze[ht+3]&&Se>=Ze[ht+0]&&ke>=Ze[ht+1]&&(!Gt||Gt(_t))&&(!Ar||!Mr(Cr,_t.overlapMode))&&(gt.push({key:_t,x1:Ze[ht],y1:Ze[ht+1],x2:Ze[ht+2],y2:Ze[ht+3]}),Ar))return!0}}const _n=this.circleCells[Be];if(_n!==null){const Ze=this.circles;for(const et of _n)if(!cr.circle[et]){cr.circle[et]=!0;const ht=3*et,_t=this.circleKeys[et];if(this._circleAndRectCollide(Ze[ht],Ze[ht+1],Ze[ht+2],P,oe,Se,ke)&&(!Gt||Gt(_t))&&(!Ar||!Mr(Cr,_t.overlapMode))){const zt=Ze[ht],Et=Ze[ht+1],Ut=Ze[ht+2];if(gt.push({key:_t,x1:zt-Ut,y1:Et-Ut,x2:zt+Ut,y2:Et+Ut}),Ar)return!0}}}return!1}_queryCellCircle(P,oe,Se,ke,Be,gt,kt,Gt){const{circle:cr,seenUids:Ar,overlapMode:Cr}=kt,Qr=this.boxCells[Be];if(Qr!==null){const Ze=this.bboxes;for(const et of Qr)if(!Ar.box[et]){Ar.box[et]=!0;const ht=4*et,_t=this.boxKeys[et];if(this._circleAndRectCollide(cr.x,cr.y,cr.radius,Ze[ht+0],Ze[ht+1],Ze[ht+2],Ze[ht+3])&&(!Gt||Gt(_t))&&!Mr(Cr,_t.overlapMode))return gt.push(!0),!0}}const _n=this.circleCells[Be];if(_n!==null){const Ze=this.circles;for(const et of _n)if(!Ar.circle[et]){Ar.circle[et]=!0;const ht=3*et,_t=this.circleKeys[et];if(this._circlesCollide(Ze[ht],Ze[ht+1],Ze[ht+2],cr.x,cr.y,cr.radius)&&(!Gt||Gt(_t))&&!Mr(Cr,_t.overlapMode))return gt.push(!0),!0}}}_forEachCell(P,oe,Se,ke,Be,gt,kt,Gt){const cr=this._convertToXCellCoord(P),Ar=this._convertToYCellCoord(oe),Cr=this._convertToXCellCoord(Se),Qr=this._convertToYCellCoord(ke);for(let _n=cr;_n<=Cr;_n++)for(let Ze=Ar;Ze<=Qr;Ze++)if(Be.call(this,P,oe,Se,ke,this.xCellCount*Ze+_n,gt,kt,Gt))return}_convertToXCellCoord(P){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(P*this.xScale)))}_convertToYCellCoord(P){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(P*this.yScale)))}_circlesCollide(P,oe,Se,ke,Be,gt){const kt=ke-P,Gt=Be-oe,cr=Se+gt;return cr*cr>kt*kt+Gt*Gt}_circleAndRectCollide(P,oe,Se,ke,Be,gt,kt){const Gt=(gt-ke)/2,cr=Math.abs(P-(ke+Gt));if(cr>Gt+Se)return!1;const Ar=(kt-Be)/2,Cr=Math.abs(oe-(Be+Ar));if(Cr>Ar+Se)return!1;if(cr<=Gt||Cr<=Ar)return!0;const Qr=cr-Gt,_n=Cr-Ar;return Qr*Qr+_n*_n<=Se*Se}}function Sr(Ue,P,oe,Se,ke){const Be=t.H();return P?(t.K(Be,Be,[1/ke,1/ke,1]),oe||t.ad(Be,Be,Se.angle)):t.L(Be,Se.labelPlaneMatrix,Ue),Be}function Br(Ue,P,oe,Se,ke){if(P){const Be=t.ae(Ue);return t.K(Be,Be,[ke,ke,1]),oe||t.ad(Be,Be,-Se.angle),Be}return Se.glCoordMatrix}function Mt(Ue,P,oe,Se){let ke;Se?(ke=[Ue,P,Se(Ue,P),1],t.af(ke,ke,oe)):(ke=[Ue,P,0,1],hr(ke,ke,oe));const Be=ke[3];return{point:new t.P(ke[0]/Be,ke[1]/Be),signedDistanceFromCamera:Be,isOccluded:!1}}function je(Ue,P){return .5+Ue/P*.5}function $e(Ue,P){return Ue.x>=-P[0]&&Ue.x<=P[0]&&Ue.y>=-P[1]&&Ue.y<=P[1]}function Ee(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Ar,Cr,Qr,_n,Ze){const et=Se?Ue.textSizeData:Ue.iconSizeData,ht=t.ag(et,oe.transform.zoom),_t=[256/oe.width*2+1,256/oe.height*2+1],zt=Se?Ue.text.dynamicLayoutVertexArray:Ue.icon.dynamicLayoutVertexArray;zt.clear();const Et=Ue.lineVertexArray,Ut=Se?Ue.text.placedSymbolArray:Ue.icon.placedSymbolArray,mr=oe.transform.width/oe.transform.height;let Tr=!1;for(let Lr=0;LrMath.abs(oe.x-P.x)*Se?{useVertical:!0}:(Ue===t.ah.vertical?P.yoe.x)?{needsFlipping:!0}:null}function Me(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Ar){const Cr=oe/24,Qr=P.lineOffsetX*Cr,_n=P.lineOffsetY*Cr;let Ze;if(P.numGlyphs>1){const et=P.glyphStartIndex+P.numGlyphs,ht=P.lineStartIndex,_t=P.lineStartIndex+P.lineLength,zt=xe(Cr,kt,Qr,_n,Se,P,Ar,Ue);if(!zt)return{notEnoughRoom:!0};const Et=Mt(zt.first.point.x,zt.first.point.y,gt,Ue.getElevation).point,Ut=Mt(zt.last.point.x,zt.last.point.y,gt,Ue.getElevation).point;if(ke&&!Se){const mr=ye(P.writingMode,Et,Ut,cr);if(mr)return mr}Ze=[zt.first];for(let mr=P.glyphStartIndex+1;mr0?Et.point:(function(Tr,Lr,Gr,on,Mn,Pn){return Xe(Tr,Lr,Gr,1,Mn,Pn)})(Ue.tileAnchorPoint,zt,ht,0,Be,Ue),mr=ye(P.writingMode,ht,Ut,cr);if(mr)return mr}const et=Wt(Cr*kt.getoffsetX(P.glyphStartIndex),Qr,_n,Se,P.segment,P.lineStartIndex,P.lineStartIndex+P.lineLength,Ue,Ar);if(!et||Ue.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};Ze=[et]}for(const et of Ze)t.aj(Gt,et.point,et.angle);return{}}function Xe(Ue,P,oe,Se,ke,Be){const gt=Ue.add(Ue.sub(P)._unit()),kt=ke!==void 0?Mt(gt.x,gt.y,ke,Be.getElevation).point:Lt(gt.x,gt.y,Be).point,Gt=oe.sub(kt);return oe.add(Gt._mult(Se/Gt.mag()))}function Je(Ue,P,oe){const Se=P.projectionCache;if(Se.projections[Ue])return Se.projections[Ue];const ke=new t.P(P.lineVertexArray.getx(Ue),P.lineVertexArray.gety(Ue)),Be=Lt(ke.x,ke.y,P);if(Be.signedDistanceFromCamera>0)return Se.projections[Ue]=Be.point,Se.anyProjectionOccluded=Se.anyProjectionOccluded||Be.isOccluded,Be.point;const gt=Ue-oe.direction;return(function(kt,Gt,cr,Ar,Cr){return Xe(kt,Gt,cr,Ar,void 0,Cr)})(oe.distanceFromAnchor===0?P.tileAnchorPoint:new t.P(P.lineVertexArray.getx(gt),P.lineVertexArray.gety(gt)),ke,oe.previousVertex,oe.absOffsetX-oe.distanceFromAnchor+1,P)}function Lt(Ue,P,oe){const Se=Ue+oe.translation[0],ke=P+oe.translation[1];let Be;return!oe.pitchWithMap&&oe.projection.useSpecialProjectionForSymbols?(Be=oe.projection.projectTileCoordinates(Se,ke,oe.unwrappedTileID,oe.getElevation),Be.point.x=(.5*Be.point.x+.5)*oe.width,Be.point.y=(.5*-Be.point.y+.5)*oe.height):(Be=Mt(Se,ke,oe.labelPlaneMatrix,oe.getElevation),Be.isOccluded=!1),Be}function Ct(Ue,P,oe){return Ue._unit()._perp()._mult(P*oe)}function Ot(Ue,P,oe,Se,ke,Be,gt,kt,Gt){if(kt.projectionCache.offsets[Ue])return kt.projectionCache.offsets[Ue];const cr=oe.add(P);if(Ue+Gt.direction=ke)return kt.projectionCache.offsets[Ue]=cr,cr;const Ar=Je(Ue+Gt.direction,kt,Gt),Cr=Ct(Ar.sub(oe),gt,Gt.direction),Qr=oe.add(Cr),_n=Ar.add(Cr);return kt.projectionCache.offsets[Ue]=t.ak(Be,cr,Qr,_n)||cr,kt.projectionCache.offsets[Ue]}function Wt(Ue,P,oe,Se,ke,Be,gt,kt,Gt){const cr=Se?Ue-P:Ue+P;let Ar=cr>0?1:-1,Cr=0;Se&&(Ar*=-1,Cr=Math.PI),Ar<0&&(Cr+=Math.PI);let Qr,_n=Ar>0?Be+ke:Be+ke+1;kt.projectionCache.cachedAnchorPoint?Qr=kt.projectionCache.cachedAnchorPoint:(Qr=Lt(kt.tileAnchorPoint.x,kt.tileAnchorPoint.y,kt).point,kt.projectionCache.cachedAnchorPoint=Qr);let Ze,et,ht=Qr,_t=Qr,zt=0,Et=0;const Ut=Math.abs(cr),mr=[];let Tr;for(;zt+Et<=Ut;){if(_n+=Ar,_n=gt)return null;zt+=Et,_t=ht,et=Ze;const on={absOffsetX:Ut,direction:Ar,distanceFromAnchor:zt,previousVertex:_t};if(ht=Je(_n,kt,on),oe===0)mr.push(_t),Tr=ht.sub(_t);else{let Mn;const Pn=ht.sub(_t);Mn=Pn.mag()===0?Ct(Je(_n+Ar,kt,on).sub(ht),oe,Ar):Ct(Pn,oe,Ar),et||(et=_t.add(Mn)),Ze=Ot(_n,Mn,ht,Be,gt,et,oe,kt,on),mr.push(et),Tr=Ze.sub(et)}Et=Tr.mag()}const Lr=Tr._mult((Ut-zt)/Et)._add(et||_t),Gr=Cr+Math.atan2(ht.y-_t.y,ht.x-_t.x);return mr.push(Lr),{point:Lr,angle:Gt?Gr:0,path:mr}}const _r=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function pr(Ue,P){for(let oe=0;oe=1;mo--)ii.push(ni.path[mo]);for(let mo=1;mo$o.signedDistanceFromCamera<=0)?[]:mo.map($o=>$o.point)}let Ao=[];if(ii.length>0){const mo=ii[0].clone(),$o=ii[0].clone();for(let Js=1;Js=Pn.x&&$o.x<=Yn.x&&mo.y>=Pn.y&&$o.y<=Yn.y?[ii]:$o.xYn.x||$o.yYn.y?[]:t.al([ii],Pn.x,Pn.y,Yn.x,Yn.y)}for(const mo of Ao){wa.reset(mo,.25*Mn);let $o=0;$o=wa.length<=.5*Mn?1:Math.ceil(wa.paddedLength/$i)+1;for(let Js=0;Js<$o;Js++){const Qs=Js/Math.max($o-1,1),Ls=wa.lerp(Qs),al=Ls.x+Fr,vu=Ls.y+Fr;_t.push(al,vu,Mn,0);const ru=al-Mn,Ps=vu-Mn,Rs=al+Mn,Cu=vu+Mn;if(on=on&&this.isOffscreen(ru,Ps,Rs,Cu),Gr=Gr||this.isInsideGrid(ru,Ps,Rs,Cu),P!=="always"&&this.grid.hitTestCircle(al,vu,Mn,P,Qr)&&(Lr=!0,!Ar))return{circles:[],offscreen:!1,collisionDetected:Lr}}}}return{circles:!Ar&&Lr||!Gr||EtMt(ke.x,ke.y,Se,oe.getElevation))}queryRenderedSymbols(P){if(P.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const oe=[];let Se=1/0,ke=1/0,Be=-1/0,gt=-1/0;for(const Ar of P){const Cr=new t.P(Ar.x+Fr,Ar.y+Fr);Se=Math.min(Se,Cr.x),ke=Math.min(ke,Cr.y),Be=Math.max(Be,Cr.x),gt=Math.max(gt,Cr.y),oe.push(Cr)}const kt=this.grid.query(Se,ke,Be,gt).concat(this.ignoredGrid.query(Se,ke,Be,gt)),Gt={},cr={};for(const Ar of kt){const Cr=Ar.key;if(Gt[Cr.bucketInstanceId]===void 0&&(Gt[Cr.bucketInstanceId]={}),Gt[Cr.bucketInstanceId][Cr.featureIndex])continue;const Qr=[new t.P(Ar.x1,Ar.y1),new t.P(Ar.x2,Ar.y1),new t.P(Ar.x2,Ar.y2),new t.P(Ar.x1,Ar.y2)];t.am(oe,Qr)&&(Gt[Cr.bucketInstanceId][Cr.featureIndex]=!0,cr[Cr.bucketInstanceId]===void 0&&(cr[Cr.bucketInstanceId]=[]),cr[Cr.bucketInstanceId].push(Cr.featureIndex))}return cr}insertCollisionBox(P,oe,Se,ke,Be,gt){(Se?this.ignoredGrid:this.grid).insert({bucketInstanceId:ke,featureIndex:Be,collisionGroupID:gt,overlapMode:oe},P[0],P[1],P[2],P[3])}insertCollisionCircles(P,oe,Se,ke,Be,gt){const kt=Se?this.ignoredGrid:this.grid,Gt={bucketInstanceId:ke,featureIndex:Be,collisionGroupID:gt,overlapMode:oe};for(let cr=0;cr=this.screenRightBoundary||kethis.screenBottomBoundary}isInsideGrid(P,oe,Se,ke){return Se>=0&&P=0&&oethis.projectAndGetPerspectiveRatio(Se,Mn.x,Mn.y,ke,cr));Gr=on.some(Mn=>!Mn.isOccluded),Lr=on.map(Mn=>Mn.point)}else Gr=!0;return{box:t.ao(Lr),allPointsOccluded:!Gr}}}function Kn(Ue,P,oe){return P*(t.X/(Ue.tileSize*Math.pow(2,oe-Ue.tileID.overscaledZ)))}class qn{constructor(P,oe,Se,ke){this.opacity=P?Math.max(0,Math.min(1,P.opacity+(P.placed?oe:-oe))):ke&&Se?1:0,this.placed=Se}isHidden(){return this.opacity===0&&!this.placed}}class ta{constructor(P,oe,Se,ke,Be){this.text=new qn(P?P.text:null,oe,Se,Be),this.icon=new qn(P?P.icon:null,oe,ke,Be)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class ra{constructor(P,oe,Se){this.text=P,this.icon=oe,this.skipFade=Se}}class Nn{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class ka{constructor(P,oe,Se,ke,Be){this.bucketInstanceId=P,this.featureIndex=oe,this.sourceLayerIndex=Se,this.bucketIndex=ke,this.tileID=Be}}class qa{constructor(P){this.crossSourceCollisions=P,this.maxGroupID=0,this.collisionGroups={}}get(P){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[P]){const oe=++this.maxGroupID;this.collisionGroups[P]={ID:oe,predicate:Se=>Se.collisionGroupID===oe}}return this.collisionGroups[P]}}function ir(Ue,P,oe,Se,ke){const{horizontalAlign:Be,verticalAlign:gt}=t.au(Ue);return new t.P(-(Be-.5)*P+Se[0]*ke,-(gt-.5)*oe+Se[1]*ke)}class qt{constructor(P,oe,Se,ke,Be,gt){this.transform=P.clone(),this.terrain=Se,this.collisionIndex=new En(this.transform,oe),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=ke,this.retainedQueryData={},this.collisionGroups=new qa(Be),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=gt,gt&&(gt.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(P){const oe=this.terrain;return oe?(Se,ke)=>oe.getElevation(P,Se,ke):null}getBucketParts(P,oe,Se,ke){const Be=Se.getBucket(oe),gt=Se.latestFeatureIndex;if(!Be||!gt||oe.id!==Be.layerIds[0])return;const kt=Se.collisionBoxArray,Gt=Be.layers[0].layout,cr=Be.layers[0].paint,Ar=Math.pow(2,this.transform.zoom-Se.tileID.overscaledZ),Cr=Se.tileSize/t.X,Qr=Se.tileID.toUnwrapped(),_n=this.transform.calculatePosMatrix(Qr),Ze=Gt.get("text-pitch-alignment")==="map",et=Gt.get("text-rotation-alignment")==="map",ht=Kn(Se,1,this.transform.zoom),_t=this.collisionIndex.mapProjection.translatePosition(this.transform,Se,cr.get("text-translate"),cr.get("text-translate-anchor")),zt=this.collisionIndex.mapProjection.translatePosition(this.transform,Se,cr.get("icon-translate"),cr.get("icon-translate-anchor")),Et=Sr(_n,Ze,et,this.transform,ht);let Ut=null;if(Ze){const Tr=Br(_n,Ze,et,this.transform,ht);Ut=t.L([],this.transform.labelPlaneMatrix,Tr)}this.retainedQueryData[Be.bucketInstanceId]=new ka(Be.bucketInstanceId,gt,Be.sourceLayerIndex,Be.index,Se.tileID);const mr={bucket:Be,layout:Gt,translationText:_t,translationIcon:zt,posMatrix:_n,unwrappedTileID:Qr,textLabelPlaneMatrix:Et,labelToScreenMatrix:Ut,scale:Ar,textPixelRatio:Cr,holdingForFade:Se.holdingForFade(),collisionBoxArray:kt,partiallyEvaluatedTextSize:t.ag(Be.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Be.sourceID)};if(ke)for(const Tr of Be.sortKeyRanges){const{sortKey:Lr,symbolInstanceStart:Gr,symbolInstanceEnd:on}=Tr;P.push({sortKey:Lr,symbolInstanceStart:Gr,symbolInstanceEnd:on,parameters:mr})}else P.push({symbolInstanceStart:0,symbolInstanceEnd:Be.symbolInstances.length,parameters:mr})}attemptAnchorPlacement(P,oe,Se,ke,Be,gt,kt,Gt,cr,Ar,Cr,Qr,_n,Ze,et,ht,_t,zt,Et){const Ut=t.aq[P.textAnchor],mr=[P.textOffset0,P.textOffset1],Tr=ir(Ut,Se,ke,mr,Be),Lr=this.collisionIndex.placeCollisionBox(oe,Qr,Gt,cr,Ar,kt,gt,ht,Cr.predicate,Et,Tr);if((!zt||this.collisionIndex.placeCollisionBox(zt,Qr,Gt,cr,Ar,kt,gt,_t,Cr.predicate,Et,Tr).placeable)&&Lr.placeable){let Gr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[_n.crossTileID]&&this.prevPlacement.placements[_n.crossTileID]&&this.prevPlacement.placements[_n.crossTileID].text&&(Gr=this.prevPlacement.variableOffsets[_n.crossTileID].anchor),_n.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[_n.crossTileID]={textOffset:mr,width:Se,height:ke,anchor:Ut,textBoxScale:Be,prevAnchor:Gr},this.markUsedJustification(Ze,Ut,_n,et),Ze.allowVerticalPlacement&&(this.markUsedOrientation(Ze,et,_n),this.placedOrientations[_n.crossTileID]=et),{shift:Tr,placedGlyphBoxes:Lr}}}placeLayerBucketPart(P,oe,Se){const{bucket:ke,layout:Be,translationText:gt,translationIcon:kt,posMatrix:Gt,unwrappedTileID:cr,textLabelPlaneMatrix:Ar,labelToScreenMatrix:Cr,textPixelRatio:Qr,holdingForFade:_n,collisionBoxArray:Ze,partiallyEvaluatedTextSize:et,collisionGroup:ht}=P.parameters,_t=Be.get("text-optional"),zt=Be.get("icon-optional"),Et=t.ar(Be,"text-overlap","text-allow-overlap"),Ut=Et==="always",mr=t.ar(Be,"icon-overlap","icon-allow-overlap"),Tr=mr==="always",Lr=Be.get("text-rotation-alignment")==="map",Gr=Be.get("text-pitch-alignment")==="map",on=Be.get("icon-text-fit")!=="none",Mn=Be.get("symbol-z-order")==="viewport-y",Pn=Ut&&(Tr||!ke.hasIconData()||zt),Yn=Tr&&(Ut||!ke.hasTextData()||_t);!ke.collisionArrays&&Ze&&ke.deserializeCollisionBoxes(Ze);const wa=this._getTerrainElevationFunc(this.retainedQueryData[ke.bucketInstanceId].tileID),ni=(Ka,ii,$i)=>{var Ao,mo;if(oe[Ka.crossTileID])return;if(_n)return void(this.placements[Ka.crossTileID]=new ra(!1,!1,!1));let $o=!1,Js=!1,Qs=!0,Ls=null,al={box:null,placeable:!1,offscreen:null},vu={placeable:!1},ru=null,Ps=null,Rs=null,Cu=0,oc=0,Oc=0;ii.textFeatureIndex?Cu=ii.textFeatureIndex:Ka.useRuntimeCollisionCircles&&(Cu=Ka.featureIndex),ii.verticalTextFeatureIndex&&(oc=ii.verticalTextFeatureIndex);const ge=ii.textBox;if(ge){const St=yr=>{let Xr=t.ah.horizontal;if(ke.allowVerticalPlacement&&!yr&&this.prevPlacement){const Hr=this.prevPlacement.placedOrientations[Ka.crossTileID];Hr&&(this.placedOrientations[Ka.crossTileID]=Hr,Xr=Hr,this.markUsedOrientation(ke,Xr,Ka))}return Xr},It=(yr,Xr)=>{if(ke.allowVerticalPlacement&&Ka.numVerticalGlyphVertices>0&&ii.verticalTextBox){for(const Hr of ke.writingModes)if(Hr===t.ah.vertical?(al=Xr(),vu=al):al=yr(),al&&al.placeable)break}else al=yr()},Qt=Ka.textAnchorOffsetStartIndex,Jt=Ka.textAnchorOffsetEndIndex;if(Jt===Qt){const yr=(Xr,Hr)=>{const hn=this.collisionIndex.placeCollisionBox(Xr,Et,Qr,Gt,cr,Gr,Lr,gt,ht.predicate,wa);return hn&&hn.placeable&&(this.markUsedOrientation(ke,Hr,Ka),this.placedOrientations[Ka.crossTileID]=Hr),hn};It(()=>yr(ge,t.ah.horizontal),()=>{const Xr=ii.verticalTextBox;return ke.allowVerticalPlacement&&Ka.numVerticalGlyphVertices>0&&Xr?yr(Xr,t.ah.vertical):{box:null,offscreen:null}}),St(al&&al.placeable)}else{let yr=t.aq[(mo=(Ao=this.prevPlacement)===null||Ao===void 0?void 0:Ao.variableOffsets[Ka.crossTileID])===null||mo===void 0?void 0:mo.anchor];const Xr=(hn,An,kn)=>{const La=hn.x2-hn.x1,zn=hn.y2-hn.y1,Qn=Ka.textBoxScale,oa=on&&mr==="never"?An:null;let Aa=null,Ra=Et==="never"?1:2,ia="never";yr&&Ra++;for(let oi=0;oiXr(ge,ii.iconBox,t.ah.horizontal),()=>{const hn=ii.verticalTextBox;return ke.allowVerticalPlacement&&(!al||!al.placeable)&&Ka.numVerticalGlyphVertices>0&&hn?Xr(hn,ii.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),al&&($o=al.placeable,Qs=al.offscreen);const Hr=St(al&&al.placeable);if(!$o&&this.prevPlacement){const hn=this.prevPlacement.variableOffsets[Ka.crossTileID];hn&&(this.variableOffsets[Ka.crossTileID]=hn,this.markUsedJustification(ke,hn.anchor,Ka,Hr))}}}if(ru=al,$o=ru&&ru.placeable,Qs=ru&&ru.offscreen,Ka.useRuntimeCollisionCircles){const St=ke.text.placedSymbolArray.get(Ka.centerJustifiedTextSymbolIndex),It=t.ai(ke.textSizeData,et,St),Qt=Be.get("text-padding");Ps=this.collisionIndex.placeCollisionCircles(Et,St,ke.lineVertexArray,ke.glyphOffsetArray,It,Gt,cr,Ar,Cr,Se,Gr,ht.predicate,Ka.collisionCircleDiameter,Qt,gt,wa),Ps.circles.length&&Ps.collisionDetected&&!Se&&t.w("Collisions detected, but collision boxes are not shown"),$o=Ut||Ps.circles.length>0&&!Ps.collisionDetected,Qs=Qs&&Ps.offscreen}if(ii.iconFeatureIndex&&(Oc=ii.iconFeatureIndex),ii.iconBox){const St=It=>this.collisionIndex.placeCollisionBox(It,mr,Qr,Gt,cr,Gr,Lr,kt,ht.predicate,wa,on&&Ls?Ls:void 0);vu&&vu.placeable&&ii.verticalIconBox?(Rs=St(ii.verticalIconBox),Js=Rs.placeable):(Rs=St(ii.iconBox),Js=Rs.placeable),Qs=Qs&&Rs.offscreen}const Oe=_t||Ka.numHorizontalGlyphVertices===0&&Ka.numVerticalGlyphVertices===0,tt=zt||Ka.numIconVertices===0;Oe||tt?tt?Oe||(Js=Js&&$o):$o=Js&&$o:Js=$o=Js&&$o;const xt=Js&&Rs.placeable;if($o&&ru.placeable&&this.collisionIndex.insertCollisionBox(ru.box,Et,Be.get("text-ignore-placement"),ke.bucketInstanceId,vu&&vu.placeable&&oc?oc:Cu,ht.ID),xt&&this.collisionIndex.insertCollisionBox(Rs.box,mr,Be.get("icon-ignore-placement"),ke.bucketInstanceId,Oc,ht.ID),Ps&&$o&&this.collisionIndex.insertCollisionCircles(Ps.circles,Et,Be.get("text-ignore-placement"),ke.bucketInstanceId,Cu,ht.ID),Se&&this.storeCollisionData(ke.bucketInstanceId,$i,ii,ru,Rs,Ps),Ka.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(ke.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Ka.crossTileID]=new ra($o||Pn,Js||Yn,Qs||ke.justReloaded),oe[Ka.crossTileID]=!0};if(Mn){if(P.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const Ka=ke.getSortedSymbolIndexes(this.transform.angle);for(let ii=Ka.length-1;ii>=0;--ii){const $i=Ka[ii];ni(ke.symbolInstances.get($i),ke.collisionArrays[$i],$i)}}else for(let Ka=P.symbolInstanceStart;Ka=0&&(P.text.placedSymbolArray.get(kt).crossTileID=Be>=0&&kt!==Be?0:Se.crossTileID)}markUsedOrientation(P,oe,Se){const ke=oe===t.ah.horizontal||oe===t.ah.horizontalOnly?oe:0,Be=oe===t.ah.vertical?oe:0,gt=[Se.leftJustifiedTextSymbolIndex,Se.centerJustifiedTextSymbolIndex,Se.rightJustifiedTextSymbolIndex];for(const kt of gt)P.text.placedSymbolArray.get(kt).placedOrientation=ke;Se.verticalPlacedTextSymbolIndex&&(P.text.placedSymbolArray.get(Se.verticalPlacedTextSymbolIndex).placedOrientation=Be)}commit(P){this.commitTime=P,this.zoomAtLastRecencyCheck=this.transform.zoom;const oe=this.prevPlacement;let Se=!1;this.prevZoomAdjustment=oe?oe.zoomAdjustment(this.transform.zoom):0;const ke=oe?oe.symbolFadeChange(P):1,Be=oe?oe.opacities:{},gt=oe?oe.variableOffsets:{},kt=oe?oe.placedOrientations:{};for(const Gt in this.placements){const cr=this.placements[Gt],Ar=Be[Gt];Ar?(this.opacities[Gt]=new ta(Ar,ke,cr.text,cr.icon),Se=Se||cr.text!==Ar.text.placed||cr.icon!==Ar.icon.placed):(this.opacities[Gt]=new ta(null,ke,cr.text,cr.icon,cr.skipFade),Se=Se||cr.text||cr.icon)}for(const Gt in Be){const cr=Be[Gt];if(!this.opacities[Gt]){const Ar=new ta(cr,ke,!1,!1);Ar.isHidden()||(this.opacities[Gt]=Ar,Se=Se||cr.text.placed||cr.icon.placed)}}for(const Gt in gt)this.variableOffsets[Gt]||!this.opacities[Gt]||this.opacities[Gt].isHidden()||(this.variableOffsets[Gt]=gt[Gt]);for(const Gt in kt)this.placedOrientations[Gt]||!this.opacities[Gt]||this.opacities[Gt].isHidden()||(this.placedOrientations[Gt]=kt[Gt]);if(oe&&oe.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Se?this.lastPlacementChangeTime=P:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=oe?oe.lastPlacementChangeTime:P)}updateLayerOpacities(P,oe){const Se={};for(const ke of oe){const Be=ke.getBucket(P);Be&&ke.latestFeatureIndex&&P.id===Be.layerIds[0]&&this.updateBucketOpacities(Be,ke.tileID,Se,ke.collisionBoxArray)}}updateBucketOpacities(P,oe,Se,ke){P.hasTextData()&&(P.text.opacityVertexArray.clear(),P.text.hasVisibleVertices=!1),P.hasIconData()&&(P.icon.opacityVertexArray.clear(),P.icon.hasVisibleVertices=!1),P.hasIconCollisionBoxData()&&P.iconCollisionBox.collisionVertexArray.clear(),P.hasTextCollisionBoxData()&&P.textCollisionBox.collisionVertexArray.clear();const Be=P.layers[0],gt=Be.layout,kt=new ta(null,0,!1,!1,!0),Gt=gt.get("text-allow-overlap"),cr=gt.get("icon-allow-overlap"),Ar=Be._unevaluatedLayout.hasValue("text-variable-anchor")||Be._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Cr=gt.get("text-rotation-alignment")==="map",Qr=gt.get("text-pitch-alignment")==="map",_n=gt.get("icon-text-fit")!=="none",Ze=new ta(null,0,Gt&&(cr||!P.hasIconData()||gt.get("icon-optional")),cr&&(Gt||!P.hasTextData()||gt.get("text-optional")),!0);!P.collisionArrays&&ke&&(P.hasIconCollisionBoxData()||P.hasTextCollisionBoxData())&&P.deserializeCollisionBoxes(ke);const et=(_t,zt,Et)=>{for(let Ut=0;Ut0,Gr=this.placedOrientations[zt.crossTileID],on=Gr===t.ah.vertical,Mn=Gr===t.ah.horizontal||Gr===t.ah.horizontalOnly;if(Et>0||Ut>0){const Yn=ha(Tr.text);et(P.text,Et,on?_a:Yn),et(P.text,Ut,Mn?_a:Yn);const wa=Tr.text.isHidden();[zt.rightJustifiedTextSymbolIndex,zt.centerJustifiedTextSymbolIndex,zt.leftJustifiedTextSymbolIndex].forEach(ii=>{ii>=0&&(P.text.placedSymbolArray.get(ii).hidden=wa||on?1:0)}),zt.verticalPlacedTextSymbolIndex>=0&&(P.text.placedSymbolArray.get(zt.verticalPlacedTextSymbolIndex).hidden=wa||Mn?1:0);const ni=this.variableOffsets[zt.crossTileID];ni&&this.markUsedJustification(P,ni.anchor,zt,Gr);const Ka=this.placedOrientations[zt.crossTileID];Ka&&(this.markUsedJustification(P,"left",zt,Ka),this.markUsedOrientation(P,Ka,zt))}if(Lr){const Yn=ha(Tr.icon),wa=!(_n&&zt.verticalPlacedIconSymbolIndex&&on);zt.placedIconSymbolIndex>=0&&(et(P.icon,zt.numIconVertices,wa?Yn:_a),P.icon.placedSymbolArray.get(zt.placedIconSymbolIndex).hidden=Tr.icon.isHidden()),zt.verticalPlacedIconSymbolIndex>=0&&(et(P.icon,zt.numVerticalIconVertices,wa?_a:Yn),P.icon.placedSymbolArray.get(zt.verticalPlacedIconSymbolIndex).hidden=Tr.icon.isHidden())}const Pn=ht&&ht.has(_t)?ht.get(_t):{text:null,icon:null};if(P.hasIconCollisionBoxData()||P.hasTextCollisionBoxData()){const Yn=P.collisionArrays[_t];if(Yn){let wa=new t.P(0,0);if(Yn.textBox||Yn.verticalTextBox){let ni=!0;if(Ar){const Ka=this.variableOffsets[mr];Ka?(wa=ir(Ka.anchor,Ka.width,Ka.height,Ka.textOffset,Ka.textBoxScale),Cr&&wa._rotate(Qr?this.transform.angle:-this.transform.angle)):ni=!1}if(Yn.textBox||Yn.verticalTextBox){let Ka;Yn.textBox&&(Ka=on),Yn.verticalTextBox&&(Ka=Mn),ar(P.textCollisionBox.collisionVertexArray,Tr.text.placed,!ni||Ka,Pn.text,wa.x,wa.y)}}if(Yn.iconBox||Yn.verticalIconBox){const ni=!!(!Mn&&Yn.verticalIconBox);let Ka;Yn.iconBox&&(Ka=ni),Yn.verticalIconBox&&(Ka=!ni),ar(P.iconCollisionBox.collisionVertexArray,Tr.icon.placed,Ka,Pn.icon,_n?wa.x:0,_n?wa.y:0)}}}}if(P.sortFeatures(this.transform.angle),this.retainedQueryData[P.bucketInstanceId]&&(this.retainedQueryData[P.bucketInstanceId].featureSortOrder=P.featureSortOrder),P.hasTextData()&&P.text.opacityVertexBuffer&&P.text.opacityVertexBuffer.updateData(P.text.opacityVertexArray),P.hasIconData()&&P.icon.opacityVertexBuffer&&P.icon.opacityVertexBuffer.updateData(P.icon.opacityVertexArray),P.hasIconCollisionBoxData()&&P.iconCollisionBox.collisionVertexBuffer&&P.iconCollisionBox.collisionVertexBuffer.updateData(P.iconCollisionBox.collisionVertexArray),P.hasTextCollisionBoxData()&&P.textCollisionBox.collisionVertexBuffer&&P.textCollisionBox.collisionVertexBuffer.updateData(P.textCollisionBox.collisionVertexArray),P.text.opacityVertexArray.length!==P.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${P.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${P.text.layoutVertexArray.length}) / 4`);if(P.icon.opacityVertexArray.length!==P.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${P.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${P.icon.layoutVertexArray.length}) / 4`);if(P.bucketInstanceId in this.collisionCircleArrays){const _t=this.collisionCircleArrays[P.bucketInstanceId];P.placementInvProjMatrix=_t.invProjMatrix,P.placementViewportMatrix=_t.viewportMatrix,P.collisionCircleArray=_t.circles,delete this.collisionCircleArrays[P.bucketInstanceId]}}symbolFadeChange(P){return this.fadeDuration===0?1:(P-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(P){return Math.max(0,(this.transform.zoom-P)/1.5)}hasTransitions(P){return this.stale||P-this.lastPlacementChangeTimeP}setStale(){this.stale=!0}}function ar(Ue,P,oe,Se,ke,Be){Se&&Se.length!==0||(Se=[0,0,0,0]);const gt=Se[0]-Fr,kt=Se[1]-Fr,Gt=Se[2]-Fr,cr=Se[3]-Fr;Ue.emplaceBack(P?1:0,oe?1:0,ke||0,Be||0,gt,kt),Ue.emplaceBack(P?1:0,oe?1:0,ke||0,Be||0,Gt,kt),Ue.emplaceBack(P?1:0,oe?1:0,ke||0,Be||0,Gt,cr),Ue.emplaceBack(P?1:0,oe?1:0,ke||0,Be||0,gt,cr)}const lr=Math.pow(2,25),Vr=Math.pow(2,24),sn=Math.pow(2,17),mn=Math.pow(2,16),wn=Math.pow(2,9),Jn=Math.pow(2,8),pa=Math.pow(2,1);function ha(Ue){if(Ue.opacity===0&&!Ue.placed)return 0;if(Ue.opacity===1&&Ue.placed)return 4294967295;const P=Ue.placed?1:0,oe=Math.floor(127*Ue.opacity);return oe*lr+P*Vr+oe*sn+P*mn+oe*wn+P*Jn+oe*pa+P}const _a=0;function Ca(){return{isOccluded:(Ue,P,oe)=>!1,getPitchedTextCorrection:(Ue,P,oe)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Ue,P,oe,Se){throw new Error("Not implemented.")},translatePosition:(Ue,P,oe,Se)=>(function(ke,Be,gt,kt,Gt=!1){if(!gt[0]&&!gt[1])return[0,0];const cr=Gt?kt==="map"?ke.angle:0:kt==="viewport"?-ke.angle:0;if(cr){const Ar=Math.sin(cr),Cr=Math.cos(cr);gt=[gt[0]*Cr-gt[1]*Ar,gt[0]*Ar+gt[1]*Cr]}return[Gt?gt[0]:Kn(Be,gt[0],ke.zoom),Gt?gt[1]:Kn(Be,gt[1],ke.zoom)]})(Ue,P,oe,Se),getCircleRadiusCorrection:Ue=>1}}class Vn{constructor(P){this._sortAcrossTiles=P.layout.get("symbol-z-order")!=="viewport-y"&&!P.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(P,oe,Se,ke,Be){const gt=this._bucketParts;for(;this._currentTileIndexkt.sortKey-Gt.sortKey));this._currentPartIndex!this._forceFullPlacement&&i.now()-ke>2;for(;this._currentPlacementIndex>=0;){const gt=oe[P[this._currentPlacementIndex]],kt=this.placement.collisionIndex.transform.zoom;if(gt.type==="symbol"&&(!gt.minzoom||gt.minzoom<=kt)&&(!gt.maxzoom||gt.maxzoom>kt)){if(this._inProgressLayer||(this._inProgressLayer=new Vn(gt)),this._inProgressLayer.continuePlacement(Se[gt.source],this.placement,this._showCollisionBoxes,gt,Be))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(P){return this.placement.commit(P),this.placement}}const Ci=512/t.X/2;class Dt{constructor(P,oe,Se){this.tileID=P,this.bucketInstanceId=Se,this._symbolsByKey={};const ke=new Map;for(let Be=0;Be({x:Math.floor(Gt.anchorX*Ci),y:Math.floor(Gt.anchorY*Ci)})),crossTileIDs:gt.map(Gt=>Gt.crossTileID)};if(kt.positions.length>128){const Gt=new t.av(kt.positions.length,16,Uint16Array);for(const{x:cr,y:Ar}of kt.positions)Gt.add(cr,Ar);Gt.finish(),delete kt.positions,kt.index=Gt}this._symbolsByKey[Be]=kt}}getScaledCoordinates(P,oe){const{x:Se,y:ke,z:Be}=this.tileID.canonical,{x:gt,y:kt,z:Gt}=oe.canonical,cr=Ci/Math.pow(2,Gt-Be),Ar=(kt*t.X+P.anchorY)*cr,Cr=ke*t.X*Ci;return{x:Math.floor((gt*t.X+P.anchorX)*cr-Se*t.X*Ci),y:Math.floor(Ar-Cr)}}findMatches(P,oe,Se){const ke=this.tileID.canonical.zP)}}class yt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class kr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(P){const oe=Math.round((P-this.lng)/360);if(oe!==0)for(const Se in this.indexes){const ke=this.indexes[Se],Be={};for(const gt in ke){const kt=ke[gt];kt.tileID=kt.tileID.unwrapTo(kt.tileID.wrap+oe),Be[kt.tileID.key]=kt}this.indexes[Se]=Be}this.lng=P}addBucket(P,oe,Se){if(this.indexes[P.overscaledZ]&&this.indexes[P.overscaledZ][P.key]){if(this.indexes[P.overscaledZ][P.key].bucketInstanceId===oe.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(P.overscaledZ,this.indexes[P.overscaledZ][P.key])}for(let Be=0;BeP.overscaledZ)for(const kt in gt){const Gt=gt[kt];Gt.tileID.isChildOf(P)&&Gt.findMatches(oe.symbolInstances,P,ke)}else{const kt=gt[P.scaledTo(Number(Be)).key];kt&&kt.findMatches(oe.symbolInstances,P,ke)}}for(let Be=0;Be{oe[Se]=!0});for(const Se in this.layerIndexes)oe[Se]||delete this.layerIndexes[Se]}}const jr=(Ue,P)=>t.t(Ue,P&&P.filter(oe=>oe.identifier!=="source.canvas")),Ir=t.aw();class Ur extends t.E{constructor(P,oe={}){super(),this._rtlPluginLoaded=()=>{for(const Se in this.sourceCaches){const ke=this.sourceCaches[Se].getSource().type;ke!=="vector"&&ke!=="geojson"||this.sourceCaches[Se].reload()}},this.map=P,this.dispatcher=new ne(ee(),P._getMapId()),this.dispatcher.registerMessageHandler("GG",(Se,ke)=>this.getGlyphs(Se,ke)),this.dispatcher.registerMessageHandler("GI",(Se,ke)=>this.getImages(Se,ke)),this.imageManager=new y,this.imageManager.setEventedParent(this),this.glyphManager=new F(P._requestManager,oe.localIdeographFontFamily),this.lineAtlas=new Z(256,512),this.crossTileSymbolIndex=new Nr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",t.ay()),ot().on(Te,this._rtlPluginLoaded),this.on("data",Se=>{if(Se.dataType!=="source"||Se.sourceDataType!=="metadata")return;const ke=this.sourceCaches[Se.sourceId];if(!ke)return;const Be=ke.getSource();if(Be&&Be.vectorLayerIds)for(const gt in this._layers){const kt=this._layers[gt];kt.source===Be.id&&this._validateLayer(kt)}})}loadURL(P,oe={},Se){this.fire(new t.k("dataloading",{dataType:"style"})),oe.validate=typeof oe.validate!="boolean"||oe.validate;const ke=this.map._requestManager.transformRequest(P,"Style");this._loadStyleRequest=new AbortController;const Be=this._loadStyleRequest;t.h(ke,this._loadStyleRequest).then(gt=>{this._loadStyleRequest=null,this._load(gt.data,oe,Se)}).catch(gt=>{this._loadStyleRequest=null,gt&&!Be.signal.aborted&&this.fire(new t.j(gt))})}loadJSON(P,oe={},Se){this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,oe.validate=oe.validate!==!1,this._load(P,oe,Se)}).catch(()=>{})}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(Ir,{validate:!1})}_load(P,oe,Se){var ke;const Be=oe.transformStyle?oe.transformStyle(Se,P):P;if(!oe.validate||!jr(this,t.u(Be))){this._loaded=!0,this.stylesheet=Be;for(const gt in Be.sources)this.addSource(gt,Be.sources[gt],{validate:!1});Be.sprite?this._loadSprite(Be.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Be.glyphs),this._createLayers(),this.light=new R(this.stylesheet.light),this.sky=new j(this.stylesheet.sky),this.map.setTerrain((ke=this.stylesheet.terrain)!==null&&ke!==void 0?ke:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){const P=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",P),this._order=P.map(oe=>oe.id),this._layers={},this._serializedLayers=null;for(const oe of P){const Se=t.aA(oe);Se.setEventedParent(this,{layer:{id:oe.id}}),this._layers[oe.id]=Se}}_loadSprite(P,oe=!1,Se=void 0){let ke;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,(function(Be,gt,kt,Gt){return t._(this,void 0,void 0,function*(){const cr=w(Be),Ar=kt>1?"@2x":"",Cr={},Qr={};for(const{id:_n,url:Ze}of cr){const et=gt.transformRequest(m(Ze,Ar,".json"),"SpriteJSON");Cr[_n]=t.h(et,Gt);const ht=gt.transformRequest(m(Ze,Ar,".png"),"SpriteImage");Qr[_n]=l.getImage(ht,Gt)}return yield Promise.all([...Object.values(Cr),...Object.values(Qr)]),(function(_n,Ze){return t._(this,void 0,void 0,function*(){const et={};for(const ht in _n){et[ht]={};const _t=i.getImageCanvasContext((yield Ze[ht]).data),zt=(yield _n[ht]).data;for(const Et in zt){const{width:Ut,height:mr,x:Tr,y:Lr,sdf:Gr,pixelRatio:on,stretchX:Mn,stretchY:Pn,content:Yn,textFitWidth:wa,textFitHeight:ni}=zt[Et];et[ht][Et]={data:null,pixelRatio:on,sdf:Gr,stretchX:Mn,stretchY:Pn,content:Yn,textFitWidth:wa,textFitHeight:ni,spriteData:{width:Ut,height:mr,x:Tr,y:Lr,context:_t}}}}return et})})(Cr,Qr)})})(P,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Be=>{if(this._spriteRequest=null,Be)for(const gt in Be){this._spritesImagesIds[gt]=[];const kt=this._spritesImagesIds[gt]?this._spritesImagesIds[gt].filter(Gt=>!(Gt in Be)):[];for(const Gt of kt)this.imageManager.removeImage(Gt),this._changedImages[Gt]=!0;for(const Gt in Be[gt]){const cr=gt==="default"?Gt:`${gt}:${Gt}`;this._spritesImagesIds[gt].push(cr),cr in this.imageManager.images?this.imageManager.updateImage(cr,Be[gt][Gt],!1):this.imageManager.addImage(cr,Be[gt][Gt]),oe&&(this._changedImages[cr]=!0)}}}).catch(Be=>{this._spriteRequest=null,ke=Be,this.fire(new t.j(ke))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),oe&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),Se&&Se(ke)})}_unloadSprite(){for(const P of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(P),this._changedImages[P]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}_validateLayer(P){const oe=this.sourceCaches[P.source];if(!oe)return;const Se=P.sourceLayer;if(!Se)return;const ke=oe.getSource();(ke.type==="geojson"||ke.vectorLayerIds&&ke.vectorLayerIds.indexOf(Se)===-1)&&this.fire(new t.j(new Error(`Source layer "${Se}" does not exist on source "${ke.id}" as specified by style layer "${P.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const P in this.sourceCaches)if(!this.sourceCaches[P].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(P,oe=!1){const Se=this._serializedAllLayers();if(!P||P.length===0)return Object.values(oe?t.aB(Se):Se);const ke=[];for(const Be of P)if(Se[Be]){const gt=oe?t.aB(Se[Be]):Se[Be];ke.push(gt)}return ke}_serializedAllLayers(){let P=this._serializedLayers;if(P)return P;P=this._serializedLayers={};const oe=Object.keys(this._layers);for(const Se of oe){const ke=this._layers[Se];ke.type!=="custom"&&(P[Se]=ke.serialize())}return P}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const P in this.sourceCaches)if(this.sourceCaches[P].hasTransition())return!0;for(const P in this._layers)if(this._layers[P].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(P){if(!this._loaded)return;const oe=this._changed;if(oe){const ke=Object.keys(this._updatedLayers),Be=Object.keys(this._removedLayers);(ke.length||Be.length)&&this._updateWorkerLayers(ke,Be);for(const gt in this._updatedSources){const kt=this._updatedSources[gt];if(kt==="reload")this._reloadSource(gt);else{if(kt!=="clear")throw new Error(`Invalid action ${kt}`);this._clearSource(gt)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const gt in this._updatedPaintProps)this._layers[gt].updateTransitions(P);this.light.updateTransitions(P),this.sky.updateTransitions(P),this._resetUpdates()}const Se={};for(const ke in this.sourceCaches){const Be=this.sourceCaches[ke];Se[ke]=Be.used,Be.used=!1}for(const ke of this._order){const Be=this._layers[ke];Be.recalculate(P,this._availableImages),!Be.isHidden(P.zoom)&&Be.source&&(this.sourceCaches[Be.source].used=!0)}for(const ke in Se){const Be=this.sourceCaches[ke];!!Se[ke]!=!!Be.used&&Be.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:ke}))}this.light.recalculate(P),this.sky.recalculate(P),this.z=P.zoom,oe&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const P=Object.keys(this._changedImages);if(P.length){for(const oe in this.sourceCaches)this.sourceCaches[oe].reloadTilesForDependencies(["icons","patterns"],P);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const P in this.sourceCaches)this.sourceCaches[P].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(P,oe){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(P,!1),removedIds:oe})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(P,oe={}){var Se;this._checkLoaded();const ke=this.serialize();if(P=oe.transformStyle?oe.transformStyle(ke,P):P,((Se=oe.validate)===null||Se===void 0||Se)&&jr(this,t.u(P)))return!1;(P=t.aB(P)).layers=t.az(P.layers);const Be=t.aC(ke,P),gt=this._getOperationsToPerform(Be);if(gt.unimplemented.length>0)throw new Error(`Unimplemented: ${gt.unimplemented.join(", ")}.`);if(gt.operations.length===0)return!1;for(const kt of gt.operations)kt();return this.stylesheet=P,this._serializedLayers=null,!0}_getOperationsToPerform(P){const oe=[],Se=[];for(const ke of P)switch(ke.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":oe.push(()=>this.addLayer.apply(this,ke.args));break;case"removeLayer":oe.push(()=>this.removeLayer.apply(this,ke.args));break;case"setPaintProperty":oe.push(()=>this.setPaintProperty.apply(this,ke.args));break;case"setLayoutProperty":oe.push(()=>this.setLayoutProperty.apply(this,ke.args));break;case"setFilter":oe.push(()=>this.setFilter.apply(this,ke.args));break;case"addSource":oe.push(()=>this.addSource.apply(this,ke.args));break;case"removeSource":oe.push(()=>this.removeSource.apply(this,ke.args));break;case"setLayerZoomRange":oe.push(()=>this.setLayerZoomRange.apply(this,ke.args));break;case"setLight":oe.push(()=>this.setLight.apply(this,ke.args));break;case"setGeoJSONSourceData":oe.push(()=>this.setGeoJSONSourceData.apply(this,ke.args));break;case"setGlyphs":oe.push(()=>this.setGlyphs.apply(this,ke.args));break;case"setSprite":oe.push(()=>this.setSprite.apply(this,ke.args));break;case"setSky":oe.push(()=>this.setSky.apply(this,ke.args));break;case"setTerrain":oe.push(()=>this.map.setTerrain.apply(this,ke.args));break;case"setTransition":oe.push(()=>{});break;default:Se.push(ke.command)}return{operations:oe,unimplemented:Se}}addImage(P,oe){if(this.getImage(P))return this.fire(new t.j(new Error(`An image named "${P}" already exists.`)));this.imageManager.addImage(P,oe),this._afterImageUpdated(P)}updateImage(P,oe){this.imageManager.updateImage(P,oe)}getImage(P){return this.imageManager.getImage(P)}removeImage(P){if(!this.getImage(P))return this.fire(new t.j(new Error(`An image named "${P}" does not exist.`)));this.imageManager.removeImage(P),this._afterImageUpdated(P)}_afterImageUpdated(P){this._availableImages=this.imageManager.listImages(),this._changedImages[P]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(P,oe,Se={}){if(this._checkLoaded(),this.sourceCaches[P]!==void 0)throw new Error(`Source "${P}" already exists.`);if(!oe.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(oe).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(oe.type)>=0&&this._validate(t.u.source,`sources.${P}`,oe,null,Se))return;this.map&&this.map._collectResourceTiming&&(oe.collectResourceTiming=!0);const ke=this.sourceCaches[P]=new Nt(P,oe,this.dispatcher);ke.style=this,ke.setEventedParent(this,()=>({isSourceLoaded:ke.loaded(),source:ke.serialize(),sourceId:P})),ke.onAdd(this.map),this._changed=!0}removeSource(P){if(this._checkLoaded(),this.sourceCaches[P]===void 0)throw new Error("There is no source with this ID");for(const Se in this._layers)if(this._layers[Se].source===P)return this.fire(new t.j(new Error(`Source "${P}" cannot be removed while layer "${Se}" is using it.`)));const oe=this.sourceCaches[P];delete this.sourceCaches[P],delete this._updatedSources[P],oe.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:P})),oe.setEventedParent(null),oe.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(P,oe){if(this._checkLoaded(),this.sourceCaches[P]===void 0)throw new Error(`There is no source with this ID=${P}`);const Se=this.sourceCaches[P].getSource();if(Se.type!=="geojson")throw new Error(`geojsonSource.type is ${Se.type}, which is !== 'geojson`);Se.setData(oe),this._changed=!0}getSource(P){return this.sourceCaches[P]&&this.sourceCaches[P].getSource()}addLayer(P,oe,Se={}){this._checkLoaded();const ke=P.id;if(this.getLayer(ke))return void this.fire(new t.j(new Error(`Layer "${ke}" already exists on this map.`)));let Be;if(P.type==="custom"){if(jr(this,t.aD(P)))return;Be=t.aA(P)}else{if("source"in P&&typeof P.source=="object"&&(this.addSource(ke,P.source),P=t.aB(P),P=t.e(P,{source:ke})),this._validate(t.u.layer,`layers.${ke}`,P,{arrayIndex:-1},Se))return;Be=t.aA(P),this._validateLayer(Be),Be.setEventedParent(this,{layer:{id:ke}})}const gt=oe?this._order.indexOf(oe):this._order.length;if(oe&>===-1)this.fire(new t.j(new Error(`Cannot add layer "${ke}" before non-existing layer "${oe}".`)));else{if(this._order.splice(gt,0,ke),this._layerOrderChanged=!0,this._layers[ke]=Be,this._removedLayers[ke]&&Be.source&&Be.type!=="custom"){const kt=this._removedLayers[ke];delete this._removedLayers[ke],kt.type!==Be.type?this._updatedSources[Be.source]="clear":(this._updatedSources[Be.source]="reload",this.sourceCaches[Be.source].pause())}this._updateLayer(Be),Be.onAdd&&Be.onAdd(this.map)}}moveLayer(P,oe){if(this._checkLoaded(),this._changed=!0,!this._layers[P])return void this.fire(new t.j(new Error(`The layer '${P}' does not exist in the map's style and cannot be moved.`)));if(P===oe)return;const Se=this._order.indexOf(P);this._order.splice(Se,1);const ke=oe?this._order.indexOf(oe):this._order.length;oe&&ke===-1?this.fire(new t.j(new Error(`Cannot move layer "${P}" before non-existing layer "${oe}".`))):(this._order.splice(ke,0,P),this._layerOrderChanged=!0)}removeLayer(P){this._checkLoaded();const oe=this._layers[P];if(!oe)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${P}".`)));oe.setEventedParent(null);const Se=this._order.indexOf(P);this._order.splice(Se,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[P]=oe,delete this._layers[P],this._serializedLayers&&delete this._serializedLayers[P],delete this._updatedLayers[P],delete this._updatedPaintProps[P],oe.onRemove&&oe.onRemove(this.map)}getLayer(P){return this._layers[P]}getLayersOrder(){return[...this._order]}hasLayer(P){return P in this._layers}setLayerZoomRange(P,oe,Se){this._checkLoaded();const ke=this.getLayer(P);ke?ke.minzoom===oe&&ke.maxzoom===Se||(oe!=null&&(ke.minzoom=oe),Se!=null&&(ke.maxzoom=Se),this._updateLayer(ke)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${P}".`)))}setFilter(P,oe,Se={}){this._checkLoaded();const ke=this.getLayer(P);if(ke){if(!t.aE(ke.filter,oe))return oe==null?(ke.filter=void 0,void this._updateLayer(ke)):void(this._validate(t.u.filter,`layers.${ke.id}.filter`,oe,null,Se)||(ke.filter=t.aB(oe),this._updateLayer(ke)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${P}".`)))}getFilter(P){return t.aB(this.getLayer(P).filter)}setLayoutProperty(P,oe,Se,ke={}){this._checkLoaded();const Be=this.getLayer(P);Be?t.aE(Be.getLayoutProperty(oe),Se)||(Be.setLayoutProperty(oe,Se,ke),this._updateLayer(Be)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${P}".`)))}getLayoutProperty(P,oe){const Se=this.getLayer(P);if(Se)return Se.getLayoutProperty(oe);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${P}".`)))}setPaintProperty(P,oe,Se,ke={}){this._checkLoaded();const Be=this.getLayer(P);Be?t.aE(Be.getPaintProperty(oe),Se)||(Be.setPaintProperty(oe,Se,ke)&&this._updateLayer(Be),this._changed=!0,this._updatedPaintProps[P]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${P}".`)))}getPaintProperty(P,oe){return this.getLayer(P).getPaintProperty(oe)}setFeatureState(P,oe){this._checkLoaded();const Se=P.source,ke=P.sourceLayer,Be=this.sourceCaches[Se];if(Be===void 0)return void this.fire(new t.j(new Error(`The source '${Se}' does not exist in the map's style.`)));const gt=Be.getSource().type;gt==="geojson"&&ke?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):gt!=="vector"||ke?(P.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Be.setFeatureState(ke,P.id,oe)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(P,oe){this._checkLoaded();const Se=P.source,ke=this.sourceCaches[Se];if(ke===void 0)return void this.fire(new t.j(new Error(`The source '${Se}' does not exist in the map's style.`)));const Be=ke.getSource().type,gt=Be==="vector"?P.sourceLayer:void 0;Be!=="vector"||gt?oe&&typeof P.id!="string"&&typeof P.id!="number"?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):ke.removeFeatureState(gt,P.id,oe):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(P){this._checkLoaded();const oe=P.source,Se=P.sourceLayer,ke=this.sourceCaches[oe];if(ke!==void 0)return ke.getSource().type!=="vector"||Se?(P.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),ke.getFeatureState(Se,P.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${oe}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const P=t.aF(this.sourceCaches,Be=>Be.serialize()),oe=this._serializeByIds(this._order,!0),Se=this.map.getTerrain()||void 0,ke=this.stylesheet;return t.aG({version:ke.version,name:ke.name,metadata:ke.metadata,light:ke.light,sky:ke.sky,center:ke.center,zoom:ke.zoom,bearing:ke.bearing,pitch:ke.pitch,sprite:ke.sprite,glyphs:ke.glyphs,transition:ke.transition,sources:P,layers:oe,terrain:Se},Be=>Be!==void 0)}_updateLayer(P){this._updatedLayers[P.id]=!0,P.source&&!this._updatedSources[P.source]&&this.sourceCaches[P.source].getSource().type!=="raster"&&(this._updatedSources[P.source]="reload",this.sourceCaches[P.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(P){const oe=gt=>this._layers[gt].type==="fill-extrusion",Se={},ke=[];for(let gt=this._order.length-1;gt>=0;gt--){const kt=this._order[gt];if(oe(kt)){Se[kt]=gt;for(const Gt of P){const cr=Gt[kt];if(cr)for(const Ar of cr)ke.push(Ar)}}}ke.sort((gt,kt)=>kt.intersectionZ-gt.intersectionZ);const Be=[];for(let gt=this._order.length-1;gt>=0;gt--){const kt=this._order[gt];if(oe(kt))for(let Gt=ke.length-1;Gt>=0;Gt--){const cr=ke[Gt].feature;if(Se[cr.layer.id]{const Gr=_t.featureSortOrder;if(Gr){const on=Gr.indexOf(Tr.featureIndex);return Gr.indexOf(Lr.featureIndex)-on}return Lr.featureIndex-Tr.featureIndex});for(const Tr of mr)Ut.push(Tr)}}for(const _t in Ze)Ze[_t].forEach(zt=>{const Et=zt.feature,Ut=cr[kt[_t].source].getFeatureState(Et.layer["source-layer"],Et.id);Et.source=Et.layer.source,Et.layer["source-layer"]&&(Et.sourceLayer=Et.layer["source-layer"]),Et.state=Ut});return Ze})(this._layers,gt,this.sourceCaches,P,oe,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Be)}querySourceFeatures(P,oe){oe&&oe.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",oe.filter,null,oe);const Se=this.sourceCaches[P];return Se?(function(ke,Be){const gt=ke.getRenderableIds().map(cr=>ke.getTileByID(cr)),kt=[],Gt={};for(let cr=0;crQr.getTileByID(_n)).sort((_n,Ze)=>Ze.tileID.overscaledZ-_n.tileID.overscaledZ||(_n.tileID.isLessThan(Ze.tileID)?-1:1))}const Cr=this.crossTileSymbolIndex.addLayer(Ar,Gt[Ar.source],P.center.lng);gt=gt||Cr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Be=Be||this._layerOrderChanged||Se===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.now(),P.zoom))&&(this.pauseablePlacement=new yi(P,this.map.terrain,this._order,Be,oe,Se,ke,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Gt),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),kt=!0),gt&&this.pauseablePlacement.placement.setStale()),kt||gt)for(const cr of this._order){const Ar=this._layers[cr];Ar.type==="symbol"&&this.placement.updateLayerOpacities(Ar,Gt[Ar.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.now())}_releaseSymbolFadeTiles(){for(const P in this.sourceCaches)this.sourceCaches[P].releaseSymbolFadeTiles()}getImages(P,oe){return t._(this,void 0,void 0,function*(){const Se=yield this.imageManager.getImages(oe.icons);this._updateTilesForChangedImages();const ke=this.sourceCaches[oe.source];return ke&&ke.setDependencies(oe.tileID.key,oe.type,oe.icons),Se})}getGlyphs(P,oe){return t._(this,void 0,void 0,function*(){const Se=yield this.glyphManager.getGlyphs(oe.stacks),ke=this.sourceCaches[oe.source];return ke&&ke.setDependencies(oe.tileID.key,oe.type,[""]),Se})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(P,oe={}){this._checkLoaded(),P&&this._validate(t.u.glyphs,"glyphs",P,null,oe)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=P,this.glyphManager.entries={},this.glyphManager.setURL(P))}addSprite(P,oe,Se={},ke){this._checkLoaded();const Be=[{id:P,url:oe}],gt=[...w(this.stylesheet.sprite),...Be];this._validate(t.u.sprite,"sprite",gt,null,Se)||(this.stylesheet.sprite=gt,this._loadSprite(Be,!0,ke))}removeSprite(P){this._checkLoaded();const oe=w(this.stylesheet.sprite);if(oe.find(Se=>Se.id===P)){if(this._spritesImagesIds[P])for(const Se of this._spritesImagesIds[P])this.imageManager.removeImage(Se),this._changedImages[Se]=!0;oe.splice(oe.findIndex(Se=>Se.id===P),1),this.stylesheet.sprite=oe.length>0?oe:void 0,delete this._spritesImagesIds[P],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}else this.fire(new t.j(new Error(`Sprite "${P}" doesn't exists on this map.`)))}getSprite(){return w(this.stylesheet.sprite)}setSprite(P,oe={},Se){this._checkLoaded(),P&&this._validate(t.u.sprite,"sprite",P,null,oe)||(this.stylesheet.sprite=P,P?this._loadSprite(P,!0,Se):(this._unloadSprite(),Se&&Se(null)))}}var ln=t.Y([{name:"a_pos",type:"Int16",components:2}]);const $r={prelude:At(`#ifdef GL_ES +{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),T7=Ge({"src/plots/map/styles/arcgis-sat.js"(K,G){G.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),j_=Ge({"src/plots/map/constants.js"(K,G){var h=Op(),b=w7(),S=T7(),E='© OpenStreetMap contributors',e="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",t="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",n="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",a={basic:r,streets:r,outdoors:r,light:e,dark:t,satellite:S,"satellite-streets":b,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:E,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":e,"carto-darkmatter":t,"carto-voyager":r,"carto-positron-nolabels":o,"carto-darkmatter-nolabels":n,"carto-voyager-nolabels":i},s=h(a);G.exports={styleValueDflt:"basic",stylesMap:a,styleValuesMap:s,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",s.join(", "),"or use a tile service."].join(` +`),mapOnErrorMsg:"Map error."}}}),fS=Ge({"src/plots/map/layout_attributes.js"(K,G){var h=_n(),b=go().defaultLine,S=Cc().attributes,E=Us(),e=Gc().textposition,t=Hc().overrideAll,r=_u().templatedArray,o=j_(),n=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[h.counterRegex("map",".layers",!0)],domain:S({name:"map"}),style:{valType:"any",values:o.styleValuesMap,dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:b},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:b}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:h.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),KE=Ge({"src/traces/scattermap/attributes.js"(K,G){var{hovertemplateAttrs:h,texttemplateAttrs:b,templatefallbackAttrs:S}=Sl(),E=cv(),e=Wb(),t=Gc(),r=fS(),o=Jl(),n=zu(),i=Ji().extendFlat,a=Hc().overrideAll,s=fS(),f=e.line,c=e.marker;G.exports=a({lon:e.lon,lat:e.lat,cluster:{enabled:{valType:"boolean"},maxzoom:i({},s.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:i({},c.opacity,{dflt:1})},mode:i({},t.mode,{dflt:"markers"}),text:i({},t.text,{}),texttemplate:b({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:S({editType:"plot"}),hovertext:i({},t.hovertext,{}),line:{color:f.color,width:f.width},connectgaps:t.connectgaps,marker:i({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},n("marker")),fill:e.fill,fillcolor:E(),textfont:r.layers.symbol.textfont,textposition:r.layers.symbol.textposition,below:{valType:"string"},selected:{marker:t.selected.marker},unselected:{marker:t.unselected.marker},hoverinfo:i({},o.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:h(),hovertemplatefallback:S()},"calc","nested")}}),kL=Ge({"src/traces/scattermap/constants.js"(K,G){var h=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];G.exports={isSupportedFont:function(b){return h.indexOf(b)!==-1}}}}),A7=Ge({"src/traces/scattermap/defaults.js"(K,G){var h=_n(),b=uu(),S=Jd(),E=Hp(),e=op(),t=Nd(),r=KE(),o=kL().isSupportedFont;G.exports=function(a,s,f,c){function p(d,y){return h.coerce(a,s,r,d,y)}function v(d,y){return h.coerce2(a,s,r,d,y)}var T=n(a,s,p);if(!T){s.visible=!1;return}if(p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback"),p("mode"),p("below"),b.hasMarkers(s)){S(a,s,f,c,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var l=s.marker;l.symbol!=="circle"&&(h.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),h.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}b.hasLines(s)&&(E(a,s,f,c,p,{noDash:!0}),p("connectgaps"));var g=v("cluster.maxzoom"),x=v("cluster.step"),A=v("cluster.color",s.marker&&s.marker.color||f),M=v("cluster.size"),_=v("cluster.opacity"),w=g!==!1||x!==!1||A!==!1||M!==!1||_!==!1,m=p("cluster.enabled",w);if(m||b.hasText(s)){var u=c.font.family;e(a,s,c,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:c.font.weight,style:c.font.style,size:c.font.size,color:c.font.color}})}p("fill"),s.fill!=="none"&&t(a,s,f,p),h.coerceSelectionMarkerOpacity(s,p)};function n(i,a,s){var f=s("lon")||[],c=s("lat")||[],p=Math.min(f.length,c.length);return a._length=p,p}}}),CL=Ge({"src/traces/scattermap/format_labels.js"(K,G){var h=Ts();G.exports=function(S,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,n=S.lonlat;return t.lonLabel=h.tickText(o,o.c2l(n[0]),!0).text,t.latLabel=h.tickText(o,o.c2l(n[1]),!0).text,t}}}),LL=Ge({"src/plots/map/convert_text_opts.js"(K,G){var h=_n();G.exports=function(S,E){var e=S.split(" "),t=e[0],r=e[1],o=h.isArrayOrTypedArray(E)?h.mean(E):E,n=.5+o/100,i=1.5+o/100,a=["",""],s=[0,0];switch(t){case"top":a[0]="top",s[1]=-i;break;case"bottom":a[0]="bottom",s[1]=i;break}switch(r){case"left":a[1]="right",s[0]=-n;break;case"right":a[1]="left",s[0]=n;break}var f;return a[0]&&a[1]?f=a.join("-"):a[0]?f=a[0]:a[1]?f=a[1]:f="center",{anchor:f,offset:s}}}}),S7=Ge({"src/traces/scattermap/convert.js"(K,G){var h=Ei(),b=_n(),S=Ii().BADNUM,E=O_(),e=kc(),t=As(),r=Bp(),o=uu(),n=kL().isSupportedFont,i=LL(),a=Kd().appendArrayPointValue,s=nc().NEWLINES,f=nc().BR_TAG_ALL;G.exports=function(_,w){var m=w[0].trace,u=m.visible===!0&&m._length!==0,d=m.fill!=="none",y=o.hasLines(m),I=o.hasMarkers(m),L=o.hasText(m),z=I&&m.marker.symbol==="circle",F=I&&m.marker.symbol!=="circle",N=m.cluster&&m.cluster.enabled,B=c("fill"),R=c("line"),U=c("circle"),j=c("symbol"),Z={fill:B,line:R,circle:U,symbol:j};if(!u)return Z;var re;if((d||y)&&(re=E.calcTraceToLineCoords(w)),d&&(B.geojson=E.makePolygon(re),B.layout.visibility="visible",b.extendFlat(B.paint,{"fill-color":m.fillcolor})),y&&(R.geojson=E.makeLine(re),R.layout.visibility="visible",b.extendFlat(R.paint,{"line-width":m.line.width,"line-color":m.line.color,"line-opacity":m.opacity})),z){var fe=p(w);U.geojson=fe.geojson,U.layout.visibility="visible",N&&(U.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(m.cluster.color,m.cluster.step),"circle-radius":x(m.cluster.size,m.cluster.step),"circle-opacity":x(m.cluster.opacity,m.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":A(m),"text-size":12}}),b.extendFlat(U.paint,{"circle-color":fe.mcc,"circle-radius":fe.mrc,"circle-opacity":fe.mo})}if(z&&N&&(U.filter=["!",["has","point_count"]]),(F||L)&&(j.geojson=v(w,_),b.extendFlat(j.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(b.extendFlat(j.layout,{"icon-size":m.marker.size/10}),"angle"in m.marker&&m.marker.angle!=="auto"&&b.extendFlat(j.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),j.layout["icon-allow-overlap"]=m.marker.allowoverlap,b.extendFlat(j.paint,{"icon-opacity":m.opacity*m.marker.opacity,"icon-color":m.marker.color})),L)){var le=(m.marker||{}).size,ce=i(m.textposition,le);b.extendFlat(j.layout,{"text-size":m.textfont.size,"text-anchor":ce.anchor,"text-offset":ce.offset,"text-font":A(m)}),b.extendFlat(j.paint,{"text-color":m.textfont.color,"text-opacity":m.opacity})}return Z};function c(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function p(M){var _=M[0].trace,w=_.marker,m=_.selectedpoints,u=b.isArrayOrTypedArray(w.color),d=b.isArrayOrTypedArray(w.size),y=b.isArrayOrTypedArray(w.opacity),I;function L(le){return _.opacity*le}function z(le){return le/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=b.identity);var N;d&&(N=r(_));var B;y&&(B=function(le){var ce=h(le)?+b.constrain(le,0,1):0;return L(ce)});var R=[];for(I=0;I850?I+=" Black":u>750?I+=" Extra Bold":u>650?I+=" Bold":u>550?I+=" Semi Bold":u>450?I+=" Medium":u>350?I+=" Regular":u>250?I+=" Light":u>150?I+=" Extra Light":I+=" Thin"):d.slice(0,2).join(" ")==="Open Sans"?(I="Open Sans",u>750?I+=" Extrabold":u>650?I+=" Bold":u>550?I+=" Semibold":u>350?I+=" Regular":I+=" Light"):d.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(I="Klokantech Noto Sans",d[3]==="CJK"&&(I+=" CJK"),I+=u>500?" Bold":" Regular")),y&&(I+=" Italic"),I==="Open Sans Regular Italic"?I="Open Sans Italic":I==="Open Sans Regular Bold"?I="Open Sans Bold":I==="Open Sans Regular Bold Italic"?I="Open Sans Bold Italic":I==="Klokantech Noto Sans Regular Italic"&&(I="Klokantech Noto Sans Italic"),n(I)||(I=w);var L=I.split(", ");return L}}}),M7=Ge({"src/traces/scattermap/plot.js"(K,G){var h=_n(),b=S7(),S=j_().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,n,i){this.type="scattermap",this.subplot=r,this.uid=o,this.clusterEnabled=n,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:S+o+"-fill",line:S+o+"-line",circle:S+o+"-circle",symbol:S+o+"-symbol",cluster:S+o+"-cluster",clusterCount:S+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,n){var i={type:"geojson",data:o.geojson};n&&n.enabled&&h.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[r]);a?a.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,n){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var a=this.layerIds[r],s,f=this.subplot.getMapLayers(),c=0;c=0;y--){var I=d[y];a.removeLayer(v.layerIds[I])}u||a.removeSource(v.sourceIds.circle)}function g(u){for(var d=E.nonCluster,y=0;y=0;y--){var I=d[y];a.removeLayer(v.layerIds[I]),u||a.removeSource(v.sourceIds[I])}}function A(u){p?l(u):x(u)}function M(u){c?T(u):g(u)}function _(){for(var u=c?E.cluster:E.nonCluster,d=0;d=0;i--){var a=n[i];o.removeLayer(this.layerIds[a]),o.removeSource(this.sourceIds[a])}},G.exports=function(o,n){var i=n[0].trace,a=i.cluster&&i.cluster.enabled,s=i.visible!==!0,f=new e(o,i.uid,a,s),c=b(o.gd,n),p=f.below=o.belowLookup["trace-"+i.uid],v,T,l;if(a)for(f.addSource("circle",c.circle,i.cluster),v=0;v=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=A*360,_=i-M;function w(N){var B=N.lonlat;if(B[0]===e||g&&T.indexOf(N.i+1)===-1)return 1/0;var R=b.modHalf(B[0],360),U=B[1],j=v.project([R,U]),Z=j.x-c.c2p([_,U]),re=j.y-p.c2p([R,a]),fe=Math.max(3,N.mrc||0);return Math.max(Math.sqrt(Z*Z+re*re)-fe,1-3/fe)}if(h.getClosest(s,w,n),n.index!==!1){var m=s[n.index],u=m.lonlat,d=[b.modHalf(u[0],360)+M,u[1]],y=c.c2p(d),I=p.c2p(d),L=m.mrc||1;n.x0=y-L,n.x1=y+L,n.y0=I-L,n.y1=I+L;var z={};z[f.subplot]={_subplot:v};var F=f._module.formatLabels(m,f,z);return n.lonLabel=F.lonLabel,n.latLabel=F.latLabel,n.color=S(f,m),n.extraText=o(f,m,s[0].t.labels),n.hovertemplate=f.hovertemplate,[n]}}function o(n,i,a){if(n.hovertemplate)return;var s=i.hi||n.hoverinfo,f=s.split("+"),c=f.indexOf("all")!==-1,p=f.indexOf("lon")!==-1,v=f.indexOf("lat")!==-1,T=i.lonlat,l=[];function g(x){return x+"°"}return c||p&&v?l.push("("+g(T[1])+", "+g(T[0])+")"):p?l.push(a.lon+g(T[0])):v&&l.push(a.lat+g(T[1])),(c||f.indexOf("text")!==-1)&&E(i,n,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),E7=Ge({"src/traces/scattermap/event_data.js"(K,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b}}}),k7=Ge({"src/traces/scattermap/select.js"(K,G){var h=_n(),b=uu(),S=Ii().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,n=e.yaxis,i=[],a=r[0].trace,s;if(!b.hasMarkers(a))return[];if(t===!1)for(s=0;s1)return 1;for(var Q=Y,me=0;me<8;me++){var Re=this.sampleCurveX(Q)-Y;if(Math.abs(Re)Re?We=Q:gt=Q,Q=.5*(gt-We)+We;return Q},solve:function(Y,D){return this.sampleCurveY(this.solveCurveX(Y,D))}};var f=r(a);let c,p;function v(){return c==null&&(c=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),c}function T(){if(p==null&&(p=!1,v())){const D=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(D){for(let me=0;me<25;me++){const Re=4*me;D.fillStyle=`rgb(${Re},${Re+1},${Re+2})`,D.fillRect(me%5,Math.floor(me/5),1,1)}const Q=D.getImageData(0,0,5,5).data;for(let me=0;me<100;me++)if(me%4!=3&&Q[me]!==me){p=!0;break}}}return p||!1}function l(Y,D,Q,me){const Re=new f(Y,D,Q,me);return Ve=>Re.solve(Ve)}const g=l(.25,.1,.25,1);function x(Y,D,Q){return Math.min(Q,Math.max(D,Y))}function A(Y,D,Q){const me=Q-D,Re=((Y-D)%me+me)%me+D;return Re===D?Q:Re}function M(Y,...D){for(const Q of D)for(const me in Q)Y[me]=Q[me];return Y}let _=1;function w(Y,D,Q){const me={};for(const Re in Y)me[Re]=D.call(this,Y[Re],Re,Y);return me}function m(Y,D,Q){const me={};for(const Re in Y)D.call(this,Y[Re],Re,Y)&&(me[Re]=Y[Re]);return me}function u(Y){return Array.isArray(Y)?Y.map(u):typeof Y=="object"&&Y?w(Y,u):Y}const d={};function y(Y){d[Y]||(typeof console<"u"&&console.warn(Y),d[Y]=!0)}function I(Y,D,Q){return(Q.y-Y.y)*(D.x-Y.x)>(D.y-Y.y)*(Q.x-Y.x)}function L(Y){return typeof WorkerGlobalScope<"u"&&Y!==void 0&&Y instanceof WorkerGlobalScope}let z=null;function F(Y){return typeof ImageBitmap<"u"&&Y instanceof ImageBitmap}const N="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function B(Y,D,Q,me,Re){return t(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const Ve=new VideoFrame(Y,{timestamp:0});try{const We=Ve?.format;if(!We||!We.startsWith("BGR")&&!We.startsWith("RGB"))throw new Error(`Unrecognized format ${We}`);const gt=We.startsWith("BGR"),Rt=new Uint8ClampedArray(me*Re*4);if(yield Ve.copyTo(Rt,(function(Wt,pr,br,Hr,Qr){const vn=4*Math.max(-pr,0),Sn=(Math.max(0,br)-br)*Hr*4+vn,Nn=4*Hr,va=Math.max(0,pr),oi=Math.max(0,br);return{rect:{x:va,y:oi,width:Math.min(Wt.width,pr+Hr)-va,height:Math.min(Wt.height,br+Qr)-oi},layout:[{offset:Sn,stride:Nn}]}})(Y,D,Q,me,Re)),gt)for(let Wt=0;WtL(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,ee=function(Y,D){if(/:\/\//.test(Y.url)&&!/^https?:|^file:/.test(Y.url)){const me=fe(Y.url);if(me)return me(Y,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Y,targetMapId:le},D)}if(!(/^file:/.test(Q=Y.url)||/^file:/.test(V())&&!/^\w+:/.test(Q))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(me,Re){return t(this,void 0,void 0,function*(){const Ve=new Request(me.url,{method:me.method||"GET",body:me.body,credentials:me.credentials,headers:me.headers,cache:me.cache,referrer:V(),signal:Re.signal});me.type!=="json"||Ve.headers.has("Accept")||Ve.headers.set("Accept","application/json");const We=yield fetch(Ve);if(!We.ok){const Wt=yield We.blob();throw new ce(We.status,We.statusText,me.url,Wt)}let gt;gt=me.type==="arrayBuffer"||me.type==="image"?We.arrayBuffer():me.type==="json"?We.json():We.text();const Rt=yield gt;if(Re.signal.aborted)throw Z();return{data:Rt,cacheControl:We.headers.get("Cache-Control"),expires:We.headers.get("Expires")}})})(Y,D);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Y,mustQueue:!0,targetMapId:le},D)}var Q;return(function(me,Re){return new Promise((Ve,We)=>{var gt;const Rt=new XMLHttpRequest;Rt.open(me.method||"GET",me.url,!0),me.type!=="arrayBuffer"&&me.type!=="image"||(Rt.responseType="arraybuffer");for(const Wt in me.headers)Rt.setRequestHeader(Wt,me.headers[Wt]);me.type==="json"&&(Rt.responseType="text",!((gt=me.headers)===null||gt===void 0)&>.Accept||Rt.setRequestHeader("Accept","application/json")),Rt.withCredentials=me.credentials==="include",Rt.onerror=()=>{We(new Error(Rt.statusText))},Rt.onload=()=>{if(!Re.signal.aborted)if((Rt.status>=200&&Rt.status<300||Rt.status===0)&&Rt.response!==null){let Wt=Rt.response;if(me.type==="json")try{Wt=JSON.parse(Rt.response)}catch(pr){return void We(pr)}Ve({data:Wt,cacheControl:Rt.getResponseHeader("Cache-Control"),expires:Rt.getResponseHeader("Expires")})}else{const Wt=new Blob([Rt.response],{type:Rt.getResponseHeader("Content-Type")});We(new ce(Rt.status,Rt.statusText,me.url,Wt))}},Re.signal.addEventListener("abort",()=>{Rt.abort(),We(Z())}),Rt.send(me.body)})})(Y,D)};function ne(Y){if(!Y||Y.indexOf("://")<=0||Y.indexOf("data:image/")===0||Y.indexOf("blob:")===0)return!0;const D=new URL(Y),Q=window.location;return D.protocol===Q.protocol&&D.host===Q.host}function $(Y,D,Q){Q[Y]&&Q[Y].indexOf(D)!==-1||(Q[Y]=Q[Y]||[],Q[Y].push(D))}function ue(Y,D,Q){if(Q&&Q[Y]){const me=Q[Y].indexOf(D);me!==-1&&Q[Y].splice(me,1)}}class te{constructor(D,Q={}){M(this,Q),this.type=D}}class H extends te{constructor(D,Q={}){super("error",M({error:D},Q))}}class ae{on(D,Q){return this._listeners=this._listeners||{},$(D,Q,this._listeners),this}off(D,Q){return ue(D,Q,this._listeners),ue(D,Q,this._oneTimeListeners),this}once(D,Q){return Q?(this._oneTimeListeners=this._oneTimeListeners||{},$(D,Q,this._oneTimeListeners),this):new Promise(me=>this.once(D,me))}fire(D,Q){typeof D=="string"&&(D=new te(D,Q||{}));const me=D.type;if(this.listens(me)){D.target=this;const Re=this._listeners&&this._listeners[me]?this._listeners[me].slice():[];for(const gt of Re)gt.call(this,D);const Ve=this._oneTimeListeners&&this._oneTimeListeners[me]?this._oneTimeListeners[me].slice():[];for(const gt of Ve)ue(me,gt,this._oneTimeListeners),gt.call(this,D);const We=this._eventedParent;We&&(M(D,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),We.fire(D))}else D instanceof H&&console.error(D.error);return this}listens(D){return this._listeners&&this._listeners[D]&&this._listeners[D].length>0||this._oneTimeListeners&&this._oneTimeListeners[D]&&this._oneTimeListeners[D].length>0||this._eventedParent&&this._eventedParent.listens(D)}setEventedParent(D,Q){return this._eventedParent=D,this._eventedParentData=Q,this}}var ie={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const de=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Se(Y,D){const Q={};for(const me in Y)me!=="ref"&&(Q[me]=Y[me]);return de.forEach(me=>{me in D&&(Q[me]=D[me])}),Q}function Le(Y,D){if(Array.isArray(Y)){if(!Array.isArray(D)||Y.length!==D.length)return!1;for(let Q=0;Q`:Y.itemType.kind==="value"?"array":`array<${D}>`}return Y.kind}const ke=[dt,nt,Ft,Nt,Qt,$r,ar,je(kr),Sr,Ur,Mt];function xe(Y,D){if(D.kind==="error")return null;if(Y.kind==="array"){if(D.kind==="array"&&(D.N===0&&D.itemType.kind==="value"||!xe(Y.itemType,D.itemType))&&(typeof Y.N!="number"||Y.N===D.N))return null}else{if(Y.kind===D.kind)return null;if(Y.kind==="value"){for(const Q of ke)if(!xe(Q,D))return null}}return`Expected ${Je(Y)} but found ${Je(D)} instead.`}function ye(Y,D){return D.some(Q=>Q.kind===Y.kind)}function Ee(Y,D){return D.some(Q=>Q==="null"?Y===null:Q==="array"?Array.isArray(Y):Q==="object"?Y&&!Array.isArray(Y)&&typeof Y=="object":Q===typeof Y)}function Xe(Y,D){return Y.kind==="array"&&D.kind==="array"?Y.itemType.kind===D.itemType.kind&&typeof Y.N=="number":Y.kind===D.kind}const Qe=.96422,Lt=.82521,Ct=4/29,Ot=6/29,Kt=3*Ot*Ot,xr=Ot*Ot*Ot,mr=Math.PI/180,vr=180/Math.PI;function Nr(Y){return(Y%=360)<0&&(Y+=360),Y}function kn([Y,D,Q,me]){let Re,Ve;const We=Vn((.2225045*(Y=$n(Y))+.7168786*(D=$n(D))+.0606169*(Q=$n(Q)))/1);Y===D&&D===Q?Re=Ve=We:(Re=Vn((.4360747*Y+.3850649*D+.1430804*Q)/Qe),Ve=Vn((.0139322*Y+.0971045*D+.7141733*Q)/Lt));const gt=116*We-16;return[gt<0?0:gt,500*(Re-We),200*(We-Ve),me]}function $n(Y){return Y<=.04045?Y/12.92:Math.pow((Y+.055)/1.055,2.4)}function Vn(Y){return Y>xr?Math.pow(Y,1/3):Y/Kt+Ct}function ra([Y,D,Q,me]){let Re=(Y+16)/116,Ve=isNaN(D)?Re:Re+D/500,We=isNaN(Q)?Re:Re-Q/200;return Re=1*Un(Re),Ve=Qe*Un(Ve),We=Lt*Un(We),[na(3.1338561*Ve-1.6168667*Re-.4906146*We),na(-.9787684*Ve+1.9161415*Re+.033454*We),na(.0719453*Ve-.2289914*Re+1.4052427*We),me]}function na(Y){return(Y=Y<=.00304?12.92*Y:1.055*Math.pow(Y,1/2.4)-.055)<0?0:Y>1?1:Y}function Un(Y){return Y>Ot?Y*Y*Y:Kt*(Y-Ct)}function ka(Y){return parseInt(Y.padEnd(2,Y),16)/255}function Va(Y,D){return sr(D?Y/100:Y,0,1)}function sr(Y,D,Q){return Math.min(Math.max(D,Y),Q)}function Vt(Y){return!Y.some(Number.isNaN)}const or={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]};class ur{constructor(D,Q,me,Re=1,Ve=!0){this.r=D,this.g=Q,this.b=me,this.a=Re,Ve||(this.r*=Re,this.g*=Re,this.b*=Re,Re||this.overwriteGetter("rgb",[D,Q,me,Re]))}static parse(D){if(D instanceof ur)return D;if(typeof D!="string")return;const Q=(function(me){if((me=me.toLowerCase().trim())==="transparent")return[0,0,0,0];const Re=or[me];if(Re){const[We,gt,Rt]=Re;return[We/255,gt/255,Rt/255,1]}if(me.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(me)){const We=me.length<6?1:2;let gt=1;return[ka(me.slice(gt,gt+=We)),ka(me.slice(gt,gt+=We)),ka(me.slice(gt,gt+=We)),ka(me.slice(gt,gt+We)||"ff")]}if(me.startsWith("rgb")){const We=me.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(We){const[gt,Rt,Wt,pr,br,Hr,Qr,vn,Sn,Nn,va,oi]=We,Ba=[pr||" ",Qr||" ",Nn].join("");if(Ba===" "||Ba===" /"||Ba===",,"||Ba===",,,"){const ei=[Wt,Hr,Sn].join(""),Oi=ei==="%%%"?100:ei===""?255:0;if(Oi){const fo=[sr(+Rt/Oi,0,1),sr(+br/Oi,0,1),sr(+vn/Oi,0,1),va?Va(+va,oi):1];if(Vt(fo))return fo}}return}}const Ve=me.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Ve){const[We,gt,Rt,Wt,pr,br,Hr,Qr,vn]=Ve,Sn=[Rt||" ",pr||" ",Hr].join("");if(Sn===" "||Sn===" /"||Sn===",,"||Sn===",,,"){const Nn=[+gt,sr(+Wt,0,100),sr(+br,0,100),Qr?Va(+Qr,vn):1];if(Vt(Nn))return(function([va,oi,Ba,ei]){function Oi(fo){const $o=(fo+va/30)%12,dl=oi*Math.min(Ba,1-Ba);return Ba-dl*Math.max(-1,Math.min($o-3,9-$o,1))}return va=Nr(va),oi/=100,Ba/=100,[Oi(0),Oi(8),Oi(4),ei]})(Nn)}}})(D);return Q?new ur(...Q,!1):void 0}get rgb(){const{r:D,g:Q,b:me,a:Re}=this,Ve=Re||1/0;return this.overwriteGetter("rgb",[D/Ve,Q/Ve,me/Ve,Re])}get hcl(){return this.overwriteGetter("hcl",(function(D){const[Q,me,Re,Ve]=kn(D),We=Math.sqrt(me*me+Re*Re);return[Math.round(1e4*We)?Nr(Math.atan2(Re,me)*vr):NaN,We,Q,Ve]})(this.rgb))}get lab(){return this.overwriteGetter("lab",kn(this.rgb))}overwriteGetter(D,Q){return Object.defineProperty(this,D,{value:Q}),Q}toString(){const[D,Q,me,Re]=this.rgb;return`rgba(${[D,Q,me].map(Ve=>Math.round(255*Ve)).join(",")},${Re})`}}ur.black=new ur(0,0,0,1),ur.white=new ur(1,1,1,1),ur.transparent=new ur(0,0,0,0),ur.red=new ur(1,0,0,1);class Gr{constructor(D,Q,me){this.sensitivity=D?Q?"variant":"case":Q?"accent":"base",this.locale=me,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(D,Q){return this.collator.compare(D,Q)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ln{constructor(D,Q,me,Re,Ve){this.text=D,this.image=Q,this.scale=me,this.fontStack=Re,this.textColor=Ve}}class gn{constructor(D){this.sections=D}static fromString(D){return new gn([new ln(D,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(D=>D.text.length!==0||D.image&&D.image.name.length!==0)}static factory(D){return D instanceof gn?D:gn.fromString(D)}toString(){return this.sections.length===0?"":this.sections.map(D=>D.text).join("")}}class An{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof An)return D;if(typeof D=="number")return new An([D,D,D,D]);if(Array.isArray(D)&&!(D.length<1||D.length>4)){for(const Q of D)if(typeof Q!="number")return;switch(D.length){case 1:D=[D[0],D[0],D[0],D[0]];break;case 2:D=[D[0],D[1],D[0],D[1]];break;case 3:D=[D[0],D[1],D[2],D[1]]}return new An(D)}}toString(){return JSON.stringify(this.values)}}const Qn=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class pa{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof pa)return D;if(Array.isArray(D)&&!(D.length<1)&&D.length%2==0){for(let Q=0;Q=0&&Y<=255&&typeof D=="number"&&D>=0&&D<=255&&typeof Q=="number"&&Q>=0&&Q<=255?me===void 0||typeof me=="number"&&me>=0&&me<=1?null:`Invalid rgba value [${[Y,D,Q,me].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof me=="number"?[Y,D,Q,me]:[Y,D,Q]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ca(Y){if(Y===null||typeof Y=="string"||typeof Y=="boolean"||typeof Y=="number"||Y instanceof ur||Y instanceof Gr||Y instanceof gn||Y instanceof An||Y instanceof pa||Y instanceof ha)return!0;if(Array.isArray(Y)){for(const D of Y)if(!Ca(D))return!1;return!0}if(typeof Y=="object"){for(const D in Y)if(!Ca(Y[D]))return!1;return!0}return!1}function Hn(Y){if(Y===null)return dt;if(typeof Y=="string")return Ft;if(typeof Y=="boolean")return Nt;if(typeof Y=="number")return nt;if(Y instanceof ur)return Qt;if(Y instanceof Gr)return Er;if(Y instanceof gn)return $r;if(Y instanceof An)return Sr;if(Y instanceof pa)return Mt;if(Y instanceof ha)return Ur;if(Array.isArray(Y)){const D=Y.length;let Q;for(const me of Y){const Re=Hn(me);if(Q){if(Q===Re)continue;Q=kr;break}Q=Re}return je(Q||kr,D)}return ar}function pi(Y){const D=typeof Y;return Y===null?"":D==="string"||D==="number"||D==="boolean"?String(Y):Y instanceof ur||Y instanceof gn||Y instanceof An||Y instanceof pa||Y instanceof ha?Y.toString():JSON.stringify(Y)}class Si{constructor(D,Q){this.type=D,this.value=Q}static parse(D,Q){if(D.length!==2)return Q.error(`'literal' expression requires exactly one argument, but found ${D.length-1} instead.`);if(!Ca(D[1]))return Q.error("invalid value");const me=D[1];let Re=Hn(me);const Ve=Q.expectedType;return Re.kind!=="array"||Re.N!==0||!Ve||Ve.kind!=="array"||typeof Ve.N=="number"&&Ve.N!==0||(Re=Ve),new Si(Re,me)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Dt{constructor(D){this.name="ExpressionEvaluationError",this.message=D}toJSON(){return this.message}}const xt={string:Ft,number:nt,boolean:Nt,object:ar};class Cr{constructor(D,Q){this.type=D,this.args=Q}static parse(D,Q){if(D.length<2)return Q.error("Expected at least one argument.");let me,Re=1;const Ve=D[0];if(Ve==="array"){let gt,Rt;if(D.length>2){const Wt=D[1];if(typeof Wt!="string"||!(Wt in xt)||Wt==="object")return Q.error('The item type argument of "array" must be one of string, number, boolean',1);gt=xt[Wt],Re++}else gt=kr;if(D.length>3){if(D[2]!==null&&(typeof D[2]!="number"||D[2]<0||D[2]!==Math.floor(D[2])))return Q.error('The length argument to "array" must be a positive integer literal',2);Rt=D[2],Re++}me=je(gt,Rt)}else{if(!xt[Ve])throw new Error(`Types doesn't contain name = ${Ve}`);me=xt[Ve]}const We=[];for(;ReD.outputDefined())}}const jr={"to-boolean":Nt,"to-color":Qt,"to-number":nt,"to-string":Ft};class Vr{constructor(D,Q){this.type=D,this.args=Q}static parse(D,Q){if(D.length<2)return Q.error("Expected at least one argument.");const me=D[0];if(!jr[me])throw new Error(`Can't parse ${me} as it is not part of the known types`);if((me==="to-boolean"||me==="to-string")&&D.length!==2)return Q.error("Expected one argument.");const Re=jr[me],Ve=[];for(let We=1;We4?`Invalid rbga value ${JSON.stringify(Q)}: expected an array containing either three or four numeric values.`:_a(Q[0],Q[1],Q[2],Q[3]),!me))return new ur(Q[0]/255,Q[1]/255,Q[2]/255,Q[3])}throw new Dt(me||`Could not parse color from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"padding":{let Q;for(const me of this.args){Q=me.evaluate(D);const Re=An.parse(Q);if(Re)return Re}throw new Dt(`Could not parse padding from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"variableAnchorOffsetCollection":{let Q;for(const me of this.args){Q=me.evaluate(D);const Re=pa.parse(Q);if(Re)return Re}throw new Dt(`Could not parse variableAnchorOffsetCollection from value '${typeof Q=="string"?Q:JSON.stringify(Q)}'`)}case"number":{let Q=null;for(const me of this.args){if(Q=me.evaluate(D),Q===null)return 0;const Re=Number(Q);if(!isNaN(Re))return Re}throw new Dt(`Could not convert ${JSON.stringify(Q)} to number.`)}case"formatted":return gn.fromString(pi(this.args[0].evaluate(D)));case"resolvedImage":return ha.fromString(pi(this.args[0].evaluate(D)));default:return pi(this.args[0].evaluate(D))}}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}const Dr=["Unknown","Point","LineString","Polygon"];class qr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Dr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(D){let Q=this._parseColorCache[D];return Q||(Q=this._parseColorCache[D]=ur.parse(D)),Q}}class un{constructor(D,Q,me=[],Re,Ve=new ut,We=[]){this.registry=D,this.path=me,this.key=me.map(gt=>`[${gt}]`).join(""),this.scope=Ve,this.errors=We,this.expectedType=Re,this._isConstant=Q}parse(D,Q,me,Re,Ve={}){return Q?this.concat(Q,me,Re)._parse(D,Ve):this._parse(D,Ve)}_parse(D,Q){function me(Re,Ve,We){return We==="assert"?new Cr(Ve,[Re]):We==="coerce"?new Vr(Ve,[Re]):Re}if(D!==null&&typeof D!="string"&&typeof D!="boolean"&&typeof D!="number"||(D=["literal",D]),Array.isArray(D)){if(D.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const Re=D[0];if(typeof Re!="string")return this.error(`Expression name must be a string, but found ${typeof Re} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const Ve=this.registry[Re];if(Ve){let We=Ve.parse(D,this);if(!We)return null;if(this.expectedType){const gt=this.expectedType,Rt=We.type;if(gt.kind!=="string"&>.kind!=="number"&>.kind!=="boolean"&>.kind!=="object"&>.kind!=="array"||Rt.kind!=="value")if(gt.kind!=="color"&>.kind!=="formatted"&>.kind!=="resolvedImage"||Rt.kind!=="value"&&Rt.kind!=="string")if(gt.kind!=="padding"||Rt.kind!=="value"&&Rt.kind!=="number"&&Rt.kind!=="array")if(gt.kind!=="variableAnchorOffsetCollection"||Rt.kind!=="value"&&Rt.kind!=="array"){if(this.checkSubtype(gt,Rt))return null}else We=me(We,gt,Q.typeAnnotation||"coerce");else We=me(We,gt,Q.typeAnnotation||"coerce");else We=me(We,gt,Q.typeAnnotation||"coerce");else We=me(We,gt,Q.typeAnnotation||"assert")}if(!(We instanceof Si)&&We.type.kind!=="resolvedImage"&&this._isConstant(We)){const gt=new qr;try{We=new Si(We.type,We.evaluate(gt))}catch(Rt){return this.error(Rt.message),null}}return We}return this.error(`Unknown expression "${Re}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(D===void 0?"'undefined' value invalid. Use null instead.":typeof D=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof D} instead.`)}concat(D,Q,me){const Re=typeof D=="number"?this.path.concat(D):this.path,Ve=me?this.scope.concat(me):this.scope;return new un(this.registry,this._isConstant,Re,Q||null,Ve,this.errors)}error(D,...Q){const me=`${this.key}${Q.map(Re=>`[${Re}]`).join("")}`;this.errors.push(new Ne(me,D))}checkSubtype(D,Q){const me=xe(D,Q);return me&&this.error(me),me}}class Jr{constructor(D,Q){this.type=Q.type,this.bindings=[].concat(D),this.result=Q}evaluate(D){return this.result.evaluate(D)}eachChild(D){for(const Q of this.bindings)D(Q[1]);D(this.result)}static parse(D,Q){if(D.length<4)return Q.error(`Expected at least 3 arguments, but found ${D.length-1} instead.`);const me=[];for(let Ve=1;Ve=me.length)throw new Dt(`Array index out of bounds: ${Q} > ${me.length-1}.`);if(Q!==Math.floor(Q))throw new Dt(`Array index must be an integer, but found ${Q} instead.`);return me[Q]}eachChild(D){D(this.index),D(this.input)}outputDefined(){return!1}}class zr{constructor(D,Q){this.type=Nt,this.needle=D,this.haystack=Q}static parse(D,Q){if(D.length!==3)return Q.error(`Expected 2 arguments, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1,kr),Re=Q.parse(D[2],2,kr);return me&&Re?ye(me.type,[Nt,Ft,nt,dt,kr])?new zr(me,Re):Q.error(`Expected first argument to be of type boolean, string, number or null, but found ${Je(me.type)} instead`):null}evaluate(D){const Q=this.needle.evaluate(D),me=this.haystack.evaluate(D);if(!me)return!1;if(!Ee(Q,["boolean","string","number","null"]))throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${Je(Hn(Q))} instead.`);if(!Ee(me,["string","array"]))throw new Dt(`Expected second argument to be of type array or string, but found ${Je(Hn(me))} instead.`);return me.indexOf(Q)>=0}eachChild(D){D(this.needle),D(this.haystack)}outputDefined(){return!0}}class cn{constructor(D,Q,me){this.type=nt,this.needle=D,this.haystack=Q,this.fromIndex=me}static parse(D,Q){if(D.length<=2||D.length>=5)return Q.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1,kr),Re=Q.parse(D[2],2,kr);if(!me||!Re)return null;if(!ye(me.type,[Nt,Ft,nt,dt,kr]))return Q.error(`Expected first argument to be of type boolean, string, number or null, but found ${Je(me.type)} instead`);if(D.length===4){const Ve=Q.parse(D[3],3,nt);return Ve?new cn(me,Re,Ve):null}return new cn(me,Re)}evaluate(D){const Q=this.needle.evaluate(D),me=this.haystack.evaluate(D);if(!Ee(Q,["boolean","string","number","null"]))throw new Dt(`Expected first argument to be of type boolean, string, number or null, but found ${Je(Hn(Q))} instead.`);let Re;if(this.fromIndex&&(Re=this.fromIndex.evaluate(D)),Ee(me,["string"])){const Ve=me.indexOf(Q,Re);return Ve===-1?-1:[...me.slice(0,Ve)].length}if(Ee(me,["array"]))return me.indexOf(Q,Re);throw new Dt(`Expected second argument to be of type array or string, but found ${Je(Hn(me))} instead.`)}eachChild(D){D(this.needle),D(this.haystack),this.fromIndex&&D(this.fromIndex)}outputDefined(){return!1}}class Rn{constructor(D,Q,me,Re,Ve,We){this.inputType=D,this.type=Q,this.input=me,this.cases=Re,this.outputs=Ve,this.otherwise=We}static parse(D,Q){if(D.length<5)return Q.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if(D.length%2!=1)return Q.error("Expected an even number of arguments.");let me,Re;Q.expectedType&&Q.expectedType.kind!=="value"&&(Re=Q.expectedType);const Ve={},We=[];for(let Wt=2;WtNumber.MAX_SAFE_INTEGER)return Hr.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof vn=="number"&&Math.floor(vn)!==vn)return Hr.error("Numeric branch labels must be integer values.");if(me){if(Hr.checkSubtype(me,Hn(vn)))return null}else me=Hn(vn);if(Ve[String(vn)]!==void 0)return Hr.error("Branch labels must be unique.");Ve[String(vn)]=We.length}const Qr=Q.parse(br,Wt,Re);if(!Qr)return null;Re=Re||Qr.type,We.push(Qr)}const gt=Q.parse(D[1],1,kr);if(!gt)return null;const Rt=Q.parse(D[D.length-1],D.length-1,Re);return Rt?gt.type.kind!=="value"&&Q.concat(1).checkSubtype(me,gt.type)?null:new Rn(me,Re,gt,Ve,We,Rt):null}evaluate(D){const Q=this.input.evaluate(D);return(Hn(Q)===this.inputType&&this.outputs[this.cases[Q]]||this.otherwise).evaluate(D)}eachChild(D){D(this.input),this.outputs.forEach(D),D(this.otherwise)}outputDefined(){return this.outputs.every(D=>D.outputDefined())&&this.otherwise.outputDefined()}}class qn{constructor(D,Q,me){this.type=D,this.branches=Q,this.otherwise=me}static parse(D,Q){if(D.length<4)return Q.error(`Expected at least 3 arguments, but found only ${D.length-1}.`);if(D.length%2!=0)return Q.error("Expected an odd number of arguments.");let me;Q.expectedType&&Q.expectedType.kind!=="value"&&(me=Q.expectedType);const Re=[];for(let We=1;WeQ.outputDefined())&&this.otherwise.outputDefined()}}class jn{constructor(D,Q,me,Re){this.type=D,this.input=Q,this.beginIndex=me,this.endIndex=Re}static parse(D,Q){if(D.length<=2||D.length>=5)return Q.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1,kr),Re=Q.parse(D[2],2,nt);if(!me||!Re)return null;if(!ye(me.type,[je(kr),Ft,kr]))return Q.error(`Expected first argument to be of type array or string, but found ${Je(me.type)} instead`);if(D.length===4){const Ve=Q.parse(D[3],3,nt);return Ve?new jn(me.type,me,Re,Ve):null}return new jn(me.type,me,Re)}evaluate(D){const Q=this.input.evaluate(D),me=this.beginIndex.evaluate(D);let Re;if(this.endIndex&&(Re=this.endIndex.evaluate(D)),Ee(Q,["string"]))return[...Q].slice(me,Re).join("");if(Ee(Q,["array"]))return Q.slice(me,Re);throw new Dt(`Expected first argument to be of type array or string, but found ${Je(Hn(Q))} instead.`)}eachChild(D){D(this.input),D(this.beginIndex),this.endIndex&&D(this.endIndex)}outputDefined(){return!1}}function fn(Y,D){const Q=Y.length-1;let me,Re,Ve=0,We=Q,gt=0;for(;Ve<=We;)if(gt=Math.floor((Ve+We)/2),me=Y[gt],Re=Y[gt+1],me<=D){if(gt===Q||DD))throw new Dt("Input is not a number.");We=gt-1}return 0}class In{constructor(D,Q,me){this.type=D,this.input=Q,this.labels=[],this.outputs=[];for(const[Re,Ve]of me)this.labels.push(Re),this.outputs.push(Ve)}static parse(D,Q){if(D.length-1<4)return Q.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return Q.error("Expected an even number of arguments.");const me=Q.parse(D[1],1,nt);if(!me)return null;const Re=[];let Ve=null;Q.expectedType&&Q.expectedType.kind!=="value"&&(Ve=Q.expectedType);for(let We=1;We=gt)return Q.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Wt);const br=Q.parse(Rt,pr,Ve);if(!br)return null;Ve=Ve||br.type,Re.push([gt,br])}return new In(Ve,me,Re)}evaluate(D){const Q=this.labels,me=this.outputs;if(Q.length===1)return me[0].evaluate(D);const Re=this.input.evaluate(D);if(Re<=Q[0])return me[0].evaluate(D);const Ve=Q.length;return Re>=Q[Ve-1]?me[Ve-1].evaluate(D):me[fn(Q,Re)].evaluate(D)}eachChild(D){D(this.input);for(const Q of this.outputs)D(Q)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function gi(Y){return Y&&Y.__esModule&&Object.prototype.hasOwnProperty.call(Y,"default")?Y.default:Y}var Ea=Ci;function Ci(Y,D,Q,me){this.cx=3*Y,this.bx=3*(Q-Y)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*D,this.by=3*(me-D)-this.cy,this.ay=1-this.cy-this.by,this.p1x=Y,this.p1y=D,this.p2x=Q,this.p2y=me}Ci.prototype={sampleCurveX:function(Y){return((this.ax*Y+this.bx)*Y+this.cx)*Y},sampleCurveY:function(Y){return((this.ay*Y+this.by)*Y+this.cy)*Y},sampleCurveDerivativeX:function(Y){return(3*this.ax*Y+2*this.bx)*Y+this.cx},solveCurveX:function(Y,D){if(D===void 0&&(D=1e-6),Y<0)return 0;if(Y>1)return 1;for(var Q=Y,me=0;me<8;me++){var Re=this.sampleCurveX(Q)-Y;if(Math.abs(Re)Re?We=Q:gt=Q,Q=.5*(gt-We)+We;return Q},solve:function(Y,D){return this.sampleCurveY(this.solveCurveX(Y,D))}};var Xi=gi(Ea);function so(Y,D,Q){return Y+Q*(D-Y)}function io(Y,D,Q){return Y.map((me,Re)=>so(me,D[Re],Q))}const Mo={number:so,color:function(Y,D,Q,me="rgb"){switch(me){case"rgb":{const[Re,Ve,We,gt]=io(Y.rgb,D.rgb,Q);return new ur(Re,Ve,We,gt,!1)}case"hcl":{const[Re,Ve,We,gt]=Y.hcl,[Rt,Wt,pr,br]=D.hcl;let Hr,Qr;if(isNaN(Re)||isNaN(Rt))isNaN(Re)?isNaN(Rt)?Hr=NaN:(Hr=Rt,We!==1&&We!==0||(Qr=Wt)):(Hr=Re,pr!==1&&pr!==0||(Qr=Ve));else{let oi=Rt-Re;Rt>Re&&oi>180?oi-=360:Rt180&&(oi+=360),Hr=Re+Q*oi}const[vn,Sn,Nn,va]=(function([oi,Ba,ei,Oi]){return oi=isNaN(oi)?0:oi*mr,ra([ei,Math.cos(oi)*Ba,Math.sin(oi)*Ba,Oi])})([Hr,Qr??so(Ve,Wt,Q),so(We,pr,Q),so(gt,br,Q)]);return new ur(vn,Sn,Nn,va,!1)}case"lab":{const[Re,Ve,We,gt]=ra(io(Y.lab,D.lab,Q));return new ur(Re,Ve,We,gt,!1)}}},array:io,padding:function(Y,D,Q){return new An(io(Y.values,D.values,Q))},variableAnchorOffsetCollection:function(Y,D,Q){const me=Y.values,Re=D.values;if(me.length!==Re.length)throw new Dt(`Cannot interpolate values of different length. from: ${Y.toString()}, to: ${D.toString()}`);const Ve=[];for(let We=0;Wetypeof pr!="number"||pr<0||pr>1))return Q.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Re={name:"cubic-bezier",controlPoints:Wt}}}if(D.length-1<4)return Q.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return Q.error("Expected an even number of arguments.");if(Ve=Q.parse(Ve,2,nt),!Ve)return null;const gt=[];let Rt=null;me==="interpolate-hcl"||me==="interpolate-lab"?Rt=Qt:Q.expectedType&&Q.expectedType.kind!=="value"&&(Rt=Q.expectedType);for(let Wt=0;Wt=pr)return Q.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Hr);const vn=Q.parse(br,Qr,Rt);if(!vn)return null;Rt=Rt||vn.type,gt.push([pr,vn])}return Xe(Rt,nt)||Xe(Rt,Qt)||Xe(Rt,Sr)||Xe(Rt,Mt)||Xe(Rt,je(nt))?new ui(Rt,me,Re,Ve,gt):Q.error(`Type ${Je(Rt)} is not interpolatable.`)}evaluate(D){const Q=this.labels,me=this.outputs;if(Q.length===1)return me[0].evaluate(D);const Re=this.input.evaluate(D);if(Re<=Q[0])return me[0].evaluate(D);const Ve=Q.length;if(Re>=Q[Ve-1])return me[Ve-1].evaluate(D);const We=fn(Q,Re),gt=ui.interpolationFactor(this.interpolation,Re,Q[We],Q[We+1]),Rt=me[We].evaluate(D),Wt=me[We+1].evaluate(D);switch(this.operator){case"interpolate":return Mo[this.type.kind](Rt,Wt,gt);case"interpolate-hcl":return Mo.color(Rt,Wt,gt,"hcl");case"interpolate-lab":return Mo.color(Rt,Wt,gt,"lab")}}eachChild(D){D(this.input);for(const Q of this.outputs)D(Q)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function ts(Y,D,Q,me){const Re=me-Q,Ve=Y-Q;return Re===0?0:D===1?Ve/Re:(Math.pow(D,Ve)-1)/(Math.pow(D,Re)-1)}class Ho{constructor(D,Q){this.type=D,this.args=Q}static parse(D,Q){if(D.length<2)return Q.error("Expectected at least one argument.");let me=null;const Re=Q.expectedType;Re&&Re.kind!=="value"&&(me=Re);const Ve=[];for(const gt of D.slice(1)){const Rt=Q.parse(gt,1+Ve.length,me,void 0,{typeAnnotation:"omit"});if(!Rt)return null;me=me||Rt.type,Ve.push(Rt)}if(!me)throw new Error("No output type");const We=Re&&Ve.some(gt=>xe(Re,gt.type));return new Ho(We?kr:me,Ve)}evaluate(D){let Q,me=null,Re=0;for(const Ve of this.args)if(Re++,me=Ve.evaluate(D),me&&me instanceof ha&&!me.available&&(Q||(Q=me.name),me=null,Re===this.args.length&&(me=Q)),me!==null)break;return me}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}function Xs(Y,D){return Y==="=="||Y==="!="?D.kind==="boolean"||D.kind==="string"||D.kind==="number"||D.kind==="null"||D.kind==="value":D.kind==="string"||D.kind==="number"||D.kind==="value"}function cs(Y,D,Q,me){return me.compare(D,Q)===0}function Jo(Y,D,Q){const me=Y!=="=="&&Y!=="!=";return class _P{constructor(Ve,We,gt){this.type=Nt,this.lhs=Ve,this.rhs=We,this.collator=gt,this.hasUntypedArgument=Ve.type.kind==="value"||We.type.kind==="value"}static parse(Ve,We){if(Ve.length!==3&&Ve.length!==4)return We.error("Expected two or three arguments.");const gt=Ve[0];let Rt=We.parse(Ve[1],1,kr);if(!Rt)return null;if(!Xs(gt,Rt.type))return We.concat(1).error(`"${gt}" comparisons are not supported for type '${Je(Rt.type)}'.`);let Wt=We.parse(Ve[2],2,kr);if(!Wt)return null;if(!Xs(gt,Wt.type))return We.concat(2).error(`"${gt}" comparisons are not supported for type '${Je(Wt.type)}'.`);if(Rt.type.kind!==Wt.type.kind&&Rt.type.kind!=="value"&&Wt.type.kind!=="value")return We.error(`Cannot compare types '${Je(Rt.type)}' and '${Je(Wt.type)}'.`);me&&(Rt.type.kind==="value"&&Wt.type.kind!=="value"?Rt=new Cr(Wt.type,[Rt]):Rt.type.kind!=="value"&&Wt.type.kind==="value"&&(Wt=new Cr(Rt.type,[Wt])));let pr=null;if(Ve.length===4){if(Rt.type.kind!=="string"&&Wt.type.kind!=="string"&&Rt.type.kind!=="value"&&Wt.type.kind!=="value")return We.error("Cannot use collator to compare non-string types.");if(pr=We.parse(Ve[3],3,Er),!pr)return null}return new _P(Rt,Wt,pr)}evaluate(Ve){const We=this.lhs.evaluate(Ve),gt=this.rhs.evaluate(Ve);if(me&&this.hasUntypedArgument){const Rt=Hn(We),Wt=Hn(gt);if(Rt.kind!==Wt.kind||Rt.kind!=="string"&&Rt.kind!=="number")throw new Dt(`Expected arguments for "${Y}" to be (string, string) or (number, number), but found (${Rt.kind}, ${Wt.kind}) instead.`)}if(this.collator&&!me&&this.hasUntypedArgument){const Rt=Hn(We),Wt=Hn(gt);if(Rt.kind!=="string"||Wt.kind!=="string")return D(Ve,We,gt)}return this.collator?Q(Ve,We,gt,this.collator.evaluate(Ve)):D(Ve,We,gt)}eachChild(Ve){Ve(this.lhs),Ve(this.rhs),this.collator&&Ve(this.collator)}outputDefined(){return!0}}}const Uo=Jo("==",function(Y,D,Q){return D===Q},cs),Ys=Jo("!=",function(Y,D,Q){return D!==Q},function(Y,D,Q,me){return!cs(0,D,Q,me)}),Vs=Jo("<",function(Y,D,Q){return D",function(Y,D,Q){return D>Q},function(Y,D,Q,me){return me.compare(D,Q)>0}),fs=Jo("<=",function(Y,D,Q){return D<=Q},function(Y,D,Q,me){return me.compare(D,Q)<=0}),Zo=Jo(">=",function(Y,D,Q){return D>=Q},function(Y,D,Q,me){return me.compare(D,Q)>=0});class po{constructor(D,Q,me){this.type=Er,this.locale=me,this.caseSensitive=D,this.diacriticSensitive=Q}static parse(D,Q){if(D.length!==2)return Q.error("Expected one argument.");const me=D[1];if(typeof me!="object"||Array.isArray(me))return Q.error("Collator options argument must be an object.");const Re=Q.parse(me["case-sensitive"]!==void 0&&me["case-sensitive"],1,Nt);if(!Re)return null;const Ve=Q.parse(me["diacritic-sensitive"]!==void 0&&me["diacritic-sensitive"],1,Nt);if(!Ve)return null;let We=null;return me.locale&&(We=Q.parse(me.locale,1,Ft),!We)?null:new po(Re,Ve,We)}evaluate(D){return new Gr(this.caseSensitive.evaluate(D),this.diacriticSensitive.evaluate(D),this.locale?this.locale.evaluate(D):null)}eachChild(D){D(this.caseSensitive),D(this.diacriticSensitive),this.locale&&D(this.locale)}outputDefined(){return!1}}class hs{constructor(D,Q,me,Re,Ve){this.type=Ft,this.number=D,this.locale=Q,this.currency=me,this.minFractionDigits=Re,this.maxFractionDigits=Ve}static parse(D,Q){if(D.length!==3)return Q.error("Expected two arguments.");const me=Q.parse(D[1],1,nt);if(!me)return null;const Re=D[2];if(typeof Re!="object"||Array.isArray(Re))return Q.error("NumberFormat options argument must be an object.");let Ve=null;if(Re.locale&&(Ve=Q.parse(Re.locale,1,Ft),!Ve))return null;let We=null;if(Re.currency&&(We=Q.parse(Re.currency,1,Ft),!We))return null;let gt=null;if(Re["min-fraction-digits"]&&(gt=Q.parse(Re["min-fraction-digits"],1,nt),!gt))return null;let Rt=null;return Re["max-fraction-digits"]&&(Rt=Q.parse(Re["max-fraction-digits"],1,nt),!Rt)?null:new hs(me,Ve,We,gt,Rt)}evaluate(D){return new Intl.NumberFormat(this.locale?this.locale.evaluate(D):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(D):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(D):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(D):void 0}).format(this.number.evaluate(D))}eachChild(D){D(this.number),this.locale&&D(this.locale),this.currency&&D(this.currency),this.minFractionDigits&&D(this.minFractionDigits),this.maxFractionDigits&&D(this.maxFractionDigits)}outputDefined(){return!1}}class ul{constructor(D){this.type=$r,this.sections=D}static parse(D,Q){if(D.length<2)return Q.error("Expected at least one argument.");const me=D[1];if(!Array.isArray(me)&&typeof me=="object")return Q.error("First argument must be an image or text section.");const Re=[];let Ve=!1;for(let We=1;We<=D.length-1;++We){const gt=D[We];if(Ve&&typeof gt=="object"&&!Array.isArray(gt)){Ve=!1;let Rt=null;if(gt["font-scale"]&&(Rt=Q.parse(gt["font-scale"],1,nt),!Rt))return null;let Wt=null;if(gt["text-font"]&&(Wt=Q.parse(gt["text-font"],1,je(Ft)),!Wt))return null;let pr=null;if(gt["text-color"]&&(pr=Q.parse(gt["text-color"],1,Qt),!pr))return null;const br=Re[Re.length-1];br.scale=Rt,br.font=Wt,br.textColor=pr}else{const Rt=Q.parse(D[We],1,kr);if(!Rt)return null;const Wt=Rt.type.kind;if(Wt!=="string"&&Wt!=="value"&&Wt!=="null"&&Wt!=="resolvedImage")return Q.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Ve=!0,Re.push({content:Rt,scale:null,font:null,textColor:null})}}return new ul(Re)}evaluate(D){return new gn(this.sections.map(Q=>{const me=Q.content.evaluate(D);return Hn(me)===Ur?new ln("",me,null,null,null):new ln(pi(me),null,Q.scale?Q.scale.evaluate(D):null,Q.font?Q.font.evaluate(D).join(","):null,Q.textColor?Q.textColor.evaluate(D):null)}))}eachChild(D){for(const Q of this.sections)D(Q.content),Q.scale&&D(Q.scale),Q.font&&D(Q.font),Q.textColor&&D(Q.textColor)}outputDefined(){return!1}}class kl{constructor(D){this.type=Ur,this.input=D}static parse(D,Q){if(D.length!==2)return Q.error("Expected two arguments.");const me=Q.parse(D[1],1,Ft);return me?new kl(me):Q.error("No image name provided.")}evaluate(D){const Q=this.input.evaluate(D),me=ha.fromString(Q);return me&&D.availableImages&&(me.available=D.availableImages.indexOf(Q)>-1),me}eachChild(D){D(this.input)}outputDefined(){return!1}}class Rl{constructor(D){this.type=nt,this.input=D}static parse(D,Q){if(D.length!==2)return Q.error(`Expected 1 argument, but found ${D.length-1} instead.`);const me=Q.parse(D[1],1);return me?me.type.kind!=="array"&&me.type.kind!=="string"&&me.type.kind!=="value"?Q.error(`Expected argument of type string or array, but found ${Je(me.type)} instead.`):new Rl(me):null}evaluate(D){const Q=this.input.evaluate(D);if(typeof Q=="string")return[...Q].length;if(Array.isArray(Q))return Q.length;throw new Dt(`Expected value to be of type string or array, but found ${Je(Hn(Q))} instead.`)}eachChild(D){D(this.input)}outputDefined(){return!1}}const Ms=8192;function fi(Y,D){const Q=(180+Y[0])/360,me=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Y[1]*Math.PI/360)))/360,Re=Math.pow(2,D.z);return[Math.round(Q*Re*Ms),Math.round(me*Re*Ms)]}function to(Y,D){const Q=Math.pow(2,D.z);return[(Re=(Y[0]/Ms+D.x)/Q,360*Re-180),(me=(Y[1]/Ms+D.y)/Q,360/Math.PI*Math.atan(Math.exp((180-360*me)*Math.PI/180))-90)];var me,Re}function Cl(Y,D){Y[0]=Math.min(Y[0],D[0]),Y[1]=Math.min(Y[1],D[1]),Y[2]=Math.max(Y[2],D[0]),Y[3]=Math.max(Y[3],D[1])}function Ps(Y,D){return!(Y[0]<=D[0]||Y[2]>=D[2]||Y[1]<=D[1]||Y[3]>=D[3])}function Fo(Y,D,Q){const me=Y[0]-D[0],Re=Y[1]-D[1],Ve=Y[0]-Q[0],We=Y[1]-Q[1];return me*We-Ve*Re==0&&me*Ve<=0&&Re*We<=0}function Il(Y,D,Q,me){return(Re=[me[0]-Q[0],me[1]-Q[1]])[0]*(Ve=[D[0]-Y[0],D[1]-Y[1]])[1]-Re[1]*Ve[0]!=0&&!(!rs(Y,D,Q,me)||!rs(Q,me,Y,D));var Re,Ve}function Zs(Y,D,Q){for(const me of Q)for(let Re=0;Re(Re=Y)[1]!=(We=gt[Rt+1])[1]>Re[1]&&Re[0]<(We[0]-Ve[0])*(Re[1]-Ve[1])/(We[1]-Ve[1])+Ve[0]&&(me=!me)}var Re,Ve,We;return me}function Au(Y,D){for(const Q of D)if(cl(Y,Q))return!0;return!1}function Qi(Y,D){for(const Q of Y)if(!cl(Q,D))return!1;for(let Q=0;Q0&><0||We<0&>>0}function Xl(Y,D,Q){const me=[];for(let Re=0;ReQ[2]){const Re=.5*me;let Ve=Y[0]-Q[0]>Re?-me:Q[0]-Y[0]>Re?me:0;Ve===0&&(Ve=Y[0]-Q[2]>Re?-me:Q[2]-Y[0]>Re?me:0),Y[0]+=Ve}Cl(D,Y)}function cu(Y,D,Q,me){const Re=Math.pow(2,me.z)*Ms,Ve=[me.x*Ms,me.y*Ms],We=[];for(const gt of Y)for(const Rt of gt){const Wt=[Rt.x+Ve[0],Rt.y+Ve[1]];Io(Wt,D,Q,Re),We.push(Wt)}return We}function vu(Y,D,Q,me){const Re=Math.pow(2,me.z)*Ms,Ve=[me.x*Ms,me.y*Ms],We=[];for(const Rt of Y){const Wt=[];for(const pr of Rt){const br=[pr.x+Ve[0],pr.y+Ve[1]];Cl(D,br),Wt.push(br)}We.push(Wt)}if(D[2]-D[0]<=Re/2){(gt=D)[0]=gt[1]=1/0,gt[2]=gt[3]=-1/0;for(const Rt of We)for(const Wt of Rt)Io(Wt,D,Q,Re)}var gt;return We}class Os{constructor(D,Q){this.type=Nt,this.geojson=D,this.geometries=Q}static parse(D,Q){if(D.length!==2)return Q.error(`'within' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Ca(D[1])){const me=D[1];if(me.type==="FeatureCollection"){const Re=[];for(const Ve of me.features){const{type:We,coordinates:gt}=Ve.geometry;We==="Polygon"&&Re.push(gt),We==="MultiPolygon"&&Re.push(...gt)}if(Re.length)return new Os(me,{type:"MultiPolygon",coordinates:Re})}else if(me.type==="Feature"){const Re=me.geometry.type;if(Re==="Polygon"||Re==="MultiPolygon")return new Os(me,me.geometry)}else if(me.type==="Polygon"||me.type==="MultiPolygon")return new Os(me,me)}return Q.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return(function(Q,me){const Re=[1/0,1/0,-1/0,-1/0],Ve=[1/0,1/0,-1/0,-1/0],We=Q.canonicalID();if(me.type==="Polygon"){const gt=Xl(me.coordinates,Ve,We),Rt=cu(Q.geometry(),Re,Ve,We);if(!Ps(Re,Ve))return!1;for(const Wt of Rt)if(!cl(Wt,gt))return!1}if(me.type==="MultiPolygon"){const gt=Yl(me.coordinates,Ve,We),Rt=cu(Q.geometry(),Re,Ve,We);if(!Ps(Re,Ve))return!1;for(const Wt of Rt)if(!Au(Wt,gt))return!1}return!0})(D,this.geometries);if(D.geometryType()==="LineString")return(function(Q,me){const Re=[1/0,1/0,-1/0,-1/0],Ve=[1/0,1/0,-1/0,-1/0],We=Q.canonicalID();if(me.type==="Polygon"){const gt=Xl(me.coordinates,Ve,We),Rt=vu(Q.geometry(),Re,Ve,We);if(!Ps(Re,Ve))return!1;for(const Wt of Rt)if(!Qi(Wt,gt))return!1}if(me.type==="MultiPolygon"){const gt=Yl(me.coordinates,Ve,We),Rt=vu(Q.geometry(),Re,Ve,We);if(!Ps(Re,Ve))return!1;for(const Wt of Rt)if(!gs(Wt,gt))return!1}return!0})(D,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let wl=class{constructor(Y=[],D=(Q,me)=>Qme?1:0){if(this.data=Y,this.length=this.data.length,this.compare=D,this.length>0)for(let Q=(this.length>>1)-1;Q>=0;Q--)this._down(Q)}push(Y){this.data.push(Y),this._up(this.length++)}pop(){if(this.length===0)return;const Y=this.data[0],D=this.data.pop();return--this.length>0&&(this.data[0]=D,this._down(0)),Y}peek(){return this.data[0]}_up(Y){const{data:D,compare:Q}=this,me=D[Y];for(;Y>0;){const Re=Y-1>>1,Ve=D[Re];if(Q(me,Ve)>=0)break;D[Y]=Ve,Y=Re}D[Y]=me}_down(Y){const{data:D,compare:Q}=this,me=this.length>>1,Re=D[Y];for(;Y=0)break;D[Y]=D[Ve],Y=Ve}D[Y]=Re}};function Nl(Y,D,Q,me,Re){Vl(Y,D,Q,me||Y.length-1,Re||df)}function Vl(Y,D,Q,me,Re){for(;me>Q;){if(me-Q>600){var Ve=me-Q+1,We=D-Q+1,gt=Math.log(Ve),Rt=.5*Math.exp(2*gt/3),Wt=.5*Math.sqrt(gt*Rt*(Ve-Rt)/Ve)*(We-Ve/2<0?-1:1);Vl(Y,D,Math.max(Q,Math.floor(D-We*Rt/Ve+Wt)),Math.min(me,Math.floor(D+(Ve-We)*Rt/Ve+Wt)),Re)}var pr=Y[D],br=Q,Hr=me;for(Zu(Y,Q,D),Re(Y[me],pr)>0&&Zu(Y,Q,me);br0;)Hr--}Re(Y[Q],pr)===0?Zu(Y,Q,Hr):Zu(Y,++Hr,me),Hr<=D&&(Q=Hr+1),D<=Hr&&(me=Hr-1)}}function Zu(Y,D,Q){var me=Y[D];Y[D]=Y[Q],Y[Q]=me}function df(Y,D){return YD?1:0}function Xc(Y,D){if(Y.length<=1)return[Y];const Q=[];let me,Re;for(const Ve of Y){const We=Dh(Ve);We!==0&&(Ve.area=Math.abs(We),Re===void 0&&(Re=We<0),Re===We<0?(me&&Q.push(me),me=[Ve]):me.push(Ve))}if(me&&Q.push(me),D>1)for(let Ve=0;Ve1?(Wt=D[Rt+1][0],pr=D[Rt+1][1]):Qr>0&&(Wt+=br/this.kx*Qr,pr+=Hr/this.ky*Qr)),br=this.wrap(Q[0]-Wt)*this.kx,Hr=(Q[1]-pr)*this.ky;const vn=br*br+Hr*Hr;vn180;)D-=360;return D}}function oc(Y,D){return D[0]-Y[0]}function Wu(Y){return Y[1]-Y[0]+1}function sc(Y,D){return Y[1]>=Y[0]&&Y[1]Y[1])return[null,null];const Q=Wu(Y);if(D){if(Q===2)return[Y,null];const Re=Math.floor(Q/2);return[[Y[0],Y[0]+Re],[Y[0]+Re,Y[1]]]}if(Q===1)return[Y,null];const me=Math.floor(Q/2)-1;return[[Y[0],Y[0]+me],[Y[0]+me+1,Y[1]]]}function eu(Y,D){if(!sc(D,Y.length))return[1/0,1/0,-1/0,-1/0];const Q=[1/0,1/0,-1/0,-1/0];for(let me=D[0];me<=D[1];++me)Cl(Q,Y[me]);return Q}function $u(Y){const D=[1/0,1/0,-1/0,-1/0];for(const Q of Y)for(const me of Q)Cl(D,me);return D}function Hs(Y){return Y[0]!==-1/0&&Y[1]!==-1/0&&Y[2]!==1/0&&Y[3]!==1/0}function Dl(Y,D,Q){if(!Hs(Y)||!Hs(D))return NaN;let me=0,Re=0;return Y[2]D[2]&&(me=Y[0]-D[2]),Y[1]>D[3]&&(Re=Y[1]-D[3]),Y[3]=me)return me;if(Ps(Re,Ve)){if(Vd(Y,D))return 0}else if(Vd(D,Y))return 0;let We=1/0;for(const gt of Y)for(let Rt=0,Wt=gt.length,pr=Wt-1;Rt0;){const Rt=We.pop();if(Rt[0]>=Ve)continue;const Wt=Rt[1],pr=D?50:100;if(Wu(Wt)<=pr){if(!sc(Wt,Y.length))return NaN;if(D){const br=Fs(Y,Wt,Q,me);if(isNaN(br)||br===0)return br;Ve=Math.min(Ve,br)}else for(let br=Wt[0];br<=Wt[1];++br){const Hr=Sd(Y[br],Q,me);if(Ve=Math.min(Ve,Hr),Ve===0)return 0}}else{const br=nf(Wt,D);Oo(We,Ve,me,Y,gt,br[0]),Oo(We,Ve,me,Y,gt,br[1])}}return Ve}function Ou(Y,D,Q,me,Re,Ve=1/0){let We=Math.min(Ve,Re.distance(Y[0],Q[0]));if(We===0)return We;const gt=new wl([[0,[0,Y.length-1],[0,Q.length-1]]],oc);for(;gt.length>0;){const Rt=gt.pop();if(Rt[0]>=We)continue;const Wt=Rt[1],pr=Rt[2],br=D?50:100,Hr=me?50:100;if(Wu(Wt)<=br&&Wu(pr)<=Hr){if(!sc(Wt,Y.length)&&sc(pr,Q.length))return NaN;let Qr;if(D&&me)Qr=Ff(Y,Wt,Q,pr,Re),We=Math.min(We,Qr);else if(D&&!me){const vn=Y.slice(Wt[0],Wt[1]+1);for(let Sn=pr[0];Sn<=pr[1];++Sn)if(Qr=Mf(Q[Sn],vn,Re),We=Math.min(We,Qr),We===0)return We}else if(!D&&me){const vn=Q.slice(pr[0],pr[1]+1);for(let Sn=Wt[0];Sn<=Wt[1];++Sn)if(Qr=Mf(Y[Sn],vn,Re),We=Math.min(We,Qr),We===0)return We}else Qr=fu(Y,Wt,Q,pr,Re),We=Math.min(We,Qr)}else{const Qr=nf(Wt,D),vn=nf(pr,me);th(gt,We,Re,Y,Q,Qr[0],vn[0]),th(gt,We,Re,Y,Q,Qr[0],vn[1]),th(gt,We,Re,Y,Q,Qr[1],vn[0]),th(gt,We,Re,Y,Q,Qr[1],vn[1])}}return We}function Oh(Y){return Y.type==="MultiPolygon"?Y.coordinates.map(D=>({type:"Polygon",coordinates:D})):Y.type==="MultiLineString"?Y.coordinates.map(D=>({type:"LineString",coordinates:D})):Y.type==="MultiPoint"?Y.coordinates.map(D=>({type:"Point",coordinates:D})):[Y]}class Bf{constructor(D,Q){this.type=nt,this.geojson=D,this.geometries=Q}static parse(D,Q){if(D.length!==2)return Q.error(`'distance' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Ca(D[1])){const me=D[1];if(me.type==="FeatureCollection")return new Bf(me,me.features.map(Re=>Oh(Re.geometry)).flat());if(me.type==="Feature")return new Bf(me,Oh(me.geometry));if("type"in me&&"coordinates"in me)return new Bf(me,Oh(me))}return Q.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return(function(Q,me){const Re=Q.geometry(),Ve=Re.flat().map(Rt=>to([Rt.x,Rt.y],Q.canonical));if(Re.length===0)return NaN;const We=new zh(Ve[0][1]);let gt=1/0;for(const Rt of me){switch(Rt.type){case"Point":gt=Math.min(gt,Ou(Ve,!1,[Rt.coordinates],!1,We,gt));break;case"LineString":gt=Math.min(gt,Ou(Ve,!1,Rt.coordinates,!0,We,gt));break;case"Polygon":gt=Math.min(gt,af(Ve,!1,Rt.coordinates,We,gt))}if(gt===0)return gt}return gt})(D,this.geometries);if(D.geometryType()==="LineString")return(function(Q,me){const Re=Q.geometry(),Ve=Re.flat().map(Rt=>to([Rt.x,Rt.y],Q.canonical));if(Re.length===0)return NaN;const We=new zh(Ve[0][1]);let gt=1/0;for(const Rt of me){switch(Rt.type){case"Point":gt=Math.min(gt,Ou(Ve,!0,[Rt.coordinates],!1,We,gt));break;case"LineString":gt=Math.min(gt,Ou(Ve,!0,Rt.coordinates,!0,We,gt));break;case"Polygon":gt=Math.min(gt,af(Ve,!0,Rt.coordinates,We,gt))}if(gt===0)return gt}return gt})(D,this.geometries);if(D.geometryType()==="Polygon")return(function(Q,me){const Re=Q.geometry();if(Re.length===0||Re[0].length===0)return NaN;const Ve=Xc(Re,0).map(Rt=>Rt.map(Wt=>Wt.map(pr=>to([pr.x,pr.y],Q.canonical)))),We=new zh(Ve[0][0][0][1]);let gt=1/0;for(const Rt of me)for(const Wt of Ve){switch(Rt.type){case"Point":gt=Math.min(gt,af([Rt.coordinates],!1,Wt,We,gt));break;case"LineString":gt=Math.min(gt,af(Rt.coordinates,!0,Wt,We,gt));break;case"Polygon":gt=Math.min(gt,pl(Wt,Rt.coordinates,We,gt))}if(gt===0)return gt}return gt})(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const uh={"==":Uo,"!=":Ys,">":ll,"<":Vs,">=":Zo,"<=":fs,array:Cr,at:lr,boolean:Cr,case:qn,coalesce:Ho,collator:po,format:ul,image:kl,in:zr,"index-of":cn,interpolate:ui,"interpolate-hcl":ui,"interpolate-lab":ui,length:Rl,let:Jr,literal:Si,match:Rn,number:Cr,"number-format":hs,object:Cr,slice:jn,step:In,string:Cr,"to-boolean":Vr,"to-color":Vr,"to-number":Vr,"to-string":Vr,var:At,within:Os,distance:Bf};class Ku{constructor(D,Q,me,Re){this.name=D,this.type=Q,this._evaluate=me,this.args=Re}evaluate(D){return this._evaluate(D,this.args)}eachChild(D){this.args.forEach(D)}outputDefined(){return!1}static parse(D,Q){const me=D[0],Re=Ku.definitions[me];if(!Re)return Q.error(`Unknown expression "${me}". If you wanted a literal array, use ["literal", [...]].`,0);const Ve=Array.isArray(Re)?Re[0]:Re.type,We=Array.isArray(Re)?[[Re[1],Re[2]]]:Re.overloads,gt=We.filter(([Wt])=>!Array.isArray(Wt)||Wt.length===D.length-1);let Rt=null;for(const[Wt,pr]of gt){Rt=new un(Q.registry,Fh,Q.path,null,Q.scope);const br=[];let Hr=!1;for(let Qr=1;Qr{return Hr=br,Array.isArray(Hr)?`(${Hr.map(Je).join(", ")})`:`(${Je(Hr.type)}...)`;var Hr}).join(" | "),pr=[];for(let br=1;br{Q=D?Q&&Fh(me):Q&&me instanceof Si}),!!Q&&Bh(Y)&&Gh(Y,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Bh(Y){if(Y instanceof Ku&&(Y.name==="get"&&Y.args.length===1||Y.name==="feature-state"||Y.name==="has"&&Y.args.length===1||Y.name==="properties"||Y.name==="geometry-type"||Y.name==="id"||/^filter-/.test(Y.name))||Y instanceof Os||Y instanceof Bf)return!1;let D=!0;return Y.eachChild(Q=>{D&&!Bh(Q)&&(D=!1)}),D}function of(Y){if(Y instanceof Ku&&Y.name==="feature-state")return!1;let D=!0;return Y.eachChild(Q=>{D&&!of(Q)&&(D=!1)}),D}function Gh(Y,D){if(Y instanceof Ku&&D.indexOf(Y.name)>=0)return!1;let Q=!0;return Y.eachChild(me=>{Q&&!Gh(me,D)&&(Q=!1)}),Q}function Ef(Y){return{result:"success",value:Y}}function vf(Y){return{result:"error",value:Y}}function Ju(Y){return Y["property-type"]==="data-driven"||Y["property-type"]==="cross-faded-data-driven"}function Wf(Y){return!!Y.expression&&Y.expression.parameters.indexOf("zoom")>-1}function Nh(Y){return!!Y.expression&&Y.expression.interpolated}function Ul(Y){return Y instanceof Number?"number":Y instanceof String?"string":Y instanceof Boolean?"boolean":Array.isArray(Y)?"array":Y===null?"null":typeof Y}function Th(Y){return typeof Y=="object"&&Y!==null&&!Array.isArray(Y)}function Md(Y){return Y}function Xh(Y,D){const Q=D.type==="color",me=Y.stops&&typeof Y.stops[0][0]=="object",Re=me||!(me||Y.property!==void 0),Ve=Y.type||(Nh(D)?"exponential":"interval");if(Q||D.type==="padding"){const pr=Q?ur.parse:An.parse;(Y=pe({},Y)).stops&&(Y.stops=Y.stops.map(br=>[br[0],pr(br[1])])),Y.default=pr(Y.default?Y.default:D.default)}if(Y.colorSpace&&(We=Y.colorSpace)!=="rgb"&&We!=="hcl"&&We!=="lab")throw new Error(`Unknown color space: "${Y.colorSpace}"`);var We;let gt,Rt,Wt;if(Ve==="exponential")gt=Zh;else if(Ve==="interval")gt=zc;else if(Ve==="categorical"){gt=Yh,Rt=Object.create(null);for(const pr of Y.stops)Rt[pr[0]]=pr[1];Wt=typeof Y.stops[0][0]}else{if(Ve!=="identity")throw new Error(`Unknown function type "${Ve}"`);gt=wu}if(me){const pr={},br=[];for(let vn=0;vnvn[0]),evaluate:({zoom:vn},Sn)=>Zh({stops:Hr,base:Y.base},D,vn).evaluate(vn,Sn)}}if(Re){const pr=Ve==="exponential"?{name:"exponential",base:Y.base!==void 0?Y.base:1}:null;return{kind:"camera",interpolationType:pr,interpolationFactor:ui.interpolationFactor.bind(void 0,pr),zoomStops:Y.stops.map(br=>br[0]),evaluate:({zoom:br})=>gt(Y,D,br,Rt,Wt)}}return{kind:"source",evaluate(pr,br){const Hr=br&&br.properties?br.properties[Y.property]:void 0;return Hr===void 0?fh(Y.default,D.default):gt(Y,D,Hr,Rt,Wt)}}}function fh(Y,D,Q){return Y!==void 0?Y:D!==void 0?D:Q!==void 0?Q:void 0}function Yh(Y,D,Q,me,Re){return fh(typeof Q===Re?me[Q]:void 0,Y.default,D.default)}function zc(Y,D,Q){if(Ul(Q)!=="number")return fh(Y.default,D.default);const me=Y.stops.length;if(me===1||Q<=Y.stops[0][0])return Y.stops[0][1];if(Q>=Y.stops[me-1][0])return Y.stops[me-1][1];const Re=fn(Y.stops.map(Ve=>Ve[0]),Q);return Y.stops[Re][1]}function Zh(Y,D,Q){const me=Y.base!==void 0?Y.base:1;if(Ul(Q)!=="number")return fh(Y.default,D.default);const Re=Y.stops.length;if(Re===1||Q<=Y.stops[0][0])return Y.stops[0][1];if(Q>=Y.stops[Re-1][0])return Y.stops[Re-1][1];const Ve=fn(Y.stops.map(pr=>pr[0]),Q),We=(function(pr,br,Hr,Qr){const vn=Qr-Hr,Sn=pr-Hr;return vn===0?0:br===1?Sn/vn:(Math.pow(br,Sn)-1)/(Math.pow(br,vn)-1)})(Q,me,Y.stops[Ve][0],Y.stops[Ve+1][0]),gt=Y.stops[Ve][1],Rt=Y.stops[Ve+1][1],Wt=Mo[D.type]||Md;return typeof gt.evaluate=="function"?{evaluate(...pr){const br=gt.evaluate.apply(void 0,pr),Hr=Rt.evaluate.apply(void 0,pr);if(br!==void 0&&Hr!==void 0)return Wt(br,Hr,We,Y.colorSpace)}}:Wt(gt,Rt,We,Y.colorSpace)}function wu(Y,D,Q){switch(D.type){case"color":Q=ur.parse(Q);break;case"formatted":Q=gn.fromString(Q.toString());break;case"resolvedImage":Q=ha.fromString(Q.toString());break;case"padding":Q=An.parse(Q);break;default:Ul(Q)===D.type||D.type==="enum"&&D.values[Q]||(Q=void 0)}return fh(Q,Y.default,D.default)}Ku.register(uh,{error:[{kind:"error"},[Ft],(Y,[D])=>{throw new Dt(D.evaluate(Y))}],typeof:[Ft,[kr],(Y,[D])=>Je(Hn(D.evaluate(Y)))],"to-rgba":[je(nt,4),[Qt],(Y,[D])=>{const[Q,me,Re,Ve]=D.evaluate(Y).rgb;return[255*Q,255*me,255*Re,Ve]}],rgb:[Qt,[nt,nt,nt],fd],rgba:[Qt,[nt,nt,nt,nt],fd],has:{type:Nt,overloads:[[[Ft],(Y,[D])=>Hh(D.evaluate(Y),Y.properties())],[[Ft,ar],(Y,[D,Q])=>Hh(D.evaluate(Y),Q.evaluate(Y))]]},get:{type:kr,overloads:[[[Ft],(Y,[D])=>ch(D.evaluate(Y),Y.properties())],[[Ft,ar],(Y,[D,Q])=>ch(D.evaluate(Y),Q.evaluate(Y))]]},"feature-state":[kr,[Ft],(Y,[D])=>ch(D.evaluate(Y),Y.featureState||{})],properties:[ar,[],Y=>Y.properties()],"geometry-type":[Ft,[],Y=>Y.geometryType()],id:[kr,[],Y=>Y.id()],zoom:[nt,[],Y=>Y.globals.zoom],"heatmap-density":[nt,[],Y=>Y.globals.heatmapDensity||0],"line-progress":[nt,[],Y=>Y.globals.lineProgress||0],accumulated:[kr,[],Y=>Y.globals.accumulated===void 0?null:Y.globals.accumulated],"+":[nt,Nf(nt),(Y,D)=>{let Q=0;for(const me of D)Q+=me.evaluate(Y);return Q}],"*":[nt,Nf(nt),(Y,D)=>{let Q=1;for(const me of D)Q*=me.evaluate(Y);return Q}],"-":{type:nt,overloads:[[[nt,nt],(Y,[D,Q])=>D.evaluate(Y)-Q.evaluate(Y)],[[nt],(Y,[D])=>-D.evaluate(Y)]]},"/":[nt,[nt,nt],(Y,[D,Q])=>D.evaluate(Y)/Q.evaluate(Y)],"%":[nt,[nt,nt],(Y,[D,Q])=>D.evaluate(Y)%Q.evaluate(Y)],ln2:[nt,[],()=>Math.LN2],pi:[nt,[],()=>Math.PI],e:[nt,[],()=>Math.E],"^":[nt,[nt,nt],(Y,[D,Q])=>Math.pow(D.evaluate(Y),Q.evaluate(Y))],sqrt:[nt,[nt],(Y,[D])=>Math.sqrt(D.evaluate(Y))],log10:[nt,[nt],(Y,[D])=>Math.log(D.evaluate(Y))/Math.LN10],ln:[nt,[nt],(Y,[D])=>Math.log(D.evaluate(Y))],log2:[nt,[nt],(Y,[D])=>Math.log(D.evaluate(Y))/Math.LN2],sin:[nt,[nt],(Y,[D])=>Math.sin(D.evaluate(Y))],cos:[nt,[nt],(Y,[D])=>Math.cos(D.evaluate(Y))],tan:[nt,[nt],(Y,[D])=>Math.tan(D.evaluate(Y))],asin:[nt,[nt],(Y,[D])=>Math.asin(D.evaluate(Y))],acos:[nt,[nt],(Y,[D])=>Math.acos(D.evaluate(Y))],atan:[nt,[nt],(Y,[D])=>Math.atan(D.evaluate(Y))],min:[nt,Nf(nt),(Y,D)=>Math.min(...D.map(Q=>Q.evaluate(Y)))],max:[nt,Nf(nt),(Y,D)=>Math.max(...D.map(Q=>Q.evaluate(Y)))],abs:[nt,[nt],(Y,[D])=>Math.abs(D.evaluate(Y))],round:[nt,[nt],(Y,[D])=>{const Q=D.evaluate(Y);return Q<0?-Math.round(-Q):Math.round(Q)}],floor:[nt,[nt],(Y,[D])=>Math.floor(D.evaluate(Y))],ceil:[nt,[nt],(Y,[D])=>Math.ceil(D.evaluate(Y))],"filter-==":[Nt,[Ft,kr],(Y,[D,Q])=>Y.properties()[D.value]===Q.value],"filter-id-==":[Nt,[kr],(Y,[D])=>Y.id()===D.value],"filter-type-==":[Nt,[Ft],(Y,[D])=>Y.geometryType()===D.value],"filter-<":[Nt,[Ft,kr],(Y,[D,Q])=>{const me=Y.properties()[D.value],Re=Q.value;return typeof me==typeof Re&&me{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q":[Nt,[Ft,kr],(Y,[D,Q])=>{const me=Y.properties()[D.value],Re=Q.value;return typeof me==typeof Re&&me>Re}],"filter-id->":[Nt,[kr],(Y,[D])=>{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q>me}],"filter-<=":[Nt,[Ft,kr],(Y,[D,Q])=>{const me=Y.properties()[D.value],Re=Q.value;return typeof me==typeof Re&&me<=Re}],"filter-id-<=":[Nt,[kr],(Y,[D])=>{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q<=me}],"filter->=":[Nt,[Ft,kr],(Y,[D,Q])=>{const me=Y.properties()[D.value],Re=Q.value;return typeof me==typeof Re&&me>=Re}],"filter-id->=":[Nt,[kr],(Y,[D])=>{const Q=Y.id(),me=D.value;return typeof Q==typeof me&&Q>=me}],"filter-has":[Nt,[kr],(Y,[D])=>D.value in Y.properties()],"filter-has-id":[Nt,[],Y=>Y.id()!==null&&Y.id()!==void 0],"filter-type-in":[Nt,[je(Ft)],(Y,[D])=>D.value.indexOf(Y.geometryType())>=0],"filter-id-in":[Nt,[je(kr)],(Y,[D])=>D.value.indexOf(Y.id())>=0],"filter-in-small":[Nt,[Ft,je(kr)],(Y,[D,Q])=>Q.value.indexOf(Y.properties()[D.value])>=0],"filter-in-large":[Nt,[Ft,je(kr)],(Y,[D,Q])=>(function(me,Re,Ve,We){for(;Ve<=We;){const gt=Ve+We>>1;if(Re[gt]===me)return!0;Re[gt]>me?We=gt-1:Ve=gt+1}return!1})(Y.properties()[D.value],Q.value,0,Q.value.length-1)],all:{type:Nt,overloads:[[[Nt,Nt],(Y,[D,Q])=>D.evaluate(Y)&&Q.evaluate(Y)],[Nf(Nt),(Y,D)=>{for(const Q of D)if(!Q.evaluate(Y))return!1;return!0}]]},any:{type:Nt,overloads:[[[Nt,Nt],(Y,[D,Q])=>D.evaluate(Y)||Q.evaluate(Y)],[Nf(Nt),(Y,D)=>{for(const Q of D)if(Q.evaluate(Y))return!0;return!1}]]},"!":[Nt,[Nt],(Y,[D])=>!D.evaluate(Y)],"is-supported-script":[Nt,[Ft],(Y,[D])=>{const Q=Y.globals&&Y.globals.isSupportedScript;return!Q||Q(D.evaluate(Y))}],upcase:[Ft,[Ft],(Y,[D])=>D.evaluate(Y).toUpperCase()],downcase:[Ft,[Ft],(Y,[D])=>D.evaluate(Y).toLowerCase()],concat:[Ft,Nf(kr),(Y,D)=>D.map(Q=>pi(Q.evaluate(Y))).join("")],"resolved-locale":[Ft,[Er],(Y,[D])=>D.evaluate(Y).resolvedLocale()]});class Oc{constructor(D,Q){var me;this.expression=D,this._warningHistory={},this._evaluator=new qr,this._defaultValue=Q?(me=Q).type==="color"&&Th(me.default)?new ur(0,0,0,0):me.type==="color"?ur.parse(me.default)||null:me.type==="padding"?An.parse(me.default)||null:me.type==="variableAnchorOffsetCollection"?pa.parse(me.default)||null:me.default===void 0?null:me.default:null,this._enumValues=Q&&Q.type==="enum"?Q.values:null}evaluateWithoutErrorHandling(D,Q,me,Re,Ve,We){return this._evaluator.globals=D,this._evaluator.feature=Q,this._evaluator.featureState=me,this._evaluator.canonical=Re,this._evaluator.availableImages=Ve||null,this._evaluator.formattedSection=We,this.expression.evaluate(this._evaluator)}evaluate(D,Q,me,Re,Ve,We){this._evaluator.globals=D,this._evaluator.feature=Q||null,this._evaluator.featureState=me||null,this._evaluator.canonical=Re,this._evaluator.availableImages=Ve||null,this._evaluator.formattedSection=We||null;try{const gt=this.expression.evaluate(this._evaluator);if(gt==null||typeof gt=="number"&>!=gt)return this._defaultValue;if(this._enumValues&&!(gt in this._enumValues))throw new Dt(`Expected value to be one of ${Object.keys(this._enumValues).map(Rt=>JSON.stringify(Rt)).join(", ")}, but found ${JSON.stringify(gt)} instead.`);return gt}catch(gt){return this._warningHistory[gt.message]||(this._warningHistory[gt.message]=!0,typeof console<"u"&&console.warn(gt.message)),this._defaultValue}}}function Uf(Y){return Array.isArray(Y)&&Y.length>0&&typeof Y[0]=="string"&&Y[0]in uh}function tu(Y,D){const Q=new un(uh,Fh,[],D?(function(Re){const Ve={color:Qt,string:Ft,number:nt,enum:Ft,boolean:Nt,formatted:$r,padding:Sr,resolvedImage:Ur,variableAnchorOffsetCollection:Mt};return Re.type==="array"?je(Ve[Re.value]||kr,Re.length):Ve[Re.type]})(D):void 0),me=Q.parse(Y,void 0,void 0,void 0,D&&D.type==="string"?{typeAnnotation:"coerce"}:void 0);return me?Ef(new Oc(me,D)):vf(Q.errors)}class kf{constructor(D,Q){this.kind=D,this._styleExpression=Q,this.isStateDependent=D!=="constant"&&!of(Q.expression)}evaluateWithoutErrorHandling(D,Q,me,Re,Ve,We){return this._styleExpression.evaluateWithoutErrorHandling(D,Q,me,Re,Ve,We)}evaluate(D,Q,me,Re,Ve,We){return this._styleExpression.evaluate(D,Q,me,Re,Ve,We)}}class gc{constructor(D,Q,me,Re){this.kind=D,this.zoomStops=me,this._styleExpression=Q,this.isStateDependent=D!=="camera"&&!of(Q.expression),this.interpolationType=Re}evaluateWithoutErrorHandling(D,Q,me,Re,Ve,We){return this._styleExpression.evaluateWithoutErrorHandling(D,Q,me,Re,Ve,We)}evaluate(D,Q,me,Re,Ve,We){return this._styleExpression.evaluate(D,Q,me,Re,Ve,We)}interpolationFactor(D,Q,me){return this.interpolationType?ui.interpolationFactor(this.interpolationType,D,Q,me):0}}function Fc(Y,D){const Q=tu(Y,D);if(Q.result==="error")return Q;const me=Q.value.expression,Re=Bh(me);if(!Re&&!Ju(D))return vf([new Ne("","data expressions not supported")]);const Ve=Gh(me,["zoom"]);if(!Ve&&!Wf(D))return vf([new Ne("","zoom expressions not supported")]);const We=rh(me);return We||Ve?We instanceof Ne?vf([We]):We instanceof ui&&!Nh(D)?vf([new Ne("",'"interpolate" expressions cannot be used with this property')]):Ef(We?new gc(Re?"camera":"composite",Q.value,We.labels,We instanceof ui?We.interpolation:void 0):new kf(Re?"constant":"source",Q.value)):vf([new Ne("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class hu{constructor(D,Q){this._parameters=D,this._specification=Q,pe(this,Xh(this._parameters,this._specification))}static deserialize(D){return new hu(D._parameters,D._specification)}static serialize(D){return{_parameters:D._parameters,_specification:D._specification}}}function rh(Y){let D=null;if(Y instanceof Jr)D=rh(Y.result);else if(Y instanceof Ho){for(const Q of Y.args)if(D=rh(Q),D)break}else(Y instanceof In||Y instanceof ui)&&Y.input instanceof Ku&&Y.input.name==="zoom"&&(D=Y);return D instanceof Ne||Y.eachChild(Q=>{const me=rh(Q);me instanceof Ne?D=me:!D&&me?D=new Ne("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&me&&D!==me&&(D=new Ne("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}function pf(Y){if(Y===!0||Y===!1)return!0;if(!Array.isArray(Y)||Y.length===0)return!1;switch(Y[0]){case"has":return Y.length>=2&&Y[1]!=="$id"&&Y[1]!=="$type";case"in":return Y.length>=3&&(typeof Y[1]!="string"||Array.isArray(Y[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return Y.length!==3||Array.isArray(Y[1])||Array.isArray(Y[2]);case"any":case"all":for(const D of Y.slice(1))if(!pf(D)&&typeof D!="boolean")return!1;return!0;default:return!0}}const jf={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ah(Y){if(Y==null)return{filter:()=>!0,needGeometry:!1};pf(Y)||(Y=nh(Y));const D=tu(Y,jf);if(D.result==="error")throw new Error(D.value.map(Q=>`${Q.key}: ${Q.message}`).join(", "));return{filter:(Q,me,Re)=>D.value.evaluate(Q,me,{},Re),needGeometry:tv(Y)}}function Ed(Y,D){return YD?1:0}function tv(Y){if(!Array.isArray(Y))return!1;if(Y[0]==="within"||Y[0]==="distance")return!0;for(let D=1;D"||D==="<="||D===">="?Sh(Y[1],Y[2],D):D==="any"?(Q=Y.slice(1),["any"].concat(Q.map(nh))):D==="all"?["all"].concat(Y.slice(1).map(nh)):D==="none"?["all"].concat(Y.slice(1).map(nh).map(lc)):D==="in"?Yc(Y[1],Y.slice(2)):D==="!in"?lc(Yc(Y[1],Y.slice(2))):D==="has"?Mh(Y[1]):D!=="!has"||lc(Mh(Y[1]));var Q}function Sh(Y,D,Q){switch(Y){case"$type":return[`filter-type-${Q}`,D];case"$id":return[`filter-id-${Q}`,D];default:return[`filter-${Q}`,Y,D]}}function Yc(Y,D){if(D.length===0)return!1;switch(Y){case"$type":return["filter-type-in",["literal",D]];case"$id":return["filter-id-in",["literal",D]];default:return D.length>200&&!D.some(Q=>typeof Q!=typeof D[0])?["filter-in-large",Y,["literal",D.sort(Ed)]]:["filter-in-small",Y,["literal",D]]}}function Mh(Y){switch(Y){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",Y]}}function lc(Y){return["!",Y]}function ah(Y){const D=typeof Y;if(D==="number"||D==="boolean"||D==="string"||Y==null)return JSON.stringify(Y);if(Array.isArray(Y)){let Re="[";for(const Ve of Y)Re+=`${ah(Ve)},`;return`${Re}]`}const Q=Object.keys(Y).sort();let me="{";for(let Re=0;Reme.maximum?[new Ae(D,Q,`${Q} is greater than the maximum value ${me.maximum}`)]:[]}function hh(Y){const D=Y.valueSpec,Q=iu(Y.value.type);let me,Re,Ve,We={};const gt=Q!=="categorical"&&Y.value.property===void 0,Rt=!gt,Wt=Ul(Y.value.stops)==="array"&&Ul(Y.value.stops[0])==="array"&&Ul(Y.value.stops[0][0])==="object",pr=sf({key:Y.key,value:Y.value,valueSpec:Y.styleSpec.function,validateSpec:Y.validateSpec,style:Y.style,styleSpec:Y.styleSpec,objectElementValidators:{stops:function(Qr){if(Q==="identity")return[new Ae(Qr.key,Qr.value,'identity function may not have a "stops" property')];let vn=[];const Sn=Qr.value;return vn=vn.concat(Uh({key:Qr.key,value:Sn,valueSpec:Qr.valueSpec,validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec,arrayElementValidator:br})),Ul(Sn)==="array"&&Sn.length===0&&vn.push(new Ae(Qr.key,Sn,"array must have at least one stop")),vn},default:function(Qr){return Qr.validateSpec({key:Qr.key,value:Qr.value,valueSpec:D,validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec})}}});return Q==="identity"&>&&pr.push(new Ae(Y.key,Y.value,'missing required property "property"')),Q==="identity"||Y.value.stops||pr.push(new Ae(Y.key,Y.value,'missing required property "stops"')),Q==="exponential"&&Y.valueSpec.expression&&!Nh(Y.valueSpec)&&pr.push(new Ae(Y.key,Y.value,"exponential functions not supported")),Y.styleSpec.$version>=8&&(Rt&&!Ju(Y.valueSpec)?pr.push(new Ae(Y.key,Y.value,"property functions not supported")):gt&&!Wf(Y.valueSpec)&&pr.push(new Ae(Y.key,Y.value,"zoom functions not supported"))),Q!=="categorical"&&!Wt||Y.value.property!==void 0||pr.push(new Ae(Y.key,Y.value,'"property" property is required')),pr;function br(Qr){let vn=[];const Sn=Qr.value,Nn=Qr.key;if(Ul(Sn)!=="array")return[new Ae(Nn,Sn,`array expected, ${Ul(Sn)} found`)];if(Sn.length!==2)return[new Ae(Nn,Sn,`array length 2 expected, length ${Sn.length} found`)];if(Wt){if(Ul(Sn[0])!=="object")return[new Ae(Nn,Sn,`object expected, ${Ul(Sn[0])} found`)];if(Sn[0].zoom===void 0)return[new Ae(Nn,Sn,"object stop key must have zoom")];if(Sn[0].value===void 0)return[new Ae(Nn,Sn,"object stop key must have value")];if(Ve&&Ve>iu(Sn[0].zoom))return[new Ae(Nn,Sn[0].zoom,"stop zoom values must appear in ascending order")];iu(Sn[0].zoom)!==Ve&&(Ve=iu(Sn[0].zoom),Re=void 0,We={}),vn=vn.concat(sf({key:`${Nn}[0]`,value:Sn[0],valueSpec:{zoom:{}},validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec,objectElementValidators:{zoom:lu,value:Hr}}))}else vn=vn.concat(Hr({key:`${Nn}[0]`,value:Sn[0],validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec},Sn));return Uf(Bc(Sn[1]))?vn.concat([new Ae(`${Nn}[1]`,Sn[1],"expressions are not allowed in function stops.")]):vn.concat(Qr.validateSpec({key:`${Nn}[1]`,value:Sn[1],valueSpec:D,validateSpec:Qr.validateSpec,style:Qr.style,styleSpec:Qr.styleSpec}))}function Hr(Qr,vn){const Sn=Ul(Qr.value),Nn=iu(Qr.value),va=Qr.value!==null?Qr.value:vn;if(me){if(Sn!==me)return[new Ae(Qr.key,va,`${Sn} stop domain type must match previous stop domain type ${me}`)]}else me=Sn;if(Sn!=="number"&&Sn!=="string"&&Sn!=="boolean")return[new Ae(Qr.key,va,"stop domain value must be a number, string, or boolean")];if(Sn!=="number"&&Q!=="categorical"){let oi=`number expected, ${Sn} found`;return Ju(D)&&Q===void 0&&(oi+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ae(Qr.key,va,oi)]}return Q!=="categorical"||Sn!=="number"||isFinite(Nn)&&Math.floor(Nn)===Nn?Q!=="categorical"&&Sn==="number"&&Re!==void 0&&Nnnew Ae(`${Y.key}${me.key}`,Y.value,me.message));const Q=D.value.expression||D.value._styleExpression.expression;if(Y.expressionContext==="property"&&Y.propertyKey==="text-font"&&!Q.outputDefined())return[new Ae(Y.key,Y.value,`Invalid data expression for "${Y.propertyKey}". Output values must be contained as literals within the expression.`)];if(Y.expressionContext==="property"&&Y.propertyType==="layout"&&!of(Q))return[new Ae(Y.key,Y.value,'"feature-state" data expressions are not supported with layout properties.')];if(Y.expressionContext==="filter"&&!of(Q))return[new Ae(Y.key,Y.value,'"feature-state" data expressions are not supported with filters.')];if(Y.expressionContext&&Y.expressionContext.indexOf("cluster")===0){if(!Gh(Q,["zoom","feature-state"]))return[new Ae(Y.key,Y.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(Y.expressionContext==="cluster-initial"&&!Bh(Q))return[new Ae(Y.key,Y.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Zc(Y){const D=Y.key,Q=Y.value,me=Y.valueSpec,Re=[];return Array.isArray(me.values)?me.values.indexOf(iu(Q))===-1&&Re.push(new Ae(D,Q,`expected one of [${me.values.join(", ")}], ${JSON.stringify(Q)} found`)):Object.keys(me.values).indexOf(iu(Q))===-1&&Re.push(new Ae(D,Q,`expected one of [${Object.keys(me.values).join(", ")}], ${JSON.stringify(Q)} found`)),Re}function dh(Y){return pf(Bc(Y.value))?qf(pe({},Y,{expressionContext:"filter",valueSpec:{value:"boolean"}})):mf(Y)}function mf(Y){const D=Y.value,Q=Y.key;if(Ul(D)!=="array")return[new Ae(Q,D,`array expected, ${Ul(D)} found`)];const me=Y.styleSpec;let Re,Ve=[];if(D.length<1)return[new Ae(Q,D,"filter array must have at least 1 element")];switch(Ve=Ve.concat(Zc({key:`${Q}[0]`,value:D[0],valueSpec:me.filter_operator,style:Y.style,styleSpec:Y.styleSpec})),iu(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&iu(D[1])==="$type"&&Ve.push(new Ae(Q,D,`"$type" cannot be use with operator "${D[0]}"`));case"==":case"!=":D.length!==3&&Ve.push(new Ae(Q,D,`filter array for operator "${D[0]}" must have 3 elements`));case"in":case"!in":D.length>=2&&(Re=Ul(D[1]),Re!=="string"&&Ve.push(new Ae(`${Q}[1]`,D[1],`string expected, ${Re} found`)));for(let We=2;We{Wt in Q&&D.push(new Ae(me,Q[Wt],`"${Wt}" is prohibited for ref layers`))}),Re.layers.forEach(Wt=>{iu(Wt.id)===gt&&(Rt=Wt)}),Rt?Rt.ref?D.push(new Ae(me,Q.ref,"ref cannot reference another ref layer")):We=iu(Rt.type):D.push(new Ae(me,Q.ref,`ref layer "${gt}" not found`))}else if(We!=="background")if(Q.source){const Rt=Re.sources&&Re.sources[Q.source],Wt=Rt&&iu(Rt.type);Rt?Wt==="vector"&&We==="raster"?D.push(new Ae(me,Q.source,`layer "${Q.id}" requires a raster source`)):Wt!=="raster-dem"&&We==="hillshade"?D.push(new Ae(me,Q.source,`layer "${Q.id}" requires a raster-dem source`)):Wt==="raster"&&We!=="raster"?D.push(new Ae(me,Q.source,`layer "${Q.id}" requires a vector source`)):Wt!=="vector"||Q["source-layer"]?Wt==="raster-dem"&&We!=="hillshade"?D.push(new Ae(me,Q.source,"raster-dem source can only be used with layer type 'hillshade'.")):We!=="line"||!Q.paint||!Q.paint["line-gradient"]||Wt==="geojson"&&Rt.lineMetrics||D.push(new Ae(me,Q,`layer "${Q.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):D.push(new Ae(me,Q,`layer "${Q.id}" must specify a "source-layer"`)):D.push(new Ae(me,Q.source,`source "${Q.source}" not found`))}else D.push(new Ae(me,Q,'missing required property "source"'));return D=D.concat(sf({key:me,value:Q,valueSpec:Ve.layer,style:Y.style,styleSpec:Y.styleSpec,validateSpec:Y.validateSpec,objectElementValidators:{"*":()=>[],type:()=>Y.validateSpec({key:`${me}.type`,value:Q.type,valueSpec:Ve.layer.type,style:Y.style,styleSpec:Y.styleSpec,validateSpec:Y.validateSpec,object:Q,objectKey:"type"}),filter:dh,layout:Rt=>sf({layer:Q,key:Rt.key,value:Rt.value,style:Rt.style,styleSpec:Rt.styleSpec,validateSpec:Rt.validateSpec,objectElementValidators:{"*":Wt=>hc(pe({layerType:We},Wt))}}),paint:Rt=>sf({layer:Q,key:Rt.key,value:Rt.value,style:Rt.style,styleSpec:Rt.styleSpec,validateSpec:Rt.validateSpec,objectElementValidators:{"*":Wt=>kd(pe({layerType:We},Wt))}})}})),D}function Wc(Y){const D=Y.value,Q=Y.key,me=Ul(D);return me!=="string"?[new Ae(Q,D,`string expected, ${me} found`)]:[]}const Cf={promoteId:function({key:Y,value:D}){if(Ul(D)==="string")return Wc({key:Y,value:D});{const Q=[];for(const me in D)Q.push(...Wc({key:`${Y}.${me}`,value:D[me]}));return Q}}};function gf(Y){const D=Y.value,Q=Y.key,me=Y.styleSpec,Re=Y.style,Ve=Y.validateSpec;if(!D.type)return[new Ae(Q,D,'"type" is required')];const We=iu(D.type);let gt;switch(We){case"vector":case"raster":return gt=sf({key:Q,value:D,valueSpec:me[`source_${We.replace("-","_")}`],style:Y.style,styleSpec:me,objectElementValidators:Cf,validateSpec:Ve}),gt;case"raster-dem":return gt=(function(Rt){var Wt;const pr=(Wt=Rt.sourceName)!==null&&Wt!==void 0?Wt:"",br=Rt.value,Hr=Rt.styleSpec,Qr=Hr.source_raster_dem,vn=Rt.style;let Sn=[];const Nn=Ul(br);if(br===void 0)return Sn;if(Nn!=="object")return Sn.push(new Ae("source_raster_dem",br,`object expected, ${Nn} found`)),Sn;const va=iu(br.encoding)==="custom",oi=["redFactor","greenFactor","blueFactor","baseShift"],Ba=Rt.value.encoding?`"${Rt.value.encoding}"`:"Default";for(const ei in br)!va&&oi.includes(ei)?Sn.push(new Ae(ei,br[ei],`In "${pr}": "${ei}" is only valid when "encoding" is set to "custom". ${Ba} encoding found`)):Qr[ei]?Sn=Sn.concat(Rt.validateSpec({key:ei,value:br[ei],valueSpec:Qr[ei],validateSpec:Rt.validateSpec,style:vn,styleSpec:Hr})):Sn.push(new Ae(ei,br[ei],`unknown property "${ei}"`));return Sn})({sourceName:Q,value:D,style:Y.style,styleSpec:me,validateSpec:Ve}),gt;case"geojson":if(gt=sf({key:Q,value:D,valueSpec:me.source_geojson,style:Re,styleSpec:me,validateSpec:Ve,objectElementValidators:Cf}),D.cluster)for(const Rt in D.clusterProperties){const[Wt,pr]=D.clusterProperties[Rt],br=typeof Wt=="string"?[Wt,["accumulated"],["get",Rt]]:Wt;gt.push(...qf({key:`${Q}.${Rt}.map`,value:pr,expressionContext:"cluster-map"})),gt.push(...qf({key:`${Q}.${Rt}.reduce`,value:br,expressionContext:"cluster-reduce"}))}return gt;case"video":return sf({key:Q,value:D,valueSpec:me.source_video,style:Re,validateSpec:Ve,styleSpec:me});case"image":return sf({key:Q,value:D,valueSpec:me.source_image,style:Re,validateSpec:Ve,styleSpec:me});case"canvas":return[new Ae(Q,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Zc({key:`${Q}.type`,value:D.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Su(Y){const D=Y.value,Q=Y.styleSpec,me=Q.light,Re=Y.style;let Ve=[];const We=Ul(D);if(D===void 0)return Ve;if(We!=="object")return Ve=Ve.concat([new Ae("light",D,`object expected, ${We} found`)]),Ve;for(const gt in D){const Rt=gt.match(/^(.*)-transition$/);Ve=Ve.concat(Rt&&me[Rt[1]]&&me[Rt[1]].transition?Y.validateSpec({key:gt,value:D[gt],valueSpec:Q.transition,validateSpec:Y.validateSpec,style:Re,styleSpec:Q}):me[gt]?Y.validateSpec({key:gt,value:D[gt],valueSpec:me[gt],validateSpec:Y.validateSpec,style:Re,styleSpec:Q}):[new Ae(gt,D[gt],`unknown property "${gt}"`)])}return Ve}function Tc(Y){const D=Y.value,Q=Y.styleSpec,me=Q.sky,Re=Y.style,Ve=Ul(D);if(D===void 0)return[];if(Ve!=="object")return[new Ae("sky",D,`object expected, ${Ve} found`)];let We=[];for(const gt in D)We=We.concat(me[gt]?Y.validateSpec({key:gt,value:D[gt],valueSpec:me[gt],style:Re,styleSpec:Q}):[new Ae(gt,D[gt],`unknown property "${gt}"`)]);return We}function pu(Y){const D=Y.value,Q=Y.styleSpec,me=Q.terrain,Re=Y.style;let Ve=[];const We=Ul(D);if(D===void 0)return Ve;if(We!=="object")return Ve=Ve.concat([new Ae("terrain",D,`object expected, ${We} found`)]),Ve;for(const gt in D)Ve=Ve.concat(me[gt]?Y.validateSpec({key:gt,value:D[gt],valueSpec:me[gt],validateSpec:Y.validateSpec,style:Re,styleSpec:Q}):[new Ae(gt,D[gt],`unknown property "${gt}"`)]);return Ve}function Vf(Y){let D=[];const Q=Y.value,me=Y.key;if(Array.isArray(Q)){const Re=[],Ve=[];for(const We in Q)Q[We].id&&Re.includes(Q[We].id)&&D.push(new Ae(me,Q,`all the sprites' ids must be unique, but ${Q[We].id} is duplicated`)),Re.push(Q[We].id),Q[We].url&&Ve.includes(Q[We].url)&&D.push(new Ae(me,Q,`all the sprites' URLs must be unique, but ${Q[We].url} is duplicated`)),Ve.push(Q[We].url),D=D.concat(sf({key:`${me}[${We}]`,value:Q[We],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:Y.validateSpec}));return D}return Wc({key:me,value:Q})}const yf={"*":()=>[],array:Uh,boolean:function(Y){const D=Y.value,Q=Y.key,me=Ul(D);return me!=="boolean"?[new Ae(Q,D,`boolean expected, ${me} found`)]:[]},number:lu,color:function(Y){const D=Y.key,Q=Y.value,me=Ul(Q);return me!=="string"?[new Ae(D,Q,`color expected, ${me} found`)]:ur.parse(String(Q))?[]:[new Ae(D,Q,`color expected, "${Q}" found`)]},constants:ih,enum:Zc,filter:dh,function:hh,layer:$h,object:sf,source:gf,light:Su,sky:Tc,terrain:pu,projection:function(Y){const D=Y.value,Q=Y.styleSpec,me=Q.projection,Re=Y.style,Ve=Ul(D);if(D===void 0)return[];if(Ve!=="object")return[new Ae("projection",D,`object expected, ${Ve} found`)];let We=[];for(const gt in D)We=We.concat(me[gt]?Y.validateSpec({key:gt,value:D[gt],valueSpec:me[gt],style:Re,styleSpec:Q}):[new Ae(gt,D[gt],`unknown property "${gt}"`)]);return We},string:Wc,formatted:function(Y){return Wc(Y).length===0?[]:qf(Y)},resolvedImage:function(Y){return Wc(Y).length===0?[]:qf(Y)},padding:function(Y){const D=Y.key,Q=Y.value;if(Ul(Q)==="array"){if(Q.length<1||Q.length>4)return[new Ae(D,Q,`padding requires 1 to 4 values; ${Q.length} values found`)];const me={type:"number"};let Re=[];for(let Ve=0;Ve[]}})),Y.constants&&(Q=Q.concat(ih({key:"constants",value:Y.constants}))),an(Q)}function pn(Y){return function(D){return Y(wo(Hi({},D),{validateSpec:jh}))}}function an(Y){return[].concat(Y).sort((D,Q)=>D.line-Q.line)}function On(Y){return function(...D){return an(Y.apply(this,D))}}Rr.source=On(pn(gf)),Rr.sprite=On(pn(Vf)),Rr.glyphs=On(pn(cr)),Rr.light=On(pn(Su)),Rr.sky=On(pn(Tc)),Rr.terrain=On(pn(pu)),Rr.layer=On(pn($h)),Rr.filter=On(pn(dh)),Rr.paintProperty=On(pn(kd)),Rr.layoutProperty=On(pn(hc));const Aa=Rr,xa=Aa.light,ti=Aa.sky,li=Aa.paintProperty,Ni=Aa.layoutProperty;function Ha(Y,D){let Q=!1;if(D&&D.length)for(const me of D)Y.fire(new H(new Error(me.message))),Q=!0;return Q}class bi{constructor(D,Q,me){const Re=this.cells=[];if(D instanceof ArrayBuffer){this.arrayBuffer=D;const We=new Int32Array(this.arrayBuffer);D=We[0],this.d=(Q=We[1])+2*(me=We[2]);for(let Rt=0;Rt=br[vn+0]&&Re>=br[vn+1])?(gt[Qr]=!0,We.push(pr[Qr])):gt[Qr]=!1}}}}_forEachCell(D,Q,me,Re,Ve,We,gt,Rt){const Wt=this._convertToCellCoord(D),pr=this._convertToCellCoord(Q),br=this._convertToCellCoord(me),Hr=this._convertToCellCoord(Re);for(let Qr=Wt;Qr<=br;Qr++)for(let vn=pr;vn<=Hr;vn++){const Sn=this.d*vn+Qr;if((!Rt||Rt(this._convertFromCellCoord(Qr),this._convertFromCellCoord(vn),this._convertFromCellCoord(Qr+1),this._convertFromCellCoord(vn+1)))&&Ve.call(this,D,Q,me,Re,Sn,We,gt,Rt))return}}_convertFromCellCoord(D){return(D-this.padding)/this.scale}_convertToCellCoord(D){return Math.max(0,Math.min(this.d-1,Math.floor(D*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const D=this.cells,Q=3+this.cells.length+1+1;let me=0;for(let We=0;We=0)continue;const We=Y[Ve];Re[Ve]=Qa[Q].shallow.indexOf(Ve)>=0?We:Go(We,D)}Y instanceof Error&&(Re.message=Y.message)}if(Re.$name)throw new Error("$name property is reserved for worker serialization logic.");return Q!=="Object"&&(Re.$name=Q),Re}function jo(Y){if(Do(Y))return Y;if(Array.isArray(Y))return Y.map(jo);if(typeof Y!="object")throw new Error("can't deserialize object of type "+typeof Y);const D=No(Y)||"Object";if(!Qa[D])throw new Error(`can't deserialize unregistered class ${D}`);const{klass:Q}=Qa[D];if(!Q)throw new Error(`can't deserialize unregistered class ${D}`);if(Q.deserialize)return Q.deserialize(Y);const me=Object.create(Q.prototype);for(const Re of Object.keys(Y)){if(Re==="$name")continue;const Ve=Y[Re];me[Re]=Qa[D].shallow.indexOf(Re)>=0?Ve:jo(Ve)}return me}class Wi{constructor(){this.first=!0}update(D,Q){const me=Math.floor(D);return this.first?(this.first=!1,this.lastIntegerZoom=me,this.lastIntegerZoomTime=0,this.lastZoom=D,this.lastFloorZoom=me,!0):(this.lastFloorZoom>me?(this.lastIntegerZoom=me+1,this.lastIntegerZoomTime=Q):this.lastFloorZoomY>=128&&Y<=255,"Hangul Jamo":Y=>Y>=4352&&Y<=4607,Khmer:Y=>Y>=6016&&Y<=6143,"General Punctuation":Y=>Y>=8192&&Y<=8303,"Letterlike Symbols":Y=>Y>=8448&&Y<=8527,"Number Forms":Y=>Y>=8528&&Y<=8591,"Miscellaneous Technical":Y=>Y>=8960&&Y<=9215,"Control Pictures":Y=>Y>=9216&&Y<=9279,"Optical Character Recognition":Y=>Y>=9280&&Y<=9311,"Enclosed Alphanumerics":Y=>Y>=9312&&Y<=9471,"Geometric Shapes":Y=>Y>=9632&&Y<=9727,"Miscellaneous Symbols":Y=>Y>=9728&&Y<=9983,"Miscellaneous Symbols and Arrows":Y=>Y>=11008&&Y<=11263,"Ideographic Description Characters":Y=>Y>=12272&&Y<=12287,"CJK Symbols and Punctuation":Y=>Y>=12288&&Y<=12351,Katakana:Y=>Y>=12448&&Y<=12543,Kanbun:Y=>Y>=12688&&Y<=12703,"CJK Strokes":Y=>Y>=12736&&Y<=12783,"Enclosed CJK Letters and Months":Y=>Y>=12800&&Y<=13055,"CJK Compatibility":Y=>Y>=13056&&Y<=13311,"Yijing Hexagram Symbols":Y=>Y>=19904&&Y<=19967,"Private Use Area":Y=>Y>=57344&&Y<=63743,"Vertical Forms":Y=>Y>=65040&&Y<=65055,"CJK Compatibility Forms":Y=>Y>=65072&&Y<=65103,"Small Form Variants":Y=>Y>=65104&&Y<=65135,"Halfwidth and Fullwidth Forms":Y=>Y>=65280&&Y<=65519};function ns(Y){for(const D of Y)if(rl(D.charCodeAt(0)))return!0;return!1}function Bs(Y){for(const D of Y)if(!Ml(D.charCodeAt(0)))return!1;return!0}function Al(Y){const D=Y.map(Q=>{try{return new RegExp(`\\p{sc=${Q}}`,"u").source}catch{return null}}).filter(Q=>Q);return new RegExp(D.join("|"),"u")}const Zl=Al(["Arab","Dupl","Mong","Ougr","Syrc"]);function Ml(Y){return!Zl.test(String.fromCodePoint(Y))}const Wl=Al(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function rl(Y){return!(Y!==746&&Y!==747&&(Y<4352||!(Li["CJK Compatibility Forms"](Y)&&!(Y>=65097&&Y<=65103)||Li["CJK Compatibility"](Y)||Li["CJK Strokes"](Y)||!(!Li["CJK Symbols and Punctuation"](Y)||Y>=12296&&Y<=12305||Y>=12308&&Y<=12319||Y===12336)||Li["Enclosed CJK Letters and Months"](Y)||Li["Ideographic Description Characters"](Y)||Li.Kanbun(Y)||Li.Katakana(Y)&&Y!==12540||!(!Li["Halfwidth and Fullwidth Forms"](Y)||Y===65288||Y===65289||Y===65293||Y>=65306&&Y<=65310||Y===65339||Y===65341||Y===65343||Y>=65371&&Y<=65503||Y===65507||Y>=65512&&Y<=65519)||!(!Li["Small Form Variants"](Y)||Y>=65112&&Y<=65118||Y>=65123&&Y<=65126)||Li["Vertical Forms"](Y)||Li["Yijing Hexagram Symbols"](Y)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(Y))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(Y))||Wl.test(String.fromCodePoint(Y)))))}function Cu(Y){return!(rl(Y)||(function(D){return!!(Li["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||Li["General Punctuation"](D)&&(D===8214||D===8224||D===8225||D===8240||D===8241||D===8251||D===8252||D===8258||D===8263||D===8264||D===8265||D===8273)||Li["Letterlike Symbols"](D)||Li["Number Forms"](D)||Li["Miscellaneous Technical"](D)&&(D>=8960&&D<=8967||D>=8972&&D<=8991||D>=8996&&D<=9e3||D===9003||D>=9085&&D<=9114||D>=9150&&D<=9165||D===9167||D>=9169&&D<=9179||D>=9186&&D<=9215)||Li["Control Pictures"](D)&&D!==9251||Li["Optical Character Recognition"](D)||Li["Enclosed Alphanumerics"](D)||Li["Geometric Shapes"](D)||Li["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||Li["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||Li["CJK Symbols and Punctuation"](D)||Li.Katakana(D)||Li["Private Use Area"](D)||Li["CJK Compatibility Forms"](D)||Li["Small Form Variants"](D)||Li["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)})(Y))}const Mu=Al(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Hl(Y){return Mu.test(String.fromCodePoint(Y))}function yo(Y,D){return!(!D&&Hl(Y)||Y>=2304&&Y<=3583||Y>=3840&&Y<=4255||Li.Khmer(Y))}function ys(Y){for(const D of Y)if(Hl(D.charCodeAt(0)))return!0;return!1}const zl=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(Y){this.pluginStatus=Y.pluginStatus,this.pluginURL=Y.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(Y){this.applyArabicShaping=Y.applyArabicShaping,this.processBidirectionalText=Y.processBidirectionalText,this.processStyledBidirectionalText=Y.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class ml{constructor(D,Q){this.zoom=D,Q?(this.now=Q.now,this.fadeDuration=Q.fadeDuration,this.zoomHistory=Q.zoomHistory,this.transition=Q.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Wi,this.transition={})}isSupportedScript(D){return(function(Q,me){for(const Re of Q)if(!yo(Re.charCodeAt(0),me))return!1;return!0})(D,zl.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const D=this.zoom,Q=D-Math.floor(D),me=this.crossFadingFactor();return D>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:Q+(1-Q)*me}:{fromScale:.5,toScale:1,t:1-(1-me)*Q}}}class yc{constructor(D,Q){this.property=D,this.value=Q,this.expression=(function(me,Re){if(Th(me))return new hu(me,Re);if(Uf(me)){const Ve=Fc(me,Re);if(Ve.result==="error")throw new Error(Ve.value.map(We=>`${We.key}: ${We.message}`).join(", "));return Ve.value}{let Ve=me;return Re.type==="color"&&typeof me=="string"?Ve=ur.parse(me):Re.type!=="padding"||typeof me!="number"&&!Array.isArray(me)?Re.type==="variableAnchorOffsetCollection"&&Array.isArray(me)&&(Ve=pa.parse(me)):Ve=An.parse(me),{kind:"constant",evaluate:()=>Ve}}})(Q===void 0?D.specification.default:Q,D.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(D,Q,me){return this.property.possiblyEvaluate(this,D,Q,me)}}class _c{constructor(D){this.property=D,this.value=new yc(D,void 0)}transitioned(D,Q){return new $f(this.property,this.value,Q,M({},D.transition,this.transition),D.now)}untransitioned(){return new $f(this.property,this.value,null,{},0)}}class Ac{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitionablePropertyValues)}getValue(D){return u(this._values[D].value.value)}setValue(D,Q){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new _c(this._values[D].property)),this._values[D].value=new yc(this._values[D].property,Q===null?void 0:u(Q))}getTransition(D){return u(this._values[D].transition)}setTransition(D,Q){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new _c(this._values[D].property)),this._values[D].transition=u(Q)||void 0}serialize(){const D={};for(const Q of Object.keys(this._values)){const me=this.getValue(Q);me!==void 0&&(D[Q]=me);const Re=this.getTransition(Q);Re!==void 0&&(D[`${Q}-transition`]=Re)}return D}transitioned(D,Q){const me=new xc(this._properties);for(const Re of Object.keys(this._values))me._values[Re]=this._values[Re].transitioned(D,Q._values[Re]);return me}untransitioned(){const D=new xc(this._properties);for(const Q of Object.keys(this._values))D._values[Q]=this._values[Q].untransitioned();return D}}class $f{constructor(D,Q,me,Re,Ve){this.property=D,this.value=Q,this.begin=Ve+Re.delay||0,this.end=this.begin+Re.duration||0,D.specification.transition&&(Re.delay||Re.duration)&&(this.prior=me)}possiblyEvaluate(D,Q,me){const Re=D.now||0,Ve=this.value.possiblyEvaluate(D,Q,me),We=this.prior;if(We){if(Re>this.end)return this.prior=null,Ve;if(this.value.isDataDriven())return this.prior=null,Ve;if(Re=1)return 1;const Wt=Rt*Rt,pr=Wt*Rt;return 4*(Rt<.5?pr:3*(Rt-Wt)+pr-.75)})(gt))}}return Ve}}class xc{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitioningPropertyValues)}possiblyEvaluate(D,Q,me){const Re=new Pf(this._properties);for(const Ve of Object.keys(this._values))Re._values[Ve]=this._values[Ve].possiblyEvaluate(D,Q,me);return Re}hasTransition(){for(const D of Object.keys(this._values))if(this._values[D].prior)return!0;return!1}}class Lf{constructor(D){this._properties=D,this._values=Object.create(D.defaultPropertyValues)}hasValue(D){return this._values[D].value!==void 0}getValue(D){return u(this._values[D].value)}setValue(D,Q){this._values[D]=new yc(this._values[D].property,Q===null?void 0:u(Q))}serialize(){const D={};for(const Q of Object.keys(this._values)){const me=this.getValue(Q);me!==void 0&&(D[Q]=me)}return D}possiblyEvaluate(D,Q,me){const Re=new Pf(this._properties);for(const Ve of Object.keys(this._values))Re._values[Ve]=this._values[Ve].possiblyEvaluate(D,Q,me);return Re}}class Lu{constructor(D,Q,me){this.property=D,this.value=Q,this.parameters=me}isConstant(){return this.value.kind==="constant"}constantOr(D){return this.value.kind==="constant"?this.value.value:D}evaluate(D,Q,me,Re){return this.property.evaluate(this.value,this.parameters,D,Q,me,Re)}}class Pf{constructor(D){this._properties=D,this._values=Object.create(D.defaultPossiblyEvaluatedValues)}get(D){return this._values[D]}}class Xo{constructor(D){this.specification=D}possiblyEvaluate(D,Q){if(D.isDataDriven())throw new Error("Value should not be data driven");return D.expression.evaluate(Q)}interpolate(D,Q,me){const Re=Mo[this.specification.type];return Re?Re(D,Q,me):D}}class as{constructor(D,Q){this.specification=D,this.overrides=Q}possiblyEvaluate(D,Q,me,Re){return new Lu(this,D.expression.kind==="constant"||D.expression.kind==="camera"?{kind:"constant",value:D.expression.evaluate(Q,null,{},me,Re)}:D.expression,Q)}interpolate(D,Q,me){if(D.value.kind!=="constant"||Q.value.kind!=="constant")return D;if(D.value.value===void 0||Q.value.value===void 0)return new Lu(this,{kind:"constant",value:void 0},D.parameters);const Re=Mo[this.specification.type];if(Re){const Ve=Re(D.value.value,Q.value.value,me);return new Lu(this,{kind:"constant",value:Ve},D.parameters)}return D}evaluate(D,Q,me,Re,Ve,We){return D.kind==="constant"?D.value:D.evaluate(Q,me,Re,Ve,We)}}class Rf extends as{possiblyEvaluate(D,Q,me,Re){if(D.value===void 0)return new Lu(this,{kind:"constant",value:void 0},Q);if(D.expression.kind==="constant"){const Ve=D.expression.evaluate(Q,null,{},me,Re),We=D.property.specification.type==="resolvedImage"&&typeof Ve!="string"?Ve.name:Ve,gt=this._calculate(We,We,We,Q);return new Lu(this,{kind:"constant",value:gt},Q)}if(D.expression.kind==="camera"){const Ve=this._calculate(D.expression.evaluate({zoom:Q.zoom-1}),D.expression.evaluate({zoom:Q.zoom}),D.expression.evaluate({zoom:Q.zoom+1}),Q);return new Lu(this,{kind:"constant",value:Ve},Q)}return new Lu(this,D.expression,Q)}evaluate(D,Q,me,Re,Ve,We){if(D.kind==="source"){const gt=D.evaluate(Q,me,Re,Ve,We);return this._calculate(gt,gt,gt,Q)}return D.kind==="composite"?this._calculate(D.evaluate({zoom:Math.floor(Q.zoom)-1},me,Re),D.evaluate({zoom:Math.floor(Q.zoom)},me,Re),D.evaluate({zoom:Math.floor(Q.zoom)+1},me,Re),Q):D.value}_calculate(D,Q,me,Re){return Re.zoom>Re.zoomHistory.lastIntegerZoom?{from:D,to:Q}:{from:me,to:Q}}interpolate(D){return D}}class $c{constructor(D){this.specification=D}possiblyEvaluate(D,Q,me,Re){if(D.value!==void 0){if(D.expression.kind==="constant"){const Ve=D.expression.evaluate(Q,null,{},me,Re);return this._calculate(Ve,Ve,Ve,Q)}return this._calculate(D.expression.evaluate(new ml(Math.floor(Q.zoom-1),Q)),D.expression.evaluate(new ml(Math.floor(Q.zoom),Q)),D.expression.evaluate(new ml(Math.floor(Q.zoom+1),Q)),Q)}}_calculate(D,Q,me,Re){return Re.zoom>Re.zoomHistory.lastIntegerZoom?{from:D,to:Q}:{from:me,to:Q}}interpolate(D){return D}}class Nc{constructor(D){this.specification=D}possiblyEvaluate(D,Q,me,Re){return!!D.expression.evaluate(Q,null,{},me,Re)}interpolate(){return!1}}class Ue{constructor(D){this.properties=D,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const Q in D){const me=D[Q];me.specification.overridable&&this.overridableProperties.push(Q);const Re=this.defaultPropertyValues[Q]=new yc(me,void 0),Ve=this.defaultTransitionablePropertyValues[Q]=new _c(me);this.defaultTransitioningPropertyValues[Q]=Ve.untransitioned(),this.defaultPossiblyEvaluatedValues[Q]=Re.possiblyEvaluate({})}}}Na("DataDrivenProperty",as),Na("DataConstantProperty",Xo),Na("CrossFadedDataDrivenProperty",Rf),Na("CrossFadedProperty",$c),Na("ColorRampProperty",Nc);const P="-transition";class oe extends ae{constructor(D,Q){if(super(),this.id=D.id,this.type=D.type,this._featureFilter={filter:()=>!0,needGeometry:!1},D.type!=="custom"&&(this.metadata=D.metadata,this.minzoom=D.minzoom,this.maxzoom=D.maxzoom,D.type!=="background"&&(this.source=D.source,this.sourceLayer=D["source-layer"],this.filter=D.filter),Q.layout&&(this._unevaluatedLayout=new Lf(Q.layout)),Q.paint)){this._transitionablePaint=new Ac(Q.paint);for(const me in D.paint)this.setPaintProperty(me,D.paint[me],{validate:!1});for(const me in D.layout)this.setLayoutProperty(me,D.layout[me],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Pf(Q.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(D){return D==="visibility"?this.visibility:this._unevaluatedLayout.getValue(D)}setLayoutProperty(D,Q,me={}){Q!=null&&this._validate(Ni,`layers.${this.id}.layout.${D}`,D,Q,me)||(D!=="visibility"?this._unevaluatedLayout.setValue(D,Q):this.visibility=Q)}getPaintProperty(D){return D.endsWith(P)?this._transitionablePaint.getTransition(D.slice(0,-11)):this._transitionablePaint.getValue(D)}setPaintProperty(D,Q,me={}){if(Q!=null&&this._validate(li,`layers.${this.id}.paint.${D}`,D,Q,me))return!1;if(D.endsWith(P))return this._transitionablePaint.setTransition(D.slice(0,-11),Q||void 0),!1;{const Re=this._transitionablePaint._values[D],Ve=Re.property.specification["property-type"]==="cross-faded-data-driven",We=Re.value.isDataDriven(),gt=Re.value;this._transitionablePaint.setValue(D,Q),this._handleSpecialPaintPropertyUpdate(D);const Rt=this._transitionablePaint._values[D].value;return Rt.isDataDriven()||We||Ve||this._handleOverridablePaintPropertyUpdate(D,gt,Rt)}}_handleSpecialPaintPropertyUpdate(D){}_handleOverridablePaintPropertyUpdate(D,Q,me){return!1}isHidden(D){return!!(this.minzoom&&D=this.maxzoom)||this.visibility==="none"}updateTransitions(D){this._transitioningPaint=this._transitionablePaint.transitioned(D,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(D,Q){D.getCrossfadeParameters&&(this._crossfadeParameters=D.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(D,void 0,Q)),this.paint=this._transitioningPaint.possiblyEvaluate(D,void 0,Q)}serialize(){const D={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(D.layout=D.layout||{},D.layout.visibility=this.visibility),m(D,(Q,me)=>!(Q===void 0||me==="layout"&&!Object.keys(Q).length||me==="paint"&&!Object.keys(Q).length))}_validate(D,Q,me,Re,Ve={}){return(!Ve||Ve.validate!==!1)&&Ha(this,D.call(Aa,{key:Q,layerType:this.type,objectKey:me,value:Re,styleSpec:ie,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const D in this.paint._values){const Q=this.paint.get(D);if(Q instanceof Lu&&Ju(Q.property.specification)&&(Q.value.kind==="source"||Q.value.kind==="composite")&&Q.value.isStateDependent)return!0}return!1}}const Me={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ce{constructor(D,Q){this._structArray=D,this._pos1=Q*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Be{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(D,Q){return D._trim(),Q&&(D.isTransferred=!0,Q.push(D.arrayBuffer)),{length:D.length,arrayBuffer:D.arrayBuffer}}static deserialize(D){const Q=Object.create(this.prototype);return Q.arrayBuffer=D.arrayBuffer,Q.length=D.length,Q.capacity=D.arrayBuffer.byteLength/Q.bytesPerElement,Q._refreshViews(),Q}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(D){this.reserve(D),this.length=D}reserve(D){if(D>this.capacity){this.capacity=Math.max(D,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const Q=this.uint8;this._refreshViews(),Q&&this.uint8.set(Q)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function _t(Y,D=1){let Q=0,me=0;return{members:Y.map(Re=>{const Ve=Me[Re.type].BYTES_PER_ELEMENT,We=Q=kt(Q,Math.max(D,Ve)),gt=Re.components||1;return me=Math.max(me,Ve),Q+=Ve*gt,{name:Re.name,type:Re.type,components:gt,offset:We}}),size:kt(Q,Math.max(me,D)),alignment:D}}function kt(Y,D){return Math.ceil(Y/D)*D}class Xt extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q){const me=this.length;return this.resize(me+1),this.emplace(me,D,Q)}emplace(D,Q,me){const Re=2*D;return this.int16[Re+0]=Q,this.int16[Re+1]=me,D}}Xt.prototype.bytesPerElement=4,Na("StructArrayLayout2i4",Xt);class fr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Re=this.length;return this.resize(Re+1),this.emplace(Re,D,Q,me)}emplace(D,Q,me,Re){const Ve=3*D;return this.int16[Ve+0]=Q,this.int16[Ve+1]=me,this.int16[Ve+2]=Re,D}}fr.prototype.bytesPerElement=6,Na("StructArrayLayout3i6",fr);class Ar extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re){const Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,D,Q,me,Re)}emplace(D,Q,me,Re,Ve){const We=4*D;return this.int16[We+0]=Q,this.int16[We+1]=me,this.int16[We+2]=Re,this.int16[We+3]=Ve,D}}Ar.prototype.bytesPerElement=8,Na("StructArrayLayout4i8",Ar);class Lr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re,Ve,We){const gt=this.length;return this.resize(gt+1),this.emplace(gt,D,Q,me,Re,Ve,We)}emplace(D,Q,me,Re,Ve,We,gt){const Rt=6*D;return this.int16[Rt+0]=Q,this.int16[Rt+1]=me,this.int16[Rt+2]=Re,this.int16[Rt+3]=Ve,this.int16[Rt+4]=We,this.int16[Rt+5]=gt,D}}Lr.prototype.bytesPerElement=12,Na("StructArrayLayout2i4i12",Lr);class tn extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re,Ve,We){const gt=this.length;return this.resize(gt+1),this.emplace(gt,D,Q,me,Re,Ve,We)}emplace(D,Q,me,Re,Ve,We,gt){const Rt=4*D,Wt=8*D;return this.int16[Rt+0]=Q,this.int16[Rt+1]=me,this.uint8[Wt+4]=Re,this.uint8[Wt+5]=Ve,this.uint8[Wt+6]=We,this.uint8[Wt+7]=gt,D}}tn.prototype.bytesPerElement=8,Na("StructArrayLayout2i4ub8",tn);class xn extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q){const me=this.length;return this.resize(me+1),this.emplace(me,D,Q)}emplace(D,Q,me){const Re=2*D;return this.float32[Re+0]=Q,this.float32[Re+1]=me,D}}xn.prototype.bytesPerElement=8,Na("StructArrayLayout2f8",xn);class Ze extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re,Ve,We,gt,Rt,Wt,pr){const br=this.length;return this.resize(br+1),this.emplace(br,D,Q,me,Re,Ve,We,gt,Rt,Wt,pr)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br){const Hr=10*D;return this.uint16[Hr+0]=Q,this.uint16[Hr+1]=me,this.uint16[Hr+2]=Re,this.uint16[Hr+3]=Ve,this.uint16[Hr+4]=We,this.uint16[Hr+5]=gt,this.uint16[Hr+6]=Rt,this.uint16[Hr+7]=Wt,this.uint16[Hr+8]=pr,this.uint16[Hr+9]=br,D}}Ze.prototype.bytesPerElement=20,Na("StructArrayLayout10ui20",Ze);class tt extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr){const Qr=this.length;return this.resize(Qr+1),this.emplace(Qr,D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr,Qr){const vn=12*D;return this.int16[vn+0]=Q,this.int16[vn+1]=me,this.int16[vn+2]=Re,this.int16[vn+3]=Ve,this.uint16[vn+4]=We,this.uint16[vn+5]=gt,this.uint16[vn+6]=Rt,this.uint16[vn+7]=Wt,this.int16[vn+8]=pr,this.int16[vn+9]=br,this.int16[vn+10]=Hr,this.int16[vn+11]=Qr,D}}tt.prototype.bytesPerElement=24,Na("StructArrayLayout4i4ui4i24",tt);class vt extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Re=this.length;return this.resize(Re+1),this.emplace(Re,D,Q,me)}emplace(D,Q,me,Re){const Ve=3*D;return this.float32[Ve+0]=Q,this.float32[Ve+1]=me,this.float32[Ve+2]=Re,D}}vt.prototype.bytesPerElement=12,Na("StructArrayLayout3f12",vt);class bt extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(D){const Q=this.length;return this.resize(Q+1),this.emplace(Q,D)}emplace(D,Q){return this.uint32[1*D+0]=Q,D}}bt.prototype.bytesPerElement=4,Na("StructArrayLayout1ul4",bt);class zt extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re,Ve,We,gt,Rt,Wt){const pr=this.length;return this.resize(pr+1),this.emplace(pr,D,Q,me,Re,Ve,We,gt,Rt,Wt)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Wt,pr){const br=10*D,Hr=5*D;return this.int16[br+0]=Q,this.int16[br+1]=me,this.int16[br+2]=Re,this.int16[br+3]=Ve,this.int16[br+4]=We,this.int16[br+5]=gt,this.uint32[Hr+3]=Rt,this.uint16[br+8]=Wt,this.uint16[br+9]=pr,D}}zt.prototype.bytesPerElement=20,Na("StructArrayLayout6i1ul2ui20",zt);class Et extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re,Ve,We){const gt=this.length;return this.resize(gt+1),this.emplace(gt,D,Q,me,Re,Ve,We)}emplace(D,Q,me,Re,Ve,We,gt){const Rt=6*D;return this.int16[Rt+0]=Q,this.int16[Rt+1]=me,this.int16[Rt+2]=Re,this.int16[Rt+3]=Ve,this.int16[Rt+4]=We,this.int16[Rt+5]=gt,D}}Et.prototype.bytesPerElement=12,Na("StructArrayLayout2i2i2i12",Et);class Ut extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re,Ve){const We=this.length;return this.resize(We+1),this.emplace(We,D,Q,me,Re,Ve)}emplace(D,Q,me,Re,Ve,We){const gt=4*D,Rt=8*D;return this.float32[gt+0]=Q,this.float32[gt+1]=me,this.float32[gt+2]=Re,this.int16[Rt+6]=Ve,this.int16[Rt+7]=We,D}}Ut.prototype.bytesPerElement=16,Na("StructArrayLayout2f1f2i16",Ut);class gr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re,Ve,We){const gt=this.length;return this.resize(gt+1),this.emplace(gt,D,Q,me,Re,Ve,We)}emplace(D,Q,me,Re,Ve,We,gt){const Rt=16*D,Wt=4*D,pr=8*D;return this.uint8[Rt+0]=Q,this.uint8[Rt+1]=me,this.float32[Wt+1]=Re,this.float32[Wt+2]=Ve,this.int16[pr+6]=We,this.int16[pr+7]=gt,D}}gr.prototype.bytesPerElement=16,Na("StructArrayLayout2ub2f2i16",gr);class Tr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Re=this.length;return this.resize(Re+1),this.emplace(Re,D,Q,me)}emplace(D,Q,me,Re){const Ve=3*D;return this.uint16[Ve+0]=Q,this.uint16[Ve+1]=me,this.uint16[Ve+2]=Re,D}}Tr.prototype.bytesPerElement=6,Na("StructArrayLayout3ui6",Tr);class Pr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr,Qr,vn,Sn,Nn,va){const oi=this.length;return this.resize(oi+1),this.emplace(oi,D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr,Qr,vn,Sn,Nn,va)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr,Qr,vn,Sn,Nn,va,oi){const Ba=24*D,ei=12*D,Oi=48*D;return this.int16[Ba+0]=Q,this.int16[Ba+1]=me,this.uint16[Ba+2]=Re,this.uint16[Ba+3]=Ve,this.uint32[ei+2]=We,this.uint32[ei+3]=gt,this.uint32[ei+4]=Rt,this.uint16[Ba+10]=Wt,this.uint16[Ba+11]=pr,this.uint16[Ba+12]=br,this.float32[ei+7]=Hr,this.float32[ei+8]=Qr,this.uint8[Oi+36]=vn,this.uint8[Oi+37]=Sn,this.uint8[Oi+38]=Nn,this.uint32[ei+10]=va,this.int16[Ba+22]=oi,D}}Pr.prototype.bytesPerElement=48,Na("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Pr);class Yr extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr,Qr,vn,Sn,Nn,va,oi,Ba,ei,Oi,fo,$o,dl,is,Yo,Is,Ss){const bs=this.length;return this.resize(bs+1),this.emplace(bs,D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr,Qr,vn,Sn,Nn,va,oi,Ba,ei,Oi,fo,$o,dl,is,Yo,Is,Ss)}emplace(D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr,Qr,vn,Sn,Nn,va,oi,Ba,ei,Oi,fo,$o,dl,is,Yo,Is,Ss,bs){const eo=32*D,Gs=16*D;return this.int16[eo+0]=Q,this.int16[eo+1]=me,this.int16[eo+2]=Re,this.int16[eo+3]=Ve,this.int16[eo+4]=We,this.int16[eo+5]=gt,this.int16[eo+6]=Rt,this.int16[eo+7]=Wt,this.uint16[eo+8]=pr,this.uint16[eo+9]=br,this.uint16[eo+10]=Hr,this.uint16[eo+11]=Qr,this.uint16[eo+12]=vn,this.uint16[eo+13]=Sn,this.uint16[eo+14]=Nn,this.uint16[eo+15]=va,this.uint16[eo+16]=oi,this.uint16[eo+17]=Ba,this.uint16[eo+18]=ei,this.uint16[eo+19]=Oi,this.uint16[eo+20]=fo,this.uint16[eo+21]=$o,this.uint16[eo+22]=dl,this.uint32[Gs+12]=is,this.float32[Gs+13]=Yo,this.float32[Gs+14]=Is,this.uint16[eo+30]=Ss,this.uint16[eo+31]=bs,D}}Yr.prototype.bytesPerElement=64,Na("StructArrayLayout8i15ui1ul2f2ui64",Yr);class sn extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D){const Q=this.length;return this.resize(Q+1),this.emplace(Q,D)}emplace(D,Q){return this.float32[1*D+0]=Q,D}}sn.prototype.bytesPerElement=4,Na("StructArrayLayout1f4",sn);class En extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Re=this.length;return this.resize(Re+1),this.emplace(Re,D,Q,me)}emplace(D,Q,me,Re){const Ve=3*D;return this.uint16[6*D+0]=Q,this.float32[Ve+1]=me,this.float32[Ve+2]=Re,D}}En.prototype.bytesPerElement=12,Na("StructArrayLayout1ui2f12",En);class Pn extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q,me){const Re=this.length;return this.resize(Re+1),this.emplace(Re,D,Q,me)}emplace(D,Q,me,Re){const Ve=4*D;return this.uint32[2*D+0]=Q,this.uint16[Ve+2]=me,this.uint16[Ve+3]=Re,D}}Pn.prototype.bytesPerElement=8,Na("StructArrayLayout1ul2ui8",Pn);class Xn extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,Q){const me=this.length;return this.resize(me+1),this.emplace(me,D,Q)}emplace(D,Q,me){const Re=2*D;return this.uint16[Re+0]=Q,this.uint16[Re+1]=me,D}}Xn.prototype.bytesPerElement=4,Na("StructArrayLayout2ui4",Xn);class Ta extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D){const Q=this.length;return this.resize(Q+1),this.emplace(Q,D)}emplace(D,Q){return this.uint16[1*D+0]=Q,D}}Ta.prototype.bytesPerElement=2,Na("StructArrayLayout1ui2",Ta);class ri extends Be{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,Q,me,Re){const Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,D,Q,me,Re)}emplace(D,Q,me,Re,Ve){const We=4*D;return this.float32[We+0]=Q,this.float32[We+1]=me,this.float32[We+2]=Re,this.float32[We+3]=Ve,D}}ri.prototype.bytesPerElement=16,Na("StructArrayLayout4f16",ri);class Wa extends Ce{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new i(this.anchorPointX,this.anchorPointY)}}Wa.prototype.size=20;class ni extends zt{get(D){return new Wa(this,D)}}Na("CollisionBoxArray",ni);class $i extends Ce{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(D){this._structArray.uint8[this._pos1+37]=D}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(D){this._structArray.uint8[this._pos1+38]=D}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(D){this._structArray.uint32[this._pos4+10]=D}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}$i.prototype.size=48;class bo extends Pr{get(D){return new $i(this,D)}}Na("PlacedSymbolArray",bo);class vo extends Ce{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(D){this._structArray.uint32[this._pos4+12]=D}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}vo.prototype.size=64;class Wo extends Yr{get(D){return new vo(this,D)}}Na("SymbolInstanceArray",Wo);class Ks extends sn{getoffsetX(D){return this.float32[1*D+0]}}Na("GlyphOffsetArray",Ks);class Js extends fr{getx(D){return this.int16[3*D+0]}gety(D){return this.int16[3*D+1]}gettileUnitDistanceFromAnchor(D){return this.int16[3*D+2]}}Na("SymbolLineVertexArray",Js);class Es extends Ce{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Es.prototype.size=12;class il extends En{get(D){return new Es(this,D)}}Na("TextAnchorOffsetArray",il);class mu extends Ce{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}mu.prototype.size=8;class ou extends Pn{get(D){return new mu(this,D)}}Na("FeatureIndexArray",ou);class ks extends Xt{}class Cs extends Xt{}class Ru extends Xt{}class uc extends Lr{}class Uc extends tn{}class ge extends xn{}class Oe extends Ze{}class rt extends tt{}class wt extends vt{}class St extends bt{}class It extends Et{}class tr extends gr{}class er extends Tr{}class _r extends Xn{}const Zr=_t([{name:"a_pos",components:2,type:"Int16"}],4),{members:Xr}=Zr;class dn{constructor(D=[]){this.segments=D}prepareSegment(D,Q,me,Re){let Ve=this.segments[this.segments.length-1];return D>dn.MAX_VERTEX_ARRAY_LENGTH&&y(`Max vertices per segment is ${dn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${D}`),(!Ve||Ve.vertexLength+D>dn.MAX_VERTEX_ARRAY_LENGTH||Ve.sortKey!==Re)&&(Ve={vertexOffset:Q.length,primitiveOffset:me.length,vertexLength:0,primitiveLength:0},Re!==void 0&&(Ve.sortKey=Re),this.segments.push(Ve)),Ve}get(){return this.segments}destroy(){for(const D of this.segments)for(const Q in D.vaos)D.vaos[Q].destroy()}static simpleSegment(D,Q,me,Re){return new dn([{vertexOffset:D,primitiveOffset:Q,vertexLength:me,primitiveLength:Re,vaos:{},sortKey:0}])}}function Mn(Y,D){return 256*(Y=x(Math.floor(Y),0,255))+x(Math.floor(D),0,255)}dn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Na("SegmentVector",dn);const Cn=_t([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var La={exports:{}},zn={exports:{}};zn.exports=function(Y,D){var Q,me,Re,Ve,We,gt,Rt,Wt;for(me=Y.length-(Q=3&Y.length),Re=D,We=3432918353,gt=461845907,Wt=0;Wt>>16)*We&65535)<<16)&4294967295)<<15|Rt>>>17))*gt+(((Rt>>>16)*gt&65535)<<16)&4294967295)<<13|Re>>>19))+((5*(Re>>>16)&65535)<<16)&4294967295))+((58964+(Ve>>>16)&65535)<<16);switch(Rt=0,Q){case 3:Rt^=(255&Y.charCodeAt(Wt+2))<<16;case 2:Rt^=(255&Y.charCodeAt(Wt+1))<<8;case 1:Re^=Rt=(65535&(Rt=(Rt=(65535&(Rt^=255&Y.charCodeAt(Wt)))*We+(((Rt>>>16)*We&65535)<<16)&4294967295)<<15|Rt>>>17))*gt+(((Rt>>>16)*gt&65535)<<16)&4294967295}return Re^=Y.length,Re=2246822507*(65535&(Re^=Re>>>16))+((2246822507*(Re>>>16)&65535)<<16)&4294967295,Re=3266489909*(65535&(Re^=Re>>>13))+((3266489909*(Re>>>16)&65535)<<16)&4294967295,(Re^=Re>>>16)>>>0};var ea=zn.exports,sa={exports:{}};sa.exports=function(Y,D){for(var Q,me=Y.length,Re=D^me,Ve=0;me>=4;)Q=1540483477*(65535&(Q=255&Y.charCodeAt(Ve)|(255&Y.charCodeAt(++Ve))<<8|(255&Y.charCodeAt(++Ve))<<16|(255&Y.charCodeAt(++Ve))<<24))+((1540483477*(Q>>>16)&65535)<<16),Re=1540483477*(65535&Re)+((1540483477*(Re>>>16)&65535)<<16)^(Q=1540483477*(65535&(Q^=Q>>>24))+((1540483477*(Q>>>16)&65535)<<16)),me-=4,++Ve;switch(me){case 3:Re^=(255&Y.charCodeAt(Ve+2))<<16;case 2:Re^=(255&Y.charCodeAt(Ve+1))<<8;case 1:Re=1540483477*(65535&(Re^=255&Y.charCodeAt(Ve)))+((1540483477*(Re>>>16)&65535)<<16)}return Re=1540483477*(65535&(Re^=Re>>>13))+((1540483477*(Re>>>16)&65535)<<16),(Re^=Re>>>15)>>>0};var Sa=ea,Ra=sa.exports;La.exports=Sa,La.exports.murmur3=Sa,La.exports.murmur2=Ra;var oa=r(La.exports);class ai{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,Q,me,Re){this.ids.push(Zi(D)),this.positions.push(Q,me,Re)}getPositions(D){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const Q=Zi(D);let me=0,Re=this.ids.length-1;for(;me>1;this.ids[We]>=Q?Re=We:me=We+1}const Ve=[];for(;this.ids[me]===Q;)Ve.push({index:this.positions[3*me],start:this.positions[3*me+1],end:this.positions[3*me+2]}),me++;return Ve}static serialize(D,Q){const me=new Float64Array(D.ids),Re=new Uint32Array(D.positions);return Di(me,Re,0,me.length-1),Q&&Q.push(me.buffer,Re.buffer),{ids:me,positions:Re}}static deserialize(D){const Q=new ai;return Q.ids=D.ids,Q.positions=D.positions,Q.indexed=!0,Q}}function Zi(Y){const D=+Y;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:oa(String(Y))}function Di(Y,D,Q,me){for(;Q>1];let Ve=Q-1,We=me+1;for(;;){do Ve++;while(Y[Ve]Re);if(Ve>=We)break;Vi(Y,Ve,We),Vi(D,3*Ve,3*We),Vi(D,3*Ve+1,3*We+1),Vi(D,3*Ve+2,3*We+2)}We-Q`u_${Re}`),this.type=me}setUniform(D,Q,me){D.set(me.constantOr(this.value))}getBinding(D,Q,me){return this.type==="color"?new Po(D,Q):new ko(D,Q)}}class ru{constructor(D,Q){this.uniformNames=Q.map(me=>`u_${me}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(D,Q){this.pixelRatioFrom=Q.pixelRatio,this.pixelRatioTo=D.pixelRatio,this.patternFrom=Q.tlbr,this.patternTo=D.tlbr}setUniform(D,Q,me,Re){const Ve=Re==="u_pattern_to"?this.patternTo:Re==="u_pattern_from"?this.patternFrom:Re==="u_pixel_ratio_to"?this.pixelRatioTo:Re==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Ve&&D.set(Ve)}getBinding(D,Q,me){return me.substr(0,9)==="u_pattern"?new Ws(D,Q):new ko(D,Q)}}class lo{constructor(D,Q,me,Re){this.expression=D,this.type=me,this.maxValue=0,this.paintVertexAttributes=Q.map(Ve=>({name:`a_${Ve}`,type:"Float32",components:me==="color"?2:1,offset:0})),this.paintVertexArray=new Re}populatePaintArray(D,Q,me,Re,Ve){const We=this.paintVertexArray.length,gt=this.expression.evaluate(new ml(0),Q,{},Re,[],Ve);this.paintVertexArray.resize(D),this._setPaintValue(We,D,gt)}updatePaintArray(D,Q,me,Re){const Ve=this.expression.evaluate({zoom:0},me,Re);this._setPaintValue(D,Q,Ve)}_setPaintValue(D,Q,me){if(this.type==="color"){const Re=nl(me);for(let Ve=D;Ve`u_${gt}_t`),this.type=me,this.useIntegerZoom=Re,this.zoom=Ve,this.maxValue=0,this.paintVertexAttributes=Q.map(gt=>({name:`a_${gt}`,type:"Float32",components:me==="color"?4:2,offset:0})),this.paintVertexArray=new We}populatePaintArray(D,Q,me,Re,Ve){const We=this.expression.evaluate(new ml(this.zoom),Q,{},Re,[],Ve),gt=this.expression.evaluate(new ml(this.zoom+1),Q,{},Re,[],Ve),Rt=this.paintVertexArray.length;this.paintVertexArray.resize(D),this._setPaintValue(Rt,D,We,gt)}updatePaintArray(D,Q,me,Re){const Ve=this.expression.evaluate({zoom:this.zoom},me,Re),We=this.expression.evaluate({zoom:this.zoom+1},me,Re);this._setPaintValue(D,Q,Ve,We)}_setPaintValue(D,Q,me,Re){if(this.type==="color"){const Ve=nl(me),We=nl(Re);for(let gt=D;gt`#define HAS_UNIFORM_${Re}`))}return D}getBinderAttributes(){const D=[];for(const Q in this.binders){const me=this.binders[Q];if(me instanceof lo||me instanceof Ls)for(let Re=0;Re!0){this.programConfigurations={};for(const Re of D)this.programConfigurations[Re.id]=new $l(Re,Q,me);this.needsUpload=!1,this._featureMap=new ai,this._bufferOffset=0}populatePaintArrays(D,Q,me,Re,Ve,We){for(const gt in this.programConfigurations)this.programConfigurations[gt].populatePaintArrays(D,Q,Re,Ve,We);Q.id!==void 0&&this._featureMap.add(Q.id,me,this._bufferOffset,D),this._bufferOffset=D,this.needsUpload=!0}updatePaintArrays(D,Q,me,Re){for(const Ve of me)this.needsUpload=this.programConfigurations[Ve.id].updatePaintArrays(D,this._featureMap,Q,Ve,Re)||this.needsUpload}get(D){return this.programConfigurations[D]}upload(D){if(this.needsUpload){for(const Q in this.programConfigurations)this.programConfigurations[Q].upload(D);this.needsUpload=!1}}destroy(){for(const D in this.programConfigurations)this.programConfigurations[D].destroy()}}function Sc(Y,D){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[Y]||[Y.replace(`${D}-`,"").replace(/-/g,"_")]}function El(Y,D,Q){const me={color:{source:xn,composite:ri},number:{source:sn,composite:xn}},Re=(function(Ve){return{"line-pattern":{source:Oe,composite:Oe},"fill-pattern":{source:Oe,composite:Oe},"fill-extrusion-pattern":{source:Oe,composite:Oe}}[Ve]})(Y);return Re&&Re[Q]||me[D][Q]}Na("ConstantBinder",Iu),Na("CrossFadedConstantBinder",ru),Na("SourceExpressionBinder",lo),Na("CrossFadedCompositeBinder",Qs),Na("CompositeExpressionBinder",Ls),Na("ProgramConfiguration",$l,{omit:["_buffers"]}),Na("ProgramConfigurationSet",Ol);const Kl=8192,Kc=Math.pow(2,14)-1,Pu=-Kc-1;function mt(Y){const D=Kl/Y.extent,Q=Y.loadGeometry();for(let me=0;meWe.x+1||RtWe.y+1)&&y("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return Q}function yr(Y,D){return{type:Y.type,id:Y.id,properties:Y.properties,geometry:D?mt(Y):[]}}function wr(Y,D,Q,me,Re){Y.emplaceBack(2*D+(me+1)/2,2*Q+(Re+1)/2)}class Ln{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new Cs,this.indexArray=new er,this.segments=new dn,this.programConfigurations=new Ol(D.layers,D.zoom),this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){const Re=this.layers[0],Ve=[];let We=null,gt=!1;Re.type==="circle"&&(We=Re.layout.get("circle-sort-key"),gt=!We.isConstant());for(const{feature:Rt,id:Wt,index:pr,sourceLayerIndex:br}of D){const Hr=this.layers[0]._featureFilter.needGeometry,Qr=yr(Rt,Hr);if(!this.layers[0]._featureFilter.filter(new ml(this.zoom),Qr,me))continue;const vn=gt?We.evaluate(Qr,{},me):void 0,Sn={id:Wt,properties:Rt.properties,type:Rt.type,sourceLayerIndex:br,index:pr,geometry:Hr?Qr.geometry:mt(Rt),patterns:{},sortKey:vn};Ve.push(Sn)}gt&&Ve.sort((Rt,Wt)=>Rt.sortKey-Wt.sortKey);for(const Rt of Ve){const{geometry:Wt,index:pr,sourceLayerIndex:br}=Rt,Hr=D[pr].feature;this.addFeature(Rt,Wt,pr,me),Q.featureIndex.insert(Hr,Wt,pr,br,this.index)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Xr),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(D,Q,me,Re){for(const Ve of Q)for(const We of Ve){const gt=We.x,Rt=We.y;if(gt<0||gt>=Kl||Rt<0||Rt>=Kl)continue;const Wt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),pr=Wt.vertexLength;wr(this.layoutVertexArray,gt,Rt,-1,-1),wr(this.layoutVertexArray,gt,Rt,1,-1),wr(this.layoutVertexArray,gt,Rt,1,1),wr(this.layoutVertexArray,gt,Rt,-1,1),this.indexArray.emplaceBack(pr,pr+1,pr+2),this.indexArray.emplaceBack(pr,pr+3,pr+2),Wt.vertexLength+=4,Wt.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,me,{},Re)}}function ca(Y,D){for(let Q=0;Q1){if(Ia(Y,D))return!0;for(let me=0;me1?Q:Q.sub(D)._mult(Re)._add(D))}function yi(Y,D){let Q,me,Re,Ve=!1;for(let We=0;WeD.y!=Re.y>D.y&&D.x<(Re.x-me.x)*(D.y-me.y)/(Re.y-me.y)+me.x&&(Ve=!Ve)}return Ve}function Ga(Y,D){let Q=!1;for(let me=0,Re=Y.length-1;meD.y!=We.y>D.y&&D.x<(We.x-Ve.x)*(D.y-Ve.y)/(We.y-Ve.y)+Ve.x&&(Q=!Q)}return Q}function ma(Y,D,Q){const me=Q[0],Re=Q[2];if(Y.xRe.x&&D.x>Re.x||Y.yRe.y&&D.y>Re.y)return!1;const Ve=I(Y,D,Q[0]);return Ve!==I(Y,D,Q[1])||Ve!==I(Y,D,Q[2])||Ve!==I(Y,D,Q[3])}function nn(Y,D,Q){const me=D.paint.get(Y).value;return me.kind==="constant"?me.value:Q.programConfigurations.get(D.id).getMaxValue(Y)}function Fn(Y){return Math.sqrt(Y[0]*Y[0]+Y[1]*Y[1])}function ta(Y,D,Q,me,Re){if(!D[0]&&!D[1])return Y;const Ve=i.convert(D)._mult(Re);Q==="viewport"&&Ve._rotate(-me);const We=[];for(let gt=0;gtzi(Nn,Sn))})(Wt,Rt),Qr=br?pr*gt:pr;for(const vn of Re)for(const Sn of vn){const Nn=br?Sn:zi(Sn,Rt);let va=Qr;const oi=$a([],[Sn.x,Sn.y,0,1],Rt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?va*=oi[3]/We.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(va*=We.cameraToCenterDistance/oi[3]),yn(Hr,Nn,va))return!0}return!1}}function zi(Y,D){const Q=$a([],[Y.x,Y.y,0,1],D);return new i(Q[0]/Q[3],Q[1]/Q[3])}class Lo extends Ln{}let _i;Na("HeatmapBucket",Lo,{omit:["layers"]});var ji={get paint(){return _i=_i||new Ue({"heatmap-radius":new as(ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new as(ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Xo(ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Nc(ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Xo(ie.paint_heatmap["heatmap-opacity"])})}};function Ya(Y,{width:D,height:Q},me,Re){if(Re){if(Re instanceof Uint8ClampedArray)Re=new Uint8Array(Re.buffer);else if(Re.length!==D*Q*me)throw new RangeError(`mismatched image size. expected: ${Re.length} but got: ${D*Q*me}`)}else Re=new Uint8Array(D*Q*me);return Y.width=D,Y.height=Q,Y.data=Re,Y}function To(Y,{width:D,height:Q},me){if(D===Y.width&&Q===Y.height)return;const Re=Ya({},{width:D,height:Q},me);qo(Y,Re,{x:0,y:0},{x:0,y:0},{width:Math.min(Y.width,D),height:Math.min(Y.height,Q)},me),Y.width=D,Y.height=Q,Y.data=Re.data}function qo(Y,D,Q,me,Re,Ve){if(Re.width===0||Re.height===0)return D;if(Re.width>Y.width||Re.height>Y.height||Q.x>Y.width-Re.width||Q.y>Y.height-Re.height)throw new RangeError("out of range source coordinates for image copy");if(Re.width>D.width||Re.height>D.height||me.x>D.width-Re.width||me.y>D.height-Re.height)throw new RangeError("out of range destination coordinates for image copy");const We=Y.data,gt=D.data;if(We===gt)throw new Error("srcData equals dstData, so image is already copied");for(let Rt=0;Rt{D[Y.evaluationKey]=Rt;const Wt=Y.expression.evaluate(D);Re.data[We+gt+0]=Math.floor(255*Wt.r/Wt.a),Re.data[We+gt+1]=Math.floor(255*Wt.g/Wt.a),Re.data[We+gt+2]=Math.floor(255*Wt.b/Wt.a),Re.data[We+gt+3]=Math.floor(255*Wt.a)};if(Y.clips)for(let We=0,gt=0;We80*Q){gt=1/0,Rt=1/0;let pr=-1/0,br=-1/0;for(let Hr=Q;Hrpr&&(pr=Qr),vn>br&&(br=vn)}Wt=Math.max(pr-gt,br-Rt),Wt=Wt!==0?32767/Wt:0}return qs(Ve,We,Q,gt,Rt,Wt,0),We}function ho(Y,D,Q,me,Re){let Ve;if(Re===(function(We,gt,Rt,Wt){let pr=0;for(let br=gt,Hr=Rt-Wt;br0)for(let We=D;We=D;We-=me)Ve=Ht(We/me|0,Y[We],Y[We+1],Ve);return Ve&&ft(Ve,Ve.next)&&(Jt(Ve),Ve=Ve.next),Ve}function ec(Y,D){if(!Y)return Y;D||(D=Y);let Q,me=Y;do if(Q=!1,me.steiner||!ft(me,me.next)&&qe(me.prev,me,me.next)!==0)me=me.next;else{if(Jt(me),me=D=me.prev,me===me.next)break;Q=!0}while(Q||me!==D);return D}function qs(Y,D,Q,me,Re,Ve,We){if(!Y)return;!We&&Ve&&(function(Rt,Wt,pr,br){let Hr=Rt;do Hr.z===0&&(Hr.z=q(Hr.x,Hr.y,Wt,pr,br)),Hr.prevZ=Hr.prev,Hr.nextZ=Hr.next,Hr=Hr.next;while(Hr!==Rt);Hr.prevZ.nextZ=null,Hr.prevZ=null,(function(Qr){let vn,Sn=1;do{let Nn,va=Qr;Qr=null;let oi=null;for(vn=0;va;){vn++;let Ba=va,ei=0;for(let fo=0;fo0||Oi>0&&Ba;)ei!==0&&(Oi===0||!Ba||va.z<=Ba.z)?(Nn=va,va=va.nextZ,ei--):(Nn=Ba,Ba=Ba.nextZ,Oi--),oi?oi.nextZ=Nn:Qr=Nn,Nn.prevZ=oi,oi=Nn;va=Ba}oi.nextZ=null,Sn*=2}while(vn>1)})(Hr)})(Y,me,Re,Ve);let gt=Y;for(;Y.prev!==Y.next;){const Rt=Y.prev,Wt=Y.next;if(Ve?dc(Y,me,Re,Ve):Fl(Y))D.push(Rt.i,Y.i,Wt.i),Jt(Y),Y=Wt.next,gt=Wt.next;else if((Y=Wt)===gt){We?We===1?qs(Y=vc(ec(Y),D),D,Q,me,Re,Ve,2):We===2&&Co(Y,D,Q,me,Re,Ve):qs(ec(Y),D,Q,me,Re,Ve,1);break}}}function Fl(Y){const D=Y.prev,Q=Y,me=Y.next;if(qe(D,Q,me)>=0)return!1;const Re=D.x,Ve=Q.x,We=me.x,gt=D.y,Rt=Q.y,Wt=me.y,pr=ReVe?Re>We?Re:We:Ve>We?Ve:We,Qr=gt>Rt?gt>Wt?gt:Wt:Rt>Wt?Rt:Wt;let vn=me.next;for(;vn!==D;){if(vn.x>=pr&&vn.x<=Hr&&vn.y>=br&&vn.y<=Qr&&J(Re,gt,Ve,Rt,We,Wt,vn.x,vn.y)&&qe(vn.prev,vn,vn.next)>=0)return!1;vn=vn.next}return!0}function dc(Y,D,Q,me){const Re=Y.prev,Ve=Y,We=Y.next;if(qe(Re,Ve,We)>=0)return!1;const gt=Re.x,Rt=Ve.x,Wt=We.x,pr=Re.y,br=Ve.y,Hr=We.y,Qr=gtRt?gt>Wt?gt:Wt:Rt>Wt?Rt:Wt,Nn=pr>br?pr>Hr?pr:Hr:br>Hr?br:Hr,va=q(Qr,vn,D,Q,me),oi=q(Sn,Nn,D,Q,me);let Ba=Y.prevZ,ei=Y.nextZ;for(;Ba&&Ba.z>=va&&ei&&ei.z<=oi;){if(Ba.x>=Qr&&Ba.x<=Sn&&Ba.y>=vn&&Ba.y<=Nn&&Ba!==Re&&Ba!==We&&J(gt,pr,Rt,br,Wt,Hr,Ba.x,Ba.y)&&qe(Ba.prev,Ba,Ba.next)>=0||(Ba=Ba.prevZ,ei.x>=Qr&&ei.x<=Sn&&ei.y>=vn&&ei.y<=Nn&&ei!==Re&&ei!==We&&J(gt,pr,Rt,br,Wt,Hr,ei.x,ei.y)&&qe(ei.prev,ei,ei.next)>=0))return!1;ei=ei.nextZ}for(;Ba&&Ba.z>=va;){if(Ba.x>=Qr&&Ba.x<=Sn&&Ba.y>=vn&&Ba.y<=Nn&&Ba!==Re&&Ba!==We&&J(gt,pr,Rt,br,Wt,Hr,Ba.x,Ba.y)&&qe(Ba.prev,Ba,Ba.next)>=0)return!1;Ba=Ba.prevZ}for(;ei&&ei.z<=oi;){if(ei.x>=Qr&&ei.x<=Sn&&ei.y>=vn&&ei.y<=Nn&&ei!==Re&&ei!==We&&J(gt,pr,Rt,br,Wt,Hr,ei.x,ei.y)&&qe(ei.prev,ei,ei.next)>=0)return!1;ei=ei.nextZ}return!0}function vc(Y,D){let Q=Y;do{const me=Q.prev,Re=Q.next.next;!ft(me,Re)&&pt(me,Q,Q.next,Re)&&Tt(me,Re)&&Tt(Re,me)&&(D.push(me.i,Q.i,Re.i),Jt(Q),Jt(Q.next),Q=Y=Re),Q=Q.next}while(Q!==Y);return ec(Q)}function Co(Y,D,Q,me,Re,Ve){let We=Y;do{let gt=We.next.next;for(;gt!==We.prev;){if(We.i!==gt.i&&_e(We,gt)){let Rt=$t(We,gt);return We=ec(We,We.next),Rt=ec(Rt,Rt.next),qs(We,D,Q,me,Re,Ve,0),void qs(Rt,D,Q,me,Re,Ve,0)}gt=gt.next}We=We.next}while(We!==Y)}function ds(Y,D){return Y.x-D.x}function _s(Y,D){const Q=(function(Re,Ve){let We=Ve;const gt=Re.x,Rt=Re.y;let Wt,pr=-1/0;do{if(Rt<=We.y&&Rt>=We.next.y&&We.next.y!==We.y){const Sn=We.x+(Rt-We.y)*(We.next.x-We.x)/(We.next.y-We.y);if(Sn<=gt&&Sn>pr&&(pr=Sn,Wt=We.x=We.x&&We.x>=Hr&>!==We.x&&J(RtWt.x||We.x===Wt.x&&be(Wt,We)))&&(Wt=We,vn=Sn)}We=We.next}while(We!==br);return Wt})(Y,D);if(!Q)return D;const me=$t(Q,Y);return ec(me,me.next),ec(Q,Q.next)}function be(Y,D){return qe(Y.prev,Y,D.prev)<0&&qe(D.next,Y,Y.next)<0}function q(Y,D,Q,me,Re){return(Y=1431655765&((Y=858993459&((Y=252645135&((Y=16711935&((Y=(Y-Q)*Re|0)|Y<<8))|Y<<4))|Y<<2))|Y<<1))|(D=1431655765&((D=858993459&((D=252645135&((D=16711935&((D=(D-me)*Re|0)|D<<8))|D<<4))|D<<2))|D<<1))<<1}function he(Y){let D=Y,Q=Y;do(D.x=(Y-We)*(Ve-gt)&&(Y-We)*(me-gt)>=(Q-We)*(D-gt)&&(Q-We)*(Ve-gt)>=(Re-We)*(me-gt)}function _e(Y,D){return Y.next.i!==D.i&&Y.prev.i!==D.i&&!(function(Q,me){let Re=Q;do{if(Re.i!==Q.i&&Re.next.i!==Q.i&&Re.i!==me.i&&Re.next.i!==me.i&&pt(Re,Re.next,Q,me))return!0;Re=Re.next}while(Re!==Q);return!1})(Y,D)&&(Tt(Y,D)&&Tt(D,Y)&&(function(Q,me){let Re=Q,Ve=!1;const We=(Q.x+me.x)/2,gt=(Q.y+me.y)/2;do Re.y>gt!=Re.next.y>gt&&Re.next.y!==Re.y&&We<(Re.next.x-Re.x)*(gt-Re.y)/(Re.next.y-Re.y)+Re.x&&(Ve=!Ve),Re=Re.next;while(Re!==Q);return Ve})(Y,D)&&(qe(Y.prev,Y,D.prev)||qe(Y,D.prev,D))||ft(Y,D)&&qe(Y.prev,Y,Y.next)>0&&qe(D.prev,D,D.next)>0)}function qe(Y,D,Q){return(D.y-Y.y)*(Q.x-D.x)-(D.x-Y.x)*(Q.y-D.y)}function ft(Y,D){return Y.x===D.x&&Y.y===D.y}function pt(Y,D,Q,me){const Re=it(qe(Y,D,Q)),Ve=it(qe(Y,D,me)),We=it(qe(Q,me,Y)),gt=it(qe(Q,me,D));return Re!==Ve&&We!==gt||!(Re!==0||!$e(Y,Q,D))||!(Ve!==0||!$e(Y,me,D))||!(We!==0||!$e(Q,Y,me))||!(gt!==0||!$e(Q,D,me))}function $e(Y,D,Q){return D.x<=Math.max(Y.x,Q.x)&&D.x>=Math.min(Y.x,Q.x)&&D.y<=Math.max(Y.y,Q.y)&&D.y>=Math.min(Y.y,Q.y)}function it(Y){return Y>0?1:Y<0?-1:0}function Tt(Y,D){return qe(Y.prev,Y,Y.next)<0?qe(Y,D,Y.next)>=0&&qe(Y,Y.prev,D)>=0:qe(Y,D,Y.prev)<0||qe(Y,Y.next,D)<0}function $t(Y,D){const Q=ir(Y.i,Y.x,Y.y),me=ir(D.i,D.x,D.y),Re=Y.next,Ve=D.prev;return Y.next=D,D.prev=Y,Q.next=Re,Re.prev=Q,me.next=Q,Q.prev=me,Ve.next=me,me.prev=Ve,me}function Ht(Y,D,Q,me){const Re=ir(Y,D,Q);return me?(Re.next=me.next,Re.prev=me,me.next.prev=Re,me.next=Re):(Re.prev=Re,Re.next=Re),Re}function Jt(Y){Y.next.prev=Y.prev,Y.prev.next=Y.next,Y.prevZ&&(Y.prevZ.nextZ=Y.nextZ),Y.nextZ&&(Y.nextZ.prevZ=Y.prevZ)}function ir(Y,D,Q){return{i:Y,x:D,y:Q,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function rr(Y,D,Q){const me=Q.patternDependencies;let Re=!1;for(const Ve of D){const We=Ve.paint.get(`${Y}-pattern`);We.isConstant()||(Re=!0);const gt=We.constantOr(null);gt&&(Re=!0,me[gt.to]=!0,me[gt.from]=!0)}return Re}function Bt(Y,D,Q,me,Re){const Ve=Re.patternDependencies;for(const We of D){const gt=We.paint.get(`${Y}-pattern`).value;if(gt.kind!=="constant"){let Rt=gt.evaluate({zoom:me-1},Q,{},Re.availableImages),Wt=gt.evaluate({zoom:me},Q,{},Re.availableImages),pr=gt.evaluate({zoom:me+1},Q,{},Re.availableImages);Rt=Rt&&Rt.name?Rt.name:Rt,Wt=Wt&&Wt.name?Wt.name:Wt,pr=pr&&pr.name?pr.name:pr,Ve[Rt]=!0,Ve[Wt]=!0,Ve[pr]=!0,Q.patterns[We.id]={min:Rt,mid:Wt,max:pr}}}return Q}class Zt{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ru,this.indexArray=new er,this.indexArray2=new _r,this.programConfigurations=new Ol(D.layers,D.zoom),this.segments=new dn,this.segments2=new dn,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){this.hasPattern=rr("fill",this.layers,Q);const Re=this.layers[0].layout.get("fill-sort-key"),Ve=!Re.isConstant(),We=[];for(const{feature:gt,id:Rt,index:Wt,sourceLayerIndex:pr}of D){const br=this.layers[0]._featureFilter.needGeometry,Hr=yr(gt,br);if(!this.layers[0]._featureFilter.filter(new ml(this.zoom),Hr,me))continue;const Qr=Ve?Re.evaluate(Hr,{},me,Q.availableImages):void 0,vn={id:Rt,properties:gt.properties,type:gt.type,sourceLayerIndex:pr,index:Wt,geometry:br?Hr.geometry:mt(gt),patterns:{},sortKey:Qr};We.push(vn)}Ve&&We.sort((gt,Rt)=>gt.sortKey-Rt.sortKey);for(const gt of We){const{geometry:Rt,index:Wt,sourceLayerIndex:pr}=gt;if(this.hasPattern){const br=Bt("fill",this.layers,gt,this.zoom,Q);this.patternFeatures.push(br)}else this.addFeature(gt,Rt,Wt,me,{});Q.featureIndex.insert(D[Wt].feature,Rt,Wt,pr,this.index)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}addFeatures(D,Q,me){for(const Re of this.patternFeatures)this.addFeature(Re,Re.geometry,Re.index,Q,me)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,nu),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.indexBuffer2=D.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(D,Q,me,Re,Ve){for(const We of Xc(Q,500)){let gt=0;for(const Qr of We)gt+=Qr.length;const Rt=this.segments.prepareSegment(gt,this.layoutVertexArray,this.indexArray),Wt=Rt.vertexLength,pr=[],br=[];for(const Qr of We){if(Qr.length===0)continue;Qr!==We[0]&&br.push(pr.length/2);const vn=this.segments2.prepareSegment(Qr.length,this.layoutVertexArray,this.indexArray2),Sn=vn.vertexLength;this.layoutVertexArray.emplaceBack(Qr[0].x,Qr[0].y),this.indexArray2.emplaceBack(Sn+Qr.length-1,Sn),pr.push(Qr[0].x),pr.push(Qr[0].y);for(let Nn=1;Nn>3}if(Re--,me===1||me===2)Ve+=Y.readSVarint(),We+=Y.readSVarint(),me===1&&(D&>.push(D),D=[]),D.push(new da(Ve,We));else{if(me!==7)throw new Error("unknown command "+me);D&&D.push(D[0].clone())}}return D&>.push(D),gt},fa.prototype.bbox=function(){var Y=this._pbf;Y.pos=this._geometry;for(var D=Y.readVarint()+Y.pos,Q=1,me=0,Re=0,Ve=0,We=1/0,gt=-1/0,Rt=1/0,Wt=-1/0;Y.pos>3}if(me--,Q===1||Q===2)(Re+=Y.readSVarint())gt&&(gt=Re),(Ve+=Y.readSVarint())Wt&&(Wt=Ve);else if(Q!==7)throw new Error("unknown command "+Q)}return[We,Rt,gt,Wt]},fa.prototype.toGeoJSON=function(Y,D,Q){var me,Re,Ve=this.extent*Math.pow(2,Q),We=this.extent*Y,gt=this.extent*D,Rt=this.loadGeometry(),Wt=fa.types[this.type];function pr(Qr){for(var vn=0;vn>3;Re=We===1?me.readString():We===2?me.readFloat():We===3?me.readDouble():We===4?me.readVarint64():We===5?me.readVarint():We===6?me.readSVarint():We===7?me.readBoolean():null}return Re})(Q))}xs.prototype.feature=function(Y){if(Y<0||Y>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[Y];var D=this._pbf.readVarint()+this._pbf.pos;return new wi(this._pbf,D,this.extent,this._keys,this._values)};var yl=qi;function hl(Y,D,Q){if(Y===3){var me=new yl(Q,Q.readVarint()+Q.pos);me.length&&(D[me.name]=me)}}ua.VectorTile=function(Y,D){this.layers=Y.readFields(hl,{},D)},ua.VectorTileFeature=Pa,ua.VectorTileLayer=qi;const xl=ua.VectorTileFeature.types,_l=Math.pow(2,13);function tc(Y,D,Q,me,Re,Ve,We,gt){Y.emplaceBack(D,Q,2*Math.floor(me*_l)+We,Re*_l*2,Ve*_l*2,Math.round(gt))}class sl{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(Q=>Q.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new uc,this.centroidVertexArray=new ks,this.indexArray=new er,this.programConfigurations=new Ol(D.layers,D.zoom),this.segments=new dn,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){this.features=[],this.hasPattern=rr("fill-extrusion",this.layers,Q);for(const{feature:Re,id:Ve,index:We,sourceLayerIndex:gt}of D){const Rt=this.layers[0]._featureFilter.needGeometry,Wt=yr(Re,Rt);if(!this.layers[0]._featureFilter.filter(new ml(this.zoom),Wt,me))continue;const pr={id:Ve,sourceLayerIndex:gt,index:We,geometry:Rt?Wt.geometry:mt(Re),properties:Re.properties,type:Re.type,patterns:{}};this.hasPattern?this.features.push(Bt("fill-extrusion",this.layers,pr,this.zoom,Q)):this.addFeature(pr,pr.geometry,We,me,{}),Q.featureIndex.insert(Re,pr.geometry,We,gt,this.index,!0)}}addFeatures(D,Q,me){for(const Re of this.features){const{geometry:Ve}=Re;this.addFeature(Re,Ve,Re.index,Q,me)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Gn),this.centroidVertexBuffer=D.createVertexBuffer(this.centroidVertexArray,Zn.members,!0),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(D,Q,me,Re,Ve){for(const We of Xc(Q,500)){const gt={x:0,y:0,vertexCount:0};let Rt=0;for(const vn of We)Rt+=vn.length;let Wt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const vn of We){if(vn.length===0||Kf(vn))continue;let Sn=0;for(let Nn=0;Nn=1){const oi=vn[Nn-1];if(!Tu(va,oi)){Wt.vertexLength+4>dn.MAX_VERTEX_ARRAY_LENGTH&&(Wt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ba=va.sub(oi)._perp()._unit(),ei=oi.dist(va);Sn+ei>32768&&(Sn=0),tc(this.layoutVertexArray,va.x,va.y,Ba.x,Ba.y,0,0,Sn),tc(this.layoutVertexArray,va.x,va.y,Ba.x,Ba.y,0,1,Sn),gt.x+=2*va.x,gt.y+=2*va.y,gt.vertexCount+=2,Sn+=ei,tc(this.layoutVertexArray,oi.x,oi.y,Ba.x,Ba.y,0,0,Sn),tc(this.layoutVertexArray,oi.x,oi.y,Ba.x,Ba.y,0,1,Sn),gt.x+=2*oi.x,gt.y+=2*oi.y,gt.vertexCount+=2;const Oi=Wt.vertexLength;this.indexArray.emplaceBack(Oi,Oi+2,Oi+1),this.indexArray.emplaceBack(Oi+1,Oi+2,Oi+3),Wt.vertexLength+=4,Wt.primitiveLength+=2}}}}if(Wt.vertexLength+Rt>dn.MAX_VERTEX_ARRAY_LENGTH&&(Wt=this.segments.prepareSegment(Rt,this.layoutVertexArray,this.indexArray)),xl[D.type]!=="Polygon")continue;const pr=[],br=[],Hr=Wt.vertexLength;for(const vn of We)if(vn.length!==0){vn!==We[0]&&br.push(pr.length/2);for(let Sn=0;SnKl)||Y.y===D.y&&(Y.y<0||Y.y>Kl)}function Kf(Y){return Y.every(D=>D.x<0)||Y.every(D=>D.x>Kl)||Y.every(D=>D.y<0)||Y.every(D=>D.y>Kl)}let Eh;Na("FillExtrusionBucket",sl,{omit:["layers","features"]});var Hv={get paint(){return Eh=Eh||new Ue({"fill-extrusion-opacity":new Xo(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new as(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Xo(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Xo(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Rf(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new as(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new as(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Xo(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Gv extends oe{constructor(D){super(D,Hv)}createBucket(D){return new sl(D)}queryRadius(){return Fn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,Q,me,Re,Ve,We,gt,Rt){const Wt=ta(D,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),We.angle,gt),pr=this.paint.get("fill-extrusion-height").evaluate(Q,me),br=this.paint.get("fill-extrusion-base").evaluate(Q,me),Hr=(function(vn,Sn,Nn,va){const oi=[];for(const Ba of vn){const ei=[Ba.x,Ba.y,0,1];$a(ei,ei,Sn),oi.push(new i(ei[0]/ei[3],ei[1]/ei[3]))}return oi})(Wt,Rt),Qr=(function(vn,Sn,Nn,va){const oi=[],Ba=[],ei=va[8]*Sn,Oi=va[9]*Sn,fo=va[10]*Sn,$o=va[11]*Sn,dl=va[8]*Nn,is=va[9]*Nn,Yo=va[10]*Nn,Is=va[11]*Nn;for(const Ss of vn){const bs=[],eo=[];for(const Gs of Ss){const Ds=Gs.x,Pl=Gs.y,lf=va[0]*Ds+va[4]*Pl+va[12],Jc=va[1]*Ds+va[5]*Pl+va[13],hd=va[2]*Ds+va[6]*Pl+va[14],Av=va[3]*Ds+va[7]*Pl+va[15],kh=hd+fo,Qh=Av+$o,pv=lf+dl,mv=Jc+is,gv=hd+Yo,Jf=Av+Is,dd=new i((lf+ei)/Qh,(Jc+Oi)/Qh);dd.z=kh/Qh,bs.push(dd);const ov=new i(pv/Jf,mv/Jf);ov.z=gv/Jf,eo.push(ov)}oi.push(bs),Ba.push(eo)}return[oi,Ba]})(Re,br,pr,Rt);return(function(vn,Sn,Nn){let va=1/0;mn(Nn,Sn)&&(va=hp(Nn,Sn[0]));for(let oi=0;oiQ.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(Q=>{this.gradients[Q.id]={}}),this.layoutVertexArray=new Uc,this.layoutVertexArray2=new ge,this.indexArray=new er,this.programConfigurations=new Ol(D.layers,D.zoom),this.segments=new dn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(Q=>Q.isStateDependent()).map(Q=>Q.id)}populate(D,Q,me){this.hasPattern=rr("line",this.layers,Q);const Re=this.layers[0].layout.get("line-sort-key"),Ve=!Re.isConstant(),We=[];for(const{feature:gt,id:Rt,index:Wt,sourceLayerIndex:pr}of D){const br=this.layers[0]._featureFilter.needGeometry,Hr=yr(gt,br);if(!this.layers[0]._featureFilter.filter(new ml(this.zoom),Hr,me))continue;const Qr=Ve?Re.evaluate(Hr,{},me):void 0,vn={id:Rt,properties:gt.properties,type:gt.type,sourceLayerIndex:pr,index:Wt,geometry:br?Hr.geometry:mt(gt),patterns:{},sortKey:Qr};We.push(vn)}Ve&&We.sort((gt,Rt)=>gt.sortKey-Rt.sortKey);for(const gt of We){const{geometry:Rt,index:Wt,sourceLayerIndex:pr}=gt;if(this.hasPattern){const br=Bt("line",this.layers,gt,this.zoom,Q);this.patternFeatures.push(br)}else this.addFeature(gt,Rt,Wt,me,{});Q.featureIndex.insert(D[Wt].feature,Rt,Wt,pr,this.index)}}update(D,Q,me){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,Q,this.stateDependentLayers,me)}addFeatures(D,Q,me){for(const Re of this.patternFeatures)this.addFeature(Re,Re.geometry,Re.index,Q,me)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=D.createVertexBuffer(this.layoutVertexArray2,Ep)),this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Mp),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(D){if(D.properties&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_end"))return{start:+D.properties.mapbox_clip_start,end:+D.properties.mapbox_clip_end}}addFeature(D,Q,me,Re,Ve){const We=this.layers[0].layout,gt=We.get("line-join").evaluate(D,{}),Rt=We.get("line-cap"),Wt=We.get("line-miter-limit"),pr=We.get("line-round-limit");this.lineClips=this.lineFeatureClips(D);for(const br of Q)this.addLine(br,D,gt,Rt,Wt,pr);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,me,Ve,Re)}addLine(D,Q,me,Re,Ve,We){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let va=0;va=2&&D[Rt-1].equals(D[Rt-2]);)Rt--;let Wt=0;for(;Wt0;if($o&&va>Wt){const Is=Hr.dist(Qr);if(Is>2*pr){const Ss=Hr.sub(Hr.sub(Qr)._mult(pr/Is)._round());this.updateDistance(Qr,Ss),this.addCurrentVertex(Ss,Sn,0,0,br),Qr=Ss}}const is=Qr&&vn;let Yo=is?me:gt?"butt":Re;if(is&&Yo==="round"&&(OiVe&&(Yo="bevel"),Yo==="bevel"&&(Oi>2&&(Yo="flipbevel"),Oi100)oi=Nn.mult(-1);else{const Is=Oi*Sn.add(Nn).mag()/Sn.sub(Nn).mag();oi._perp()._mult(Is*(dl?-1:1))}this.addCurrentVertex(Hr,oi,0,0,br),this.addCurrentVertex(Hr,oi.mult(-1),0,0,br)}else if(Yo==="bevel"||Yo==="fakeround"){const Is=-Math.sqrt(Oi*Oi-1),Ss=dl?Is:0,bs=dl?0:Is;if(Qr&&this.addCurrentVertex(Hr,Sn,Ss,bs,br),Yo==="fakeround"){const eo=Math.round(180*fo/Math.PI/20);for(let Gs=1;Gs2*pr){const Ss=Hr.add(vn.sub(Hr)._mult(pr/Is)._round());this.updateDistance(Hr,Ss),this.addCurrentVertex(Ss,Nn,0,0,br),Hr=Ss}}}}addCurrentVertex(D,Q,me,Re,Ve,We=!1){const gt=Q.y*Re-Q.x,Rt=-Q.y-Q.x*Re;this.addHalfVertex(D,Q.x+Q.y*me,Q.y-Q.x*me,We,!1,me,Ve),this.addHalfVertex(D,gt,Rt,We,!0,-Re,Ve),this.distance>Xv/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(D,Q,me,Re,Ve,We))}addHalfVertex({x:D,y:Q},me,Re,Ve,We,gt,Rt){const Wt=.5*(this.lineClips?this.scaledDistance*(Xv-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((D<<1)+(Ve?1:0),(Q<<1)+(We?1:0),Math.round(63*me)+128,Math.round(63*Re)+128,1+(gt===0?0:gt<0?-1:1)|(63&Wt)<<2,Wt>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const pr=Rt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,pr),Rt.primitiveLength++),We?this.e2=pr:this.e1=pr}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(D,Q){this.distance+=D.dist(Q),this.updateScaledDistance()}}let Yv,Bg;Na("LineBucket",dp,{omit:["layers","patternFeatures"]});var Q0={get paint(){return Bg=Bg||new Ue({"line-opacity":new as(ie.paint_line["line-opacity"]),"line-color":new as(ie.paint_line["line-color"]),"line-translate":new Xo(ie.paint_line["line-translate"]),"line-translate-anchor":new Xo(ie.paint_line["line-translate-anchor"]),"line-width":new as(ie.paint_line["line-width"]),"line-gap-width":new as(ie.paint_line["line-gap-width"]),"line-offset":new as(ie.paint_line["line-offset"]),"line-blur":new as(ie.paint_line["line-blur"]),"line-dasharray":new $c(ie.paint_line["line-dasharray"]),"line-pattern":new Rf(ie.paint_line["line-pattern"]),"line-gradient":new Nc(ie.paint_line["line-gradient"])})},get layout(){return Yv=Yv||new Ue({"line-cap":new Xo(ie.layout_line["line-cap"]),"line-join":new as(ie.layout_line["line-join"]),"line-miter-limit":new Xo(ie.layout_line["line-miter-limit"]),"line-round-limit":new Xo(ie.layout_line["line-round-limit"]),"line-sort-key":new as(ie.layout_line["line-sort-key"])})}};class Kh extends as{possiblyEvaluate(D,Q){return Q=new ml(Math.floor(Q.zoom),{now:Q.now,fadeDuration:Q.fadeDuration,zoomHistory:Q.zoomHistory,transition:Q.transition}),super.possiblyEvaluate(D,Q)}evaluate(D,Q,me,Re){return Q=M({},Q,{zoom:Math.floor(Q.zoom)}),super.evaluate(D,Q,me,Re)}}let em;class Ng extends oe{constructor(D){super(D,Q0),this.gradientVersion=0,em||(em=new Kh(Q0.paint.properties["line-width"].specification),em.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(D){if(D==="line-gradient"){const Q=this.gradientExpression();this.stepInterpolant=!!(function(me){return me._styleExpression!==void 0})(Q)&&Q._styleExpression.expression instanceof In,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(D,Q){super.recalculate(D,Q),this.paint._values["line-floorwidth"]=em.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,D)}createBucket(D){return new dp(D)}queryRadius(D){const Q=D,me=Cd(nn("line-width",this,Q),nn("line-gap-width",this,Q)),Re=nn("line-offset",this,Q);return me/2+Math.abs(Re)+Fn(this.paint.get("line-translate"))}queryIntersectsFeature(D,Q,me,Re,Ve,We,gt){const Rt=ta(D,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),We.angle,gt),Wt=gt/2*Cd(this.paint.get("line-width").evaluate(Q,me),this.paint.get("line-gap-width").evaluate(Q,me)),pr=this.paint.get("line-offset").evaluate(Q,me);return pr&&(Re=(function(br,Hr){const Qr=[];for(let vn=0;vn=3){for(let Nn=0;Nn0?D+2*Y:Y}const Um=_t([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),$y=_t([{name:"a_projected_pos",components:3,type:"Float32"}],4);_t([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ky=_t([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);_t([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Ug=_t([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),jm=_t([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function qm(Y,D,Q){return Y.sections.forEach(me=>{me.text=(function(Re,Ve,We){const gt=Ve.layout.get("text-transform").evaluate(We,{});return gt==="uppercase"?Re=Re.toLocaleUpperCase():gt==="lowercase"&&(Re=Re.toLocaleLowerCase()),zl.applyArabicShaping&&(Re=zl.applyArabicShaping(Re)),Re})(me.text,D,Q)}),Y}_t([{name:"triangle",components:3,type:"Uint16"}]),_t([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),_t([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),_t([{type:"Float32",name:"offsetX"}]),_t([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),_t([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const xf={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var pc=24,iv=Mc,jg=function(Y,D,Q,me,Re){var Ve,We,gt=8*Re-me-1,Rt=(1<>1,pr=-7,br=Re-1,Hr=-1,Qr=Y[D+br];for(br+=Hr,Ve=Qr&(1<<-pr)-1,Qr>>=-pr,pr+=gt;pr>0;Ve=256*Ve+Y[D+br],br+=Hr,pr-=8);for(We=Ve&(1<<-pr)-1,Ve>>=-pr,pr+=me;pr>0;We=256*We+Y[D+br],br+=Hr,pr-=8);if(Ve===0)Ve=1-Wt;else{if(Ve===Rt)return We?NaN:1/0*(Qr?-1:1);We+=Math.pow(2,me),Ve-=Wt}return(Qr?-1:1)*We*Math.pow(2,Ve-me)},Jy=function(Y,D,Q,me,Re,Ve){var We,gt,Rt,Wt=8*Ve-Re-1,pr=(1<>1,Hr=Re===23?Math.pow(2,-24)-Math.pow(2,-77):0,Qr=0,vn=1,Sn=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(gt=isNaN(D)?1:0,We=pr):(We=Math.floor(Math.log(D)/Math.LN2),D*(Rt=Math.pow(2,-We))<1&&(We--,Rt*=2),(D+=We+br>=1?Hr/Rt:Hr*Math.pow(2,1-br))*Rt>=2&&(We++,Rt/=2),We+br>=pr?(gt=0,We=pr):We+br>=1?(gt=(D*Rt-1)*Math.pow(2,Re),We+=br):(gt=D*Math.pow(2,br-1)*Math.pow(2,Re),We=0));Re>=8;Y[Q+Qr]=255>,Qr+=vn,gt/=256,Re-=8);for(We=We<0;Y[Q+Qr]=255&We,Qr+=vn,We/=256,Wt-=8);Y[Q+Qr-vn]|=128*Sn};function Mc(Y){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(Y)?Y:new Uint8Array(Y||0),this.pos=0,this.type=0,this.length=this.buf.length}Mc.Varint=0,Mc.Fixed64=1,Mc.Bytes=2,Mc.Fixed32=5;var q_=4294967296,Vm=1/q_,ew=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Zv(Y){return Y.type===Mc.Bytes?Y.readVarint()+Y.pos:Y.pos+1}function Hm(Y,D,Q){return Q?4294967296*D+(Y>>>0):4294967296*(D>>>0)+(Y>>>0)}function tw(Y,D,Q){var me=D<=16383?1:D<=2097151?2:D<=268435455?3:Math.floor(Math.log(D)/(7*Math.LN2));Q.realloc(me);for(var Re=Q.pos-1;Re>=Y;Re--)Q.buf[Re+me]=Q.buf[Re]}function V_(Y,D){for(var Q=0;Q>>8,Y[Q+2]=D>>>16,Y[Q+3]=D>>>24}function dS(Y,D){return(Y[D]|Y[D+1]<<8|Y[D+2]<<16)+(Y[D+3]<<24)}Mc.prototype={destroy:function(){this.buf=null},readFields:function(Y,D,Q){for(Q=Q||this.length;this.pos>3,Ve=this.pos;this.type=7&me,Y(Re,D,this),this.pos===Ve&&this.skip(me)}return D},readMessage:function(Y,D){return this.readFields(Y,D,this.readVarint()+this.pos)},readFixed32:function(){var Y=nw(this.buf,this.pos);return this.pos+=4,Y},readSFixed32:function(){var Y=dS(this.buf,this.pos);return this.pos+=4,Y},readFixed64:function(){var Y=nw(this.buf,this.pos)+nw(this.buf,this.pos+4)*q_;return this.pos+=8,Y},readSFixed64:function(){var Y=nw(this.buf,this.pos)+dS(this.buf,this.pos+4)*q_;return this.pos+=8,Y},readFloat:function(){var Y=jg(this.buf,this.pos,!0,23,4);return this.pos+=4,Y},readDouble:function(){var Y=jg(this.buf,this.pos,!0,52,8);return this.pos+=8,Y},readVarint:function(Y){var D,Q,me=this.buf;return D=127&(Q=me[this.pos++]),Q<128?D:(D|=(127&(Q=me[this.pos++]))<<7,Q<128?D:(D|=(127&(Q=me[this.pos++]))<<14,Q<128?D:(D|=(127&(Q=me[this.pos++]))<<21,Q<128?D:(function(Re,Ve,We){var gt,Rt,Wt=We.buf;if(gt=(112&(Rt=Wt[We.pos++]))>>4,Rt<128||(gt|=(127&(Rt=Wt[We.pos++]))<<3,Rt<128)||(gt|=(127&(Rt=Wt[We.pos++]))<<10,Rt<128)||(gt|=(127&(Rt=Wt[We.pos++]))<<17,Rt<128)||(gt|=(127&(Rt=Wt[We.pos++]))<<24,Rt<128)||(gt|=(1&(Rt=Wt[We.pos++]))<<31,Rt<128))return Hm(Re,gt,Ve);throw new Error("Expected varint not more than 10 bytes")})(D|=(15&(Q=me[this.pos]))<<28,Y,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var Y=this.readVarint();return Y%2==1?(Y+1)/-2:Y/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var Y=this.readVarint()+this.pos,D=this.pos;return this.pos=Y,Y-D>=12&&ew?(function(Q,me,Re){return ew.decode(Q.subarray(me,Re))})(this.buf,D,Y):(function(Q,me,Re){for(var Ve="",We=me;We239?4:pr>223?3:pr>191?2:1;if(We+Hr>Re)break;Hr===1?pr<128&&(br=pr):Hr===2?(192&(gt=Q[We+1]))==128&&(br=(31&pr)<<6|63>)<=127&&(br=null):Hr===3?(Rt=Q[We+2],(192&(gt=Q[We+1]))==128&&(192&Rt)==128&&((br=(15&pr)<<12|(63>)<<6|63&Rt)<=2047||br>=55296&&br<=57343)&&(br=null)):Hr===4&&(Rt=Q[We+2],Wt=Q[We+3],(192&(gt=Q[We+1]))==128&&(192&Rt)==128&&(192&Wt)==128&&((br=(15&pr)<<18|(63>)<<12|(63&Rt)<<6|63&Wt)<=65535||br>=1114112)&&(br=null)),br===null?(br=65533,Hr=1):br>65535&&(br-=65536,Ve+=String.fromCharCode(br>>>10&1023|55296),br=56320|1023&br),Ve+=String.fromCharCode(br),We+=Hr}return Ve})(this.buf,D,Y)},readBytes:function(){var Y=this.readVarint()+this.pos,D=this.buf.subarray(this.pos,Y);return this.pos=Y,D},readPackedVarint:function(Y,D){if(this.type!==Mc.Bytes)return Y.push(this.readVarint(D));var Q=Zv(this);for(Y=Y||[];this.pos127;);else if(D===Mc.Bytes)this.pos=this.readVarint()+this.pos;else if(D===Mc.Fixed32)this.pos+=4;else{if(D!==Mc.Fixed64)throw new Error("Unimplemented type: "+D);this.pos+=8}},writeTag:function(Y,D){this.writeVarint(Y<<3|D)},realloc:function(Y){for(var D=this.length||16;D268435455||Y<0?(function(D,Q){var me,Re;if(D>=0?(me=D%4294967296|0,Re=D/4294967296|0):(Re=~(-D/4294967296),4294967295^(me=~(-D%4294967296))?me=me+1|0:(me=0,Re=Re+1|0)),D>=18446744073709552e3||D<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");Q.realloc(10),(function(Ve,We,gt){gt.buf[gt.pos++]=127&Ve|128,Ve>>>=7,gt.buf[gt.pos++]=127&Ve|128,Ve>>>=7,gt.buf[gt.pos++]=127&Ve|128,Ve>>>=7,gt.buf[gt.pos++]=127&Ve|128,gt.buf[gt.pos]=127&(Ve>>>=7)})(me,0,Q),(function(Ve,We){var gt=(7&Ve)<<4;We.buf[We.pos++]|=gt|((Ve>>>=3)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve|((Ve>>>=7)?128:0),Ve&&(We.buf[We.pos++]=127&Ve)))))})(Re,Q)})(Y,this):(this.realloc(4),this.buf[this.pos++]=127&Y|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=127&(Y>>>=7)|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=127&(Y>>>=7)|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=Y>>>7&127))))},writeSVarint:function(Y){this.writeVarint(Y<0?2*-Y-1:2*Y)},writeBoolean:function(Y){this.writeVarint(!!Y)},writeString:function(Y){Y=String(Y),this.realloc(4*Y.length),this.pos++;var D=this.pos;this.pos=(function(me,Re,Ve){for(var We,gt,Rt=0;Rt55295&&We<57344){if(!gt){We>56319||Rt+1===Re.length?(me[Ve++]=239,me[Ve++]=191,me[Ve++]=189):gt=We;continue}if(We<56320){me[Ve++]=239,me[Ve++]=191,me[Ve++]=189,gt=We;continue}We=gt-55296<<10|We-56320|65536,gt=null}else gt&&(me[Ve++]=239,me[Ve++]=191,me[Ve++]=189,gt=null);We<128?me[Ve++]=We:(We<2048?me[Ve++]=We>>6|192:(We<65536?me[Ve++]=We>>12|224:(me[Ve++]=We>>18|240,me[Ve++]=We>>12&63|128),me[Ve++]=We>>6&63|128),me[Ve++]=63&We|128)}return Ve})(this.buf,Y,this.pos);var Q=this.pos-D;Q>=128&&tw(D,Q,this),this.pos=D-1,this.writeVarint(Q),this.pos+=Q},writeFloat:function(Y){this.realloc(4),Jy(this.buf,Y,this.pos,!0,23,4),this.pos+=4},writeDouble:function(Y){this.realloc(8),Jy(this.buf,Y,this.pos,!0,52,8),this.pos+=8},writeBytes:function(Y){var D=Y.length;this.writeVarint(D),this.realloc(D);for(var Q=0;Q=128&&tw(Q,me,this),this.pos=Q-1,this.writeVarint(me),this.pos+=me},writeMessage:function(Y,D,Q){this.writeTag(Y,Mc.Bytes),this.writeRawMessage(D,Q)},writePackedVarint:function(Y,D){D.length&&this.writeMessage(Y,V_,D)},writePackedSVarint:function(Y,D){D.length&&this.writeMessage(Y,c6,D)},writePackedBoolean:function(Y,D){D.length&&this.writeMessage(Y,d6,D)},writePackedFloat:function(Y,D){D.length&&this.writeMessage(Y,f6,D)},writePackedDouble:function(Y,D){D.length&&this.writeMessage(Y,h6,D)},writePackedFixed32:function(Y,D){D.length&&this.writeMessage(Y,v6,D)},writePackedSFixed32:function(Y,D){D.length&&this.writeMessage(Y,p6,D)},writePackedFixed64:function(Y,D){D.length&&this.writeMessage(Y,m6,D)},writePackedSFixed64:function(Y,D){D.length&&this.writeMessage(Y,rw,D)},writeBytesField:function(Y,D){this.writeTag(Y,Mc.Bytes),this.writeBytes(D)},writeFixed32Field:function(Y,D){this.writeTag(Y,Mc.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(Y,D){this.writeTag(Y,Mc.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(Y,D){this.writeTag(Y,Mc.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(Y,D){this.writeTag(Y,Mc.Fixed64),this.writeSFixed64(D)},writeVarintField:function(Y,D){this.writeTag(Y,Mc.Varint),this.writeVarint(D)},writeSVarintField:function(Y,D){this.writeTag(Y,Mc.Varint),this.writeSVarint(D)},writeStringField:function(Y,D){this.writeTag(Y,Mc.Bytes),this.writeString(D)},writeFloatField:function(Y,D){this.writeTag(Y,Mc.Fixed32),this.writeFloat(D)},writeDoubleField:function(Y,D){this.writeTag(Y,Mc.Fixed64),this.writeDouble(D)},writeBooleanField:function(Y,D){this.writeVarintField(Y,!!D)}};var X3=r(iv);const aw=3;function g6(Y,D,Q){Y===1&&Q.readMessage(vS,D)}function vS(Y,D,Q){if(Y===3){const{id:me,bitmap:Re,width:Ve,height:We,left:gt,top:Rt,advance:Wt}=Q.readMessage(Y3,{});D.push({id:me,bitmap:new Qo({width:Ve+2*aw,height:We+2*aw},Re),metrics:{width:Ve,height:We,left:gt,top:Rt,advance:Wt}})}}function Y3(Y,D,Q){Y===1?D.id=Q.readVarint():Y===2?D.bitmap=Q.readBytes():Y===3?D.width=Q.readVarint():Y===4?D.height=Q.readVarint():Y===5?D.left=Q.readSVarint():Y===6?D.top=Q.readSVarint():Y===7&&(D.advance=Q.readVarint())}const Z3=aw;function iw(Y){let D=0,Q=0;for(const We of Y)D+=We.w*We.h,Q=Math.max(Q,We.w);Y.sort((We,gt)=>gt.h-We.h);const me=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(D/.95)),Q),h:1/0}];let Re=0,Ve=0;for(const We of Y)for(let gt=me.length-1;gt>=0;gt--){const Rt=me[gt];if(!(We.w>Rt.w||We.h>Rt.h)){if(We.x=Rt.x,We.y=Rt.y,Ve=Math.max(Ve,We.y+We.h),Re=Math.max(Re,We.x+We.w),We.w===Rt.w&&We.h===Rt.h){const Wt=me.pop();gt=0&&me>=D&&sw[this.text.charCodeAt(me)];me--)Q--;this.text=this.text.substring(D,Q),this.sectionIndex=this.sectionIndex.slice(D,Q)}substring(D,Q){const me=new t1;return me.text=this.text.substring(D,Q),me.sectionIndex=this.sectionIndex.slice(D,Q),me.sections=this.sections,me}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((D,Q)=>Math.max(D,this.sections[Q].scale),0)}addTextSection(D,Q){this.text+=D.text,this.sections.push(H_.forText(D.scale,D.fontStack||Q));const me=this.sections.length-1;for(let Re=0;Re=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function ow(Y,D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr,Qr,vn){const Sn=t1.fromFeature(Y,Re);let Nn;br===e.ah.vertical&&Sn.verticalizePunctuation();const{processBidirectionalText:va,processStyledBidirectionalText:oi}=zl;if(va&&Sn.sections.length===1){Nn=[];const Oi=va(Sn.toString(),qg(Sn,Wt,Ve,D,me,Qr));for(const fo of Oi){const $o=new t1;$o.text=fo,$o.sections=Sn.sections;for(let dl=0;dl0&&Cp>Pd&&(Pd=Cp)}else{const uf=$o[Bu.fontStack],Rd=uf&&uf[jc];if(Rd&&Rd.rect)c1=Rd.rect,wf=Rd.metrics;else{const Cp=fo[Bu.fontStack],Kv=Cp&&Cp[jc];if(!Kv)continue;wf=Kv.metrics}Hf=(dd-Bu.scale)*pc}sv?(Oi.verticalizable=!0,yv.push({glyph:jc,imageName:r0,x:Pl,y:lf+Hf,vertical:sv,scale:Bu.scale,fontStack:Bu.fontStack,sectionIndex:Ec,metrics:wf,rect:c1}),Pl+=n0*Bu.scale+eo):(yv.push({glyph:jc,imageName:r0,x:Pl,y:lf+Hf,vertical:sv,scale:Bu.scale,fontStack:Bu.fontStack,sectionIndex:Ec,metrics:wf,rect:c1}),Pl+=wf.advance*Bu.scale+eo)}yv.length!==0&&(Jc=Math.max(Pl-eo,Jc),x6(yv,0,yv.length-1,Av,Pd)),Pl=0;const $v=Yo*dd+Pd;Xd.lineOffset=Math.max(Pd,ov),lf+=$v,hd=Math.max($v,hd),++kh}var Qh;const pv=lf-e1,{horizontalAlign:mv,verticalAlign:gv}=$3(Is);(function(Jf,dd,ov,Xd,yv,Pd,$v,bf,Bu){const Ec=(dd-ov)*yv;let jc=0;jc=Pd!==$v?-bf*Xd-e1:(-Xd*Bu+.5)*$v;for(const Hf of Jf)for(const wf of Hf.positionedGlyphs)wf.x+=Ec,wf.y+=jc})(Oi.positionedLines,Av,mv,gv,Jc,hd,Yo,pv,is.length),Oi.top+=-gv*pv,Oi.bottom=Oi.top+pv,Oi.left+=-mv*Jc,Oi.right=Oi.left+Jc})(ei,D,Q,me,Nn,We,gt,Rt,br,Wt,Hr,vn),!(function(Oi){for(const fo of Oi)if(fo.positionedGlyphs.length!==0)return!1;return!0})(Ba)&&ei}const sw={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},y6={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},_6={40:!0};function lw(Y,D,Q,me,Re,Ve){if(D.imageName){const We=me[D.imageName];return We?We.displaySize[0]*D.scale*pc/Ve+Re:0}{const We=Q[D.fontStack],gt=We&&We[Y];return gt?gt.metrics.advance*D.scale+Re:0}}function mS(Y,D,Q,me){const Re=Math.pow(Y-D,2);return me?Y=0;let Wt=0;for(let br=0;brWt){const pr=Math.ceil(Ve/Wt);Re*=pr/We,We=pr}return{x1:me,y1:Re,x2:me+Ve,y2:Re+We}}function yS(Y,D,Q,me,Re,Ve){const We=Y.image;let gt;if(We.content){const Nn=We.content,va=We.pixelRatio||1;gt=[Nn[0]/va,Nn[1]/va,We.displaySize[0]-Nn[2]/va,We.displaySize[1]-Nn[3]/va]}const Rt=D.left*Ve,Wt=D.right*Ve;let pr,br,Hr,Qr;Q==="width"||Q==="both"?(Qr=Re[0]+Rt-me[3],br=Re[0]+Wt+me[1]):(Qr=Re[0]+(Rt+Wt-We.displaySize[0])/2,br=Qr+We.displaySize[0]);const vn=D.top*Ve,Sn=D.bottom*Ve;return Q==="height"||Q==="both"?(pr=Re[1]+vn-me[0],Hr=Re[1]+Sn+me[2]):(pr=Re[1]+(vn+Sn-We.displaySize[1])/2,Hr=pr+We.displaySize[1]),{image:We,top:pr,right:br,bottom:Hr,left:Qr,collisionPadding:gt}}const G_=255,A0=128,Xm=G_*A0;function _S(Y,D){const{expression:Q}=D;if(Q.kind==="constant")return{kind:"constant",layoutSize:Q.evaluate(new ml(Y+1))};if(Q.kind==="source")return{kind:"source"};{const{zoomStops:me,interpolationType:Re}=Q;let Ve=0;for(;VeWe.id),this.index=D.index,this.pixelRatio=D.pixelRatio,this.sourceLayerIndex=D.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ia([]),this.placementViewportMatrix=ia([]);const Q=this.layers[0]._unevaluatedLayout._values;this.textSizeData=_S(this.zoom,Q["text-size"]),this.iconSizeData=_S(this.zoom,Q["icon-size"]);const me=this.layers[0].layout,Re=me.get("symbol-sort-key"),Ve=me.get("symbol-z-order");this.canOverlap=K3(me,"text-overlap","text-allow-overlap")!=="never"||K3(me,"icon-overlap","icon-allow-overlap")!=="never"||me.get("text-ignore-placement")||me.get("icon-ignore-placement"),this.sortFeaturesByKey=Ve!=="viewport-y"&&!Re.isConstant(),this.sortFeaturesByY=(Ve==="viewport-y"||Ve==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,me.get("symbol-placement")==="point"&&(this.writingModes=me.get("text-writing-mode").map(We=>e.ah[We])),this.stateDependentLayerIds=this.layers.filter(We=>We.isStateDependent()).map(We=>We.id),this.sourceID=D.sourceID}createArrays(){this.text=new oh(new Ol(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new oh(new Ol(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new Ks,this.lineVertexArray=new Js,this.symbolInstances=new Wo,this.textAnchorOffsets=new il}calculateGlyphDependencies(D,Q,me,Re,Ve){for(let We=0;We0)&&(We.value.kind!=="constant"||We.value.value.length>0),pr=Rt.value.kind!=="constant"||!!Rt.value.value||Object.keys(Rt.parameters).length>0,br=Ve.get("symbol-sort-key");if(this.features=[],!Wt&&!pr)return;const Hr=Q.iconDependencies,Qr=Q.glyphDependencies,vn=Q.availableImages,Sn=new ml(this.zoom);for(const{feature:Nn,id:va,index:oi,sourceLayerIndex:Ba}of D){const ei=Re._featureFilter.needGeometry,Oi=yr(Nn,ei);if(!Re._featureFilter.filter(Sn,Oi,me))continue;let fo,$o;if(ei||(Oi.geometry=mt(Nn)),Wt){const is=Re.getValueAndResolveTokens("text-field",Oi,me,vn),Yo=gn.factory(is),Is=this.hasRTLText=this.hasRTLText||T6(Yo);(!Is||zl.getRTLTextPluginStatus()==="unavailable"||Is&&zl.isParsed())&&(fo=qm(Yo,Re,Oi))}if(pr){const is=Re.getValueAndResolveTokens("icon-image",Oi,me,vn);$o=is instanceof ha?is:ha.fromString(is)}if(!fo&&!$o)continue;const dl=this.sortFeaturesByKey?br.evaluate(Oi,{},me):void 0;if(this.features.push({id:va,text:fo,icon:$o,index:oi,sourceLayerIndex:Ba,geometry:Oi.geometry,properties:Nn.properties,type:w6[Nn.type],sortKey:dl}),$o&&(Hr[$o.name]=!0),fo){const is=We.evaluate(Oi,{},me).join(","),Yo=Ve.get("text-rotation-alignment")!=="viewport"&&Ve.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(const Is of fo.sections)if(Is.image)Hr[Is.image.name]=!0;else{const Ss=ns(fo.toString()),bs=Is.fontStack||is,eo=Qr[bs]=Qr[bs]||{};this.calculateGlyphDependencies(Is.text,eo,Yo,this.allowVerticalPlacement,Ss)}}}Ve.get("symbol-placement")==="line"&&(this.features=(function(Nn){const va={},oi={},Ba=[];let ei=0;function Oi(is){Ba.push(Nn[is]),ei++}function fo(is,Yo,Is){const Ss=oi[is];return delete oi[is],oi[Yo]=Ss,Ba[Ss].geometry[0].pop(),Ba[Ss].geometry[0]=Ba[Ss].geometry[0].concat(Is[0]),Ss}function $o(is,Yo,Is){const Ss=va[Yo];return delete va[Yo],va[is]=Ss,Ba[Ss].geometry[0].shift(),Ba[Ss].geometry[0]=Is[0].concat(Ba[Ss].geometry[0]),Ss}function dl(is,Yo,Is){const Ss=Is?Yo[0][Yo[0].length-1]:Yo[0][0];return`${is}:${Ss.x}:${Ss.y}`}for(let is=0;isis.geometry)})(this.features)),this.sortFeaturesByKey&&this.features.sort((Nn,va)=>Nn.sortKey-va.sortKey)}update(D,Q,me){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(D,Q,this.layers,me),this.icon.programConfigurations.updatePaintArrays(D,Q,this.layers,me))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(D){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(D),this.iconCollisionBox.upload(D)),this.text.upload(D,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(D,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(D,Q){const me=this.lineVertexArray.length;if(D.segment!==void 0){let Re=D.dist(Q[D.segment+1]),Ve=D.dist(Q[D.segment]);const We={};for(let gt=D.segment+1;gt=0;gt--)We[gt]={x:Q[gt].x,y:Q[gt].y,tileUnitDistanceFromAnchor:Ve},gt>0&&(Ve+=Q[gt-1].dist(Q[gt]));for(let gt=0;gt0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(D,Q){const me=D.placedSymbolArray.get(Q),Re=me.vertexStartIndex+4*me.numGlyphs;for(let Ve=me.vertexStartIndex;VeRe[gt]-Re[Rt]||Ve[Rt]-Ve[gt]),We}addToSortKeyRanges(D,Q){const me=this.sortKeyRanges[this.sortKeyRanges.length-1];me&&me.sortKey===Q?me.symbolInstanceEnd=D+1:this.sortKeyRanges.push({sortKey:Q,symbolInstanceStart:D,symbolInstanceEnd:D+1})}sortFeatures(D){if(this.sortFeaturesByY&&this.sortedAngle!==D&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(D),this.sortedAngle=D,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const Q of this.symbolInstanceIndexes){const me=this.symbolInstances.get(Q);this.featureSortOrder.push(me.featureIndex),[me.rightJustifiedTextSymbolIndex,me.centerJustifiedTextSymbolIndex,me.leftJustifiedTextSymbolIndex].forEach((Re,Ve,We)=>{Re>=0&&We.indexOf(Re)===Ve&&this.addIndicesForPlacedSymbol(this.text,Re)}),me.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,me.verticalPlacedTextSymbolIndex),me.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,me.placedIconSymbolIndex),me.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,me.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let X_,Y_;Na("SymbolBucket",Vg,{omit:["layers","collisionBoxArray","features","compareText"]}),Vg.MAX_GLYPHS=65535,Vg.addDynamicAttributes=Ym;var Q3={get paint(){return Y_=Y_||new Ue({"icon-opacity":new as(ie.paint_symbol["icon-opacity"]),"icon-color":new as(ie.paint_symbol["icon-color"]),"icon-halo-color":new as(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new as(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new as(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new Xo(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new Xo(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new as(ie.paint_symbol["text-opacity"]),"text-color":new as(ie.paint_symbol["text-color"],{runtimeType:Qt,getOverride:Y=>Y.textColor,hasOverride:Y=>!!Y.textColor}),"text-halo-color":new as(ie.paint_symbol["text-halo-color"]),"text-halo-width":new as(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new as(ie.paint_symbol["text-halo-blur"]),"text-translate":new Xo(ie.paint_symbol["text-translate"]),"text-translate-anchor":new Xo(ie.paint_symbol["text-translate-anchor"])})},get layout(){return X_=X_||new Ue({"symbol-placement":new Xo(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new Xo(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Xo(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new as(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Xo(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Xo(ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Xo(ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Xo(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new Xo(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Xo(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new as(ie.layout_symbol["icon-size"]),"icon-text-fit":new Xo(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Xo(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new as(ie.layout_symbol["icon-image"]),"icon-rotate":new as(ie.layout_symbol["icon-rotate"]),"icon-padding":new as(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new Xo(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new as(ie.layout_symbol["icon-offset"]),"icon-anchor":new as(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Xo(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Xo(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Xo(ie.layout_symbol["text-rotation-alignment"]),"text-field":new as(ie.layout_symbol["text-field"]),"text-font":new as(ie.layout_symbol["text-font"]),"text-size":new as(ie.layout_symbol["text-size"]),"text-max-width":new as(ie.layout_symbol["text-max-width"]),"text-line-height":new Xo(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new as(ie.layout_symbol["text-letter-spacing"]),"text-justify":new as(ie.layout_symbol["text-justify"]),"text-radial-offset":new as(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Xo(ie.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new as(ie.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new as(ie.layout_symbol["text-anchor"]),"text-max-angle":new Xo(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new Xo(ie.layout_symbol["text-writing-mode"]),"text-rotate":new as(ie.layout_symbol["text-rotate"]),"text-padding":new Xo(ie.layout_symbol["text-padding"]),"text-keep-upright":new Xo(ie.layout_symbol["text-keep-upright"]),"text-transform":new as(ie.layout_symbol["text-transform"]),"text-offset":new as(ie.layout_symbol["text-offset"]),"text-allow-overlap":new Xo(ie.layout_symbol["text-allow-overlap"]),"text-overlap":new Xo(ie.layout_symbol["text-overlap"]),"text-ignore-placement":new Xo(ie.layout_symbol["text-ignore-placement"]),"text-optional":new Xo(ie.layout_symbol["text-optional"])})}};class n1{constructor(D){if(D.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=D.property.overrides?D.property.overrides.runtimeType:dt,this.defaultValue=D}evaluate(D){if(D.formattedSection){const Q=this.defaultValue.property.overrides;if(Q&&Q.hasOverride(D.formattedSection))return Q.getOverride(D.formattedSection)}return D.feature&&D.featureState?this.defaultValue.evaluate(D.feature,D.featureState):this.defaultValue.property.specification.default}eachChild(D){this.defaultValue.isConstant()||D(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Na("FormatSectionOverride",n1,{omit:["defaultValue"]});class fw extends oe{constructor(D){super(D,Q3)}recalculate(D,Q){if(super.recalculate(D,Q),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const me=this.layout.get("text-writing-mode");if(me){const Re=[];for(const Ve of me)Re.indexOf(Ve)<0&&Re.push(Ve);this.layout._values["text-writing-mode"]=Re}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(D,Q,me,Re){const Ve=this.layout.get(D).evaluate(Q,{},me,Re),We=this._unevaluatedLayout._values[D];return We.isDataDriven()||Uf(We.value)||!Ve?Ve:(function(gt,Rt){return Rt.replace(/{([^{}]+)}/g,(Wt,pr)=>gt&&pr in gt?String(gt[pr]):"")})(Q.properties,Ve)}createBucket(D){return new Vg(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const D of Q3.paint.overridableProperties){if(!fw.hasPaintOverride(this.layout,D))continue;const Q=this.paint.get(D),me=new n1(Q),Re=new Oc(me,Q.property.specification);let Ve=null;Ve=Q.value.kind==="constant"||Q.value.kind==="source"?new kf("source",Re):new gc("composite",Re,Q.value.zoomStops),this.paint._values[D]=new Lu(Q.property,Ve,Q.parameters)}}_handleOverridablePaintPropertyUpdate(D,Q,me){return!(!this.layout||Q.isDataDriven()||me.isDataDriven())&&fw.hasPaintOverride(this.layout,D)}static hasPaintOverride(D,Q){const me=D.get("text-field"),Re=Q3.paint.properties[Q];let Ve=!1;const We=gt=>{for(const Rt of gt)if(Re.overrides&&Re.overrides.hasOverride(Rt))return void(Ve=!0)};if(me.value.kind==="constant"&&me.value.value instanceof gn)We(me.value.value.sections);else if(me.value.kind==="source"){const gt=Wt=>{Ve||(Wt instanceof Si&&Hn(Wt.value)===$r?We(Wt.value.sections):Wt instanceof ul?We(Wt.sections):Wt.eachChild(gt))},Rt=me.value;Rt._styleExpression&>(Rt._styleExpression.expression)}return Ve}}let eT;var xS={get paint(){return eT=eT||new Ue({"background-color":new Xo(ie.paint_background["background-color"]),"background-pattern":new $c(ie.paint_background["background-pattern"]),"background-opacity":new Xo(ie.paint_background["background-opacity"])})}};class Z_ extends oe{constructor(D){super(D,xS)}}let hw;var tT={get paint(){return hw=hw||new Ue({"raster-opacity":new Xo(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new Xo(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Xo(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Xo(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new Xo(ie.paint_raster["raster-saturation"]),"raster-contrast":new Xo(ie.paint_raster["raster-contrast"]),"raster-resampling":new Xo(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new Xo(ie.paint_raster["raster-fade-duration"])})}};class A6 extends oe{constructor(D){super(D,tT)}}class bS extends oe{constructor(D){super(D,{}),this.onAdd=Q=>{this.implementation.onAdd&&this.implementation.onAdd(Q,Q.painter.context.gl)},this.onRemove=Q=>{this.implementation.onRemove&&this.implementation.onRemove(Q,Q.painter.context.gl)},this.implementation=D}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class W_{constructor(D){this._methodToThrottle=D,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const rT=63710088e-1;class S0{constructor(D,Q){if(isNaN(D)||isNaN(Q))throw new Error(`Invalid LngLat object: (${D}, ${Q})`);if(this.lng=+D,this.lat=+Q,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new S0(A(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(D){const Q=Math.PI/180,me=this.lat*Q,Re=D.lat*Q,Ve=Math.sin(me)*Math.sin(Re)+Math.cos(me)*Math.cos(Re)*Math.cos((D.lng-this.lng)*Q);return rT*Math.acos(Math.min(Ve,1))}static convert(D){if(D instanceof S0)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new S0(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new S0(Number("lng"in D?D.lng:D.lon),Number(D.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const wS=2*Math.PI*rT;function dw(Y){return wS*Math.cos(Y*Math.PI/180)}function vw(Y){return(180+Y)/360}function TS(Y){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Y*Math.PI/360)))/360}function kp(Y,D){return Y/dw(D)}function nT(Y){return 360/Math.PI*Math.atan(Math.exp((180-360*Y)*Math.PI/180))-90}class $_{constructor(D,Q,me=0){this.x=+D,this.y=+Q,this.z=+me}static fromLngLat(D,Q=0){const me=S0.convert(D);return new $_(vw(me.lng),TS(me.lat),kp(Q,me.lat))}toLngLat(){return new S0(360*this.x-180,nT(this.y))}toAltitude(){return this.z*dw(nT(this.y))}meterInMercatorCoordinateUnits(){return 1/wS*(D=nT(this.y),1/Math.cos(D*Math.PI/180));var D}}function AS(Y,D,Q){var me=2*Math.PI*6378137/256/Math.pow(2,Q);return[Y*me-2*Math.PI*6378137/2,D*me-2*Math.PI*6378137/2]}class aT{constructor(D,Q,me){if(!(function(Re,Ve,We){return!(Re<0||Re>25||We<0||We>=Math.pow(2,Re)||Ve<0||Ve>=Math.pow(2,Re))})(D,Q,me))throw new Error(`x=${Q}, y=${me}, z=${D} outside of bounds. 0<=x<${Math.pow(2,D)}, 0<=y<${Math.pow(2,D)} 0<=z<=25 `);this.z=D,this.x=Q,this.y=me,this.key=a1(0,D,D,Q,me)}equals(D){return this.z===D.z&&this.x===D.x&&this.y===D.y}url(D,Q,me){const Re=(We=this.y,gt=this.z,Rt=AS(256*(Ve=this.x),256*(We=Math.pow(2,gt)-We-1),gt),Wt=AS(256*(Ve+1),256*(We+1),gt),Rt[0]+","+Rt[1]+","+Wt[0]+","+Wt[1]);var Ve,We,gt,Rt,Wt;const pr=(function(br,Hr,Qr){let vn,Sn="";for(let Nn=br;Nn>0;Nn--)vn=1<1?"@2x":"").replace(/{quadkey}/g,pr).replace(/{bbox-epsg-3857}/g,Re)}isChildOf(D){const Q=this.z-D.z;return Q>0&&D.x===this.x>>Q&&D.y===this.y>>Q}getTilePoint(D){const Q=Math.pow(2,this.z);return new i((D.x*Q-this.x)*Kl,(D.y*Q-this.y)*Kl)}toString(){return`${this.z}/${this.x}/${this.y}`}}class SS{constructor(D,Q){this.wrap=D,this.canonical=Q,this.key=a1(D,Q.z,Q.z,Q.x,Q.y)}}class vp{constructor(D,Q,me,Re,Ve){if(D= z; overscaledZ = ${D}; z = ${me}`);this.overscaledZ=D,this.wrap=Q,this.canonical=new aT(me,+Re,+Ve),this.key=a1(Q,D,me,Re,Ve)}clone(){return new vp(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(D){return this.overscaledZ===D.overscaledZ&&this.wrap===D.wrap&&this.canonical.equals(D.canonical)}scaledTo(D){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);const Q=this.canonical.z-D;return D>this.canonical.z?new vp(D,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new vp(D,this.wrap,D,this.canonical.x>>Q,this.canonical.y>>Q)}calculateScaledKey(D,Q){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);const me=this.canonical.z-D;return D>this.canonical.z?a1(this.wrap*+Q,D,this.canonical.z,this.canonical.x,this.canonical.y):a1(this.wrap*+Q,D,D,this.canonical.x>>me,this.canonical.y>>me)}isChildOf(D){if(D.wrap!==this.wrap)return!1;const Q=this.canonical.z-D.canonical.z;return D.overscaledZ===0||D.overscaledZ>Q&&D.canonical.y===this.canonical.y>>Q}children(D){if(this.overscaledZ>=D)return[new vp(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const Q=this.canonical.z+1,me=2*this.canonical.x,Re=2*this.canonical.y;return[new vp(Q,this.wrap,Q,me,Re),new vp(Q,this.wrap,Q,me+1,Re),new vp(Q,this.wrap,Q,me,Re+1),new vp(Q,this.wrap,Q,me+1,Re+1)]}isLessThan(D){return this.wrapD.wrap)&&(this.overscaledZD.overscaledZ)&&(this.canonical.xD.canonical.x)&&this.canonical.ythis.max&&(this.max=br),br=this.dim+1||Q<-1||Q>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(Q+1)*this.stride+(D+1)}unpack(D,Q,me){return D*this.redFactor+Q*this.greenFactor+me*this.blueFactor-this.baseShift}getPixels(){return new fl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(D,Q,me){if(this.dim!==D.dim)throw new Error("dem dimension mismatch");let Re=Q*this.dim,Ve=Q*this.dim+this.dim,We=me*this.dim,gt=me*this.dim+this.dim;switch(Q){case-1:Re=Ve-1;break;case 1:Ve=Re+1}switch(me){case-1:We=gt-1;break;case 1:gt=We+1}const Rt=-Q*this.dim,Wt=-me*this.dim;for(let pr=We;pr=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${D} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[D]}}class ES{constructor(D,Q,me,Re,Ve){this.type="Feature",this._vectorTileFeature=D,D._z=Q,D._x=me,D._y=Re,this.properties=D.properties,this.id=Ve}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(D){this._geometry=D}toJSON(){const D={geometry:this.geometry};for(const Q in this)Q!=="_geometry"&&Q!=="_vectorTileFeature"&&(D[Q]=this[Q]);return D}}class kS{constructor(D,Q){this.tileID=D,this.x=D.canonical.x,this.y=D.canonical.y,this.z=D.canonical.z,this.grid=new bi(Kl,16,0),this.grid3D=new bi(Kl,16,0),this.featureIndexArray=new ou,this.promoteId=Q}insert(D,Q,me,Re,Ve,We){const gt=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(me,Re,Ve);const Rt=We?this.grid3D:this.grid;for(let Wt=0;Wt=0&&br[3]>=0&&Rt.insert(gt,br[0],br[1],br[2],br[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ua.VectorTile(new X3(this.rawTileData)).layers,this.sourceLayerCoder=new MS(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(D,Q,me,Re){this.loadVTLayers();const Ve=D.params||{},We=Kl/D.tileSize/D.scale,gt=Ah(Ve.filter),Rt=D.queryGeometry,Wt=D.queryPadding*We,pr=iT(Rt),br=this.grid.query(pr.minX-Wt,pr.minY-Wt,pr.maxX+Wt,pr.maxY+Wt),Hr=iT(D.cameraQueryGeometry),Qr=this.grid3D.query(Hr.minX-Wt,Hr.minY-Wt,Hr.maxX+Wt,Hr.maxY+Wt,(Nn,va,oi,Ba)=>(function(ei,Oi,fo,$o,dl){for(const Yo of ei)if(Oi<=Yo.x&&fo<=Yo.y&&$o>=Yo.x&&dl>=Yo.y)return!0;const is=[new i(Oi,fo),new i(Oi,dl),new i($o,dl),new i($o,fo)];if(ei.length>2){for(const Yo of is)if(Ga(ei,Yo))return!0}for(let Yo=0;Yo(Ba||(Ba=mt(ei)),Oi.queryIntersectsFeature(Rt,ei,fo,Ba,this.z,D.transform,We,D.pixelPosMatrix)))}return vn}loadMatchingFeature(D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br){const Hr=this.bucketLayerIDs[Q];if(We&&!(function(Nn,va){for(let oi=0;oi=0)return!0;return!1})(We,Hr))return;const Qr=this.sourceLayerCoder.decode(me),vn=this.vtLayers[Qr].feature(Re);if(Ve.needGeometry){const Nn=yr(vn,!0);if(!Ve.filter(new ml(this.tileID.overscaledZ),Nn,this.tileID.canonical))return}else if(!Ve.filter(new ml(this.tileID.overscaledZ),vn))return;const Sn=this.getId(vn,Qr);for(let Nn=0;Nn{const gt=D instanceof Pf?D.get(We):null;return gt&>.evaluate?gt.evaluate(Q,me,Re):gt})}function iT(Y){let D=1/0,Q=1/0,me=-1/0,Re=-1/0;for(const Ve of Y)D=Math.min(D,Ve.x),Q=Math.min(Q,Ve.y),me=Math.max(me,Ve.x),Re=Math.max(Re,Ve.y);return{minX:D,minY:Q,maxX:me,maxY:Re}}function LS(Y,D){return D-Y}function PS(Y,D,Q,me,Re){const Ve=[];for(let We=0;We=me&&br.x>=me||(pr.x>=me?pr=new i(me,pr.y+(me-pr.x)/(br.x-pr.x)*(br.y-pr.y))._round():br.x>=me&&(br=new i(me,pr.y+(me-pr.x)/(br.x-pr.x)*(br.y-pr.y))._round()),pr.y>=Re&&br.y>=Re||(pr.y>=Re?pr=new i(pr.x+(Re-pr.y)/(br.y-pr.y)*(br.x-pr.x),Re)._round():br.y>=Re&&(br=new i(pr.x+(Re-pr.y)/(br.y-pr.y)*(br.x-pr.x),Re)._round()),Rt&&pr.equals(Rt[Rt.length-1])||(Rt=[pr],Ve.push(Rt)),Rt.push(br)))))}}return Ve}Na("FeatureIndex",kS,{omit:["rawTileData","sourceLayerCoder"]});class Zm extends i{constructor(D,Q,me,Re){super(D,Q),this.angle=me,Re!==void 0&&(this.segment=Re)}clone(){return new Zm(this.x,this.y,this.angle,this.segment)}}function RS(Y,D,Q,me,Re){if(D.segment===void 0||Q===0)return!0;let Ve=D,We=D.segment+1,gt=0;for(;gt>-Q/2;){if(We--,We<0)return!1;gt-=Y[We].dist(Ve),Ve=Y[We]}gt+=Y[We].dist(Y[We+1]),We++;const Rt=[];let Wt=0;for(;gtme;)Wt-=Rt.shift().angleDelta;if(Wt>Re)return!1;We++,gt+=pr.dist(br)}return!0}function IS(Y){let D=0;for(let Q=0;QWt){const vn=(Wt-Rt)/Qr,Sn=Mo.number(br.x,Hr.x,vn),Nn=Mo.number(br.y,Hr.y,vn),va=new Zm(Sn,Nn,Hr.angleTo(br),pr);return va._round(),!We||RS(Y,va,gt,We,D)?va:void 0}Rt+=Qr}}function M6(Y,D,Q,me,Re,Ve,We,gt,Rt){const Wt=DS(me,Ve,We),pr=zS(me,Re),br=pr*We,Hr=Y[0].x===0||Y[0].x===Rt||Y[0].y===0||Y[0].y===Rt;return D-br=0&&ei=0&&Oi=0&&Hr+Wt<=pr){const fo=new Zm(ei,Oi,oi,vn);fo._round(),me&&!RS(Y,fo,Ve,me,Re)||Qr.push(fo)}}br+=va}return gt||Qr.length||We||(Qr=Gg(Y,br/2,Q,me,Re,Ve,We,!0,Rt)),Qr}Na("Anchor",Zm);const i1=Jh;function OS(Y,D,Q,me){const Re=[],Ve=Y.image,We=Ve.pixelRatio,gt=Ve.paddedRect.w-2*i1,Rt=Ve.paddedRect.h-2*i1;let Wt={x1:Y.left,y1:Y.top,x2:Y.right,y2:Y.bottom};const pr=Ve.stretchX||[[0,gt]],br=Ve.stretchY||[[0,Rt]],Hr=(eo,Gs)=>eo+Gs[1]-Gs[0],Qr=pr.reduce(Hr,0),vn=br.reduce(Hr,0),Sn=gt-Qr,Nn=Rt-vn;let va=0,oi=Qr,Ba=0,ei=vn,Oi=0,fo=Sn,$o=0,dl=Nn;if(Ve.content&&me){const eo=Ve.content,Gs=eo[2]-eo[0],Ds=eo[3]-eo[1];(Ve.textFitWidth||Ve.textFitHeight)&&(Wt=gS(Y)),va=o1(pr,0,eo[0]),Ba=o1(br,0,eo[1]),oi=o1(pr,eo[0],eo[2]),ei=o1(br,eo[1],eo[3]),Oi=eo[0]-va,$o=eo[1]-Ba,fo=Gs-oi,dl=Ds-ei}const is=Wt.x1,Yo=Wt.y1,Is=Wt.x2-is,Ss=Wt.y2-Yo,bs=(eo,Gs,Ds,Pl)=>{const lf=Wv(eo.stretch-va,oi,Is,is),Jc=pw(eo.fixed-Oi,fo,eo.stretch,Qr),hd=Wv(Gs.stretch-Ba,ei,Ss,Yo),Av=pw(Gs.fixed-$o,dl,Gs.stretch,vn),kh=Wv(Ds.stretch-va,oi,Is,is),Qh=pw(Ds.fixed-Oi,fo,Ds.stretch,Qr),pv=Wv(Pl.stretch-Ba,ei,Ss,Yo),mv=pw(Pl.fixed-$o,dl,Pl.stretch,vn),gv=new i(lf,hd),Jf=new i(kh,hd),dd=new i(kh,pv),ov=new i(lf,pv),Xd=new i(Jc/We,Av/We),yv=new i(Qh/We,mv/We),Pd=D*Math.PI/180;if(Pd){const Bu=Math.sin(Pd),Ec=Math.cos(Pd),jc=[Ec,-Bu,Bu,Ec];gv._matMult(jc),Jf._matMult(jc),ov._matMult(jc),dd._matMult(jc)}const $v=eo.stretch+eo.fixed,bf=Gs.stretch+Gs.fixed;return{tl:gv,tr:Jf,bl:ov,br:dd,tex:{x:Ve.paddedRect.x+i1+$v,y:Ve.paddedRect.y+i1+bf,w:Ds.stretch+Ds.fixed-$v,h:Pl.stretch+Pl.fixed-bf},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Xd,pixelOffsetBR:yv,minFontScaleX:fo/We/Is,minFontScaleY:dl/We/Ss,isSDF:Q}};if(me&&(Ve.stretchX||Ve.stretchY)){const eo=s1(pr,Sn,Qr),Gs=s1(br,Nn,vn);for(let Ds=0;Ds0&&(Sn=Math.max(10,Sn),this.circleDiameter=Sn)}else{const Hr=!((br=We.image)===null||br===void 0)&&br.content&&(We.image.textFitWidth||We.image.textFitHeight)?gS(We):{x1:We.left,y1:We.top,x2:We.right,y2:We.bottom};Hr.y1=Hr.y1*gt-Rt[0],Hr.y2=Hr.y2*gt+Rt[2],Hr.x1=Hr.x1*gt-Rt[3],Hr.x2=Hr.x2*gt+Rt[1];const Qr=We.collisionPadding;if(Qr&&(Hr.x1-=Qr[0]*gt,Hr.y1-=Qr[1]*gt,Hr.x2+=Qr[2]*gt,Hr.y2+=Qr[3]*gt),pr){const vn=new i(Hr.x1,Hr.y1),Sn=new i(Hr.x2,Hr.y1),Nn=new i(Hr.x1,Hr.y2),va=new i(Hr.x2,Hr.y2),oi=pr*Math.PI/180;vn._rotate(oi),Sn._rotate(oi),Nn._rotate(oi),va._rotate(oi),Hr.x1=Math.min(vn.x,Sn.x,Nn.x,va.x),Hr.x2=Math.max(vn.x,Sn.x,Nn.x,va.x),Hr.y1=Math.min(vn.y,Sn.y,Nn.y,va.y),Hr.y2=Math.max(vn.y,Sn.y,Nn.y,va.y)}D.emplaceBack(Q.x,Q.y,Hr.x1,Hr.y1,Hr.x2,Hr.y2,me,Re,Ve)}this.boxEndIndex=D.length}}class E6{constructor(D=[],Q=(me,Re)=>meRe?1:0){if(this.data=D,this.length=this.data.length,this.compare=Q,this.length>0)for(let me=(this.length>>1)-1;me>=0;me--)this._down(me)}push(D){this.data.push(D),this._up(this.length++)}pop(){if(this.length===0)return;const D=this.data[0],Q=this.data.pop();return--this.length>0&&(this.data[0]=Q,this._down(0)),D}peek(){return this.data[0]}_up(D){const{data:Q,compare:me}=this,Re=Q[D];for(;D>0;){const Ve=D-1>>1,We=Q[Ve];if(me(Re,We)>=0)break;Q[D]=We,D=Ve}Q[D]=Re}_down(D){const{data:Q,compare:me}=this,Re=this.length>>1,Ve=Q[D];for(;D=0)break;Q[D]=Q[We],D=We}Q[D]=Ve}}function k6(Y,D=1,Q=!1){let me=1/0,Re=1/0,Ve=-1/0,We=-1/0;const gt=Y[0];for(let Qr=0;QrVe)&&(Ve=vn.x),(!Qr||vn.y>We)&&(We=vn.y)}const Rt=Math.min(Ve-me,We-Re);let Wt=Rt/2;const pr=new E6([],C6);if(Rt===0)return new i(me,Re);for(let Qr=me;Qrbr.d||!br.d)&&(br=Qr,Q&&console.log("found best %d after %d probes",Math.round(1e4*Qr.d)/1e4,Hr)),Qr.max-br.d<=D||(Wt=Qr.h/2,pr.push(new M0(Qr.p.x-Wt,Qr.p.y-Wt,Wt,Y)),pr.push(new M0(Qr.p.x+Wt,Qr.p.y-Wt,Wt,Y)),pr.push(new M0(Qr.p.x-Wt,Qr.p.y+Wt,Wt,Y)),pr.push(new M0(Qr.p.x+Wt,Qr.p.y+Wt,Wt,Y)),Hr+=4)}return Q&&(console.log(`num probes: ${Hr}`),console.log(`best distance: ${br.d}`)),br.p}function C6(Y,D){return D.max-Y.max}function M0(Y,D,Q,me){this.p=new i(Y,D),this.h=Q,this.d=(function(Re,Ve){let We=!1,gt=1/0;for(let Rt=0;RtRe.y!=vn.y>Re.y&&Re.x<(vn.x-Qr.x)*(Re.y-Qr.y)/(vn.y-Qr.y)+Qr.x&&(We=!We),gt=Math.min(gt,Fi(Re,Qr,vn))}}return(We?1:-1)*Math.sqrt(gt)})(this.p,me),this.max=this.d+this.h*Math.SQRT2}var Ld;e.aq=void 0,(Ld=e.aq||(e.aq={}))[Ld.center=1]="center",Ld[Ld.left=2]="left",Ld[Ld.right=3]="right",Ld[Ld.top=4]="top",Ld[Ld.bottom=5]="bottom",Ld[Ld["top-left"]=6]="top-left",Ld[Ld["top-right"]=7]="top-right",Ld[Ld["bottom-left"]=8]="bottom-left",Ld[Ld["bottom-right"]=9]="bottom-right";const Wm=7,oT=Number.POSITIVE_INFINITY;function FS(Y,D){return D[1]!==oT?(function(Q,me,Re){let Ve=0,We=0;switch(me=Math.abs(me),Re=Math.abs(Re),Q){case"top-right":case"top-left":case"top":We=Re-Wm;break;case"bottom-right":case"bottom-left":case"bottom":We=-Re+Wm}switch(Q){case"top-right":case"bottom-right":case"right":Ve=-me;break;case"top-left":case"bottom-left":case"left":Ve=me}return[Ve,We]})(Y,D[0],D[1]):(function(Q,me){let Re=0,Ve=0;me<0&&(me=0);const We=me/Math.SQRT2;switch(Q){case"top-right":case"top-left":Ve=We-Wm;break;case"bottom-right":case"bottom-left":Ve=-We+Wm;break;case"bottom":Ve=-me+Wm;break;case"top":Ve=me-Wm}switch(Q){case"top-right":case"bottom-right":Re=-We;break;case"top-left":case"bottom-left":Re=We;break;case"left":Re=me;break;case"right":Re=-me}return[Re,Ve]})(Y,D[0])}function BS(Y,D,Q){var me;const Re=Y.layout,Ve=(me=Re.get("text-variable-anchor-offset"))===null||me===void 0?void 0:me.evaluate(D,{},Q);if(Ve){const gt=Ve.values,Rt=[];for(let Wt=0;WtHr*pc);pr.startsWith("top")?br[1]-=Wm:pr.startsWith("bottom")&&(br[1]+=Wm),Rt[Wt+1]=br}return new pa(Rt)}const We=Re.get("text-variable-anchor");if(We){let gt;gt=Y._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Re.get("text-radial-offset").evaluate(D,{},Q)*pc,oT]:Re.get("text-offset").evaluate(D,{},Q).map(Wt=>Wt*pc);const Rt=[];for(const Wt of We)Rt.push(Wt,FS(Wt,gt));return new pa(Rt)}return null}function sT(Y){switch(Y){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function L6(Y,D,Q,me,Re,Ve,We,gt,Rt,Wt,pr){let br=Ve.textMaxSize.evaluate(D,{});br===void 0&&(br=We);const Hr=Y.layers[0].layout,Qr=Hr.get("icon-offset").evaluate(D,{},pr),vn=US(Q.horizontal),Sn=We/24,Nn=Y.tilePixelRatio*Sn,va=Y.tilePixelRatio*br/24,oi=Y.tilePixelRatio*gt,Ba=Y.tilePixelRatio*Hr.get("symbol-spacing"),ei=Hr.get("text-padding")*Y.tilePixelRatio,Oi=(function(eo,Gs,Ds,Pl=1){const lf=eo.get("icon-padding").evaluate(Gs,{},Ds),Jc=lf&&lf.values;return[Jc[0]*Pl,Jc[1]*Pl,Jc[2]*Pl,Jc[3]*Pl]})(Hr,D,pr,Y.tilePixelRatio),fo=Hr.get("text-max-angle")/180*Math.PI,$o=Hr.get("text-rotation-alignment")!=="viewport"&&Hr.get("symbol-placement")!=="point",dl=Hr.get("icon-rotation-alignment")==="map"&&Hr.get("symbol-placement")!=="point",is=Hr.get("symbol-placement"),Yo=Ba/2,Is=Hr.get("icon-text-fit");let Ss;me&&Is!=="none"&&(Y.allowVerticalPlacement&&Q.vertical&&(Ss=yS(me,Q.vertical,Is,Hr.get("icon-text-fit-padding"),Qr,Sn)),vn&&(me=yS(me,vn,Is,Hr.get("icon-text-fit-padding"),Qr,Sn)));const bs=(eo,Gs)=>{Gs.x<0||Gs.x>=Kl||Gs.y<0||Gs.y>=Kl||(function(Ds,Pl,lf,Jc,hd,Av,kh,Qh,pv,mv,gv,Jf,dd,ov,Xd,yv,Pd,$v,bf,Bu,Ec,jc,Hf,wf,c1){const r0=Ds.addToLineVertexArray(Pl,lf);let n0,sv,uf,Rd,Cp=0,Kv=0,_v=0,dT=0,vT=-1,xw=-1;const rm={};let pT=oa("");if(Ds.allowVerticalPlacement&&Jc.vertical){const Yd=Qh.layout.get("text-rotate").evaluate(Ec,{},wf)+90;uf=new mw(pv,Pl,mv,gv,Jf,Jc.vertical,dd,ov,Xd,Yd),kh&&(Rd=new mw(pv,Pl,mv,gv,Jf,kh,Pd,$v,Xd,Yd))}if(hd){const Yd=Qh.layout.get("icon-rotate").evaluate(Ec,{}),Jv=Qh.layout.get("icon-text-fit")!=="none",$m=OS(hd,Yd,Hf,Jv),a0=kh?OS(kh,Yd,Hf,Jv):void 0;sv=new mw(pv,Pl,mv,gv,Jf,hd,Pd,$v,!1,Yd),Cp=4*$m.length;const Xg=Ds.iconSizeData;let i0=null;Xg.kind==="source"?(i0=[A0*Qh.layout.get("icon-size").evaluate(Ec,{})],i0[0]>Xm&&y(`${Ds.layerIds[0]}: Value for "icon-size" is >= ${G_}. Reduce your "icon-size".`)):Xg.kind==="composite"&&(i0=[A0*jc.compositeIconSizes[0].evaluate(Ec,{},wf),A0*jc.compositeIconSizes[1].evaluate(Ec,{},wf)],(i0[0]>Xm||i0[1]>Xm)&&y(`${Ds.layerIds[0]}: Value for "icon-size" is >= ${G_}. Reduce your "icon-size".`)),Ds.addSymbols(Ds.icon,$m,i0,Bu,bf,Ec,e.ah.none,Pl,r0.lineStartIndex,r0.lineLength,-1,wf),vT=Ds.icon.placedSymbolArray.length-1,a0&&(Kv=4*a0.length,Ds.addSymbols(Ds.icon,a0,i0,Bu,bf,Ec,e.ah.vertical,Pl,r0.lineStartIndex,r0.lineLength,-1,wf),xw=Ds.icon.placedSymbolArray.length-1)}const mT=Object.keys(Jc.horizontal);for(const Yd of mT){const Jv=Jc.horizontal[Yd];if(!n0){pT=oa(Jv.text);const a0=Qh.layout.get("text-rotate").evaluate(Ec,{},wf);n0=new mw(pv,Pl,mv,gv,Jf,Jv,dd,ov,Xd,a0)}const $m=Jv.positionedLines.length===1;if(_v+=NS(Ds,Pl,Jv,Av,Qh,Xd,Ec,yv,r0,Jc.vertical?e.ah.horizontal:e.ah.horizontalOnly,$m?mT:[Yd],rm,vT,jc,wf),$m)break}Jc.vertical&&(dT+=NS(Ds,Pl,Jc.vertical,Av,Qh,Xd,Ec,yv,r0,e.ah.vertical,["vertical"],rm,xw,jc,wf));const gT=n0?n0.boxStartIndex:Ds.collisionBoxArray.length,yT=n0?n0.boxEndIndex:Ds.collisionBoxArray.length,P6=uf?uf.boxStartIndex:Ds.collisionBoxArray.length,R6=uf?uf.boxEndIndex:Ds.collisionBoxArray.length,I6=sv?sv.boxStartIndex:Ds.collisionBoxArray.length,D6=sv?sv.boxEndIndex:Ds.collisionBoxArray.length,GS=Rd?Rd.boxStartIndex:Ds.collisionBoxArray.length,f1=Rd?Rd.boxEndIndex:Ds.collisionBoxArray.length;let ed=-1;const h1=(Yd,Jv)=>Yd&&Yd.circleDiameter?Math.max(Yd.circleDiameter,Jv):Jv;ed=h1(n0,ed),ed=h1(uf,ed),ed=h1(sv,ed),ed=h1(Rd,ed);const _T=ed>-1?1:0;_T&&(ed*=c1/pc),Ds.glyphOffsetArray.length>=Vg.MAX_GLYPHS&&y("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ec.sortKey!==void 0&&Ds.addToSortKeyRanges(Ds.symbolInstances.length,Ec.sortKey);const XS=BS(Qh,Ec,wf),[z6,YS]=(function(Yd,Jv){const $m=Yd.length,a0=Jv?.values;if(a0?.length>0)for(let Xg=0;Xg=0?rm.right:-1,rm.center>=0?rm.center:-1,rm.left>=0?rm.left:-1,rm.vertical||-1,vT,xw,pT,gT,yT,P6,R6,I6,D6,GS,f1,mv,_v,dT,Cp,Kv,_T,0,dd,ed,z6,YS)})(Y,Gs,eo,Q,me,Re,Ss,Y.layers[0],Y.collisionBoxArray,D.index,D.sourceLayerIndex,Y.index,Nn,[ei,ei,ei,ei],$o,Rt,oi,Oi,dl,Qr,D,Ve,Wt,pr,We)};if(is==="line")for(const eo of PS(D.geometry,0,0,Kl,Kl)){const Gs=M6(eo,Ba,fo,Q.vertical||vn,me,24,va,Y.overscaling,Kl);for(const Ds of Gs)vn&&jS(Y,vn.text,Yo,Ds)||bs(eo,Ds)}else if(is==="line-center"){for(const eo of D.geometry)if(eo.length>1){const Gs=S6(eo,fo,Q.vertical||vn,me,24,va);Gs&&bs(eo,Gs)}}else if(D.type==="Polygon")for(const eo of Xc(D.geometry,0)){const Gs=k6(eo,16);bs(eo[0],new Zm(Gs.x,Gs.y,0))}else if(D.type==="LineString")for(const eo of D.geometry)bs(eo,new Zm(eo[0].x,eo[0].y,0));else if(D.type==="Point")for(const eo of D.geometry)for(const Gs of eo)bs([Gs],new Zm(Gs.x,Gs.y,0))}function NS(Y,D,Q,me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr,Qr,vn){const Sn=(function(oi,Ba,ei,Oi,fo,$o,dl,is){const Yo=Oi.layout.get("text-rotate").evaluate($o,{})*Math.PI/180,Is=[];for(const Ss of Ba.positionedLines)for(const bs of Ss.positionedGlyphs){if(!bs.rect)continue;const eo=bs.rect||{};let Gs=Z3+1,Ds=!0,Pl=1,lf=0;const Jc=(fo||is)&&bs.vertical,hd=bs.metrics.advance*bs.scale/2;if(is&&Ba.verticalizable&&(lf=Ss.lineOffset/2-(bs.imageName?-(pc-bs.metrics.width*bs.scale)/2:(bs.scale-1)*pc)),bs.imageName){const Bu=dl[bs.imageName];Ds=Bu.sdf,Pl=Bu.pixelRatio,Gs=Jh/Pl}const Av=fo?[bs.x+hd,bs.y]:[0,0];let kh=fo?[0,0]:[bs.x+hd+ei[0],bs.y+ei[1]-lf],Qh=[0,0];Jc&&(Qh=kh,kh=[0,0]);const pv=bs.metrics.isDoubleResolution?2:1,mv=(bs.metrics.left-Gs)*bs.scale-hd+kh[0],gv=(-bs.metrics.top-Gs)*bs.scale+kh[1],Jf=mv+eo.w/pv*bs.scale/Pl,dd=gv+eo.h/pv*bs.scale/Pl,ov=new i(mv,gv),Xd=new i(Jf,gv),yv=new i(mv,dd),Pd=new i(Jf,dd);if(Jc){const Bu=new i(-hd,hd-e1),Ec=-Math.PI/2,jc=pc/2-hd,Hf=new i(5-e1-jc,-(bs.imageName?jc:0)),wf=new i(...Qh);ov._rotateAround(Ec,Bu)._add(Hf)._add(wf),Xd._rotateAround(Ec,Bu)._add(Hf)._add(wf),yv._rotateAround(Ec,Bu)._add(Hf)._add(wf),Pd._rotateAround(Ec,Bu)._add(Hf)._add(wf)}if(Yo){const Bu=Math.sin(Yo),Ec=Math.cos(Yo),jc=[Ec,-Bu,Bu,Ec];ov._matMult(jc),Xd._matMult(jc),yv._matMult(jc),Pd._matMult(jc)}const $v=new i(0,0),bf=new i(0,0);Is.push({tl:ov,tr:Xd,bl:yv,br:Pd,tex:eo,writingMode:Ba.writingMode,glyphOffset:Av,sectionIndex:bs.sectionIndex,isSDF:Ds,pixelOffsetTL:$v,pixelOffsetBR:bf,minFontScaleX:0,minFontScaleY:0})}return Is})(0,Q,gt,Re,Ve,We,me,Y.allowVerticalPlacement),Nn=Y.textSizeData;let va=null;Nn.kind==="source"?(va=[A0*Re.layout.get("text-size").evaluate(We,{})],va[0]>Xm&&y(`${Y.layerIds[0]}: Value for "text-size" is >= ${G_}. Reduce your "text-size".`)):Nn.kind==="composite"&&(va=[A0*Qr.compositeTextSizes[0].evaluate(We,{},vn),A0*Qr.compositeTextSizes[1].evaluate(We,{},vn)],(va[0]>Xm||va[1]>Xm)&&y(`${Y.layerIds[0]}: Value for "text-size" is >= ${G_}. Reduce your "text-size".`)),Y.addSymbols(Y.text,Sn,va,gt,Ve,We,Wt,D,Rt.lineStartIndex,Rt.lineLength,Hr,vn);for(const oi of pr)br[oi]=Y.text.placedSymbolArray.length-1;return 4*Sn.length}function US(Y){for(const D in Y)return Y[D];return null}function jS(Y,D,Q,me){const Re=Y.compareText;if(D in Re){const Ve=Re[D];for(let We=Ve.length-1;We>=0;We--)if(me.dist(Ve[We])>4;if(Re!==1)throw new Error(`Got v${Re} data when expected v1.`);const Ve=qS[15&me];if(!Ve)throw new Error("Unrecognized array type.");const[We]=new Uint16Array(D,2,1),[gt]=new Uint32Array(D,4,1);return new lT(gt,We,Ve,D)}constructor(D,Q=64,me=Float64Array,Re){if(isNaN(D)||D<0)throw new Error(`Unpexpected numItems value: ${D}.`);this.numItems=+D,this.nodeSize=Math.min(Math.max(+Q,2),65535),this.ArrayType=me,this.IndexArrayType=D<65536?Uint16Array:Uint32Array;const Ve=qS.indexOf(this.ArrayType),We=2*D*this.ArrayType.BYTES_PER_ELEMENT,gt=D*this.IndexArrayType.BYTES_PER_ELEMENT,Rt=(8-gt%8)%8;if(Ve<0)throw new Error(`Unexpected typed array class: ${me}.`);Re&&Re instanceof ArrayBuffer?(this.data=Re,this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+gt+Rt,2*D),this._pos=2*D,this._finished=!0):(this.data=new ArrayBuffer(8+We+gt+Rt),this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+gt+Rt,2*D),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Ve]),new Uint16Array(this.data,2,1)[0]=Q,new Uint32Array(this.data,4,1)[0]=D)}add(D,Q){const me=this._pos>>1;return this.ids[me]=me,this.coords[this._pos++]=D,this.coords[this._pos++]=Q,me}finish(){const D=this._pos>>1;if(D!==this.numItems)throw new Error(`Added ${D} items when expected ${this.numItems}.`);return uT(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(D,Q,me,Re){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Ve,coords:We,nodeSize:gt}=this,Rt=[0,Ve.length-1,0],Wt=[];for(;Rt.length;){const pr=Rt.pop()||0,br=Rt.pop()||0,Hr=Rt.pop()||0;if(br-Hr<=gt){for(let Nn=Hr;Nn<=br;Nn++){const va=We[2*Nn],oi=We[2*Nn+1];va>=D&&va<=me&&oi>=Q&&oi<=Re&&Wt.push(Ve[Nn])}continue}const Qr=Hr+br>>1,vn=We[2*Qr],Sn=We[2*Qr+1];vn>=D&&vn<=me&&Sn>=Q&&Sn<=Re&&Wt.push(Ve[Qr]),(pr===0?D<=vn:Q<=Sn)&&(Rt.push(Hr),Rt.push(Qr-1),Rt.push(1-pr)),(pr===0?me>=vn:Re>=Sn)&&(Rt.push(Qr+1),Rt.push(br),Rt.push(1-pr))}return Wt}within(D,Q,me){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Re,coords:Ve,nodeSize:We}=this,gt=[0,Re.length-1,0],Rt=[],Wt=me*me;for(;gt.length;){const pr=gt.pop()||0,br=gt.pop()||0,Hr=gt.pop()||0;if(br-Hr<=We){for(let Nn=Hr;Nn<=br;Nn++)Gd(Ve[2*Nn],Ve[2*Nn+1],D,Q)<=Wt&&Rt.push(Re[Nn]);continue}const Qr=Hr+br>>1,vn=Ve[2*Qr],Sn=Ve[2*Qr+1];Gd(vn,Sn,D,Q)<=Wt&&Rt.push(Re[Qr]),(pr===0?D-me<=vn:Q-me<=Sn)&&(gt.push(Hr),gt.push(Qr-1),gt.push(1-pr)),(pr===0?D+me>=vn:Q+me>=Sn)&&(gt.push(Qr+1),gt.push(br),gt.push(1-pr))}return Rt}}function uT(Y,D,Q,me,Re,Ve){if(Re-me<=Q)return;const We=me+Re>>1;VS(Y,D,We,me,Re,Ve),uT(Y,D,Q,me,We-1,1-Ve),uT(Y,D,Q,We+1,Re,1-Ve)}function VS(Y,D,Q,me,Re,Ve){for(;Re>me;){if(Re-me>600){const Wt=Re-me+1,pr=Q-me+1,br=Math.log(Wt),Hr=.5*Math.exp(2*br/3),Qr=.5*Math.sqrt(br*Hr*(Wt-Hr)/Wt)*(pr-Wt/2<0?-1:1);VS(Y,D,Q,Math.max(me,Math.floor(Q-pr*Hr/Wt+Qr)),Math.min(Re,Math.floor(Q+(Wt-pr)*Hr/Wt+Qr)),Ve)}const We=D[2*Q+Ve];let gt=me,Rt=Re;for(l1(Y,D,me,Q),D[2*Re+Ve]>We&&l1(Y,D,me,Re);gtWe;)Rt--}D[2*me+Ve]===We?l1(Y,D,me,Rt):(Rt++,l1(Y,D,Rt,Re)),Rt<=Q&&(me=Rt+1),Q<=Rt&&(Re=Rt-1)}}function l1(Y,D,Q,me){gw(Y,Q,me),gw(D,2*Q,2*me),gw(D,2*Q+1,2*me+1)}function gw(Y,D,Q){const me=Y[D];Y[D]=Y[Q],Y[Q]=me}function Gd(Y,D,Q,me){const Re=Y-Q,Ve=D-me;return Re*Re+Ve*Ve}var cT;e.bg=void 0,(cT=e.bg||(e.bg={})).create="create",cT.load="load",cT.fullLoad="fullLoad";let yw=null,u1=[];const fT=1e3/60,_w="loadTime",hT="fullLoadTime",HS={mark(Y){performance.mark(Y)},frame(Y){const D=Y;yw!=null&&u1.push(D-yw),yw=D},clearMetrics(){yw=null,u1=[],performance.clearMeasures(_w),performance.clearMeasures(hT);for(const Y in e.bg)performance.clearMarks(e.bg[Y])},getPerformanceMetrics(){performance.measure(_w,e.bg.create,e.bg.load),performance.measure(hT,e.bg.create,e.bg.fullLoad);const Y=performance.getEntriesByName(_w)[0].duration,D=performance.getEntriesByName(hT)[0].duration,Q=u1.length,me=1/(u1.reduce((Ve,We)=>Ve+We,0)/Q/1e3),Re=u1.filter(Ve=>Ve>fT).reduce((Ve,We)=>Ve+(We-fT)/fT,0);return{loadTime:Y,fullLoadTime:D,fps:me,percentDroppedFrames:Re/(Q+Re)*100,totalFrames:Q}}};e.$=class extends Ar{},e.A=Ri,e.B=ti,e.C=function(Y){if(z==null){const D=Y.navigator?Y.navigator.userAgent:null;z=!!Y.safari||!(!D||!(/\b(iPad|iPhone|iPod)\b/.test(D)||D.match("Safari")&&!D.match("Chrome")))}return z},e.D=Xo,e.E=ae,e.F=class{constructor(Y,D){this.target=Y,this.mapId=D,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new W_(()=>this.process()),this.subscription=(function(Q,me,Re,Ve){return Q.addEventListener(me,Re,!1),{unsubscribe:()=>{Q.removeEventListener(me,Re,!1)}}})(this.target,"message",Q=>this.receive(Q)),this.globalScope=L(self)?Y:window}registerMessageHandler(Y,D){this.messageHandlers[Y]=D}sendAsync(Y,D){return new Promise((Q,me)=>{const Re=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Re]={resolve:Q,reject:me},D&&D.signal.addEventListener("abort",()=>{delete this.resolveRejects[Re];const gt={id:Re,type:"",origin:location.origin,targetMapId:Y.targetMapId,sourceMapId:this.mapId};this.target.postMessage(gt)},{once:!0});const Ve=[],We=Object.assign(Object.assign({},Y),{id:Re,sourceMapId:this.mapId,origin:location.origin,data:Go(Y.data,Ve)});this.target.postMessage(We,{transfer:Ve})})}receive(Y){const D=Y.data,Q=D.id;if(!(D.origin!=="file://"&&location.origin!=="file://"&&D.origin!=="resource://android"&&location.origin!=="resource://android"&&D.origin!==location.origin||D.targetMapId&&this.mapId!==D.targetMapId)){if(D.type===""){delete this.tasks[Q];const me=this.abortControllers[Q];return delete this.abortControllers[Q],void(me&&me.abort())}if(L(self)||D.mustQueue)return this.tasks[Q]=D,this.taskQueue.push(Q),void this.invoker.trigger();this.processTask(Q,D)}}process(){if(this.taskQueue.length===0)return;const Y=this.taskQueue.shift(),D=this.tasks[Y];delete this.tasks[Y],this.taskQueue.length>0&&this.invoker.trigger(),D&&this.processTask(Y,D)}processTask(Y,D){return t(this,void 0,void 0,function*(){if(D.type===""){const Re=this.resolveRejects[Y];return delete this.resolveRejects[Y],Re?void(D.error?Re.reject(jo(D.error)):Re.resolve(jo(D.data))):void 0}if(!this.messageHandlers[D.type])return void this.completeTask(Y,new Error(`Could not find a registered handler for ${D.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const Q=jo(D.data),me=new AbortController;this.abortControllers[Y]=me;try{const Re=yield this.messageHandlers[D.type](D.sourceMapId,Q,me);this.completeTask(Y,null,Re)}catch(Re){this.completeTask(Y,Re)}})}completeTask(Y,D,Q){const me=[];delete this.abortControllers[Y];const Re={id:Y,type:"",sourceMapId:this.mapId,origin:location.origin,error:D?Go(D):null,data:Go(Q,me)};this.target.postMessage(Re,{transfer:me})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=le,e.H=function(){var Y=new Ri(16);return Ri!=Float32Array&&(Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=0,Y[6]=0,Y[7]=0,Y[8]=0,Y[9]=0,Y[11]=0,Y[12]=0,Y[13]=0,Y[14]=0),Y[0]=1,Y[5]=1,Y[10]=1,Y[15]=1,Y},e.I=Hd,e.J=function(Y,D,Q){var me,Re,Ve,We,gt,Rt,Wt,pr,br,Hr,Qr,vn,Sn=Q[0],Nn=Q[1],va=Q[2];return D===Y?(Y[12]=D[0]*Sn+D[4]*Nn+D[8]*va+D[12],Y[13]=D[1]*Sn+D[5]*Nn+D[9]*va+D[13],Y[14]=D[2]*Sn+D[6]*Nn+D[10]*va+D[14],Y[15]=D[3]*Sn+D[7]*Nn+D[11]*va+D[15]):(Re=D[1],Ve=D[2],We=D[3],gt=D[4],Rt=D[5],Wt=D[6],pr=D[7],br=D[8],Hr=D[9],Qr=D[10],vn=D[11],Y[0]=me=D[0],Y[1]=Re,Y[2]=Ve,Y[3]=We,Y[4]=gt,Y[5]=Rt,Y[6]=Wt,Y[7]=pr,Y[8]=br,Y[9]=Hr,Y[10]=Qr,Y[11]=vn,Y[12]=me*Sn+gt*Nn+br*va+D[12],Y[13]=Re*Sn+Rt*Nn+Hr*va+D[13],Y[14]=Ve*Sn+Wt*Nn+Qr*va+D[14],Y[15]=We*Sn+pr*Nn+vn*va+D[15]),Y},e.K=function(Y,D,Q){var me=Q[0],Re=Q[1],Ve=Q[2];return Y[0]=D[0]*me,Y[1]=D[1]*me,Y[2]=D[2]*me,Y[3]=D[3]*me,Y[4]=D[4]*Re,Y[5]=D[5]*Re,Y[6]=D[6]*Re,Y[7]=D[7]*Re,Y[8]=D[8]*Ve,Y[9]=D[9]*Ve,Y[10]=D[10]*Ve,Y[11]=D[11]*Ve,Y[12]=D[12],Y[13]=D[13],Y[14]=D[14],Y[15]=D[15],Y},e.L=Yn,e.M=function(Y,D){const Q={};for(let me=0;me{const D=window.document.createElement("video");return D.muted=!0,new Promise(Q=>{D.onloadstart=()=>{Q(D)};for(const me of Y){const Re=window.document.createElement("source");ne(me)||(D.crossOrigin="Anonymous"),Re.src=me,D.appendChild(Re)}})},e.a4=function(){return _++},e.a5=ni,e.a6=Vg,e.a7=Ah,e.a8=yr,e.a9=ES,e.aA=function(Y){if(Y.type==="custom")return new bS(Y);switch(Y.type){case"background":return new Z_(Y);case"circle":return new Oa(Y);case"fill":return new hn(Y);case"fill-extrusion":return new Gv(Y);case"heatmap":return new el(Y);case"hillshade":return new Qu(Y);case"line":return new Ng(Y);case"raster":return new A6(Y);case"symbol":return new fw(Y)}},e.aB=u,e.aC=function(Y,D){if(!Y)return[{command:"setStyle",args:[D]}];let Q=[];try{if(!Le(Y.version,D.version))return[{command:"setStyle",args:[D]}];Le(Y.center,D.center)||Q.push({command:"setCenter",args:[D.center]}),Le(Y.zoom,D.zoom)||Q.push({command:"setZoom",args:[D.zoom]}),Le(Y.bearing,D.bearing)||Q.push({command:"setBearing",args:[D.bearing]}),Le(Y.pitch,D.pitch)||Q.push({command:"setPitch",args:[D.pitch]}),Le(Y.sprite,D.sprite)||Q.push({command:"setSprite",args:[D.sprite]}),Le(Y.glyphs,D.glyphs)||Q.push({command:"setGlyphs",args:[D.glyphs]}),Le(Y.transition,D.transition)||Q.push({command:"setTransition",args:[D.transition]}),Le(Y.light,D.light)||Q.push({command:"setLight",args:[D.light]}),Le(Y.terrain,D.terrain)||Q.push({command:"setTerrain",args:[D.terrain]}),Le(Y.sky,D.sky)||Q.push({command:"setSky",args:[D.sky]}),Le(Y.projection,D.projection)||Q.push({command:"setProjection",args:[D.projection]});const me={},Re=[];(function(We,gt,Rt,Wt){let pr;for(pr in gt=gt||{},We=We||{})Object.prototype.hasOwnProperty.call(We,pr)&&(Object.prototype.hasOwnProperty.call(gt,pr)||Ye(pr,Rt,Wt));for(pr in gt)Object.prototype.hasOwnProperty.call(gt,pr)&&(Object.prototype.hasOwnProperty.call(We,pr)?Le(We[pr],gt[pr])||(We[pr].type==="geojson"&>[pr].type==="geojson"&&ct(We,gt,pr)?Fe(Rt,{command:"setGeoJSONSourceData",args:[pr,gt[pr].data]}):st(pr,gt,Rt,Wt)):ze(pr,gt,Rt))})(Y.sources,D.sources,Re,me);const Ve=[];Y.layers&&Y.layers.forEach(We=>{"source"in We&&me[We.source]?Q.push({command:"removeLayer",args:[We.id]}):Ve.push(We)}),Q=Q.concat(Re),(function(We,gt,Rt){gt=gt||[];const Wt=(We=We||[]).map(et),pr=gt.map(et),br=We.reduce(Pe,{}),Hr=gt.reduce(Pe,{}),Qr=Wt.slice(),vn=Object.create(null);let Sn,Nn,va,oi,Ba;for(let ei=0,Oi=0;ei@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(Q,me,Re,Ve)=>{const We=Re||Ve;return D[me]=!We||We.toLowerCase(),""}),D["max-age"]){const Q=parseInt(D["max-age"],10);isNaN(Q)?delete D["max-age"]:D["max-age"]=Q}return D},e.ab=function(Y,D){const Q=[];for(const me in Y)me in D||Q.push(me);return Q},e.ac=x,e.ad=function(Y,D,Q){var me=Math.sin(Q),Re=Math.cos(Q),Ve=D[0],We=D[1],gt=D[2],Rt=D[3],Wt=D[4],pr=D[5],br=D[6],Hr=D[7];return D!==Y&&(Y[8]=D[8],Y[9]=D[9],Y[10]=D[10],Y[11]=D[11],Y[12]=D[12],Y[13]=D[13],Y[14]=D[14],Y[15]=D[15]),Y[0]=Ve*Re+Wt*me,Y[1]=We*Re+pr*me,Y[2]=gt*Re+br*me,Y[3]=Rt*Re+Hr*me,Y[4]=Wt*Re-Ve*me,Y[5]=pr*Re-We*me,Y[6]=br*Re-gt*me,Y[7]=Hr*Re-Rt*me,Y},e.ae=function(Y){var D=new Ri(16);return D[0]=Y[0],D[1]=Y[1],D[2]=Y[2],D[3]=Y[3],D[4]=Y[4],D[5]=Y[5],D[6]=Y[6],D[7]=Y[7],D[8]=Y[8],D[9]=Y[9],D[10]=Y[10],D[11]=Y[11],D[12]=Y[12],D[13]=Y[13],D[14]=Y[14],D[15]=Y[15],D},e.af=$a,e.ag=function(Y,D){let Q=0,me=0;if(Y.kind==="constant")me=Y.layoutSize;else if(Y.kind!=="source"){const{interpolationType:Re,minZoom:Ve,maxZoom:We}=Y,gt=Re?x(ui.interpolationFactor(Re,D,Ve,We),0,1):0;Y.kind==="camera"?me=Mo.number(Y.minSize,Y.maxSize,gt):Q=gt}return{uSizeT:Q,uSize:me}},e.ai=function(Y,{uSize:D,uSizeT:Q},{lowerSize:me,upperSize:Re}){return Y.kind==="source"?me/A0:Y.kind==="composite"?Mo.number(me/A0,Re/A0,Q):D},e.aj=Ym,e.ak=function(Y,D,Q,me){const Re=D.y-Y.y,Ve=D.x-Y.x,We=me.y-Q.y,gt=me.x-Q.x,Rt=We*Ve-gt*Re;if(Rt===0)return null;const Wt=(gt*(Y.y-Q.y)-We*(Y.x-Q.x))/Rt;return new i(Y.x+Wt*Ve,Y.y+Wt*Re)},e.al=PS,e.am=ca,e.an=ia,e.ao=function(Y){let D=1/0,Q=1/0,me=-1/0,Re=-1/0;for(const Ve of Y)D=Math.min(D,Ve.x),Q=Math.min(Q,Ve.y),me=Math.max(me,Ve.x),Re=Math.max(Re,Ve.y);return[D,Q,me,Re]},e.ap=pc,e.ar=K3,e.as=function(Y,D){var Q=D[0],me=D[1],Re=D[2],Ve=D[3],We=D[4],gt=D[5],Rt=D[6],Wt=D[7],pr=D[8],br=D[9],Hr=D[10],Qr=D[11],vn=D[12],Sn=D[13],Nn=D[14],va=D[15],oi=Q*gt-me*We,Ba=Q*Rt-Re*We,ei=Q*Wt-Ve*We,Oi=me*Rt-Re*gt,fo=me*Wt-Ve*gt,$o=Re*Wt-Ve*Rt,dl=pr*Sn-br*vn,is=pr*Nn-Hr*vn,Yo=pr*va-Qr*vn,Is=br*Nn-Hr*Sn,Ss=br*va-Qr*Sn,bs=Hr*va-Qr*Nn,eo=oi*bs-Ba*Ss+ei*Is+Oi*Yo-fo*is+$o*dl;return eo?(Y[0]=(gt*bs-Rt*Ss+Wt*Is)*(eo=1/eo),Y[1]=(Re*Ss-me*bs-Ve*Is)*eo,Y[2]=(Sn*$o-Nn*fo+va*Oi)*eo,Y[3]=(Hr*fo-br*$o-Qr*Oi)*eo,Y[4]=(Rt*Yo-We*bs-Wt*is)*eo,Y[5]=(Q*bs-Re*Yo+Ve*is)*eo,Y[6]=(Nn*ei-vn*$o-va*Ba)*eo,Y[7]=(pr*$o-Hr*ei+Qr*Ba)*eo,Y[8]=(We*Ss-gt*Yo+Wt*dl)*eo,Y[9]=(me*Yo-Q*Ss-Ve*dl)*eo,Y[10]=(vn*fo-Sn*ei+va*oi)*eo,Y[11]=(br*ei-pr*fo-Qr*oi)*eo,Y[12]=(gt*is-We*Is-Rt*dl)*eo,Y[13]=(Q*Is-me*is+Re*dl)*eo,Y[14]=(Sn*Ba-vn*Oi-Nn*oi)*eo,Y[15]=(pr*Oi-br*Ba+Hr*oi)*eo,Y):null},e.at=sT,e.au=$3,e.av=lT,e.aw=function(){const Y={},D=ie.$version;for(const Q in ie.$root){const me=ie.$root[Q];if(me.required){let Re=null;Re=Q==="version"?D:me.type==="array"?[]:{},Re!=null&&(Y[Q]=Re)}}return Y},e.ax=Wi,e.ay=V,e.az=function(Y){Y=Y.slice();const D=Object.create(null);for(let Q=0;Q25||me<0||me>=1||Q<0||Q>=1)},e.bc=function(Y,D){return Y[0]=D[0],Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=0,Y[5]=D[1],Y[6]=0,Y[7]=0,Y[8]=0,Y[9]=0,Y[10]=D[2],Y[11]=0,Y[12]=0,Y[13]=0,Y[14]=0,Y[15]=1,Y},e.bd=class extends fr{},e.be=rT,e.bf=HS,e.bh=ce,e.bi=function(Y,D){re.REGISTERED_PROTOCOLS[Y]=D},e.bj=function(Y){delete re.REGISTERED_PROTOCOLS[Y]},e.bk=function(Y,D){const Q={};for(let Re=0;Rebs*pc)}let is=We?"center":Q.get("text-justify").evaluate(Wt,{},Y.canonical);const Yo=Q.get("symbol-placement")==="point"?Q.get("text-max-width").evaluate(Wt,{},Y.canonical)*pc:1/0,Is=()=>{Y.bucket.allowVerticalPlacement&&ns(ei)&&(vn.vertical=ow(Sn,Y.glyphMap,Y.glyphPositions,Y.imagePositions,pr,Yo,Ve,$o,"left",fo,va,e.ah.vertical,!0,Hr,br))};if(!We&&dl){const Ss=new Set;if(is==="auto")for(let eo=0;eot(void 0,void 0,void 0,function*(){if(Y.byteLength===0)return createImageBitmap(new ImageData(1,1));const D=new Blob([new Uint8Array(Y)],{type:"image/png"});try{return createImageBitmap(D)}catch(Q){throw new Error(`Could not load image because of ${Q.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),e.e=M,e.f=Y=>new Promise((D,Q)=>{const me=new Image;me.onload=()=>{D(me),URL.revokeObjectURL(me.src),me.onload=null,window.requestAnimationFrame(()=>{me.src=N})},me.onerror=()=>Q(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const Re=new Blob([new Uint8Array(Y)],{type:"image/png"});me.src=Y.byteLength?URL.createObjectURL(Re):N}),e.g=fe,e.h=(Y,D)=>ee(M(Y,{type:"json"}),D),e.i=L,e.j=H,e.k=te,e.l=(Y,D)=>ee(M(Y,{type:"arrayBuffer"}),D),e.m=ee,e.n=function(Y){return new X3(Y).readFields(g6,[])},e.o=Qo,e.p=iw,e.q=Ue,e.r=xa,e.s=ne,e.t=Ha,e.u=Aa,e.v=ie,e.w=y,e.x=function([Y,D,Q]){return D+=90,D*=Math.PI/180,Q*=Math.PI/180,{x:Y*Math.cos(D)*Math.sin(Q),y:Y*Math.sin(D)*Math.sin(Q),z:Y*Math.cos(Q)}},e.y=Mo,e.z=ml}),S("worker",["./shared"],function(e){class t{constructor(je){this.keyCache={},je&&this.replace(je)}replace(je){this._layerConfigs={},this._layers={},this.update(je,[])}update(je,Je){for(const xe of je){this._layerConfigs[xe.id]=xe;const ye=this._layers[xe.id]=e.aA(xe);ye._featureFilter=e.a7(ye.filter),this.keyCache[xe.id]&&delete this.keyCache[xe.id]}for(const xe of Je)delete this.keyCache[xe],delete this._layerConfigs[xe],delete this._layers[xe];this.familiesBySource={};const ke=e.bk(Object.values(this._layerConfigs),this.keyCache);for(const xe of ke){const ye=xe.map(Ot=>this._layers[Ot.id]),Ee=ye[0];if(Ee.visibility==="none")continue;const Xe=Ee.source||"";let Qe=this.familiesBySource[Xe];Qe||(Qe=this.familiesBySource[Xe]={});const Lt=Ee.sourceLayer||"_geojsonTileLayer";let Ct=Qe[Lt];Ct||(Ct=Qe[Lt]=[]),Ct.push(ye)}}}class r{constructor(je){const Je={},ke=[];for(const Xe in je){const Qe=je[Xe],Lt=Je[Xe]={};for(const Ct in Qe){const Ot=Qe[+Ct];if(!Ot||Ot.bitmap.width===0||Ot.bitmap.height===0)continue;const Kt={x:0,y:0,w:Ot.bitmap.width+2,h:Ot.bitmap.height+2};ke.push(Kt),Lt[Ct]={rect:Kt,metrics:Ot.metrics}}}const{w:xe,h:ye}=e.p(ke),Ee=new e.o({width:xe||1,height:ye||1});for(const Xe in je){const Qe=je[Xe];for(const Lt in Qe){const Ct=Qe[+Lt];if(!Ct||Ct.bitmap.width===0||Ct.bitmap.height===0)continue;const Ot=Je[Xe][Lt].rect;e.o.copy(Ct.bitmap,Ee,{x:0,y:0},{x:Ot.x+1,y:Ot.y+1},Ct.bitmap)}}this.image=Ee,this.positions=Je}}e.bl("GlyphAtlas",r);class o{constructor(je){this.tileID=new e.S(je.tileID.overscaledZ,je.tileID.wrap,je.tileID.canonical.z,je.tileID.canonical.x,je.tileID.canonical.y),this.uid=je.uid,this.zoom=je.zoom,this.pixelRatio=je.pixelRatio,this.tileSize=je.tileSize,this.source=je.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=je.showCollisionBoxes,this.collectResourceTiming=!!je.collectResourceTiming,this.returnDependencies=!!je.returnDependencies,this.promoteId=je.promoteId,this.inFlightDependencies=[]}parse(je,Je,ke,xe){return e._(this,void 0,void 0,function*(){this.status="parsing",this.data=je,this.collisionBoxArray=new e.a5;const ye=new e.bm(Object.keys(je.layers).sort()),Ee=new e.bn(this.tileID,this.promoteId);Ee.bucketLayerIDs=[];const Xe={},Qe={featureIndex:Ee,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:ke},Lt=Je.familiesBySource[this.source];for(const na in Lt){const Un=je.layers[na];if(!Un)continue;Un.version===1&&e.w(`Vector tile source "${this.source}" layer "${na}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const ka=ye.encode(na),Va=[];for(let sr=0;sr=Vt.maxzoom||Vt.visibility!=="none"&&(n(sr,this.zoom,ke),(Xe[Vt.id]=Vt.createBucket({index:Ee.bucketLayerIDs.length,layers:sr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ka,sourceID:this.source})).populate(Va,Qe,this.tileID.canonical),Ee.bucketLayerIDs.push(sr.map(or=>or.id)))}}const Ct=e.aF(Qe.glyphDependencies,na=>Object.keys(na).map(Number));this.inFlightDependencies.forEach(na=>na?.abort()),this.inFlightDependencies=[];let Ot=Promise.resolve({});if(Object.keys(Ct).length){const na=new AbortController;this.inFlightDependencies.push(na),Ot=xe.sendAsync({type:"GG",data:{stacks:Ct,source:this.source,tileID:this.tileID,type:"glyphs"}},na)}const Kt=Object.keys(Qe.iconDependencies);let xr=Promise.resolve({});if(Kt.length){const na=new AbortController;this.inFlightDependencies.push(na),xr=xe.sendAsync({type:"GI",data:{icons:Kt,source:this.source,tileID:this.tileID,type:"icons"}},na)}const mr=Object.keys(Qe.patternDependencies);let vr=Promise.resolve({});if(mr.length){const na=new AbortController;this.inFlightDependencies.push(na),vr=xe.sendAsync({type:"GI",data:{icons:mr,source:this.source,tileID:this.tileID,type:"patterns"}},na)}const[Nr,kn,$n]=yield Promise.all([Ot,xr,vr]),Vn=new r(Nr),ra=new e.bo(kn,$n);for(const na in Xe){const Un=Xe[na];Un instanceof e.a6?(n(Un.layers,this.zoom,ke),e.bp({bucket:Un,glyphMap:Nr,glyphPositions:Vn.positions,imageMap:kn,imagePositions:ra.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Un.hasPattern&&(Un instanceof e.bq||Un instanceof e.br||Un instanceof e.bs)&&(n(Un.layers,this.zoom,ke),Un.addFeatures(Qe,this.tileID.canonical,ra.patternPositions))}return this.status="done",{buckets:Object.values(Xe).filter(na=>!na.isEmpty()),featureIndex:Ee,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Vn.image,imageAtlas:ra,glyphMap:this.returnDependencies?Nr:null,iconMap:this.returnDependencies?kn:null,glyphPositions:this.returnDependencies?Vn.positions:null}})}}function n(Mt,je,Je){const ke=new e.z(je);for(const xe of Mt)xe.recalculate(ke,Je)}class i{constructor(je,Je,ke){this.actor=je,this.layerIndex=Je,this.availableImages=ke,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(je,Je){return e._(this,void 0,void 0,function*(){const ke=yield e.l(je.request,Je);try{return{vectorTile:new e.bt.VectorTile(new e.bu(ke.data)),rawData:ke.data,cacheControl:ke.cacheControl,expires:ke.expires}}catch(xe){const ye=new Uint8Array(ke.data);let Ee=`Unable to parse the tile at ${je.request.url}, `;throw Ee+=ye[0]===31&&ye[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${xe.message}`,new Error(Ee)}})}loadTile(je){return e._(this,void 0,void 0,function*(){const Je=je.uid,ke=!!(je&&je.request&&je.request.collectResourceTiming)&&new e.bv(je.request),xe=new o(je);this.loading[Je]=xe;const ye=new AbortController;xe.abort=ye;try{const Ee=yield this.loadVectorTile(je,ye);if(delete this.loading[Je],!Ee)return null;const Xe=Ee.rawData,Qe={};Ee.expires&&(Qe.expires=Ee.expires),Ee.cacheControl&&(Qe.cacheControl=Ee.cacheControl);const Lt={};if(ke){const Ot=ke.finish();Ot&&(Lt.resourceTiming=JSON.parse(JSON.stringify(Ot)))}xe.vectorTile=Ee.vectorTile;const Ct=xe.parse(Ee.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[Je]=xe,this.fetching[Je]={rawTileData:Xe,cacheControl:Qe,resourceTiming:Lt};try{const Ot=yield Ct;return e.e({rawTileData:Xe.slice(0)},Ot,Qe,Lt)}finally{delete this.fetching[Je]}}catch(Ee){throw delete this.loading[Je],xe.status="done",this.loaded[Je]=xe,Ee}})}reloadTile(je){return e._(this,void 0,void 0,function*(){const Je=je.uid;if(!this.loaded||!this.loaded[Je])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const ke=this.loaded[Je];if(ke.showCollisionBoxes=je.showCollisionBoxes,ke.status==="parsing"){const xe=yield ke.parse(ke.vectorTile,this.layerIndex,this.availableImages,this.actor);let ye;if(this.fetching[Je]){const{rawTileData:Ee,cacheControl:Xe,resourceTiming:Qe}=this.fetching[Je];delete this.fetching[Je],ye=e.e({rawTileData:Ee.slice(0)},xe,Xe,Qe)}else ye=xe;return ye}if(ke.status==="done"&&ke.vectorTile)return ke.parse(ke.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(je){return e._(this,void 0,void 0,function*(){const Je=this.loading,ke=je.uid;Je&&Je[ke]&&Je[ke].abort&&(Je[ke].abort.abort(),delete Je[ke])})}removeTile(je){return e._(this,void 0,void 0,function*(){this.loaded&&this.loaded[je.uid]&&delete this.loaded[je.uid]})}}class a{constructor(){this.loaded={}}loadTile(je){return e._(this,void 0,void 0,function*(){const{uid:Je,encoding:ke,rawImageData:xe,redFactor:ye,greenFactor:Ee,blueFactor:Xe,baseShift:Qe}=je,Lt=xe.width+2,Ct=xe.height+2,Ot=e.b(xe)?new e.R({width:Lt,height:Ct},yield e.bw(xe,-1,-1,Lt,Ct)):xe,Kt=new e.bx(Je,Ot,ke,ye,Ee,Xe,Qe);return this.loaded=this.loaded||{},this.loaded[Je]=Kt,Kt})}removeTile(je){const Je=this.loaded,ke=je.uid;Je&&Je[ke]&&delete Je[ke]}}function s(Mt,je){if(Mt.length!==0){f(Mt[0],je);for(var Je=1;Je=Math.abs(Xe)?Je-Qe+Xe:Xe-Qe+Je,Je=Qe}Je+ke>=0!=!!je&&Mt.reverse()}var c=e.by(function Mt(je,Je){var ke,xe=je&&je.type;if(xe==="FeatureCollection")for(ke=0;ke>31}function L(Mt,je){for(var Je=Mt.loadGeometry(),ke=Mt.type,xe=0,ye=0,Ee=Je.length,Xe=0;XeMt},B=Math.fround||(R=new Float32Array(1),Mt=>(R[0]=+Mt,R[0]));var R;const U=3,j=5,Z=6;class re{constructor(je){this.options=Object.assign(Object.create(N),je),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(je){const{log:Je,minZoom:ke,maxZoom:xe}=this.options;Je&&console.time("total time");const ye=`prepare ${je.length} points`;Je&&console.time(ye),this.points=je;const Ee=[];for(let Qe=0;Qe=ke;Qe--){const Lt=+Date.now();Xe=this.trees[Qe]=this._createTree(this._cluster(Xe,Qe)),Je&&console.log("z%d: %d clusters in %dms",Qe,Xe.numItems,+Date.now()-Lt)}return Je&&console.timeEnd("total time"),this}getClusters(je,Je){let ke=((je[0]+180)%360+360)%360-180;const xe=Math.max(-90,Math.min(90,je[1]));let ye=je[2]===180?180:((je[2]+180)%360+360)%360-180;const Ee=Math.max(-90,Math.min(90,je[3]));if(je[2]-je[0]>=360)ke=-180,ye=180;else if(ke>ye){const Ot=this.getClusters([ke,xe,180,Ee],Je),Kt=this.getClusters([-180,xe,ye,Ee],Je);return Ot.concat(Kt)}const Xe=this.trees[this._limitZoom(Je)],Qe=Xe.range(ce(ke),V(Ee),ce(ye),V(xe)),Lt=Xe.data,Ct=[];for(const Ot of Qe){const Kt=this.stride*Ot;Ct.push(Lt[Kt+j]>1?fe(Lt,Kt,this.clusterProps):this.points[Lt[Kt+U]])}return Ct}getChildren(je){const Je=this._getOriginId(je),ke=this._getOriginZoom(je),xe="No cluster with the specified id.",ye=this.trees[ke];if(!ye)throw new Error(xe);const Ee=ye.data;if(Je*this.stride>=Ee.length)throw new Error(xe);const Xe=this.options.radius/(this.options.extent*Math.pow(2,ke-1)),Qe=ye.within(Ee[Je*this.stride],Ee[Je*this.stride+1],Xe),Lt=[];for(const Ct of Qe){const Ot=Ct*this.stride;Ee[Ot+4]===je&&Lt.push(Ee[Ot+j]>1?fe(Ee,Ot,this.clusterProps):this.points[Ee[Ot+U]])}if(Lt.length===0)throw new Error(xe);return Lt}getLeaves(je,Je,ke){const xe=[];return this._appendLeaves(xe,je,Je=Je||10,ke=ke||0,0),xe}getTile(je,Je,ke){const xe=this.trees[this._limitZoom(je)],ye=Math.pow(2,je),{extent:Ee,radius:Xe}=this.options,Qe=Xe/Ee,Lt=(ke-Qe)/ye,Ct=(ke+1+Qe)/ye,Ot={features:[]};return this._addTileFeatures(xe.range((Je-Qe)/ye,Lt,(Je+1+Qe)/ye,Ct),xe.data,Je,ke,ye,Ot),Je===0&&this._addTileFeatures(xe.range(1-Qe/ye,Lt,1,Ct),xe.data,ye,ke,ye,Ot),Je===ye-1&&this._addTileFeatures(xe.range(0,Lt,Qe/ye,Ct),xe.data,-1,ke,ye,Ot),Ot.features.length?Ot:null}getClusterExpansionZoom(je){let Je=this._getOriginZoom(je)-1;for(;Je<=this.options.maxZoom;){const ke=this.getChildren(je);if(Je++,ke.length!==1)break;je=ke[0].properties.cluster_id}return Je}_appendLeaves(je,Je,ke,xe,ye){const Ee=this.getChildren(Je);for(const Xe of Ee){const Qe=Xe.properties;if(Qe&&Qe.cluster?ye+Qe.point_count<=xe?ye+=Qe.point_count:ye=this._appendLeaves(je,Qe.cluster_id,ke,xe,ye):ye1;let Ct,Ot,Kt;if(Lt)Ct=le(Je,Qe,this.clusterProps),Ot=Je[Qe],Kt=Je[Qe+1];else{const vr=this.points[Je[Qe+U]];Ct=vr.properties;const[Nr,kn]=vr.geometry.coordinates;Ot=ce(Nr),Kt=V(kn)}const xr={type:1,geometry:[[Math.round(this.options.extent*(Ot*ye-ke)),Math.round(this.options.extent*(Kt*ye-xe))]],tags:Ct};let mr;mr=Lt||this.options.generateId?Je[Qe+U]:this.points[Je[Qe+U]].id,mr!==void 0&&(xr.id=mr),Ee.features.push(xr)}}_limitZoom(je){return Math.max(this.options.minZoom,Math.min(Math.floor(+je),this.options.maxZoom+1))}_cluster(je,Je){const{radius:ke,extent:xe,reduce:ye,minPoints:Ee}=this.options,Xe=ke/(xe*Math.pow(2,Je)),Qe=je.data,Lt=[],Ct=this.stride;for(let Ot=0;OtJe&&(Nr+=Qe[$n+j])}if(Nr>vr&&Nr>=Ee){let kn,$n=Kt*vr,Vn=xr*vr,ra=-1;const na=((Ot/Ct|0)<<5)+(Je+1)+this.points.length;for(const Un of mr){const ka=Un*Ct;if(Qe[ka+2]<=Je)continue;Qe[ka+2]=Je;const Va=Qe[ka+j];$n+=Qe[ka]*Va,Vn+=Qe[ka+1]*Va,Qe[ka+4]=na,ye&&(kn||(kn=this._map(Qe,Ot,!0),ra=this.clusterProps.length,this.clusterProps.push(kn)),ye(kn,this._map(Qe,ka)))}Qe[Ot+4]=na,Lt.push($n/Nr,Vn/Nr,1/0,na,-1,Nr),ye&&Lt.push(ra)}else{for(let kn=0;kn1)for(const kn of mr){const $n=kn*Ct;if(!(Qe[$n+2]<=Je)){Qe[$n+2]=Je;for(let Vn=0;Vn>5}_getOriginZoom(je){return(je-this.points.length)%32}_map(je,Je,ke){if(je[Je+j]>1){const Ee=this.clusterProps[je[Je+Z]];return ke?Object.assign({},Ee):Ee}const xe=this.points[je[Je+U]].properties,ye=this.options.map(xe);return ke&&ye===xe?Object.assign({},ye):ye}}function fe(Mt,je,Je){return{type:"Feature",id:Mt[je+U],properties:le(Mt,je,Je),geometry:{type:"Point",coordinates:[(ke=Mt[je],360*(ke-.5)),ee(Mt[je+1])]}};var ke}function le(Mt,je,Je){const ke=Mt[je+j],xe=ke>=1e4?`${Math.round(ke/1e3)}k`:ke>=1e3?Math.round(ke/100)/10+"k":ke,ye=Mt[je+Z],Ee=ye===-1?{}:Object.assign({},Je[ye]);return Object.assign(Ee,{cluster:!0,cluster_id:Mt[je+U],point_count:ke,point_count_abbreviated:xe})}function ce(Mt){return Mt/360+.5}function V(Mt){const je=Math.sin(Mt*Math.PI/180),Je=.5-.25*Math.log((1+je)/(1-je))/Math.PI;return Je<0?0:Je>1?1:Je}function ee(Mt){const je=(180-360*Mt)*Math.PI/180;return 360*Math.atan(Math.exp(je))/Math.PI-90}function ne(Mt,je,Je,ke){let xe=ke;const ye=je+(Je-je>>1);let Ee,Xe=Je-je;const Qe=Mt[je],Lt=Mt[je+1],Ct=Mt[Je],Ot=Mt[Je+1];for(let Kt=je+3;Ktxe)Ee=Kt,xe=xr;else if(xr===xe){const mr=Math.abs(Kt-ye);mrke&&(Ee-je>3&&ne(Mt,je,Ee,ke),Mt[Ee+2]=xe,Je-Ee>3&&ne(Mt,Ee,Je,ke))}function $(Mt,je,Je,ke,xe,ye){let Ee=xe-Je,Xe=ye-ke;if(Ee!==0||Xe!==0){const Qe=((Mt-Je)*Ee+(je-ke)*Xe)/(Ee*Ee+Xe*Xe);Qe>1?(Je=xe,ke=ye):Qe>0&&(Je+=Ee*Qe,ke+=Xe*Qe)}return Ee=Mt-Je,Xe=je-ke,Ee*Ee+Xe*Xe}function ue(Mt,je,Je,ke){const xe={id:Mt??null,type:je,geometry:Je,tags:ke,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(je==="Point"||je==="MultiPoint"||je==="LineString")te(xe,Je);else if(je==="Polygon")te(xe,Je[0]);else if(je==="MultiLineString")for(const ye of Je)te(xe,ye);else if(je==="MultiPolygon")for(const ye of Je)te(xe,ye[0]);return xe}function te(Mt,je){for(let Je=0;Je0&&(Ee+=ke?(xe*Ct-Lt*ye)/2:Math.sqrt(Math.pow(Lt-xe,2)+Math.pow(Ct-ye,2))),xe=Lt,ye=Ct}const Xe=je.length-3;je[2]=1,ne(je,0,Xe,Je),je[Xe+2]=1,je.size=Math.abs(Ee),je.start=0,je.end=je.size}function de(Mt,je,Je,ke){for(let xe=0;xe1?1:Je}function Fe(Mt,je,Je,ke,xe,ye,Ee,Xe){if(ke/=je,ye>=(Je/=je)&&Ee=ke)return null;const Qe=[];for(const Lt of Mt){const Ct=Lt.geometry;let Ot=Lt.type;const Kt=xe===0?Lt.minX:Lt.minY,xr=xe===0?Lt.maxX:Lt.maxY;if(Kt>=Je&&xr=ke)continue;let mr=[];if(Ot==="Point"||Ot==="MultiPoint")ze(Ct,mr,Je,ke,xe);else if(Ot==="LineString")Ye(Ct,mr,Je,ke,xe,!1,Xe.lineMetrics);else if(Ot==="MultiLineString")ct(Ct,mr,Je,ke,xe,!1);else if(Ot==="Polygon")ct(Ct,mr,Je,ke,xe,!0);else if(Ot==="MultiPolygon")for(const vr of Ct){const Nr=[];ct(vr,Nr,Je,ke,xe,!0),Nr.length&&mr.push(Nr)}if(mr.length){if(Xe.lineMetrics&&Ot==="LineString"){for(const vr of mr)Qe.push(ue(Lt.id,Ot,vr,Lt.tags));continue}Ot!=="LineString"&&Ot!=="MultiLineString"||(mr.length===1?(Ot="LineString",mr=mr[0]):Ot="MultiLineString"),Ot!=="Point"&&Ot!=="MultiPoint"||(Ot=mr.length===3?"Point":"MultiPoint"),Qe.push(ue(Lt.id,Ot,mr,Lt.tags))}}return Qe.length?Qe:null}function ze(Mt,je,Je,ke,xe){for(let ye=0;ye=Je&&Ee<=ke&&at(je,Mt[ye],Mt[ye+1],Mt[ye+2])}}function Ye(Mt,je,Je,ke,xe,ye,Ee){let Xe=st(Mt);const Qe=xe===0?et:Pe;let Lt,Ct,Ot=Mt.start;for(let Nr=0;NrJe&&(Ct=Qe(Xe,kn,$n,ra,na,Je),Ee&&(Xe.start=Ot+Lt*Ct)):Un>ke?ka=Je&&(Ct=Qe(Xe,kn,$n,ra,na,Je),Va=!0),ka>ke&&Un<=ke&&(Ct=Qe(Xe,kn,$n,ra,na,ke),Va=!0),!ye&&Va&&(Ee&&(Xe.end=Ot+Lt*Ct),je.push(Xe),Xe=st(Mt)),Ee&&(Ot+=Lt)}let Kt=Mt.length-3;const xr=Mt[Kt],mr=Mt[Kt+1],vr=xe===0?xr:mr;vr>=Je&&vr<=ke&&at(Xe,xr,mr,Mt[Kt+2]),Kt=Xe.length-3,ye&&Kt>=3&&(Xe[Kt]!==Xe[0]||Xe[Kt+1]!==Xe[1])&&at(Xe,Xe[0],Xe[1],Xe[2]),Xe.length&&je.push(Xe)}function st(Mt){const je=[];return je.size=Mt.size,je.start=Mt.start,je.end=Mt.end,je}function ct(Mt,je,Je,ke,xe,ye){for(const Ee of Mt)Ye(Ee,je,Je,ke,xe,ye,!1)}function at(Mt,je,Je,ke){Mt.push(je,Je,ke)}function et(Mt,je,Je,ke,xe,ye){const Ee=(ye-je)/(ke-je);return at(Mt,ye,Je+(xe-Je)*Ee,1),Ee}function Pe(Mt,je,Je,ke,xe,ye){const Ee=(ye-Je)/(xe-Je);return at(Mt,je+(ke-je)*Ee,ye,1),Ee}function Ae(Mt,je){const Je=[];for(let ke=0;ke0&&je.size<(xe?Ee:ke))return void(Je.numPoints+=je.length/3);const Xe=[];for(let Qe=0;QeEe)&&(Je.numSimplified++,Xe.push(je[Qe],je[Qe+1])),Je.numPoints++;xe&&(function(Qe,Lt){let Ct=0;for(let Ot=0,Kt=Qe.length,xr=Kt-2;Ot0===Lt)for(let Ot=0,Kt=Qe.length;Ot24)throw new Error("maxZoom should be in the 0-24 range");if(Je.promoteId&&Je.generateId)throw new Error("promoteId and generateId cannot be used together.");let xe=(function(ye,Ee){const Xe=[];if(ye.type==="FeatureCollection")for(let Qe=0;Qe1&&console.time("creation"),xr=this.tiles[Kt]=dt(je,Je,ke,xe,Lt),this.tileCoords.push({z:Je,x:ke,y:xe}),Ct)){Ct>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Je,ke,xe,xr.numFeatures,xr.numPoints,xr.numSimplified),console.timeEnd("creation"));const Va=`z${Je}`;this.stats[Va]=(this.stats[Va]||0)+1,this.total++}if(xr.source=je,ye==null){if(Je===Lt.indexMaxZoom||xr.numPoints<=Lt.indexMaxPoints)continue}else{if(Je===Lt.maxZoom||Je===ye)continue;if(ye!=null){const Va=ye-Je;if(ke!==Ee>>Va||xe!==Xe>>Va)continue}}if(xr.source=null,je.length===0)continue;Ct>1&&console.time("clipping");const mr=.5*Lt.buffer/Lt.extent,vr=.5-mr,Nr=.5+mr,kn=1+mr;let $n=null,Vn=null,ra=null,na=null,Un=Fe(je,Ot,ke-mr,ke+Nr,0,xr.minX,xr.maxX,Lt),ka=Fe(je,Ot,ke+vr,ke+kn,0,xr.minX,xr.maxX,Lt);je=null,Un&&($n=Fe(Un,Ot,xe-mr,xe+Nr,1,xr.minY,xr.maxY,Lt),Vn=Fe(Un,Ot,xe+vr,xe+kn,1,xr.minY,xr.maxY,Lt),Un=null),ka&&(ra=Fe(ka,Ot,xe-mr,xe+Nr,1,xr.minY,xr.maxY,Lt),na=Fe(ka,Ot,xe+vr,xe+kn,1,xr.minY,xr.maxY,Lt),ka=null),Ct>1&&console.timeEnd("clipping"),Qe.push($n||[],Je+1,2*ke,2*xe),Qe.push(Vn||[],Je+1,2*ke,2*xe+1),Qe.push(ra||[],Je+1,2*ke+1,2*xe),Qe.push(na||[],Je+1,2*ke+1,2*xe+1)}}getTile(je,Je,ke){je=+je,Je=+Je,ke=+ke;const xe=this.options,{extent:ye,debug:Ee}=xe;if(je<0||je>24)return null;const Xe=1<1&&console.log("drilling down to z%d-%d-%d",je,Je,ke);let Lt,Ct=je,Ot=Je,Kt=ke;for(;!Lt&&Ct>0;)Ct--,Ot>>=1,Kt>>=1,Lt=this.tiles[ar(Ct,Ot,Kt)];return Lt&&Lt.source?(Ee>1&&(console.log("found parent tile z%d-%d-%d",Ct,Ot,Kt),console.time("drilling down")),this.splitTile(Lt.source,Ct,Ot,Kt,je,Je,ke),Ee>1&&console.timeEnd("drilling down"),this.tiles[Qe]?Ne(this.tiles[Qe],ye):null):null}}function ar(Mt,je,Je){return 32*((1<{Ot.properties=xr;const mr={};for(const vr of Kt)mr[vr]=Qe[vr].evaluate(Ct,Ot);return mr},Ee.reduce=(xr,mr)=>{Ot.properties=mr;for(const vr of Kt)Ct.accumulated=xr[vr],xr[vr]=Lt[vr].evaluate(Ct,Ot)},Ee})(je)).load((yield this._pendingData).features):(xe=yield this._pendingData,new Qt(xe,je.geojsonVtOptions)),this.loaded={};const ye={};if(ke){const Ee=ke.finish();Ee&&(ye.resourceTiming={},ye.resourceTiming[je.source]=JSON.parse(JSON.stringify(Ee)))}return ye}catch(ye){if(delete this._pendingRequest,e.bB(ye))return{abandoned:!0};throw ye}var xe})}getData(){return e._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(je){const Je=this.loaded;return Je&&Je[je.uid]?super.reloadTile(je):this.loadTile(je)}loadAndProcessGeoJSON(je,Je){return e._(this,void 0,void 0,function*(){let ke=yield this.loadGeoJSON(je,Je);if(delete this._pendingRequest,typeof ke!="object")throw new Error(`Input data given to '${je.source}' is not a valid GeoJSON object.`);if(c(ke,!0),je.filter){const xe=e.bC(je.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(xe.result==="error")throw new Error(xe.value.map(Ee=>`${Ee.key}: ${Ee.message}`).join(", "));ke={type:"FeatureCollection",features:ke.features.filter(Ee=>xe.value.evaluate({zoom:0},Ee))}}return ke})}loadGeoJSON(je,Je){return e._(this,void 0,void 0,function*(){const{promoteId:ke}=je;if(je.request){const xe=yield e.h(je.request,Je);return this._dataUpdateable=Er(xe.data,ke)?$r(xe.data,ke):void 0,xe.data}if(typeof je.data=="string")try{const xe=JSON.parse(je.data);return this._dataUpdateable=Er(xe,ke)?$r(xe,ke):void 0,xe}catch{throw new Error(`Input data given to '${je.source}' is not a valid GeoJSON object.`)}if(!je.dataDiff)throw new Error(`Input data given to '${je.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${je.source}`);return(function(xe,ye,Ee){var Xe,Qe,Lt,Ct;if(ye.removeAll&&xe.clear(),ye.remove)for(const Ot of ye.remove)xe.delete(Ot);if(ye.add)for(const Ot of ye.add){const Kt=kr(Ot,Ee);Kt!=null&&xe.set(Kt,Ot)}if(ye.update)for(const Ot of ye.update){let Kt=xe.get(Ot.id);if(Kt==null)continue;const xr=!Ot.removeAllProperties&&(((Xe=Ot.removeProperties)===null||Xe===void 0?void 0:Xe.length)>0||((Qe=Ot.addOrUpdateProperties)===null||Qe===void 0?void 0:Qe.length)>0);if((Ot.newGeometry||Ot.removeAllProperties||xr)&&(Kt=Object.assign({},Kt),xe.set(Ot.id,Kt),xr&&(Kt.properties=Object.assign({},Kt.properties))),Ot.newGeometry&&(Kt.geometry=Ot.newGeometry),Ot.removeAllProperties)Kt.properties={};else if(((Lt=Ot.removeProperties)===null||Lt===void 0?void 0:Lt.length)>0)for(const mr of Ot.removeProperties)Object.prototype.hasOwnProperty.call(Kt.properties,mr)&&delete Kt.properties[mr];if(((Ct=Ot.addOrUpdateProperties)===null||Ct===void 0?void 0:Ct.length)>0)for(const{key:mr,value:vr}of Ot.addOrUpdateProperties)Kt.properties[mr]=vr}})(this._dataUpdateable,je.dataDiff,ke),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(je){return e._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(je){return this._geoJSONIndex.getClusterExpansionZoom(je.clusterId)}getClusterChildren(je){return this._geoJSONIndex.getChildren(je.clusterId)}getClusterLeaves(je){return this._geoJSONIndex.getLeaves(je.clusterId,je.limit,je.offset)}}class Ur{constructor(je){this.self=je,this.actor=new e.F(je),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(Je,ke)=>{if(this.externalWorkerSourceTypes[Je])throw new Error(`Worker source with name "${Je}" already registered.`);this.externalWorkerSourceTypes[Je]=ke},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=Je=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods(Je)},this.actor.registerMessageHandler("LDT",(Je,ke)=>this._getDEMWorkerSource(Je,ke.source).loadTile(ke)),this.actor.registerMessageHandler("RDT",(Je,ke)=>e._(this,void 0,void 0,function*(){this._getDEMWorkerSource(Je,ke.source).removeTile(ke)})),this.actor.registerMessageHandler("GCEZ",(Je,ke)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Je,ke.type,ke.source).getClusterExpansionZoom(ke)})),this.actor.registerMessageHandler("GCC",(Je,ke)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Je,ke.type,ke.source).getClusterChildren(ke)})),this.actor.registerMessageHandler("GCL",(Je,ke)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Je,ke.type,ke.source).getClusterLeaves(ke)})),this.actor.registerMessageHandler("LD",(Je,ke)=>this._getWorkerSource(Je,ke.type,ke.source).loadData(ke)),this.actor.registerMessageHandler("GD",(Je,ke)=>this._getWorkerSource(Je,ke.type,ke.source).getData()),this.actor.registerMessageHandler("LT",(Je,ke)=>this._getWorkerSource(Je,ke.type,ke.source).loadTile(ke)),this.actor.registerMessageHandler("RT",(Je,ke)=>this._getWorkerSource(Je,ke.type,ke.source).reloadTile(ke)),this.actor.registerMessageHandler("AT",(Je,ke)=>this._getWorkerSource(Je,ke.type,ke.source).abortTile(ke)),this.actor.registerMessageHandler("RMT",(Je,ke)=>this._getWorkerSource(Je,ke.type,ke.source).removeTile(ke)),this.actor.registerMessageHandler("RS",(Je,ke)=>e._(this,void 0,void 0,function*(){if(!this.workerSources[Je]||!this.workerSources[Je][ke.type]||!this.workerSources[Je][ke.type][ke.source])return;const xe=this.workerSources[Je][ke.type][ke.source];delete this.workerSources[Je][ke.type][ke.source],xe.removeSource!==void 0&&xe.removeSource(ke)})),this.actor.registerMessageHandler("RM",Je=>e._(this,void 0,void 0,function*(){delete this.layerIndexes[Je],delete this.availableImages[Je],delete this.workerSources[Je],delete this.demWorkerSources[Je]})),this.actor.registerMessageHandler("SR",(Je,ke)=>e._(this,void 0,void 0,function*(){this.referrer=ke})),this.actor.registerMessageHandler("SRPS",(Je,ke)=>this._syncRTLPluginState(Je,ke)),this.actor.registerMessageHandler("IS",(Je,ke)=>e._(this,void 0,void 0,function*(){this.self.importScripts(ke)})),this.actor.registerMessageHandler("SI",(Je,ke)=>this._setImages(Je,ke)),this.actor.registerMessageHandler("UL",(Je,ke)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Je).update(ke.layers,ke.removedIds)})),this.actor.registerMessageHandler("SL",(Je,ke)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Je).replace(ke)}))}_setImages(je,Je){return e._(this,void 0,void 0,function*(){this.availableImages[je]=Je;for(const ke in this.workerSources[je]){const xe=this.workerSources[je][ke];for(const ye in xe)xe[ye].availableImages=Je}})}_syncRTLPluginState(je,Je){return e._(this,void 0,void 0,function*(){if(e.bD.isParsed())return e.bD.getState();if(Je.pluginStatus!=="loading")return e.bD.setState(Je),Je;const ke=Je.pluginURL;if(this.self.importScripts(ke),e.bD.isParsed()){const xe={pluginStatus:"loaded",pluginURL:ke};return e.bD.setState(xe),xe}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${ke}`)})}_getAvailableImages(je){let Je=this.availableImages[je];return Je||(Je=[]),Je}_getLayerIndex(je){let Je=this.layerIndexes[je];return Je||(Je=this.layerIndexes[je]=new t),Je}_getWorkerSource(je,Je,ke){if(this.workerSources[je]||(this.workerSources[je]={}),this.workerSources[je][Je]||(this.workerSources[je][Je]={}),!this.workerSources[je][Je][ke]){const xe={sendAsync:(ye,Ee)=>(ye.targetMapId=je,this.actor.sendAsync(ye,Ee))};switch(Je){case"vector":this.workerSources[je][Je][ke]=new i(xe,this._getLayerIndex(je),this._getAvailableImages(je));break;case"geojson":this.workerSources[je][Je][ke]=new Sr(xe,this._getLayerIndex(je),this._getAvailableImages(je));break;default:this.workerSources[je][Je][ke]=new this.externalWorkerSourceTypes[Je](xe,this._getLayerIndex(je),this._getAvailableImages(je))}}return this.workerSources[je][Je][ke]}_getDEMWorkerSource(je,Je){return this.demWorkerSources[je]||(this.demWorkerSources[je]={}),this.demWorkerSources[je][Je]||(this.demWorkerSources[je][Je]=new a),this.demWorkerSources[je][Je]}}return e.i(self)&&(self.worker=new Ur(self)),Ur}),S("index",["exports","./shared"],function(e,t){var r="4.7.1";let o,n;const i={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Ue=>new Promise((P,oe)=>{const Me=requestAnimationFrame(P);Ue.signal.addEventListener("abort",()=>{cancelAnimationFrame(Me),oe(t.c())})}),getImageData(Ue,P=0){return this.getImageCanvasContext(Ue).getImageData(-P,-P,Ue.width+2*P,Ue.height+2*P)},getImageCanvasContext(Ue){const P=window.document.createElement("canvas"),oe=P.getContext("2d",{willReadFrequently:!0});if(!oe)throw new Error("failed to create canvas 2d context");return P.width=Ue.width,P.height=Ue.height,oe.drawImage(Ue,0,0,Ue.width,Ue.height),oe},resolveURL:Ue=>(o||(o=document.createElement("a")),o.href=Ue,o.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(n==null&&(n=matchMedia("(prefers-reduced-motion: reduce)")),n.matches)}};class a{static testProp(P){if(!a.docStyle)return P[0];for(let oe=0;oe{window.removeEventListener("click",a.suppressClickInternal,!0)},0)}static getScale(P){const oe=P.getBoundingClientRect();return{x:oe.width/P.offsetWidth||1,y:oe.height/P.offsetHeight||1,boundingClientRect:oe}}static getPoint(P,oe,Me){const Ce=oe.boundingClientRect;return new t.P((Me.clientX-Ce.left)/oe.x-P.clientLeft,(Me.clientY-Ce.top)/oe.y-P.clientTop)}static mousePos(P,oe){const Me=a.getScale(P);return a.getPoint(P,Me,oe)}static touchPos(P,oe){const Me=[],Ce=a.getScale(P);for(let Be=0;Be{f&&T(f),f=null,v=!0},c.onerror=()=>{p=!0,f=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),(function(Ue){let P,oe,Me,Ce;Ue.resetRequestQueue=()=>{P=[],oe=0,Me=0,Ce={}},Ue.addThrottleControl=Xt=>{const fr=Me++;return Ce[fr]=Xt,fr},Ue.removeThrottleControl=Xt=>{delete Ce[Xt],_t()},Ue.getImage=(Xt,fr,Ar=!0)=>new Promise((Lr,tn)=>{s.supported&&(Xt.headers||(Xt.headers={}),Xt.headers.accept="image/webp,*/*"),t.e(Xt,{type:"image"}),P.push({abortController:fr,requestParameters:Xt,supportImageRefresh:Ar,state:"queued",onError:xn=>{tn(xn)},onSuccess:xn=>{Lr(xn)}}),_t()});const Be=Xt=>t._(this,void 0,void 0,function*(){Xt.state="running";const{requestParameters:fr,supportImageRefresh:Ar,onError:Lr,onSuccess:tn,abortController:xn}=Xt,Ze=Ar===!1&&!t.i(self)&&!t.g(fr.url)&&(!fr.headers||Object.keys(fr.headers).reduce((bt,zt)=>bt&&zt==="accept",!0));oe++;const tt=Ze?kt(fr,xn):t.m(fr,xn);try{const bt=yield tt;delete Xt.abortController,Xt.state="completed",bt.data instanceof HTMLImageElement||t.b(bt.data)?tn(bt):bt.data&&tn({data:yield(vt=bt.data,typeof createImageBitmap=="function"?t.d(vt):t.f(vt)),cacheControl:bt.cacheControl,expires:bt.expires})}catch(bt){delete Xt.abortController,Lr(bt)}finally{oe--,_t()}var vt}),_t=()=>{const Xt=(()=>{for(const fr of Object.keys(Ce))if(Ce[fr]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let fr=oe;fr0;fr++){const Ar=P.shift();Ar.abortController.signal.aborted?fr--:Be(Ar)}},kt=(Xt,fr)=>new Promise((Ar,Lr)=>{const tn=new Image,xn=Xt.url,Ze=Xt.credentials;Ze&&Ze==="include"?tn.crossOrigin="use-credentials":(Ze&&Ze==="same-origin"||!t.s(xn))&&(tn.crossOrigin="anonymous"),fr.signal.addEventListener("abort",()=>{tn.src="",Lr(t.c())}),tn.fetchPriority="high",tn.onload=()=>{tn.onerror=tn.onload=null,Ar({data:tn})},tn.onerror=()=>{tn.onerror=tn.onload=null,fr.signal.aborted||Lr(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},tn.src=xn})})(l||(l={})),l.resetRequestQueue();class g{constructor(P){this._transformRequestFn=P}transformRequest(P,oe){return this._transformRequestFn&&this._transformRequestFn(P,oe)||{url:P}}setTransformRequest(P){this._transformRequestFn=P}}function x(Ue){var P=new t.A(3);return P[0]=Ue[0],P[1]=Ue[1],P[2]=Ue[2],P}var A,M=function(Ue,P,oe){return Ue[0]=P[0]-oe[0],Ue[1]=P[1]-oe[1],Ue[2]=P[2]-oe[2],Ue};A=new t.A(3),t.A!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0);var _=function(Ue){var P=Ue[0],oe=Ue[1];return P*P+oe*oe};function w(Ue){const P=[];if(typeof Ue=="string")P.push({id:"default",url:Ue});else if(Ue&&Ue.length>0){const oe=[];for(const{id:Me,url:Ce}of Ue){const Be=`${Me}${Ce}`;oe.indexOf(Be)===-1&&(oe.push(Be),P.push({id:Me,url:Ce}))}}return P}function m(Ue,P,oe){const Me=Ue.split("?");return Me[0]+=`${P}${oe}`,Me.join("?")}(function(){var Ue=new t.A(2);t.A!=Float32Array&&(Ue[0]=0,Ue[1]=0)})();class u{constructor(P,oe,Me,Ce){this.context=P,this.format=Me,this.texture=P.gl.createTexture(),this.update(oe,Ce)}update(P,oe,Me){const{width:Ce,height:Be}=P,_t=!(this.size&&this.size[0]===Ce&&this.size[1]===Be||Me),{context:kt}=this,{gl:Xt}=kt;if(this.useMipmap=!!(oe&&oe.useMipmap),Xt.bindTexture(Xt.TEXTURE_2D,this.texture),kt.pixelStoreUnpackFlipY.set(!1),kt.pixelStoreUnpack.set(1),kt.pixelStoreUnpackPremultiplyAlpha.set(this.format===Xt.RGBA&&(!oe||oe.premultiply!==!1)),_t)this.size=[Ce,Be],P instanceof HTMLImageElement||P instanceof HTMLCanvasElement||P instanceof HTMLVideoElement||P instanceof ImageData||t.b(P)?Xt.texImage2D(Xt.TEXTURE_2D,0,this.format,this.format,Xt.UNSIGNED_BYTE,P):Xt.texImage2D(Xt.TEXTURE_2D,0,this.format,Ce,Be,0,this.format,Xt.UNSIGNED_BYTE,P.data);else{const{x:fr,y:Ar}=Me||{x:0,y:0};P instanceof HTMLImageElement||P instanceof HTMLCanvasElement||P instanceof HTMLVideoElement||P instanceof ImageData||t.b(P)?Xt.texSubImage2D(Xt.TEXTURE_2D,0,fr,Ar,Xt.RGBA,Xt.UNSIGNED_BYTE,P):Xt.texSubImage2D(Xt.TEXTURE_2D,0,fr,Ar,Ce,Be,Xt.RGBA,Xt.UNSIGNED_BYTE,P.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Xt.generateMipmap(Xt.TEXTURE_2D)}bind(P,oe,Me){const{context:Ce}=this,{gl:Be}=Ce;Be.bindTexture(Be.TEXTURE_2D,this.texture),Me!==Be.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Me=Be.LINEAR),P!==this.filter&&(Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MAG_FILTER,P),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MIN_FILTER,Me||P),this.filter=P),oe!==this.wrap&&(Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_S,oe),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_T,oe),this.wrap=oe)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:P}=this.context;P.deleteTexture(this.texture),this.texture=null}}function d(Ue){const{userImage:P}=Ue;return!!(P&&P.render&&P.render())&&(Ue.data.replace(new Uint8Array(P.data.buffer)),!0)}class y extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(P){if(this.loaded!==P&&(this.loaded=P,P)){for(const{ids:oe,promiseResolve:Me}of this.requestors)Me(this._getImagesForIds(oe));this.requestors=[]}}getImage(P){const oe=this.images[P];if(oe&&!oe.data&&oe.spriteData){const Me=oe.spriteData;oe.data=new t.R({width:Me.width,height:Me.height},Me.context.getImageData(Me.x,Me.y,Me.width,Me.height).data),oe.spriteData=null}return oe}addImage(P,oe){if(this.images[P])throw new Error(`Image id ${P} already exist, use updateImage instead`);this._validate(P,oe)&&(this.images[P]=oe)}_validate(P,oe){let Me=!0;const Ce=oe.data||oe.spriteData;return this._validateStretch(oe.stretchX,Ce&&Ce.width)||(this.fire(new t.j(new Error(`Image "${P}" has invalid "stretchX" value`))),Me=!1),this._validateStretch(oe.stretchY,Ce&&Ce.height)||(this.fire(new t.j(new Error(`Image "${P}" has invalid "stretchY" value`))),Me=!1),this._validateContent(oe.content,oe)||(this.fire(new t.j(new Error(`Image "${P}" has invalid "content" value`))),Me=!1),Me}_validateStretch(P,oe){if(!P)return!0;let Me=0;for(const Ce of P){if(Ce[0]{let Ce=!0;if(!this.isLoaded())for(const Be of P)this.images[Be]||(Ce=!1);this.isLoaded()||Ce?oe(this._getImagesForIds(P)):this.requestors.push({ids:P,promiseResolve:oe})})}_getImagesForIds(P){const oe={};for(const Me of P){let Ce=this.getImage(Me);Ce||(this.fire(new t.k("styleimagemissing",{id:Me})),Ce=this.getImage(Me)),Ce?oe[Me]={data:Ce.data.clone(),pixelRatio:Ce.pixelRatio,sdf:Ce.sdf,version:Ce.version,stretchX:Ce.stretchX,stretchY:Ce.stretchY,content:Ce.content,textFitWidth:Ce.textFitWidth,textFitHeight:Ce.textFitHeight,hasRenderCallback:!!(Ce.userImage&&Ce.userImage.render)}:t.w(`Image "${Me}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return oe}getPixelSize(){const{width:P,height:oe}=this.atlasImage;return{width:P,height:oe}}getPattern(P){const oe=this.patterns[P],Me=this.getImage(P);if(!Me)return null;if(oe&&oe.position.version===Me.version)return oe.position;if(oe)oe.position.version=Me.version;else{const Ce={w:Me.data.width+2,h:Me.data.height+2,x:0,y:0},Be=new t.I(Ce,Me);this.patterns[P]={bin:Ce,position:Be}}return this._updatePatternAtlas(),this.patterns[P].position}bind(P){const oe=P.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u(P,this.atlasImage,oe.RGBA),this.atlasTexture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE)}_updatePatternAtlas(){const P=[];for(const Be in this.patterns)P.push(this.patterns[Be].bin);const{w:oe,h:Me}=t.p(P),Ce=this.atlasImage;Ce.resize({width:oe||1,height:Me||1});for(const Be in this.patterns){const{bin:_t}=this.patterns[Be],kt=_t.x+1,Xt=_t.y+1,fr=this.getImage(Be).data,Ar=fr.width,Lr=fr.height;t.R.copy(fr,Ce,{x:0,y:0},{x:kt,y:Xt},{width:Ar,height:Lr}),t.R.copy(fr,Ce,{x:0,y:Lr-1},{x:kt,y:Xt-1},{width:Ar,height:1}),t.R.copy(fr,Ce,{x:0,y:0},{x:kt,y:Xt+Lr},{width:Ar,height:1}),t.R.copy(fr,Ce,{x:Ar-1,y:0},{x:kt-1,y:Xt},{width:1,height:Lr}),t.R.copy(fr,Ce,{x:0,y:0},{x:kt+Ar,y:Xt},{width:1,height:Lr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(P){for(const oe of P){if(this.callbackDispatchedThisFrame[oe])continue;this.callbackDispatchedThisFrame[oe]=!0;const Me=this.getImage(oe);Me||t.w(`Image with ID: "${oe}" was not found`),d(Me)&&this.updateImage(oe,Me)}}}const I=1e20;function L(Ue,P,oe,Me,Ce,Be,_t,kt,Xt){for(let fr=P;fr-1);Xt++,Be[Xt]=kt,_t[Xt]=fr,_t[Xt+1]=I}for(let kt=0,Xt=0;kt65535)throw new Error("glyphs > 65535 not supported");if(Me.ranges[Be])return{stack:P,id:oe,glyph:Ce};if(!this.url)throw new Error("glyphsUrl is not set");if(!Me.requests[Be]){const kt=F.loadGlyphRange(P,Be,this.url,this.requestManager);Me.requests[Be]=kt}const _t=yield Me.requests[Be];for(const kt in _t)this._doesCharSupportLocalGlyph(+kt)||(Me.glyphs[+kt]=_t[+kt]);return Me.ranges[Be]=!0,{stack:P,id:oe,glyph:_t[oe]||null}})}_doesCharSupportLocalGlyph(P){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(P))}_tinySDF(P,oe,Me){const Ce=this.localIdeographFontFamily;if(!Ce||!this._doesCharSupportLocalGlyph(Me))return;let Be=P.tinySDF;if(!Be){let kt="400";/bold/i.test(oe)?kt="900":/medium/i.test(oe)?kt="500":/light/i.test(oe)&&(kt="200"),Be=P.tinySDF=new F.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Ce,fontWeight:kt})}const _t=Be.draw(String.fromCharCode(Me));return{id:Me,bitmap:new t.o({width:_t.width||60,height:_t.height||60},_t.data),metrics:{width:_t.glyphWidth/2||24,height:_t.glyphHeight/2||24,left:_t.glyphLeft/2+.5||0,top:_t.glyphTop/2-27.5||-8,advance:_t.glyphAdvance/2||24,isDoubleResolution:!0}}}}F.loadGlyphRange=function(Ue,P,oe,Me){return t._(this,void 0,void 0,function*(){const Ce=256*P,Be=Ce+255,_t=Me.transformRequest(oe.replace("{fontstack}",Ue).replace("{range}",`${Ce}-${Be}`),"Glyphs"),kt=yield t.l(_t,new AbortController);if(!kt||!kt.data)throw new Error(`Could not load glyph range. range: ${P}, ${Ce}-${Be}`);const Xt={};for(const fr of t.n(kt.data))Xt[fr.id]=fr;return Xt})},F.TinySDF=class{constructor({fontSize:Ue=24,buffer:P=3,radius:oe=8,cutoff:Me=.25,fontFamily:Ce="sans-serif",fontWeight:Be="normal",fontStyle:_t="normal"}={}){this.buffer=P,this.cutoff=Me,this.radius=oe;const kt=this.size=Ue+4*P,Xt=this._createCanvas(kt),fr=this.ctx=Xt.getContext("2d",{willReadFrequently:!0});fr.font=`${_t} ${Be} ${Ue}px ${Ce}`,fr.textBaseline="alphabetic",fr.textAlign="left",fr.fillStyle="black",this.gridOuter=new Float64Array(kt*kt),this.gridInner=new Float64Array(kt*kt),this.f=new Float64Array(kt),this.z=new Float64Array(kt+1),this.v=new Uint16Array(kt)}_createCanvas(Ue){const P=document.createElement("canvas");return P.width=P.height=Ue,P}draw(Ue){const{width:P,actualBoundingBoxAscent:oe,actualBoundingBoxDescent:Me,actualBoundingBoxLeft:Ce,actualBoundingBoxRight:Be}=this.ctx.measureText(Ue),_t=Math.ceil(oe),kt=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Be-Ce))),Xt=Math.min(this.size-this.buffer,_t+Math.ceil(Me)),fr=kt+2*this.buffer,Ar=Xt+2*this.buffer,Lr=Math.max(fr*Ar,0),tn=new Uint8ClampedArray(Lr),xn={data:tn,width:fr,height:Ar,glyphWidth:kt,glyphHeight:Xt,glyphTop:_t,glyphLeft:0,glyphAdvance:P};if(kt===0||Xt===0)return xn;const{ctx:Ze,buffer:tt,gridInner:vt,gridOuter:bt}=this;Ze.clearRect(tt,tt,kt,Xt),Ze.fillText(Ue,tt,tt+_t);const zt=Ze.getImageData(tt,tt,kt,Xt);bt.fill(I,0,Lr),vt.fill(0,0,Lr);for(let Et=0;Et0?Pr*Pr:0,vt[Tr]=Pr<0?Pr*Pr:0}}L(bt,0,0,fr,Ar,fr,this.f,this.v,this.z),L(vt,tt,tt,kt,Xt,fr,this.f,this.v,this.z);for(let Et=0;Et1&&(Xt=P[++kt]);const Ar=Math.abs(fr-Xt.left),Lr=Math.abs(fr-Xt.right),tn=Math.min(Ar,Lr);let xn;const Ze=Be/Me*(Ce+1);if(Xt.isDash){const tt=Ce-Math.abs(Ze);xn=Math.sqrt(tn*tn+tt*tt)}else xn=Ce-Math.sqrt(tn*tn+Ze*Ze);this.data[_t+fr]=Math.max(0,Math.min(255,xn+128))}}}addRegularDash(P){for(let kt=P.length-1;kt>=0;--kt){const Xt=P[kt],fr=P[kt+1];Xt.zeroLength?P.splice(kt,1):fr&&fr.isDash===Xt.isDash&&(fr.left=Xt.left,P.splice(kt,1))}const oe=P[0],Me=P[P.length-1];oe.isDash===Me.isDash&&(oe.left=Me.left-this.width,Me.right=oe.right+this.width);const Ce=this.width*this.nextRow;let Be=0,_t=P[Be];for(let kt=0;kt1&&(_t=P[++Be]);const Xt=Math.abs(kt-_t.left),fr=Math.abs(kt-_t.right),Ar=Math.min(Xt,fr);this.data[Ce+kt]=Math.max(0,Math.min(255,(_t.isDash?Ar:-Ar)+128))}}addDash(P,oe){const Me=oe?7:0,Ce=2*Me+1;if(this.nextRow+Ce>this.height)return t.w("LineAtlas out of space"),null;let Be=0;for(let kt=0;kt{oe.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[re]}numActive(){return Object.keys(this.active).length}}const le=Math.floor(i.hardwareConcurrency/2);let ce,V;function ee(){return ce||(ce=new fe),ce}fe.workerCount=t.C(globalThis)?Math.max(Math.min(le,3),1):1;class ne{constructor(P,oe){this.workerPool=P,this.actors=[],this.currentActor=0,this.id=oe;const Me=this.workerPool.acquire(oe);for(let Ce=0;Ce{oe.remove()}),this.actors=[],P&&this.workerPool.release(this.id)}registerMessageHandler(P,oe){for(const Me of this.actors)Me.registerMessageHandler(P,oe)}}function $(){return V||(V=new ne(ee(),t.G),V.registerMessageHandler("GR",(Ue,P,oe)=>t.m(P,oe))),V}function ue(Ue,P){const oe=t.H();return t.J(oe,oe,[1,1,0]),t.K(oe,oe,[.5*Ue.width,.5*Ue.height,1]),t.L(oe,oe,Ue.calculatePosMatrix(P.toUnwrapped()))}function te(Ue,P,oe,Me,Ce,Be){const _t=(function(Lr,tn,xn){if(Lr)for(const Ze of Lr){const tt=tn[Ze];if(tt&&tt.source===xn&&tt.type==="fill-extrusion")return!0}else for(const Ze in tn){const tt=tn[Ze];if(tt.source===xn&&tt.type==="fill-extrusion")return!0}return!1})(Ce&&Ce.layers,P,Ue.id),kt=Be.maxPitchScaleFactor(),Xt=Ue.tilesIn(Me,kt,_t);Xt.sort(H);const fr=[];for(const Lr of Xt)fr.push({wrappedTileID:Lr.tileID.wrapped().key,queryResults:Lr.tile.queryRenderedFeatures(P,oe,Ue._state,Lr.queryGeometry,Lr.cameraQueryGeometry,Lr.scale,Ce,Be,kt,ue(Ue.transform,Lr.tileID))});const Ar=(function(Lr){const tn={},xn={};for(const Ze of Lr){const tt=Ze.queryResults,vt=Ze.wrappedTileID,bt=xn[vt]=xn[vt]||{};for(const zt in tt){const Et=tt[zt],Ut=bt[zt]=bt[zt]||{},gr=tn[zt]=tn[zt]||[];for(const Tr of Et)Ut[Tr.featureIndex]||(Ut[Tr.featureIndex]=!0,gr.push(Tr))}}return tn})(fr);for(const Lr in Ar)Ar[Lr].forEach(tn=>{const xn=tn.feature,Ze=Ue.getFeatureState(xn.layer["source-layer"],xn.id);xn.source=xn.layer.source,xn.layer["source-layer"]&&(xn.sourceLayer=xn.layer["source-layer"]),xn.state=Ze});return Ar}function H(Ue,P){const oe=Ue.tileID,Me=P.tileID;return oe.overscaledZ-Me.overscaledZ||oe.canonical.y-Me.canonical.y||oe.wrap-Me.wrap||oe.canonical.x-Me.canonical.x}function ae(Ue,P,oe){return t._(this,void 0,void 0,function*(){let Me=Ue;if(Ue.url?Me=(yield t.h(P.transformRequest(Ue.url,"Source"),oe)).data:yield i.frameAsync(oe),!Me)return null;const Ce=t.M(t.e(Me,Ue),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Me&&Me.vector_layers&&(Ce.vectorLayerIds=Me.vector_layers.map(Be=>Be.id)),Ce})}class ie{constructor(P,oe){P&&(oe?this.setSouthWest(P).setNorthEast(oe):Array.isArray(P)&&(P.length===4?this.setSouthWest([P[0],P[1]]).setNorthEast([P[2],P[3]]):this.setSouthWest(P[0]).setNorthEast(P[1])))}setNorthEast(P){return this._ne=P instanceof t.N?new t.N(P.lng,P.lat):t.N.convert(P),this}setSouthWest(P){return this._sw=P instanceof t.N?new t.N(P.lng,P.lat):t.N.convert(P),this}extend(P){const oe=this._sw,Me=this._ne;let Ce,Be;if(P instanceof t.N)Ce=P,Be=P;else{if(!(P instanceof ie))return Array.isArray(P)?P.length===4||P.every(Array.isArray)?this.extend(ie.convert(P)):this.extend(t.N.convert(P)):P&&("lng"in P||"lon"in P)&&"lat"in P?this.extend(t.N.convert(P)):this;if(Ce=P._sw,Be=P._ne,!Ce||!Be)return this}return oe||Me?(oe.lng=Math.min(Ce.lng,oe.lng),oe.lat=Math.min(Ce.lat,oe.lat),Me.lng=Math.max(Be.lng,Me.lng),Me.lat=Math.max(Be.lat,Me.lat)):(this._sw=new t.N(Ce.lng,Ce.lat),this._ne=new t.N(Be.lng,Be.lat)),this}getCenter(){return new t.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(P){const{lng:oe,lat:Me}=t.N.convert(P);let Ce=this._sw.lng<=oe&&oe<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ce=this._sw.lng>=oe&&oe>=this._ne.lng),this._sw.lat<=Me&&Me<=this._ne.lat&&Ce}static convert(P){return P instanceof ie?P:P&&new ie(P)}static fromLngLat(P,oe=0){const Me=360*oe/40075017,Ce=Me/Math.cos(Math.PI/180*P.lat);return new ie(new t.N(P.lng-Ce,P.lat-Me),new t.N(P.lng+Ce,P.lat+Me))}adjustAntiMeridian(){const P=new t.N(this._sw.lng,this._sw.lat),oe=new t.N(this._ne.lng,this._ne.lat);return new ie(P,P.lng>oe.lng?new t.N(oe.lng+360,oe.lat):oe)}}class de{constructor(P,oe,Me){this.bounds=ie.convert(this.validateBounds(P)),this.minzoom=oe||0,this.maxzoom=Me||24}validateBounds(P){return Array.isArray(P)&&P.length===4?[Math.max(-180,P[0]),Math.max(-90,P[1]),Math.min(180,P[2]),Math.min(90,P[3])]:[-180,-90,180,90]}contains(P){const oe=Math.pow(2,P.z),Me=Math.floor(t.O(this.bounds.getWest())*oe),Ce=Math.floor(t.Q(this.bounds.getNorth())*oe),Be=Math.ceil(t.O(this.bounds.getEast())*oe),_t=Math.ceil(t.Q(this.bounds.getSouth())*oe);return P.x>=Me&&P.x=Ce&&P.y<_t}}class Se extends t.E{constructor(P,oe,Me,Ce){if(super(),this.id=P,this.dispatcher=Me,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.e(this,t.M(oe,["url","scheme","tileSize","promoteId"])),this._options=t.e({type:"vector"},oe),this._collectResourceTiming=oe.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(Ce)}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const P=yield ae(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),P&&(t.e(this,P),P.bounds&&(this.tileBounds=new de(P.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(P){this._tileJSONRequest=null,this.fire(new t.j(P))}})}loaded(){return this._loaded}hasTile(P){return!this.tileBounds||this.tileBounds.contains(P.canonical)}onAdd(P){this.map=P,this.load()}setSourceProperty(P){this._tileJSONRequest&&this._tileJSONRequest.abort(),P(),this.load()}setTiles(P){return this.setSourceProperty(()=>{this._options.tiles=P}),this}setUrl(P){return this.setSourceProperty(()=>{this.url=P,this._options.url=P}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Me={request:this.map._requestManager.transformRequest(oe,"Tile"),uid:P.uid,tileID:P.tileID,zoom:P.tileID.overscaledZ,tileSize:this.tileSize*P.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Me.request.collectResourceTiming=this._collectResourceTiming;let Ce="RT";if(P.actor&&P.state!=="expired"){if(P.state==="loading")return new Promise((Be,_t)=>{P.reloadPromise={resolve:Be,reject:_t}})}else P.actor=this.dispatcher.getActor(),Ce="LT";P.abortController=new AbortController;try{const Be=yield P.actor.sendAsync({type:Ce,data:Me},P.abortController);if(delete P.abortController,P.aborted)return;this._afterTileLoadWorkerResponse(P,Be)}catch(Be){if(delete P.abortController,P.aborted)return;if(Be&&Be.status!==404)throw Be;this._afterTileLoadWorkerResponse(P,null)}})}_afterTileLoadWorkerResponse(P,oe){if(oe&&oe.resourceTiming&&(P.resourceTiming=oe.resourceTiming),oe&&this.map._refreshExpiredTiles&&P.setExpiryData(oe),P.loadVectorData(oe,this.map.painter),P.reloadPromise){const Me=P.reloadPromise;P.reloadPromise=null,this.loadTile(P).then(Me.resolve).catch(Me.reject)}}abortTile(P){return t._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController),P.actor&&(yield P.actor.sendAsync({type:"AT",data:{uid:P.uid,type:this.type,source:this.id}}))})}unloadTile(P){return t._(this,void 0,void 0,function*(){P.unloadVectorData(),P.actor&&(yield P.actor.sendAsync({type:"RMT",data:{uid:P.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Le extends t.E{constructor(P,oe,Me,Ce){super(),this.id=P,this.dispatcher=Me,this.setEventedParent(Ce),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.e({type:"raster"},oe),t.e(this,t.M(oe,["url","scheme","tileSize"]))}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const P=yield ae(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,P&&(t.e(this,P),P.bounds&&(this.tileBounds=new de(P.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(P){this._tileJSONRequest=null,this.fire(new t.j(P))}})}loaded(){return this._loaded}onAdd(P){this.map=P,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(P){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),P(),this.load()}setTiles(P){return this.setSourceProperty(()=>{this._options.tiles=P}),this}setUrl(P){return this.setSourceProperty(()=>{this.url=P,this._options.url=P}),this}serialize(){return t.e({},this._options)}hasTile(P){return!this.tileBounds||this.tileBounds.contains(P.canonical)}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);P.abortController=new AbortController;try{const Me=yield l.getImage(this.map._requestManager.transformRequest(oe,"Tile"),P.abortController,this.map._refreshExpiredTiles);if(delete P.abortController,P.aborted)return void(P.state="unloaded");if(Me&&Me.data){this.map._refreshExpiredTiles&&Me.cacheControl&&Me.expires&&P.setExpiryData({cacheControl:Me.cacheControl,expires:Me.expires});const Ce=this.map.painter.context,Be=Ce.gl,_t=Me.data;P.texture=this.map.painter.getTileTexture(_t.width),P.texture?P.texture.update(_t,{useMipmap:!0}):(P.texture=new u(Ce,_t,Be.RGBA,{useMipmap:!0}),P.texture.bind(Be.LINEAR,Be.CLAMP_TO_EDGE,Be.LINEAR_MIPMAP_NEAREST)),P.state="loaded"}}catch(Me){if(delete P.abortController,P.aborted)P.state="unloaded";else if(Me)throw P.state="errored",Me}})}abortTile(P){return t._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController)})}unloadTile(P){return t._(this,void 0,void 0,function*(){P.texture&&this.map.painter.saveTileTexture(P.texture)})}hasTransition(){return!1}}class Fe extends Le{constructor(P,oe,Me,Ce){super(P,oe,Me,Ce),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},oe),this.encoding=oe.encoding||"mapbox",this.redFactor=oe.redFactor,this.greenFactor=oe.greenFactor,this.blueFactor=oe.blueFactor,this.baseShift=oe.baseShift}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Me=this.map._requestManager.transformRequest(oe,"Tile");P.neighboringTiles=this._getNeighboringTiles(P.tileID),P.abortController=new AbortController;try{const Ce=yield l.getImage(Me,P.abortController,this.map._refreshExpiredTiles);if(delete P.abortController,P.aborted)return void(P.state="unloaded");if(Ce&&Ce.data){const Be=Ce.data;this.map._refreshExpiredTiles&&Ce.cacheControl&&Ce.expires&&P.setExpiryData({cacheControl:Ce.cacheControl,expires:Ce.expires});const _t=t.b(Be)&&t.U()?Be:yield this.readImageNow(Be),kt={type:this.type,uid:P.uid,source:this.id,rawImageData:_t,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!P.actor||P.state==="expired"){P.actor=this.dispatcher.getActor();const Xt=yield P.actor.sendAsync({type:"LDT",data:kt});P.dem=Xt,P.needsHillshadePrepare=!0,P.needsTerrainPrepare=!0,P.state="loaded"}}}catch(Ce){if(delete P.abortController,P.aborted)P.state="unloaded";else if(Ce)throw P.state="errored",Ce}})}readImageNow(P){return t._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&t.V()){const oe=P.width+2,Me=P.height+2;try{return new t.R({width:oe,height:Me},yield t.W(P,-1,-1,oe,Me))}catch{}}return i.getImageData(P,1)})}_getNeighboringTiles(P){const oe=P.canonical,Me=Math.pow(2,oe.z),Ce=(oe.x-1+Me)%Me,Be=oe.x===0?P.wrap-1:P.wrap,_t=(oe.x+1+Me)%Me,kt=oe.x+1===Me?P.wrap+1:P.wrap,Xt={};return Xt[new t.S(P.overscaledZ,Be,oe.z,Ce,oe.y).key]={backfilled:!1},Xt[new t.S(P.overscaledZ,kt,oe.z,_t,oe.y).key]={backfilled:!1},oe.y>0&&(Xt[new t.S(P.overscaledZ,Be,oe.z,Ce,oe.y-1).key]={backfilled:!1},Xt[new t.S(P.overscaledZ,P.wrap,oe.z,oe.x,oe.y-1).key]={backfilled:!1},Xt[new t.S(P.overscaledZ,kt,oe.z,_t,oe.y-1).key]={backfilled:!1}),oe.y+10&&t.e(Be,{resourceTiming:Ce}),this.fire(new t.k("data",Object.assign(Object.assign({},Be),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},Be),{sourceDataType:"content"})))}catch(Me){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(Me))}})}loaded(){return this._pendingLoads===0}loadTile(P){return t._(this,void 0,void 0,function*(){const oe=P.actor?"RT":"LT";P.actor=this.actor;const Me={type:this.type,uid:P.uid,tileID:P.tileID,zoom:P.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};P.abortController=new AbortController;const Ce=yield this.actor.sendAsync({type:oe,data:Me},P.abortController);delete P.abortController,P.unloadVectorData(),P.aborted||P.loadVectorData(Ce,this.map.painter,oe==="RT")})}abortTile(P){return t._(this,void 0,void 0,function*(){P.abortController&&(P.abortController.abort(),delete P.abortController),P.aborted=!0})}unloadTile(P){return t._(this,void 0,void 0,function*(){P.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:P.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Ye=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class st extends t.E{constructor(P,oe,Me,Ce){super(),this.id=P,this.dispatcher=Me,this.coordinates=oe.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ce),this.options=oe}load(P){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const oe=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,oe&&oe.data&&(this.image=oe.data,P&&(this.coordinates=P),this._finishLoading())}catch(oe){this._request=null,this._loaded=!0,this.fire(new t.j(oe))}})}loaded(){return this._loaded}updateImage(P){return P.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=P.url,this.load(P.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(P){this.map=P,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(P){this.coordinates=P;const oe=P.map(t.Z.fromLngLat);this.tileID=(function(Ce){let Be=1/0,_t=1/0,kt=-1/0,Xt=-1/0;for(const tn of Ce)Be=Math.min(Be,tn.x),_t=Math.min(_t,tn.y),kt=Math.max(kt,tn.x),Xt=Math.max(Xt,tn.y);const fr=Math.max(kt-Be,Xt-_t),Ar=Math.max(0,Math.floor(-Math.log(fr)/Math.LN2)),Lr=Math.pow(2,Ar);return new t.a1(Ar,Math.floor((Be+kt)/2*Lr),Math.floor((_t+Xt)/2*Lr))})(oe),this.minzoom=this.maxzoom=this.tileID.z;const Me=oe.map(Ce=>this.tileID.getTilePoint(Ce)._round());return this._boundsArray=new t.$,this._boundsArray.emplaceBack(Me[0].x,Me[0].y,0,0),this._boundsArray.emplaceBack(Me[1].x,Me[1].y,t.X,0),this._boundsArray.emplaceBack(Me[3].x,Me[3].y,0,t.X),this._boundsArray.emplaceBack(Me[2].x,Me[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const P=this.map.painter.context,oe=P.gl;this.boundsBuffer||(this.boundsBuffer=P.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u(P,this.image,oe.RGBA),this.texture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE));let Me=!1;for(const Ce in this.tiles){const Be=this.tiles[Ce];Be.state!=="loaded"&&(Be.state="loaded",Be.texture=this.texture,Me=!0)}Me&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(P){return t._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(P.tileID.canonical)?(this.tiles[String(P.tileID.wrap)]=P,P.buckets={}):P.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ct extends st{constructor(P,oe,Me,Ce){super(P,oe,Me,Ce),this.roundZoom=!0,this.type="video",this.options=oe}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1;const P=this.options;this.urls=[];for(const oe of P.urls)this.urls.push(this.map._requestManager.transformRequest(oe,"Source").url);try{const oe=yield t.a3(this.urls);if(this._loaded=!0,!oe)return;this.video=oe,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(oe){this.fire(new t.j(oe))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(P){if(this.video){const oe=this.video.seekable;Poe.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${oe.start(0)} and ${oe.end(0)}-second mark.`))):this.video.currentTime=P}}getVideo(){return this.video}onAdd(P){this.map||(this.map=P,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const P=this.map.painter.context,oe=P.gl;this.boundsBuffer||(this.boundsBuffer=P.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE),oe.texSubImage2D(oe.TEXTURE_2D,0,0,0,oe.RGBA,oe.UNSIGNED_BYTE,this.video)):(this.texture=new u(P,this.video,oe.RGBA),this.texture.bind(oe.LINEAR,oe.CLAMP_TO_EDGE));let Me=!1;for(const Ce in this.tiles){const Be=this.tiles[Ce];Be.state!=="loaded"&&(Be.state="loaded",Be.texture=this.texture,Me=!0)}Me&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class at extends st{constructor(P,oe,Me,Ce){super(P,oe,Me,Ce),oe.coordinates?Array.isArray(oe.coordinates)&&oe.coordinates.length===4&&!oe.coordinates.some(Be=>!Array.isArray(Be)||Be.length!==2||Be.some(_t=>typeof _t!="number"))||this.fire(new t.j(new t.a2(`sources.${P}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${P}`,null,'missing required property "coordinates"'))),oe.animate&&typeof oe.animate!="boolean"&&this.fire(new t.j(new t.a2(`sources.${P}`,null,'optional "animate" property must be a boolean value'))),oe.canvas?typeof oe.canvas=="string"||oe.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${P}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.j(new t.a2(`sources.${P}`,null,'missing required property "canvas"'))),this.options=oe,this.animate=oe.animate===void 0||oe.animate}load(){return t._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(P){this.map=P,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let P=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,P=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,P=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const oe=this.map.painter.context,Me=oe.gl;this.boundsBuffer||(this.boundsBuffer=oe.createVertexBuffer(this._boundsArray,Ye.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(P||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u(oe,this.canvas,Me.RGBA,{premultiply:!0});let Ce=!1;for(const Be in this.tiles){const _t=this.tiles[Be];_t.state!=="loaded"&&(_t.state="loaded",_t.texture=this.texture,Ce=!0)}Ce&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const P of[this.canvas.width,this.canvas.height])if(isNaN(P)||P<=0)return!0;return!1}}const et={},Pe=Ue=>{switch(Ue){case"geojson":return ze;case"image":return st;case"raster":return Le;case"raster-dem":return Fe;case"vector":return Se;case"video":return ct;case"canvas":return at}return et[Ue]},Ae="RTLPluginLoaded";class pe extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=$()}_syncState(P){return this.status=P,this.dispatcher.broadcast("SRPS",{pluginStatus:P,pluginURL:this.url}).catch(oe=>{throw this.status="error",oe})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(P){return t._(this,arguments,void 0,function*(oe,Me=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=i.resolveURL(oe),!this.url)throw new Error(`requested url ${oe} is invalid`);if(this.status==="unavailable"){if(!Me)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return t._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.k(Ae))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Ne=null;function ut(){return Ne||(Ne=new pe),Ne}class dt{constructor(P,oe){this.timeAdded=0,this.fadeEndTime=0,this.tileID=P,this.uid=t.a4(),this.uses=0,this.tileSize=oe,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(P){const oe=P+this.timeAdded;oeBe.getLayer(fr)).filter(Boolean);if(Xt.length!==0){kt.layers=Xt,kt.stateDependentLayerIds&&(kt.stateDependentLayers=kt.stateDependentLayerIds.map(fr=>Xt.filter(Ar=>Ar.id===fr)[0]));for(const fr of Xt)_t[fr.id]=kt}}return _t})(P.buckets,oe.style),this.hasSymbolBuckets=!1;for(const Ce in this.buckets){const Be=this.buckets[Ce];if(Be instanceof t.a6){if(this.hasSymbolBuckets=!0,!Me)break;Be.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const Ce in this.buckets){const Be=this.buckets[Ce];if(Be instanceof t.a6&&Be.hasRTLText){this.hasRTLText=!0,ut().lazyLoad();break}}this.queryPadding=0;for(const Ce in this.buckets){const Be=this.buckets[Ce];this.queryPadding=Math.max(this.queryPadding,oe.style.getLayer(Ce).queryRadius(Be))}P.imageAtlas&&(this.imageAtlas=P.imageAtlas),P.glyphAtlasImage&&(this.glyphAtlasImage=P.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(const P in this.buckets)this.buckets[P].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(P){return this.buckets[P.id]}upload(P){for(const Me in this.buckets){const Ce=this.buckets[Me];Ce.uploadPending()&&Ce.upload(P)}const oe=P.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u(P,this.imageAtlas.image,oe.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u(P,this.glyphAtlasImage,oe.ALPHA),this.glyphAtlasImage=null)}prepare(P){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(P,this.imageAtlasTexture)}queryRenderedFeatures(P,oe,Me,Ce,Be,_t,kt,Xt,fr,Ar){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Ce,cameraQueryGeometry:Be,scale:_t,tileSize:this.tileSize,pixelPosMatrix:Ar,transform:Xt,params:kt,queryPadding:this.queryPadding*fr},P,oe,Me):{}}querySourceFeatures(P,oe){const Me=this.latestFeatureIndex;if(!Me||!Me.rawTileData)return;const Ce=Me.loadVTLayers(),Be=oe&&oe.sourceLayer?oe.sourceLayer:"",_t=Ce._geojsonTileLayer||Ce[Be];if(!_t)return;const kt=t.a7(oe&&oe.filter),{z:Xt,x:fr,y:Ar}=this.tileID.canonical,Lr={z:Xt,x:fr,y:Ar};for(let tn=0;tn<_t.length;tn++){const xn=_t.feature(tn);if(kt.needGeometry){const vt=t.a8(xn,!0);if(!kt.filter(new t.z(this.tileID.overscaledZ),vt,this.tileID.canonical))continue}else if(!kt.filter(new t.z(this.tileID.overscaledZ),xn))continue;const Ze=Me.getId(xn,Be),tt=new t.a9(xn,Xt,fr,Ar,Ze);tt.tile=Lr,P.push(tt)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(P){const oe=this.expirationTime;if(P.cacheControl){const Me=t.aa(P.cacheControl);Me["max-age"]&&(this.expirationTime=Date.now()+1e3*Me["max-age"])}else P.expires&&(this.expirationTime=new Date(P.expires).getTime());if(this.expirationTime){const Me=Date.now();let Ce=!1;if(this.expirationTime>Me)Ce=!1;else if(oe)if(this.expirationTime{this.remove(P,Be)},Me)),this.data[Ce].push(Be),this.order.push(Ce),this.order.length>this.max){const _t=this._getAndRemoveByKey(this.order[0]);_t&&this.onRemove(_t)}return this}has(P){return P.wrapped().key in this.data}getAndRemove(P){return this.has(P)?this._getAndRemoveByKey(P.wrapped().key):null}_getAndRemoveByKey(P){const oe=this.data[P].shift();return oe.timeout&&clearTimeout(oe.timeout),this.data[P].length===0&&delete this.data[P],this.order.splice(this.order.indexOf(P),1),oe.value}getByKey(P){const oe=this.data[P];return oe?oe[0].value:null}get(P){return this.has(P)?this.data[P.wrapped().key][0].value:null}remove(P,oe){if(!this.has(P))return this;const Me=P.wrapped().key,Ce=oe===void 0?0:this.data[Me].indexOf(oe),Be=this.data[Me][Ce];return this.data[Me].splice(Ce,1),Be.timeout&&clearTimeout(Be.timeout),this.data[Me].length===0&&delete this.data[Me],this.onRemove(Be.value),this.order.splice(this.order.indexOf(Me),1),this}setMaxSize(P){for(this.max=P;this.order.length>this.max;){const oe=this._getAndRemoveByKey(this.order[0]);oe&&this.onRemove(oe)}return this}filter(P){const oe=[];for(const Me in this.data)for(const Ce of this.data[Me])P(Ce.value)||oe.push(Ce);for(const Me of oe)this.remove(Me.value.tileID,Me)}}class Ft{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(P,oe,Me){const Ce=String(oe);if(this.stateChanges[P]=this.stateChanges[P]||{},this.stateChanges[P][Ce]=this.stateChanges[P][Ce]||{},t.e(this.stateChanges[P][Ce],Me),this.deletedStates[P]===null){this.deletedStates[P]={};for(const Be in this.state[P])Be!==Ce&&(this.deletedStates[P][Be]=null)}else if(this.deletedStates[P]&&this.deletedStates[P][Ce]===null){this.deletedStates[P][Ce]={};for(const Be in this.state[P][Ce])Me[Be]||(this.deletedStates[P][Ce][Be]=null)}else for(const Be in Me)this.deletedStates[P]&&this.deletedStates[P][Ce]&&this.deletedStates[P][Ce][Be]===null&&delete this.deletedStates[P][Ce][Be]}removeFeatureState(P,oe,Me){if(this.deletedStates[P]===null)return;const Ce=String(oe);if(this.deletedStates[P]=this.deletedStates[P]||{},Me&&oe!==void 0)this.deletedStates[P][Ce]!==null&&(this.deletedStates[P][Ce]=this.deletedStates[P][Ce]||{},this.deletedStates[P][Ce][Me]=null);else if(oe!==void 0)if(this.stateChanges[P]&&this.stateChanges[P][Ce])for(Me in this.deletedStates[P][Ce]={},this.stateChanges[P][Ce])this.deletedStates[P][Ce][Me]=null;else this.deletedStates[P][Ce]=null;else this.deletedStates[P]=null}getState(P,oe){const Me=String(oe),Ce=t.e({},(this.state[P]||{})[Me],(this.stateChanges[P]||{})[Me]);if(this.deletedStates[P]===null)return{};if(this.deletedStates[P]){const Be=this.deletedStates[P][oe];if(Be===null)return{};for(const _t in Be)delete Ce[_t]}return Ce}initializeTileState(P,oe){P.setFeatureState(this.state,oe)}coalesceChanges(P,oe){const Me={};for(const Ce in this.stateChanges){this.state[Ce]=this.state[Ce]||{};const Be={};for(const _t in this.stateChanges[Ce])this.state[Ce][_t]||(this.state[Ce][_t]={}),t.e(this.state[Ce][_t],this.stateChanges[Ce][_t]),Be[_t]=this.state[Ce][_t];Me[Ce]=Be}for(const Ce in this.deletedStates){this.state[Ce]=this.state[Ce]||{};const Be={};if(this.deletedStates[Ce]===null)for(const _t in this.state[Ce])Be[_t]={},this.state[Ce][_t]={};else for(const _t in this.deletedStates[Ce]){if(this.deletedStates[Ce][_t]===null)this.state[Ce][_t]={};else for(const kt of Object.keys(this.deletedStates[Ce][_t]))delete this.state[Ce][_t][kt];Be[_t]=this.state[Ce][_t]}Me[Ce]=Me[Ce]||{},t.e(Me[Ce],Be)}if(this.stateChanges={},this.deletedStates={},Object.keys(Me).length!==0)for(const Ce in P)P[Ce].setFeatureState(Me,oe)}}class Nt extends t.E{constructor(P,oe,Me){super(),this.id=P,this.dispatcher=Me,this.on("data",Ce=>this._dataHandler(Ce)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Ce,Be,_t,kt)=>{const Xt=new(Pe(Be.type))(Ce,Be,_t,kt);if(Xt.id!==Ce)throw new Error(`Expected Source id to be ${Ce} instead of ${Xt.id}`);return Xt})(P,oe,Me,this),this._tiles={},this._cache=new nt(0,Ce=>this._unloadTile(Ce)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ft,this._didEmitContent=!1,this._updated=!1}onAdd(P){this.map=P,this._maxTileCacheSize=P?P._maxTileCacheSize:null,this._maxTileCacheZoomLevels=P?P._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(P)}onRemove(P){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(P)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const P in this._tiles){const oe=this._tiles[P];if(oe.state!=="loaded"&&oe.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const P=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,P&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(P,oe,Me){return t._(this,void 0,void 0,function*(){try{yield this._source.loadTile(P),this._tileLoaded(P,oe,Me)}catch(Ce){P.state="errored",Ce.status!==404?this._source.fire(new t.j(Ce,{tile:P})):this.update(this.transform,this.terrain)}})}_unloadTile(P){this._source.unloadTile&&this._source.unloadTile(P)}_abortTile(P){this._source.abortTile&&this._source.abortTile(P),this._source.fire(new t.k("dataabort",{tile:P,coord:P.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(P){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const oe in this._tiles){const Me=this._tiles[oe];Me.upload(P),Me.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(P=>P.tileID).sort(Qt).map(P=>P.key)}getRenderableIds(P){const oe=[];for(const Me in this._tiles)this._isIdRenderable(Me,P)&&oe.push(this._tiles[Me]);return P?oe.sort((Me,Ce)=>{const Be=Me.tileID,_t=Ce.tileID,kt=new t.P(Be.canonical.x,Be.canonical.y)._rotate(this.transform.angle),Xt=new t.P(_t.canonical.x,_t.canonical.y)._rotate(this.transform.angle);return Be.overscaledZ-_t.overscaledZ||Xt.y-kt.y||Xt.x-kt.x}).map(Me=>Me.tileID.key):oe.map(Me=>Me.tileID).sort(Qt).map(Me=>Me.key)}hasRenderableParent(P){const oe=this.findLoadedParent(P,0);return!!oe&&this._isIdRenderable(oe.tileID.key)}_isIdRenderable(P,oe){return this._tiles[P]&&this._tiles[P].hasData()&&!this._coveredTiles[P]&&(oe||!this._tiles[P].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const P in this._tiles)this._tiles[P].state!=="errored"&&this._reloadTile(P,"reloading")}}_reloadTile(P,oe){return t._(this,void 0,void 0,function*(){const Me=this._tiles[P];Me&&(Me.state!=="loading"&&(Me.state=oe),yield this._loadTile(Me,P,oe))})}_tileLoaded(P,oe,Me){P.timeAdded=i.now(),Me==="expired"&&(P.refreshedUponExpiration=!0),this._setTileReloadTimer(oe,P),this.getSource().type==="raster-dem"&&P.dem&&this._backfillDEM(P),this._state.initializeTileState(P,this.map?this.map.painter:null),P.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:P,coord:P.tileID}))}_backfillDEM(P){const oe=this.getRenderableIds();for(let Ce=0;Ce1||(Math.abs(_t)>1&&(Math.abs(_t+Xt)===1?_t+=Xt:Math.abs(_t-Xt)===1&&(_t-=Xt)),Be.dem&&Ce.dem&&(Ce.dem.backfillBorder(Be.dem,_t,kt),Ce.neighboringTiles&&Ce.neighboringTiles[fr]&&(Ce.neighboringTiles[fr].backfilled=!0)))}}getTile(P){return this.getTileByID(P.key)}getTileByID(P){return this._tiles[P]}_retainLoadedChildren(P,oe,Me,Ce){for(const Be in this._tiles){let _t=this._tiles[Be];if(Ce[Be]||!_t.hasData()||_t.tileID.overscaledZ<=oe||_t.tileID.overscaledZ>Me)continue;let kt=_t.tileID;for(;_t&&_t.tileID.overscaledZ>oe+1;){const fr=_t.tileID.scaledTo(_t.tileID.overscaledZ-1);_t=this._tiles[fr.key],_t&&_t.hasData()&&(kt=fr)}let Xt=kt;for(;Xt.overscaledZ>oe;)if(Xt=Xt.scaledTo(Xt.overscaledZ-1),P[Xt.key]){Ce[kt.key]=kt;break}}}findLoadedParent(P,oe){if(P.key in this._loadedParentTiles){const Me=this._loadedParentTiles[P.key];return Me&&Me.tileID.overscaledZ>=oe?Me:null}for(let Me=P.overscaledZ-1;Me>=oe;Me--){const Ce=P.scaledTo(Me),Be=this._getLoadedTile(Ce);if(Be)return Be}}findLoadedSibling(P){return this._getLoadedTile(P)}_getLoadedTile(P){const oe=this._tiles[P.key];return oe&&oe.hasData()?oe:this._cache.getByKey(P.wrapped().key)}updateCacheSize(P){const oe=Math.ceil(P.width/this._source.tileSize)+1,Me=Math.ceil(P.height/this._source.tileSize)+1,Ce=Math.floor(oe*Me*(this._maxTileCacheZoomLevels===null?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Be=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Ce):Ce;this._cache.setMaxSize(Be)}handleWrapJump(P){const oe=Math.round((P-(this._prevLng===void 0?P:this._prevLng))/360);if(this._prevLng=P,oe){const Me={};for(const Ce in this._tiles){const Be=this._tiles[Ce];Be.tileID=Be.tileID.unwrapTo(Be.tileID.wrap+oe),Me[Be.tileID.key]=Be}this._tiles=Me;for(const Ce in this._timers)clearTimeout(this._timers[Ce]),delete this._timers[Ce];for(const Ce in this._tiles)this._setTileReloadTimer(Ce,this._tiles[Ce])}}_updateCoveredAndRetainedTiles(P,oe,Me,Ce,Be,_t){const kt={},Xt={},fr=Object.keys(P),Ar=i.now();for(const Lr of fr){const tn=P[Lr],xn=this._tiles[Lr];if(!xn||xn.fadeEndTime!==0&&xn.fadeEndTime<=Ar)continue;const Ze=this.findLoadedParent(tn,oe),tt=this.findLoadedSibling(tn),vt=Ze||tt||null;vt&&(this._addTile(vt.tileID),kt[vt.tileID.key]=vt.tileID),Xt[Lr]=tn}this._retainLoadedChildren(Xt,Ce,Me,P);for(const Lr in kt)P[Lr]||(this._coveredTiles[Lr]=!0,P[Lr]=kt[Lr]);if(_t){const Lr={},tn={};for(const xn of Be)this._tiles[xn.key].hasData()?Lr[xn.key]=xn:tn[xn.key]=xn;for(const xn in tn){const Ze=tn[xn].children(this._source.maxzoom);this._tiles[Ze[0].key]&&this._tiles[Ze[1].key]&&this._tiles[Ze[2].key]&&this._tiles[Ze[3].key]&&(Lr[Ze[0].key]=P[Ze[0].key]=Ze[0],Lr[Ze[1].key]=P[Ze[1].key]=Ze[1],Lr[Ze[2].key]=P[Ze[2].key]=Ze[2],Lr[Ze[3].key]=P[Ze[3].key]=Ze[3],delete tn[xn])}for(const xn in tn){const Ze=tn[xn],tt=this.findLoadedParent(Ze,this._source.minzoom),vt=this.findLoadedSibling(Ze),bt=tt||vt||null;if(bt){Lr[bt.tileID.key]=P[bt.tileID.key]=bt.tileID;for(const zt in Lr)Lr[zt].isChildOf(bt.tileID)&&delete Lr[zt]}}for(const xn in this._tiles)Lr[xn]||(this._coveredTiles[xn]=!0)}}update(P,oe){if(!this._sourceLoaded||this._paused)return;let Me;this.transform=P,this.terrain=oe,this.updateCacheSize(P),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Me=P.getVisibleUnwrappedCoordinates(this._source.tileID).map(Ar=>new t.S(Ar.canonical.z,Ar.wrap,Ar.canonical.z,Ar.canonical.x,Ar.canonical.y)):(Me=P.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:oe}),this._source.hasTile&&(Me=Me.filter(Ar=>this._source.hasTile(Ar)))):Me=[];const Ce=P.coveringZoomLevel(this._source),Be=Math.max(Ce-Nt.maxOverzooming,this._source.minzoom),_t=Math.max(Ce+Nt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const Ar={};for(const Lr of Me)if(Lr.canonical.z>this._source.minzoom){const tn=Lr.scaledTo(Lr.canonical.z-1);Ar[tn.key]=tn;const xn=Lr.scaledTo(Math.max(this._source.minzoom,Math.min(Lr.canonical.z,5)));Ar[xn.key]=xn}Me=Me.concat(Object.values(Ar))}const kt=Me.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,kt&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const Xt=this._updateRetainedTiles(Me,Ce);ar(this._source.type)&&this._updateCoveredAndRetainedTiles(Xt,Be,_t,Ce,Me,oe);for(const Ar in Xt)this._tiles[Ar].clearFadeHold();const fr=t.ab(this._tiles,Xt);for(const Ar of fr){const Lr=this._tiles[Ar];Lr.hasSymbolBuckets&&!Lr.holdingForFade()?Lr.setHoldDuration(this.map._fadeDuration):Lr.hasSymbolBuckets&&!Lr.symbolFadeFinished()||this._removeTile(Ar)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const P in this._tiles)this._tiles[P].holdingForFade()&&this._removeTile(P)}_updateRetainedTiles(P,oe){var Me;const Ce={},Be={},_t=Math.max(oe-Nt.maxOverzooming,this._source.minzoom),kt=Math.max(oe+Nt.maxUnderzooming,this._source.minzoom),Xt={};for(const fr of P){const Ar=this._addTile(fr);Ce[fr.key]=fr,Ar.hasData()||oethis._source.maxzoom){const tn=fr.children(this._source.maxzoom)[0],xn=this.getTile(tn);if(xn&&xn.hasData()){Ce[tn.key]=tn;continue}}else{const tn=fr.children(this._source.maxzoom);if(Ce[tn[0].key]&&Ce[tn[1].key]&&Ce[tn[2].key]&&Ce[tn[3].key])continue}let Lr=Ar.wasRequested();for(let tn=fr.overscaledZ-1;tn>=_t;--tn){const xn=fr.scaledTo(tn);if(Be[xn.key])break;if(Be[xn.key]=!0,Ar=this.getTile(xn),!Ar&&Lr&&(Ar=this._addTile(xn)),Ar){const Ze=Ar.hasData();if((Ze||!(!((Me=this.map)===null||Me===void 0)&&Me.cancelPendingTileRequestsWhileZooming)||Lr)&&(Ce[xn.key]=xn),Lr=Ar.wasRequested(),Ze)break}}}return Ce}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const P in this._tiles){const oe=[];let Me,Ce=this._tiles[P].tileID;for(;Ce.overscaledZ>0;){if(Ce.key in this._loadedParentTiles){Me=this._loadedParentTiles[Ce.key];break}oe.push(Ce.key);const Be=Ce.scaledTo(Ce.overscaledZ-1);if(Me=this._getLoadedTile(Be),Me)break;Ce=Be}for(const Be of oe)this._loadedParentTiles[Be]=Me}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const P in this._tiles){const oe=this._tiles[P].tileID,Me=this._getLoadedTile(oe);this._loadedSiblingTiles[oe.key]=Me}}_addTile(P){let oe=this._tiles[P.key];if(oe)return oe;oe=this._cache.getAndRemove(P),oe&&(this._setTileReloadTimer(P.key,oe),oe.tileID=P,this._state.initializeTileState(oe,this.map?this.map.painter:null),this._cacheTimers[P.key]&&(clearTimeout(this._cacheTimers[P.key]),delete this._cacheTimers[P.key],this._setTileReloadTimer(P.key,oe)));const Me=oe;return oe||(oe=new dt(P,this._source.tileSize*P.overscaleFactor()),this._loadTile(oe,P.key,oe.state)),oe.uses++,this._tiles[P.key]=oe,Me||this._source.fire(new t.k("dataloading",{tile:oe,coord:oe.tileID,dataType:"source"})),oe}_setTileReloadTimer(P,oe){P in this._timers&&(clearTimeout(this._timers[P]),delete this._timers[P]);const Me=oe.getExpiryTimeout();Me&&(this._timers[P]=setTimeout(()=>{this._reloadTile(P,"expired"),delete this._timers[P]},Me))}_removeTile(P){const oe=this._tiles[P];oe&&(oe.uses--,delete this._tiles[P],this._timers[P]&&(clearTimeout(this._timers[P]),delete this._timers[P]),oe.uses>0||(oe.hasData()&&oe.state!=="reloading"?this._cache.add(oe.tileID,oe,oe.getExpiryTimeout()):(oe.aborted=!0,this._abortTile(oe),this._unloadTile(oe))))}_dataHandler(P){const oe=P.sourceDataType;P.dataType==="source"&&oe==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&P.dataType==="source"&&oe==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const P in this._tiles)this._removeTile(P);this._cache.reset()}tilesIn(P,oe,Me){const Ce=[],Be=this.transform;if(!Be)return Ce;const _t=Me?Be.getCameraQueryGeometry(P):P,kt=P.map(Ze=>Be.pointCoordinate(Ze,this.terrain)),Xt=_t.map(Ze=>Be.pointCoordinate(Ze,this.terrain)),fr=this.getIds();let Ar=1/0,Lr=1/0,tn=-1/0,xn=-1/0;for(const Ze of Xt)Ar=Math.min(Ar,Ze.x),Lr=Math.min(Lr,Ze.y),tn=Math.max(tn,Ze.x),xn=Math.max(xn,Ze.y);for(let Ze=0;Ze=0&&Et[1].y+zt>=0){const Ut=kt.map(Tr=>vt.getTilePoint(Tr)),gr=Xt.map(Tr=>vt.getTilePoint(Tr));Ce.push({tile:tt,tileID:vt,queryGeometry:Ut,cameraQueryGeometry:gr,scale:bt})}}return Ce}getVisibleCoordinates(P){const oe=this.getRenderableIds(P).map(Me=>this._tiles[Me].tileID);for(const Me of oe)Me.posMatrix=this.transform.calculatePosMatrix(Me.toUnwrapped());return oe}hasTransition(){if(this._source.hasTransition())return!0;if(ar(this._source.type)){const P=i.now();for(const oe in this._tiles)if(this._tiles[oe].fadeEndTime>=P)return!0}return!1}setFeatureState(P,oe,Me){this._state.updateState(P=P||"_geojsonTileLayer",oe,Me)}removeFeatureState(P,oe,Me){this._state.removeFeatureState(P=P||"_geojsonTileLayer",oe,Me)}getFeatureState(P,oe){return this._state.getState(P=P||"_geojsonTileLayer",oe)}setDependencies(P,oe,Me){const Ce=this._tiles[P];Ce&&Ce.setDependencies(oe,Me)}reloadTilesForDependencies(P,oe){for(const Me in this._tiles)this._tiles[Me].hasDependency(P,oe)&&this._reloadTile(Me,"reloading");this._cache.filter(Me=>!Me.hasDependency(P,oe))}}function Qt(Ue,P){const oe=Math.abs(2*Ue.wrap)-+(Ue.wrap<0),Me=Math.abs(2*P.wrap)-+(P.wrap<0);return Ue.overscaledZ-P.overscaledZ||Me-oe||P.canonical.y-Ue.canonical.y||P.canonical.x-Ue.canonical.x}function ar(Ue){return Ue==="raster"||Ue==="image"||Ue==="video"}Nt.maxOverzooming=10,Nt.maxUnderzooming=3;class kr{constructor(P,oe){this.reset(P,oe)}reset(P,oe){this.points=P||[],this._distances=[0];for(let Me=1;Me0?(Ce-_t)/kt:0;return this.points[Be].mult(1-Xt).add(this.points[oe].mult(Xt))}}function Er(Ue,P){let oe=!0;return Ue==="always"||Ue!=="never"&&P!=="never"||(oe=!1),oe}class $r{constructor(P,oe,Me){const Ce=this.boxCells=[],Be=this.circleCells=[];this.xCellCount=Math.ceil(P/Me),this.yCellCount=Math.ceil(oe/Me);for(let _t=0;_tthis.width||Ce<0||oe>this.height)return[];const Xt=[];if(P<=0&&oe<=0&&this.width<=Me&&this.height<=Ce){if(Be)return[{key:null,x1:P,y1:oe,x2:Me,y2:Ce}];for(let fr=0;fr0}hitTestCircle(P,oe,Me,Ce,Be){const _t=P-Me,kt=P+Me,Xt=oe-Me,fr=oe+Me;if(kt<0||_t>this.width||fr<0||Xt>this.height)return!1;const Ar=[];return this._forEachCell(_t,Xt,kt,fr,this._queryCellCircle,Ar,{hitTest:!0,overlapMode:Ce,circle:{x:P,y:oe,radius:Me},seenUids:{box:{},circle:{}}},Be),Ar.length>0}_queryCell(P,oe,Me,Ce,Be,_t,kt,Xt){const{seenUids:fr,hitTest:Ar,overlapMode:Lr}=kt,tn=this.boxCells[Be];if(tn!==null){const Ze=this.bboxes;for(const tt of tn)if(!fr.box[tt]){fr.box[tt]=!0;const vt=4*tt,bt=this.boxKeys[tt];if(P<=Ze[vt+2]&&oe<=Ze[vt+3]&&Me>=Ze[vt+0]&&Ce>=Ze[vt+1]&&(!Xt||Xt(bt))&&(!Ar||!Er(Lr,bt.overlapMode))&&(_t.push({key:bt,x1:Ze[vt],y1:Ze[vt+1],x2:Ze[vt+2],y2:Ze[vt+3]}),Ar))return!0}}const xn=this.circleCells[Be];if(xn!==null){const Ze=this.circles;for(const tt of xn)if(!fr.circle[tt]){fr.circle[tt]=!0;const vt=3*tt,bt=this.circleKeys[tt];if(this._circleAndRectCollide(Ze[vt],Ze[vt+1],Ze[vt+2],P,oe,Me,Ce)&&(!Xt||Xt(bt))&&(!Ar||!Er(Lr,bt.overlapMode))){const zt=Ze[vt],Et=Ze[vt+1],Ut=Ze[vt+2];if(_t.push({key:bt,x1:zt-Ut,y1:Et-Ut,x2:zt+Ut,y2:Et+Ut}),Ar)return!0}}}return!1}_queryCellCircle(P,oe,Me,Ce,Be,_t,kt,Xt){const{circle:fr,seenUids:Ar,overlapMode:Lr}=kt,tn=this.boxCells[Be];if(tn!==null){const Ze=this.bboxes;for(const tt of tn)if(!Ar.box[tt]){Ar.box[tt]=!0;const vt=4*tt,bt=this.boxKeys[tt];if(this._circleAndRectCollide(fr.x,fr.y,fr.radius,Ze[vt+0],Ze[vt+1],Ze[vt+2],Ze[vt+3])&&(!Xt||Xt(bt))&&!Er(Lr,bt.overlapMode))return _t.push(!0),!0}}const xn=this.circleCells[Be];if(xn!==null){const Ze=this.circles;for(const tt of xn)if(!Ar.circle[tt]){Ar.circle[tt]=!0;const vt=3*tt,bt=this.circleKeys[tt];if(this._circlesCollide(Ze[vt],Ze[vt+1],Ze[vt+2],fr.x,fr.y,fr.radius)&&(!Xt||Xt(bt))&&!Er(Lr,bt.overlapMode))return _t.push(!0),!0}}}_forEachCell(P,oe,Me,Ce,Be,_t,kt,Xt){const fr=this._convertToXCellCoord(P),Ar=this._convertToYCellCoord(oe),Lr=this._convertToXCellCoord(Me),tn=this._convertToYCellCoord(Ce);for(let xn=fr;xn<=Lr;xn++)for(let Ze=Ar;Ze<=tn;Ze++)if(Be.call(this,P,oe,Me,Ce,this.xCellCount*Ze+xn,_t,kt,Xt))return}_convertToXCellCoord(P){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(P*this.xScale)))}_convertToYCellCoord(P){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(P*this.yScale)))}_circlesCollide(P,oe,Me,Ce,Be,_t){const kt=Ce-P,Xt=Be-oe,fr=Me+_t;return fr*fr>kt*kt+Xt*Xt}_circleAndRectCollide(P,oe,Me,Ce,Be,_t,kt){const Xt=(_t-Ce)/2,fr=Math.abs(P-(Ce+Xt));if(fr>Xt+Me)return!1;const Ar=(kt-Be)/2,Lr=Math.abs(oe-(Be+Ar));if(Lr>Ar+Me)return!1;if(fr<=Xt||Lr<=Ar)return!0;const tn=fr-Xt,xn=Lr-Ar;return tn*tn+xn*xn<=Me*Me}}function Sr(Ue,P,oe,Me,Ce){const Be=t.H();return P?(t.K(Be,Be,[1/Ce,1/Ce,1]),oe||t.ad(Be,Be,Me.angle)):t.L(Be,Me.labelPlaneMatrix,Ue),Be}function Ur(Ue,P,oe,Me,Ce){if(P){const Be=t.ae(Ue);return t.K(Be,Be,[Ce,Ce,1]),oe||t.ad(Be,Be,-Me.angle),Be}return Me.glCoordMatrix}function Mt(Ue,P,oe,Me){let Ce;Me?(Ce=[Ue,P,Me(Ue,P),1],t.af(Ce,Ce,oe)):(Ce=[Ue,P,0,1],vr(Ce,Ce,oe));const Be=Ce[3];return{point:new t.P(Ce[0]/Be,Ce[1]/Be),signedDistanceFromCamera:Be,isOccluded:!1}}function je(Ue,P){return .5+Ue/P*.5}function Je(Ue,P){return Ue.x>=-P[0]&&Ue.x<=P[0]&&Ue.y>=-P[1]&&Ue.y<=P[1]}function ke(Ue,P,oe,Me,Ce,Be,_t,kt,Xt,fr,Ar,Lr,tn,xn,Ze){const tt=Me?Ue.textSizeData:Ue.iconSizeData,vt=t.ag(tt,oe.transform.zoom),bt=[256/oe.width*2+1,256/oe.height*2+1],zt=Me?Ue.text.dynamicLayoutVertexArray:Ue.icon.dynamicLayoutVertexArray;zt.clear();const Et=Ue.lineVertexArray,Ut=Me?Ue.text.placedSymbolArray:Ue.icon.placedSymbolArray,gr=oe.transform.width/oe.transform.height;let Tr=!1;for(let Pr=0;PrMath.abs(oe.x-P.x)*Me?{useVertical:!0}:(Ue===t.ah.vertical?P.yoe.x)?{needsFlipping:!0}:null}function Ee(Ue,P,oe,Me,Ce,Be,_t,kt,Xt,fr,Ar){const Lr=oe/24,tn=P.lineOffsetX*Lr,xn=P.lineOffsetY*Lr;let Ze;if(P.numGlyphs>1){const tt=P.glyphStartIndex+P.numGlyphs,vt=P.lineStartIndex,bt=P.lineStartIndex+P.lineLength,zt=xe(Lr,kt,tn,xn,Me,P,Ar,Ue);if(!zt)return{notEnoughRoom:!0};const Et=Mt(zt.first.point.x,zt.first.point.y,_t,Ue.getElevation).point,Ut=Mt(zt.last.point.x,zt.last.point.y,_t,Ue.getElevation).point;if(Ce&&!Me){const gr=ye(P.writingMode,Et,Ut,fr);if(gr)return gr}Ze=[zt.first];for(let gr=P.glyphStartIndex+1;gr0?Et.point:(function(Tr,Pr,Yr,sn,En,Pn){return Xe(Tr,Pr,Yr,1,En,Pn)})(Ue.tileAnchorPoint,zt,vt,0,Be,Ue),gr=ye(P.writingMode,vt,Ut,fr);if(gr)return gr}const tt=Kt(Lr*kt.getoffsetX(P.glyphStartIndex),tn,xn,Me,P.segment,P.lineStartIndex,P.lineStartIndex+P.lineLength,Ue,Ar);if(!tt||Ue.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};Ze=[tt]}for(const tt of Ze)t.aj(Xt,tt.point,tt.angle);return{}}function Xe(Ue,P,oe,Me,Ce,Be){const _t=Ue.add(Ue.sub(P)._unit()),kt=Ce!==void 0?Mt(_t.x,_t.y,Ce,Be.getElevation).point:Lt(_t.x,_t.y,Be).point,Xt=oe.sub(kt);return oe.add(Xt._mult(Me/Xt.mag()))}function Qe(Ue,P,oe){const Me=P.projectionCache;if(Me.projections[Ue])return Me.projections[Ue];const Ce=new t.P(P.lineVertexArray.getx(Ue),P.lineVertexArray.gety(Ue)),Be=Lt(Ce.x,Ce.y,P);if(Be.signedDistanceFromCamera>0)return Me.projections[Ue]=Be.point,Me.anyProjectionOccluded=Me.anyProjectionOccluded||Be.isOccluded,Be.point;const _t=Ue-oe.direction;return(function(kt,Xt,fr,Ar,Lr){return Xe(kt,Xt,fr,Ar,void 0,Lr)})(oe.distanceFromAnchor===0?P.tileAnchorPoint:new t.P(P.lineVertexArray.getx(_t),P.lineVertexArray.gety(_t)),Ce,oe.previousVertex,oe.absOffsetX-oe.distanceFromAnchor+1,P)}function Lt(Ue,P,oe){const Me=Ue+oe.translation[0],Ce=P+oe.translation[1];let Be;return!oe.pitchWithMap&&oe.projection.useSpecialProjectionForSymbols?(Be=oe.projection.projectTileCoordinates(Me,Ce,oe.unwrappedTileID,oe.getElevation),Be.point.x=(.5*Be.point.x+.5)*oe.width,Be.point.y=(.5*-Be.point.y+.5)*oe.height):(Be=Mt(Me,Ce,oe.labelPlaneMatrix,oe.getElevation),Be.isOccluded=!1),Be}function Ct(Ue,P,oe){return Ue._unit()._perp()._mult(P*oe)}function Ot(Ue,P,oe,Me,Ce,Be,_t,kt,Xt){if(kt.projectionCache.offsets[Ue])return kt.projectionCache.offsets[Ue];const fr=oe.add(P);if(Ue+Xt.direction=Ce)return kt.projectionCache.offsets[Ue]=fr,fr;const Ar=Qe(Ue+Xt.direction,kt,Xt),Lr=Ct(Ar.sub(oe),_t,Xt.direction),tn=oe.add(Lr),xn=Ar.add(Lr);return kt.projectionCache.offsets[Ue]=t.ak(Be,fr,tn,xn)||fr,kt.projectionCache.offsets[Ue]}function Kt(Ue,P,oe,Me,Ce,Be,_t,kt,Xt){const fr=Me?Ue-P:Ue+P;let Ar=fr>0?1:-1,Lr=0;Me&&(Ar*=-1,Lr=Math.PI),Ar<0&&(Lr+=Math.PI);let tn,xn=Ar>0?Be+Ce:Be+Ce+1;kt.projectionCache.cachedAnchorPoint?tn=kt.projectionCache.cachedAnchorPoint:(tn=Lt(kt.tileAnchorPoint.x,kt.tileAnchorPoint.y,kt).point,kt.projectionCache.cachedAnchorPoint=tn);let Ze,tt,vt=tn,bt=tn,zt=0,Et=0;const Ut=Math.abs(fr),gr=[];let Tr;for(;zt+Et<=Ut;){if(xn+=Ar,xn=_t)return null;zt+=Et,bt=vt,tt=Ze;const sn={absOffsetX:Ut,direction:Ar,distanceFromAnchor:zt,previousVertex:bt};if(vt=Qe(xn,kt,sn),oe===0)gr.push(bt),Tr=vt.sub(bt);else{let En;const Pn=vt.sub(bt);En=Pn.mag()===0?Ct(Qe(xn+Ar,kt,sn).sub(vt),oe,Ar):Ct(Pn,oe,Ar),tt||(tt=bt.add(En)),Ze=Ot(xn,En,vt,Be,_t,tt,oe,kt,sn),gr.push(tt),Tr=Ze.sub(tt)}Et=Tr.mag()}const Pr=Tr._mult((Ut-zt)/Et)._add(tt||bt),Yr=Lr+Math.atan2(vt.y-bt.y,vt.x-bt.x);return gr.push(Pr),{point:Pr,angle:Xt?Yr:0,path:gr}}const xr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function mr(Ue,P){for(let oe=0;oe=1;vo--)ni.push(ri.path[vo]);for(let vo=1;voWo.signedDistanceFromCamera<=0)?[]:vo.map(Wo=>Wo.point)}let bo=[];if(ni.length>0){const vo=ni[0].clone(),Wo=ni[0].clone();for(let Ks=1;Ks=Pn.x&&Wo.x<=Xn.x&&vo.y>=Pn.y&&Wo.y<=Xn.y?[ni]:Wo.xXn.x||Wo.yXn.y?[]:t.al([ni],Pn.x,Pn.y,Xn.x,Xn.y)}for(const vo of bo){Ta.reset(vo,.25*En);let Wo=0;Wo=Ta.length<=.5*En?1:Math.ceil(Ta.paddedLength/$i)+1;for(let Ks=0;KsMt(Ce.x,Ce.y,Me,oe.getElevation))}queryRenderedSymbols(P){if(P.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const oe=[];let Me=1/0,Ce=1/0,Be=-1/0,_t=-1/0;for(const Ar of P){const Lr=new t.P(Ar.x+Nr,Ar.y+Nr);Me=Math.min(Me,Lr.x),Ce=Math.min(Ce,Lr.y),Be=Math.max(Be,Lr.x),_t=Math.max(_t,Lr.y),oe.push(Lr)}const kt=this.grid.query(Me,Ce,Be,_t).concat(this.ignoredGrid.query(Me,Ce,Be,_t)),Xt={},fr={};for(const Ar of kt){const Lr=Ar.key;if(Xt[Lr.bucketInstanceId]===void 0&&(Xt[Lr.bucketInstanceId]={}),Xt[Lr.bucketInstanceId][Lr.featureIndex])continue;const tn=[new t.P(Ar.x1,Ar.y1),new t.P(Ar.x2,Ar.y1),new t.P(Ar.x2,Ar.y2),new t.P(Ar.x1,Ar.y2)];t.am(oe,tn)&&(Xt[Lr.bucketInstanceId][Lr.featureIndex]=!0,fr[Lr.bucketInstanceId]===void 0&&(fr[Lr.bucketInstanceId]=[]),fr[Lr.bucketInstanceId].push(Lr.featureIndex))}return fr}insertCollisionBox(P,oe,Me,Ce,Be,_t){(Me?this.ignoredGrid:this.grid).insert({bucketInstanceId:Ce,featureIndex:Be,collisionGroupID:_t,overlapMode:oe},P[0],P[1],P[2],P[3])}insertCollisionCircles(P,oe,Me,Ce,Be,_t){const kt=Me?this.ignoredGrid:this.grid,Xt={bucketInstanceId:Ce,featureIndex:Be,collisionGroupID:_t,overlapMode:oe};for(let fr=0;fr=this.screenRightBoundary||Cethis.screenBottomBoundary}isInsideGrid(P,oe,Me,Ce){return Me>=0&&P=0&&oethis.projectAndGetPerspectiveRatio(Me,En.x,En.y,Ce,fr));Yr=sn.some(En=>!En.isOccluded),Pr=sn.map(En=>En.point)}else Yr=!0;return{box:t.ao(Pr),allPointsOccluded:!Yr}}}function $n(Ue,P,oe){return P*(t.X/(Ue.tileSize*Math.pow(2,oe-Ue.tileID.overscaledZ)))}class Vn{constructor(P,oe,Me,Ce){this.opacity=P?Math.max(0,Math.min(1,P.opacity+(P.placed?oe:-oe))):Ce&&Me?1:0,this.placed=Me}isHidden(){return this.opacity===0&&!this.placed}}class ra{constructor(P,oe,Me,Ce,Be){this.text=new Vn(P?P.text:null,oe,Me,Be),this.icon=new Vn(P?P.icon:null,oe,Ce,Be)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class na{constructor(P,oe,Me){this.text=P,this.icon=oe,this.skipFade=Me}}class Un{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class ka{constructor(P,oe,Me,Ce,Be){this.bucketInstanceId=P,this.featureIndex=oe,this.sourceLayerIndex=Me,this.bucketIndex=Ce,this.tileID=Be}}class Va{constructor(P){this.crossSourceCollisions=P,this.maxGroupID=0,this.collisionGroups={}}get(P){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[P]){const oe=++this.maxGroupID;this.collisionGroups[P]={ID:oe,predicate:Me=>Me.collisionGroupID===oe}}return this.collisionGroups[P]}}function sr(Ue,P,oe,Me,Ce){const{horizontalAlign:Be,verticalAlign:_t}=t.au(Ue);return new t.P(-(Be-.5)*P+Me[0]*Ce,-(_t-.5)*oe+Me[1]*Ce)}class Vt{constructor(P,oe,Me,Ce,Be,_t){this.transform=P.clone(),this.terrain=Me,this.collisionIndex=new kn(this.transform,oe),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Ce,this.retainedQueryData={},this.collisionGroups=new Va(Be),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=_t,_t&&(_t.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(P){const oe=this.terrain;return oe?(Me,Ce)=>oe.getElevation(P,Me,Ce):null}getBucketParts(P,oe,Me,Ce){const Be=Me.getBucket(oe),_t=Me.latestFeatureIndex;if(!Be||!_t||oe.id!==Be.layerIds[0])return;const kt=Me.collisionBoxArray,Xt=Be.layers[0].layout,fr=Be.layers[0].paint,Ar=Math.pow(2,this.transform.zoom-Me.tileID.overscaledZ),Lr=Me.tileSize/t.X,tn=Me.tileID.toUnwrapped(),xn=this.transform.calculatePosMatrix(tn),Ze=Xt.get("text-pitch-alignment")==="map",tt=Xt.get("text-rotation-alignment")==="map",vt=$n(Me,1,this.transform.zoom),bt=this.collisionIndex.mapProjection.translatePosition(this.transform,Me,fr.get("text-translate"),fr.get("text-translate-anchor")),zt=this.collisionIndex.mapProjection.translatePosition(this.transform,Me,fr.get("icon-translate"),fr.get("icon-translate-anchor")),Et=Sr(xn,Ze,tt,this.transform,vt);let Ut=null;if(Ze){const Tr=Ur(xn,Ze,tt,this.transform,vt);Ut=t.L([],this.transform.labelPlaneMatrix,Tr)}this.retainedQueryData[Be.bucketInstanceId]=new ka(Be.bucketInstanceId,_t,Be.sourceLayerIndex,Be.index,Me.tileID);const gr={bucket:Be,layout:Xt,translationText:bt,translationIcon:zt,posMatrix:xn,unwrappedTileID:tn,textLabelPlaneMatrix:Et,labelToScreenMatrix:Ut,scale:Ar,textPixelRatio:Lr,holdingForFade:Me.holdingForFade(),collisionBoxArray:kt,partiallyEvaluatedTextSize:t.ag(Be.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Be.sourceID)};if(Ce)for(const Tr of Be.sortKeyRanges){const{sortKey:Pr,symbolInstanceStart:Yr,symbolInstanceEnd:sn}=Tr;P.push({sortKey:Pr,symbolInstanceStart:Yr,symbolInstanceEnd:sn,parameters:gr})}else P.push({symbolInstanceStart:0,symbolInstanceEnd:Be.symbolInstances.length,parameters:gr})}attemptAnchorPlacement(P,oe,Me,Ce,Be,_t,kt,Xt,fr,Ar,Lr,tn,xn,Ze,tt,vt,bt,zt,Et){const Ut=t.aq[P.textAnchor],gr=[P.textOffset0,P.textOffset1],Tr=sr(Ut,Me,Ce,gr,Be),Pr=this.collisionIndex.placeCollisionBox(oe,tn,Xt,fr,Ar,kt,_t,vt,Lr.predicate,Et,Tr);if((!zt||this.collisionIndex.placeCollisionBox(zt,tn,Xt,fr,Ar,kt,_t,bt,Lr.predicate,Et,Tr).placeable)&&Pr.placeable){let Yr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[xn.crossTileID]&&this.prevPlacement.placements[xn.crossTileID]&&this.prevPlacement.placements[xn.crossTileID].text&&(Yr=this.prevPlacement.variableOffsets[xn.crossTileID].anchor),xn.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[xn.crossTileID]={textOffset:gr,width:Me,height:Ce,anchor:Ut,textBoxScale:Be,prevAnchor:Yr},this.markUsedJustification(Ze,Ut,xn,tt),Ze.allowVerticalPlacement&&(this.markUsedOrientation(Ze,tt,xn),this.placedOrientations[xn.crossTileID]=tt),{shift:Tr,placedGlyphBoxes:Pr}}}placeLayerBucketPart(P,oe,Me){const{bucket:Ce,layout:Be,translationText:_t,translationIcon:kt,posMatrix:Xt,unwrappedTileID:fr,textLabelPlaneMatrix:Ar,labelToScreenMatrix:Lr,textPixelRatio:tn,holdingForFade:xn,collisionBoxArray:Ze,partiallyEvaluatedTextSize:tt,collisionGroup:vt}=P.parameters,bt=Be.get("text-optional"),zt=Be.get("icon-optional"),Et=t.ar(Be,"text-overlap","text-allow-overlap"),Ut=Et==="always",gr=t.ar(Be,"icon-overlap","icon-allow-overlap"),Tr=gr==="always",Pr=Be.get("text-rotation-alignment")==="map",Yr=Be.get("text-pitch-alignment")==="map",sn=Be.get("icon-text-fit")!=="none",En=Be.get("symbol-z-order")==="viewport-y",Pn=Ut&&(Tr||!Ce.hasIconData()||zt),Xn=Tr&&(Ut||!Ce.hasTextData()||bt);!Ce.collisionArrays&&Ze&&Ce.deserializeCollisionBoxes(Ze);const Ta=this._getTerrainElevationFunc(this.retainedQueryData[Ce.bucketInstanceId].tileID),ri=(Wa,ni,$i)=>{var bo,vo;if(oe[Wa.crossTileID])return;if(xn)return void(this.placements[Wa.crossTileID]=new na(!1,!1,!1));let Wo=!1,Ks=!1,Js=!0,Es=null,il={box:null,placeable:!1,offscreen:null},mu={placeable:!1},ou=null,ks=null,Cs=null,Ru=0,uc=0,Uc=0;ni.textFeatureIndex?Ru=ni.textFeatureIndex:Wa.useRuntimeCollisionCircles&&(Ru=Wa.featureIndex),ni.verticalTextFeatureIndex&&(uc=ni.verticalTextFeatureIndex);const ge=ni.textBox;if(ge){const St=_r=>{let Zr=t.ah.horizontal;if(Ce.allowVerticalPlacement&&!_r&&this.prevPlacement){const Xr=this.prevPlacement.placedOrientations[Wa.crossTileID];Xr&&(this.placedOrientations[Wa.crossTileID]=Xr,Zr=Xr,this.markUsedOrientation(Ce,Zr,Wa))}return Zr},It=(_r,Zr)=>{if(Ce.allowVerticalPlacement&&Wa.numVerticalGlyphVertices>0&&ni.verticalTextBox){for(const Xr of Ce.writingModes)if(Xr===t.ah.vertical?(il=Zr(),mu=il):il=_r(),il&&il.placeable)break}else il=_r()},tr=Wa.textAnchorOffsetStartIndex,er=Wa.textAnchorOffsetEndIndex;if(er===tr){const _r=(Zr,Xr)=>{const dn=this.collisionIndex.placeCollisionBox(Zr,Et,tn,Xt,fr,Yr,Pr,_t,vt.predicate,Ta);return dn&&dn.placeable&&(this.markUsedOrientation(Ce,Xr,Wa),this.placedOrientations[Wa.crossTileID]=Xr),dn};It(()=>_r(ge,t.ah.horizontal),()=>{const Zr=ni.verticalTextBox;return Ce.allowVerticalPlacement&&Wa.numVerticalGlyphVertices>0&&Zr?_r(Zr,t.ah.vertical):{box:null,offscreen:null}}),St(il&&il.placeable)}else{let _r=t.aq[(vo=(bo=this.prevPlacement)===null||bo===void 0?void 0:bo.variableOffsets[Wa.crossTileID])===null||vo===void 0?void 0:vo.anchor];const Zr=(dn,Mn,Cn)=>{const La=dn.x2-dn.x1,zn=dn.y2-dn.y1,ea=Wa.textBoxScale,sa=sn&&gr==="never"?Mn:null;let Sa=null,Ra=Et==="never"?1:2,oa="never";_r&&Ra++;for(let ai=0;aiZr(ge,ni.iconBox,t.ah.horizontal),()=>{const dn=ni.verticalTextBox;return Ce.allowVerticalPlacement&&(!il||!il.placeable)&&Wa.numVerticalGlyphVertices>0&&dn?Zr(dn,ni.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),il&&(Wo=il.placeable,Js=il.offscreen);const Xr=St(il&&il.placeable);if(!Wo&&this.prevPlacement){const dn=this.prevPlacement.variableOffsets[Wa.crossTileID];dn&&(this.variableOffsets[Wa.crossTileID]=dn,this.markUsedJustification(Ce,dn.anchor,Wa,Xr))}}}if(ou=il,Wo=ou&&ou.placeable,Js=ou&&ou.offscreen,Wa.useRuntimeCollisionCircles){const St=Ce.text.placedSymbolArray.get(Wa.centerJustifiedTextSymbolIndex),It=t.ai(Ce.textSizeData,tt,St),tr=Be.get("text-padding");ks=this.collisionIndex.placeCollisionCircles(Et,St,Ce.lineVertexArray,Ce.glyphOffsetArray,It,Xt,fr,Ar,Lr,Me,Yr,vt.predicate,Wa.collisionCircleDiameter,tr,_t,Ta),ks.circles.length&&ks.collisionDetected&&!Me&&t.w("Collisions detected, but collision boxes are not shown"),Wo=Ut||ks.circles.length>0&&!ks.collisionDetected,Js=Js&&ks.offscreen}if(ni.iconFeatureIndex&&(Uc=ni.iconFeatureIndex),ni.iconBox){const St=It=>this.collisionIndex.placeCollisionBox(It,gr,tn,Xt,fr,Yr,Pr,kt,vt.predicate,Ta,sn&&Es?Es:void 0);mu&&mu.placeable&&ni.verticalIconBox?(Cs=St(ni.verticalIconBox),Ks=Cs.placeable):(Cs=St(ni.iconBox),Ks=Cs.placeable),Js=Js&&Cs.offscreen}const Oe=bt||Wa.numHorizontalGlyphVertices===0&&Wa.numVerticalGlyphVertices===0,rt=zt||Wa.numIconVertices===0;Oe||rt?rt?Oe||(Ks=Ks&&Wo):Wo=Ks&&Wo:Ks=Wo=Ks&&Wo;const wt=Ks&&Cs.placeable;if(Wo&&ou.placeable&&this.collisionIndex.insertCollisionBox(ou.box,Et,Be.get("text-ignore-placement"),Ce.bucketInstanceId,mu&&mu.placeable&&uc?uc:Ru,vt.ID),wt&&this.collisionIndex.insertCollisionBox(Cs.box,gr,Be.get("icon-ignore-placement"),Ce.bucketInstanceId,Uc,vt.ID),ks&&Wo&&this.collisionIndex.insertCollisionCircles(ks.circles,Et,Be.get("text-ignore-placement"),Ce.bucketInstanceId,Ru,vt.ID),Me&&this.storeCollisionData(Ce.bucketInstanceId,$i,ni,ou,Cs,ks),Wa.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Ce.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Wa.crossTileID]=new na(Wo||Pn,Ks||Xn,Js||Ce.justReloaded),oe[Wa.crossTileID]=!0};if(En){if(P.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const Wa=Ce.getSortedSymbolIndexes(this.transform.angle);for(let ni=Wa.length-1;ni>=0;--ni){const $i=Wa[ni];ri(Ce.symbolInstances.get($i),Ce.collisionArrays[$i],$i)}}else for(let Wa=P.symbolInstanceStart;Wa=0&&(P.text.placedSymbolArray.get(kt).crossTileID=Be>=0&&kt!==Be?0:Me.crossTileID)}markUsedOrientation(P,oe,Me){const Ce=oe===t.ah.horizontal||oe===t.ah.horizontalOnly?oe:0,Be=oe===t.ah.vertical?oe:0,_t=[Me.leftJustifiedTextSymbolIndex,Me.centerJustifiedTextSymbolIndex,Me.rightJustifiedTextSymbolIndex];for(const kt of _t)P.text.placedSymbolArray.get(kt).placedOrientation=Ce;Me.verticalPlacedTextSymbolIndex&&(P.text.placedSymbolArray.get(Me.verticalPlacedTextSymbolIndex).placedOrientation=Be)}commit(P){this.commitTime=P,this.zoomAtLastRecencyCheck=this.transform.zoom;const oe=this.prevPlacement;let Me=!1;this.prevZoomAdjustment=oe?oe.zoomAdjustment(this.transform.zoom):0;const Ce=oe?oe.symbolFadeChange(P):1,Be=oe?oe.opacities:{},_t=oe?oe.variableOffsets:{},kt=oe?oe.placedOrientations:{};for(const Xt in this.placements){const fr=this.placements[Xt],Ar=Be[Xt];Ar?(this.opacities[Xt]=new ra(Ar,Ce,fr.text,fr.icon),Me=Me||fr.text!==Ar.text.placed||fr.icon!==Ar.icon.placed):(this.opacities[Xt]=new ra(null,Ce,fr.text,fr.icon,fr.skipFade),Me=Me||fr.text||fr.icon)}for(const Xt in Be){const fr=Be[Xt];if(!this.opacities[Xt]){const Ar=new ra(fr,Ce,!1,!1);Ar.isHidden()||(this.opacities[Xt]=Ar,Me=Me||fr.text.placed||fr.icon.placed)}}for(const Xt in _t)this.variableOffsets[Xt]||!this.opacities[Xt]||this.opacities[Xt].isHidden()||(this.variableOffsets[Xt]=_t[Xt]);for(const Xt in kt)this.placedOrientations[Xt]||!this.opacities[Xt]||this.opacities[Xt].isHidden()||(this.placedOrientations[Xt]=kt[Xt]);if(oe&&oe.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Me?this.lastPlacementChangeTime=P:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=oe?oe.lastPlacementChangeTime:P)}updateLayerOpacities(P,oe){const Me={};for(const Ce of oe){const Be=Ce.getBucket(P);Be&&Ce.latestFeatureIndex&&P.id===Be.layerIds[0]&&this.updateBucketOpacities(Be,Ce.tileID,Me,Ce.collisionBoxArray)}}updateBucketOpacities(P,oe,Me,Ce){P.hasTextData()&&(P.text.opacityVertexArray.clear(),P.text.hasVisibleVertices=!1),P.hasIconData()&&(P.icon.opacityVertexArray.clear(),P.icon.hasVisibleVertices=!1),P.hasIconCollisionBoxData()&&P.iconCollisionBox.collisionVertexArray.clear(),P.hasTextCollisionBoxData()&&P.textCollisionBox.collisionVertexArray.clear();const Be=P.layers[0],_t=Be.layout,kt=new ra(null,0,!1,!1,!0),Xt=_t.get("text-allow-overlap"),fr=_t.get("icon-allow-overlap"),Ar=Be._unevaluatedLayout.hasValue("text-variable-anchor")||Be._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Lr=_t.get("text-rotation-alignment")==="map",tn=_t.get("text-pitch-alignment")==="map",xn=_t.get("icon-text-fit")!=="none",Ze=new ra(null,0,Xt&&(fr||!P.hasIconData()||_t.get("icon-optional")),fr&&(Xt||!P.hasTextData()||_t.get("text-optional")),!0);!P.collisionArrays&&Ce&&(P.hasIconCollisionBoxData()||P.hasTextCollisionBoxData())&&P.deserializeCollisionBoxes(Ce);const tt=(bt,zt,Et)=>{for(let Ut=0;Ut0,Yr=this.placedOrientations[zt.crossTileID],sn=Yr===t.ah.vertical,En=Yr===t.ah.horizontal||Yr===t.ah.horizontalOnly;if(Et>0||Ut>0){const Xn=ha(Tr.text);tt(P.text,Et,sn?_a:Xn),tt(P.text,Ut,En?_a:Xn);const Ta=Tr.text.isHidden();[zt.rightJustifiedTextSymbolIndex,zt.centerJustifiedTextSymbolIndex,zt.leftJustifiedTextSymbolIndex].forEach(ni=>{ni>=0&&(P.text.placedSymbolArray.get(ni).hidden=Ta||sn?1:0)}),zt.verticalPlacedTextSymbolIndex>=0&&(P.text.placedSymbolArray.get(zt.verticalPlacedTextSymbolIndex).hidden=Ta||En?1:0);const ri=this.variableOffsets[zt.crossTileID];ri&&this.markUsedJustification(P,ri.anchor,zt,Yr);const Wa=this.placedOrientations[zt.crossTileID];Wa&&(this.markUsedJustification(P,"left",zt,Wa),this.markUsedOrientation(P,Wa,zt))}if(Pr){const Xn=ha(Tr.icon),Ta=!(xn&&zt.verticalPlacedIconSymbolIndex&&sn);zt.placedIconSymbolIndex>=0&&(tt(P.icon,zt.numIconVertices,Ta?Xn:_a),P.icon.placedSymbolArray.get(zt.placedIconSymbolIndex).hidden=Tr.icon.isHidden()),zt.verticalPlacedIconSymbolIndex>=0&&(tt(P.icon,zt.numVerticalIconVertices,Ta?_a:Xn),P.icon.placedSymbolArray.get(zt.verticalPlacedIconSymbolIndex).hidden=Tr.icon.isHidden())}const Pn=vt&&vt.has(bt)?vt.get(bt):{text:null,icon:null};if(P.hasIconCollisionBoxData()||P.hasTextCollisionBoxData()){const Xn=P.collisionArrays[bt];if(Xn){let Ta=new t.P(0,0);if(Xn.textBox||Xn.verticalTextBox){let ri=!0;if(Ar){const Wa=this.variableOffsets[gr];Wa?(Ta=sr(Wa.anchor,Wa.width,Wa.height,Wa.textOffset,Wa.textBoxScale),Lr&&Ta._rotate(tn?this.transform.angle:-this.transform.angle)):ri=!1}if(Xn.textBox||Xn.verticalTextBox){let Wa;Xn.textBox&&(Wa=sn),Xn.verticalTextBox&&(Wa=En),or(P.textCollisionBox.collisionVertexArray,Tr.text.placed,!ri||Wa,Pn.text,Ta.x,Ta.y)}}if(Xn.iconBox||Xn.verticalIconBox){const ri=!!(!En&&Xn.verticalIconBox);let Wa;Xn.iconBox&&(Wa=ri),Xn.verticalIconBox&&(Wa=!ri),or(P.iconCollisionBox.collisionVertexArray,Tr.icon.placed,Wa,Pn.icon,xn?Ta.x:0,xn?Ta.y:0)}}}}if(P.sortFeatures(this.transform.angle),this.retainedQueryData[P.bucketInstanceId]&&(this.retainedQueryData[P.bucketInstanceId].featureSortOrder=P.featureSortOrder),P.hasTextData()&&P.text.opacityVertexBuffer&&P.text.opacityVertexBuffer.updateData(P.text.opacityVertexArray),P.hasIconData()&&P.icon.opacityVertexBuffer&&P.icon.opacityVertexBuffer.updateData(P.icon.opacityVertexArray),P.hasIconCollisionBoxData()&&P.iconCollisionBox.collisionVertexBuffer&&P.iconCollisionBox.collisionVertexBuffer.updateData(P.iconCollisionBox.collisionVertexArray),P.hasTextCollisionBoxData()&&P.textCollisionBox.collisionVertexBuffer&&P.textCollisionBox.collisionVertexBuffer.updateData(P.textCollisionBox.collisionVertexArray),P.text.opacityVertexArray.length!==P.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${P.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${P.text.layoutVertexArray.length}) / 4`);if(P.icon.opacityVertexArray.length!==P.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${P.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${P.icon.layoutVertexArray.length}) / 4`);if(P.bucketInstanceId in this.collisionCircleArrays){const bt=this.collisionCircleArrays[P.bucketInstanceId];P.placementInvProjMatrix=bt.invProjMatrix,P.placementViewportMatrix=bt.viewportMatrix,P.collisionCircleArray=bt.circles,delete this.collisionCircleArrays[P.bucketInstanceId]}}symbolFadeChange(P){return this.fadeDuration===0?1:(P-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(P){return Math.max(0,(this.transform.zoom-P)/1.5)}hasTransitions(P){return this.stale||P-this.lastPlacementChangeTimeP}setStale(){this.stale=!0}}function or(Ue,P,oe,Me,Ce,Be){Me&&Me.length!==0||(Me=[0,0,0,0]);const _t=Me[0]-Nr,kt=Me[1]-Nr,Xt=Me[2]-Nr,fr=Me[3]-Nr;Ue.emplaceBack(P?1:0,oe?1:0,Ce||0,Be||0,_t,kt),Ue.emplaceBack(P?1:0,oe?1:0,Ce||0,Be||0,Xt,kt),Ue.emplaceBack(P?1:0,oe?1:0,Ce||0,Be||0,Xt,fr),Ue.emplaceBack(P?1:0,oe?1:0,Ce||0,Be||0,_t,fr)}const ur=Math.pow(2,25),Gr=Math.pow(2,24),ln=Math.pow(2,17),gn=Math.pow(2,16),An=Math.pow(2,9),Qn=Math.pow(2,8),pa=Math.pow(2,1);function ha(Ue){if(Ue.opacity===0&&!Ue.placed)return 0;if(Ue.opacity===1&&Ue.placed)return 4294967295;const P=Ue.placed?1:0,oe=Math.floor(127*Ue.opacity);return oe*ur+P*Gr+oe*ln+P*gn+oe*An+P*Qn+oe*pa+P}const _a=0;function Ca(){return{isOccluded:(Ue,P,oe)=>!1,getPitchedTextCorrection:(Ue,P,oe)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Ue,P,oe,Me){throw new Error("Not implemented.")},translatePosition:(Ue,P,oe,Me)=>(function(Ce,Be,_t,kt,Xt=!1){if(!_t[0]&&!_t[1])return[0,0];const fr=Xt?kt==="map"?Ce.angle:0:kt==="viewport"?-Ce.angle:0;if(fr){const Ar=Math.sin(fr),Lr=Math.cos(fr);_t=[_t[0]*Lr-_t[1]*Ar,_t[0]*Ar+_t[1]*Lr]}return[Xt?_t[0]:$n(Be,_t[0],Ce.zoom),Xt?_t[1]:$n(Be,_t[1],Ce.zoom)]})(Ue,P,oe,Me),getCircleRadiusCorrection:Ue=>1}}class Hn{constructor(P){this._sortAcrossTiles=P.layout.get("symbol-z-order")!=="viewport-y"&&!P.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(P,oe,Me,Ce,Be){const _t=this._bucketParts;for(;this._currentTileIndexkt.sortKey-Xt.sortKey));this._currentPartIndex<_t.length;)if(oe.placeLayerBucketPart(_t[this._currentPartIndex],this._seenCrossTileIDs,Me),this._currentPartIndex++,Be())return!0;return!1}}class pi{constructor(P,oe,Me,Ce,Be,_t,kt,Xt){this.placement=new Vt(P,Ca(),oe,_t,kt,Xt),this._currentPlacementIndex=Me.length-1,this._forceFullPlacement=Ce,this._showCollisionBoxes=Be,this._done=!1}isDone(){return this._done}continuePlacement(P,oe,Me){const Ce=i.now(),Be=()=>!this._forceFullPlacement&&i.now()-Ce>2;for(;this._currentPlacementIndex>=0;){const _t=oe[P[this._currentPlacementIndex]],kt=this.placement.collisionIndex.transform.zoom;if(_t.type==="symbol"&&(!_t.minzoom||_t.minzoom<=kt)&&(!_t.maxzoom||_t.maxzoom>kt)){if(this._inProgressLayer||(this._inProgressLayer=new Hn(_t)),this._inProgressLayer.continuePlacement(Me[_t.source],this.placement,this._showCollisionBoxes,_t,Be))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(P){return this.placement.commit(P),this.placement}}const Si=512/t.X/2;class Dt{constructor(P,oe,Me){this.tileID=P,this.bucketInstanceId=Me,this._symbolsByKey={};const Ce=new Map;for(let Be=0;Be({x:Math.floor(Xt.anchorX*Si),y:Math.floor(Xt.anchorY*Si)})),crossTileIDs:_t.map(Xt=>Xt.crossTileID)};if(kt.positions.length>128){const Xt=new t.av(kt.positions.length,16,Uint16Array);for(const{x:fr,y:Ar}of kt.positions)Xt.add(fr,Ar);Xt.finish(),delete kt.positions,kt.index=Xt}this._symbolsByKey[Be]=kt}}getScaledCoordinates(P,oe){const{x:Me,y:Ce,z:Be}=this.tileID.canonical,{x:_t,y:kt,z:Xt}=oe.canonical,fr=Si/Math.pow(2,Xt-Be),Ar=(kt*t.X+P.anchorY)*fr,Lr=Ce*t.X*Si;return{x:Math.floor((_t*t.X+P.anchorX)*fr-Me*t.X*Si),y:Math.floor(Ar-Lr)}}findMatches(P,oe,Me){const Ce=this.tileID.canonical.zP)}}class xt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Cr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(P){const oe=Math.round((P-this.lng)/360);if(oe!==0)for(const Me in this.indexes){const Ce=this.indexes[Me],Be={};for(const _t in Ce){const kt=Ce[_t];kt.tileID=kt.tileID.unwrapTo(kt.tileID.wrap+oe),Be[kt.tileID.key]=kt}this.indexes[Me]=Be}this.lng=P}addBucket(P,oe,Me){if(this.indexes[P.overscaledZ]&&this.indexes[P.overscaledZ][P.key]){if(this.indexes[P.overscaledZ][P.key].bucketInstanceId===oe.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(P.overscaledZ,this.indexes[P.overscaledZ][P.key])}for(let Be=0;BeP.overscaledZ)for(const kt in _t){const Xt=_t[kt];Xt.tileID.isChildOf(P)&&Xt.findMatches(oe.symbolInstances,P,Ce)}else{const kt=_t[P.scaledTo(Number(Be)).key];kt&&kt.findMatches(oe.symbolInstances,P,Ce)}}for(let Be=0;Be{oe[Me]=!0});for(const Me in this.layerIndexes)oe[Me]||delete this.layerIndexes[Me]}}const Vr=(Ue,P)=>t.t(Ue,P&&P.filter(oe=>oe.identifier!=="source.canvas")),Dr=t.aw();class qr extends t.E{constructor(P,oe={}){super(),this._rtlPluginLoaded=()=>{for(const Me in this.sourceCaches){const Ce=this.sourceCaches[Me].getSource().type;Ce!=="vector"&&Ce!=="geojson"||this.sourceCaches[Me].reload()}},this.map=P,this.dispatcher=new ne(ee(),P._getMapId()),this.dispatcher.registerMessageHandler("GG",(Me,Ce)=>this.getGlyphs(Me,Ce)),this.dispatcher.registerMessageHandler("GI",(Me,Ce)=>this.getImages(Me,Ce)),this.imageManager=new y,this.imageManager.setEventedParent(this),this.glyphManager=new F(P._requestManager,oe.localIdeographFontFamily),this.lineAtlas=new Z(256,512),this.crossTileSymbolIndex=new jr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",t.ay()),ut().on(Ae,this._rtlPluginLoaded),this.on("data",Me=>{if(Me.dataType!=="source"||Me.sourceDataType!=="metadata")return;const Ce=this.sourceCaches[Me.sourceId];if(!Ce)return;const Be=Ce.getSource();if(Be&&Be.vectorLayerIds)for(const _t in this._layers){const kt=this._layers[_t];kt.source===Be.id&&this._validateLayer(kt)}})}loadURL(P,oe={},Me){this.fire(new t.k("dataloading",{dataType:"style"})),oe.validate=typeof oe.validate!="boolean"||oe.validate;const Ce=this.map._requestManager.transformRequest(P,"Style");this._loadStyleRequest=new AbortController;const Be=this._loadStyleRequest;t.h(Ce,this._loadStyleRequest).then(_t=>{this._loadStyleRequest=null,this._load(_t.data,oe,Me)}).catch(_t=>{this._loadStyleRequest=null,_t&&!Be.signal.aborted&&this.fire(new t.j(_t))})}loadJSON(P,oe={},Me){this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,oe.validate=oe.validate!==!1,this._load(P,oe,Me)}).catch(()=>{})}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(Dr,{validate:!1})}_load(P,oe,Me){var Ce;const Be=oe.transformStyle?oe.transformStyle(Me,P):P;if(!oe.validate||!Vr(this,t.u(Be))){this._loaded=!0,this.stylesheet=Be;for(const _t in Be.sources)this.addSource(_t,Be.sources[_t],{validate:!1});Be.sprite?this._loadSprite(Be.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Be.glyphs),this._createLayers(),this.light=new R(this.stylesheet.light),this.sky=new j(this.stylesheet.sky),this.map.setTerrain((Ce=this.stylesheet.terrain)!==null&&Ce!==void 0?Ce:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){const P=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",P),this._order=P.map(oe=>oe.id),this._layers={},this._serializedLayers=null;for(const oe of P){const Me=t.aA(oe);Me.setEventedParent(this,{layer:{id:oe.id}}),this._layers[oe.id]=Me}}_loadSprite(P,oe=!1,Me=void 0){let Ce;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,(function(Be,_t,kt,Xt){return t._(this,void 0,void 0,function*(){const fr=w(Be),Ar=kt>1?"@2x":"",Lr={},tn={};for(const{id:xn,url:Ze}of fr){const tt=_t.transformRequest(m(Ze,Ar,".json"),"SpriteJSON");Lr[xn]=t.h(tt,Xt);const vt=_t.transformRequest(m(Ze,Ar,".png"),"SpriteImage");tn[xn]=l.getImage(vt,Xt)}return yield Promise.all([...Object.values(Lr),...Object.values(tn)]),(function(xn,Ze){return t._(this,void 0,void 0,function*(){const tt={};for(const vt in xn){tt[vt]={};const bt=i.getImageCanvasContext((yield Ze[vt]).data),zt=(yield xn[vt]).data;for(const Et in zt){const{width:Ut,height:gr,x:Tr,y:Pr,sdf:Yr,pixelRatio:sn,stretchX:En,stretchY:Pn,content:Xn,textFitWidth:Ta,textFitHeight:ri}=zt[Et];tt[vt][Et]={data:null,pixelRatio:sn,sdf:Yr,stretchX:En,stretchY:Pn,content:Xn,textFitWidth:Ta,textFitHeight:ri,spriteData:{width:Ut,height:gr,x:Tr,y:Pr,context:bt}}}}return tt})})(Lr,tn)})})(P,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Be=>{if(this._spriteRequest=null,Be)for(const _t in Be){this._spritesImagesIds[_t]=[];const kt=this._spritesImagesIds[_t]?this._spritesImagesIds[_t].filter(Xt=>!(Xt in Be)):[];for(const Xt of kt)this.imageManager.removeImage(Xt),this._changedImages[Xt]=!0;for(const Xt in Be[_t]){const fr=_t==="default"?Xt:`${_t}:${Xt}`;this._spritesImagesIds[_t].push(fr),fr in this.imageManager.images?this.imageManager.updateImage(fr,Be[_t][Xt],!1):this.imageManager.addImage(fr,Be[_t][Xt]),oe&&(this._changedImages[fr]=!0)}}}).catch(Be=>{this._spriteRequest=null,Ce=Be,this.fire(new t.j(Ce))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),oe&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),Me&&Me(Ce)})}_unloadSprite(){for(const P of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(P),this._changedImages[P]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}_validateLayer(P){const oe=this.sourceCaches[P.source];if(!oe)return;const Me=P.sourceLayer;if(!Me)return;const Ce=oe.getSource();(Ce.type==="geojson"||Ce.vectorLayerIds&&Ce.vectorLayerIds.indexOf(Me)===-1)&&this.fire(new t.j(new Error(`Source layer "${Me}" does not exist on source "${Ce.id}" as specified by style layer "${P.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const P in this.sourceCaches)if(!this.sourceCaches[P].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(P,oe=!1){const Me=this._serializedAllLayers();if(!P||P.length===0)return Object.values(oe?t.aB(Me):Me);const Ce=[];for(const Be of P)if(Me[Be]){const _t=oe?t.aB(Me[Be]):Me[Be];Ce.push(_t)}return Ce}_serializedAllLayers(){let P=this._serializedLayers;if(P)return P;P=this._serializedLayers={};const oe=Object.keys(this._layers);for(const Me of oe){const Ce=this._layers[Me];Ce.type!=="custom"&&(P[Me]=Ce.serialize())}return P}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const P in this.sourceCaches)if(this.sourceCaches[P].hasTransition())return!0;for(const P in this._layers)if(this._layers[P].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(P){if(!this._loaded)return;const oe=this._changed;if(oe){const Ce=Object.keys(this._updatedLayers),Be=Object.keys(this._removedLayers);(Ce.length||Be.length)&&this._updateWorkerLayers(Ce,Be);for(const _t in this._updatedSources){const kt=this._updatedSources[_t];if(kt==="reload")this._reloadSource(_t);else{if(kt!=="clear")throw new Error(`Invalid action ${kt}`);this._clearSource(_t)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const _t in this._updatedPaintProps)this._layers[_t].updateTransitions(P);this.light.updateTransitions(P),this.sky.updateTransitions(P),this._resetUpdates()}const Me={};for(const Ce in this.sourceCaches){const Be=this.sourceCaches[Ce];Me[Ce]=Be.used,Be.used=!1}for(const Ce of this._order){const Be=this._layers[Ce];Be.recalculate(P,this._availableImages),!Be.isHidden(P.zoom)&&Be.source&&(this.sourceCaches[Be.source].used=!0)}for(const Ce in Me){const Be=this.sourceCaches[Ce];!!Me[Ce]!=!!Be.used&&Be.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Ce}))}this.light.recalculate(P),this.sky.recalculate(P),this.z=P.zoom,oe&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const P=Object.keys(this._changedImages);if(P.length){for(const oe in this.sourceCaches)this.sourceCaches[oe].reloadTilesForDependencies(["icons","patterns"],P);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const P in this.sourceCaches)this.sourceCaches[P].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(P,oe){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(P,!1),removedIds:oe})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(P,oe={}){var Me;this._checkLoaded();const Ce=this.serialize();if(P=oe.transformStyle?oe.transformStyle(Ce,P):P,((Me=oe.validate)===null||Me===void 0||Me)&&Vr(this,t.u(P)))return!1;(P=t.aB(P)).layers=t.az(P.layers);const Be=t.aC(Ce,P),_t=this._getOperationsToPerform(Be);if(_t.unimplemented.length>0)throw new Error(`Unimplemented: ${_t.unimplemented.join(", ")}.`);if(_t.operations.length===0)return!1;for(const kt of _t.operations)kt();return this.stylesheet=P,this._serializedLayers=null,!0}_getOperationsToPerform(P){const oe=[],Me=[];for(const Ce of P)switch(Ce.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":oe.push(()=>this.addLayer.apply(this,Ce.args));break;case"removeLayer":oe.push(()=>this.removeLayer.apply(this,Ce.args));break;case"setPaintProperty":oe.push(()=>this.setPaintProperty.apply(this,Ce.args));break;case"setLayoutProperty":oe.push(()=>this.setLayoutProperty.apply(this,Ce.args));break;case"setFilter":oe.push(()=>this.setFilter.apply(this,Ce.args));break;case"addSource":oe.push(()=>this.addSource.apply(this,Ce.args));break;case"removeSource":oe.push(()=>this.removeSource.apply(this,Ce.args));break;case"setLayerZoomRange":oe.push(()=>this.setLayerZoomRange.apply(this,Ce.args));break;case"setLight":oe.push(()=>this.setLight.apply(this,Ce.args));break;case"setGeoJSONSourceData":oe.push(()=>this.setGeoJSONSourceData.apply(this,Ce.args));break;case"setGlyphs":oe.push(()=>this.setGlyphs.apply(this,Ce.args));break;case"setSprite":oe.push(()=>this.setSprite.apply(this,Ce.args));break;case"setSky":oe.push(()=>this.setSky.apply(this,Ce.args));break;case"setTerrain":oe.push(()=>this.map.setTerrain.apply(this,Ce.args));break;case"setTransition":oe.push(()=>{});break;default:Me.push(Ce.command)}return{operations:oe,unimplemented:Me}}addImage(P,oe){if(this.getImage(P))return this.fire(new t.j(new Error(`An image named "${P}" already exists.`)));this.imageManager.addImage(P,oe),this._afterImageUpdated(P)}updateImage(P,oe){this.imageManager.updateImage(P,oe)}getImage(P){return this.imageManager.getImage(P)}removeImage(P){if(!this.getImage(P))return this.fire(new t.j(new Error(`An image named "${P}" does not exist.`)));this.imageManager.removeImage(P),this._afterImageUpdated(P)}_afterImageUpdated(P){this._availableImages=this.imageManager.listImages(),this._changedImages[P]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(P,oe,Me={}){if(this._checkLoaded(),this.sourceCaches[P]!==void 0)throw new Error(`Source "${P}" already exists.`);if(!oe.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(oe).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(oe.type)>=0&&this._validate(t.u.source,`sources.${P}`,oe,null,Me))return;this.map&&this.map._collectResourceTiming&&(oe.collectResourceTiming=!0);const Ce=this.sourceCaches[P]=new Nt(P,oe,this.dispatcher);Ce.style=this,Ce.setEventedParent(this,()=>({isSourceLoaded:Ce.loaded(),source:Ce.serialize(),sourceId:P})),Ce.onAdd(this.map),this._changed=!0}removeSource(P){if(this._checkLoaded(),this.sourceCaches[P]===void 0)throw new Error("There is no source with this ID");for(const Me in this._layers)if(this._layers[Me].source===P)return this.fire(new t.j(new Error(`Source "${P}" cannot be removed while layer "${Me}" is using it.`)));const oe=this.sourceCaches[P];delete this.sourceCaches[P],delete this._updatedSources[P],oe.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:P})),oe.setEventedParent(null),oe.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(P,oe){if(this._checkLoaded(),this.sourceCaches[P]===void 0)throw new Error(`There is no source with this ID=${P}`);const Me=this.sourceCaches[P].getSource();if(Me.type!=="geojson")throw new Error(`geojsonSource.type is ${Me.type}, which is !== 'geojson`);Me.setData(oe),this._changed=!0}getSource(P){return this.sourceCaches[P]&&this.sourceCaches[P].getSource()}addLayer(P,oe,Me={}){this._checkLoaded();const Ce=P.id;if(this.getLayer(Ce))return void this.fire(new t.j(new Error(`Layer "${Ce}" already exists on this map.`)));let Be;if(P.type==="custom"){if(Vr(this,t.aD(P)))return;Be=t.aA(P)}else{if("source"in P&&typeof P.source=="object"&&(this.addSource(Ce,P.source),P=t.aB(P),P=t.e(P,{source:Ce})),this._validate(t.u.layer,`layers.${Ce}`,P,{arrayIndex:-1},Me))return;Be=t.aA(P),this._validateLayer(Be),Be.setEventedParent(this,{layer:{id:Ce}})}const _t=oe?this._order.indexOf(oe):this._order.length;if(oe&&_t===-1)this.fire(new t.j(new Error(`Cannot add layer "${Ce}" before non-existing layer "${oe}".`)));else{if(this._order.splice(_t,0,Ce),this._layerOrderChanged=!0,this._layers[Ce]=Be,this._removedLayers[Ce]&&Be.source&&Be.type!=="custom"){const kt=this._removedLayers[Ce];delete this._removedLayers[Ce],kt.type!==Be.type?this._updatedSources[Be.source]="clear":(this._updatedSources[Be.source]="reload",this.sourceCaches[Be.source].pause())}this._updateLayer(Be),Be.onAdd&&Be.onAdd(this.map)}}moveLayer(P,oe){if(this._checkLoaded(),this._changed=!0,!this._layers[P])return void this.fire(new t.j(new Error(`The layer '${P}' does not exist in the map's style and cannot be moved.`)));if(P===oe)return;const Me=this._order.indexOf(P);this._order.splice(Me,1);const Ce=oe?this._order.indexOf(oe):this._order.length;oe&&Ce===-1?this.fire(new t.j(new Error(`Cannot move layer "${P}" before non-existing layer "${oe}".`))):(this._order.splice(Ce,0,P),this._layerOrderChanged=!0)}removeLayer(P){this._checkLoaded();const oe=this._layers[P];if(!oe)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${P}".`)));oe.setEventedParent(null);const Me=this._order.indexOf(P);this._order.splice(Me,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[P]=oe,delete this._layers[P],this._serializedLayers&&delete this._serializedLayers[P],delete this._updatedLayers[P],delete this._updatedPaintProps[P],oe.onRemove&&oe.onRemove(this.map)}getLayer(P){return this._layers[P]}getLayersOrder(){return[...this._order]}hasLayer(P){return P in this._layers}setLayerZoomRange(P,oe,Me){this._checkLoaded();const Ce=this.getLayer(P);Ce?Ce.minzoom===oe&&Ce.maxzoom===Me||(oe!=null&&(Ce.minzoom=oe),Me!=null&&(Ce.maxzoom=Me),this._updateLayer(Ce)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${P}".`)))}setFilter(P,oe,Me={}){this._checkLoaded();const Ce=this.getLayer(P);if(Ce){if(!t.aE(Ce.filter,oe))return oe==null?(Ce.filter=void 0,void this._updateLayer(Ce)):void(this._validate(t.u.filter,`layers.${Ce.id}.filter`,oe,null,Me)||(Ce.filter=t.aB(oe),this._updateLayer(Ce)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${P}".`)))}getFilter(P){return t.aB(this.getLayer(P).filter)}setLayoutProperty(P,oe,Me,Ce={}){this._checkLoaded();const Be=this.getLayer(P);Be?t.aE(Be.getLayoutProperty(oe),Me)||(Be.setLayoutProperty(oe,Me,Ce),this._updateLayer(Be)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${P}".`)))}getLayoutProperty(P,oe){const Me=this.getLayer(P);if(Me)return Me.getLayoutProperty(oe);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${P}".`)))}setPaintProperty(P,oe,Me,Ce={}){this._checkLoaded();const Be=this.getLayer(P);Be?t.aE(Be.getPaintProperty(oe),Me)||(Be.setPaintProperty(oe,Me,Ce)&&this._updateLayer(Be),this._changed=!0,this._updatedPaintProps[P]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${P}".`)))}getPaintProperty(P,oe){return this.getLayer(P).getPaintProperty(oe)}setFeatureState(P,oe){this._checkLoaded();const Me=P.source,Ce=P.sourceLayer,Be=this.sourceCaches[Me];if(Be===void 0)return void this.fire(new t.j(new Error(`The source '${Me}' does not exist in the map's style.`)));const _t=Be.getSource().type;_t==="geojson"&&Ce?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):_t!=="vector"||Ce?(P.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Be.setFeatureState(Ce,P.id,oe)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(P,oe){this._checkLoaded();const Me=P.source,Ce=this.sourceCaches[Me];if(Ce===void 0)return void this.fire(new t.j(new Error(`The source '${Me}' does not exist in the map's style.`)));const Be=Ce.getSource().type,_t=Be==="vector"?P.sourceLayer:void 0;Be!=="vector"||_t?oe&&typeof P.id!="string"&&typeof P.id!="number"?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):Ce.removeFeatureState(_t,P.id,oe):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(P){this._checkLoaded();const oe=P.source,Me=P.sourceLayer,Ce=this.sourceCaches[oe];if(Ce!==void 0)return Ce.getSource().type!=="vector"||Me?(P.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Ce.getFeatureState(Me,P.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${oe}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const P=t.aF(this.sourceCaches,Be=>Be.serialize()),oe=this._serializeByIds(this._order,!0),Me=this.map.getTerrain()||void 0,Ce=this.stylesheet;return t.aG({version:Ce.version,name:Ce.name,metadata:Ce.metadata,light:Ce.light,sky:Ce.sky,center:Ce.center,zoom:Ce.zoom,bearing:Ce.bearing,pitch:Ce.pitch,sprite:Ce.sprite,glyphs:Ce.glyphs,transition:Ce.transition,sources:P,layers:oe,terrain:Me},Be=>Be!==void 0)}_updateLayer(P){this._updatedLayers[P.id]=!0,P.source&&!this._updatedSources[P.source]&&this.sourceCaches[P.source].getSource().type!=="raster"&&(this._updatedSources[P.source]="reload",this.sourceCaches[P.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(P){const oe=_t=>this._layers[_t].type==="fill-extrusion",Me={},Ce=[];for(let _t=this._order.length-1;_t>=0;_t--){const kt=this._order[_t];if(oe(kt)){Me[kt]=_t;for(const Xt of P){const fr=Xt[kt];if(fr)for(const Ar of fr)Ce.push(Ar)}}}Ce.sort((_t,kt)=>kt.intersectionZ-_t.intersectionZ);const Be=[];for(let _t=this._order.length-1;_t>=0;_t--){const kt=this._order[_t];if(oe(kt))for(let Xt=Ce.length-1;Xt>=0;Xt--){const fr=Ce[Xt].feature;if(Me[fr.layer.id]<_t)break;Be.push(fr),Ce.pop()}else for(const Xt of P){const fr=Xt[kt];if(fr)for(const Ar of fr)Be.push(Ar.feature)}}return Be}queryRenderedFeatures(P,oe,Me){oe&&oe.filter&&this._validate(t.u.filter,"queryRenderedFeatures.filter",oe.filter,null,oe);const Ce={};if(oe&&oe.layers){if(!Array.isArray(oe.layers))return this.fire(new t.j(new Error("parameters.layers must be an Array."))),[];for(const kt of oe.layers){const Xt=this._layers[kt];if(!Xt)return this.fire(new t.j(new Error(`The layer '${kt}' does not exist in the map's style and cannot be queried for features.`))),[];Ce[Xt.source]=!0}}const Be=[];oe.availableImages=this._availableImages;const _t=this._serializedAllLayers();for(const kt in this.sourceCaches)oe.layers&&!Ce[kt]||Be.push(te(this.sourceCaches[kt],this._layers,_t,P,oe,Me));return this.placement&&Be.push((function(kt,Xt,fr,Ar,Lr,tn,xn){const Ze={},tt=tn.queryRenderedSymbols(Ar),vt=[];for(const bt of Object.keys(tt).map(Number))vt.push(xn[bt]);vt.sort(H);for(const bt of vt){const zt=bt.featureIndex.lookupSymbolFeatures(tt[bt.bucketInstanceId],Xt,bt.bucketIndex,bt.sourceLayerIndex,Lr.filter,Lr.layers,Lr.availableImages,kt);for(const Et in zt){const Ut=Ze[Et]=Ze[Et]||[],gr=zt[Et];gr.sort((Tr,Pr)=>{const Yr=bt.featureSortOrder;if(Yr){const sn=Yr.indexOf(Tr.featureIndex);return Yr.indexOf(Pr.featureIndex)-sn}return Pr.featureIndex-Tr.featureIndex});for(const Tr of gr)Ut.push(Tr)}}for(const bt in Ze)Ze[bt].forEach(zt=>{const Et=zt.feature,Ut=fr[kt[bt].source].getFeatureState(Et.layer["source-layer"],Et.id);Et.source=Et.layer.source,Et.layer["source-layer"]&&(Et.sourceLayer=Et.layer["source-layer"]),Et.state=Ut});return Ze})(this._layers,_t,this.sourceCaches,P,oe,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Be)}querySourceFeatures(P,oe){oe&&oe.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",oe.filter,null,oe);const Me=this.sourceCaches[P];return Me?(function(Ce,Be){const _t=Ce.getRenderableIds().map(fr=>Ce.getTileByID(fr)),kt=[],Xt={};for(let fr=0;fr<_t.length;fr++){const Ar=_t[fr],Lr=Ar.tileID.canonical.key;Xt[Lr]||(Xt[Lr]=!0,Ar.querySourceFeatures(kt,Be))}return kt})(Me,oe):[]}getLight(){return this.light.getLight()}setLight(P,oe={}){this._checkLoaded();const Me=this.light.getLight();let Ce=!1;for(const _t in P)if(!t.aE(P[_t],Me[_t])){Ce=!0;break}if(!Ce)return;const Be={now:i.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(P,oe),this.light.updateTransitions(Be)}getSky(){var P;return(P=this.stylesheet)===null||P===void 0?void 0:P.sky}setSky(P,oe={}){const Me=this.getSky();let Ce=!1;if(!P&&!Me)return;if(P&&!Me)Ce=!0;else if(!P&&Me)Ce=!0;else for(const _t in P)if(!t.aE(P[_t],Me[_t])){Ce=!0;break}if(!Ce)return;const Be={now:i.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=P,this.sky.setSky(P,oe),this.sky.updateTransitions(Be)}_validate(P,oe,Me,Ce,Be={}){return(!Be||Be.validate!==!1)&&Vr(this,P.call(t.u,t.e({key:oe,style:this.serialize(),value:Me,styleSpec:t.v},Ce)))}_remove(P=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),ut().off(Ae,this._rtlPluginLoaded);for(const oe in this._layers)this._layers[oe].setEventedParent(null);for(const oe in this.sourceCaches){const Me=this.sourceCaches[oe];Me.setEventedParent(null),Me.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),P&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(P)}_clearSource(P){this.sourceCaches[P].clearTiles()}_reloadSource(P){this.sourceCaches[P].resume(),this.sourceCaches[P].reload()}_updateSources(P){for(const oe in this.sourceCaches)this.sourceCaches[oe].update(P,this.map.terrain)}_generateCollisionBoxes(){for(const P in this.sourceCaches)this._reloadSource(P)}_updatePlacement(P,oe,Me,Ce,Be=!1){let _t=!1,kt=!1;const Xt={};for(const fr of this._order){const Ar=this._layers[fr];if(Ar.type!=="symbol")continue;if(!Xt[Ar.source]){const tn=this.sourceCaches[Ar.source];Xt[Ar.source]=tn.getRenderableIds(!0).map(xn=>tn.getTileByID(xn)).sort((xn,Ze)=>Ze.tileID.overscaledZ-xn.tileID.overscaledZ||(xn.tileID.isLessThan(Ze.tileID)?-1:1))}const Lr=this.crossTileSymbolIndex.addLayer(Ar,Xt[Ar.source],P.center.lng);_t=_t||Lr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Be=Be||this._layerOrderChanged||Me===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.now(),P.zoom))&&(this.pauseablePlacement=new pi(P,this.map.terrain,this._order,Be,oe,Me,Ce,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Xt),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),kt=!0),_t&&this.pauseablePlacement.placement.setStale()),kt||_t)for(const fr of this._order){const Ar=this._layers[fr];Ar.type==="symbol"&&this.placement.updateLayerOpacities(Ar,Xt[Ar.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.now())}_releaseSymbolFadeTiles(){for(const P in this.sourceCaches)this.sourceCaches[P].releaseSymbolFadeTiles()}getImages(P,oe){return t._(this,void 0,void 0,function*(){const Me=yield this.imageManager.getImages(oe.icons);this._updateTilesForChangedImages();const Ce=this.sourceCaches[oe.source];return Ce&&Ce.setDependencies(oe.tileID.key,oe.type,oe.icons),Me})}getGlyphs(P,oe){return t._(this,void 0,void 0,function*(){const Me=yield this.glyphManager.getGlyphs(oe.stacks),Ce=this.sourceCaches[oe.source];return Ce&&Ce.setDependencies(oe.tileID.key,oe.type,[""]),Me})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(P,oe={}){this._checkLoaded(),P&&this._validate(t.u.glyphs,"glyphs",P,null,oe)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=P,this.glyphManager.entries={},this.glyphManager.setURL(P))}addSprite(P,oe,Me={},Ce){this._checkLoaded();const Be=[{id:P,url:oe}],_t=[...w(this.stylesheet.sprite),...Be];this._validate(t.u.sprite,"sprite",_t,null,Me)||(this.stylesheet.sprite=_t,this._loadSprite(Be,!0,Ce))}removeSprite(P){this._checkLoaded();const oe=w(this.stylesheet.sprite);if(oe.find(Me=>Me.id===P)){if(this._spritesImagesIds[P])for(const Me of this._spritesImagesIds[P])this.imageManager.removeImage(Me),this._changedImages[Me]=!0;oe.splice(oe.findIndex(Me=>Me.id===P),1),this.stylesheet.sprite=oe.length>0?oe:void 0,delete this._spritesImagesIds[P],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}else this.fire(new t.j(new Error(`Sprite "${P}" doesn't exists on this map.`)))}getSprite(){return w(this.stylesheet.sprite)}setSprite(P,oe={},Me){this._checkLoaded(),P&&this._validate(t.u.sprite,"sprite",P,null,oe)||(this.stylesheet.sprite=P,P?this._loadSprite(P,!0,Me):(this._unloadSprite(),Me&&Me(null)))}}var un=t.Y([{name:"a_pos",type:"Int16",components:2}]);const Jr={prelude:At(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) @@ -3743,102 +3743,69 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:At("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:At("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:At("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:At("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function At(Ue,P){const oe=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Se=P.match(/attribute ([\w]+) ([\w]+)/g),ke=Ue.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Be=P.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),gt=Be?Be.concat(ke):ke,kt={};return{fragmentSource:Ue=Ue.replace(oe,(Gt,cr,Ar,Cr,Qr)=>(kt[Qr]=!0,cr==="define"?` -#ifndef HAS_UNIFORM_u_${Qr} -varying ${Ar} ${Cr} ${Qr}; +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:At("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:At("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:At("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:At("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function At(Ue,P){const oe=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Me=P.match(/attribute ([\w]+) ([\w]+)/g),Ce=Ue.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Be=P.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),_t=Be?Be.concat(Ce):Ce,kt={};return{fragmentSource:Ue=Ue.replace(oe,(Xt,fr,Ar,Lr,tn)=>(kt[tn]=!0,fr==="define"?` +#ifndef HAS_UNIFORM_u_${tn} +varying ${Ar} ${Lr} ${tn}; #else -uniform ${Ar} ${Cr} u_${Qr}; +uniform ${Ar} ${Lr} u_${tn}; #endif `:` -#ifdef HAS_UNIFORM_u_${Qr} - ${Ar} ${Cr} ${Qr} = u_${Qr}; -#endif -`)),vertexSource:P=P.replace(oe,(Gt,cr,Ar,Cr,Qr)=>{const _n=Cr==="float"?"vec2":"vec4",Ze=Qr.match(/color/)?"color":_n;return kt[Qr]?cr==="define"?` -#ifndef HAS_UNIFORM_u_${Qr} -uniform lowp float u_${Qr}_t; -attribute ${Ar} ${_n} a_${Qr}; -varying ${Ar} ${Cr} ${Qr}; +#ifdef HAS_UNIFORM_u_${tn} + ${Ar} ${Lr} ${tn} = u_${tn}; +#endif +`)),vertexSource:P=P.replace(oe,(Xt,fr,Ar,Lr,tn)=>{const xn=Lr==="float"?"vec2":"vec4",Ze=tn.match(/color/)?"color":xn;return kt[tn]?fr==="define"?` +#ifndef HAS_UNIFORM_u_${tn} +uniform lowp float u_${tn}_t; +attribute ${Ar} ${xn} a_${tn}; +varying ${Ar} ${Lr} ${tn}; #else -uniform ${Ar} ${Cr} u_${Qr}; +uniform ${Ar} ${Lr} u_${tn}; #endif `:Ze==="vec4"?` -#ifndef HAS_UNIFORM_u_${Qr} - ${Qr} = a_${Qr}; +#ifndef HAS_UNIFORM_u_${tn} + ${tn} = a_${tn}; #else - ${Ar} ${Cr} ${Qr} = u_${Qr}; + ${Ar} ${Lr} ${tn} = u_${tn}; #endif `:` -#ifndef HAS_UNIFORM_u_${Qr} - ${Qr} = unpack_mix_${Ze}(a_${Qr}, u_${Qr}_t); +#ifndef HAS_UNIFORM_u_${tn} + ${tn} = unpack_mix_${Ze}(a_${tn}, u_${tn}_t); #else - ${Ar} ${Cr} ${Qr} = u_${Qr}; + ${Ar} ${Lr} ${tn} = u_${tn}; #endif -`:cr==="define"?` -#ifndef HAS_UNIFORM_u_${Qr} -uniform lowp float u_${Qr}_t; -attribute ${Ar} ${_n} a_${Qr}; +`:fr==="define"?` +#ifndef HAS_UNIFORM_u_${tn} +uniform lowp float u_${tn}_t; +attribute ${Ar} ${xn} a_${tn}; #else -uniform ${Ar} ${Cr} u_${Qr}; +uniform ${Ar} ${Lr} u_${tn}; #endif `:Ze==="vec4"?` -#ifndef HAS_UNIFORM_u_${Qr} - ${Ar} ${Cr} ${Qr} = a_${Qr}; +#ifndef HAS_UNIFORM_u_${tn} + ${Ar} ${Lr} ${tn} = a_${tn}; #else - ${Ar} ${Cr} ${Qr} = u_${Qr}; + ${Ar} ${Lr} ${tn} = u_${tn}; #endif `:` -#ifndef HAS_UNIFORM_u_${Qr} - ${Ar} ${Cr} ${Qr} = unpack_mix_${Ze}(a_${Qr}, u_${Qr}_t); +#ifndef HAS_UNIFORM_u_${tn} + ${Ar} ${Lr} ${tn} = unpack_mix_${Ze}(a_${tn}, u_${tn}_t); #else - ${Ar} ${Cr} ${Qr} = u_${Qr}; -#endif -`}),staticAttributes:Se,staticUniforms:gt}}class or{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(P,oe,Se,ke,Be,gt,kt,Gt,cr){this.context=P;let Ar=this.boundPaintVertexBuffers.length!==ke.length;for(let Cr=0;!Ar&&Cr({u_matrix:Ue,u_texture:0,u_ele_delta:P,u_fog_matrix:oe,u_fog_color:Se?Se.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:Se?Se.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Se?Se.calculateFogBlendOpacity(ke):0,u_horizon_color:Se?Se.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:Se?Se.properties.get("horizon-fog-blend"):1});function un(Ue){const P=[];for(let oe=0;oe({u_depth:new t.aH(Tr,Lr.u_depth),u_terrain:new t.aH(Tr,Lr.u_terrain),u_terrain_dim:new t.aI(Tr,Lr.u_terrain_dim),u_terrain_matrix:new t.aJ(Tr,Lr.u_terrain_matrix),u_terrain_unpack:new t.aK(Tr,Lr.u_terrain_unpack),u_terrain_exaggeration:new t.aI(Tr,Lr.u_terrain_exaggeration)}))(P,mr),this.binderUniforms=Se?Se.getUniforms(P,mr):[]}draw(P,oe,Se,ke,Be,gt,kt,Gt,cr,Ar,Cr,Qr,_n,Ze,et,ht,_t,zt){const Et=P.gl;if(this.failedToCreate)return;if(P.program.set(this.program),P.setDepthMode(Se),P.setStencilMode(ke),P.setColorMode(Be),P.setCullFace(gt),Gt){P.activeTexture.set(Et.TEXTURE2),Et.bindTexture(Et.TEXTURE_2D,Gt.depthTexture),P.activeTexture.set(Et.TEXTURE3),Et.bindTexture(Et.TEXTURE_2D,Gt.texture);for(const mr in this.terrainUniforms)this.terrainUniforms[mr].set(Gt[mr])}for(const mr in this.fixedUniforms)this.fixedUniforms[mr].set(kt[mr]);et&&et.setUniforms(P,this.binderUniforms,_n,{zoom:Ze});let Ut=0;switch(oe){case Et.LINES:Ut=2;break;case Et.TRIANGLES:Ut=3;break;case Et.LINE_STRIP:Ut=1}for(const mr of Qr.get()){const Tr=mr.vaos||(mr.vaos={});(Tr[cr]||(Tr[cr]=new or)).bind(P,this,Ar,et?et.getPaintVertexBuffers():[],Cr,mr.vertexOffset,ht,_t,zt),Et.drawElements(oe,mr.primitiveLength*Ut,Et.UNSIGNED_SHORT,mr.primitiveOffset*Ut*2)}}}function jn(Ue,P,oe){const Se=1/Kn(oe,1,P.transform.tileZoom),ke=Math.pow(2,oe.tileID.overscaledZ),Be=oe.tileSize*Math.pow(2,P.transform.tileZoom)/ke,gt=Be*(oe.tileID.canonical.x+oe.tileID.wrap*ke),kt=Be*oe.tileID.canonical.y;return{u_image:0,u_texsize:oe.imageAtlasTexture.size,u_scale:[Se,Ue.fromScale,Ue.toScale],u_fade:Ue.t,u_pixel_coord_upper:[gt>>16,kt>>16],u_pixel_coord_lower:[65535>,65535&kt]}}const Un=(Ue,P,oe,Se)=>{const ke=P.style.light,Be=ke.properties.get("position"),gt=[Be.x,Be.y,Be.z],kt=(function(){var cr=new t.A(9);return t.A!=Float32Array&&(cr[1]=0,cr[2]=0,cr[3]=0,cr[5]=0,cr[6]=0,cr[7]=0),cr[0]=1,cr[4]=1,cr[8]=1,cr})();ke.properties.get("anchor")==="viewport"&&(function(cr,Ar){var Cr=Math.sin(Ar),Qr=Math.cos(Ar);cr[0]=Qr,cr[1]=Cr,cr[2]=0,cr[3]=-Cr,cr[4]=Qr,cr[5]=0,cr[6]=0,cr[7]=0,cr[8]=1})(kt,-P.transform.angle),(function(cr,Ar,Cr){var Qr=Ar[0],_n=Ar[1],Ze=Ar[2];cr[0]=Qr*Cr[0]+_n*Cr[3]+Ze*Cr[6],cr[1]=Qr*Cr[1]+_n*Cr[4]+Ze*Cr[7],cr[2]=Qr*Cr[2]+_n*Cr[5]+Ze*Cr[8]})(gt,gt,kt);const Gt=ke.properties.get("color");return{u_matrix:Ue,u_lightpos:gt,u_lightintensity:ke.properties.get("intensity"),u_lightcolor:[Gt.r,Gt.g,Gt.b],u_vertical_gradient:+oe,u_opacity:Se}},cn=(Ue,P,oe,Se,ke,Be,gt)=>t.e(Un(Ue,P,oe,Se),jn(Be,P,gt),{u_height_factor:-Math.pow(2,ke.overscaledZ)/gt.tileSize/8}),In=Ue=>({u_matrix:Ue}),xi=(Ue,P,oe,Se)=>t.e(In(Ue),jn(oe,P,Se)),Ea=(Ue,P)=>({u_matrix:Ue,u_world:P}),Pi=(Ue,P,oe,Se,ke)=>t.e(xi(Ue,P,oe,Se),{u_world:ke}),Xi=(Ue,P,oe,Se)=>{const ke=Ue.transform;let Be,gt;if(Se.paint.get("circle-pitch-alignment")==="map"){const kt=Kn(oe,1,ke.zoom);Be=!0,gt=[kt,kt]}else Be=!1,gt=ke.pixelsToGLUnits;return{u_camera_to_center_distance:ke.cameraToCenterDistance,u_scale_with_map:+(Se.paint.get("circle-pitch-scale")==="map"),u_matrix:Ue.translatePosMatrix(P.posMatrix,oe,Se.paint.get("circle-translate"),Se.paint.get("circle-translate-anchor")),u_pitch_with_map:+Be,u_device_pixel_ratio:Ue.pixelRatio,u_extrude_scale:gt}},uo=(Ue,P,oe)=>({u_matrix:Ue,u_inv_matrix:P,u_camera_to_center_distance:oe.cameraToCenterDistance,u_viewport_size:[oe.width,oe.height]}),so=(Ue,P,oe=1)=>({u_matrix:Ue,u_color:P,u_overlay:0,u_overlay_scale:oe}),Eo=Ue=>({u_matrix:Ue}),vi=(Ue,P,oe,Se)=>({u_matrix:Ue,u_extrude_scale:Kn(P,1,oe),u_intensity:Se}),ns=(Ue,P,oe,Se)=>{const ke=t.H();t.aP(ke,0,Ue.width,Ue.height,0,0,1);const Be=Ue.context.gl;return{u_matrix:ke,u_world:[Be.drawingBufferWidth,Be.drawingBufferHeight],u_image:oe,u_color_ramp:Se,u_opacity:P.paint.get("heatmap-opacity")}};function Xo(Ue,P){const oe=Math.pow(2,P.canonical.z),Se=P.canonical.y;return[new t.Z(0,Se/oe).toLngLat().lat,new t.Z(0,(Se+1)/oe).toLngLat().lat]}const Ys=(Ue,P,oe,Se)=>{const ke=Ue.transform;return{u_matrix:Hs(Ue,P,oe,Se),u_ratio:1/Kn(P,1,ke.zoom),u_device_pixel_ratio:Ue.pixelRatio,u_units_to_pixels:[1/ke.pixelsToGLUnits[0],1/ke.pixelsToGLUnits[1]]}},vs=(Ue,P,oe,Se,ke)=>t.e(Ys(Ue,P,oe,ke),{u_image:0,u_image_height:Se}),es=(Ue,P,oe,Se,ke)=>{const Be=Ue.transform,gt=Zs(P,Be);return{u_matrix:Hs(Ue,P,oe,ke),u_texsize:P.imageAtlasTexture.size,u_ratio:1/Kn(P,1,Be.zoom),u_device_pixel_ratio:Ue.pixelRatio,u_image:0,u_scale:[gt,Se.fromScale,Se.toScale],u_fade:Se.t,u_units_to_pixels:[1/Be.pixelsToGLUnits[0],1/Be.pixelsToGLUnits[1]]}},qo=(Ue,P,oe,Se,ke,Be)=>{const gt=Ue.lineAtlas,kt=Zs(P,Ue.transform),Gt=oe.layout.get("line-cap")==="round",cr=gt.getDash(Se.from,Gt),Ar=gt.getDash(Se.to,Gt),Cr=cr.width*ke.fromScale,Qr=Ar.width*ke.toScale;return t.e(Ys(Ue,P,oe,Be),{u_patternscale_a:[kt/Cr,-cr.height/2],u_patternscale_b:[kt/Qr,-Ar.height/2],u_sdfgamma:gt.width/(256*Math.min(Cr,Qr)*Ue.pixelRatio)/2,u_image:0,u_tex_y_a:cr.y,u_tex_y_b:Ar.y,u_mix:ke.t})};function Zs(Ue,P){return 1/Kn(Ue,1,P.tileZoom)}function Hs(Ue,P,oe,Se){return Ue.translatePosMatrix(Se?Se.posMatrix:P.tileID.posMatrix,P,oe.paint.get("line-translate"),oe.paint.get("line-translate-anchor"))}const sl=(Ue,P,oe,Se,ke)=>{return{u_matrix:Ue,u_tl_parent:P,u_scale_parent:oe,u_buffer_scale:1,u_fade_t:Se.mix,u_opacity:Se.opacity*ke.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:ke.paint.get("raster-brightness-min"),u_brightness_high:ke.paint.get("raster-brightness-max"),u_saturation_factor:(gt=ke.paint.get("raster-saturation"),gt>0?1-1/(1.001-gt):-gt),u_contrast_factor:(Be=ke.paint.get("raster-contrast"),Be>0?1/(1-Be):1+Be),u_spin_weights:ds(ke.paint.get("raster-hue-rotate"))};var Be,gt};function ds(Ue){Ue*=Math.PI/180;const P=Math.sin(Ue),oe=Math.cos(Ue);return[(2*oe+1)/3,(-Math.sqrt(3)*P-oe+1)/3,(Math.sqrt(3)*P-oe+1)/3]}const Ko=(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Ar,Cr,Qr,_n)=>{const Ze=gt.transform;return{u_is_size_zoom_constant:+(Ue==="constant"||Ue==="source"),u_is_size_feature_constant:+(Ue==="constant"||Ue==="camera"),u_size_t:P?P.uSizeT:0,u_size:P?P.uSize:0,u_camera_to_center_distance:Ze.cameraToCenterDistance,u_pitch:Ze.pitch/360*2*Math.PI,u_rotate_symbol:+oe,u_aspect_ratio:Ze.width/Ze.height,u_fade_change:gt.options.fadeDuration?gt.symbolFadeChange:1,u_matrix:kt,u_label_plane_matrix:Gt,u_coord_matrix:cr,u_is_text:+Cr,u_pitch_with_map:+Se,u_is_along_line:ke,u_is_variable_anchor:Be,u_texsize:Qr,u_texture:0,u_translation:Ar,u_pitched_scale:_n}},_o=(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Ar,Cr,Qr,_n,Ze)=>{const et=gt.transform;return t.e(Ko(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Ar,Cr,Qr,Ze),{u_gamma_scale:Se?Math.cos(et._pitch)*et.cameraToCenterDistance:1,u_device_pixel_ratio:gt.pixelRatio,u_is_halo:1})},ps=(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Ar,Cr,Qr,_n)=>t.e(_o(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr,Ar,!0,Cr,!0,_n),{u_texsize_icon:Qr,u_texture_icon:1}),ll=(Ue,P,oe)=>({u_matrix:Ue,u_opacity:P,u_color:oe}),kl=(Ue,P,oe,Se,ke,Be)=>t.e((function(gt,kt,Gt,cr){const Ar=Gt.imageManager.getPattern(gt.from.toString()),Cr=Gt.imageManager.getPattern(gt.to.toString()),{width:Qr,height:_n}=Gt.imageManager.getPixelSize(),Ze=Math.pow(2,cr.tileID.overscaledZ),et=cr.tileSize*Math.pow(2,Gt.transform.tileZoom)/Ze,ht=et*(cr.tileID.canonical.x+cr.tileID.wrap*Ze),_t=et*cr.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Ar.tl,u_pattern_br_a:Ar.br,u_pattern_tl_b:Cr.tl,u_pattern_br_b:Cr.br,u_texsize:[Qr,_n],u_mix:kt.t,u_pattern_size_a:Ar.displaySize,u_pattern_size_b:Cr.displaySize,u_scale_a:kt.fromScale,u_scale_b:kt.toScale,u_tile_units_to_pixels:1/Kn(cr,1,Gt.transform.tileZoom),u_pixel_coord_upper:[ht>>16,_t>>16],u_pixel_coord_lower:[65535&ht,65535&_t]}})(Se,Be,oe,ke),{u_matrix:Ue,u_opacity:P}),Rl={fillExtrusion:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_lightpos:new t.aN(Ue,P.u_lightpos),u_lightintensity:new t.aI(Ue,P.u_lightintensity),u_lightcolor:new t.aN(Ue,P.u_lightcolor),u_vertical_gradient:new t.aI(Ue,P.u_vertical_gradient),u_opacity:new t.aI(Ue,P.u_opacity)}),fillExtrusionPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_lightpos:new t.aN(Ue,P.u_lightpos),u_lightintensity:new t.aI(Ue,P.u_lightintensity),u_lightcolor:new t.aN(Ue,P.u_lightcolor),u_vertical_gradient:new t.aI(Ue,P.u_vertical_gradient),u_height_factor:new t.aI(Ue,P.u_height_factor),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade),u_opacity:new t.aI(Ue,P.u_opacity)}),fill:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix)}),fillPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),fillOutline:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world)}),fillOutlinePattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),circle:(Ue,P)=>({u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_scale_with_map:new t.aH(Ue,P.u_scale_with_map),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_extrude_scale:new t.aO(Ue,P.u_extrude_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_matrix:new t.aJ(Ue,P.u_matrix)}),collisionBox:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_pixel_extrude_scale:new t.aO(Ue,P.u_pixel_extrude_scale)}),collisionCircle:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_inv_matrix:new t.aJ(Ue,P.u_inv_matrix),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_viewport_size:new t.aO(Ue,P.u_viewport_size)}),debug:(Ue,P)=>({u_color:new t.aL(Ue,P.u_color),u_matrix:new t.aJ(Ue,P.u_matrix),u_overlay:new t.aH(Ue,P.u_overlay),u_overlay_scale:new t.aI(Ue,P.u_overlay_scale)}),clippingMask:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix)}),heatmap:(Ue,P)=>({u_extrude_scale:new t.aI(Ue,P.u_extrude_scale),u_intensity:new t.aI(Ue,P.u_intensity),u_matrix:new t.aJ(Ue,P.u_matrix)}),heatmapTexture:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world),u_image:new t.aH(Ue,P.u_image),u_color_ramp:new t.aH(Ue,P.u_color_ramp),u_opacity:new t.aI(Ue,P.u_opacity)}),hillshade:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_latrange:new t.aO(Ue,P.u_latrange),u_light:new t.aO(Ue,P.u_light),u_shadow:new t.aL(Ue,P.u_shadow),u_highlight:new t.aL(Ue,P.u_highlight),u_accent:new t.aL(Ue,P.u_accent)}),hillshadePrepare:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_dimension:new t.aO(Ue,P.u_dimension),u_zoom:new t.aI(Ue,P.u_zoom),u_unpack:new t.aK(Ue,P.u_unpack)}),line:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels)}),lineGradient:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_image:new t.aH(Ue,P.u_image),u_image_height:new t.aI(Ue,P.u_image_height)}),linePattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texsize:new t.aO(Ue,P.u_texsize),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_image:new t.aH(Ue,P.u_image),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),lineSDF:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_patternscale_a:new t.aO(Ue,P.u_patternscale_a),u_patternscale_b:new t.aO(Ue,P.u_patternscale_b),u_sdfgamma:new t.aI(Ue,P.u_sdfgamma),u_image:new t.aH(Ue,P.u_image),u_tex_y_a:new t.aI(Ue,P.u_tex_y_a),u_tex_y_b:new t.aI(Ue,P.u_tex_y_b),u_mix:new t.aI(Ue,P.u_mix)}),raster:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_tl_parent:new t.aO(Ue,P.u_tl_parent),u_scale_parent:new t.aI(Ue,P.u_scale_parent),u_buffer_scale:new t.aI(Ue,P.u_buffer_scale),u_fade_t:new t.aI(Ue,P.u_fade_t),u_opacity:new t.aI(Ue,P.u_opacity),u_image0:new t.aH(Ue,P.u_image0),u_image1:new t.aH(Ue,P.u_image1),u_brightness_low:new t.aI(Ue,P.u_brightness_low),u_brightness_high:new t.aI(Ue,P.u_brightness_high),u_saturation_factor:new t.aI(Ue,P.u_saturation_factor),u_contrast_factor:new t.aI(Ue,P.u_contrast_factor),u_spin_weights:new t.aN(Ue,P.u_spin_weights)}),symbolIcon:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texture:new t.aH(Ue,P.u_texture),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),symbolSDF:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texture:new t.aH(Ue,P.u_texture),u_gamma_scale:new t.aI(Ue,P.u_gamma_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_is_halo:new t.aH(Ue,P.u_is_halo),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),symbolTextAndIcon:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texsize_icon:new t.aO(Ue,P.u_texsize_icon),u_texture:new t.aH(Ue,P.u_texture),u_texture_icon:new t.aH(Ue,P.u_texture_icon),u_gamma_scale:new t.aI(Ue,P.u_gamma_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_is_halo:new t.aH(Ue,P.u_is_halo),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),background:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_opacity:new t.aI(Ue,P.u_opacity),u_color:new t.aL(Ue,P.u_color)}),backgroundPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_opacity:new t.aI(Ue,P.u_opacity),u_image:new t.aH(Ue,P.u_image),u_pattern_tl_a:new t.aO(Ue,P.u_pattern_tl_a),u_pattern_br_a:new t.aO(Ue,P.u_pattern_br_a),u_pattern_tl_b:new t.aO(Ue,P.u_pattern_tl_b),u_pattern_br_b:new t.aO(Ue,P.u_pattern_br_b),u_texsize:new t.aO(Ue,P.u_texsize),u_mix:new t.aI(Ue,P.u_mix),u_pattern_size_a:new t.aO(Ue,P.u_pattern_size_a),u_pattern_size_b:new t.aO(Ue,P.u_pattern_size_b),u_scale_a:new t.aI(Ue,P.u_scale_a),u_scale_b:new t.aI(Ue,P.u_scale_b),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(Ue,P.u_tile_units_to_pixels)}),terrain:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texture:new t.aH(Ue,P.u_texture),u_ele_delta:new t.aI(Ue,P.u_ele_delta),u_fog_matrix:new t.aJ(Ue,P.u_fog_matrix),u_fog_color:new t.aL(Ue,P.u_fog_color),u_fog_ground_blend:new t.aI(Ue,P.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(Ue,P.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(Ue,P.u_horizon_color),u_horizon_fog_blend:new t.aI(Ue,P.u_horizon_fog_blend)}),terrainDepth:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ele_delta:new t.aI(Ue,P.u_ele_delta)}),terrainCoords:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texture:new t.aH(Ue,P.u_texture),u_terrain_coords_id:new t.aI(Ue,P.u_terrain_coords_id),u_ele_delta:new t.aI(Ue,P.u_ele_delta)}),sky:(Ue,P)=>({u_sky_color:new t.aL(Ue,P.u_sky_color),u_horizon_color:new t.aL(Ue,P.u_horizon_color),u_horizon:new t.aI(Ue,P.u_horizon),u_sky_horizon_blend:new t.aI(Ue,P.u_sky_horizon_blend)})};class Cs{constructor(P,oe,Se){this.context=P;const ke=P.gl;this.buffer=ke.createBuffer(),this.dynamicDraw=!!Se,this.context.unbindVAO(),P.bindElementBuffer.set(this.buffer),ke.bufferData(ke.ELEMENT_ARRAY_BUFFER,oe.arrayBuffer,this.dynamicDraw?ke.DYNAMIC_DRAW:ke.STATIC_DRAW),this.dynamicDraw||delete oe.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(P){const oe=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),oe.bufferSubData(oe.ELEMENT_ARRAY_BUFFER,0,P.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const pi={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class no{constructor(P,oe,Se,ke){this.length=oe.length,this.attributes=Se,this.itemSize=oe.bytesPerElement,this.dynamicDraw=ke,this.context=P;const Be=P.gl;this.buffer=Be.createBuffer(),P.bindVertexBuffer.set(this.buffer),Be.bufferData(Be.ARRAY_BUFFER,oe.arrayBuffer,this.dynamicDraw?Be.DYNAMIC_DRAW:Be.STATIC_DRAW),this.dynamicDraw||delete oe.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(P){if(P.length!==this.length)throw new Error(`Length of new data is ${P.length}, which doesn't match current length of ${this.length}`);const oe=this.context.gl;this.bind(),oe.bufferSubData(oe.ARRAY_BUFFER,0,P.arrayBuffer)}enableAttributes(P,oe){for(let Se=0;Se0){const Tr=t.H();t.aQ(Tr,Et.placementInvProjMatrix,Ue.transform.glCoordMatrix),t.aQ(Tr,Tr,Et.placementViewportMatrix),Gt.push({circleArray:mr,circleOffset:Ar,transform:zt.posMatrix,invTransform:Tr,coord:zt}),cr+=mr.length/4,Ar=cr}Ut&&kt.draw(Be,gt.LINES,Ns.disabled,dl.disabled,Ue.colorModeForRenderPass(),Bo.disabled,{u_matrix:zt.posMatrix,u_pixel_extrude_scale:[1/(Cr=Ue.transform).width,1/Cr.height]},Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(zt),oe.id,Ut.layoutVertexBuffer,Ut.indexBuffer,Ut.segments,null,Ue.transform.zoom,null,null,Ut.collisionVertexBuffer)}var Cr;if(!ke||!Gt.length)return;const Qr=Ue.useProgram("collisionCircle"),_n=new t.aR;_n.resize(4*cr),_n._trim();let Ze=0;for(const _t of Gt)for(let zt=0;zt<_t.circleArray.length/4;zt++){const Et=4*zt,Ut=_t.circleArray[Et+0],mr=_t.circleArray[Et+1],Tr=_t.circleArray[Et+2],Lr=_t.circleArray[Et+3];_n.emplace(Ze++,Ut,mr,Tr,Lr,0),_n.emplace(Ze++,Ut,mr,Tr,Lr,1),_n.emplace(Ze++,Ut,mr,Tr,Lr,2),_n.emplace(Ze++,Ut,mr,Tr,Lr,3)}(!Kf||Kf.length<2*cr)&&(Kf=(function(_t){const zt=2*_t,Et=new t.aT;Et.resize(zt),Et._trim();for(let Ut=0;Ut=0&&(_t[Et.associatedIconIndex]={shiftedAnchor:$i,angle:Ao})}else pr(Et.numGlyphs,et)}if(cr){ht.clear();const zt=Ue.icon.placedSymbolArray;for(let Et=0;EtUe.style.map.terrain.getElevation(Pn,kn,La):null,An=oe.layout.get("text-rotation-alignment")==="map";Ee(wa,Pn.posMatrix,Ue,ke,oc,ge,_t,cr,An,et,Pn.toUnwrapped(),Ze.width,Ze.height,Oe,hn)}const St=Pn.posMatrix,It=ke&&Gr||xt,Qt=zt||It?Iu:oc,Jt=Oc,yr=ii&&oe.paint.get(ke?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Xr;Xr=ii?wa.iconsInText?ps($i.kind,$o,Et,_t,zt,It,Ue,St,Qt,Jt,Oe,Qs,ru,Mn):_o($i.kind,$o,Et,_t,zt,It,Ue,St,Qt,Jt,Oe,ke,Qs,!0,Mn):Ko($i.kind,$o,Et,_t,zt,It,Ue,St,Qt,Jt,Oe,ke,Qs,Mn);const Hr={program:mo,buffers:ni,uniformValues:Xr,atlasTexture:Ls,atlasTextureIcon:Ps,atlasInterpolation:al,atlasInterpolationIcon:vu,isSDF:ii,hasHalo:yr};if(mr&&wa.canOverlap){Tr=!0;const hn=ni.segments.get();for(const An of hn)on.push({segments:new t.a0([An]),sortKey:An.sortKey,state:Hr,terrainData:Js})}else on.push({segments:ni.segments,sortKey:0,state:Hr,terrainData:Js})}Tr&&on.sort((Pn,Yn)=>Pn.sortKey-Yn.sortKey);for(const Pn of on){const Yn=Pn.state;if(Qr.activeTexture.set(_n.TEXTURE0),Yn.atlasTexture.bind(Yn.atlasInterpolation,_n.CLAMP_TO_EDGE),Yn.atlasTextureIcon&&(Qr.activeTexture.set(_n.TEXTURE1),Yn.atlasTextureIcon&&Yn.atlasTextureIcon.bind(Yn.atlasInterpolationIcon,_n.CLAMP_TO_EDGE)),Yn.isSDF){const wa=Yn.uniformValues;Yn.hasHalo&&(wa.u_is_halo=1,Uh(Yn.buffers,Pn.segments,oe,Ue,Yn.program,Lr,Ar,Cr,wa,Pn.terrainData)),wa.u_is_halo=0}Uh(Yn.buffers,Pn.segments,oe,Ue,Yn.program,Lr,Ar,Cr,Yn.uniformValues,Pn.terrainData)}}function Uh(Ue,P,oe,Se,ke,Be,gt,kt,Gt,cr){const Ar=Se.context;ke.draw(Ar,Ar.gl.TRIANGLES,Be,gt,kt,Bo.disabled,Gt,cr,oe.id,Ue.layoutVertexBuffer,Ue.indexBuffer,P,oe.paint,Se.transform.zoom,Ue.programConfigurations.get(oe.id),Ue.dynamicLayoutVertexBuffer,Ue.opacityVertexBuffer)}function oh(Ue,P,oe,Se){const ke=Ue.context,Be=ke.gl,gt=dl.disabled,kt=new lu([Be.ONE,Be.ONE],t.aM.transparent,[!0,!0,!0,!0]),Gt=P.getBucket(oe);if(!Gt)return;const cr=Se.key;let Ar=oe.heatmapFbos.get(cr);Ar||(Ar=Ih(ke,P.tileSize,P.tileSize),oe.heatmapFbos.set(cr,Ar)),ke.bindFramebuffer.set(Ar.framebuffer),ke.viewport.set([0,0,P.tileSize,P.tileSize]),ke.clear({color:t.aM.transparent});const Cr=Gt.programConfigurations.get(oe.id),Qr=Ue.useProgram("heatmap",Cr),_n=Ue.style.map.terrain.getTerrainData(Se);Qr.draw(ke,Be.TRIANGLES,Ns.disabled,gt,kt,Bo.disabled,vi(Se.posMatrix,P,Ue.transform.zoom,oe.paint.get("heatmap-intensity")),_n,oe.id,Gt.layoutVertexBuffer,Gt.indexBuffer,Gt.segments,oe.paint,Ue.transform.zoom,Cr)}function zf(Ue,P,oe){const Se=Ue.context,ke=Se.gl;Se.setColorMode(Ue.colorModeForRenderPass());const Be=Dh(Se,P),gt=oe.key,kt=P.heatmapFbos.get(gt);kt&&(Se.activeTexture.set(ke.TEXTURE0),ke.bindTexture(ke.TEXTURE_2D,kt.colorAttachment.get()),Se.activeTexture.set(ke.TEXTURE1),Be.bind(ke.LINEAR,ke.CLAMP_TO_EDGE),Ue.useProgram("heatmapTexture").draw(Se,ke.TRIANGLES,Ns.disabled,dl.disabled,Ue.colorModeForRenderPass(),Bo.disabled,ns(Ue,P,0,1),null,P.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments,P.paint,Ue.transform.zoom),kt.destroy(),P.heatmapFbos.delete(gt))}function Ih(Ue,P,oe){var Se,ke;const Be=Ue.gl,gt=Be.createTexture();Be.bindTexture(Be.TEXTURE_2D,gt),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_S,Be.CLAMP_TO_EDGE),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_T,Be.CLAMP_TO_EDGE),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MIN_FILTER,Be.LINEAR),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MAG_FILTER,Be.LINEAR);const kt=(Se=Ue.HALF_FLOAT)!==null&&Se!==void 0?Se:Be.UNSIGNED_BYTE,Gt=(ke=Ue.RGBA16F)!==null&&ke!==void 0?ke:Be.RGBA;Be.texImage2D(Be.TEXTURE_2D,0,Gt,P,oe,0,Be.RGBA,kt,null);const cr=Ue.createFramebuffer(P,oe,!1,!1);return cr.colorAttachment.set(gt),cr}function Dh(Ue,P){return P.colorRampTexture||(P.colorRampTexture=new u(Ue,P.colorRamp,Ue.gl.RGBA)),P.colorRampTexture}function rf(Ue,P,oe,Se,ke){if(!oe||!Se||!Se.imageAtlas)return;const Be=Se.imageAtlas.patternPositions;let gt=Be[oe.to.toString()],kt=Be[oe.from.toString()];if(!gt&&kt&&(gt=kt),!kt&>&&(kt=gt),!gt||!kt){const Gt=ke.getPaintProperty(P);gt=Be[Gt],kt=Be[Gt]}gt&&kt&&Ue.setConstantPatternPositions(gt,kt)}function jh(Ue,P,oe,Se,ke,Be,gt){const kt=Ue.context.gl,Gt="fill-pattern",cr=oe.paint.get(Gt),Ar=cr&&cr.constantOr(1),Cr=oe.getCrossfadeParameters();let Qr,_n,Ze,et,ht;gt?(_n=Ar&&!oe.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Qr=kt.LINES):(_n=Ar?"fillPattern":"fill",Qr=kt.TRIANGLES);const _t=cr.constantOr(null);for(const zt of Se){const Et=P.getTile(zt);if(Ar&&!Et.patternsLoaded())continue;const Ut=Et.getBucket(oe);if(!Ut)continue;const mr=Ut.programConfigurations.get(oe.id),Tr=Ue.useProgram(_n,mr),Lr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(zt);Ar&&(Ue.context.activeTexture.set(kt.TEXTURE0),Et.imageAtlasTexture.bind(kt.LINEAR,kt.CLAMP_TO_EDGE),mr.updatePaintBuffers(Cr)),rf(mr,Gt,_t,Et,oe);const Gr=Lr?zt:null,on=Ue.translatePosMatrix(Gr?Gr.posMatrix:zt.posMatrix,Et,oe.paint.get("fill-translate"),oe.paint.get("fill-translate-anchor"));if(gt){et=Ut.indexBuffer2,ht=Ut.segments2;const Mn=[kt.drawingBufferWidth,kt.drawingBufferHeight];Ze=_n==="fillOutlinePattern"&&Ar?Pi(on,Ue,Cr,Et,Mn):Ea(on,Mn)}else et=Ut.indexBuffer,ht=Ut.segments,Ze=Ar?xi(on,Ue,Cr,Et):In(on);Tr.draw(Ue.context,Qr,ke,Ue.stencilModeForClipping(zt),Be,Bo.disabled,Ze,Lr,oe.id,Ut.layoutVertexBuffer,et,ht,oe.paint,Ue.transform.zoom,mr)}}function Tf(Ue,P,oe,Se,ke,Be,gt){const kt=Ue.context,Gt=kt.gl,cr="fill-extrusion-pattern",Ar=oe.paint.get(cr),Cr=Ar.constantOr(1),Qr=oe.getCrossfadeParameters(),_n=oe.paint.get("fill-extrusion-opacity"),Ze=Ar.constantOr(null);for(const et of Se){const ht=P.getTile(et),_t=ht.getBucket(oe);if(!_t)continue;const zt=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(et),Et=_t.programConfigurations.get(oe.id),Ut=Ue.useProgram(Cr?"fillExtrusionPattern":"fillExtrusion",Et);Cr&&(Ue.context.activeTexture.set(Gt.TEXTURE0),ht.imageAtlasTexture.bind(Gt.LINEAR,Gt.CLAMP_TO_EDGE),Et.updatePaintBuffers(Qr)),rf(Et,cr,Ze,ht,oe);const mr=Ue.translatePosMatrix(et.posMatrix,ht,oe.paint.get("fill-extrusion-translate"),oe.paint.get("fill-extrusion-translate-anchor")),Tr=oe.paint.get("fill-extrusion-vertical-gradient"),Lr=Cr?cn(mr,Ue,Tr,_n,et,Qr,ht):Un(mr,Ue,Tr,_n);Ut.draw(kt,kt.gl.TRIANGLES,ke,Be,gt,Bo.backCCW,Lr,zt,oe.id,_t.layoutVertexBuffer,_t.indexBuffer,_t.segments,oe.paint,Ue.transform.zoom,Et,Ue.style.map.terrain&&_t.centroidVertexBuffer)}}function cf(Ue,P,oe,Se,ke,Be,gt){const kt=Ue.context,Gt=kt.gl,cr=oe.fbo;if(!cr)return;const Ar=Ue.useProgram("hillshade"),Cr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(P);kt.activeTexture.set(Gt.TEXTURE0),Gt.bindTexture(Gt.TEXTURE_2D,cr.colorAttachment.get()),Ar.draw(kt,Gt.TRIANGLES,ke,Be,gt,Bo.disabled,((Qr,_n,Ze,et)=>{const ht=Ze.paint.get("hillshade-shadow-color"),_t=Ze.paint.get("hillshade-highlight-color"),zt=Ze.paint.get("hillshade-accent-color");let Et=Ze.paint.get("hillshade-illumination-direction")*(Math.PI/180);Ze.paint.get("hillshade-illumination-anchor")==="viewport"&&(Et-=Qr.transform.angle);const Ut=!Qr.options.moving;return{u_matrix:et?et.posMatrix:Qr.transform.calculatePosMatrix(_n.tileID.toUnwrapped(),Ut),u_image:0,u_latrange:Xo(0,_n.tileID),u_light:[Ze.paint.get("hillshade-exaggeration"),Et],u_shadow:ht,u_highlight:_t,u_accent:zt}})(Ue,oe,Se,Cr?P:null),Cr,Se.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments)}function Zu(Ue,P,oe,Se,ke,Be){const gt=Ue.context,kt=gt.gl,Gt=P.dem;if(Gt&&Gt.data){const cr=Gt.dim,Ar=Gt.stride,Cr=Gt.getPixels();if(gt.activeTexture.set(kt.TEXTURE1),gt.pixelStoreUnpackPremultiplyAlpha.set(!1),P.demTexture=P.demTexture||Ue.getTileTexture(Ar),P.demTexture){const _n=P.demTexture;_n.update(Cr,{premultiply:!1}),_n.bind(kt.NEAREST,kt.CLAMP_TO_EDGE)}else P.demTexture=new u(gt,Cr,kt.RGBA,{premultiply:!1}),P.demTexture.bind(kt.NEAREST,kt.CLAMP_TO_EDGE);gt.activeTexture.set(kt.TEXTURE0);let Qr=P.fbo;if(!Qr){const _n=new u(gt,{width:cr,height:cr,data:null},kt.RGBA);_n.bind(kt.LINEAR,kt.CLAMP_TO_EDGE),Qr=P.fbo=gt.createFramebuffer(cr,cr,!0,!1),Qr.colorAttachment.set(_n.texture)}gt.bindFramebuffer.set(Qr.framebuffer),gt.viewport.set([0,0,cr,cr]),Ue.useProgram("hillshadePrepare").draw(gt,kt.TRIANGLES,Se,ke,Be,Bo.disabled,((_n,Ze)=>{const et=Ze.stride,ht=t.H();return t.aP(ht,0,t.X,-t.X,0,0,1),t.J(ht,ht,[0,-t.X,0]),{u_matrix:ht,u_image:1,u_dimension:[et,et],u_zoom:_n.overscaledZ,u_unpack:Ze.getUnpackVector()}})(P.tileID,Gt),null,oe.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments),P.needsHillshadePrepare=!1}}function Hf(Ue,P,oe,Se,ke,Be){const gt=Se.paint.get("raster-fade-duration");if(!Be&>>0){const kt=i.now(),Gt=(kt-Ue.timeAdded)/gt,cr=P?(kt-P.timeAdded)/gt:-1,Ar=oe.getSource(),Cr=ke.coveringZoomLevel({tileSize:Ar.tileSize,roundZoom:Ar.roundZoom}),Qr=!P||Math.abs(P.tileID.overscaledZ-Cr)>Math.abs(Ue.tileID.overscaledZ-Cr),_n=Qr&&Ue.refreshedUponExpiration?1:t.ac(Qr?Gt:1-cr,0,1);return Ue.refreshedUponExpiration&&Gt>=1&&(Ue.refreshedUponExpiration=!1),P?{opacity:1,mix:1-_n}:{opacity:_n,mix:0}}return{opacity:1,mix:0}}const zh=new t.aM(1,0,0,1),Nl=new t.aM(0,1,0,1),_h=new t.aM(0,0,1,1),wv=new t.aM(1,0,1,1),qh=new t.aM(0,1,1,1);function sh(Ue,P,oe,Se){Pc(Ue,0,P+oe/2,Ue.transform.width,oe,Se)}function Vh(Ue,P,oe,Se){Pc(Ue,P-oe/2,0,oe,Ue.transform.height,Se)}function Pc(Ue,P,oe,Se,ke,Be){const gt=Ue.context,kt=gt.gl;kt.enable(kt.SCISSOR_TEST),kt.scissor(P*Ue.pixelRatio,oe*Ue.pixelRatio,Se*Ue.pixelRatio,ke*Ue.pixelRatio),gt.clear({color:Be}),kt.disable(kt.SCISSOR_TEST)}function Hh(Ue,P,oe){const Se=Ue.context,ke=Se.gl,Be=oe.posMatrix,gt=Ue.useProgram("debug"),kt=Ns.disabled,Gt=dl.disabled,cr=Ue.colorModeForRenderPass(),Ar="$debug",Cr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(oe);Se.activeTexture.set(ke.TEXTURE0);const Qr=P.getTileByID(oe.key).latestRawTileData,_n=Math.floor((Qr&&Qr.byteLength||0)/1024),Ze=P.getTile(oe).tileSize,et=512/Math.min(Ze,512)*(oe.overscaledZ/Ue.transform.zoom)*.5;let ht=oe.canonical.toString();oe.overscaledZ!==oe.canonical.z&&(ht+=` => ${oe.overscaledZ}`),(function(_t,zt){_t.initDebugOverlayCanvas();const Et=_t.debugOverlayCanvas,Ut=_t.context.gl,mr=_t.debugOverlayCanvas.getContext("2d");mr.clearRect(0,0,Et.width,Et.height),mr.shadowColor="white",mr.shadowBlur=2,mr.lineWidth=1.5,mr.strokeStyle="white",mr.textBaseline="top",mr.font="bold 36px Open Sans, sans-serif",mr.fillText(zt,5,5),mr.strokeText(zt,5,5),_t.debugOverlayTexture.update(Et),_t.debugOverlayTexture.bind(Ut.LINEAR,Ut.CLAMP_TO_EDGE)})(Ue,`${ht} ${_n}kB`),gt.draw(Se,ke.TRIANGLES,kt,Gt,lu.alphaBlended,Bo.disabled,so(Be,t.aM.transparent,et),null,Ar,Ue.debugBuffer,Ue.quadTriangleIndexBuffer,Ue.debugSegments),gt.draw(Se,ke.LINE_STRIP,kt,Gt,cr,Bo.disabled,so(Be,t.aM.red),Cr,Ar,Ue.debugBuffer,Ue.tileBorderIndexBuffer,Ue.debugSegments)}function yu(Ue,P,oe){const Se=Ue.context,ke=Se.gl,Be=Ue.colorModeForRenderPass(),gt=new Ns(ke.LEQUAL,Ns.ReadWrite,Ue.depthRangeFor3D),kt=Ue.useProgram("terrain"),Gt=P.getTerrainMesh();Se.bindFramebuffer.set(null),Se.viewport.set([0,0,Ue.width,Ue.height]);for(const cr of oe){const Ar=Ue.renderToTexture.getTexture(cr),Cr=P.getTerrainData(cr.tileID);Se.activeTexture.set(ke.TEXTURE0),ke.bindTexture(ke.TEXTURE_2D,Ar.texture);const Qr=Ue.transform.calculatePosMatrix(cr.tileID.toUnwrapped()),_n=P.getMeshFrameDelta(Ue.transform.zoom),Ze=Ue.transform.calculateFogMatrix(cr.tileID.toUnwrapped()),et=Dr(Qr,_n,Ze,Ue.style.sky,Ue.transform.pitch);kt.draw(Se,ke.TRIANGLES,gt,dl.disabled,Be,Bo.backCCW,et,Cr,"terrain",Gt.vertexBuffer,Gt.indexBuffer,Gt.segments)}}class Rc{constructor(P,oe,Se){this.vertexBuffer=P,this.indexBuffer=oe,this.segments=Se}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Of{constructor(P,oe){this.context=new bv(P),this.transform=oe,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Nt.maxUnderzooming+Nt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Nr}resize(P,oe,Se){if(this.width=Math.floor(P*Se),this.height=Math.floor(oe*Se),this.pixelRatio=Se,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const ke of this.style._order)this.style._layers[ke].resize()}setup(){const P=this.context,oe=new t.aX;oe.emplaceBack(0,0),oe.emplaceBack(t.X,0),oe.emplaceBack(0,t.X),oe.emplaceBack(t.X,t.X),this.tileExtentBuffer=P.createVertexBuffer(oe,ln.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);const Se=new t.aX;Se.emplaceBack(0,0),Se.emplaceBack(t.X,0),Se.emplaceBack(0,t.X),Se.emplaceBack(t.X,t.X),this.debugBuffer=P.createVertexBuffer(Se,ln.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);const ke=new t.$;ke.emplaceBack(0,0,0,0),ke.emplaceBack(t.X,0,t.X,0),ke.emplaceBack(0,t.X,0,t.X),ke.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=P.createVertexBuffer(ke,Ye.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);const Be=new t.aX;Be.emplaceBack(0,0),Be.emplaceBack(1,0),Be.emplaceBack(0,1),Be.emplaceBack(1,1),this.viewportBuffer=P.createVertexBuffer(Be,ln.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);const gt=new t.aZ;gt.emplaceBack(0),gt.emplaceBack(1),gt.emplaceBack(3),gt.emplaceBack(2),gt.emplaceBack(0),this.tileBorderIndexBuffer=P.createIndexBuffer(gt);const kt=new t.aY;kt.emplaceBack(0,1,2),kt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=P.createIndexBuffer(kt);const Gt=this.context.gl;this.stencilClearMode=new dl({func:Gt.ALWAYS,mask:0},0,255,Gt.ZERO,Gt.ZERO,Gt.ZERO)}clearStencil(){const P=this.context,oe=P.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const Se=t.H();t.aP(Se,0,this.width,this.height,0,0,1),t.K(Se,Se,[oe.drawingBufferWidth,oe.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(P,oe.TRIANGLES,Ns.disabled,this.stencilClearMode,lu.disabled,Bo.disabled,Eo(Se),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(P,oe){if(this.currentStencilSource===P.source||!P.isTileClipped()||!oe||!oe.length)return;this.currentStencilSource=P.source;const Se=this.context,ke=Se.gl;this.nextStencilID+oe.length>256&&this.clearStencil(),Se.setColorMode(lu.disabled),Se.setDepthMode(Ns.disabled);const Be=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const gt of oe){const kt=this._tileClippingMaskIDs[gt.key]=this.nextStencilID++,Gt=this.style.map.terrain&&this.style.map.terrain.getTerrainData(gt);Be.draw(Se,ke.TRIANGLES,Ns.disabled,new dl({func:ke.ALWAYS,mask:0},kt,255,ke.KEEP,ke.KEEP,ke.REPLACE),lu.disabled,Bo.disabled,Eo(gt.posMatrix),Gt,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const P=this.nextStencilID++,oe=this.context.gl;return new dl({func:oe.NOTEQUAL,mask:255},P,255,oe.KEEP,oe.KEEP,oe.REPLACE)}stencilModeForClipping(P){const oe=this.context.gl;return new dl({func:oe.EQUAL,mask:255},this._tileClippingMaskIDs[P.key],0,oe.KEEP,oe.KEEP,oe.REPLACE)}stencilConfigForOverlap(P){const oe=this.context.gl,Se=P.sort((gt,kt)=>kt.overscaledZ-gt.overscaledZ),ke=Se[Se.length-1].overscaledZ,Be=Se[0].overscaledZ-ke+1;if(Be>1){this.currentStencilSource=void 0,this.nextStencilID+Be>256&&this.clearStencil();const gt={};for(let kt=0;kt({u_sky_color:_t.properties.get("sky-color"),u_horizon_color:_t.properties.get("horizon-color"),u_horizon:(zt.height/2+zt.getHorizon())*Et,u_sky_horizon_blend:_t.properties.get("sky-horizon-blend")*zt.height/2*Et}))(cr,Gt.style.map.transform,Gt.pixelRatio),_n=new Ns(Cr.LEQUAL,Ns.ReadWrite,[0,1]),Ze=dl.disabled,et=Gt.colorModeForRenderPass(),ht=Gt.useProgram("sky");if(!cr.mesh){const _t=new t.aX;_t.emplaceBack(-1,-1),_t.emplaceBack(1,-1),_t.emplaceBack(1,1),_t.emplaceBack(-1,1);const zt=new t.aY;zt.emplaceBack(0,1,2),zt.emplaceBack(0,2,3),cr.mesh=new Rc(Ar.createVertexBuffer(_t,ln.members),Ar.createIndexBuffer(zt),t.a0.simpleSegment(0,0,_t.length,zt.length))}ht.draw(Ar,Cr.TRIANGLES,_n,Ze,et,Bo.disabled,Qr,void 0,"sky",cr.mesh.vertexBuffer,cr.mesh.indexBuffer,cr.mesh.segments)})(this,this.style.sky),this._showOverdrawInspector=oe.showOverdrawInspector,this.depthRangeFor3D=[0,1-(P._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Se.length-1;this.currentLayer>=0;this.currentLayer--){const Gt=this.style._layers[Se[this.currentLayer]],cr=ke[Gt.source],Ar=Be[Gt.source];this._renderTileClippingMasks(Gt,Ar),this.renderLayer(this,cr,Gt,Ar)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerht.source&&!ht.isHidden(Ar)?[cr.sourceCaches[ht.source]]:[]),_n=Qr.filter(ht=>ht.getSource().type==="vector"),Ze=Qr.filter(ht=>ht.getSource().type!=="vector"),et=ht=>{(!Cr||Cr.getSource().maxzoomet(ht)),Cr||Ze.forEach(ht=>et(ht)),Cr})(this.style,this.transform.zoom);Gt&&(function(cr,Ar,Cr){for(let Qr=0;Qr0),ke&&(t.b0(oe,Se),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(Be,gt){const kt=Be.context,Gt=kt.gl,cr=lu.unblended,Ar=new Ns(Gt.LEQUAL,Ns.ReadWrite,[0,1]),Cr=gt.getTerrainMesh(),Qr=gt.sourceCache.getRenderableTiles(),_n=Be.useProgram("terrainDepth");kt.bindFramebuffer.set(gt.getFramebuffer("depth").framebuffer),kt.viewport.set([0,0,Be.width/devicePixelRatio,Be.height/devicePixelRatio]),kt.clear({color:t.aM.transparent,depth:1});for(const Ze of Qr){const et=gt.getTerrainData(Ze.tileID),ht={u_matrix:Be.transform.calculatePosMatrix(Ze.tileID.toUnwrapped()),u_ele_delta:gt.getMeshFrameDelta(Be.transform.zoom)};_n.draw(kt,Gt.TRIANGLES,Ar,dl.disabled,cr,Bo.backCCW,ht,et,"terrain",Cr.vertexBuffer,Cr.indexBuffer,Cr.segments)}kt.bindFramebuffer.set(null),kt.viewport.set([0,0,Be.width,Be.height])})(this,this.style.map.terrain),(function(Be,gt){const kt=Be.context,Gt=kt.gl,cr=lu.unblended,Ar=new Ns(Gt.LEQUAL,Ns.ReadWrite,[0,1]),Cr=gt.getTerrainMesh(),Qr=gt.getCoordsTexture(),_n=gt.sourceCache.getRenderableTiles(),Ze=Be.useProgram("terrainCoords");kt.bindFramebuffer.set(gt.getFramebuffer("coords").framebuffer),kt.viewport.set([0,0,Be.width/devicePixelRatio,Be.height/devicePixelRatio]),kt.clear({color:t.aM.transparent,depth:1}),gt.coordsIndex=[];for(const et of _n){const ht=gt.getTerrainData(et.tileID);kt.activeTexture.set(Gt.TEXTURE0),Gt.bindTexture(Gt.TEXTURE_2D,Qr.texture);const _t={u_matrix:Be.transform.calculatePosMatrix(et.tileID.toUnwrapped()),u_terrain_coords_id:(255-gt.coordsIndex.length)/255,u_texture:0,u_ele_delta:gt.getMeshFrameDelta(Be.transform.zoom)};Ze.draw(kt,Gt.TRIANGLES,Ar,dl.disabled,cr,Bo.backCCW,_t,ht,"terrain",Cr.vertexBuffer,Cr.indexBuffer,Cr.segments),gt.coordsIndex.push(et.tileID.key)}kt.bindFramebuffer.set(null),kt.viewport.set([0,0,Be.width,Be.height])})(this,this.style.map.terrain))}renderLayer(P,oe,Se,ke){if(!Se.isHidden(this.transform.zoom)&&(Se.type==="background"||Se.type==="custom"||(ke||[]).length))switch(this.id=Se.id,Se.type){case"symbol":(function(Be,gt,kt,Gt,cr){if(Be.renderPass!=="translucent")return;const Ar=dl.disabled,Cr=Be.colorModeForRenderPass();(kt._unevaluatedLayout.hasValue("text-variable-anchor")||kt._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(Qr,_n,Ze,et,ht,_t,zt,Et,Ut){const mr=_n.transform,Tr=Ca(),Lr=ht==="map",Gr=_t==="map";for(const on of Qr){const Mn=et.getTile(on),Pn=Mn.getBucket(Ze);if(!Pn||!Pn.text||!Pn.text.segments.get().length)continue;const Yn=t.ag(Pn.textSizeData,mr.zoom),wa=Kn(Mn,1,_n.transform.zoom),ni=Sr(on.posMatrix,Gr,Lr,_n.transform,wa),Ka=Ze.layout.get("icon-text-fit")!=="none"&&Pn.hasIconData();if(Yn){const ii=Math.pow(2,mr.zoom-Mn.tileID.overscaledZ),$i=_n.style.map.terrain?(mo,$o)=>_n.style.map.terrain.getElevation(on,mo,$o):null,Ao=Tr.translatePosition(mr,Mn,zt,Et);ih(Pn,Lr,Gr,Ut,mr,ni,on.posMatrix,ii,Yn,Ka,Tr,Ao,on.toUnwrapped(),$i)}}})(Gt,Be,kt,gt,kt.layout.get("text-rotation-alignment"),kt.layout.get("text-pitch-alignment"),kt.paint.get("text-translate"),kt.paint.get("text-translate-anchor"),cr),kt.paint.get("icon-opacity").constantOr(1)!==0&&sv(Be,gt,kt,Gt,!1,kt.paint.get("icon-translate"),kt.paint.get("icon-translate-anchor"),kt.layout.get("icon-rotation-alignment"),kt.layout.get("icon-pitch-alignment"),kt.layout.get("icon-keep-upright"),Ar,Cr),kt.paint.get("text-opacity").constantOr(1)!==0&&sv(Be,gt,kt,Gt,!0,kt.paint.get("text-translate"),kt.paint.get("text-translate-anchor"),kt.layout.get("text-rotation-alignment"),kt.layout.get("text-pitch-alignment"),kt.layout.get("text-keep-upright"),Ar,Cr),gt.map.showCollisionBoxes&&(tf(Be,gt,kt,Gt,!0),tf(Be,gt,kt,Gt,!1))})(P,oe,Se,ke,this.style.placement.variableOffsets);break;case"circle":(function(Be,gt,kt,Gt){if(Be.renderPass!=="translucent")return;const cr=kt.paint.get("circle-opacity"),Ar=kt.paint.get("circle-stroke-width"),Cr=kt.paint.get("circle-stroke-opacity"),Qr=!kt.layout.get("circle-sort-key").isConstant();if(cr.constantOr(1)===0&&(Ar.constantOr(1)===0||Cr.constantOr(1)===0))return;const _n=Be.context,Ze=_n.gl,et=Be.depthModeForSublayer(0,Ns.ReadOnly),ht=dl.disabled,_t=Be.colorModeForRenderPass(),zt=[];for(let Et=0;EtEt.sortKey-Ut.sortKey);for(const Et of zt){const{programConfiguration:Ut,program:mr,layoutVertexBuffer:Tr,indexBuffer:Lr,uniformValues:Gr,terrainData:on}=Et.state;mr.draw(_n,Ze.TRIANGLES,et,ht,_t,Bo.disabled,Gr,on,kt.id,Tr,Lr,Et.segments,kt.paint,Be.transform.zoom,Ut)}})(P,oe,Se,ke);break;case"heatmap":(function(Be,gt,kt,Gt){if(kt.paint.get("heatmap-opacity")===0)return;const cr=Be.context;if(Be.style.map.terrain){for(const Ar of Gt){const Cr=gt.getTile(Ar);gt.hasRenderableParent(Ar)||(Be.renderPass==="offscreen"?oh(Be,Cr,kt,Ar):Be.renderPass==="translucent"&&zf(Be,kt,Ar))}cr.viewport.set([0,0,Be.width,Be.height])}else Be.renderPass==="offscreen"?(function(Ar,Cr,Qr,_n){const Ze=Ar.context,et=Ze.gl,ht=dl.disabled,_t=new lu([et.ONE,et.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(zt,Et,Ut){const mr=zt.gl;zt.activeTexture.set(mr.TEXTURE1),zt.viewport.set([0,0,Et.width/4,Et.height/4]);let Tr=Ut.heatmapFbos.get(t.aU);Tr?(mr.bindTexture(mr.TEXTURE_2D,Tr.colorAttachment.get()),zt.bindFramebuffer.set(Tr.framebuffer)):(Tr=Ih(zt,Et.width/4,Et.height/4),Ut.heatmapFbos.set(t.aU,Tr))})(Ze,Ar,Qr),Ze.clear({color:t.aM.transparent});for(let zt=0;zt<_n.length;zt++){const Et=_n[zt];if(Cr.hasRenderableParent(Et))continue;const Ut=Cr.getTile(Et),mr=Ut.getBucket(Qr);if(!mr)continue;const Tr=mr.programConfigurations.get(Qr.id),Lr=Ar.useProgram("heatmap",Tr),{zoom:Gr}=Ar.transform;Lr.draw(Ze,et.TRIANGLES,Ns.disabled,ht,_t,Bo.disabled,vi(Et.posMatrix,Ut,Gr,Qr.paint.get("heatmap-intensity")),null,Qr.id,mr.layoutVertexBuffer,mr.indexBuffer,mr.segments,Qr.paint,Ar.transform.zoom,Tr)}Ze.viewport.set([0,0,Ar.width,Ar.height])})(Be,gt,kt,Gt):Be.renderPass==="translucent"&&(function(Ar,Cr){const Qr=Ar.context,_n=Qr.gl;Qr.setColorMode(Ar.colorModeForRenderPass());const Ze=Cr.heatmapFbos.get(t.aU);Ze&&(Qr.activeTexture.set(_n.TEXTURE0),_n.bindTexture(_n.TEXTURE_2D,Ze.colorAttachment.get()),Qr.activeTexture.set(_n.TEXTURE1),Dh(Qr,Cr).bind(_n.LINEAR,_n.CLAMP_TO_EDGE),Ar.useProgram("heatmapTexture").draw(Qr,_n.TRIANGLES,Ns.disabled,dl.disabled,Ar.colorModeForRenderPass(),Bo.disabled,ns(Ar,Cr,0,1),null,Cr.id,Ar.viewportBuffer,Ar.quadTriangleIndexBuffer,Ar.viewportSegments,Cr.paint,Ar.transform.zoom))})(Be,kt)})(P,oe,Se,ke);break;case"line":(function(Be,gt,kt,Gt){if(Be.renderPass!=="translucent")return;const cr=kt.paint.get("line-opacity"),Ar=kt.paint.get("line-width");if(cr.constantOr(1)===0||Ar.constantOr(1)===0)return;const Cr=Be.depthModeForSublayer(0,Ns.ReadOnly),Qr=Be.colorModeForRenderPass(),_n=kt.paint.get("line-dasharray"),Ze=kt.paint.get("line-pattern"),et=Ze.constantOr(1),ht=kt.paint.get("line-gradient"),_t=kt.getCrossfadeParameters(),zt=et?"linePattern":_n?"lineSDF":ht?"lineGradient":"line",Et=Be.context,Ut=Et.gl;let mr=!0;for(const Tr of Gt){const Lr=gt.getTile(Tr);if(et&&!Lr.patternsLoaded())continue;const Gr=Lr.getBucket(kt);if(!Gr)continue;const on=Gr.programConfigurations.get(kt.id),Mn=Be.context.program.get(),Pn=Be.useProgram(zt,on),Yn=mr||Pn.program!==Mn,wa=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(Tr),ni=Ze.constantOr(null);if(ni&&Lr.imageAtlas){const $i=Lr.imageAtlas,Ao=$i.patternPositions[ni.to.toString()],mo=$i.patternPositions[ni.from.toString()];Ao&&mo&&on.setConstantPatternPositions(Ao,mo)}const Ka=wa?Tr:null,ii=et?es(Be,Lr,kt,_t,Ka):_n?qo(Be,Lr,kt,_n,_t,Ka):ht?vs(Be,Lr,kt,Gr.lineClipsArray.length,Ka):Ys(Be,Lr,kt,Ka);if(et)Et.activeTexture.set(Ut.TEXTURE0),Lr.imageAtlasTexture.bind(Ut.LINEAR,Ut.CLAMP_TO_EDGE),on.updatePaintBuffers(_t);else if(_n&&(Yn||Be.lineAtlas.dirty))Et.activeTexture.set(Ut.TEXTURE0),Be.lineAtlas.bind(Et);else if(ht){const $i=Gr.gradients[kt.id];let Ao=$i.texture;if(kt.gradientVersion!==$i.version){let mo=256;if(kt.stepInterpolant){const $o=gt.getSource().maxzoom,Js=Tr.canonical.z===$o?Math.ceil(1<20&&Ar.texParameterf(Ar.TEXTURE_2D,cr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,cr.extTextureFilterAnisotropicMax);const Pn=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(zt),Yn=Pn?zt:null,wa=Yn?Yn.posMatrix:Be.transform.calculatePosMatrix(zt.toUnwrapped(),_t),ni=sl(wa,on||[0,0],Gr||1,Lr,kt);Cr instanceof it?Qr.draw(cr,Ar.TRIANGLES,Et,dl.disabled,_n,Bo.disabled,ni,Pn,kt.id,Cr.boundsBuffer,Be.quadTriangleIndexBuffer,Cr.boundsSegments):Qr.draw(cr,Ar.TRIANGLES,Et,Ze[zt.overscaledZ],_n,Bo.disabled,ni,Pn,kt.id,Be.rasterBoundsBuffer,Be.quadTriangleIndexBuffer,Be.rasterBoundsSegments)}})(P,oe,Se,ke);break;case"background":(function(Be,gt,kt,Gt){const cr=kt.paint.get("background-color"),Ar=kt.paint.get("background-opacity");if(Ar===0)return;const Cr=Be.context,Qr=Cr.gl,_n=Be.transform,Ze=_n.tileSize,et=kt.paint.get("background-pattern");if(Be.isPatternMissing(et))return;const ht=!et&&cr.a===1&&Ar===1&&Be.opaquePassEnabledForLayer()?"opaque":"translucent";if(Be.renderPass!==ht)return;const _t=dl.disabled,zt=Be.depthModeForSublayer(0,ht==="opaque"?Ns.ReadWrite:Ns.ReadOnly),Et=Be.colorModeForRenderPass(),Ut=Be.useProgram(et?"backgroundPattern":"background"),mr=Gt||_n.coveringTiles({tileSize:Ze,terrain:Be.style.map.terrain});et&&(Cr.activeTexture.set(Qr.TEXTURE0),Be.imageManager.bind(Be.context));const Tr=kt.getCrossfadeParameters();for(const Lr of mr){const Gr=Gt?Lr.posMatrix:Be.transform.calculatePosMatrix(Lr.toUnwrapped()),on=et?kl(Gr,Ar,Be,et,{tileID:Lr,tileSize:Ze},Tr):ll(Gr,Ar,cr),Mn=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(Lr);Ut.draw(Cr,Qr.TRIANGLES,zt,_t,Et,Bo.disabled,on,Mn,kt.id,Be.tileExtentBuffer,Be.quadTriangleIndexBuffer,Be.tileExtentSegments)}})(P,0,Se,ke);break;case"custom":(function(Be,gt,kt){const Gt=Be.context,cr=kt.implementation;if(Be.renderPass==="offscreen"){const Ar=cr.prerender;Ar&&(Be.setCustomLayerDefaults(),Gt.setColorMode(Be.colorModeForRenderPass()),Ar.call(cr,Gt.gl,Be.transform.customLayerMatrix()),Gt.setDirty(),Be.setBaseState())}else if(Be.renderPass==="translucent"){Be.setCustomLayerDefaults(),Gt.setColorMode(Be.colorModeForRenderPass()),Gt.setStencilMode(dl.disabled);const Ar=cr.renderingMode==="3d"?new Ns(Be.context.gl.LEQUAL,Ns.ReadWrite,Be.depthRangeFor3D):Be.depthModeForSublayer(0,Ns.ReadOnly);Gt.setDepthMode(Ar),cr.render(Gt.gl,Be.transform.customLayerMatrix(),{farZ:Be.transform.farZ,nearZ:Be.transform.nearZ,fov:Be.transform._fov,modelViewProjectionMatrix:Be.transform.modelViewProjectionMatrix,projectionMatrix:Be.transform.projectionMatrix}),Gt.setDirty(),Be.setBaseState(),Gt.bindFramebuffer.set(null)}})(P,0,Se)}}translatePosMatrix(P,oe,Se,ke,Be){if(!Se[0]&&!Se[1])return P;const gt=Be?ke==="map"?this.transform.angle:0:ke==="viewport"?-this.transform.angle:0;if(gt){const cr=Math.sin(gt),Ar=Math.cos(gt);Se=[Se[0]*Ar-Se[1]*cr,Se[0]*cr+Se[1]*Ar]}const kt=[Be?Se[0]:Kn(oe,Se[0],this.transform.zoom),Be?Se[1]:Kn(oe,Se[1],this.transform.zoom),0],Gt=new Float32Array(16);return t.J(Gt,P,kt),Gt}saveTileTexture(P){const oe=this._tileTextures[P.size[0]];oe?oe.push(P):this._tileTextures[P.size[0]]=[P]}getTileTexture(P){const oe=this._tileTextures[P];return oe&&oe.length>0?oe.pop():null}isPatternMissing(P){if(!P)return!1;if(!P.from||!P.to)return!0;const oe=this.imageManager.getPattern(P.from.toString()),Se=this.imageManager.getPattern(P.to.toString());return!oe||!Se}useProgram(P,oe){this.cache=this.cache||{};const Se=P+(oe?oe.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Se]||(this.cache[Se]=new Rn(this.context,$r[P],oe,Rl[P],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Se]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const P=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(P.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:P,drawingBufferHeight:oe}=this.context.gl;return this.width!==P||this.height!==oe}}class $l{constructor(P,oe){this.points=P,this.planes=oe}static fromInvProjectionMatrix(P,oe,Se){const ke=Math.pow(2,Se),Be=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(kt=>{const Gt=1/(kt=t.af([],kt,P))[3]/oe*ke;return t.b1(kt,kt,[Gt,Gt,1/kt[3],Gt])}),gt=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(kt=>{const Gt=(function(Qr,_n){var Ze=_n[0],et=_n[1],ht=_n[2],_t=Ze*Ze+et*et+ht*ht;return _t>0&&(_t=1/Math.sqrt(_t)),Qr[0]=_n[0]*_t,Qr[1]=_n[1]*_t,Qr[2]=_n[2]*_t,Qr})([],(function(Qr,_n,Ze){var et=_n[0],ht=_n[1],_t=_n[2],zt=Ze[0],Et=Ze[1],Ut=Ze[2];return Qr[0]=ht*Ut-_t*Et,Qr[1]=_t*zt-et*Ut,Qr[2]=et*Et-ht*zt,Qr})([],M([],Be[kt[0]],Be[kt[1]]),M([],Be[kt[2]],Be[kt[1]]))),cr=-((Ar=Gt)[0]*(Cr=Be[kt[1]])[0]+Ar[1]*Cr[1]+Ar[2]*Cr[2]);var Ar,Cr;return Gt.concat(cr)});return new $l(Be,gt)}}class Af{constructor(P,oe){this.min=P,this.max=oe,this.center=(function(Se,ke,Be){return Se[0]=.5*ke[0],Se[1]=.5*ke[1],Se[2]=.5*ke[2],Se})([],(function(Se,ke,Be){return Se[0]=ke[0]+Be[0],Se[1]=ke[1]+Be[1],Se[2]=ke[2]+Be[2],Se})([],this.min,this.max))}quadrant(P){const oe=[P%2==0,P<2],Se=x(this.min),ke=x(this.max);for(let Be=0;Be=0&>++;if(gt===0)return 0;gt!==oe.length&&(Se=!1)}if(Se)return 2;for(let ke=0;ke<3;ke++){let Be=Number.MAX_VALUE,gt=-Number.MAX_VALUE;for(let kt=0;ktthis.max[ke]-this.min[ke])return 0}return 1}}class vc{constructor(P=0,oe=0,Se=0,ke=0){if(isNaN(P)||P<0||isNaN(oe)||oe<0||isNaN(Se)||Se<0||isNaN(ke)||ke<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=P,this.bottom=oe,this.left=Se,this.right=ke}interpolate(P,oe,Se){return oe.top!=null&&P.top!=null&&(this.top=t.y.number(P.top,oe.top,Se)),oe.bottom!=null&&P.bottom!=null&&(this.bottom=t.y.number(P.bottom,oe.bottom,Se)),oe.left!=null&&P.left!=null&&(this.left=t.y.number(P.left,oe.left,Se)),oe.right!=null&&P.right!=null&&(this.right=t.y.number(P.right,oe.right,Se)),this}getCenter(P,oe){const Se=t.ac((this.left+P-this.right)/2,0,P),ke=t.ac((this.top+oe-this.bottom)/2,0,oe);return new t.P(Se,ke)}equals(P){return this.top===P.top&&this.bottom===P.bottom&&this.left===P.left&&this.right===P.right}clone(){return new vc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Ic=85.051129;class uu{constructor(P,oe,Se,ke,Be){this.tileSize=512,this._renderWorldCopies=Be===void 0||!!Be,this._minZoom=P||0,this._maxZoom=oe||22,this._minPitch=Se??0,this._maxPitch=ke??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new vc,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const P=new uu(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return P.apply(this),P}apply(P){this.tileSize=P.tileSize,this.latRange=P.latRange,this.lngRange=P.lngRange,this.width=P.width,this.height=P.height,this._center=P._center,this._elevation=P._elevation,this.minElevationForCurrentTile=P.minElevationForCurrentTile,this.zoom=P.zoom,this.angle=P.angle,this._fov=P._fov,this._pitch=P._pitch,this._unmodified=P._unmodified,this._edgeInsets=P._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(P){this._minZoom!==P&&(this._minZoom=P,this.zoom=Math.max(this.zoom,P))}get maxZoom(){return this._maxZoom}set maxZoom(P){this._maxZoom!==P&&(this._maxZoom=P,this.zoom=Math.min(this.zoom,P))}get minPitch(){return this._minPitch}set minPitch(P){this._minPitch!==P&&(this._minPitch=P,this.pitch=Math.max(this.pitch,P))}get maxPitch(){return this._maxPitch}set maxPitch(P){this._maxPitch!==P&&(this._maxPitch=P,this.pitch=Math.min(this.pitch,P))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(P){P===void 0?P=!0:P===null&&(P=!1),this._renderWorldCopies=P}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(P){const oe=-t.b3(P,-180,180)*Math.PI/180;this.angle!==oe&&(this._unmodified=!1,this.angle=oe,this._calcMatrices(),this.rotationMatrix=(function(){var Se=new t.A(4);return t.A!=Float32Array&&(Se[1]=0,Se[2]=0),Se[0]=1,Se[3]=1,Se})(),(function(Se,ke,Be){var gt=ke[0],kt=ke[1],Gt=ke[2],cr=ke[3],Ar=Math.sin(Be),Cr=Math.cos(Be);Se[0]=gt*Cr+Gt*Ar,Se[1]=kt*Cr+cr*Ar,Se[2]=gt*-Ar+Gt*Cr,Se[3]=kt*-Ar+cr*Cr})(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(P){const oe=t.ac(P,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==oe&&(this._unmodified=!1,this._pitch=oe,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(P){P=Math.max(.01,Math.min(60,P)),this._fov!==P&&(this._unmodified=!1,this._fov=P/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(P){const oe=Math.min(Math.max(P,this.minZoom),this.maxZoom);this._zoom!==oe&&(this._unmodified=!1,this._zoom=oe,this.tileZoom=Math.max(0,Math.floor(oe)),this.scale=this.zoomScale(oe),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(P){P.lat===this._center.lat&&P.lng===this._center.lng||(this._unmodified=!1,this._center=P,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(P){P!==this._elevation&&(this._elevation=P,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(P){this._edgeInsets.equals(P)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,P,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(P){return this._edgeInsets.equals(P)}interpolatePadding(P,oe,Se){this._unmodified=!1,this._edgeInsets.interpolate(P,oe,Se),this._constrain(),this._calcMatrices()}coveringZoomLevel(P){const oe=(P.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/P.tileSize));return Math.max(0,oe)}getVisibleUnwrappedCoordinates(P){const oe=[new t.b4(0,P)];if(this._renderWorldCopies){const Se=this.pointCoordinate(new t.P(0,0)),ke=this.pointCoordinate(new t.P(this.width,0)),Be=this.pointCoordinate(new t.P(this.width,this.height)),gt=this.pointCoordinate(new t.P(0,this.height)),kt=Math.floor(Math.min(Se.x,ke.x,Be.x,gt.x)),Gt=Math.floor(Math.max(Se.x,ke.x,Be.x,gt.x)),cr=1;for(let Ar=kt-cr;Ar<=Gt+cr;Ar++)Ar!==0&&oe.push(new t.b4(Ar,P))}return oe}coveringTiles(P){var oe,Se;let ke=this.coveringZoomLevel(P);const Be=ke;if(P.minzoom!==void 0&&keP.maxzoom&&(ke=P.maxzoom);const gt=this.pointCoordinate(this.getCameraPoint()),kt=t.Z.fromLngLat(this.center),Gt=Math.pow(2,ke),cr=[Gt*gt.x,Gt*gt.y,0],Ar=[Gt*kt.x,Gt*kt.y,0],Cr=$l.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,ke);let Qr=P.minzoom||0;!P.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Qr=ke);const _n=P.terrain?2/Math.min(this.tileSize,P.tileSize)*this.tileSize:3,Ze=Et=>({aabb:new Af([Et*Gt,0,0],[(Et+1)*Gt,Gt,0]),zoom:0,x:0,y:0,wrap:Et,fullyVisible:!1}),et=[],ht=[],_t=ke,zt=P.reparseOverscaled?Be:ke;if(this._renderWorldCopies)for(let Et=1;Et<=3;Et++)et.push(Ze(-Et)),et.push(Ze(Et));for(et.push(Ze(0));et.length>0;){const Et=et.pop(),Ut=Et.x,mr=Et.y;let Tr=Et.fullyVisible;if(!Tr){const Pn=Et.aabb.intersects(Cr);if(Pn===0)continue;Tr=Pn===2}const Lr=P.terrain?cr:Ar,Gr=Et.aabb.distanceX(Lr),on=Et.aabb.distanceY(Lr),Mn=Math.max(Math.abs(Gr),Math.abs(on));if(Et.zoom===_t||Mn>_n+(1<<_t-Et.zoom)-2&&Et.zoom>=Qr){const Pn=_t-Et.zoom,Yn=cr[0]-.5-(Ut<>1),ni=Et.zoom+1;let Ka=Et.aabb.quadrant(Pn);if(P.terrain){const ii=new t.S(ni,Et.wrap,ni,Yn,wa),$i=P.terrain.getMinMaxElevation(ii),Ao=(oe=$i.minElevation)!==null&&oe!==void 0?oe:this.elevation,mo=(Se=$i.maxElevation)!==null&&Se!==void 0?Se:this.elevation;Ka=new Af([Ka.min[0],Ka.min[1],Ao],[Ka.max[0],Ka.max[1],mo])}et.push({aabb:Ka,zoom:ni,x:Yn,y:wa,wrap:Et.wrap,fullyVisible:Tr})}}return ht.sort((Et,Ut)=>Et.distanceSq-Ut.distanceSq).map(Et=>Et.tileID)}resize(P,oe){this.width=P,this.height=oe,this.pixelsToGLUnits=[2/P,-2/oe],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(P){return Math.pow(2,P)}scaleZoom(P){return Math.log(P)/Math.LN2}project(P){const oe=t.ac(P.lat,-85.051129,Ic);return new t.P(t.O(P.lng)*this.worldSize,t.Q(oe)*this.worldSize)}unproject(P){return new t.Z(P.x/this.worldSize,P.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(P){const oe=this.elevation,Se=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,ke=this.pointLocation(this.centerPoint,P),Be=P.getElevationForLngLatZoom(ke,this.tileZoom);if(!(this.elevation-Be))return;const gt=Se+oe-Be,kt=Math.cos(this._pitch)*this.cameraToCenterDistance/gt/t.b5(1,ke.lat),Gt=this.scaleZoom(kt/this.tileSize);this._elevation=Be,this._center=ke,this.zoom=Gt}setLocationAtPoint(P,oe){const Se=this.pointCoordinate(oe),ke=this.pointCoordinate(this.centerPoint),Be=this.locationCoordinate(P),gt=new t.Z(Be.x-(Se.x-ke.x),Be.y-(Se.y-ke.y));this.center=this.coordinateLocation(gt),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(P,oe){return oe?this.coordinatePoint(this.locationCoordinate(P),oe.getElevationForLngLatZoom(P,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(P))}pointLocation(P,oe){return this.coordinateLocation(this.pointCoordinate(P,oe))}locationCoordinate(P){return t.Z.fromLngLat(P)}coordinateLocation(P){return P&&P.toLngLat()}pointCoordinate(P,oe){if(oe){const Qr=oe.pointCoordinate(P);if(Qr!=null)return Qr}const Se=[P.x,P.y,0,1],ke=[P.x,P.y,1,1];t.af(Se,Se,this.pixelMatrixInverse),t.af(ke,ke,this.pixelMatrixInverse);const Be=Se[3],gt=ke[3],kt=Se[1]/Be,Gt=ke[1]/gt,cr=Se[2]/Be,Ar=ke[2]/gt,Cr=cr===Ar?0:(0-cr)/(Ar-cr);return new t.Z(t.y.number(Se[0]/Be,ke[0]/gt,Cr)/this.worldSize,t.y.number(kt,Gt,Cr)/this.worldSize)}coordinatePoint(P,oe=0,Se=this.pixelMatrix){const ke=[P.x*this.worldSize,P.y*this.worldSize,oe,1];return t.af(ke,ke,Se),new t.P(ke[0]/ke[3],ke[1]/ke[3])}getBounds(){const P=Math.max(0,this.height/2-this.getHorizon());return new ie().extend(this.pointLocation(new t.P(0,P))).extend(this.pointLocation(new t.P(this.width,P))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new ie([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(P){P?(this.lngRange=[P.getWest(),P.getEast()],this.latRange=[P.getSouth(),P.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Ic])}calculateTileMatrix(P){const oe=P.canonical,Se=this.worldSize/this.zoomScale(oe.z),ke=oe.x+Math.pow(2,oe.z)*P.wrap,Be=t.an(new Float64Array(16));return t.J(Be,Be,[ke*Se,oe.y*Se,0]),t.K(Be,Be,[Se/t.X,Se/t.X,1]),Be}calculatePosMatrix(P,oe=!1){const Se=P.key,ke=oe?this._alignedPosMatrixCache:this._posMatrixCache;if(ke[Se])return ke[Se];const Be=this.calculateTileMatrix(P);return t.L(Be,oe?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Be),ke[Se]=new Float32Array(Be),ke[Se]}calculateFogMatrix(P){const oe=P.key,Se=this._fogMatrixCache;if(Se[oe])return Se[oe];const ke=this.calculateTileMatrix(P);return t.L(ke,this.fogMatrix,ke),Se[oe]=new Float32Array(ke),Se[oe]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(P,oe){oe=t.ac(+oe,this.minZoom,this.maxZoom);const Se={center:new t.N(P.lng,P.lat),zoom:oe};let ke=this.lngRange;if(!this._renderWorldCopies&&ke===null){const Et=179.9999999999;ke=[-Et,Et]}const Be=this.tileSize*this.zoomScale(Se.zoom);let gt=0,kt=Be,Gt=0,cr=Be,Ar=0,Cr=0;const{x:Qr,y:_n}=this.size;if(this.latRange){const Et=this.latRange;gt=t.Q(Et[1])*Be,kt=t.Q(Et[0])*Be,kt-gt<_n&&(Ar=_n/(kt-gt))}ke&&(Gt=t.b3(t.O(ke[0])*Be,0,Be),cr=t.b3(t.O(ke[1])*Be,0,Be),crkt&&(_t=kt-Et)}if(ke){const Et=(Gt+cr)/2;let Ut=Ze;this._renderWorldCopies&&(Ut=t.b3(Ze,Et-Be/2,Et+Be/2));const mr=Qr/2;Ut-mrcr&&(ht=cr-mr)}if(ht!==void 0||_t!==void 0){const Et=new t.P(ht??Ze,_t??et);Se.center=this.unproject.call({worldSize:Be},Et).wrap()}return Se}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const P=this._unmodified,{center:oe,zoom:Se}=this.getConstrained(this.center,this.zoom);this.center=oe,this.zoom=Se,this._unmodified=P,this._constraining=!1}_calcMatrices(){if(!this.height)return;const P=this.centerOffset,oe=this.point.x,Se=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let ke=t.an(new Float64Array(16));t.K(ke,ke,[this.width/2,-this.height/2,1]),t.J(ke,ke,[1,-1,0]),this.labelPlaneMatrix=ke,ke=t.an(new Float64Array(16)),t.K(ke,ke,[1,-1,1]),t.J(ke,ke,[-1,-1,0]),t.K(ke,ke,[2/this.width,2/this.height,1]),this.glCoordMatrix=ke;const Be=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),gt=Math.min(this.elevation,this.minElevationForCurrentTile),kt=Be-gt*this._pixelPerMeter/Math.cos(this._pitch),Gt=gt<0?kt:Be,cr=Math.PI/2+this._pitch,Ar=this._fov*(.5+P.y/this.height),Cr=Math.sin(Ar)*Gt/Math.sin(t.ac(Math.PI-cr-Ar,.01,Math.PI-.01)),Qr=this.getHorizon(),_n=2*Math.atan(Qr/this.cameraToCenterDistance)*(.5+P.y/(2*Qr)),Ze=Math.sin(_n)*Gt/Math.sin(t.ac(Math.PI-cr-_n,.01,Math.PI-.01)),et=Math.min(Cr,Ze);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*et+Gt),this.nearZ=this.height/50,ke=new Float64Array(16),t.b6(ke,this._fov,this.width/this.height,this.nearZ,this.farZ),ke[8]=2*-P.x/this.width,ke[9]=2*P.y/this.height,this.projectionMatrix=t.ae(ke),t.K(ke,ke,[1,-1,1]),t.J(ke,ke,[0,0,-this.cameraToCenterDistance]),t.b7(ke,ke,this._pitch),t.ad(ke,ke,this.angle),t.J(ke,ke,[-oe,-Se,0]),this.mercatorMatrix=t.K([],ke,[this.worldSize,this.worldSize,this.worldSize]),t.K(ke,ke,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,ke),t.J(ke,ke,[0,0,-this.elevation]),this.modelViewProjectionMatrix=ke,this.invModelViewProjectionMatrix=t.as([],ke),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,Be,this.farZ),this.fogMatrix[8]=2*-P.x/this.width,this.fogMatrix[9]=2*P.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-oe,-Se,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,ke);const ht=this.width%2/2,_t=this.height%2/2,zt=Math.cos(this.angle),Et=Math.sin(this.angle),Ut=oe-Math.round(oe)+zt*ht+Et*_t,mr=Se-Math.round(Se)+zt*_t+Et*ht,Tr=new Float64Array(ke);if(t.J(Tr,Tr,[Ut>.5?Ut-1:Ut,mr>.5?mr-1:mr,0]),this.alignedModelViewProjectionMatrix=Tr,ke=t.as(new Float64Array(16),this.pixelMatrix),!ke)throw new Error("failed to invert matrix");this.pixelMatrixInverse=ke,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const P=this.pointCoordinate(new t.P(0,0)),oe=[P.x*this.worldSize,P.y*this.worldSize,0,1];return t.af(oe,oe,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const P=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,P))}getCameraQueryGeometry(P){const oe=this.getCameraPoint();if(P.length===1)return[P[0],oe];{let Se=oe.x,ke=oe.y,Be=oe.x,gt=oe.y;for(const kt of P)Se=Math.min(Se,kt.x),ke=Math.min(ke,kt.y),Be=Math.max(Be,kt.x),gt=Math.max(gt,kt.y);return[new t.P(Se,ke),new t.P(Be,ke),new t.P(Be,gt),new t.P(Se,gt),new t.P(Se,ke)]}}lngLatToCameraDepth(P,oe){const Se=this.locationCoordinate(P),ke=[Se.x*this.worldSize,Se.y*this.worldSize,oe,1];return t.af(ke,ke,this.modelViewProjectionMatrix),ke[2]/ke[3]}}function $f(Ue,P){let oe,Se=!1,ke=null,Be=null;const gt=()=>{ke=null,Se&&(Ue.apply(Be,oe),ke=setTimeout(gt,P),Se=!1)};return(...kt)=>(Se=!0,Be=this,oe=kt,ke||gt(),ke)}class ff{constructor(P){this._getCurrentHash=()=>{const oe=window.location.hash.replace("#","");if(this._hashName){let Se;return oe.split("&").map(ke=>ke.split("=")).forEach(ke=>{ke[0]===this._hashName&&(Se=ke)}),(Se&&Se[1]||"").split("/")}return oe.split("/")},this._onHashChange=()=>{const oe=this._getCurrentHash();if(oe.length>=3&&!oe.some(Se=>isNaN(Se))){const Se=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(oe[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+oe[2],+oe[1]],zoom:+oe[0],bearing:Se,pitch:+(oe[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const oe=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,oe)},this._removeHash=()=>{const oe=this._getCurrentHash();if(oe.length===0)return;const Se=oe.join("/");let ke=Se;ke.split("&").length>0&&(ke=ke.split("&")[0]),this._hashName&&(ke=`${this._hashName}=${Se}`);let Be=window.location.hash.replace(ke,"");Be.startsWith("#&")?Be=Be.slice(0,1)+Be.slice(2):Be==="#"&&(Be="");let gt=window.location.href.replace(/(#.+)?$/,Be);gt=gt.replace("&&","&"),window.history.replaceState(window.history.state,null,gt)},this._updateHash=$f(this._updateHashUnthrottled,300),this._hashName=P&&encodeURIComponent(P)}addTo(P){return this._map=P,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(P){const oe=this._map.getCenter(),Se=Math.round(100*this._map.getZoom())/100,ke=Math.ceil((Se*Math.LN2+Math.log(512/360/.5))/Math.LN10),Be=Math.pow(10,ke),gt=Math.round(oe.lng*Be)/Be,kt=Math.round(oe.lat*Be)/Be,Gt=this._map.getBearing(),cr=this._map.getPitch();let Ar="";if(Ar+=P?`/${gt}/${kt}/${Se}`:`${Se}/${kt}/${gt}`,(Gt||cr)&&(Ar+="/"+Math.round(10*Gt)/10),cr&&(Ar+=`/${Math.round(cr)}`),this._hashName){const Cr=this._hashName;let Qr=!1;const _n=window.location.hash.slice(1).split("&").map(Ze=>{const et=Ze.split("=")[0];return et===Cr?(Qr=!0,`${et}=${Ar}`):Ze}).filter(Ze=>Ze);return Qr||_n.push(`${Cr}=${Ar}`),`#${_n.join("&")}`}return`#${Ar}`}}const Ff={linearity:.3,easing:t.b8(0,0,.3,1)},xh=t.e({deceleration:2500,maxSpeed:1400},Ff),Tv=t.e({deceleration:20,maxSpeed:1400},Ff),Zv=t.e({deceleration:1e3,maxSpeed:360},Ff),Jf=t.e({deceleration:1e3,maxSpeed:90},Ff);class bh{constructor(P){this._map=P,this.clear()}clear(){this._inertiaBuffer=[]}record(P){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.now(),settings:P})}_drainInertiaBuffer(){const P=this._inertiaBuffer,oe=i.now();for(;P.length>0&&oe-P[0].time>160;)P.shift()}_onMoveEnd(P){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const oe={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Be}of this._inertiaBuffer)oe.zoom+=Be.zoomDelta||0,oe.bearing+=Be.bearingDelta||0,oe.pitch+=Be.pitchDelta||0,Be.panDelta&&oe.pan._add(Be.panDelta),Be.around&&(oe.around=Be.around),Be.pinchAround&&(oe.pinchAround=Be.pinchAround);const Se=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,ke={};if(oe.pan.mag()){const Be=wh(oe.pan.mag(),Se,t.e({},xh,P||{}));ke.offset=oe.pan.mult(Be.amount/oe.pan.mag()),ke.center=this._map.transform.center,Vc(ke,Be)}if(oe.zoom){const Be=wh(oe.zoom,Se,Tv);ke.zoom=this._map.transform.zoom+Be.amount,Vc(ke,Be)}if(oe.bearing){const Be=wh(oe.bearing,Se,Zv);ke.bearing=this._map.transform.bearing+t.ac(Be.amount,-179,179),Vc(ke,Be)}if(oe.pitch){const Be=wh(oe.pitch,Se,Jf);ke.pitch=this._map.transform.pitch+Be.amount,Vc(ke,Be)}if(ke.zoom||ke.bearing){const Be=oe.pinchAround===void 0?oe.around:oe.pinchAround;ke.around=Be?this._map.unproject(Be):this._map.getCenter()}return this.clear(),t.e(ke,{noMoveStart:!0})}}function Vc(Ue,P){(!Ue.duration||Ue.durationoe.unproject(Gt)),kt=Be.reduce((Gt,cr,Ar,Cr)=>Gt.add(cr.div(Cr.length)),new t.P(0,0));super(P,{points:Be,point:kt,lngLats:gt,lngLat:oe.unproject(kt),originalEvent:Se}),this._defaultPrevented=!1}}class Gh extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(P,oe,Se){super(P,{originalEvent:Se}),this._defaultPrevented=!1}}class eh{constructor(P,oe){this._map=P,this._clickTolerance=oe.clickTolerance}reset(){delete this._mousedownPos}wheel(P){return this._firePreventable(new Gh(P.type,this._map,P))}mousedown(P,oe){return this._mousedownPos=oe,this._firePreventable(new ic(P.type,this._map,P))}mouseup(P){this._map.fire(new ic(P.type,this._map,P))}click(P,oe){this._mousedownPos&&this._mousedownPos.dist(oe)>=this._clickTolerance||this._map.fire(new ic(P.type,this._map,P))}dblclick(P){return this._firePreventable(new ic(P.type,this._map,P))}mouseover(P){this._map.fire(new ic(P.type,this._map,P))}mouseout(P){this._map.fire(new ic(P.type,this._map,P))}touchstart(P){return this._firePreventable(new Qf(P.type,this._map,P))}touchmove(P){this._map.fire(new Qf(P.type,this._map,P))}touchend(P){this._map.fire(new Qf(P.type,this._map,P))}touchcancel(P){this._map.fire(new Qf(P.type,this._map,P))}_firePreventable(P){if(this._map.fire(P),P.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class tu{constructor(P){this._map=P}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(P){this._map.fire(new ic(P.type,this._map,P))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ic("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(P){this._delayContextMenu?this._contextMenuEvent=P:this._ignoreContextMenu||this._map.fire(new ic(P.type,this._map,P)),this._map.listens("contextmenu")&&P.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Dc{constructor(P){this._map=P}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(P){return this.transform.pointLocation(t.P.convert(P),this._map.terrain)}}class nf{constructor(P,oe){this._map=P,this._tr=new Dc(P),this._el=P.getCanvasContainer(),this._container=P.getContainer(),this._clickTolerance=oe.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(P,oe){this.isEnabled()&&P.shiftKey&&P.button===0&&(a.disableDrag(),this._startPos=this._lastPos=oe,this._active=!0)}mousemoveWindow(P,oe){if(!this._active)return;const Se=oe;if(this._lastPos.equals(Se)||!this._box&&Se.dist(this._startPos)Be.fitScreenCoordinates(Se,ke,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",P)}keydown(P){this._active&&P.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",P))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(a.remove(this._box),this._box=null),a.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(P,oe){return this._map.fire(new t.k(P,{originalEvent:oe}))}}function Oh(Ue,P){if(Ue.length!==P.length)throw new Error(`The number of touches and points are not equal - touches ${Ue.length}, points ${P.length}`);const oe={};for(let Se=0;Sethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=P.timeStamp),Se.length===this.numTouches&&(this.centroid=(function(ke){const Be=new t.P(0,0);for(const gt of ke)Be._add(gt);return Be.div(ke.length)})(oe),this.touches=Oh(Se,oe)))}touchmove(P,oe,Se){if(this.aborted||!this.centroid)return;const ke=Oh(Se,oe);for(const Be in this.touches){const gt=ke[Be];(!gt||gt.dist(this.touches[Be])>30)&&(this.aborted=!0)}}touchend(P,oe,Se){if((!this.centroid||P.timeStamp-this.startTime>500)&&(this.aborted=!0),Se.length===0){const ke=!this.aborted&&this.centroid;if(this.reset(),ke)return ke}}}class lh{constructor(P){this.singleTap=new iu(P),this.numTaps=P.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(P,oe,Se){this.singleTap.touchstart(P,oe,Se)}touchmove(P,oe,Se){this.singleTap.touchmove(P,oe,Se)}touchend(P,oe,Se){const ke=this.singleTap.touchend(P,oe,Se);if(ke){const Be=P.timeStamp-this.lastTime<500,gt=!this.lastTap||this.lastTap.dist(ke)<30;if(Be&>||this.reset(),this.count++,this.lastTime=P.timeStamp,this.lastTap=ke,this.count===this.numTaps)return this.reset(),ke}}}class Bf{constructor(P){this._tr=new Dc(P),this._zoomIn=new lh({numTouches:1,numTaps:2}),this._zoomOut=new lh({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(P,oe,Se){this._zoomIn.touchstart(P,oe,Se),this._zoomOut.touchstart(P,oe,Se)}touchmove(P,oe,Se){this._zoomIn.touchmove(P,oe,Se),this._zoomOut.touchmove(P,oe,Se)}touchend(P,oe,Se){const ke=this._zoomIn.touchend(P,oe,Se),Be=this._zoomOut.touchend(P,oe,Se),gt=this._tr;return ke?(this._active=!0,P.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:kt=>kt.easeTo({duration:300,zoom:gt.zoom+1,around:gt.unproject(ke)},{originalEvent:P})}):Be?(this._active=!0,P.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:kt=>kt.easeTo({duration:300,zoom:gt.zoom-1,around:gt.unproject(Be)},{originalEvent:P})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Hc{constructor(P){this._enabled=!!P.enable,this._moveStateManager=P.moveStateManager,this._clickTolerance=P.clickTolerance||1,this._moveFunction=P.move,this._activateOnStart=!!P.activateOnStart,P.assignEvents(this),this.reset()}reset(P){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(P)}_move(...P){const oe=this._moveFunction(...P);if(oe.bearingDelta||oe.pitchDelta||oe.around||oe.panDelta)return this._active=!0,oe}dragStart(P,oe){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(P)&&(this._moveStateManager.startMove(P),this._lastPoint=oe.length?oe[0]:oe,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(P,oe){if(!this.isEnabled())return;const Se=this._lastPoint;if(!Se)return;if(P.preventDefault(),!this._moveStateManager.isValidMoveEvent(P))return void this.reset(P);const ke=oe.length?oe[0]:oe;return!this._moved&&ke.dist(Se){Ue.mousedown=Ue.dragStart,Ue.mousemoveWindow=Ue.dragMove,Ue.mouseup=Ue.dragEnd,Ue.contextmenu=P=>{P.preventDefault()}},lc=({enable:Ue,clickTolerance:P,bearingDegreesPerPixelMoved:oe=.8})=>{const Se=new hf({checkCorrectEvent:ke=>a.mouseButton(ke)===0&&ke.ctrlKey||a.mouseButton(ke)===2});return new Hc({clickTolerance:P,move:(ke,Be)=>({bearingDelta:(Be.x-ke.x)*oe}),moveStateManager:Se,enable:Ue,assignEvents:Av})},Xh=({enable:Ue,clickTolerance:P,pitchDegreesPerPixelMoved:oe=-.5})=>{const Se=new hf({checkCorrectEvent:ke=>a.mouseButton(ke)===0&&ke.ctrlKey||a.mouseButton(ke)===2});return new Hc({clickTolerance:P,move:(ke,Be)=>({pitchDelta:(Be.y-ke.y)*oe}),moveStateManager:Se,enable:Ue,assignEvents:Av})};class Gc{constructor(P,oe){this._clickTolerance=P.clickTolerance||1,this._map=oe,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(P){return P<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(P,oe,Se){return this._calculateTransform(P,oe,Se)}touchmove(P,oe,Se){if(this._active){if(!this._shouldBePrevented(Se.length))return P.preventDefault(),this._calculateTransform(P,oe,Se);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",P)}}touchend(P,oe,Se){this._calculateTransform(P,oe,Se),this._active&&this._shouldBePrevented(Se.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(P,oe,Se){Se.length>0&&(this._active=!0);const ke=Oh(Se,oe),Be=new t.P(0,0),gt=new t.P(0,0);let kt=0;for(const cr in ke){const Ar=ke[cr],Cr=this._touches[cr];Cr&&(Be._add(Ar),gt._add(Ar.sub(Cr)),kt++,ke[cr]=Ar)}if(this._touches=ke,this._shouldBePrevented(kt)||!gt.mag())return;const Gt=gt.div(kt);return this._sum._add(Gt),this._sum.mag()Math.abs(Ue.x)}class Fh extends Sf{constructor(P){super(),this._currentTouchCount=0,this._map=P}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(P,oe,Se){super.touchstart(P,oe,Se),this._currentTouchCount=Se.length}_start(P){this._lastPoints=P,df(P[0].sub(P[1]))&&(this._valid=!1)}_move(P,oe,Se){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const ke=P[0].sub(this._lastPoints[0]),Be=P[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(ke,Be,Se.timeStamp),this._valid?(this._lastPoints=P,this._active=!0,{pitchDelta:(ke.y+Be.y)/2*-.5}):void 0}gestureBeginsVertically(P,oe,Se){if(this._valid!==void 0)return this._valid;const ke=P.mag()>=2,Be=oe.mag()>=2;if(!ke&&!Be)return;if(!ke||!Be)return this._firstMove===void 0&&(this._firstMove=Se),Se-this._firstMove<100&&void 0;const gt=P.y>0==oe.y>0;return df(P)&&df(oe)&>}}const ur={panStep:100,bearingStep:15,pitchStep:10};class Pr{constructor(P){this._tr=new Dc(P);const oe=ur;this._panStep=oe.panStep,this._bearingStep=oe.bearingStep,this._pitchStep=oe.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(P){if(P.altKey||P.ctrlKey||P.metaKey)return;let oe=0,Se=0,ke=0,Be=0,gt=0;switch(P.keyCode){case 61:case 107:case 171:case 187:oe=1;break;case 189:case 109:case 173:oe=-1;break;case 37:P.shiftKey?Se=-1:(P.preventDefault(),Be=-1);break;case 39:P.shiftKey?Se=1:(P.preventDefault(),Be=1);break;case 38:P.shiftKey?ke=1:(P.preventDefault(),gt=-1);break;case 40:P.shiftKey?ke=-1:(P.preventDefault(),gt=1);break;default:return}return this._rotationDisabled&&(Se=0,ke=0),{cameraAnimation:kt=>{const Gt=this._tr;kt.easeTo({duration:300,easeId:"keyboardHandler",easing:dn,zoom:oe?Math.round(Gt.zoom)+oe*(P.shiftKey?2:1):Gt.zoom,bearing:Gt.bearing+Se*this._bearingStep,pitch:Gt.pitch+ke*this._pitchStep,offset:[-Be*this._panStep,-gt*this._panStep],center:Gt.center},{originalEvent:P})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function dn(Ue){return Ue*(2-Ue)}const nn=4.000244140625;class On{constructor(P,oe){this._onTimeout=Se=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Se)},this._map=P,this._tr=new Dc(P),this._triggerRenderFrame=oe,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(P){this._defaultZoomRate=P}setWheelZoomRate(P){this._wheelZoomRate=P}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(P){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!P&&P.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(P){return!!this._map.cooperativeGestures.isEnabled()&&!(P.ctrlKey||this._map.cooperativeGestures.isBypassed(P))}wheel(P){if(!this.isEnabled())return;if(this._shouldBePrevented(P))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",P);let oe=P.deltaMode===WheelEvent.DOM_DELTA_LINE?40*P.deltaY:P.deltaY;const Se=i.now(),ke=Se-(this._lastWheelEventTime||0);this._lastWheelEventTime=Se,oe!==0&&oe%nn==0?this._type="wheel":oe!==0&&Math.abs(oe)<4?this._type="trackpad":ke>400?(this._type=null,this._lastValue=oe,this._timeout=setTimeout(this._onTimeout,40,P)):this._type||(this._type=Math.abs(ke*oe)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,oe+=this._lastValue)),P.shiftKey&&oe&&(oe/=4),this._type&&(this._lastWheelEvent=P,this._delta-=oe,this._active||this._start(P)),P.preventDefault()}_start(P){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const oe=a.mousePos(this._map.getCanvas(),P),Se=this._tr;this._around=oe.y>Se.transform.height/2-Se.transform.getHorizon()?t.N.convert(this._aroundCenter?Se.center:Se.unproject(oe)):t.N.convert(Se.center),this._aroundPoint=Se.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const P=this._tr.transform;if(this._delta!==0){const Gt=this._type==="wheel"&&Math.abs(this._delta)>nn?this._wheelZoomRate:this._defaultZoomRate;let cr=2/(1+Math.exp(-Math.abs(this._delta*Gt)));this._delta<0&&cr!==0&&(cr=1/cr);const Ar=typeof this._targetZoom=="number"?P.zoomScale(this._targetZoom):P.scale;this._targetZoom=Math.min(P.maxZoom,Math.max(P.minZoom,P.scaleZoom(Ar*cr))),this._type==="wheel"&&(this._startZoom=P.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const oe=typeof this._targetZoom=="number"?this._targetZoom:P.zoom,Se=this._startZoom,ke=this._easing;let Be,gt=!1;const kt=i.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Se&&ke&&kt){const Gt=Math.min(kt/200,1),cr=ke(Gt);Be=t.y.number(Se,oe,cr),Gt<1?this._frameId||(this._frameId=!0):gt=!0}else Be=oe,gt=!0;return this._active=!0,gt&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!gt,zoomDelta:Be-P.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(P){let oe=t.b9;if(this._prevEase){const Se=this._prevEase,ke=(i.now()-Se.start)/Se.duration,Be=Se.easing(ke+.01)-Se.easing(ke),gt=.27/Math.sqrt(Be*Be+1e-4)*.01,kt=Math.sqrt(.0729-gt*gt);oe=t.b8(gt,kt,.25,1)}return this._prevEase={start:i.now(),duration:P,easing:oe},oe}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ta{constructor(P,oe){this._clickZoom=P,this._tapZoom=oe}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class xa{constructor(P){this._tr=new Dc(P),this.reset()}reset(){this._active=!1}dblclick(P,oe){return P.preventDefault(),{cameraAnimation:Se=>{Se.easeTo({duration:300,zoom:this._tr.zoom+(P.shiftKey?-1:1),around:this._tr.unproject(oe)},{originalEvent:P})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ri{constructor(){this._tap=new lh({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(P,oe,Se){if(!this._swipePoint)if(this._tapTime){const ke=oe[0],Be=P.timeStamp-this._tapTime<500,gt=this._tapPoint.dist(ke)<30;Be&>?Se.length>0&&(this._swipePoint=ke,this._swipeTouch=Se[0].identifier):this.reset()}else this._tap.touchstart(P,oe,Se)}touchmove(P,oe,Se){if(this._tapTime){if(this._swipePoint){if(Se[0].identifier!==this._swipeTouch)return;const ke=oe[0],Be=ke.y-this._swipePoint.y;return this._swipePoint=ke,P.preventDefault(),this._active=!0,{zoomDelta:Be/128}}}else this._tap.touchmove(P,oe,Se)}touchend(P,oe,Se){if(this._tapTime)this._swipePoint&&Se.length===0&&this.reset();else{const ke=this._tap.touchend(P,oe,Se);ke&&(this._tapTime=P.timeStamp,this._tapPoint=ke)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class fi{constructor(P,oe,Se){this._el=P,this._mousePan=oe,this._touchPan=Se}enable(P){this._inertiaOptions=P||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ni{constructor(P,oe,Se){this._pitchWithRotate=P.pitchWithRotate,this._mouseRotate=oe,this._mousePitch=Se}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Va{constructor(P,oe,Se,ke){this._el=P,this._touchZoom=oe,this._touchRotate=Se,this._tapDragZoom=ke,this._rotationDisabled=!1,this._enabled=!0}enable(P){this._touchZoom.enable(P),this._rotationDisabled||this._touchRotate.enable(P),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Ai{constructor(P,oe){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=P,this._options=oe,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const P=this._map.getCanvasContainer();P.classList.add("maplibregl-cooperative-gestures"),this._container=a.create("div","maplibregl-cooperative-gesture-screen",P);let oe=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(oe=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const Se=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),ke=document.createElement("div");ke.className="maplibregl-desktop-message",ke.textContent=oe,this._container.appendChild(ke);const Be=document.createElement("div");Be.className="maplibregl-mobile-message",Be.textContent=Se,this._container.appendChild(Be),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(a.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(P){return P[this._bypassKey]}notifyGestureBlocked(P,oe){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:P,originalEvent:oe})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const ei=Ue=>Ue.zoom||Ue.drag||Ue.pitch||Ue.rotate;class Na extends t.k{}function Zi(Ue){return Ue.panDelta&&Ue.panDelta.mag()||Ue.zoomDelta||Ue.bearingDelta||Ue.pitchDelta}class jo{constructor(P,oe){this.handleWindowEvent=ke=>{this.handleEvent(ke,`${ke.type}Window`)},this.handleEvent=(ke,Be)=>{if(ke.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const gt=ke.type==="renderFrame"?void 0:ke,kt={needsRenderFrame:!1},Gt={},cr={},Ar=ke.touches,Cr=Ar?this._getMapTouches(Ar):void 0,Qr=Cr?a.touchPos(this._map.getCanvas(),Cr):a.mousePos(this._map.getCanvas(),ke);for(const{handlerName:et,handler:ht,allowed:_t}of this._handlers){if(!ht.isEnabled())continue;let zt;this._blockedByActive(cr,_t,et)?ht.reset():ht[Be||ke.type]&&(zt=ht[Be||ke.type](ke,Qr,Cr),this.mergeHandlerResult(kt,Gt,zt,et,gt),zt&&zt.needsRenderFrame&&this._triggerRenderFrame()),(zt||ht.isActive())&&(cr[et]=ht)}const _n={};for(const et in this._previousActiveHandlers)cr[et]||(_n[et]=gt);this._previousActiveHandlers=cr,(Object.keys(_n).length||Zi(kt))&&(this._changes.push([kt,Gt,_n]),this._triggerRenderFrame()),(Object.keys(cr).length||Zi(kt))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:Ze}=kt;Ze&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Ze(this._map))},this._map=P,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new bh(P),this._bearingSnap=oe.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(oe);const Se=this._el;this._listeners=[[Se,"touchstart",{passive:!0}],[Se,"touchmove",{passive:!1}],[Se,"touchend",void 0],[Se,"touchcancel",void 0],[Se,"mousedown",void 0],[Se,"mousemove",void 0],[Se,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Se,"mouseover",void 0],[Se,"mouseout",void 0],[Se,"dblclick",void 0],[Se,"click",void 0],[Se,"keydown",{capture:!1}],[Se,"keyup",void 0],[Se,"wheel",{passive:!1}],[Se,"contextmenu",void 0],[window,"blur",void 0]];for(const[ke,Be,gt]of this._listeners)a.addEventListener(ke,Be,ke===document?this.handleWindowEvent:this.handleEvent,gt)}destroy(){for(const[P,oe,Se]of this._listeners)a.removeEventListener(P,oe,P===document?this.handleWindowEvent:this.handleEvent,Se)}_addDefaultHandlers(P){const oe=this._map,Se=oe.getCanvasContainer();this._add("mapEvent",new eh(oe,P));const ke=oe.boxZoom=new nf(oe,P);this._add("boxZoom",ke),P.interactive&&P.boxZoom&&ke.enable();const Be=oe.cooperativeGestures=new Ai(oe,P.cooperativeGestures);this._add("cooperativeGestures",Be),P.cooperativeGestures&&Be.enable();const gt=new Bf(oe),kt=new xa(oe);oe.doubleClickZoom=new Ta(kt,gt),this._add("tapZoom",gt),this._add("clickZoom",kt),P.interactive&&P.doubleClickZoom&&oe.doubleClickZoom.enable();const Gt=new ri;this._add("tapDragZoom",Gt);const cr=oe.touchPitch=new Fh(oe);this._add("touchPitch",cr),P.interactive&&P.touchPitch&&oe.touchPitch.enable(P.touchPitch);const Ar=lc(P),Cr=Xh(P);oe.dragRotate=new Ni(P,Ar,Cr),this._add("mouseRotate",Ar,["mousePitch"]),this._add("mousePitch",Cr,["mouseRotate"]),P.interactive&&P.dragRotate&&oe.dragRotate.enable();const Qr=(({enable:zt,clickTolerance:Et})=>{const Ut=new hf({checkCorrectEvent:mr=>a.mouseButton(mr)===0&&!mr.ctrlKey});return new Hc({clickTolerance:Et,move:(mr,Tr)=>({around:Tr,panDelta:Tr.sub(mr)}),activateOnStart:!0,moveStateManager:Ut,enable:zt,assignEvents:Av})})(P),_n=new Gc(P,oe);oe.dragPan=new fi(Se,Qr,_n),this._add("mousePan",Qr),this._add("touchPan",_n,["touchZoom","touchRotate"]),P.interactive&&P.dragPan&&oe.dragPan.enable(P.dragPan);const Ze=new Nf,et=new _c;oe.touchZoomRotate=new Va(Se,et,Ze,Gt),this._add("touchRotate",Ze,["touchPan","touchZoom"]),this._add("touchZoom",et,["touchPan","touchRotate"]),P.interactive&&P.touchZoomRotate&&oe.touchZoomRotate.enable(P.touchZoomRotate);const ht=oe.scrollZoom=new On(oe,()=>this._triggerRenderFrame());this._add("scrollZoom",ht,["mousePan"]),P.interactive&&P.scrollZoom&&oe.scrollZoom.enable(P.scrollZoom);const _t=oe.keyboard=new Pr(oe);this._add("keyboard",_t),P.interactive&&P.keyboard&&oe.keyboard.enable(),this._add("blockableMapEvent",new tu(oe))}_add(P,oe,Se){this._handlers.push({handlerName:P,handler:oe,allowed:Se}),this._handlersById[P]=oe}stop(P){if(!this._updatingCamera){for(const{handler:oe}of this._handlers)oe.reset();this._inertia.clear(),this._fireEvents({},{},P),this._changes=[]}}isActive(){for(const{handler:P}of this._handlers)if(P.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ei(this._eventsInProgress)||this.isZooming()}_blockedByActive(P,oe,Se){for(const ke in P)if(ke!==Se&&(!oe||oe.indexOf(ke)<0))return!0;return!1}_getMapTouches(P){const oe=[];for(const Se of P)this._el.contains(Se.target)&&oe.push(Se);return oe}mergeHandlerResult(P,oe,Se,ke,Be){if(!Se)return;t.e(P,Se);const gt={handlerName:ke,originalEvent:Se.originalEvent||Be};Se.zoomDelta!==void 0&&(oe.zoom=gt),Se.panDelta!==void 0&&(oe.drag=gt),Se.pitchDelta!==void 0&&(oe.pitch=gt),Se.bearingDelta!==void 0&&(oe.rotate=gt)}_applyChanges(){const P={},oe={},Se={};for(const[ke,Be,gt]of this._changes)ke.panDelta&&(P.panDelta=(P.panDelta||new t.P(0,0))._add(ke.panDelta)),ke.zoomDelta&&(P.zoomDelta=(P.zoomDelta||0)+ke.zoomDelta),ke.bearingDelta&&(P.bearingDelta=(P.bearingDelta||0)+ke.bearingDelta),ke.pitchDelta&&(P.pitchDelta=(P.pitchDelta||0)+ke.pitchDelta),ke.around!==void 0&&(P.around=ke.around),ke.pinchAround!==void 0&&(P.pinchAround=ke.pinchAround),ke.noInertia&&(P.noInertia=ke.noInertia),t.e(oe,Be),t.e(Se,gt);this._updateMapTransform(P,oe,Se),this._changes=[]}_updateMapTransform(P,oe,Se){const ke=this._map,Be=ke._getTransformForUpdate(),gt=ke.terrain;if(!(Zi(P)||gt&&this._terrainMovement))return this._fireEvents(oe,Se,!0);let{panDelta:kt,zoomDelta:Gt,bearingDelta:cr,pitchDelta:Ar,around:Cr,pinchAround:Qr}=P;Qr!==void 0&&(Cr=Qr),ke._stop(!0),Cr=Cr||ke.transform.centerPoint;const _n=Be.pointLocation(kt?Cr.sub(kt):Cr);cr&&(Be.bearing+=cr),Ar&&(Be.pitch+=Ar),Gt&&(Be.zoom+=Gt),gt?this._terrainMovement||!oe.drag&&!oe.zoom?oe.drag&&this._terrainMovement?Be.center=Be.pointLocation(Be.centerPoint.sub(kt)):Be.setLocationAtPoint(_n,Cr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Be.setLocationAtPoint(_n,Cr)):Be.setLocationAtPoint(_n,Cr),ke._applyUpdatedTransform(Be),this._map._update(),P.noInertia||this._inertia.record(P),this._fireEvents(oe,Se,!0)}_fireEvents(P,oe,Se){const ke=ei(this._eventsInProgress),Be=ei(P),gt={};for(const Cr in P){const{originalEvent:Qr}=P[Cr];this._eventsInProgress[Cr]||(gt[`${Cr}start`]=Qr),this._eventsInProgress[Cr]=P[Cr]}!ke&&Be&&this._fireEvent("movestart",Be.originalEvent);for(const Cr in gt)this._fireEvent(Cr,gt[Cr]);Be&&this._fireEvent("move",Be.originalEvent);for(const Cr in P){const{originalEvent:Qr}=P[Cr];this._fireEvent(Cr,Qr)}const kt={};let Gt;for(const Cr in this._eventsInProgress){const{handlerName:Qr,originalEvent:_n}=this._eventsInProgress[Cr];this._handlersById[Qr].isActive()||(delete this._eventsInProgress[Cr],Gt=oe[Qr]||_n,kt[`${Cr}end`]=Gt)}for(const Cr in kt)this._fireEvent(Cr,kt[Cr]);const cr=ei(this._eventsInProgress),Ar=(ke||Be)&&!cr;if(Ar&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const Cr=this._map._getTransformForUpdate();Cr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Cr)}if(Se&&Ar){this._updatingCamera=!0;const Cr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Qr=_n=>_n!==0&&-this._bearingSnap<_n&&_n{delete this._frameId,this.handleEvent(new Na("renderFrame",{timeStamp:P})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Fo extends t.E{constructor(P,oe){super(),this._renderFrameCallback=()=>{const Se=Math.min((i.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Se)),Se<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=P,this._bearingSnap=oe.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(P,oe){return this.jumpTo({center:P},oe)}panBy(P,oe,Se){return P=t.P.convert(P).mult(-1),this.panTo(this.transform.center,t.e({offset:P},oe),Se)}panTo(P,oe,Se){return this.easeTo(t.e({center:P},oe),Se)}getZoom(){return this.transform.zoom}setZoom(P,oe){return this.jumpTo({zoom:P},oe),this}zoomTo(P,oe,Se){return this.easeTo(t.e({zoom:P},oe),Se)}zoomIn(P,oe){return this.zoomTo(this.getZoom()+1,P,oe),this}zoomOut(P,oe){return this.zoomTo(this.getZoom()-1,P,oe),this}getBearing(){return this.transform.bearing}setBearing(P,oe){return this.jumpTo({bearing:P},oe),this}getPadding(){return this.transform.padding}setPadding(P,oe){return this.jumpTo({padding:P},oe),this}rotateTo(P,oe,Se){return this.easeTo(t.e({bearing:P},oe),Se)}resetNorth(P,oe){return this.rotateTo(0,t.e({duration:1e3},P),oe),this}resetNorthPitch(P,oe){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},P),oe),this}snapToNorth(P,oe){return Math.abs(this.getBearing()){if(this._zooming&&(ke.zoom=t.y.number(Be,ht,Lr)),this._rotating&&(ke.bearing=t.y.number(gt,cr,Lr)),this._pitching&&(ke.pitch=t.y.number(kt,Ar,Lr)),this._padding&&(ke.interpolatePadding(Gt,Cr,Lr),_n=ke.centerPoint.add(Qr)),this.terrain&&!P.freezeElevation&&this._updateElevation(Lr),Ut)ke.setLocationAtPoint(Ut,mr);else{const Gr=ke.zoomScale(ke.zoom-Be),on=ht>Be?Math.min(2,Et):Math.max(.5,Et),Mn=Math.pow(on,1-Lr),Pn=ke.unproject(_t.add(zt.mult(Lr*Mn)).mult(Gr));ke.setLocationAtPoint(ke.renderWorldCopies?Pn.wrap():Pn,_n)}this._applyUpdatedTransform(ke),this._fireMoveEvents(oe)},Lr=>{this.terrain&&P.freezeElevation&&this._finalizeElevation(),this._afterEase(oe,Lr)},P),this}_prepareEase(P,oe,Se={}){this._moving=!0,oe||Se.moving||this.fire(new t.k("movestart",P)),this._zooming&&!Se.zooming&&this.fire(new t.k("zoomstart",P)),this._rotating&&!Se.rotating&&this.fire(new t.k("rotatestart",P)),this._pitching&&!Se.pitching&&this.fire(new t.k("pitchstart",P))}_prepareElevation(P){this._elevationCenter=P,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(P,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(P){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const oe=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(P<1&&oe!==this._elevationTarget){const Se=this._elevationTarget-this._elevationStart;this._elevationStart+=P*(Se-(oe-(Se*P+this._elevationStart))/(1-P)),this._elevationTarget=oe}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,P)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(P){const oe=P.getCameraPosition(),Se=this.terrain.getElevationForLngLatZoom(oe.lngLat,P.zoom);if(oe.altitudethis._elevateCameraIfInsideTerrain(ke)),this.transformCameraUpdate&&oe.push(ke=>this.transformCameraUpdate(ke)),!oe.length)return;const Se=P.clone();for(const ke of oe){const Be=Se.clone(),{center:gt,zoom:kt,pitch:Gt,bearing:cr,elevation:Ar}=ke(Be);gt&&(Be.center=gt),kt!==void 0&&(Be.zoom=kt),Gt!==void 0&&(Be.pitch=Gt),cr!==void 0&&(Be.bearing=cr),Ar!==void 0&&(Be.elevation=Ar),Se.apply(Be)}this.transform.apply(Se)}_fireMoveEvents(P){this.fire(new t.k("move",P)),this._zooming&&this.fire(new t.k("zoom",P)),this._rotating&&this.fire(new t.k("rotate",P)),this._pitching&&this.fire(new t.k("pitch",P))}_afterEase(P,oe){if(this._easeId&&oe&&this._easeId===oe)return;delete this._easeId;const Se=this._zooming,ke=this._rotating,Be=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Se&&this.fire(new t.k("zoomend",P)),ke&&this.fire(new t.k("rotateend",P)),Be&&this.fire(new t.k("pitchend",P)),this.fire(new t.k("moveend",P))}flyTo(P,oe){var Se;if(!P.essential&&i.prefersReducedMotion){const ii=t.M(P,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ii,oe)}this.stop(),P=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},P);const ke=this._getTransformForUpdate(),Be=ke.zoom,gt=ke.bearing,kt=ke.pitch,Gt=ke.padding,cr="bearing"in P?this._normalizeBearing(P.bearing,gt):gt,Ar="pitch"in P?+P.pitch:kt,Cr="padding"in P?P.padding:ke.padding,Qr=t.P.convert(P.offset);let _n=ke.centerPoint.add(Qr);const Ze=ke.pointLocation(_n),{center:et,zoom:ht}=ke.getConstrained(t.N.convert(P.center||Ze),(Se=P.zoom)!==null&&Se!==void 0?Se:Be);this._normalizeCenter(et,ke);const _t=ke.zoomScale(ht-Be),zt=ke.project(Ze),Et=ke.project(et).sub(zt);let Ut=P.curve;const mr=Math.max(ke.width,ke.height),Tr=mr/_t,Lr=Et.mag();if("minZoom"in P){const ii=t.ac(Math.min(P.minZoom,Be,ht),ke.minZoom,ke.maxZoom),$i=mr/ke.zoomScale(ii-Be);Ut=Math.sqrt($i/Lr*2)}const Gr=Ut*Ut;function on(ii){const $i=(Tr*Tr-mr*mr+(ii?-1:1)*Gr*Gr*Lr*Lr)/(2*(ii?Tr:mr)*Gr*Lr);return Math.log(Math.sqrt($i*$i+1)-$i)}function Mn(ii){return(Math.exp(ii)-Math.exp(-ii))/2}function Pn(ii){return(Math.exp(ii)+Math.exp(-ii))/2}const Yn=on(!1);let wa=function(ii){return Pn(Yn)/Pn(Yn+Ut*ii)},ni=function(ii){return mr*((Pn(Yn)*(Mn($i=Yn+Ut*ii)/Pn($i))-Mn(Yn))/Gr)/Lr;var $i},Ka=(on(!0)-Yn)/Ut;if(Math.abs(Lr)<1e-6||!isFinite(Ka)){if(Math.abs(mr-Tr)<1e-6)return this.easeTo(P,oe);const ii=Tr0,wa=$i=>Math.exp(ii*Ut*$i)}return P.duration="duration"in P?+P.duration:1e3*Ka/("screenSpeed"in P?+P.screenSpeed/Ut:+P.speed),P.maxDuration&&P.duration>P.maxDuration&&(P.duration=0),this._zooming=!0,this._rotating=gt!==cr,this._pitching=Ar!==kt,this._padding=!ke.isPaddingEqual(Cr),this._prepareEase(oe,!1),this.terrain&&this._prepareElevation(et),this._ease(ii=>{const $i=ii*Ka,Ao=1/wa($i);ke.zoom=ii===1?ht:Be+ke.scaleZoom(Ao),this._rotating&&(ke.bearing=t.y.number(gt,cr,ii)),this._pitching&&(ke.pitch=t.y.number(kt,Ar,ii)),this._padding&&(ke.interpolatePadding(Gt,Cr,ii),_n=ke.centerPoint.add(Qr)),this.terrain&&!P.freezeElevation&&this._updateElevation(ii);const mo=ii===1?et:ke.unproject(zt.add(Et.mult(ni($i))).mult(Ao));ke.setLocationAtPoint(ke.renderWorldCopies?mo.wrap():mo,_n),this._applyUpdatedTransform(ke),this._fireMoveEvents(oe)},()=>{this.terrain&&P.freezeElevation&&this._finalizeElevation(),this._afterEase(oe)},P),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(P,oe){var Se;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const ke=this._onEaseEnd;delete this._onEaseEnd,ke.call(this,oe)}return P||(Se=this.handlers)===null||Se===void 0||Se.stop(!1),this}_ease(P,oe,Se){Se.animate===!1||Se.duration===0?(P(1),oe()):(this._easeStart=i.now(),this._easeOptions=Se,this._onEaseFrame=P,this._onEaseEnd=oe,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(P,oe){P=t.b3(P,-180,180);const Se=Math.abs(P-oe);return Math.abs(P-360-oe)180?-360:Se<-180?360:0}queryTerrainElevation(P){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(P),this.transform.tileZoom)-this.transform.elevation:null}}const Yo={compact:!0,customAttribution:'MapLibre'};class Vo{constructor(P=Yo){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=oe=>{!oe||oe.sourceDataType!=="metadata"&&oe.sourceDataType!=="visibility"&&oe.dataType!=="style"&&oe.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=P}getDefaultPosition(){return"bottom-right"}onAdd(P){return this._map=P,this._compact=this.options.compact,this._container=a.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=a.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){a.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(P,oe){const Se=this._map._getUIString(`AttributionControl.${oe}`);P.title=Se,P.setAttribute("aria-label",Se)}_updateAttributions(){if(!this._map.style)return;let P=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?P=P.concat(this.options.customAttribution.map(ke=>typeof ke!="string"?"":ke)):typeof this.options.customAttribution=="string"&&P.push(this.options.customAttribution)),this._map.style.stylesheet){const ke=this._map.style.stylesheet;this.styleOwner=ke.owner,this.styleId=ke.id}const oe=this._map.style.sourceCaches;for(const ke in oe){const Be=oe[ke];if(Be.used||Be.usedForTerrain){const gt=Be.getSource();gt.attribution&&P.indexOf(gt.attribution)<0&&P.push(gt.attribution)}}P=P.filter(ke=>String(ke).trim()),P.sort((ke,Be)=>ke.length-Be.length),P=P.filter((ke,Be)=>{for(let gt=Be+1;gt=0)return!1;return!0});const Se=P.join(" | ");Se!==this._attribHTML&&(this._attribHTML=Se,P.length?(this._innerContainer.innerHTML=Se,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ki{constructor(P={}){this._updateCompact=()=>{const oe=this._container.children;if(oe.length){const Se=oe[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Se.classList.add("maplibregl-compact"):Se.classList.remove("maplibregl-compact")}},this.options=P}getDefaultPosition(){return"bottom-left"}onAdd(P){this._map=P,this._compact=this.options&&this.options.compact,this._container=a.create("div","maplibregl-ctrl");const oe=a.create("a","maplibregl-ctrl-logo");return oe.target="_blank",oe.rel="noopener nofollow",oe.href="https://maplibre.org/",oe.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),oe.setAttribute("rel","noopener nofollow"),this._container.appendChild(oe),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){a.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ri{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(P){const oe=++this._id;return this._queue.push({callback:P,id:oe,cancelled:!1}),oe}remove(P){const oe=this._currentlyRunning,Se=oe?this._queue.concat(oe):this._queue;for(const ke of Se)if(ke.id===P)return void(ke.cancelled=!0)}run(P=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const oe=this._currentlyRunning=this._queue;this._queue=[];for(const Se of oe)if(!Se.cancelled&&(Se.callback(P),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var is=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Us extends t.E{constructor(P){super(),this.sourceCache=P,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,P.usedForTerrain=!0,P.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(P,oe){this.sourceCache.update(P,oe),this._renderableTilesKeys=[];const Se={};for(const ke of P.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:oe}))Se[ke.key]=!0,this._renderableTilesKeys.push(ke.key),this._tiles[ke.key]||(ke.posMatrix=new Float64Array(16),t.aP(ke.posMatrix,0,t.X,0,t.X,0,1),this._tiles[ke.key]=new ft(ke,this.tileSize));for(const ke in this._tiles)Se[ke]||delete this._tiles[ke]}freeRtt(P){for(const oe in this._tiles){const Se=this._tiles[oe];(!P||Se.tileID.equals(P)||Se.tileID.isChildOf(P)||P.isChildOf(Se.tileID))&&(Se.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(P=>this.getTileByID(P))}getTileByID(P){return this._tiles[P]}getTerrainCoords(P){const oe={};for(const Se of this._renderableTilesKeys){const ke=this._tiles[Se].tileID;if(ke.canonical.equals(P.canonical)){const Be=P.clone();Be.posMatrix=new Float64Array(16),t.aP(Be.posMatrix,0,t.X,0,t.X,0,1),oe[Se]=Be}else if(ke.canonical.isChildOf(P.canonical)){const Be=P.clone();Be.posMatrix=new Float64Array(16);const gt=ke.canonical.z-P.canonical.z,kt=ke.canonical.x-(ke.canonical.x>>gt<>gt<>gt;t.aP(Be.posMatrix,0,cr,0,cr,0,1),t.J(Be.posMatrix,Be.posMatrix,[-kt*cr,-Gt*cr,0]),oe[Se]=Be}else if(P.canonical.isChildOf(ke.canonical)){const Be=P.clone();Be.posMatrix=new Float64Array(16);const gt=P.canonical.z-ke.canonical.z,kt=P.canonical.x-(P.canonical.x>>gt<>gt<>gt;t.aP(Be.posMatrix,0,t.X,0,t.X,0,1),t.J(Be.posMatrix,Be.posMatrix,[kt*cr,Gt*cr,0]),t.K(Be.posMatrix,Be.posMatrix,[1/2**gt,1/2**gt,0]),oe[Se]=Be}}return oe}getSourceTile(P,oe){const Se=this.sourceCache._source;let ke=P.overscaledZ-this.deltaZoom;if(ke>Se.maxzoom&&(ke=Se.maxzoom),ke=Se.minzoom&&(!Be||!Be.dem);)Be=this.sourceCache.getTileByID(P.scaledTo(ke--).key);return Be}tilesAfterTime(P=Date.now()){return Object.values(this._tiles).filter(oe=>oe.timeAdded>=P)}}class Al{constructor(P,oe,Se){this.painter=P,this.sourceCache=new Us(oe),this.options=Se,this.exaggeration=typeof Se.exaggeration=="number"?Se.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(P,oe,Se,ke=t.X){var Be;if(!(oe>=0&&oe=0&&SeP.canonical.z&&(P.canonical.z>=ke?Be=P.canonical.z-ke:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const gt=P.canonical.x-(P.canonical.x>>Be<>Be<>8<<4|Be>>8,oe[gt+3]=0;const Se=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(oe.buffer)),ke=new u(P,Se,P.gl.RGBA,{premultiply:!1});return ke.bind(P.gl.NEAREST,P.gl.CLAMP_TO_EDGE),this._coordsTexture=ke,ke}pointCoordinate(P){this.painter.maybeDrawDepthAndCoords(!0);const oe=new Uint8Array(4),Se=this.painter.context,ke=Se.gl,Be=Math.round(P.x*this.painter.pixelRatio/devicePixelRatio),gt=Math.round(P.y*this.painter.pixelRatio/devicePixelRatio),kt=Math.round(this.painter.height/devicePixelRatio);Se.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),ke.readPixels(Be,kt-gt-1,1,1,ke.RGBA,ke.UNSIGNED_BYTE,oe),Se.bindFramebuffer.set(null);const Gt=oe[0]+(oe[2]>>4<<8),cr=oe[1]+((15&oe[2])<<8),Ar=this.coordsIndex[255-oe[3]],Cr=Ar&&this.sourceCache.getTileByID(Ar);if(!Cr)return null;const Qr=this._coordsTextureSize,_n=(1<P.id!==oe),this._recentlyUsed.push(P.id)}stampObject(P){P.stamp=++this._stamp}getOrCreateFreeObject(){for(const oe of this._recentlyUsed)if(!this._objects[oe].inUse)return this._objects[oe];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const P=this._createObject(this._objects.length);return this._objects.push(P),P}freeObject(P){P.inUse=!1}freeAllObjects(){for(const P of this._objects)this.freeObject(P)}isFull(){return!(this._objects.length!P.inUse)===!1}}const Ml={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Yl{constructor(P,oe){this.painter=P,this.terrain=oe,this.pool=new Xl(P.context,30,oe.sourceCache.tileSize*oe.qualityFactor)}destruct(){this.pool.destruct()}getTexture(P){return this.pool.getObjectForId(P.rtt[this._stacks.length-1].id).texture}prepareForRender(P,oe){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=P._order.filter(Se=>!P._layers[Se].isHidden(oe)),this._coordsDescendingInv={};for(const Se in P.sourceCaches){this._coordsDescendingInv[Se]={};const ke=P.sourceCaches[Se].getVisibleCoordinates();for(const Be of ke){const gt=this.terrain.sourceCache.getTerrainCoords(Be);for(const kt in gt)this._coordsDescendingInv[Se][kt]||(this._coordsDescendingInv[Se][kt]=[]),this._coordsDescendingInv[Se][kt].push(gt[kt])}}this._coordsDescendingInvStr={};for(const Se of P._order){const ke=P._layers[Se],Be=ke.source;if(Ml[ke.type]&&!this._coordsDescendingInvStr[Be]){this._coordsDescendingInvStr[Be]={};for(const gt in this._coordsDescendingInv[Be])this._coordsDescendingInvStr[Be][gt]=this._coordsDescendingInv[Be][gt].map(kt=>kt.key).sort().join()}}for(const Se of this._renderableTiles)for(const ke in this._coordsDescendingInvStr){const Be=this._coordsDescendingInvStr[ke][Se.tileID.key];Be&&Be!==Se.rttCoords[ke]&&(Se.rtt=[])}}renderLayer(P){if(P.isHidden(this.painter.transform.zoom))return!1;const oe=P.type,Se=this.painter,ke=this._renderableLayerIds[this._renderableLayerIds.length-1]===P.id;if(Ml[oe]&&(this._prevType&&Ml[this._prevType]||this._stacks.push([]),this._prevType=oe,this._stacks[this._stacks.length-1].push(P.id),!ke))return!0;if(Ml[this._prevType]||Ml[oe]&&ke){this._prevType=oe;const Be=this._stacks.length-1,gt=this._stacks[Be]||[];for(const kt of this._renderableTiles){if(this.pool.isFull()&&(yu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(kt),kt.rtt[Be]){const cr=this.pool.getObjectForId(kt.rtt[Be].id);if(cr.stamp===kt.rtt[Be].stamp){this.pool.useObject(cr);continue}}const Gt=this.pool.getOrCreateFreeObject();this.pool.useObject(Gt),this.pool.stampObject(Gt),kt.rtt[Be]={id:Gt.id,stamp:Gt.stamp},Se.context.bindFramebuffer.set(Gt.fbo.framebuffer),Se.context.clear({color:t.aM.transparent,stencil:0}),Se.currentStencilSource=void 0;for(let cr=0;cr{Ue.touchstart=Ue.dragStart,Ue.touchmoveWindow=Ue.dragMove,Ue.touchend=Ue.dragEnd},bo={showCompass:!0,showZoom:!0,visualizePitch:!1};class xs{constructor(P,oe,Se=!1){this.mousedown=gt=>{this.startMouse(t.e({},gt,{ctrlKey:!0,preventDefault:()=>gt.preventDefault()}),a.mousePos(this.element,gt)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=gt=>{this.moveMouse(gt,a.mousePos(this.element,gt))},this.mouseup=gt=>{this.mouseRotate.dragEnd(gt),this.mousePitch&&this.mousePitch.dragEnd(gt),this.offTemp()},this.touchstart=gt=>{gt.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,gt.targetTouches)[0],this.startTouch(gt,this._startPos),a.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.addEventListener(window,"touchend",this.touchend))},this.touchmove=gt=>{gt.targetTouches.length!==1?this.reset():(this._lastPos=a.touchPos(this.element,gt.targetTouches)[0],this.moveTouch(gt,this._lastPos))},this.touchend=gt=>{gt.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const ke=P.dragRotate._mouseRotate.getClickTolerance(),Be=P.dragRotate._mousePitch.getClickTolerance();this.element=oe,this.mouseRotate=lc({clickTolerance:ke,enable:!0}),this.touchRotate=(({enable:gt,clickTolerance:kt,bearingDegreesPerPixelMoved:Gt=.8})=>{const cr=new ch;return new Hc({clickTolerance:kt,move:(Ar,Cr)=>({bearingDelta:(Cr.x-Ar.x)*Gt}),moveStateManager:cr,enable:gt,assignEvents:ql})})({clickTolerance:ke,enable:!0}),this.map=P,Se&&(this.mousePitch=Xh({clickTolerance:Be,enable:!0}),this.touchPitch=(({enable:gt,clickTolerance:kt,pitchDegreesPerPixelMoved:Gt=-.5})=>{const cr=new ch;return new Hc({clickTolerance:kt,move:(Ar,Cr)=>({pitchDelta:(Cr.y-Ar.y)*Gt}),moveStateManager:cr,enable:gt,assignEvents:ql})})({clickTolerance:Be,enable:!0})),a.addEventListener(oe,"mousedown",this.mousedown),a.addEventListener(oe,"touchstart",this.touchstart,{passive:!1}),a.addEventListener(oe,"touchcancel",this.reset)}startMouse(P,oe){this.mouseRotate.dragStart(P,oe),this.mousePitch&&this.mousePitch.dragStart(P,oe),a.disableDrag()}startTouch(P,oe){this.touchRotate.dragStart(P,oe),this.touchPitch&&this.touchPitch.dragStart(P,oe),a.disableDrag()}moveMouse(P,oe){const Se=this.map,{bearingDelta:ke}=this.mouseRotate.dragMove(P,oe)||{};if(ke&&Se.setBearing(Se.getBearing()+ke),this.mousePitch){const{pitchDelta:Be}=this.mousePitch.dragMove(P,oe)||{};Be&&Se.setPitch(Se.getPitch()+Be)}}moveTouch(P,oe){const Se=this.map,{bearingDelta:ke}=this.touchRotate.dragMove(P,oe)||{};if(ke&&Se.setBearing(Se.getBearing()+ke),this.touchPitch){const{pitchDelta:Be}=this.touchPitch.dragMove(P,oe)||{};Be&&Se.setPitch(Se.getPitch()+Be)}}off(){const P=this.element;a.removeEventListener(P,"mousedown",this.mousedown),a.removeEventListener(P,"touchstart",this.touchstart,{passive:!1}),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend),a.removeEventListener(P,"touchcancel",this.reset),this.offTemp()}offTemp(){a.enableDrag(),a.removeEventListener(window,"mousemove",this.mousemove),a.removeEventListener(window,"mouseup",this.mouseup),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend)}}let zl;function pl(Ue,P,oe){const Se=new t.N(Ue.lng,Ue.lat);if(Ue=new t.N(Ue.lng,Ue.lat),P){const ke=new t.N(Ue.lng-360,Ue.lat),Be=new t.N(Ue.lng+360,Ue.lat),gt=oe.locationPoint(Ue).distSqr(P);oe.locationPoint(ke).distSqr(P)180;){const ke=oe.locationPoint(Ue);if(ke.x>=0&&ke.y>=0&&ke.x<=oe.width&&ke.y<=oe.height)break;Ue.lng>oe.center.lng?Ue.lng-=360:Ue.lng+=360}return Ue.lng!==Se.lng&&oe.locationPoint(Ue).y>oe.height/2-oe.getHorizon()?Ue:Se}const dc={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function pc(Ue,P,oe){const Se=Ue.classList;for(const ke in dc)Se.remove(`maplibregl-${oe}-anchor-${ke}`);Se.add(`maplibregl-${oe}-anchor-${P}`)}class xc extends t.E{constructor(P){if(super(),this._onKeyPress=oe=>{const Se=oe.code,ke=oe.charCode||oe.keyCode;Se!=="Space"&&Se!=="Enter"&&ke!==32&&ke!==13||this.togglePopup()},this._onMapClick=oe=>{const Se=oe.originalEvent.target,ke=this._element;this._popup&&(Se===ke||ke.contains(Se))&&this.togglePopup()},this._update=oe=>{var Se;if(!this._map)return;const ke=this._map.loaded()&&!this._map.isMoving();(oe?.type==="terrain"||oe?.type==="render"&&!ke)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?pl(this._lngLat,this._flatPos,this._map.transform):(Se=this._lngLat)===null||Se===void 0?void 0:Se.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Be="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Be=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Be=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let gt="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?gt="rotateX(0deg)":this._pitchAlignment==="map"&&(gt=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||oe&&oe.type!=="moveend"||(this._pos=this._pos.round()),a.setTransform(this._element,`${dc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${gt} ${Be}`),i.frameAsync(new AbortController).then(()=>{this._updateOpacity(oe&&oe.type==="moveend")}).catch(()=>{})},this._onMove=oe=>{if(!this._isDragging){const Se=this._clickTolerance||this._map._clickTolerance;this._isDragging=oe.point.dist(this._pointerdownPos)>=Se}this._isDragging&&(this._pos=oe.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=oe=>{this._element.contains(oe.originalEvent.target)&&(oe.preventDefault(),this._positionDelta=oe.point.sub(this._pos).add(this._offset),this._pointerdownPos=oe.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=P&&P.anchor||"center",this._color=P&&P.color||"#3FB1CE",this._scale=P&&P.scale||1,this._draggable=P&&P.draggable||!1,this._clickTolerance=P&&P.clickTolerance||0,this._subpixelPositioning=P&&P.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=P&&P.rotation||0,this._rotationAlignment=P&&P.rotationAlignment||"auto",this._pitchAlignment=P&&P.pitchAlignment&&P.pitchAlignment!=="auto"?P.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(P?.opacity,P?.opacityWhenCovered),P&&P.element)this._element=P.element,this._offset=t.P.convert(P&&P.offset||[0,0]);else{this._defaultMarker=!0,this._element=a.create("div");const oe=a.createNS("http://www.w3.org/2000/svg","svg"),Se=41,ke=27;oe.setAttributeNS(null,"display","block"),oe.setAttributeNS(null,"height",`${Se}px`),oe.setAttributeNS(null,"width",`${ke}px`),oe.setAttributeNS(null,"viewBox",`0 0 ${ke} ${Se}`);const Be=a.createNS("http://www.w3.org/2000/svg","g");Be.setAttributeNS(null,"stroke","none"),Be.setAttributeNS(null,"stroke-width","1"),Be.setAttributeNS(null,"fill","none"),Be.setAttributeNS(null,"fill-rule","evenodd");const gt=a.createNS("http://www.w3.org/2000/svg","g");gt.setAttributeNS(null,"fill-rule","nonzero");const kt=a.createNS("http://www.w3.org/2000/svg","g");kt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),kt.setAttributeNS(null,"fill","#000000");const Gt=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const _t of Gt){const zt=a.createNS("http://www.w3.org/2000/svg","ellipse");zt.setAttributeNS(null,"opacity","0.04"),zt.setAttributeNS(null,"cx","10.5"),zt.setAttributeNS(null,"cy","5.80029008"),zt.setAttributeNS(null,"rx",_t.rx),zt.setAttributeNS(null,"ry",_t.ry),kt.appendChild(zt)}const cr=a.createNS("http://www.w3.org/2000/svg","g");cr.setAttributeNS(null,"fill",this._color);const Ar=a.createNS("http://www.w3.org/2000/svg","path");Ar.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),cr.appendChild(Ar);const Cr=a.createNS("http://www.w3.org/2000/svg","g");Cr.setAttributeNS(null,"opacity","0.25"),Cr.setAttributeNS(null,"fill","#000000");const Qr=a.createNS("http://www.w3.org/2000/svg","path");Qr.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),Cr.appendChild(Qr);const _n=a.createNS("http://www.w3.org/2000/svg","g");_n.setAttributeNS(null,"transform","translate(6.0, 7.0)"),_n.setAttributeNS(null,"fill","#FFFFFF");const Ze=a.createNS("http://www.w3.org/2000/svg","g");Ze.setAttributeNS(null,"transform","translate(8.0, 8.0)");const et=a.createNS("http://www.w3.org/2000/svg","circle");et.setAttributeNS(null,"fill","#000000"),et.setAttributeNS(null,"opacity","0.25"),et.setAttributeNS(null,"cx","5.5"),et.setAttributeNS(null,"cy","5.5"),et.setAttributeNS(null,"r","5.4999962");const ht=a.createNS("http://www.w3.org/2000/svg","circle");ht.setAttributeNS(null,"fill","#FFFFFF"),ht.setAttributeNS(null,"cx","5.5"),ht.setAttributeNS(null,"cy","5.5"),ht.setAttributeNS(null,"r","5.4999962"),Ze.appendChild(et),Ze.appendChild(ht),gt.appendChild(kt),gt.appendChild(cr),gt.appendChild(Cr),gt.appendChild(_n),gt.appendChild(Ze),oe.appendChild(gt),oe.setAttributeNS(null,"height",Se*this._scale+"px"),oe.setAttributeNS(null,"width",ke*this._scale+"px"),this._element.appendChild(oe),this._offset=t.P.convert(P&&P.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",oe=>{oe.preventDefault()}),this._element.addEventListener("mousedown",oe=>{oe.preventDefault()}),pc(this._element,this._anchor,"marker"),P&&P.className)for(const oe of P.className.split(" "))this._element.classList.add(oe);this._popup=null}addTo(P){return this.remove(),this._map=P,this._element.setAttribute("aria-label",P._getUIString("Marker.Title")),P.getCanvasContainer().appendChild(this._element),P.on("move",this._update),P.on("moveend",this._update),P.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),a.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(P){return this._lngLat=t.N.convert(P),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(P){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),P){if(!("offset"in P.options)){const ke=Math.abs(13.5)/Math.SQRT2;P.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[ke,-1*(38.1-13.5+ke)],"bottom-right":[-ke,-1*(38.1-13.5+ke)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=P,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(P){return this._subpixelPositioning=P,this}getPopup(){return this._popup}togglePopup(){const P=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:P?(P.isOpen()?P.remove():(P.setLngLat(this._lngLat),P.addTo(this._map)),this):this}_updateOpacity(P=!1){var oe,Se;if(!(!((oe=this._map)===null||oe===void 0)&&oe.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(P)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const ke=this._map,Be=ke.terrain.depthAtPoint(this._pos),gt=ke.terrain.getElevationForLngLatZoom(this._lngLat,ke.transform.tileZoom);if(ke.transform.lngLatToCameraDepth(this._lngLat,gt)-Be<.006)return void(this._element.style.opacity=this._opacity);const kt=-this._offset.y/ke.transform._pixelPerMeter,Gt=Math.sin(ke.getPitch()*Math.PI/180)*kt,cr=ke.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),Ar=ke.transform.lngLatToCameraDepth(this._lngLat,gt+Gt)-cr>.006;!((Se=this._popup)===null||Se===void 0)&&Se.isOpen()&&Ar&&this._popup.remove(),this._element.style.opacity=Ar?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(P){return this._offset=t.P.convert(P),this._update(),this}addClassName(P){this._element.classList.add(P)}removeClassName(P){this._element.classList.remove(P)}toggleClassName(P){return this._element.classList.toggle(P)}setDraggable(P){return this._draggable=!!P,this._map&&(P?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(P){return this._rotation=P||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(P){return this._rotationAlignment=P||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(P){return this._pitchAlignment=P&&P!=="auto"?P:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(P,oe){return P===void 0&&oe===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),P!==void 0&&(this._opacity=P),oe!==void 0&&(this._opacityWhenCovered=oe),this._map&&this._updateOpacity(!0),this}}const Gf={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let mc=0,Mf=!1;const Mu={maxWidth:100,unit:"metric"};function Ef(Ue,P,oe){const Se=oe&&oe.maxWidth||100,ke=Ue._container.clientHeight/2,Be=Ue.unproject([0,ke]),gt=Ue.unproject([Se,ke]),kt=Be.distanceTo(gt);if(oe&&oe.unit==="imperial"){const Gt=3.2808*kt;Gt>5280?Zo(P,Se,Gt/5280,Ue._getUIString("ScaleControl.Miles")):Zo(P,Se,Gt,Ue._getUIString("ScaleControl.Feet"))}else oe&&oe.unit==="nautical"?Zo(P,Se,kt/1852,Ue._getUIString("ScaleControl.NauticalMiles")):kt>=1e3?Zo(P,Se,kt/1e3,Ue._getUIString("ScaleControl.Kilometers")):Zo(P,Se,kt,Ue._getUIString("ScaleControl.Meters"))}function Zo(Ue,P,oe,Se){const ke=(function(Be){const gt=Math.pow(10,`${Math.floor(Be)}`.length-1);let kt=Be/gt;return kt=kt>=10?10:kt>=5?5:kt>=3?3:kt>=2?2:kt>=1?1:(function(Gt){const cr=Math.pow(10,Math.ceil(-Math.log(Gt)/Math.LN10));return Math.round(Gt*cr)/cr})(kt),gt*kt})(oe);Ue.style.width=P*(ke/oe)+"px",Ue.innerHTML=`${ke} ${Se}`}const ss={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},kf=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Xc(Ue){if(Ue){if(typeof Ue=="number"){const P=Math.round(Math.abs(Ue)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,Ue),"top-left":new t.P(P,P),"top-right":new t.P(-P,P),bottom:new t.P(0,-Ue),"bottom-left":new t.P(P,-P),"bottom-right":new t.P(-P,-P),left:new t.P(Ue,0),right:new t.P(-Ue,0)}}if(Ue instanceof t.P||Array.isArray(Ue)){const P=t.P.convert(Ue);return{center:P,top:P,"top-left":P,"top-right":P,bottom:P,"bottom-left":P,"bottom-right":P,left:P,right:P}}return{center:t.P.convert(Ue.center||[0,0]),top:t.P.convert(Ue.top||[0,0]),"top-left":t.P.convert(Ue["top-left"]||[0,0]),"top-right":t.P.convert(Ue["top-right"]||[0,0]),bottom:t.P.convert(Ue.bottom||[0,0]),"bottom-left":t.P.convert(Ue["bottom-left"]||[0,0]),"bottom-right":t.P.convert(Ue["bottom-right"]||[0,0]),left:t.P.convert(Ue.left||[0,0]),right:t.P.convert(Ue.right||[0,0])}}return Xc(new t.P(0,0))}const zc=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=Vo,e.BoxZoomHandler=nf,e.CanvasSource=nt,e.CooperativeGesturesHandler=Ai,e.DoubleClickZoomHandler=Ta,e.DragPanHandler=fi,e.DragRotateHandler=Ni,e.EdgeInsets=vc,e.FullscreenControl=class extends t.E{constructor(Ue={}){super(),this._onFullscreenChange=()=>{var P;let oe=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((P=oe?.shadowRoot)===null||P===void 0)&&P.fullscreenElement;)oe=oe.shadowRoot.fullscreenElement;oe===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Ue&&Ue.container&&(Ue.container instanceof HTMLElement?this._container=Ue.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(Ue){return this._map=Ue,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){a.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const Ue=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);a.create("span","maplibregl-ctrl-icon",Ue).setAttribute("aria-hidden","true"),Ue.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const Ue=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Ue),this._fullscreenButton.title=Ue}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=ze,e.GeolocateControl=class extends t.E{constructor(Ue){super(),this._onSuccess=P=>{if(this._map){if(this._isOutOfMapMaxBounds(P))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",P)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=P,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(P),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(P),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",P)),this._finish()}},this._updateCamera=P=>{const oe=new t.N(P.coords.longitude,P.coords.latitude),Se=P.coords.accuracy,ke=this._map.getBearing(),Be=t.e({bearing:ke},this.options.fitBoundsOptions),gt=ie.fromLngLat(oe,Se);this._map.fitBounds(gt,Be,{geolocateSource:!0})},this._updateMarker=P=>{if(P){const oe=new t.N(P.coords.longitude,P.coords.latitude);this._accuracyCircleMarker.setLngLat(oe).addTo(this._map),this._userLocationDotMarker.setLngLat(oe).addTo(this._map),this._accuracy=P.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=P=>{if(this._map){if(this.options.trackUserLocation)if(P.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const oe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=oe,this._geolocateButton.setAttribute("aria-label",oe),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(P.code===3&&Mf)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",P)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",P=>P.preventDefault()),this._geolocateButton=a.create("button","maplibregl-ctrl-geolocate",this._container),a.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=P=>{if(this._map){if(P===!1){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");const oe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=oe,this._geolocateButton.setAttribute("aria-label",oe)}else{const oe=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=oe,this._geolocateButton.setAttribute("aria-label",oe)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new xc({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new xc({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",oe=>{oe.geolocateSource||this._watchState!=="ACTIVE_LOCK"||oe.originalEvent&&oe.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))})}},this.options=t.e({},Gf,Ue)}onAdd(Ue){return this._map=Ue,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return t._(this,arguments,void 0,function*(P=!1){if(zl!==void 0&&!P)return zl;if(window.navigator.permissions===void 0)return zl=!!window.navigator.geolocation,zl;try{zl=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{zl=!!window.navigator.geolocation}return zl})})().then(P=>this._finishSetupUI(P)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,mc=0,Mf=!1}_isOutOfMapMaxBounds(Ue){const P=this._map.getMaxBounds(),oe=Ue.coords;return P&&(oe.longitudeP.getEast()||oe.latitudeP.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const Ue=this._map.getBounds(),P=Ue.getSouthEast(),oe=Ue.getNorthEast(),Se=P.distanceTo(oe),ke=Math.ceil(this._accuracy/(Se/this._map._container.clientHeight)*2);this._circleElement.style.width=`${ke}px`,this._circleElement.style.height=`${ke}px`}trigger(){if(!this._setup)return t.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":mc--,Mf=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart")),this.fire(new t.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let Ue;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),mc++,mc>1?(Ue={maximumAge:6e5,timeout:0},Mf=!0):(Ue=this.options.positionOptions,Mf=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Ue)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},e.Hash=ff,e.ImageSource=it,e.KeyboardHandler=Pr,e.LngLatBounds=ie,e.LogoControl=Ki,e.Map=class extends Fo{constructor(Ue){t.bf.mark(t.bg.create);const P=Object.assign(Object.assign({},wu),Ue);if(P.minZoom!=null&&P.maxZoom!=null&&P.minZoom>P.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(P.minPitch!=null&&P.maxPitch!=null&&P.minPitch>P.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(P.minPitch!=null&&P.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(P.maxPitch!=null&&P.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new uu(P.minZoom,P.maxZoom,P.minPitch,P.maxPitch,P.renderWorldCopies),{bearingSnap:P.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ri,this._controls=[],this._mapId=t.a4(),this._contextLost=oe=>{oe.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:oe}))},this._contextRestored=oe=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:oe}))},this._onMapScroll=oe=>{if(oe.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=P.interactive,this._maxTileCacheSize=P.maxTileCacheSize,this._maxTileCacheZoomLevels=P.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=P.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=P.preserveDrawingBuffer===!0,this._antialias=P.antialias===!0,this._trackResize=P.trackResize===!0,this._bearingSnap=P.bearingSnap,this._refreshExpiredTiles=P.refreshExpiredTiles===!0,this._fadeDuration=P.fadeDuration,this._crossSourceCollisions=P.crossSourceCollisions===!0,this._collectResourceTiming=P.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},rl),P.locale),this._clickTolerance=P.clickTolerance,this._overridePixelRatio=P.pixelRatio,this._maxCanvasSize=P.maxCanvasSize,this.transformCameraUpdate=P.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=P.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new g(P.transformRequest),typeof P.container=="string"){if(this._container=document.getElementById(P.container),!this._container)throw new Error(`Container '${P.container}' not found.`)}else{if(!(P.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=P.container}if(P.maxBounds&&this.setMaxBounds(P.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let oe=!1;const Se=$f(ke=>{this._trackResize&&!this._removed&&(this.resize(ke),this.redraw())},50);this._resizeObserver=new ResizeObserver(ke=>{oe?Se(ke):oe=!0}),this._resizeObserver.observe(this._container)}this.handlers=new jo(this,P),this._hash=P.hash&&new ff(typeof P.hash=="string"&&P.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:P.center,zoom:P.zoom,bearing:P.bearing,pitch:P.pitch}),P.bounds&&(this.resize(),this.fitBounds(P.bounds,t.e({},P.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=P.localIdeographFontFamily,this._validateStyle=P.validateStyle,P.style&&this.setStyle(P.style,{localIdeographFontFamily:P.localIdeographFontFamily}),P.attributionControl&&this.addControl(new Vo(typeof P.attributionControl=="boolean"?void 0:P.attributionControl)),P.maplibreLogo&&this.addControl(new Ki,P.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",oe=>{this._update(oe.dataType==="style"),this.fire(new t.k(`${oe.dataType}data`,oe))}),this.on("dataloading",oe=>{this.fire(new t.k(`${oe.dataType}dataloading`,oe))}),this.on("dataabort",oe=>{this.fire(new t.k("sourcedataabort",oe))})}_getMapId(){return this._mapId}addControl(Ue,P){if(P===void 0&&(P=Ue.getDefaultPosition?Ue.getDefaultPosition():"top-right"),!Ue||!Ue.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const oe=Ue.onAdd(this);this._controls.push(Ue);const Se=this._controlPositions[P];return P.indexOf("bottom")!==-1?Se.insertBefore(oe,Se.firstChild):Se.appendChild(oe),this}removeControl(Ue){if(!Ue||!Ue.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const P=this._controls.indexOf(Ue);return P>-1&&this._controls.splice(P,1),Ue.onRemove(this),this}hasControl(Ue){return this._controls.indexOf(Ue)>-1}calculateCameraOptionsFromTo(Ue,P,oe,Se){return Se==null&&this.terrain&&(Se=this.terrain.getElevationForLngLatZoom(oe,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Ue,P,oe,Se)}resize(Ue){var P;const oe=this._containerDimensions(),Se=oe[0],ke=oe[1],Be=this._getClampedPixelRatio(Se,ke);if(this._resizeCanvas(Se,ke,Be),this.painter.resize(Se,ke,Be),this.painter.overLimit()){const kt=this.painter.context.gl;this._maxCanvasSize=[kt.drawingBufferWidth,kt.drawingBufferHeight];const Gt=this._getClampedPixelRatio(Se,ke);this._resizeCanvas(Se,ke,Gt),this.painter.resize(Se,ke,Gt)}this.transform.resize(Se,ke),(P=this._requestedCameraState)===null||P===void 0||P.resize(Se,ke);const gt=!this._moving;return gt&&(this.stop(),this.fire(new t.k("movestart",Ue)).fire(new t.k("move",Ue))),this.fire(new t.k("resize",Ue)),gt&&this.fire(new t.k("moveend",Ue)),this}_getClampedPixelRatio(Ue,P){const{0:oe,1:Se}=this._maxCanvasSize,ke=this.getPixelRatio(),Be=Ue*ke,gt=P*ke;return Math.min(Be>oe?oe/Be:1,gt>Se?Se/gt:1)*ke}getPixelRatio(){var Ue;return(Ue=this._overridePixelRatio)!==null&&Ue!==void 0?Ue:devicePixelRatio}setPixelRatio(Ue){this._overridePixelRatio=Ue,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Ue){return this.transform.setMaxBounds(ie.convert(Ue)),this._update()}setMinZoom(Ue){if((Ue=Ue??-2)>=-2&&Ue<=this.transform.maxZoom)return this.transform.minZoom=Ue,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Ue,this._update(),this.getZoom()>Ue&&this.setZoom(Ue),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Ue){if((Ue=Ue??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Ue>=0&&Ue<=this.transform.maxPitch)return this.transform.minPitch=Ue,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Ue>=this.transform.minPitch)return this.transform.maxPitch=Ue,this._update(),this.getPitch()>Ue&&this.setPitch(Ue),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Ue){return this.transform.renderWorldCopies=Ue,this._update()}project(Ue){return this.transform.locationPoint(t.N.convert(Ue),this.style&&this.terrain)}unproject(Ue){return this.transform.pointLocation(t.P.convert(Ue),this.terrain)}isMoving(){var Ue;return this._moving||((Ue=this.handlers)===null||Ue===void 0?void 0:Ue.isMoving())}isZooming(){var Ue;return this._zooming||((Ue=this.handlers)===null||Ue===void 0?void 0:Ue.isZooming())}isRotating(){var Ue;return this._rotating||((Ue=this.handlers)===null||Ue===void 0?void 0:Ue.isRotating())}_createDelegatedListener(Ue,P,oe){if(Ue==="mouseenter"||Ue==="mouseover"){let Se=!1;return{layers:P,listener:oe,delegates:{mousemove:Be=>{const gt=P.filter(Gt=>this.getLayer(Gt)),kt=gt.length!==0?this.queryRenderedFeatures(Be.point,{layers:gt}):[];kt.length?Se||(Se=!0,oe.call(this,new ic(Ue,this,Be.originalEvent,{features:kt}))):Se=!1},mouseout:()=>{Se=!1}}}}if(Ue==="mouseleave"||Ue==="mouseout"){let Se=!1;return{layers:P,listener:oe,delegates:{mousemove:gt=>{const kt=P.filter(Gt=>this.getLayer(Gt));(kt.length!==0?this.queryRenderedFeatures(gt.point,{layers:kt}):[]).length?Se=!0:Se&&(Se=!1,oe.call(this,new ic(Ue,this,gt.originalEvent)))},mouseout:gt=>{Se&&(Se=!1,oe.call(this,new ic(Ue,this,gt.originalEvent)))}}}}{const Se=ke=>{const Be=P.filter(kt=>this.getLayer(kt)),gt=Be.length!==0?this.queryRenderedFeatures(ke.point,{layers:Be}):[];gt.length&&(ke.features=gt,oe.call(this,ke),delete ke.features)};return{layers:P,listener:oe,delegates:{[Ue]:Se}}}}_saveDelegatedListener(Ue,P){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Ue]=this._delegatedListeners[Ue]||[],this._delegatedListeners[Ue].push(P)}_removeDelegatedListener(Ue,P,oe){if(!this._delegatedListeners||!this._delegatedListeners[Ue])return;const Se=this._delegatedListeners[Ue];for(let ke=0;keP.includes(gt))){for(const gt in Be.delegates)this.off(gt,Be.delegates[gt]);return void Se.splice(ke,1)}}}on(Ue,P,oe){if(oe===void 0)return super.on(Ue,P);const Se=this._createDelegatedListener(Ue,typeof P=="string"?[P]:P,oe);this._saveDelegatedListener(Ue,Se);for(const ke in Se.delegates)this.on(ke,Se.delegates[ke]);return this}once(Ue,P,oe){if(oe===void 0)return super.once(Ue,P);const Se=typeof P=="string"?[P]:P,ke=this._createDelegatedListener(Ue,Se,oe);for(const Be in ke.delegates){const gt=ke.delegates[Be];ke.delegates[Be]=(...kt)=>{this._removeDelegatedListener(Ue,Se,oe),gt(...kt)}}this._saveDelegatedListener(Ue,ke);for(const Be in ke.delegates)this.once(Be,ke.delegates[Be]);return this}off(Ue,P,oe){return oe===void 0?super.off(Ue,P):(this._removeDelegatedListener(Ue,typeof P=="string"?[P]:P,oe),this)}queryRenderedFeatures(Ue,P){if(!this.style)return[];let oe;const Se=Ue instanceof t.P||Array.isArray(Ue),ke=Se?Ue:[[0,0],[this.transform.width,this.transform.height]];if(P=P||(Se?{}:Ue)||{},ke instanceof t.P||typeof ke[0]=="number")oe=[t.P.convert(ke)];else{const Be=t.P.convert(ke[0]),gt=t.P.convert(ke[1]);oe=[Be,new t.P(gt.x,Be.y),gt,new t.P(Be.x,gt.y),Be]}return this.style.queryRenderedFeatures(oe,P,this.transform)}querySourceFeatures(Ue,P){return this.style.querySourceFeatures(Ue,P)}setStyle(Ue,P){return(P=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},P)).diff!==!1&&P.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Ue?(this._diffStyle(Ue,P),this):(this._localIdeographFontFamily=P.localIdeographFontFamily,this._updateStyle(Ue,P))}setTransformRequest(Ue){return this._requestManager.setTransformRequest(Ue),this}_getUIString(Ue){const P=this._locale[Ue];if(P==null)throw new Error(`Missing UI string '${Ue}'`);return P}_updateStyle(Ue,P){if(P.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Ue,P));const oe=this.style&&P.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Ue)),Ue?(this.style=new Ur(this,P||{}),this.style.setEventedParent(this,{style:this.style}),typeof Ue=="string"?this.style.loadURL(Ue,P,oe):this.style.loadJSON(Ue,P,oe),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ur(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Ue,P){if(typeof Ue=="string"){const oe=this._requestManager.transformRequest(Ue,"Style");t.h(oe,new AbortController).then(Se=>{this._updateDiff(Se.data,P)}).catch(Se=>{Se&&this.fire(new t.j(Se))})}else typeof Ue=="object"&&this._updateDiff(Ue,P)}_updateDiff(Ue,P){try{this.style.setState(Ue,P)&&this._update(!0)}catch(oe){t.w(`Unable to perform style diff: ${oe.message||oe.error||oe}. Rebuilding the style from scratch.`),this._updateStyle(Ue,P)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(Ue,P){return this._lazyInitEmptyStyle(),this.style.addSource(Ue,P),this._update(!0)}isSourceLoaded(Ue){const P=this.style&&this.style.sourceCaches[Ue];if(P!==void 0)return P.loaded();this.fire(new t.j(new Error(`There is no source with ID '${Ue}'`)))}setTerrain(Ue){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Ue){const P=this.style.sourceCaches[Ue.source];if(!P)throw new Error(`cannot load terrain, because there exists no source with ID: ${Ue.source}`);this.terrain===null&&P.reload();for(const oe in this.style._layers){const Se=this.style._layers[oe];Se.type==="hillshade"&&Se.source===Ue.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Al(this.painter,P,Ue),this.painter.renderToTexture=new Yl(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=oe=>{oe.dataType==="style"?this.terrain.sourceCache.freeRtt():oe.dataType==="source"&&oe.tile&&(oe.sourceId!==Ue.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(oe.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:Ue})),this}getTerrain(){var Ue,P;return(P=(Ue=this.terrain)===null||Ue===void 0?void 0:Ue.options)!==null&&P!==void 0?P:null}areTilesLoaded(){const Ue=this.style&&this.style.sourceCaches;for(const P in Ue){const oe=Ue[P]._tiles;for(const Se in oe){const ke=oe[Se];if(ke.state!=="loaded"&&ke.state!=="errored")return!1}}return!0}removeSource(Ue){return this.style.removeSource(Ue),this._update(!0)}getSource(Ue){return this.style.getSource(Ue)}addImage(Ue,P,oe={}){const{pixelRatio:Se=1,sdf:ke=!1,stretchX:Be,stretchY:gt,content:kt,textFitWidth:Gt,textFitHeight:cr}=oe;if(this._lazyInitEmptyStyle(),!(P instanceof HTMLImageElement||t.b(P))){if(P.width===void 0||P.height===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:Ar,height:Cr,data:Qr}=P,_n=P;return this.style.addImage(Ue,{data:new t.R({width:Ar,height:Cr},new Uint8Array(Qr)),pixelRatio:Se,stretchX:Be,stretchY:gt,content:kt,textFitWidth:Gt,textFitHeight:cr,sdf:ke,version:0,userImage:_n}),_n.onAdd&&_n.onAdd(this,Ue),this}}{const{width:Ar,height:Cr,data:Qr}=i.getImageData(P);this.style.addImage(Ue,{data:new t.R({width:Ar,height:Cr},Qr),pixelRatio:Se,stretchX:Be,stretchY:gt,content:kt,textFitWidth:Gt,textFitHeight:cr,sdf:ke,version:0})}}updateImage(Ue,P){const oe=this.style.getImage(Ue);if(!oe)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const Se=P instanceof HTMLImageElement||t.b(P)?i.getImageData(P):P,{width:ke,height:Be,data:gt}=Se;if(ke===void 0||Be===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(ke!==oe.data.width||Be!==oe.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const kt=!(P instanceof HTMLImageElement||t.b(P));return oe.data.replace(gt,kt),this.style.updateImage(Ue,oe),this}getImage(Ue){return this.style.getImage(Ue)}hasImage(Ue){return Ue?!!this.style.getImage(Ue):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(Ue){this.style.removeImage(Ue)}loadImage(Ue){return l.getImage(this._requestManager.transformRequest(Ue,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Ue,P){return this._lazyInitEmptyStyle(),this.style.addLayer(Ue,P),this._update(!0)}moveLayer(Ue,P){return this.style.moveLayer(Ue,P),this._update(!0)}removeLayer(Ue){return this.style.removeLayer(Ue),this._update(!0)}getLayer(Ue){return this.style.getLayer(Ue)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Ue,P,oe){return this.style.setLayerZoomRange(Ue,P,oe),this._update(!0)}setFilter(Ue,P,oe={}){return this.style.setFilter(Ue,P,oe),this._update(!0)}getFilter(Ue){return this.style.getFilter(Ue)}setPaintProperty(Ue,P,oe,Se={}){return this.style.setPaintProperty(Ue,P,oe,Se),this._update(!0)}getPaintProperty(Ue,P){return this.style.getPaintProperty(Ue,P)}setLayoutProperty(Ue,P,oe,Se={}){return this.style.setLayoutProperty(Ue,P,oe,Se),this._update(!0)}getLayoutProperty(Ue,P){return this.style.getLayoutProperty(Ue,P)}setGlyphs(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Ue,P),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Ue,P,oe={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Ue,P,oe,Se=>{Se||this._update(!0)}),this}removeSprite(Ue){return this._lazyInitEmptyStyle(),this.style.removeSprite(Ue),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Ue,P,oe=>{oe||this._update(!0)}),this}setLight(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setLight(Ue,P),this._update(!0)}getLight(){return this.style.getLight()}setSky(Ue){return this._lazyInitEmptyStyle(),this.style.setSky(Ue),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Ue,P){return this.style.setFeatureState(Ue,P),this._update()}removeFeatureState(Ue,P){return this.style.removeFeatureState(Ue,P),this._update()}getFeatureState(Ue){return this.style.getFeatureState(Ue)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Ue=0,P=0;return this._container&&(Ue=this._container.clientWidth||400,P=this._container.clientHeight||300),[Ue,P]}_setupContainer(){const Ue=this._container;Ue.classList.add("maplibregl-map");const P=this._canvasContainer=a.create("div","maplibregl-canvas-container",Ue);this._interactive&&P.classList.add("maplibregl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas",P),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const oe=this._containerDimensions(),Se=this._getClampedPixelRatio(oe[0],oe[1]);this._resizeCanvas(oe[0],oe[1],Se);const ke=this._controlContainer=a.create("div","maplibregl-control-container",Ue),Be=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(gt=>{Be[gt]=a.create("div",`maplibregl-ctrl-${gt} `,ke)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Ue,P,oe){this._canvas.width=Math.floor(oe*Ue),this._canvas.height=Math.floor(oe*P),this._canvas.style.width=`${Ue}px`,this._canvas.style.height=`${P}px`}_setupPainter(){const Ue={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let P=null;this._canvas.addEventListener("webglcontextcreationerror",Se=>{P={requestedAttributes:Ue},Se&&(P.statusMessage=Se.statusMessage,P.type=Se.type)},{once:!0});const oe=this._canvas.getContext("webgl2",Ue)||this._canvas.getContext("webgl",Ue);if(!oe){const Se="Failed to initialize WebGL";throw P?(P.message=Se,new Error(JSON.stringify(P))):new Error(Se)}this.painter=new Of(oe,this.transform),s.testSupport(oe)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Ue){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Ue,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Ue){return this._update(),this._renderTaskQueue.add(Ue)}_cancelRenderFrame(Ue){this._renderTaskQueue.remove(Ue)}_render(Ue){const P=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Ue),this._removed)return;let oe=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const ke=this.transform.zoom,Be=i.now();this.style.zoomHistory.update(ke,Be);const gt=new t.z(ke,{now:Be,fadeDuration:P,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),kt=gt.crossFadingFactor();kt===1&&kt===this._crossFadingFactor||(oe=!0,this._crossFadingFactor=kt),this.style.update(gt)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,P,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:P,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||oe)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const Se=this._sourcesDirty||this._styleDirty||this._placementDirty;return Se||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||Se||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var Ue;this._hash&&this._hash.remove();for(const oe of this._controls)oe.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),l.removeThrottleControl(this._imageQueueHandle),(Ue=this._resizeObserver)===null||Ue===void 0||Ue.disconnect();const P=this.painter.context.gl.getExtension("WEBGL_lose_context");P?.loseContext&&P.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),a.remove(this._canvasContainer),a.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(Ue=>{t.bf.frame(Ue),this._frameRequest=null,this._render(Ue)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Ue){this._showTileBoundaries!==Ue&&(this._showTileBoundaries=Ue,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Ue){this._showPadding!==Ue&&(this._showPadding=Ue,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Ue){this._showCollisionBoxes!==Ue&&(this._showCollisionBoxes=Ue,Ue?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Ue){this._showOverdrawInspector!==Ue&&(this._showOverdrawInspector=Ue,this._update())}get repaint(){return!!this._repaint}set repaint(Ue){this._repaint!==Ue&&(this._repaint=Ue,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Ue){this._vertices=Ue,this._update()}get version(){return Su}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=ic,e.MapTouchEvent=Qf,e.MapWheelEvent=Gh,e.Marker=xc,e.NavigationControl=class{constructor(Ue){this._updateZoomButtons=()=>{const P=this._map.getZoom(),oe=P===this._map.getMaxZoom(),Se=P===this._map.getMinZoom();this._zoomInButton.disabled=oe,this._zoomOutButton.disabled=Se,this._zoomInButton.setAttribute("aria-disabled",oe.toString()),this._zoomOutButton.setAttribute("aria-disabled",Se.toString())},this._rotateCompassArrow=()=>{const P=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=P},this._setButtonTitle=(P,oe)=>{const Se=this._map._getUIString(`NavigationControl.${oe}`);P.title=Se,P.setAttribute("aria-label",Se)},this.options=t.e({},bo,Ue),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",P=>P.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",P=>this._map.zoomIn({},{originalEvent:P})),a.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",P=>this._map.zoomOut({},{originalEvent:P})),a.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",P=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:P}):this._map.resetNorth({},{originalEvent:P})}),this._compassIcon=a.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Ue){return this._map=Ue,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new xs(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){a.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(Ue,P){const oe=a.create("button",Ue,this._container);return oe.type="button",oe.addEventListener("click",P),oe}},e.Popup=class extends t.E{constructor(Ue){super(),this.remove=()=>(this._content&&a.remove(this._content),this._container&&(a.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=P=>{this._update(P.point)},this._onMouseMove=P=>{this._update(P.point)},this._onDrag=P=>{this._update(P.point)},this._update=P=>{var oe;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=a.create("div","maplibregl-popup",this._map.getContainer()),this._tip=a.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const kt of this.options.className.split(" "))this._container.classList.add(kt);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?pl(this._lngLat,this._flatPos,this._map.transform):(oe=this._lngLat)===null||oe===void 0?void 0:oe.wrap(),this._trackPointer&&!P)return;const Se=this._flatPos=this._pos=this._trackPointer&&P?P:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&P?P:this._map.transform.locationPoint(this._lngLat));let ke=this.options.anchor;const Be=Xc(this.options.offset);if(!ke){const kt=this._container.offsetWidth,Gt=this._container.offsetHeight;let cr;cr=Se.y+Be.bottom.ythis._map.transform.height-Gt?["bottom"]:[],Se.xthis._map.transform.width-kt/2&&cr.push("right"),ke=cr.length===0?"bottom":cr.join("-")}let gt=Se.add(Be[ke]);this.options.subpixelPositioning||(gt=gt.round()),a.setTransform(this._container,`${dc[ke]} translate(${gt.x}px,${gt.y}px)`),pc(this._container,ke,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(ss),Ue)}addTo(Ue){return this._map&&this.remove(),this._map=Ue,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Ue){return this._lngLat=t.N.convert(Ue),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(Ue){return this.setDOMContent(document.createTextNode(Ue))}setHTML(Ue){const P=document.createDocumentFragment(),oe=document.createElement("body");let Se;for(oe.innerHTML=Ue;Se=oe.firstChild,Se;)P.appendChild(Se);return this.setDOMContent(P)}getMaxWidth(){var Ue;return(Ue=this._container)===null||Ue===void 0?void 0:Ue.style.maxWidth}setMaxWidth(Ue){return this.options.maxWidth=Ue,this._update(),this}setDOMContent(Ue){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Ue),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Ue){return this._container&&this._container.classList.add(Ue),this}removeClassName(Ue){return this._container&&this._container.classList.remove(Ue),this}setOffset(Ue){return this.options.offset=Ue,this._update(),this}toggleClassName(Ue){if(this._container)return this._container.classList.toggle(Ue)}setSubpixelPositioning(Ue){this.options.subpixelPositioning=Ue}_createCloseButton(){this.options.closeButton&&(this._closeButton=a.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const Ue=this._container.querySelector(kf);Ue&&Ue.focus()}},e.RasterDEMTileSource=Fe,e.RasterTileSource=Ce,e.ScaleControl=class{constructor(Ue){this._onMove=()=>{Ef(this._map,this._container,this.options)},this.setUnit=P=>{this.options.unit=P,Ef(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Mu),Ue)}getDefaultPosition(){return"bottom-left"}onAdd(Ue){return this._map=Ue,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Ue.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=On,e.Style=Ur,e.TerrainControl=class{constructor(Ue){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=Ue}onAdd(Ue){return this._map=Ue,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=a.create("button","maplibregl-ctrl-terrain",this._container),a.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){a.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=Fh,e.TwoFingersTouchRotateHandler=Nf,e.TwoFingersTouchZoomHandler=_c,e.TwoFingersTouchZoomRotateHandler=Va,e.VectorTileSource=Ae,e.VideoSource=st,e.addSourceType=(Ue,P)=>t._(void 0,void 0,void 0,function*(){if(Le(Ue))throw new Error(`A source type called "${Ue}" already exists.`);((oe,Se)=>{Qe[oe]=Se})(Ue,P)}),e.clearPrewarmedResources=function(){const Ue=ce;Ue&&(Ue.isPreloaded()&&Ue.numActive()===1?(Ue.release(re),ce=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return ot().getRTLTextPluginStatus()},e.getVersion=function(){return zc},e.getWorkerCount=function(){return fe.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(Ue){return K().broadcast("IS",Ue)},e.prewarm=function(){ee().acquire(re)},e.setMaxParallelImageRequests=function(Ue){t.a.MAX_PARALLEL_IMAGE_REQUESTS=Ue},e.setRTLTextPlugin=function(Ue,P){return ot().setRTLTextPlugin(Ue,P)},e.setWorkerCount=function(Ue){fe.workerCount=Ue},e.setWorkerUrl=function(Ue){t.a.WORKER_URL=Ue}});var E=h;return E})}}),iz=Ge({"src/plots/map/layers.js"($,G){var h=yn(),b=ec().sanitizeHTML,S=ZC(),E=F_();function e(i,a){this.subplot=i,this.uid=i.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(a){this.visible?this.needsNewImage(a)?this.updateImage(a):this.needsNewSource(a)?(this.removeLayer(),this.updateSource(a),this.updateLayer(a)):this.needsNewLayer(a)?this.updateLayer(a):this.updateStyle(a):(this.updateSource(a),this.updateLayer(a)),this.visible=r(a)},t.needsNewImage=function(i){var a=this.subplot.map;return a.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var a=this.subplot.map;a.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var a=this.subplot.map;if(a.getSource(this.idSource)&&a.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=n(i);a.addSource(this.idSource,s)}},t.findFollowingMapLayerId=function(i){if(i==="traces")for(var a=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var a={},s={};switch(i.type){case"circle":h.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":h.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":h.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var f=i.symbol,c=S(f.textposition,f.iconsize);h.extendFlat(a,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":f.placement}),h.extendFlat(s,{"icon-color":i.color,"text-color":f.textfont.color,"text-opacity":i.opacity});break;case"raster":h.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:a,paint:s}}function n(i){var a=i.sourcetype,s=i.source,f={type:a},c;return a==="geojson"?c="data":a==="vector"?c=typeof s=="string"?"url":"tiles":a==="raster"?(c="tiles",f.tileSize=256):a==="image"&&(c="url",f.coordinates=i.coordinates),f[c]=s,i.sourceattribution&&(f.attribution=b(i.sourceattribution)),f}G.exports=function(a,s,f){var c=new e(a,s);return c.update(f),c}}}),oz=Ge({"src/plots/map/map.js"($,G){var h=az(),b=yn(),S=I_(),E=Io(),e=Ss(),t=nd(),r=qf(),o=Dp(),n=o.drawMode,i=o.selectMode,a=Zf().prepSelect,s=Zf().clearOutline,f=Zf().clearSelectionsCache,c=Zf().selectOnClick,p=F_(),d=iz();function T(_,w){this.id=w,this.gd=_;var m=_._fullLayout,u=_._context;this.container=m._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=m._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(m),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(_,w,m){var u=this,v;u.map?v=new Promise(function(y,I){u.updateMap(_,w,y,I)}):v=new Promise(function(y,I){u.createMap(_,w,y,I)}),m.push(v)},l.createMap=function(_,w,m,u){var v=this,y=w[v.id],I=v.styleObj=x(y.style),L=y.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=v.map=new h.Map({container:v.div,style:I.style,center:M(y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch,maxBounds:z,interactive:!v.isStatic,preserveDrawingBuffer:v.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new h.AttributionControl({compact:!0})),N={};F.on("styleimagemissing",function(R){var U=R.id;if(!N[U]&&U.includes("-15")){N[U]=!0;var j=new Image(15,15);j.onload=function(){F.addImage(U,j)},j.crossOrigin="Anonymous",j.src="https://unpkg.com/maki@2.1.0/icons/"+U+".svg"}}),F.setTransformRequest(function(R){return R=R.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),R=R.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),R=R.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:R}}),F._canvas.style.left="0px",F._canvas.style.top="0px",v.rejectOnError(u),v.isStatic||v.initFx(_,w);var B=[];B.push(new Promise(function(R){F.once("load",R)})),B=B.concat(S.fetchTraceGeoData(_)),Promise.all(B).then(function(){v.fillBelowLookup(_,w),v.updateData(_),v.updateLayout(w),v.resolveOnRender(m)}).catch(u)},l.updateMap=function(_,w,m,u){var v=this,y=v.map,I=w[this.id];v.rejectOnError(u);var L=[],z=x(I.style);JSON.stringify(v.styleObj)!==JSON.stringify(z)&&(v.styleObj=z,y.setStyle(z.style),v.traceHash={},L.push(new Promise(function(F){y.once("styledata",F)}))),L=L.concat(S.fetchTraceGeoData(_)),Promise.all(L).then(function(){v.fillBelowLookup(_,w),v.updateData(_),v.updateLayout(w),v.resolveOnRender(m)}).catch(u)},l.fillBelowLookup=function(_,w){var m=w[this.id],u=m.layers,v,y,I=this.belowLookup={},L=!1;for(v=0;v<_.length;v++){var z=_[v][0].trace,F=z._module;typeof z.below=="string"?y=z.below:F.getBelow&&(y=F.getBelow(z,this)),y===""&&(L=!0),I["trace-"+z.uid]=y||""}for(v=0;v1)for(v=0;v-1&&c(z.originalEvent,u,[m.xaxis],[m.yaxis],m.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,m=w.map,u=w.gd;if(w.isStatic)return;function v(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var y=_.dragmode,I;I=function(z,F){if(F.isRect){var N=z.range={};N[w.id]=[v([F.xmin,F.ymin]),v([F.xmax,F.ymax])]}else{var B=z.lassoPoints={};B[w.id]=F.map(v)}};var L=w.dragOptions;w.dragOptions=b.extendDeep(L||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:I},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),m.off("click",w.onClickInPanHandler),i(y)||n(y)?(m.dragPan.disable(),m.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,N){a(z,F,N,w.dragOptions,y)},t.init(w.dragOptions)):(m.dragPan.enable(),m.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),m.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,m=_._size,u=this.div.style;u.width=m.w*(w.x[1]-w.x[0])+"px",u.height=m.h*(w.y[1]-w.y[0])+"px",u.left=m.l+w.x[0]*m.w+"px",u.top=m.t+(1-w.y[1])*m.h+"px",this.xaxis._offset=m.l+w.x[0]*m.w,this.xaxis._length=m.w*(w.x[1]-w.x[0]),this.yaxis._offset=m.t+(1-w.y[1])*m.h,this.yaxis._length=m.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],m=w.layers,u=this.layerList,v;if(m.length!==u.length){for(v=0;vm/2){var u=A.split("|").join("
");_.text(u).attr("data-unformatted",u).call(r.convertToTspans,i),w=t.bBox(_.node())}_.attr("transform",h(-3,-w.height+8)),M.insert("rect",".static-attribution").attr({x:-w.width-6,y:-w.height-3,width:w.width+6,height:w.height+3,fill:"rgba(255, 255, 255, 0.75)"});var v=1;w.width+6>m&&(v=m/(w.width+6));var y=[f.l+f.w*d.x[1],f.t+f.h*(1-d.y[0])];M.attr("transform",h(y[0],y[1])+b(v))}},$.updateFx=function(i){for(var a=i._fullLayout,s=a._subplots[n],f=0;f=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var n=o[0].trace,i=new E(r,n.uid),a=i.sourceId,s=h(o),f=i.below=r.belowLookup["trace-"+n.uid];return r.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,f),o[0].trace._glTrace=i,i}}}),hz=Ge({"src/traces/choroplethmap/index.js"($,G){G.exports={attributes:WC(),supplyDefaults:cz(),colorbar:xm(),calc:dE(),plot:fz(),hoverPoints:mE(),eventData:gE(),selectPoints:yE(),styleOnSelect:function(h,b){if(b){var S=b[0].trace;S._glTrace.updateOnSelect(b)}},getBelow:function(h,b){for(var S=b.getMapLayers(),E=S.length-2;E>=0;E--){var e=S[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+d[c]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:A})}}var _=E.extractOpts(n),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,m=w[0][1],u=S.opacity(m)<1?m:S.addOpacity(m,0),v=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,n=new S(t,o.uid),i=n.sourceId,a=h(r),s=n.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:a.geojson}),n._addLayers(a,s),n}}}),yz=Ge({"src/traces/densitymap/hover.js"($,G){var h=Ss(),b=DE().hoverPoints,S=DE().getExtraText;G.exports=function(e,t,r){var o=b(e,t,r);if(o){var n=o[0],i=n.cd,a=i[0].trace,s=i[n.index];if(delete n.color,"z"in s){var f=n.subplot.mockAxis;n.z=s.z,n.zLabel=h.tickText(f,f.c2l(s.z),"hover").text}return n.extraText=S(a,s,i[0].t.labels),[n]}}}}),_z=Ge({"src/traces/densitymap/event_data.js"($,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b.z=S.z,b}}}),xz=Ge({"src/traces/densitymap/index.js"($,G){G.exports={attributes:$C(),supplyDefaults:dz(),colorbar:xm(),formatLabels:YC(),calc:pz(),plot:gz(),hoverPoints:yz(),eventData:_z(),getBelow:function(h,b){for(var S=b.getMapLayers(),E=0;E0;){l=x[x.length-1];var A=b[l];if(r[l]=0&&n[l].push(o[_])}r[l]=M}else{if(e[l]===E[l]){for(var w=[],m=[],u=0,M=g.length-1;M>=0;--M){var v=g[M];if(t[v]=!1,w.push(v),m.push(n[v]),u+=n[v].length,o[v]=s.length,v===l){g.length=M;break}}s.push(w);for(var y=new Array(u),M=0;M_&&(_=a.source[g]),a.target[g]>_&&(_=a.target[g]);var w=_+1;n.node._count=w;var m,u=n.node.groups,v={};for(g=0;g0&&e(N,w)&&e(B,w)&&!(v.hasOwnProperty(N)&&v.hasOwnProperty(B)&&v[N]===v[B])){v.hasOwnProperty(B)&&(B=v[B]),v.hasOwnProperty(N)&&(N=v[N]),N=+N,B=+B,d[N]=d[B]=!0;var R="";a.label&&a.label[g]&&(R=a.label[g]);var U=null;R&&T.hasOwnProperty(R)&&(U=T[R]),s.push({pointNumber:g,label:R,color:f?a.color[g]:a.color,hovercolor:c?a.hovercolor[g]:a.hovercolor,customdata:p?a.customdata[g]:a.customdata,concentrationscale:U,source:N,target:B,value:+F}),z.source.push(N),z.target.push(B)}}var j=w+u.length,Z=E(i.color),re=E(i.customdata),fe=[];for(g=0;gw-1,childrenNodes:[],pointNumber:g,label:le,color:Z?i.color[g]:i.color,customdata:re?i.customdata[g]:i.customdata})}var ce=!1;return o(j,z.source,z.target)&&(ce=!0),{circular:ce,links:s,nodes:fe,groups:u,groupLookup:v}}function o(n,i,a){for(var s=b.init2dArray(n,0),f=0;f1})}G.exports=function(i,a){var s=r(a);return S({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}}),Az=Ge({"node_modules/d3-quadtree/dist/d3-quadtree.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($):(h=h||self,b(h.d3=h.d3||{}))})($,function(h){function b(w){var m=+this._x.call(null,w),u=+this._y.call(null,w);return S(this.cover(m,u),m,u,w)}function S(w,m,u,v){if(isNaN(m)||isNaN(u))return w;var y,I=w._root,L={data:v},z=w._x0,F=w._y0,N=w._x1,B=w._y1,R,U,j,Z,re,fe,le,ce;if(!I)return w._root=L,w;for(;I.length;)if((re=m>=(R=(z+N)/2))?z=R:N=R,(fe=u>=(U=(F+B)/2))?F=U:B=U,y=I,!(I=I[le=fe<<1|re]))return y[le]=L,w;if(j=+w._x.call(null,I.data),Z=+w._y.call(null,I.data),m===j&&u===Z)return L.next=I,y?y[le]=L:w._root=L,w;do y=y?y[le]=new Array(4):w._root=new Array(4),(re=m>=(R=(z+N)/2))?z=R:N=R,(fe=u>=(U=(F+B)/2))?F=U:B=U;while((le=fe<<1|re)===(ce=(Z>=U)<<1|j>=R));return y[ce]=I,y[le]=L,w}function E(w){var m,u,v=w.length,y,I,L=new Array(v),z=new Array(v),F=1/0,N=1/0,B=-1/0,R=-1/0;for(u=0;uB&&(B=y),IR&&(R=I));if(F>B||N>R)return this;for(this.cover(F,N).cover(B,R),u=0;uw||w>=y||v>m||m>=I;)switch(N=(mB||(z=Z.y0)>R||(F=Z.x1)=le)<<1|w>=fe)&&(Z=U[U.length-1],U[U.length-1]=U[U.length-1-re],U[U.length-1-re]=Z)}else{var ce=w-+this._x.call(null,j.data),V=m-+this._y.call(null,j.data),ee=ce*ce+V*V;if(ee=(U=(L+F)/2))?L=U:F=U,(re=R>=(j=(z+N)/2))?z=j:N=j,m=u,!(u=u[fe=re<<1|Z]))return this;if(!u.length)break;(m[fe+1&3]||m[fe+2&3]||m[fe+3&3])&&(v=m,le=fe)}for(;u.data!==w;)if(y=u,!(u=u.next))return this;return(I=u.next)&&delete u.next,y?(I?y.next=I:delete y.next,this):m?(I?m[fe]=I:delete m[fe],(u=m[0]||m[1]||m[2]||m[3])&&u===(m[3]||m[2]||m[1]||m[0])&&!u.length&&(v?v[le]=u:this._root=u),this):(this._root=I,this)}function a(w){for(var m=0,u=w.length;m=d.length)return l!=null&&_.sort(l),g!=null?g(_):_;for(var v=-1,y=_.length,I=d[w++],L,z,F=E(),N,B=m();++vd.length)return _;var m,u=T[w-1];return g!=null&&w>=d.length?m=_.entries():(m=[],_.each(function(v,y){m.push({key:y,values:M(v,w)})})),u!=null?m.sort(function(v,y){return u(v.key,y.key)}):m}return x={object:function(_){return A(_,0,t,r)},map:function(_){return A(_,0,o,n)},entries:function(_){return M(A(_,0,o,n),0)},key:function(_){return d.push(_),x},sortKeys:function(_){return T[d.length-1]=_,x},sortValues:function(_){return l=_,x},rollup:function(_){return g=_,x}}}function t(){return{}}function r(d,T,l){d[T]=l}function o(){return E()}function n(d,T,l){d.set(T,l)}function i(){}var a=E.prototype;i.prototype=s.prototype={constructor:i,has:a.has,add:function(d){return d+="",this[b+d]=d,this},remove:a.remove,clear:a.clear,values:a.keys,size:a.size,empty:a.empty,each:a.each};function s(d,T){var l=new i;if(d instanceof i)d.each(function(A){l.add(A)});else if(d){var g=-1,x=d.length;if(T==null)for(;++g=0&&(a=i.slice(s+1),i=i.slice(0,s)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}E.prototype=S.prototype={constructor:E,on:function(o,n){var i=this._,a=e(o+"",i),s,f=-1,c=a.length;if(arguments.length<2){for(;++f0)for(var i=new Array(s),a=0,s,f;a=0&&w._call.call(null,m),w=w._next;--b}function l(){n=(o=a.now())+i,b=S=0;try{T()}finally{b=0,x(),n=0}}function g(){var w=a.now(),m=w-o;m>e&&(i-=m,o=w)}function x(){for(var w,m=t,u,v=1/0;m;)m._call?(v>m._time&&(v=m._time),w=m,m=m._next):(u=m._next,m._next=null,m=w?w._next=u:t=u);r=w,A(v)}function A(w){if(!b){S&&(S=clearTimeout(S));var m=w-n;m>24?(w<1/0&&(S=setTimeout(l,w-a.now()-i)),E&&(E=clearInterval(E))):(E||(o=a.now(),E=setInterval(g,e)),b=1,s(l))}}function M(w,m,u){var v=new p;return m=m==null?0:+m,v.restart(function(y){v.stop(),w(y+m)},m,u),v}function _(w,m,u){var v=new p,y=m;return m==null?(v.restart(w,m,u),v):(m=+m,u=u==null?f():+u,v.restart(function I(L){L+=y,v.restart(I,y+=m,u),w(L)},m,u),v)}h.interval=_,h.now=f,h.timeout=M,h.timer=d,h.timerFlush=T,Object.defineProperty(h,"__esModule",{value:!0})})}}),Ez=Ge({"node_modules/d3-force/dist/d3-force.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($,Az(),OE(),Sz(),Mz()):b(h.d3=h.d3||{},h.d3,h.d3,h.d3,h.d3)})($,function(h,b,S,E,e){function t(w,m){var u;w==null&&(w=0),m==null&&(m=0);function v(){var y,I=u.length,L,z=0,F=0;for(y=0;yR.index){var ae=U-ue.x-ue.vx,ie=j-ue.y-ue.vy,ve=ae*ae+ie*ie;veU+H||nej+H||KF.r&&(F.r=F[N].r)}function z(){if(m){var F,N=m.length,B;for(u=new Array(N),F=0;F1?(re==null?z.remove(Z):z.set(Z,j(re)),m):z.get(Z)},find:function(Z,re,fe){var le=0,ce=w.length,V,ee,ne,K,ue;for(fe==null?fe=1/0:fe*=fe,le=0;le1?(N.on(Z,re),m):N.on(Z)}}}function x(){var w,m,u,v=r(-30),y,I=1,L=1/0,z=.81;function F(U){var j,Z=w.length,re=b.quadtree(w,p,d).visitAfter(B);for(u=U,j=0;j=L)return;(U.data!==m||U.next)&&(fe===0&&(fe=o(),V+=fe*fe),le===0&&(le=o(),V+=le*le),VE)if(!(Math.abs(l*p-d*T)>E)||!s)this._+="L"+(this._x1=o)+","+(this._y1=n);else{var x=i-f,A=a-c,M=p*p+d*d,_=x*x+A*A,w=Math.sqrt(M),m=Math.sqrt(g),u=s*Math.tan((b-Math.acos((M+g-_)/(2*w*m)))/2),v=u/m,y=u/w;Math.abs(v-1)>E&&(this._+="L"+(o+v*T)+","+(n+v*l)),this._+="A"+s+","+s+",0,0,"+ +(l*x>T*A)+","+(this._x1=o+y*p)+","+(this._y1=n+y*d)}},arc:function(o,n,i,a,s,f){o=+o,n=+n,i=+i,f=!!f;var c=i*Math.cos(a),p=i*Math.sin(a),d=o+c,T=n+p,l=1^f,g=f?a-s:s-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+d+","+T:(Math.abs(this._x1-d)>E||Math.abs(this._y1-T)>E)&&(this._+="L"+d+","+T),i&&(g<0&&(g=g%S+S),g>e?this._+="A"+i+","+i+",0,1,"+l+","+(o-c)+","+(n-p)+"A"+i+","+i+",0,1,"+l+","+(this._x1=d)+","+(this._y1=T):g>E&&(this._+="A"+i+","+i+",0,"+ +(g>=b)+","+l+","+(this._x1=o+i*Math.cos(s))+","+(this._y1=n+i*Math.sin(s))))},rect:function(o,n,i,a){this._+="M"+(this._x0=this._x1=+o)+","+(this._y0=this._y1=+n)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}},h.path=r,Object.defineProperty(h,"__esModule",{value:!0})})}}),eL=Ge({"node_modules/d3-shape/dist/d3-shape.js"($,G){(function(h,b){typeof $=="object"&&typeof G<"u"?b($,kz()):(h=h||self,b(h.d3=h.d3||{},h.d3))})($,function(h,b){function S(At){return function(){return At}}var E=Math.abs,e=Math.atan2,t=Math.cos,r=Math.max,o=Math.min,n=Math.sin,i=Math.sqrt,a=1e-12,s=Math.PI,f=s/2,c=2*s;function p(At){return At>1?0:At<-1?s:Math.acos(At)}function d(At){return At>=1?f:At<=-1?-f:Math.asin(At)}function T(At){return At.innerRadius}function l(At){return At.outerRadius}function g(At){return At.startAngle}function x(At){return At.endAngle}function A(At){return At&&At.padAngle}function M(At,or,Dr,un,Rn,jn,Un,cn){var In=Dr-At,xi=un-or,Ea=Un-Rn,Pi=cn-jn,Xi=Pi*In-Ea*xi;if(!(Xi*Xill*ll+kl*kl&&(Hs=ds,sl=Ko),{cx:Hs,cy:sl,x01:-Ea,y01:-Pi,x11:Hs*(Rn/es-1),y11:sl*(Rn/es-1)}}function w(){var At=T,or=l,Dr=S(0),un=null,Rn=g,jn=x,Un=A,cn=null;function In(){var xi,Ea,Pi=+At.apply(this,arguments),Xi=+or.apply(this,arguments),uo=Rn.apply(this,arguments)-f,so=jn.apply(this,arguments)-f,Eo=E(so-uo),vi=so>uo;if(cn||(cn=xi=b.path()),Xia))cn.moveTo(0,0);else if(Eo>c-a)cn.moveTo(Xi*t(uo),Xi*n(uo)),cn.arc(0,0,Xi,uo,so,!vi),Pi>a&&(cn.moveTo(Pi*t(so),Pi*n(so)),cn.arc(0,0,Pi,so,uo,vi));else{var ns=uo,Xo=so,Ys=uo,vs=so,es=Eo,qo=Eo,Zs=Un.apply(this,arguments)/2,Hs=Zs>a&&(un?+un.apply(this,arguments):i(Pi*Pi+Xi*Xi)),sl=o(E(Xi-Pi)/2,+Dr.apply(this,arguments)),ds=sl,Ko=sl,_o,ps;if(Hs>a){var ll=d(Hs/Pi*n(Zs)),kl=d(Hs/Xi*n(Zs));(es-=ll*2)>a?(ll*=vi?1:-1,Ys+=ll,vs-=ll):(es=0,Ys=vs=(uo+so)/2),(qo-=kl*2)>a?(kl*=vi?1:-1,ns+=kl,Xo-=kl):(qo=0,ns=Xo=(uo+so)/2)}var Rl=Xi*t(ns),Cs=Xi*n(ns),pi=Pi*t(vs),no=Pi*n(vs);if(sl>a){var Cl=Xi*t(Xo),Ds=Xi*n(Xo),No=Pi*t(Ys),Il=Pi*n(Ys),Ws;if(Eoa?Ko>a?(_o=_(No,Il,Rl,Cs,Xi,Ko,vi),ps=_(Cl,Ds,pi,no,Xi,Ko,vi),cn.moveTo(_o.cx+_o.x01,_o.cy+_o.y01),Koa)||!(es>a)?cn.lineTo(pi,no):ds>a?(_o=_(pi,no,Cl,Ds,Pi,-ds,vi),ps=_(Rl,Cs,No,Il,Pi,-ds,vi),cn.lineTo(_o.cx+_o.x01,_o.cy+_o.y01),ds=Xi;--uo)cn.point(Xo[uo],Ys[uo]);cn.lineEnd(),cn.areaEnd()}vi&&(Xo[Pi]=+At(Eo,Pi,Ea),Ys[Pi]=+Dr(Eo,Pi,Ea),cn.point(or?+or(Eo,Pi,Ea):Xo[Pi],un?+un(Eo,Pi,Ea):Ys[Pi]))}if(ns)return cn=null,ns+""||null}function xi(){return I().defined(Rn).curve(Un).context(jn)}return In.x=function(Ea){return arguments.length?(At=typeof Ea=="function"?Ea:S(+Ea),or=null,In):At},In.x0=function(Ea){return arguments.length?(At=typeof Ea=="function"?Ea:S(+Ea),In):At},In.x1=function(Ea){return arguments.length?(or=Ea==null?null:typeof Ea=="function"?Ea:S(+Ea),In):or},In.y=function(Ea){return arguments.length?(Dr=typeof Ea=="function"?Ea:S(+Ea),un=null,In):Dr},In.y0=function(Ea){return arguments.length?(Dr=typeof Ea=="function"?Ea:S(+Ea),In):Dr},In.y1=function(Ea){return arguments.length?(un=Ea==null?null:typeof Ea=="function"?Ea:S(+Ea),In):un},In.lineX0=In.lineY0=function(){return xi().x(At).y(Dr)},In.lineY1=function(){return xi().x(At).y(un)},In.lineX1=function(){return xi().x(or).y(Dr)},In.defined=function(Ea){return arguments.length?(Rn=typeof Ea=="function"?Ea:S(!!Ea),In):Rn},In.curve=function(Ea){return arguments.length?(Un=Ea,jn!=null&&(cn=Un(jn)),In):Un},In.context=function(Ea){return arguments.length?(Ea==null?jn=cn=null:cn=Un(jn=Ea),In):jn},In}function z(At,or){return orAt?1:or>=At?0:NaN}function F(At){return At}function N(){var At=F,or=z,Dr=null,un=S(0),Rn=S(c),jn=S(0);function Un(cn){var In,xi=cn.length,Ea,Pi,Xi=0,uo=new Array(xi),so=new Array(xi),Eo=+un.apply(this,arguments),vi=Math.min(c,Math.max(-c,Rn.apply(this,arguments)-Eo)),ns,Xo=Math.min(Math.abs(vi)/xi,jn.apply(this,arguments)),Ys=Xo*(vi<0?-1:1),vs;for(In=0;In0&&(Xi+=vs);for(or!=null?uo.sort(function(es,qo){return or(so[es],so[qo])}):Dr!=null&&uo.sort(function(es,qo){return Dr(cn[es],cn[qo])}),In=0,Pi=Xi?(vi-xi*Ys)/Xi:0;In0?vs*Pi:0)+Ys,so[Ea]={data:cn[Ea],index:In,value:vs,startAngle:Eo,endAngle:ns,padAngle:Xo};return so}return Un.value=function(cn){return arguments.length?(At=typeof cn=="function"?cn:S(+cn),Un):At},Un.sortValues=function(cn){return arguments.length?(or=cn,Dr=null,Un):or},Un.sort=function(cn){return arguments.length?(Dr=cn,or=null,Un):Dr},Un.startAngle=function(cn){return arguments.length?(un=typeof cn=="function"?cn:S(+cn),Un):un},Un.endAngle=function(cn){return arguments.length?(Rn=typeof cn=="function"?cn:S(+cn),Un):Rn},Un.padAngle=function(cn){return arguments.length?(jn=typeof cn=="function"?cn:S(+cn),Un):jn},Un}var B=U(u);function R(At){this._curve=At}R.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(At,or){this._curve.point(or*Math.sin(At),or*-Math.cos(At))}};function U(At){function or(Dr){return new R(At(Dr))}return or._curve=At,or}function j(At){var or=At.curve;return At.angle=At.x,delete At.x,At.radius=At.y,delete At.y,At.curve=function(Dr){return arguments.length?or(U(Dr)):or()._curve},At}function Z(){return j(I().curve(B))}function re(){var At=L().curve(B),or=At.curve,Dr=At.lineX0,un=At.lineX1,Rn=At.lineY0,jn=At.lineY1;return At.angle=At.x,delete At.x,At.startAngle=At.x0,delete At.x0,At.endAngle=At.x1,delete At.x1,At.radius=At.y,delete At.y,At.innerRadius=At.y0,delete At.y0,At.outerRadius=At.y1,delete At.y1,At.lineStartAngle=function(){return j(Dr())},delete At.lineX0,At.lineEndAngle=function(){return j(un())},delete At.lineX1,At.lineInnerRadius=function(){return j(Rn())},delete At.lineY0,At.lineOuterRadius=function(){return j(jn())},delete At.lineY1,At.curve=function(Un){return arguments.length?or(U(Un)):or()._curve},At}function fe(At,or){return[(or=+or)*Math.cos(At-=Math.PI/2),or*Math.sin(At)]}var le=Array.prototype.slice;function ce(At){return At.source}function V(At){return At.target}function ee(At){var or=ce,Dr=V,un=v,Rn=y,jn=null;function Un(){var cn,In=le.call(arguments),xi=or.apply(this,In),Ea=Dr.apply(this,In);if(jn||(jn=cn=b.path()),At(jn,+un.apply(this,(In[0]=xi,In)),+Rn.apply(this,In),+un.apply(this,(In[0]=Ea,In)),+Rn.apply(this,In)),cn)return jn=null,cn+""||null}return Un.source=function(cn){return arguments.length?(or=cn,Un):or},Un.target=function(cn){return arguments.length?(Dr=cn,Un):Dr},Un.x=function(cn){return arguments.length?(un=typeof cn=="function"?cn:S(+cn),Un):un},Un.y=function(cn){return arguments.length?(Rn=typeof cn=="function"?cn:S(+cn),Un):Rn},Un.context=function(cn){return arguments.length?(jn=cn??null,Un):jn},Un}function ne(At,or,Dr,un,Rn){At.moveTo(or,Dr),At.bezierCurveTo(or=(or+un)/2,Dr,or,Rn,un,Rn)}function K(At,or,Dr,un,Rn){At.moveTo(or,Dr),At.bezierCurveTo(or,Dr=(Dr+Rn)/2,un,Dr,un,Rn)}function ue(At,or,Dr,un,Rn){var jn=fe(or,Dr),Un=fe(or,Dr=(Dr+Rn)/2),cn=fe(un,Dr),In=fe(un,Rn);At.moveTo(jn[0],jn[1]),At.bezierCurveTo(Un[0],Un[1],cn[0],cn[1],In[0],In[1])}function te(){return ee(ne)}function H(){return ee(K)}function ae(){var At=ee(ue);return At.angle=At.x,delete At.x,At.radius=At.y,delete At.y,At}var ie={draw:function(At,or){var Dr=Math.sqrt(or/s);At.moveTo(Dr,0),At.arc(0,0,Dr,0,c)}},ve={draw:function(At,or){var Dr=Math.sqrt(or/5)/2;At.moveTo(-3*Dr,-Dr),At.lineTo(-Dr,-Dr),At.lineTo(-Dr,-3*Dr),At.lineTo(Dr,-3*Dr),At.lineTo(Dr,-Dr),At.lineTo(3*Dr,-Dr),At.lineTo(3*Dr,Dr),At.lineTo(Dr,Dr),At.lineTo(Dr,3*Dr),At.lineTo(-Dr,3*Dr),At.lineTo(-Dr,Dr),At.lineTo(-3*Dr,Dr),At.closePath()}},Ae=Math.sqrt(1/3),Ce=Ae*2,Fe={draw:function(At,or){var Dr=Math.sqrt(or/Ce),un=Dr*Ae;At.moveTo(0,-Dr),At.lineTo(un,0),At.lineTo(0,Dr),At.lineTo(-un,0),At.closePath()}},ze=.8908130915292852,Ye=Math.sin(s/10)/Math.sin(7*s/10),it=Math.sin(c/10)*Ye,st=-Math.cos(c/10)*Ye,nt={draw:function(At,or){var Dr=Math.sqrt(or*ze),un=it*Dr,Rn=st*Dr;At.moveTo(0,-Dr),At.lineTo(un,Rn);for(var jn=1;jn<5;++jn){var Un=c*jn/5,cn=Math.cos(Un),In=Math.sin(Un);At.lineTo(In*Dr,-cn*Dr),At.lineTo(cn*un-In*Rn,In*un+cn*Rn)}At.closePath()}},Qe={draw:function(At,or){var Dr=Math.sqrt(or),un=-Dr/2;At.rect(un,un,Dr,Dr)}},Le=Math.sqrt(3),Te={draw:function(At,or){var Dr=-Math.sqrt(or/(Le*3));At.moveTo(0,Dr*2),At.lineTo(-Le*Dr,-Dr),At.lineTo(Le*Dr,-Dr),At.closePath()}},pe=-.5,Ne=Math.sqrt(3)/2,ot=1/Math.sqrt(12),ft=(ot/2+1)*3,rt={draw:function(At,or){var Dr=Math.sqrt(or/ft),un=Dr/2,Rn=Dr*ot,jn=un,Un=Dr*ot+Dr,cn=-jn,In=Un;At.moveTo(un,Rn),At.lineTo(jn,Un),At.lineTo(cn,In),At.lineTo(pe*un-Ne*Rn,Ne*un+pe*Rn),At.lineTo(pe*jn-Ne*Un,Ne*jn+pe*Un),At.lineTo(pe*cn-Ne*In,Ne*cn+pe*In),At.lineTo(pe*un+Ne*Rn,pe*Rn-Ne*un),At.lineTo(pe*jn+Ne*Un,pe*Un-Ne*jn),At.lineTo(pe*cn+Ne*In,pe*In-Ne*cn),At.closePath()}},Ft=[ie,ve,Fe,Qe,nt,Te,rt];function Nt(){var At=S(ie),or=S(64),Dr=null;function un(){var Rn;if(Dr||(Dr=Rn=b.path()),At.apply(this,arguments).draw(Dr,+or.apply(this,arguments)),Rn)return Dr=null,Rn+""||null}return un.type=function(Rn){return arguments.length?(At=typeof Rn=="function"?Rn:S(Rn),un):At},un.size=function(Rn){return arguments.length?(or=typeof Rn=="function"?Rn:S(+Rn),un):or},un.context=function(Rn){return arguments.length?(Dr=Rn??null,un):Dr},un}function $t(){}function rr(At,or,Dr){At._context.bezierCurveTo((2*At._x0+At._x1)/3,(2*At._y0+At._y1)/3,(At._x0+2*At._x1)/3,(At._y0+2*At._y1)/3,(At._x0+4*At._x1+or)/6,(At._y0+4*At._y1+Dr)/6)}function Er(At){this._context=At}Er.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:rr(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(At,or){switch(At=+At,or=+or,this._point){case 0:this._point=1,this._line?this._context.lineTo(At,or):this._context.moveTo(At,or);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:rr(this,At,or);break}this._x0=this._x1,this._x1=At,this._y0=this._y1,this._y1=or}};function Mr(At){return new Er(At)}function Wr(At){this._context=At}Wr.prototype={areaStart:$t,areaEnd:$t,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(At,or){switch(At=+At,or=+or,this._point){case 0:this._point=1,this._x2=At,this._y2=or;break;case 1:this._point=2,this._x3=At,this._y3=or;break;case 2:this._point=3,this._x4=At,this._y4=or,this._context.moveTo((this._x0+4*this._x1+At)/6,(this._y0+4*this._y1+or)/6);break;default:rr(this,At,or);break}this._x0=this._x1,this._x1=At,this._y0=this._y1,this._y1=or}};function Sr(At){return new Wr(At)}function Br(At){this._context=At}Br.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(At,or){switch(At=+At,or=+or,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var Dr=(this._x0+4*this._x1+At)/6,un=(this._y0+4*this._y1+or)/6;this._line?this._context.lineTo(Dr,un):this._context.moveTo(Dr,un);break;case 3:this._point=4;default:rr(this,At,or);break}this._x0=this._x1,this._x1=At,this._y0=this._y1,this._y1=or}};function Mt(At){return new Br(At)}function je(At,or){this._basis=new Er(At),this._beta=or}je.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var At=this._x,or=this._y,Dr=At.length-1;if(Dr>0)for(var un=At[0],Rn=or[0],jn=At[Dr]-un,Un=or[Dr]-Rn,cn=-1,In;++cn<=Dr;)In=cn/Dr,this._basis.point(this._beta*At[cn]+(1-this._beta)*(un+In*jn),this._beta*or[cn]+(1-this._beta)*(Rn+In*Un));this._x=this._y=null,this._basis.lineEnd()},point:function(At,or){this._x.push(+At),this._y.push(+or)}};var $e=(function At(or){function Dr(un){return or===1?new Er(un):new je(un,or)}return Dr.beta=function(un){return At(+un)},Dr})(.85);function Ee(At,or,Dr){At._context.bezierCurveTo(At._x1+At._k*(At._x2-At._x0),At._y1+At._k*(At._y2-At._y0),At._x2+At._k*(At._x1-or),At._y2+At._k*(At._y1-Dr),At._x2,At._y2)}function xe(At,or){this._context=At,this._k=(1-or)/6}xe.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:Ee(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(At,or){switch(At=+At,or=+or,this._point){case 0:this._point=1,this._line?this._context.lineTo(At,or):this._context.moveTo(At,or);break;case 1:this._point=2,this._x1=At,this._y1=or;break;case 2:this._point=3;default:Ee(this,At,or);break}this._x0=this._x1,this._x1=this._x2,this._x2=At,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var ye=(function At(or){function Dr(un){return new xe(un,or)}return Dr.tension=function(un){return At(+un)},Dr})(0);function Me(At,or){this._context=At,this._k=(1-or)/6}Me.prototype={areaStart:$t,areaEnd:$t,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(At,or){switch(At=+At,or=+or,this._point){case 0:this._point=1,this._x3=At,this._y3=or;break;case 1:this._point=2,this._context.moveTo(this._x4=At,this._y4=or);break;case 2:this._point=3,this._x5=At,this._y5=or;break;default:Ee(this,At,or);break}this._x0=this._x1,this._x1=this._x2,this._x2=At,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var Xe=(function At(or){function Dr(un){return new Me(un,or)}return Dr.tension=function(un){return At(+un)},Dr})(0);function Je(At,or){this._context=At,this._k=(1-or)/6}Je.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(At,or){switch(At=+At,or=+or,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:Ee(this,At,or);break}this._x0=this._x1,this._x1=this._x2,this._x2=At,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var Lt=(function At(or){function Dr(un){return new Je(un,or)}return Dr.tension=function(un){return At(+un)},Dr})(0);function Ct(At,or,Dr){var un=At._x1,Rn=At._y1,jn=At._x2,Un=At._y2;if(At._l01_a>a){var cn=2*At._l01_2a+3*At._l01_a*At._l12_a+At._l12_2a,In=3*At._l01_a*(At._l01_a+At._l12_a);un=(un*cn-At._x0*At._l12_2a+At._x2*At._l01_2a)/In,Rn=(Rn*cn-At._y0*At._l12_2a+At._y2*At._l01_2a)/In}if(At._l23_a>a){var xi=2*At._l23_2a+3*At._l23_a*At._l12_a+At._l12_2a,Ea=3*At._l23_a*(At._l23_a+At._l12_a);jn=(jn*xi+At._x1*At._l23_2a-or*At._l12_2a)/Ea,Un=(Un*xi+At._y1*At._l23_2a-Dr*At._l12_2a)/Ea}At._context.bezierCurveTo(un,Rn,jn,Un,At._x2,At._y2)}function Ot(At,or){this._context=At,this._alpha=or}Ot.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(At,or){if(At=+At,or=+or,this._point){var Dr=this._x2-At,un=this._y2-or;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Dr*Dr+un*un,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(At,or):this._context.moveTo(At,or);break;case 1:this._point=2;break;case 2:this._point=3;default:Ct(this,At,or);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=At,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var Wt=(function At(or){function Dr(un){return or?new Ot(un,or):new xe(un,0)}return Dr.alpha=function(un){return At(+un)},Dr})(.5);function _r(At,or){this._context=At,this._alpha=or}_r.prototype={areaStart:$t,areaEnd:$t,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(At,or){if(At=+At,or=+or,this._point){var Dr=this._x2-At,un=this._y2-or;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Dr*Dr+un*un,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=At,this._y3=or;break;case 1:this._point=2,this._context.moveTo(this._x4=At,this._y4=or);break;case 2:this._point=3,this._x5=At,this._y5=or;break;default:Ct(this,At,or);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=At,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var pr=(function At(or){function Dr(un){return or?new _r(un,or):new Me(un,0)}return Dr.alpha=function(un){return At(+un)},Dr})(.5);function hr(At,or){this._context=At,this._alpha=or}hr.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(At,or){if(At=+At,or=+or,this._point){var Dr=this._x2-At,un=this._y2-or;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Dr*Dr+un*un,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:Ct(this,At,or);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=At,this._y0=this._y1,this._y1=this._y2,this._y2=or}};var Fr=(function At(or){function Dr(un){return or?new hr(un,or):new Je(un,0)}return Dr.alpha=function(un){return At(+un)},Dr})(.5);function En(At){this._context=At}En.prototype={areaStart:$t,areaEnd:$t,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(At,or){At=+At,or=+or,this._point?this._context.lineTo(At,or):(this._point=1,this._context.moveTo(At,or))}};function Kn(At){return new En(At)}function qn(At){return At<0?-1:1}function ta(At,or,Dr){var un=At._x1-At._x0,Rn=or-At._x1,jn=(At._y1-At._y0)/(un||Rn<0&&-0),Un=(Dr-At._y1)/(Rn||un<0&&-0),cn=(jn*Rn+Un*un)/(un+Rn);return(qn(jn)+qn(Un))*Math.min(Math.abs(jn),Math.abs(Un),.5*Math.abs(cn))||0}function ra(At,or){var Dr=At._x1-At._x0;return Dr?(3*(At._y1-At._y0)/Dr-or)/2:or}function Nn(At,or,Dr){var un=At._x0,Rn=At._y0,jn=At._x1,Un=At._y1,cn=(jn-un)/3;At._context.bezierCurveTo(un+cn,Rn+cn*or,jn-cn,Un-cn*Dr,jn,Un)}function ka(At){this._context=At}ka.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:Nn(this,this._t0,ra(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(At,or){var Dr=NaN;if(At=+At,or=+or,!(At===this._x1&&or===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(At,or):this._context.moveTo(At,or);break;case 1:this._point=2;break;case 2:this._point=3,Nn(this,ra(this,Dr=ta(this,At,or)),Dr);break;default:Nn(this,this._t0,Dr=ta(this,At,or));break}this._x0=this._x1,this._x1=At,this._y0=this._y1,this._y1=or,this._t0=Dr}}};function qa(At){this._context=new ir(At)}(qa.prototype=Object.create(ka.prototype)).point=function(At,or){ka.prototype.point.call(this,or,At)};function ir(At){this._context=At}ir.prototype={moveTo:function(At,or){this._context.moveTo(or,At)},closePath:function(){this._context.closePath()},lineTo:function(At,or){this._context.lineTo(or,At)},bezierCurveTo:function(At,or,Dr,un,Rn,jn){this._context.bezierCurveTo(or,At,un,Dr,jn,Rn)}};function qt(At){return new ka(At)}function ar(At){return new qa(At)}function lr(At){this._context=At}lr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var At=this._x,or=this._y,Dr=At.length;if(Dr)if(this._line?this._context.lineTo(At[0],or[0]):this._context.moveTo(At[0],or[0]),Dr===2)this._context.lineTo(At[1],or[1]);else for(var un=Vr(At),Rn=Vr(or),jn=0,Un=1;Un=0;--or)Rn[or]=(Un[or]-Rn[or+1])/jn[or];for(jn[Dr-1]=(At[Dr]+Rn[Dr-1])/2,or=0;or=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(At,or){switch(At=+At,or=+or,this._point){case 0:this._point=1,this._line?this._context.lineTo(At,or):this._context.moveTo(At,or);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,or),this._context.lineTo(At,or);else{var Dr=this._x*(1-this._t)+At*this._t;this._context.lineTo(Dr,this._y),this._context.lineTo(Dr,or)}break}}this._x=At,this._y=or}};function wn(At){return new mn(At,.5)}function Jn(At){return new mn(At,0)}function pa(At){return new mn(At,1)}function ha(At,or){if((Un=At.length)>1)for(var Dr=1,un,Rn,jn=At[or[0]],Un,cn=jn.length;Dr=0;)Dr[or]=or;return Dr}function Ca(At,or){return At[or]}function Vn(){var At=S([]),or=_a,Dr=ha,un=Ca;function Rn(jn){var Un=At.apply(this,arguments),cn,In=jn.length,xi=Un.length,Ea=new Array(xi),Pi;for(cn=0;cn0){for(var Dr,un,Rn=0,jn=At[0].length,Un;Rn0)for(var Dr,un=0,Rn,jn,Un,cn,In,xi=At[or[0]].length;un0?(Rn[0]=Un,Rn[1]=Un+=jn):jn<0?(Rn[1]=cn,Rn[0]=cn+=jn):(Rn[0]=0,Rn[1]=jn)}function Dt(At,or){if((Rn=At.length)>0){for(var Dr=0,un=At[or[0]],Rn,jn=un.length;Dr0)||!((jn=(Rn=At[or[0]]).length)>0))){for(var Dr=0,un=1,Rn,jn,Un;unjn&&(jn=Rn,Dr=or);return Dr}function jr(At){var or=At.map(Ir);return _a(At).sort(function(Dr,un){return or[Dr]-or[un]})}function Ir(At){for(var or=0,Dr=-1,un=At.length,Rn;++Dr0;--ue)ae(K*=.99),ie(),H(K),ie();function te(){var ve=b.max(ne,function(Fe){return Fe.length}),Ae=j*(I-v)/(ve-1);z>Ae&&(z=Ae);var Ce=b.min(ne,function(Fe){return(I-v-(Fe.length-1)*z)/b.sum(Fe,c)});ne.forEach(function(Fe){Fe.forEach(function(ze,Ye){ze.y1=(ze.y0=Ye)+ze.value*Ce})}),ee.links.forEach(function(Fe){Fe.width=Fe.value*Ce})}function H(ve){ne.forEach(function(Ae){Ae.forEach(function(Ce){if(Ce.targetLinks.length){var Fe=(b.sum(Ce.targetLinks,d)/b.sum(Ce.targetLinks,c)-p(Ce))*ve;Ce.y0+=Fe,Ce.y1+=Fe}})})}function ae(ve){ne.slice().reverse().forEach(function(Ae){Ae.forEach(function(Ce){if(Ce.sourceLinks.length){var Fe=(b.sum(Ce.sourceLinks,T)/b.sum(Ce.sourceLinks,c)-p(Ce))*ve;Ce.y0+=Fe,Ce.y1+=Fe}})})}function ie(){ne.forEach(function(ve){var Ae,Ce,Fe=v,ze=ve.length,Ye;for(ve.sort(f),Ye=0;Ye0&&(Ae.y0+=Ce,Ae.y1+=Ce),Fe=Ae.y1+z;if(Ce=Fe-z-I,Ce>0)for(Fe=Ae.y0-=Ce,Ae.y1-=Ce,Ye=ze-2;Ye>=0;--Ye)Ae=ve[Ye],Ce=Ae.y1+z-Fe,Ce>0&&(Ae.y0-=Ce,Ae.y1-=Ce),Fe=Ae.y0})}}function V(ee){ee.nodes.forEach(function(ne){ne.sourceLinks.sort(s),ne.targetLinks.sort(a)}),ee.nodes.forEach(function(ne){var K=ne.y0,ue=K;ne.sourceLinks.forEach(function(te){te.y0=K+te.width/2,K+=te.width}),ne.targetLinks.forEach(function(te){te.y1=ue+te.width/2,ue+=te.width})})}return Z};function _(u){return[u.source.x1,u.y0]}function w(u){return[u.target.x0,u.y1]}var m=function(){return E.linkHorizontal().source(_).target(w)};h.sankey=M,h.sankeyCenter=n,h.sankeyLeft=t,h.sankeyRight=r,h.sankeyJustify=o,h.sankeyLinkHorizontal=m,Object.defineProperty(h,"__esModule",{value:!0})})}}),Lz=Ge({"node_modules/elementary-circuits-directed-graph/johnson.js"($,G){var h=QC();G.exports=function(S,E){var e=[],t=[],r=[],o={},n=[],i;function a(A){r[A]=!1,o.hasOwnProperty(A)&&Object.keys(o[A]).forEach(function(M){delete o[A][M],r[M]&&a(M)})}function s(A){var M=!1;t.push(A),r[A]=!0;var _,w;for(_=0;_=A})}function p(A){c(A);for(var M=S,_=h(M),w=_.components.filter(function(z){return z.length>1}),m=1/0,u,v=0;v"u"?"undefined":s(xe))!=="object"&&(xe=$e.source=_(je,xe)),(typeof ye>"u"?"undefined":s(ye))!=="object"&&(ye=$e.target=_(je,ye)),xe.sourceLinks.push($e),ye.targetLinks.push($e)}),Mt}function rr(Mt){Mt.nodes.forEach(function(je){je.partOfCycle=!1,je.value=Math.max(b.sum(je.sourceLinks,d),b.sum(je.targetLinks,d)),je.sourceLinks.forEach(function($e){$e.circular&&(je.partOfCycle=!0,je.circularLinkType=$e.circularLinkType)}),je.targetLinks.forEach(function($e){$e.circular&&(je.partOfCycle=!0,je.circularLinkType=$e.circularLinkType)})})}function Er(Mt){var je=0,$e=0,Ee=0,xe=0,ye=b.max(Mt.nodes,function(Me){return Me.column});return Mt.links.forEach(function(Me){Me.circular&&(Me.circularLinkType=="top"?je=je+Me.width:$e=$e+Me.width,Me.target.column==0&&(xe=xe+Me.width),Me.source.column==ye&&(Ee=Ee+Me.width))}),je=je>0?je+m+u:je,$e=$e>0?$e+m+u:$e,Ee=Ee>0?Ee+m+u:Ee,xe=xe>0?xe+m+u:xe,{top:je,bottom:$e,left:xe,right:Ee}}function Mr(Mt,je){var $e=b.max(Mt.nodes,function(Lt){return Lt.column}),Ee=it-ze,xe=st-Ye,ye=Ee+je.right+je.left,Me=xe+je.top+je.bottom,Xe=Ee/ye,Je=xe/Me;return ze=ze*Xe+je.left,it=je.right==0?it:it*Xe,Ye=Ye*Je+je.top,st=st*Je,Mt.nodes.forEach(function(Lt){Lt.x0=ze+Lt.column*((it-ze-nt)/$e),Lt.x1=Lt.x0+nt}),Je}function Wr(Mt){var je,$e,Ee;for(je=Mt.nodes,$e=[],Ee=0;je.length;++Ee,je=$e,$e=[])je.forEach(function(xe){xe.depth=Ee,xe.sourceLinks.forEach(function(ye){$e.indexOf(ye.target)<0&&!ye.circular&&$e.push(ye.target)})});for(je=Mt.nodes,$e=[],Ee=0;je.length;++Ee,je=$e,$e=[])je.forEach(function(xe){xe.height=Ee,xe.targetLinks.forEach(function(ye){$e.indexOf(ye.source)<0&&!ye.circular&&$e.push(ye.source)})});Mt.nodes.forEach(function(xe){xe.column=Math.floor(Te.call(null,xe,Ee))})}function Sr(Mt,je,$e){var Ee=S.nest().key(function(Lt){return Lt.column}).sortKeys(b.ascending).entries(Mt.nodes).map(function(Lt){return Lt.values});Me($e),Je();for(var xe=1,ye=je;ye>0;--ye)Xe(xe*=.99,$e),Je();function Me(Lt){if(rt){var Ct=1/0;Ee.forEach(function(pr){var hr=st*rt/(pr.length+1);Ct=hr0))if(pr==0&&_r==1)Fr=hr.y1-hr.y0,hr.y0=st/2-Fr/2,hr.y1=st/2+Fr/2;else if(pr==Ot-1&&_r==1)Fr=hr.y1-hr.y0,hr.y0=st/2-Fr/2,hr.y1=st/2+Fr/2;else{var En=0,Kn=b.mean(hr.sourceLinks,g),qn=b.mean(hr.targetLinks,l);Kn&&qn?En=(Kn+qn)/2:En=Kn||qn;var ta=(En-T(hr))*Lt;hr.y0+=ta,hr.y1+=ta}})})}function Je(){Ee.forEach(function(Lt){var Ct,Ot,Wt=Ye,_r=Lt.length,pr;for(Lt.sort(p),pr=0;pr<_r;++pr)Ct=Lt[pr],Ot=Wt-Ct.y0,Ot>0&&(Ct.y0+=Ot,Ct.y1+=Ot),Wt=Ct.y1+Qe;if(Ot=Wt-Qe-st,Ot>0)for(Wt=Ct.y0-=Ot,Ct.y1-=Ot,pr=_r-2;pr>=0;--pr)Ct=Lt[pr],Ot=Ct.y1+Qe-Wt,Ot>0&&(Ct.y0-=Ot,Ct.y1-=Ot),Wt=Ct.y0})}}function Br(Mt){Mt.nodes.forEach(function(je){je.sourceLinks.sort(c),je.targetLinks.sort(f)}),Mt.nodes.forEach(function(je){var $e=je.y0,Ee=$e,xe=je.y1,ye=xe;je.sourceLinks.forEach(function(Me){Me.circular?(Me.y0=xe-Me.width/2,xe=xe-Me.width):(Me.y0=$e+Me.width/2,$e+=Me.width)}),je.targetLinks.forEach(function(Me){Me.circular?(Me.y1=ye-Me.width/2,ye=ye-Me.width):(Me.y1=Ee+Me.width/2,Ee+=Me.width)})})}return Nt}function I(ze,Ye,it){var st=0;if(it===null){for(var nt=[],Qe=0;QeYe.source.column)}function N(ze,Ye){var it=0;ze.sourceLinks.forEach(function(nt){it=nt.circular&&!Ce(nt,Ye)?it+1:it});var st=0;return ze.targetLinks.forEach(function(nt){st=nt.circular&&!Ce(nt,Ye)?st+1:st}),it+st}function B(ze){var Ye=ze.source.sourceLinks,it=0;Ye.forEach(function(Qe){it=Qe.circular?it+1:it});var st=ze.target.targetLinks,nt=0;return st.forEach(function(Qe){nt=Qe.circular?nt+1:nt}),!(it>1||nt>1)}function R(ze,Ye,it){return ze.sort(Z),ze.forEach(function(st,nt){var Qe=0;if(Ce(st,it)&&B(st))st.circularPathData.verticalBuffer=Qe+st.width/2;else{var Le=0;for(Le;LeQe?Te:Qe}st.circularPathData.verticalBuffer=Qe+st.width/2}}),ze}function U(ze,Ye,it,st){var nt=5,Qe=b.min(ze.links,function(pe){return pe.source.y0});ze.links.forEach(function(pe){pe.circular&&(pe.circularPathData={})});var Le=ze.links.filter(function(pe){return pe.circularLinkType=="top"});R(Le,Ye,st);var Te=ze.links.filter(function(pe){return pe.circularLinkType=="bottom"});R(Te,Ye,st),ze.links.forEach(function(pe){if(pe.circular){if(pe.circularPathData.arcRadius=pe.width+u,pe.circularPathData.leftNodeBuffer=nt,pe.circularPathData.rightNodeBuffer=nt,pe.circularPathData.sourceWidth=pe.source.x1-pe.source.x0,pe.circularPathData.sourceX=pe.source.x0+pe.circularPathData.sourceWidth,pe.circularPathData.targetX=pe.target.x0,pe.circularPathData.sourceY=pe.y0,pe.circularPathData.targetY=pe.y1,Ce(pe,st)&&B(pe))pe.circularPathData.leftSmallArcRadius=u+pe.width/2,pe.circularPathData.leftLargeArcRadius=u+pe.width/2,pe.circularPathData.rightSmallArcRadius=u+pe.width/2,pe.circularPathData.rightLargeArcRadius=u+pe.width/2,pe.circularLinkType=="bottom"?(pe.circularPathData.verticalFullExtent=pe.source.y1+m+pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.rightLargeArcRadius):(pe.circularPathData.verticalFullExtent=pe.source.y0-m-pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.rightLargeArcRadius);else{var Ne=pe.source.column,ot=pe.circularLinkType,ft=ze.links.filter(function(Nt){return Nt.source.column==Ne&&Nt.circularLinkType==ot});pe.circularLinkType=="bottom"?ft.sort(fe):ft.sort(re);var rt=0;ft.forEach(function(Nt,$t){Nt.circularLinkID==pe.circularLinkID&&(pe.circularPathData.leftSmallArcRadius=u+pe.width/2+rt,pe.circularPathData.leftLargeArcRadius=u+pe.width/2+$t*Ye+rt),rt=rt+Nt.width}),Ne=pe.target.column,ft=ze.links.filter(function(Nt){return Nt.target.column==Ne&&Nt.circularLinkType==ot}),pe.circularLinkType=="bottom"?ft.sort(ce):ft.sort(le),rt=0,ft.forEach(function(Nt,$t){Nt.circularLinkID==pe.circularLinkID&&(pe.circularPathData.rightSmallArcRadius=u+pe.width/2+rt,pe.circularPathData.rightLargeArcRadius=u+pe.width/2+$t*Ye+rt),rt=rt+Nt.width}),pe.circularLinkType=="bottom"?(pe.circularPathData.verticalFullExtent=Math.max(it,pe.source.y1,pe.target.y1)+m+pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.rightLargeArcRadius):(pe.circularPathData.verticalFullExtent=Qe-m-pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.rightLargeArcRadius)}pe.circularPathData.leftInnerExtent=pe.circularPathData.sourceX+pe.circularPathData.leftNodeBuffer,pe.circularPathData.rightInnerExtent=pe.circularPathData.targetX-pe.circularPathData.rightNodeBuffer,pe.circularPathData.leftFullExtent=pe.circularPathData.sourceX+pe.circularPathData.leftLargeArcRadius+pe.circularPathData.leftNodeBuffer,pe.circularPathData.rightFullExtent=pe.circularPathData.targetX-pe.circularPathData.rightLargeArcRadius-pe.circularPathData.rightNodeBuffer}if(pe.circular)pe.path=j(pe);else{var Ft=E.linkHorizontal().source(function(Nt){var $t=Nt.source.x0+(Nt.source.x1-Nt.source.x0),rr=Nt.y0;return[$t,rr]}).target(function(Nt){var $t=Nt.target.x0,rr=Nt.y1;return[$t,rr]});pe.path=Ft(pe)}})}function j(ze){var Ye="";return ze.circularLinkType=="top"?Ye="M"+ze.circularPathData.sourceX+" "+ze.circularPathData.sourceY+" L"+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.sourceY+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftSmallArcRadius+" 0 0 0 "+ze.circularPathData.leftFullExtent+" "+(ze.circularPathData.sourceY-ze.circularPathData.leftSmallArcRadius)+" L"+ze.circularPathData.leftFullExtent+" "+ze.circularPathData.verticalLeftInnerExtent+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftLargeArcRadius+" 0 0 0 "+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.verticalFullExtent+" L"+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.verticalFullExtent+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightLargeArcRadius+" 0 0 0 "+ze.circularPathData.rightFullExtent+" "+ze.circularPathData.verticalRightInnerExtent+" L"+ze.circularPathData.rightFullExtent+" "+(ze.circularPathData.targetY-ze.circularPathData.rightSmallArcRadius)+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightSmallArcRadius+" 0 0 0 "+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.targetY+" L"+ze.circularPathData.targetX+" "+ze.circularPathData.targetY:Ye="M"+ze.circularPathData.sourceX+" "+ze.circularPathData.sourceY+" L"+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.sourceY+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftSmallArcRadius+" 0 0 1 "+ze.circularPathData.leftFullExtent+" "+(ze.circularPathData.sourceY+ze.circularPathData.leftSmallArcRadius)+" L"+ze.circularPathData.leftFullExtent+" "+ze.circularPathData.verticalLeftInnerExtent+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftLargeArcRadius+" 0 0 1 "+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.verticalFullExtent+" L"+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.verticalFullExtent+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightLargeArcRadius+" 0 0 1 "+ze.circularPathData.rightFullExtent+" "+ze.circularPathData.verticalRightInnerExtent+" L"+ze.circularPathData.rightFullExtent+" "+(ze.circularPathData.targetY+ze.circularPathData.rightSmallArcRadius)+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightSmallArcRadius+" 0 0 1 "+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.targetY+" L"+ze.circularPathData.targetX+" "+ze.circularPathData.targetY,Ye}function Z(ze,Ye){return V(ze)==V(Ye)?ze.circularLinkType=="bottom"?fe(ze,Ye):re(ze,Ye):V(Ye)-V(ze)}function re(ze,Ye){return ze.y0-Ye.y0}function fe(ze,Ye){return Ye.y0-ze.y0}function le(ze,Ye){return ze.y1-Ye.y1}function ce(ze,Ye){return Ye.y1-ze.y1}function V(ze){return ze.target.column-ze.source.column}function ee(ze){return ze.target.x0-ze.source.x1}function ne(ze,Ye){var it=z(ze),st=ee(Ye)/Math.tan(it),nt=Ae(ze)=="up"?ze.y1+st:ze.y1-st;return nt}function K(ze,Ye){var it=z(ze),st=ee(Ye)/Math.tan(it),nt=Ae(ze)=="up"?ze.y1-st:ze.y1+st;return nt}function ue(ze,Ye,it,st){ze.links.forEach(function(nt){if(!nt.circular&&nt.target.column-nt.source.column>1){var Qe=nt.source.column+1,Le=nt.target.column-1,Te=1,pe=Le-Qe+1;for(Te=1;Qe<=Le;Qe++,Te++)ze.nodes.forEach(function(Ne){if(Ne.column==Qe){var ot=Te/(pe+1),ft=Math.pow(1-ot,3),rt=3*ot*Math.pow(1-ot,2),Ft=3*Math.pow(ot,2)*(1-ot),Nt=Math.pow(ot,3),$t=ft*nt.y0+rt*nt.y0+Ft*nt.y1+Nt*nt.y1,rr=$t-nt.width/2,Er=$t+nt.width/2,Mr;rr>Ne.y0&&rrNe.y0&&ErNe.y1&&H(Wr,Mr,Ye,it)})):rrNe.y1&&(Mr=Er-Ne.y0+10,Ne=H(Ne,Mr,Ye,it),ze.nodes.forEach(function(Wr){w(Wr,st)==w(Ne,st)||Wr.column!=Ne.column||Wr.y0Ne.y1&&H(Wr,Mr,Ye,it)}))}})}})}function te(ze,Ye){return ze.y0>Ye.y0&&ze.y0Ye.y0&&ze.y1Ye.y1}function H(ze,Ye,it,st){return ze.y0+Ye>=it&&ze.y1+Ye<=st&&(ze.y0=ze.y0+Ye,ze.y1=ze.y1+Ye,ze.targetLinks.forEach(function(nt){nt.y1=nt.y1+Ye}),ze.sourceLinks.forEach(function(nt){nt.y0=nt.y0+Ye})),ze}function ae(ze,Ye,it,st){ze.nodes.forEach(function(nt){st&&nt.y+(nt.y1-nt.y0)>Ye&&(nt.y=nt.y-(nt.y+(nt.y1-nt.y0)-Ye));var Qe=ze.links.filter(function(pe){return w(pe.source,it)==w(nt,it)}),Le=Qe.length;Le>1&&Qe.sort(function(pe,Ne){if(!pe.circular&&!Ne.circular){if(pe.target.column==Ne.target.column)return pe.y1-Ne.y1;if(ve(pe,Ne)){if(pe.target.column>Ne.target.column){var ot=K(Ne,pe);return pe.y1-ot}if(Ne.target.column>pe.target.column){var ft=K(pe,Ne);return ft-Ne.y1}}else return pe.y1-Ne.y1}if(pe.circular&&!Ne.circular)return pe.circularLinkType=="top"?-1:1;if(Ne.circular&&!pe.circular)return Ne.circularLinkType=="top"?1:-1;if(pe.circular&&Ne.circular)return pe.circularLinkType===Ne.circularLinkType&&pe.circularLinkType=="top"?pe.target.column===Ne.target.column?pe.target.y1-Ne.target.y1:Ne.target.column-pe.target.column:pe.circularLinkType===Ne.circularLinkType&&pe.circularLinkType=="bottom"?pe.target.column===Ne.target.column?Ne.target.y1-pe.target.y1:pe.target.column-Ne.target.column:pe.circularLinkType=="top"?-1:1});var Te=nt.y0;Qe.forEach(function(pe){pe.y0=Te+pe.width/2,Te=Te+pe.width}),Qe.forEach(function(pe,Ne){if(pe.circularLinkType=="bottom"){var ot=Ne+1,ft=0;for(ot;ot1&&nt.sort(function(Te,pe){if(!Te.circular&&!pe.circular){if(Te.source.column==pe.source.column)return Te.y0-pe.y0;if(ve(Te,pe)){if(pe.source.column0?"up":"down"}function Ce(ze,Ye){return w(ze.source,Ye)==w(ze.target,Ye)}function Fe(ze,Ye,it){var st=ze.nodes,nt=ze.links,Qe=!1,Le=!1;if(nt.forEach(function(rt){rt.circularLinkType=="top"?Qe=!0:rt.circularLinkType=="bottom"&&(Le=!0)}),Qe==!1||Le==!1){var Te=b.min(st,function(rt){return rt.y0}),pe=b.max(st,function(rt){return rt.y1}),Ne=pe-Te,ot=it-Ye,ft=ot/Ne;st.forEach(function(rt){var Ft=(rt.y1-rt.y0)*ft;rt.y0=(rt.y0-Te)*ft,rt.y1=rt.y0+Ft}),nt.forEach(function(rt){rt.y0=(rt.y0-Te)*ft,rt.y1=(rt.y1-Te)*ft,rt.width=rt.width*ft})}}h.sankeyCircular=y,h.sankeyCenter=i,h.sankeyLeft=r,h.sankeyRight=o,h.sankeyJustify=n,Object.defineProperty(h,"__esModule",{value:!0})})}}),tL=Ge({"src/traces/sankey/constants.js"($,G){G.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}}),Rz=Ge({"src/traces/sankey/render.js"($,G){var h=Ez(),b=(oo(),mi(Ti)).interpolateNumber,S=Za(),E=Cz(),e=Pz(),t=tL(),r=ks(),o=So(),n=Ms(),i=yn(),a=i.strTranslate,s=i.strRotate,f=Dg(),c=f.keyFun,p=f.repeat,d=f.unwrap,T=ec(),l=Io(),g=ev(),x=g.CAP_SHIFT,A=g.LINE_SPACING,M=3;function _(ne,K,ue){var te=d(K),H=te.trace,ae=H.domain,ie=H.orientation==="h",ve=H.node.pad,Ae=H.node.thickness,Ce={justify:E.sankeyJustify,left:E.sankeyLeft,right:E.sankeyRight,center:E.sankeyCenter}[H.node.align],Fe=ne.width*(ae.x[1]-ae.x[0]),ze=ne.height*(ae.y[1]-ae.y[0]),Ye=te._nodes,it=te._links,st=te.circular,nt;st?nt=e.sankeyCircular().circularLinkGap(0):nt=E.sankey(),nt.iterations(t.sankeyIterations).size(ie?[Fe,ze]:[ze,Fe]).nodeWidth(Ae).nodePadding(ve).nodeId(function(Wr){return Wr.pointNumber}).nodeAlign(Ce).nodes(Ye).links(it);var Qe=nt();nt.nodePadding()=je||(Mt=je-Br.y0,Mt>1e-6&&(Br.y0+=Mt,Br.y1+=Mt)),je=Br.y1+ve})}function $t(Wr){var Sr=Wr.map(function(ye,Me){return{x0:ye.x0,index:Me}}).sort(function(ye,Me){return ye.x0-Me.x0}),Br=[],Mt=-1,je,$e=-1/0,Ee;for(Le=0;Le$e+Ae&&(Mt+=1,je=xe.x0),$e=xe.x0,Br[Mt]||(Br[Mt]=[]),Br[Mt].push(xe),Ee=je-xe.x0,xe.x0+=Ee,xe.x1+=Ee}return Br}if(H.node.x.length&&H.node.y.length){for(Le=0;Le0?" L "+H.targetX+" "+H.targetY:"")+"Z"):(ue="M "+(H.targetX-K)+" "+(H.targetY-te)+" L "+(H.rightInnerExtent-K)+" "+(H.targetY-te)+" A "+(H.rightLargeArcRadius+te)+" "+(H.rightSmallArcRadius+te)+" 0 0 0 "+(H.rightFullExtent-te-K)+" "+(H.targetY+H.rightSmallArcRadius)+" L "+(H.rightFullExtent-te-K)+" "+H.verticalRightInnerExtent,ae&&ie?ue+=" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.rightInnerExtent-te-K)+" "+(H.verticalFullExtent+te)+" L "+(H.rightFullExtent+te-K-(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent+te)+" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.leftFullExtent+te)+" "+H.verticalLeftInnerExtent:ae?ue+=" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.rightFullExtent-K-te-(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" L "+(H.leftFullExtent+te+(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.leftFullExtent+te)+" "+H.verticalLeftInnerExtent:ue+=" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.rightInnerExtent-K)+" "+(H.verticalFullExtent+te)+" L "+H.leftInnerExtent+" "+(H.verticalFullExtent+te)+" A "+(H.leftLargeArcRadius+te)+" "+(H.leftLargeArcRadius+te)+" 0 0 0 "+(H.leftFullExtent+te)+" "+H.verticalLeftInnerExtent,ue+=" L "+(H.leftFullExtent+te)+" "+(H.sourceY+H.leftSmallArcRadius)+" A "+(H.leftLargeArcRadius+te)+" "+(H.leftSmallArcRadius+te)+" 0 0 0 "+H.leftInnerExtent+" "+(H.sourceY-te)+" L "+H.sourceX+" "+(H.sourceY-te)+" L "+H.sourceX+" "+(H.sourceY+te)+" L "+H.leftInnerExtent+" "+(H.sourceY+te)+" A "+(H.leftLargeArcRadius-te)+" "+(H.leftSmallArcRadius-te)+" 0 0 1 "+(H.leftFullExtent-te)+" "+(H.sourceY+H.leftSmallArcRadius)+" L "+(H.leftFullExtent-te)+" "+H.verticalLeftInnerExtent,ae&&ie?ue+=" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.leftFullExtent-te-(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" L "+(H.rightFullExtent+te-K+(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.rightFullExtent+te-K)+" "+H.verticalRightInnerExtent:ae?ue+=" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.leftFullExtent+te)+" "+(H.verticalFullExtent+te)+" L "+(H.rightFullExtent-K-te)+" "+(H.verticalFullExtent+te)+" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.rightFullExtent+te-K)+" "+H.verticalRightInnerExtent:ue+=" A "+(H.leftLargeArcRadius-te)+" "+(H.leftLargeArcRadius-te)+" 0 0 1 "+H.leftInnerExtent+" "+(H.verticalFullExtent-te)+" L "+(H.rightInnerExtent-K)+" "+(H.verticalFullExtent-te)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightLargeArcRadius-te)+" 0 0 1 "+(H.rightFullExtent+te-K)+" "+H.verticalRightInnerExtent,ue+=" L "+(H.rightFullExtent+te-K)+" "+(H.targetY+H.rightSmallArcRadius)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.rightInnerExtent-K)+" "+(H.targetY+te)+" L "+(H.targetX-K)+" "+(H.targetY+te)+(K>0?" L "+H.targetX+" "+H.targetY:"")+"Z"),ue}function u(){var ne=.5;function K(ue){var te=ue.linkArrowLength;if(ue.link.circular)return m(ue.link,te);var H=Math.abs((ue.link.target.x0-ue.link.source.x1)/2);te>H&&(te=H);var ae=ue.link.source.x1,ie=ue.link.target.x0-te,ve=b(ae,ie),Ae=ve(ne),Ce=ve(1-ne),Fe=ue.link.y0-ue.link.width/2,ze=ue.link.y0+ue.link.width/2,Ye=ue.link.y1-ue.link.width/2,it=ue.link.y1+ue.link.width/2,st="M"+ae+","+Fe,nt="C"+Ae+","+Fe+" "+Ce+","+Ye+" "+ie+","+Ye,Qe="C"+Ce+","+it+" "+Ae+","+ze+" "+ae+","+ze,Le=te>0?"L"+(ie+te)+","+(Ye+ue.link.width/2):"";return Le+="L"+ie+","+it,st+nt+Le+Qe+"Z"}return K}function v(ne,K){var ue=r(K.color),te=t.nodePadAcross,H=ne.nodePad/2;K.dx=K.x1-K.x0,K.dy=K.y1-K.y0;var ae=K.dx,ie=Math.max(.5,K.dy),ve="node_"+K.pointNumber;return K.group&&(ve=i.randstr()),K.trace=ne.trace,K.curveNumber=ne.trace.index,{index:K.pointNumber,key:ve,partOfGroup:K.partOfGroup||!1,group:K.group,traceId:ne.key,trace:ne.trace,node:K,nodePad:ne.nodePad,nodeLineColor:ne.nodeLineColor,nodeLineWidth:ne.nodeLineWidth,textFont:ne.textFont,size:ne.horizontal?ne.height:ne.width,visibleWidth:Math.ceil(ae),visibleHeight:ie,zoneX:-te,zoneY:-H,zoneWidth:ae+2*te,zoneHeight:ie+2*H,labelY:ne.horizontal?K.dy/2+1:K.dx/2+1,left:K.originalLayer===1,sizeAcross:ne.width,forceLayouts:ne.forceLayouts,horizontal:ne.horizontal,darkBackground:ue.getBrightness()<=128,tinyColorHue:o.tinyRGB(ue),tinyColorAlpha:ue.getAlpha(),valueFormat:ne.valueFormat,valueSuffix:ne.valueSuffix,sankey:ne.sankey,graph:ne.graph,arrangement:ne.arrangement,uniqueNodeLabelPathId:[ne.guid,ne.key,ve].join("_"),interactionState:ne.interactionState,figure:ne}}function y(ne){ne.attr("transform",function(K){return a(K.node.x0.toFixed(3),K.node.y0.toFixed(3))})}function I(ne){ne.call(y)}function L(ne,K){ne.call(I),K.attr("d",u())}function z(ne){ne.attr("width",function(K){return K.node.x1-K.node.x0}).attr("height",function(K){return K.visibleHeight})}function F(ne){return ne.link.width>1||ne.linkLineWidth>0}function N(ne){var K=a(ne.translateX,ne.translateY);return K+(ne.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function B(ne,K,ue){ne.on(".basic",null).on("mouseover.basic",function(te){!te.interactionState.dragInProgress&&!te.partOfGroup&&(ue.hover(this,te,K),te.interactionState.hovered=[this,te])}).on("mousemove.basic",function(te){!te.interactionState.dragInProgress&&!te.partOfGroup&&(ue.follow(this,te),te.interactionState.hovered=[this,te])}).on("mouseout.basic",function(te){!te.interactionState.dragInProgress&&!te.partOfGroup&&(ue.unhover(this,te,K),te.interactionState.hovered=!1)}).on("click.basic",function(te){te.interactionState.hovered&&(ue.unhover(this,te,K),te.interactionState.hovered=!1),!te.interactionState.dragInProgress&&!te.partOfGroup&&ue.select(this,te,K)})}function R(ne,K,ue,te){var H=S.behavior.drag().origin(function(ae){return{x:ae.node.x0+ae.visibleWidth/2,y:ae.node.y0+ae.visibleHeight/2}}).on("dragstart",function(ae){if(ae.arrangement!=="fixed"&&(i.ensureSingle(te._fullLayout._infolayer,"g","dragcover",function(ve){te._fullLayout._dragCover=ve}),i.raiseToTop(this),ae.interactionState.dragInProgress=ae.node,le(ae.node),ae.interactionState.hovered&&(ue.nodeEvents.unhover.apply(0,ae.interactionState.hovered),ae.interactionState.hovered=!1),ae.arrangement==="snap")){var ie=ae.traceId+"|"+ae.key;ae.forceLayouts[ie]?ae.forceLayouts[ie].alpha(1):U(ne,ie,ae),j(ne,K,ae,ie,te)}}).on("drag",function(ae){if(ae.arrangement!=="fixed"){var ie=S.event.x,ve=S.event.y;ae.arrangement==="snap"?(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2,ae.node.y0=ve-ae.visibleHeight/2,ae.node.y1=ve+ae.visibleHeight/2):(ae.arrangement==="freeform"&&(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2),ve=Math.max(0,Math.min(ae.size-ae.visibleHeight/2,ve)),ae.node.y0=ve-ae.visibleHeight/2,ae.node.y1=ve+ae.visibleHeight/2),le(ae.node),ae.arrangement!=="snap"&&(ae.sankey.update(ae.graph),L(ne.filter(ce(ae)),K))}}).on("dragend",function(ae){if(ae.arrangement!=="fixed"){ae.interactionState.dragInProgress=!1;for(var ie=0;ie0)window.requestAnimationFrame(ae);else{var Ae=ue.node.originalX;ue.node.x0=Ae-ue.visibleWidth/2,ue.node.x1=Ae+ue.visibleWidth/2,re(ue,H)}})}function Z(ne,K,ue,te){return function(){for(var ae=0,ie=0;ie0&&te.forceLayouts[K].alpha(0)}}function re(ne,K){for(var ue=[],te=[],H=0;H"),color:g(V,"bgcolor")||t.addOpacity(te.color,1),borderColor:g(V,"bordercolor"),fontFamily:g(V,"font.family"),fontSize:g(V,"font.size"),fontColor:g(V,"font.color"),fontWeight:g(V,"font.weight"),fontStyle:g(V,"font.style"),fontVariant:g(V,"font.variant"),fontTextcase:g(V,"font.textcase"),fontLineposition:g(V,"font.lineposition"),fontShadow:g(V,"font.shadow"),nameLength:g(V,"namelength"),textAlign:g(V,"align"),idealAlign:h.event.x"),color:g(V,"bgcolor")||ce.tinyColorHue,borderColor:g(V,"bordercolor"),fontFamily:g(V,"font.family"),fontSize:g(V,"font.size"),fontColor:g(V,"font.color"),fontWeight:g(V,"font.weight"),fontStyle:g(V,"font.style"),fontVariant:g(V,"font.variant"),fontTextcase:g(V,"font.textcase"),fontLineposition:g(V,"font.lineposition"),fontShadow:g(V,"font.shadow"),nameLength:g(V,"namelength"),textAlign:g(V,"align"),idealAlign:"left",hovertemplate:V.hovertemplate,hovertemplateLabels:ae,eventData:[ce.node]},{container:_._hoverlayer.node(),outerContainer:_._paper.node(),gd:A});a(Ae,.85),s(Ae)}}},fe=function(le,ce,V){A._fullLayout.hovermode!==!1&&(h.select(le).call(d,ce,V),ce.node.trace.node.hoverinfo!=="skip"&&(ce.node.fullData=ce.node.trace,A.emit("plotly_unhover",{event:h.event,points:[ce.node]})),e.loneUnhover(_._hoverlayer.node()))};E(A,w,M,{width:m.w,height:m.h,margin:{t:m.t,r:m.r,b:m.b,l:m.l}},{linkEvents:{hover:I,follow:R,unhover:U,select:y},nodeEvents:{hover:Z,follow:re,unhover:fe,select:j}})}}}),Iz=Ge({"src/traces/sankey/base_plot.js"($){var G=Uc().overrideAll,h=Iv().getModuleCalcData,b=rL(),S=Ju(),E=Ip(),e=nd(),t=Zf().prepSelect,r=yn(),o=Io(),n="sankey";$.name=n,$.baseLayoutAttrOverrides=G({hoverlabel:S.hoverlabel},"plot","nested"),$.plot=function(a){var s=h(a.calcdata,n)[0];b(a,s),$.updateFx(a)},$.clean=function(a,s,f,c){var p=c._has&&c._has(n),d=s._has&&s._has(n);p&&!d&&(c._paperdiv.selectAll(".sankey").remove(),c._paperdiv.selectAll(".bgsankey").remove())},$.updateFx=function(a){for(var s=0;s0}G.exports=function(F,N,B,R){var U=F._fullLayout,j;x(B)&&R&&(j=R()),E.makeTraceGroups(U._indicatorlayer,N,"trace").each(function(Z){var re=Z[0],fe=re.trace,le=h.select(this),ce=fe._hasGauge,V=fe._isAngular,ee=fe._isBullet,ne=fe.domain,K={w:U._size.w*(ne.x[1]-ne.x[0]),h:U._size.h*(ne.y[1]-ne.y[0]),l:U._size.l+U._size.w*ne.x[0],r:U._size.r+U._size.w*(1-ne.x[1]),t:U._size.t+U._size.h*(1-ne.y[1]),b:U._size.b+U._size.h*ne.y[0]},ue=K.l+K.w/2,te=K.t+K.h/2,H=Math.min(K.w/2,K.h),ae=i.innerRadius*H,ie,ve,Ae,Ce=fe.align||"center";if(ve=te,!ce)ie=K.l+l[Ce]*K.w,Ae=function(pe){return v(pe,K.w,K.h)};else if(V&&(ie=ue,ve=te+H/2,Ae=function(pe){return y(pe,.9*ae)}),ee){var Fe=i.bulletPadding,ze=1-i.bulletNumberDomainSize+Fe;ie=K.l+(ze+(1-ze)*l[Ce])*K.w,Ae=function(pe){return v(pe,(i.bulletNumberDomainSize-Fe)*K.w,K.h)}}_(F,le,Z,{numbersX:ie,numbersY:ve,numbersScaler:Ae,transitionOpts:B,onComplete:j});var Ye,it;ce&&(Ye={range:fe.gauge.axis.range,color:fe.gauge.bgcolor,line:{color:fe.gauge.bordercolor,width:0},thickness:1},it={range:fe.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:fe.gauge.bordercolor,width:fe.gauge.borderwidth},thickness:1});var st=le.selectAll("g.angular").data(V?Z:[]);st.exit().remove();var nt=le.selectAll("g.angularaxis").data(V?Z:[]);nt.exit().remove(),V&&M(F,le,Z,{radius:H,innerRadius:ae,gauge:st,layer:nt,size:K,gaugeBg:Ye,gaugeOutline:it,transitionOpts:B,onComplete:j});var Qe=le.selectAll("g.bullet").data(ee?Z:[]);Qe.exit().remove();var Le=le.selectAll("g.bulletaxis").data(ee?Z:[]);Le.exit().remove(),ee&&A(F,le,Z,{gauge:Qe,layer:Le,size:K,gaugeBg:Ye,gaugeOutline:it,transitionOpts:B,onComplete:j});var Te=le.selectAll("text.title").data(Z);Te.exit().remove(),Te.enter().append("text").classed("title",!0),Te.attr("text-anchor",function(){return ee?T.right:T[fe.title.align]}).text(fe.title.text).call(n.font,fe.title.font).call(a.convertToTspans,F),Te.attr("transform",function(){var pe=K.l+K.w*l[fe.title.align],Ne,ot=i.titlePadding,ft=n.bBox(Te.node());if(ce){if(V)if(fe.gauge.axis.visible){var rt=n.bBox(nt.node());Ne=rt.top-ot-ft.bottom}else Ne=K.t+K.h/2-H/2-ft.bottom-ot;ee&&(Ne=ve-(ft.top+ft.bottom)/2,pe=K.l-i.bulletPadding*K.w)}else Ne=fe._numbersTop-ot-ft.bottom;return t(pe,Ne)})})};function A(z,F,N,B){var R=N[0].trace,U=B.gauge,j=B.layer,Z=B.gaugeBg,re=B.gaugeOutline,fe=B.size,le=R.domain,ce=B.transitionOpts,V=B.onComplete,ee,ne,K,ue,te;U.enter().append("g").classed("bullet",!0),U.attr("transform",t(fe.l,fe.t)),j.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),j.selectAll("g.xbulletaxistick,path,text").remove();var H=fe.h,ae=R.gauge.bar.thickness*H,ie=le.x[0],ve=le.x[0]+(le.x[1]-le.x[0])*(R._hasNumber||R._hasDelta?1-i.bulletNumberDomainSize:1);ee=u(z,R.gauge.axis),ee._id="xbulletaxis",ee.domain=[ie,ve],ee.setScale(),ne=s.calcTicks(ee),K=s.makeTransTickFn(ee),ue=s.getTickSigns(ee)[2],te=fe.t+fe.h,ee.visible&&(s.drawTicks(z,ee,{vals:ee.ticks==="inside"?s.clipEnds(ee,ne):ne,layer:j,path:s.makeTickPath(ee,te,ue),transFn:K}),s.drawLabels(z,ee,{vals:ne,layer:j,transFn:K,labelFns:s.makeLabelFns(ee,te)}));function Ae(nt){nt.attr("width",function(Qe){return Math.max(0,ee.c2p(Qe.range[1])-ee.c2p(Qe.range[0]))}).attr("x",function(Qe){return ee.c2p(Qe.range[0])}).attr("y",function(Qe){return .5*(1-Qe.thickness)*H}).attr("height",function(Qe){return Qe.thickness*H})}var Ce=[Z].concat(R.gauge.steps),Fe=U.selectAll("g.bg-bullet").data(Ce);Fe.enter().append("g").classed("bg-bullet",!0).append("rect"),Fe.select("rect").call(Ae).call(w),Fe.exit().remove();var ze=U.selectAll("g.value-bullet").data([R.gauge.bar]);ze.enter().append("g").classed("value-bullet",!0).append("rect"),ze.select("rect").attr("height",ae).attr("y",(H-ae)/2).call(w),x(ce)?ze.select("rect").transition().duration(ce.duration).ease(ce.easing).each("end",function(){V&&V()}).each("interrupt",function(){V&&V()}).attr("width",Math.max(0,ee.c2p(Math.min(R.gauge.axis.range[1],N[0].y)))):ze.select("rect").attr("width",typeof N[0].y=="number"?Math.max(0,ee.c2p(Math.min(R.gauge.axis.range[1],N[0].y))):0),ze.exit().remove();var Ye=N.filter(function(){return R.gauge.threshold.value||R.gauge.threshold.value===0}),it=U.selectAll("g.threshold-bullet").data(Ye);it.enter().append("g").classed("threshold-bullet",!0).append("line"),it.select("line").attr("x1",ee.c2p(R.gauge.threshold.value)).attr("x2",ee.c2p(R.gauge.threshold.value)).attr("y1",(1-R.gauge.threshold.thickness)/2*H).attr("y2",(1-(1-R.gauge.threshold.thickness)/2)*H).call(d.stroke,R.gauge.threshold.line.color).style("stroke-width",R.gauge.threshold.line.width),it.exit().remove();var st=U.selectAll("g.gauge-outline").data([re]);st.enter().append("g").classed("gauge-outline",!0).append("rect"),st.select("rect").call(Ae).call(w),st.exit().remove()}function M(z,F,N,B){var R=N[0].trace,U=B.size,j=B.radius,Z=B.innerRadius,re=B.gaugeBg,fe=B.gaugeOutline,le=[U.l+U.w/2,U.t+U.h/2+j/2],ce=B.gauge,V=B.layer,ee=B.transitionOpts,ne=B.onComplete,K=Math.PI/2;function ue(Ft){var Nt=R.gauge.axis.range[0],$t=R.gauge.axis.range[1],rr=(Ft-Nt)/($t-Nt)*Math.PI-K;return rr<-K?-K:rr>K?K:rr}function te(Ft){return h.svg.arc().innerRadius((Z+j)/2-Ft/2*(j-Z)).outerRadius((Z+j)/2+Ft/2*(j-Z)).startAngle(-K)}function H(Ft){Ft.attr("d",function(Nt){return te(Nt.thickness).startAngle(ue(Nt.range[0])).endAngle(ue(Nt.range[1]))()})}var ae,ie,ve,Ae;ce.enter().append("g").classed("angular",!0),ce.attr("transform",t(le[0],le[1])),V.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),V.selectAll("g.xangularaxistick,path,text").remove(),ae=u(z,R.gauge.axis),ae.type="linear",ae.range=R.gauge.axis.range,ae._id="xangularaxis",ae.ticklabeloverflow="allow",ae.setScale();var Ce=function(Ft){return(ae.range[0]-Ft.x)/(ae.range[1]-ae.range[0])*Math.PI+Math.PI},Fe={},ze=s.makeLabelFns(ae,0),Ye=ze.labelStandoff;Fe.xFn=function(Ft){var Nt=Ce(Ft);return Math.cos(Nt)*Ye},Fe.yFn=function(Ft){var Nt=Ce(Ft),$t=Math.sin(Nt)>0?.2:1;return-Math.sin(Nt)*(Ye+Ft.fontSize*$t)+Math.abs(Math.cos(Nt))*(Ft.fontSize*o)},Fe.anchorFn=function(Ft){var Nt=Ce(Ft),$t=Math.cos(Nt);return Math.abs($t)<.1?"middle":$t>0?"start":"end"},Fe.heightFn=function(Ft,Nt,$t){var rr=Ce(Ft);return-.5*(1+Math.sin(rr))*$t};var it=function(Ft){return t(le[0]+j*Math.cos(Ft),le[1]-j*Math.sin(Ft))};ve=function(Ft){return it(Ce(Ft))};var st=function(Ft){var Nt=Ce(Ft);return it(Nt)+"rotate("+-r(Nt)+")"};if(ie=s.calcTicks(ae),Ae=s.getTickSigns(ae)[2],ae.visible){Ae=ae.ticks==="inside"?-1:1;var nt=(ae.linewidth||1)/2;s.drawTicks(z,ae,{vals:ie,layer:V,path:"M"+Ae*nt+",0h"+Ae*ae.ticklen,transFn:st}),s.drawLabels(z,ae,{vals:ie,layer:V,transFn:ve,labelFns:Fe})}var Qe=[re].concat(R.gauge.steps),Le=ce.selectAll("g.bg-arc").data(Qe);Le.enter().append("g").classed("bg-arc",!0).append("path"),Le.select("path").call(H).call(w),Le.exit().remove();var Te=te(R.gauge.bar.thickness),pe=ce.selectAll("g.value-arc").data([R.gauge.bar]);pe.enter().append("g").classed("value-arc",!0).append("path");var Ne=pe.select("path");x(ee)?(Ne.transition().duration(ee.duration).ease(ee.easing).each("end",function(){ne&&ne()}).each("interrupt",function(){ne&&ne()}).attrTween("d",m(Te,ue(N[0].lastY),ue(N[0].y))),R._lastValue=N[0].y):Ne.attr("d",typeof N[0].y=="number"?Te.endAngle(ue(N[0].y)):"M0,0Z"),Ne.call(w),pe.exit().remove(),Qe=[];var ot=R.gauge.threshold.value;(ot||ot===0)&&Qe.push({range:[ot,ot],color:R.gauge.threshold.color,line:{color:R.gauge.threshold.line.color,width:R.gauge.threshold.line.width},thickness:R.gauge.threshold.thickness});var ft=ce.selectAll("g.threshold-arc").data(Qe);ft.enter().append("g").classed("threshold-arc",!0).append("path"),ft.select("path").call(H).call(w),ft.exit().remove();var rt=ce.selectAll("g.gauge-outline").data([fe]);rt.enter().append("g").classed("gauge-outline",!0).append("path"),rt.select("path").call(H).call(w),rt.exit().remove()}function _(z,F,N,B){var R=N[0].trace,U=B.numbersX,j=B.numbersY,Z=R.align||"center",re=T[Z],fe=B.transitionOpts,le=B.onComplete,ce=E.ensureSingle(F,"g","numbers"),V,ee,ne,K=[];R._hasNumber&&K.push("number"),R._hasDelta&&(K.push("delta"),R.delta.position==="left"&&K.reverse());var ue=ce.selectAll("text").data(K);ue.enter().append("text"),ue.attr("text-anchor",function(){return re}).attr("class",function(it){return it}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),ue.exit().remove();function te(it,st,nt,Qe){if(it.match("s")&&nt>=0!=Qe>=0&&!st(nt).slice(-1).match(g)&&!st(Qe).slice(-1).match(g)){var Le=it.slice().replace("s","f").replace(/\d+/,function(pe){return parseInt(pe)-1}),Te=u(z,{tickformat:Le});return function(pe){return Math.abs(pe)<1?s.tickText(Te,pe).text:st(pe)}}else return st}function H(){var it=u(z,{tickformat:R.number.valueformat},R._range);it.setScale(),s.prepTicks(it);var st=function(pe){return s.tickText(it,pe).text},nt=R.number.suffix,Qe=R.number.prefix,Le=ce.select("text.number");function Te(){var pe=typeof N[0].y=="number"?Qe+st(N[0].y)+nt:"-";Le.text(pe).call(n.font,R.number.font).call(a.convertToTspans,z)}return x(fe)?Le.transition().duration(fe.duration).ease(fe.easing).each("end",function(){Te(),le&&le()}).each("interrupt",function(){Te(),le&&le()}).attrTween("text",function(){var pe=h.select(this),Ne=S(N[0].lastY,N[0].y);R._lastValue=N[0].y;var ot=te(R.number.valueformat,st,N[0].lastY,N[0].y);return function(ft){pe.text(Qe+ot(Ne(ft))+nt)}}):Te(),V=I(Qe+st(N[0].y)+nt,R.number.font,re,z),Le}function ae(){var it=u(z,{tickformat:R.delta.valueformat},R._range);it.setScale(),s.prepTicks(it);var st=function(ft){return s.tickText(it,ft).text},nt=R.delta.suffix,Qe=R.delta.prefix,Le=function(ft){var rt=R.delta.relative?ft.relativeDelta:ft.delta;return rt},Te=function(ft,rt){return ft===0||typeof ft!="number"||isNaN(ft)?"-":(ft>0?R.delta.increasing.symbol:R.delta.decreasing.symbol)+Qe+rt(ft)+nt},pe=function(ft){return ft.delta>=0?R.delta.increasing.color:R.delta.decreasing.color};R._deltaLastValue===void 0&&(R._deltaLastValue=Le(N[0]));var Ne=ce.select("text.delta");Ne.call(n.font,R.delta.font).call(d.fill,pe({delta:R._deltaLastValue}));function ot(){Ne.text(Te(Le(N[0]),st)).call(d.fill,pe(N[0])).call(a.convertToTspans,z)}return x(fe)?Ne.transition().duration(fe.duration).ease(fe.easing).tween("text",function(){var ft=h.select(this),rt=Le(N[0]),Ft=R._deltaLastValue,Nt=te(R.delta.valueformat,st,Ft,rt),$t=S(Ft,rt);return R._deltaLastValue=rt,function(rr){ft.text(Te($t(rr),Nt)),ft.call(d.fill,pe({delta:$t(rr)}))}}).each("end",function(){ot(),le&&le()}).each("interrupt",function(){ot(),le&&le()}):ot(),ee=I(Te(Le(N[0]),st),R.delta.font,re,z),Ne}var ie=R.mode+R.align,ve;if(R._hasDelta&&(ve=ae(),ie+=R.delta.position+R.delta.font.size+R.delta.font.family+R.delta.valueformat,ie+=R.delta.increasing.symbol+R.delta.decreasing.symbol,ne=ee),R._hasNumber&&(H(),ie+=R.number.font.size+R.number.font.family+R.number.valueformat+R.number.suffix+R.number.prefix,ne=V),R._hasDelta&&R._hasNumber){var Ae=[(V.left+V.right)/2,(V.top+V.bottom)/2],Ce=[(ee.left+ee.right)/2,(ee.top+ee.bottom)/2],Fe,ze,Ye=.75*R.delta.font.size;R.delta.position==="left"&&(Fe=L(R,"deltaPos",0,-1*(V.width*l[R.align]+ee.width*(1-l[R.align])+Ye),ie,Math.min),ze=Ae[1]-Ce[1],ne={width:V.width+ee.width+Ye,height:Math.max(V.height,ee.height),left:ee.left+Fe,right:V.right,top:Math.min(V.top,ee.top+ze),bottom:Math.max(V.bottom,ee.bottom+ze)}),R.delta.position==="right"&&(Fe=L(R,"deltaPos",0,V.width*(1-l[R.align])+ee.width*l[R.align]+Ye,ie,Math.max),ze=Ae[1]-Ce[1],ne={width:V.width+ee.width+Ye,height:Math.max(V.height,ee.height),left:V.left,right:ee.right+Fe,top:Math.min(V.top,ee.top+ze),bottom:Math.max(V.bottom,ee.bottom+ze)}),R.delta.position==="bottom"&&(Fe=null,ze=ee.height,ne={width:Math.max(V.width,ee.width),height:V.height+ee.height,left:Math.min(V.left,ee.left),right:Math.max(V.right,ee.right),top:V.bottom-V.height,bottom:V.bottom+ee.height}),R.delta.position==="top"&&(Fe=null,ze=V.top,ne={width:Math.max(V.width,ee.width),height:V.height+ee.height,left:Math.min(V.left,ee.left),right:Math.max(V.right,ee.right),top:V.bottom-V.height-ee.height,bottom:V.bottom}),ve.attr({dx:Fe,dy:ze})}(R._hasNumber||R._hasDelta)&&ce.attr("transform",function(){var it=B.numbersScaler(ne);ie+=it[2];var st=L(R,"numbersScale",1,it[0],ie,Math.min),nt;R._scaleNumbers||(st=1),R._isAngular?nt=j-st*ne.bottom:nt=j-st*(ne.top+ne.bottom)/2,R._numbersTop=st*ne.top+nt;var Qe=ne[Z];Z==="center"&&(Qe=(ne.left+ne.right)/2);var Le=U-st*Qe;return Le=L(R,"numbersTranslate",0,Le,ie,Math.max),t(Le,nt)+e(st)})}function w(z){z.each(function(F){d.stroke(h.select(this),F.line.color)}).each(function(F){d.fill(h.select(this),F.color)}).style("stroke-width",function(F){return F.line.width})}function m(z,F,N){return function(){var B=b(F,N);return function(R){return z.endAngle(B(R))()}}}function u(z,F,N){var B=z._fullLayout,R=E.extendFlat({type:"linear",ticks:"outside",range:N,showline:!0},F),U={type:"linear",_id:"x"+F._id},j={letter:"x",font:B.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function Z(re,fe){return E.coerce(R,U,p,re,fe)}return f(R,U,Z,j,B),c(R,U,Z,j),U}function v(z,F,N){var B=Math.min(F/z.width,N/z.height);return[B,z,F+"x"+N]}function y(z,F){var N=Math.sqrt(z.width/2*(z.width/2)+z.height*z.height),B=F/N;return[B,z,F]}function I(z,F,N,B){var R=document.createElementNS("http://www.w3.org/2000/svg","text"),U=h.select(R);return U.text(z).attr("x",0).attr("y",0).attr("text-anchor",N).attr("data-unformatted",z).call(a.convertToTspans,B).call(n.font,F),n.bBox(U.node())}function L(z,F,N,B,R,U){var j="_cache"+F;z[j]&&z[j].key===R||(z[j]={key:R,value:N});var Z=E.aggNums(U,null,[z[j].value,B],2);return z[j].value=Z,Z}}}),jz=Ge({"src/traces/indicator/index.js"($,G){G.exports={moduleType:"trace",name:"indicator",basePlotModule:Fz(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:nL(),supplyDefaults:Bz().supplyDefaults,calc:Nz().calc,plot:Uz(),meta:{}}}}),qz=Ge({"lib/indicator.js"($,G){G.exports=jz()}}),iL=Ge({"src/traces/table/attributes.js"($,G){var h=lm(),b=Qi().extendFlat,S=Uc().overrideAll,E=Fs(),e=Sc().attributes,t=hc().descriptionOnlyNumbers;G.exports=S({domain:e({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:b({},h.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:b({},E({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:b({},h.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:b({},E({arrayOk:!0}))}},"calc","from-root")}}),Vz=Ge({"src/traces/table/defaults.js"($,G){var h=yn(),b=iL(),S=Sc().defaults;function E(e,t){for(var r=e.columnorder||[],o=e.header.values.length,n=r.slice(0,o),i=n.slice().sort(function(f,c){return f-c}),a=n.map(function(f){return i.indexOf(f)}),s=a.length;s",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),Gz=Ge({"src/traces/table/data_preparation_helper.js"($,G){var h=oL(),b=Qi().extendFlat,S=Ga(),E=ro().isTypedArray,e=ro().isArrayOrTypedArray;G.exports=function(p,d){var T=o(d.cells.values),l=function(re){return re.slice(d.header.values.length,re.length)},g=o(d.header.values);g.length&&!g[0].length&&(g[0]=[""],g=o(g));var x=g.concat(l(T).map(function(){return n((g[0]||[""]).length)})),A=d.domain,M=Math.floor(p._fullLayout._size.w*(A.x[1]-A.x[0])),_=Math.floor(p._fullLayout._size.h*(A.y[1]-A.y[0])),w=d.header.values.length?x[0].map(function(){return d.header.height}):[h.emptyHeaderHeight],m=T.length?T[0].map(function(){return d.cells.height}):[],u=w.reduce(r,0),v=_-u,y=v+h.uplift,I=s(m,y),L=s(w,u),z=a(L,[]),F=a(I,z),N={},B=d._fullInput.columnorder;e(B)&&(B=Array.from(B)),B=B.concat(l(T.map(function(re,fe){return fe})));var R=x.map(function(re,fe){var le=e(d.columnwidth)?d.columnwidth[Math.min(fe,d.columnwidth.length-1)]:d.columnwidth;return S(le)?Number(le):1}),U=R.reduce(r,0);R=R.map(function(re){return re/U*M});var j=Math.max(t(d.header.line.width),t(d.cells.line.width)),Z={key:d.uid+p._context.staticPlot,translateX:A.x[0]*p._fullLayout._size.w,translateY:p._fullLayout._size.h*(1-A.y[1]),size:p._fullLayout._size,width:M,maxLineWidth:j,height:_,columnOrder:B,groupHeight:_,rowBlocks:F,headerRowBlocks:z,scrollY:0,cells:b({},d.cells,{values:T}),headerCells:b({},d.header,{values:x}),gdColumns:x.map(function(re){return re[0]}),gdColumnsOriginalOrder:x.map(function(re){return re[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:x.map(function(re,fe){var le=N[re];N[re]=(le||0)+1;var ce=re+"__"+N[re];return{key:ce,label:re,specIndex:fe,xIndex:B[fe],xScale:i,x:void 0,calcdata:void 0,columnWidth:R[fe]}})};return Z.columns.forEach(function(re){re.calcdata=Z,re.x=i(re)}),Z};function t(c){if(e(c)){for(var p=0,d=0;d=p||_===c.length-1)&&(d[l]=x,x.key=M++,x.firstRowIndex=A,x.lastRowIndex=_,x=f(),l+=g,A=_+1,g=0);return d}function f(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),Xz=Ge({"src/traces/table/data_split_helpers.js"($){var G=Qi().extendFlat;$.splitToPanels=function(b){var S=[0,0],E=G({},b,{key:"header",type:"header",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!0,values:b.calcdata.headerCells.values[b.specIndex],rowBlocks:b.calcdata.headerRowBlocks,calcdata:G({},b.calcdata,{cells:b.calcdata.headerCells})}),e=G({},b,{key:"cells1",type:"cells",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:b.calcdata.cells.values[b.specIndex],rowBlocks:b.calcdata.rowBlocks}),t=G({},b,{key:"cells2",type:"cells",page:1,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:b.calcdata.cells.values[b.specIndex],rowBlocks:b.calcdata.rowBlocks});return[e,t,E]},$.splitToCells=function(b){var S=h(b);return(b.values||[]).slice(S[0],S[1]).map(function(E,e){var t=typeof E=="string"&&E.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:e+t,key:S[0]+e,column:b,calcdata:b.calcdata,page:b.page,rowBlocks:b.rowBlocks,value:E}})};function h(b){var S=b.rowBlocks[b.page],E=S?S.rows[0].rowIndex:0,e=S?E+S.rows.length:0;return[E,e]}}}),sL=Ge({"src/traces/table/plot.js"($,G){var h=oL(),b=Za(),S=yn(),E=S.numberFormat,e=Dg(),t=Ms(),r=ec(),o=yn().raiseToTop,n=yn().strTranslate,i=yn().cancelTransition,a=Gz(),s=Xz(),f=So();G.exports=function(ie,ve){var Ae=!ie._context.staticPlot,Ce=ie._fullLayout._paper.selectAll("."+h.cn.table).data(ve.map(function(rt){var Ft=e.unwrap(rt),Nt=Ft.trace;return a(ie,Nt)}),e.keyFun);Ce.exit().remove(),Ce.enter().append("g").classed(h.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Ce.attr("width",function(rt){return rt.width+rt.size.l+rt.size.r}).attr("height",function(rt){return rt.height+rt.size.t+rt.size.b}).attr("transform",function(rt){return n(rt.translateX,rt.translateY)});var Fe=Ce.selectAll("."+h.cn.tableControlView).data(e.repeat,e.keyFun),ze=Fe.enter().append("g").classed(h.cn.tableControlView,!0).style("box-sizing","content-box");if(Ae){var Ye="onwheel"in document?"wheel":"mousewheel";ze.on("mousemove",function(rt){Fe.filter(function(Ft){return rt===Ft}).call(l,ie)}).on(Ye,function(rt){if(!rt.scrollbarState.wheeling){rt.scrollbarState.wheeling=!0;var Ft=rt.scrollY+b.event.deltaY,Nt=re(ie,Fe,null,Ft)(rt);Nt||(b.event.stopPropagation(),b.event.preventDefault()),rt.scrollbarState.wheeling=!1}}).call(l,ie,!0)}Fe.attr("transform",function(rt){return n(rt.size.l,rt.size.t)});var it=Fe.selectAll("."+h.cn.scrollBackground).data(e.repeat,e.keyFun);it.enter().append("rect").classed(h.cn.scrollBackground,!0).attr("fill","none"),it.attr("width",function(rt){return rt.width}).attr("height",function(rt){return rt.height}),Fe.each(function(rt){t.setClipUrl(b.select(this),p(ie,rt),ie)});var st=Fe.selectAll("."+h.cn.yColumn).data(function(rt){return rt.columns},e.keyFun);st.enter().append("g").classed(h.cn.yColumn,!0),st.exit().remove(),st.attr("transform",function(rt){return n(rt.x,0)}),Ae&&st.call(b.behavior.drag().origin(function(rt){var Ft=b.select(this);return N(Ft,rt,-h.uplift),o(this),rt.calcdata.columnDragInProgress=!0,l(Fe.filter(function(Nt){return rt.calcdata.key===Nt.key}),ie),rt}).on("drag",function(rt){var Ft=b.select(this),Nt=function(Er){return(rt===Er?b.event.x:Er.x)+Er.columnWidth/2};rt.x=Math.max(-h.overdrag,Math.min(rt.calcdata.width+h.overdrag-rt.columnWidth,b.event.x));var $t=T(st).filter(function(Er){return Er.calcdata.key===rt.calcdata.key}),rr=$t.sort(function(Er,Mr){return Nt(Er)-Nt(Mr)});rr.forEach(function(Er,Mr){Er.xIndex=Mr,Er.x=rt===Er?Er.x:Er.xScale(Er)}),st.filter(function(Er){return rt!==Er}).transition().ease(h.transitionEase).duration(h.transitionDuration).attr("transform",function(Er){return n(Er.x,0)}),Ft.call(i).attr("transform",n(rt.x,-h.uplift))}).on("dragend",function(rt){var Ft=b.select(this),Nt=rt.calcdata;rt.x=rt.xScale(rt),rt.calcdata.columnDragInProgress=!1,N(Ft,rt,0),z(ie,Nt,Nt.columns.map(function($t){return $t.xIndex}))})),st.each(function(rt){t.setClipUrl(b.select(this),d(ie,rt),ie)});var nt=st.selectAll("."+h.cn.columnBlock).data(s.splitToPanels,e.keyFun);nt.enter().append("g").classed(h.cn.columnBlock,!0).attr("id",function(rt){return rt.key}),nt.style("cursor",function(rt){return rt.dragHandle?"ew-resize":rt.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var Qe=nt.filter(R),Le=nt.filter(B);Ae&&Le.call(b.behavior.drag().origin(function(rt){return b.event.stopPropagation(),rt}).on("drag",re(ie,Fe,-1)).on("dragend",function(){})),g(ie,Fe,Qe,nt),g(ie,Fe,Le,nt);var Te=Fe.selectAll("."+h.cn.scrollAreaClip).data(e.repeat,e.keyFun);Te.enter().append("clipPath").classed(h.cn.scrollAreaClip,!0).attr("id",function(rt){return p(ie,rt)});var pe=Te.selectAll("."+h.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);pe.enter().append("rect").classed(h.cn.scrollAreaClipRect,!0).attr("x",-h.overdrag).attr("y",-h.uplift).attr("fill","none"),pe.attr("width",function(rt){return rt.width+2*h.overdrag}).attr("height",function(rt){return rt.height+h.uplift});var Ne=st.selectAll("."+h.cn.columnBoundary).data(e.repeat,e.keyFun);Ne.enter().append("g").classed(h.cn.columnBoundary,!0);var ot=st.selectAll("."+h.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);ot.enter().append("clipPath").classed(h.cn.columnBoundaryClippath,!0),ot.attr("id",function(rt){return d(ie,rt)});var ft=ot.selectAll("."+h.cn.columnBoundaryRect).data(e.repeat,e.keyFun);ft.enter().append("rect").classed(h.cn.columnBoundaryRect,!0).attr("fill","none"),ft.attr("width",function(rt){return rt.columnWidth+2*c(rt)}).attr("height",function(rt){return rt.calcdata.height+2*c(rt)+h.uplift}).attr("x",function(rt){return-c(rt)}).attr("y",function(rt){return-c(rt)}),Z(null,Le,Fe)};function c(ae){return Math.ceil(ae.calcdata.maxLineWidth/2)}function p(ae,ie){return"clip"+ae._fullLayout._uid+"_scrollAreaBottomClip_"+ie.key}function d(ae,ie){return"clip"+ae._fullLayout._uid+"_columnBoundaryClippath_"+ie.calcdata.key+"_"+ie.specIndex}function T(ae){return[].concat.apply([],ae.map(function(ie){return ie})).map(function(ie){return ie.__data__})}function l(ae,ie,ve){function Ae(st){var nt=st.rowBlocks;return ne(nt,nt.length-1)+(nt.length?K(nt[nt.length-1],1/0):1)}var Ce=ae.selectAll("."+h.cn.scrollbarKit).data(e.repeat,e.keyFun);Ce.enter().append("g").classed(h.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Ce.each(function(st){var nt=st.scrollbarState;nt.totalHeight=Ae(st),nt.scrollableAreaHeight=st.groupHeight-U(st),nt.currentlyVisibleHeight=Math.min(nt.totalHeight,nt.scrollableAreaHeight),nt.ratio=nt.currentlyVisibleHeight/nt.totalHeight,nt.barLength=Math.max(nt.ratio*nt.currentlyVisibleHeight,h.goldenRatio*h.scrollbarWidth),nt.barWiggleRoom=nt.currentlyVisibleHeight-nt.barLength,nt.wiggleRoom=Math.max(0,nt.totalHeight-nt.scrollableAreaHeight),nt.topY=nt.barWiggleRoom===0?0:st.scrollY/nt.wiggleRoom*nt.barWiggleRoom,nt.bottomY=nt.topY+nt.barLength,nt.dragMultiplier=nt.wiggleRoom/nt.barWiggleRoom}).attr("transform",function(st){var nt=st.width+h.scrollbarWidth/2+h.scrollbarOffset;return n(nt,U(st))});var Fe=Ce.selectAll("."+h.cn.scrollbar).data(e.repeat,e.keyFun);Fe.enter().append("g").classed(h.cn.scrollbar,!0);var ze=Fe.selectAll("."+h.cn.scrollbarSlider).data(e.repeat,e.keyFun);ze.enter().append("g").classed(h.cn.scrollbarSlider,!0),ze.attr("transform",function(st){return n(0,st.scrollbarState.topY||0)});var Ye=ze.selectAll("."+h.cn.scrollbarGlyph).data(e.repeat,e.keyFun);Ye.enter().append("line").classed(h.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",h.scrollbarWidth).attr("stroke-linecap","round").attr("y1",h.scrollbarWidth/2),Ye.attr("y2",function(st){return st.scrollbarState.barLength-h.scrollbarWidth/2}).attr("stroke-opacity",function(st){return st.columnDragInProgress||!st.scrollbarState.barWiggleRoom||ve?0:.4}),Ye.transition().delay(0).duration(0),Ye.transition().delay(h.scrollbarHideDelay).duration(h.scrollbarHideDuration).attr("stroke-opacity",0);var it=Fe.selectAll("."+h.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);it.enter().append("line").classed(h.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",h.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(st){var nt=b.event.y,Qe=this.getBoundingClientRect(),Le=st.scrollbarState,Te=nt-Qe.top,pe=b.scale.linear().domain([0,Le.scrollableAreaHeight]).range([0,Le.totalHeight]).clamp(!0);Le.topY<=Te&&Te<=Le.bottomY||re(ie,ae,null,pe(Te-Le.barLength/2))(st)}).call(b.behavior.drag().origin(function(st){return b.event.stopPropagation(),st.scrollbarState.scrollbarScrollInProgress=!0,st}).on("drag",re(ie,ae)).on("dragend",function(){})),it.attr("y2",function(st){return st.scrollbarState.scrollableAreaHeight}),ie._context.staticPlot&&(Ye.remove(),it.remove())}function g(ae,ie,ve,Ae){var Ce=x(ve),Fe=A(Ce);m(Fe);var ze=M(Fe);v(ze);var Ye=w(Fe),it=_(Ye);u(it),y(it,ie,Ae,ae),ee(Fe)}function x(ae){var ie=ae.selectAll("."+h.cn.columnCells).data(e.repeat,e.keyFun);return ie.enter().append("g").classed(h.cn.columnCells,!0),ie.exit().remove(),ie}function A(ae){var ie=ae.selectAll("."+h.cn.columnCell).data(s.splitToCells,function(ve){return ve.keyWithinBlock});return ie.enter().append("g").classed(h.cn.columnCell,!0),ie.exit().remove(),ie}function M(ae){var ie=ae.selectAll("."+h.cn.cellRect).data(e.repeat,function(ve){return ve.keyWithinBlock});return ie.enter().append("rect").classed(h.cn.cellRect,!0),ie}function _(ae){var ie=ae.selectAll("."+h.cn.cellText).data(e.repeat,function(ve){return ve.keyWithinBlock});return ie.enter().append("text").classed(h.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){b.event.stopPropagation()}),ie}function w(ae){var ie=ae.selectAll("."+h.cn.cellTextHolder).data(e.repeat,function(ve){return ve.keyWithinBlock});return ie.enter().append("g").classed(h.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),ie}function m(ae){ae.each(function(ie,ve){var Ae=ie.calcdata.cells.font,Ce=ie.column.specIndex,Fe={size:F(Ae.size,Ce,ve),color:F(Ae.color,Ce,ve),family:F(Ae.family,Ce,ve),weight:F(Ae.weight,Ce,ve),style:F(Ae.style,Ce,ve),variant:F(Ae.variant,Ce,ve),textcase:F(Ae.textcase,Ce,ve),lineposition:F(Ae.lineposition,Ce,ve),shadow:F(Ae.shadow,Ce,ve)};ie.rowNumber=ie.key,ie.align=F(ie.calcdata.cells.align,Ce,ve),ie.cellBorderWidth=F(ie.calcdata.cells.line.width,Ce,ve),ie.font=Fe})}function u(ae){ae.each(function(ie){t.font(b.select(this),ie.font)})}function v(ae){ae.attr("width",function(ie){return ie.column.columnWidth}).attr("stroke-width",function(ie){return ie.cellBorderWidth}).each(function(ie){var ve=b.select(this);f.stroke(ve,F(ie.calcdata.cells.line.color,ie.column.specIndex,ie.rowNumber)),f.fill(ve,F(ie.calcdata.cells.fill.color,ie.column.specIndex,ie.rowNumber))})}function y(ae,ie,ve,Ae){ae.text(function(Ce){var Fe=Ce.column.specIndex,ze=Ce.rowNumber,Ye=Ce.value,it=typeof Ye=="string",st=it&&Ye.match(/
/i),nt=!it||st;Ce.mayHaveMarkup=it&&Ye.match(/[<&>]/);var Qe=I(Ye);Ce.latex=Qe;var Le=Qe?"":F(Ce.calcdata.cells.prefix,Fe,ze)||"",Te=Qe?"":F(Ce.calcdata.cells.suffix,Fe,ze)||"",pe=Qe?null:F(Ce.calcdata.cells.format,Fe,ze)||null,Ne=Le+(pe?E(pe)(Ce.value):Ce.value)+Te,ot;Ce.wrappingNeeded=!Ce.wrapped&&!nt&&!Qe&&(ot=L(Ne)),Ce.cellHeightMayIncrease=st||Qe||Ce.mayHaveMarkup||(ot===void 0?L(Ne):ot),Ce.needsConvertToTspans=Ce.mayHaveMarkup||Ce.wrappingNeeded||Ce.latex;var ft;if(Ce.wrappingNeeded){var rt=h.wrapSplitCharacter===" "?Ne.replace(/Ce&&Ae.push(Fe),Ce+=it}return Ae}function Z(ae,ie,ve){var Ae=T(ie)[0];if(Ae!==void 0){var Ce=Ae.rowBlocks,Fe=Ae.calcdata,ze=ne(Ce,Ce.length),Ye=Ae.calcdata.groupHeight-U(Ae),it=Fe.scrollY=Math.max(0,Math.min(ze-Ye,Fe.scrollY)),st=j(Ce,it,Ye);st.length===1&&(st[0]===Ce.length-1?st.unshift(st[0]-1):st.push(st[0]+1)),st[0]%2&&st.reverse(),ie.each(function(nt,Qe){nt.page=st[Qe],nt.scrollY=it}),ie.attr("transform",function(nt){var Qe=ne(nt.rowBlocks,nt.page)-nt.scrollY;return n(0,Qe)}),ae&&(fe(ae,ve,ie,st,Ae.prevPages,Ae,0),fe(ae,ve,ie,st,Ae.prevPages,Ae,1),l(ve,ae))}}function re(ae,ie,ve,Ae){return function(Fe){var ze=Fe.calcdata?Fe.calcdata:Fe,Ye=ie.filter(function(Qe){return ze.key===Qe.key}),it=ve||ze.scrollbarState.dragMultiplier,st=ze.scrollY;ze.scrollY=Ae===void 0?ze.scrollY+it*b.event.dy:Ae;var nt=Ye.selectAll("."+h.cn.yColumn).selectAll("."+h.cn.columnBlock).filter(B);return Z(ae,nt,Ye),ze.scrollY===st}}function fe(ae,ie,ve,Ae,Ce,Fe,ze){var Ye=Ae[ze]!==Ce[ze];Ye&&(clearTimeout(Fe.currentRepaint[ze]),Fe.currentRepaint[ze]=setTimeout(function(){var it=ve.filter(function(st,nt){return nt===ze&&Ae[nt]!==Ce[nt]});g(ae,ie,it,ve),Ce[ze]=Ae[ze]}))}function le(ae,ie,ve,Ae){return function(){var Fe=b.select(ie.parentNode);Fe.each(function(ze){var Ye=ze.fragments;Fe.selectAll("tspan.line").each(function(Ne,ot){Ye[ot].width=this.getComputedTextLength()});var it=Ye[Ye.length-1].width,st=Ye.slice(0,-1),nt=[],Qe,Le,Te=0,pe=ze.column.columnWidth-2*h.cellPad;for(ze.value="";st.length;)Qe=st.shift(),Le=Qe.width+it,Te+Le>pe&&(ze.value+=nt.join(h.wrapSpacer)+h.lineBreaker,nt=[],Te=0),nt.push(Qe.text),Te+=Le;Te&&(ze.value+=nt.join(h.wrapSpacer)),ze.wrapped=!0}),Fe.selectAll("tspan.line").remove(),y(Fe.select("."+h.cn.cellText),ve,ae,Ae),b.select(ie.parentNode.parentNode).call(ee)}}function ce(ae,ie,ve,Ae,Ce){return function(){if(!Ce.settledY){var ze=b.select(ie.parentNode),Ye=te(Ce),it=Ce.key-Ye.firstRowIndex,st=Ye.rows[it].rowHeight,nt=Ce.cellHeightMayIncrease?ie.parentNode.getBoundingClientRect().height+2*h.cellPad:st,Qe=Math.max(nt,st),Le=Qe-Ye.rows[it].rowHeight;Le&&(Ye.rows[it].rowHeight=Qe,ae.selectAll("."+h.cn.columnCell).call(ee),Z(null,ae.filter(B),0),l(ve,Ae,!0)),ze.attr("transform",function(){var Te=this,pe=Te.parentNode,Ne=pe.getBoundingClientRect(),ot=b.select(Te.parentNode).select("."+h.cn.cellRect).node().getBoundingClientRect(),ft=Te.transform.baseVal.consolidate(),rt=ot.top-Ne.top+(ft?ft.matrix.f:h.cellPad);return n(V(Ce,b.select(Te.parentNode).select("."+h.cn.cellTextHolder).node().getBoundingClientRect().width),rt)}),Ce.settledY=!0}}}function V(ae,ie){switch(ae.align){case"left":return h.cellPad;case"right":return ae.column.columnWidth-(ie||0)-h.cellPad;case"center":return(ae.column.columnWidth-(ie||0))/2;default:return h.cellPad}}function ee(ae){ae.attr("transform",function(ie){var ve=ie.rowBlocks[0].auxiliaryBlocks.reduce(function(ze,Ye){return ze+K(Ye,1/0)},0),Ae=te(ie),Ce=K(Ae,ie.key),Fe=Ce+ve;return n(0,Fe)}).selectAll("."+h.cn.cellRect).attr("height",function(ie){return H(te(ie),ie.key).rowHeight})}function ne(ae,ie){for(var ve=0,Ae=ie-1;Ae>=0;Ae--)ve+=ue(ae[Ae]);return ve}function K(ae,ie){for(var ve=0,Ae=0;AeE.length&&(S=S.slice(0,E.length)):S=[],t=0;t90&&(p-=180,i=-i),{angle:p,flip:i,p:b.c2p(e,S,E),offsetMultplier:a}}}}),r7=Ge({"src/traces/carpet/plot.js"($,G){var h=Za(),b=Ms(),S=lL(),E=uL(),e=t7(),t=ec(),r=yn(),o=r.strRotate,n=r.strTranslate,i=ev();G.exports=function(g,x,A,M){var _=g._context.staticPlot,w=x.xaxis,m=x.yaxis,u=g._fullLayout,v=u._clips;r.makeTraceGroups(M,A,"trace").each(function(y){var I=h.select(this),L=y[0],z=L.trace,F=z.aaxis,N=z.baxis,B=r.ensureSingle(I,"g","minorlayer"),R=r.ensureSingle(I,"g","majorlayer"),U=r.ensureSingle(I,"g","boundarylayer"),j=r.ensureSingle(I,"g","labellayer");I.style("opacity",z.opacity),s(w,m,R,F,"a",F._gridlines,!0),s(w,m,R,N,"b",N._gridlines,!0),s(w,m,B,F,"a",F._minorgridlines,!0),s(w,m,B,N,"b",N._minorgridlines,!0),s(w,m,U,F,"a-boundary",F._boundarylines,_),s(w,m,U,N,"b-boundary",N._boundarylines,_);var Z=f(g,w,m,z,L,j,F._labels,"a-label"),re=f(g,w,m,z,L,j,N._labels,"b-label");c(g,j,z,L,w,m,Z,re),a(z,L,v,w,m)})};function a(l,g,x,A,M){var _,w,m,u,v=x.select("#"+l._clipPathId);v.size()||(v=x.append("clipPath").classed("carpetclip",!0));var y=r.ensureSingle(v,"path","carpetboundary"),I=g.clipsegments,L=[];for(u=0;u0?"start":"end","data-notex":1}).call(b.font,I.font).text(I.text).call(t.convertToTspans,l),R=b.bBox(this);B.attr("transform",n(z.p[0],z.p[1])+o(z.angle)+n(I.axis.labelpadding*N,R.height*.3)),v=Math.max(v,R.width+I.axis.labelpadding)}),u.exit().remove(),y.maxExtent=v,y}function c(l,g,x,A,M,_,w,m){var u,v,y,I,L=r.aggNums(Math.min,null,x.a),z=r.aggNums(Math.max,null,x.a),F=r.aggNums(Math.min,null,x.b),N=r.aggNums(Math.max,null,x.b);u=.5*(L+z),v=F,y=x.ab2xy(u,v,!0),I=x.dxyda_rough(u,v),w.angle===void 0&&r.extendFlat(w,e(x,M,_,y,x.dxydb_rough(u,v))),T(l,g,x,A,y,I,x.aaxis,M,_,w,"a-title"),u=L,v=.5*(F+N),y=x.ab2xy(u,v,!0),I=x.dxydb_rough(u,v),m.angle===void 0&&r.extendFlat(m,e(x,M,_,y,x.dxyda_rough(u,v))),T(l,g,x,A,y,I,x.baxis,M,_,m,"b-title")}var p=i.LINE_SPACING,d=(1-i.MID_SHIFT)/p+1;function T(l,g,x,A,M,_,w,m,u,v,y){var I=[];w.title.text&&I.push(w.title.text);var L=g.selectAll("text."+y).data(I),z=v.maxExtent;L.enter().append("text").classed(y,!0),L.each(function(){var F=e(x,m,u,M,_);["start","both"].indexOf(w.showticklabels)===-1&&(z=0);var N=w.title.font.size;z+=N+w.title.offset;var B=v.angle+(v.flip<0?180:0),R=(B-F.angle+450)%360,U=R>90&&R<270,j=h.select(this);j.text(w.title.text).call(t.convertToTspans,l),U&&(z=(-t.lineCount(j)+d)*p*N-z),j.attr("transform",n(F.p[0],F.p[1])+o(F.angle)+n(0,z)).attr("text-anchor","middle").call(b.font,w.title.font)}),L.exit().remove()}}}),n7=Ge({"src/traces/carpet/cheater_basis.js"($,G){var h=yn().isArrayOrTypedArray;G.exports=function(b,S,E){var e,t,r,o,n,i,a=[],s=h(b)?b.length:b,f=h(S)?S.length:S,c=h(b)?b:null,p=h(S)?S:null;c&&(r=(c.length-1)/(c[c.length-1]-c[0])/(s-1)),p&&(o=(p.length-1)/(p[p.length-1]-p[0])/(f-1));var d,T=1/0,l=-1/0;for(t=0;t=10)return null;for(var e=1/0,t=-1/0,r=S.length,o=0;o0&&(K=E.dxydi([],Z-1,fe,0,le),ae.push(ce[0]+K[0]/3),ie.push(ce[1]+K[1]/3),ue=E.dxydi([],Z-1,fe,1,le),ae.push(ne[0]-ue[0]/3),ie.push(ne[1]-ue[1]/3)),ae.push(ne[0]),ie.push(ne[1]),ce=ne;else for(Z=E.a2i(j),V=Math.floor(Math.max(0,Math.min(F-2,Z))),ee=Z-V,ve.length=F,ve.crossLength=N,ve.xy=function(Ae){return E.evalxy([],Z,Ae)},ve.dxy=function(Ae,Ce){return E.dxydj([],V,Ae,ee,Ce)},re=0;re0&&(te=E.dxydj([],V,re-1,ee,0),ae.push(ce[0]+te[0]/3),ie.push(ce[1]+te[1]/3),H=E.dxydj([],V,re-1,ee,1),ae.push(ne[0]-H[0]/3),ie.push(ne[1]-H[1]/3)),ae.push(ne[0]),ie.push(ne[1]),ce=ne;return ve.axisLetter=e,ve.axis=M,ve.crossAxis=v,ve.value=j,ve.constvar=t,ve.index=c,ve.x=ae,ve.y=ie,ve.smoothing=v.smoothing,ve}function U(j){var Z,re,fe,le,ce,V=[],ee=[],ne={};if(ne.length=A.length,ne.crossLength=u.length,e==="b")for(fe=Math.max(0,Math.min(N-2,j)),ce=Math.min(1,Math.max(0,j-fe)),ne.xy=function(K){return E.evalxy([],K,j)},ne.dxy=function(K,ue){return E.dxydi([],K,fe,ue,ce)},Z=0;ZA.length-1)&&_.push(b(U(o),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(c=s;cA.length-1)&&!(T<0||T>A.length-1))for(l=A[n],g=A[T],r=0;rA[A.length-1])&&w.push(b(R(d),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash})));M.startline&&m.push(b(U(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&m.push(b(U(A.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(i=5e-15,a=[Math.floor((A[A.length-1]-M.tick0)/M.dtick*(1+i)),Math.ceil((A[0]-M.tick0)/M.dtick/(1+i))].sort(function(j,Z){return j-Z}),s=a[0],f=a[1],c=s;c<=f;c++)p=M.tick0+M.dtick*c,_.push(b(R(p),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(c=s-1;cA[A.length-1])&&w.push(b(R(d),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash}));M.startline&&m.push(b(R(A[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&m.push(b(R(A[A.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}}}),o7=Ge({"src/traces/carpet/calc_labels.js"($,G){var h=Ss(),b=Qi().extendFlat;G.exports=function(E,e){var t,r,o,n,i,a=e._labels=[],s=e._gridlines;for(t=0;t=0;t--)r[s-t]=b[f][t],o[s-t]=S[f][t];for(n.push({x:r,y:o,bicubic:i}),t=f,r=[],o=[];t>=0;t--)r[f-t]=b[t][0],o[f-t]=S[t][0];return n.push({x:r,y:o,bicubic:a}),n}}}),l7=Ge({"src/traces/carpet/smooth_fill_2d_array.js"($,G){var h=yn();G.exports=function(S,E,e){var t,r,o,n=[],i=[],a=S[0].length,s=S.length;function f(re,fe){var le=0,ce,V=0;return re>0&&(ce=S[fe][re-1])!==void 0&&(V++,le+=ce),re0&&(ce=S[fe-1][re])!==void 0&&(V++,le+=ce),fe0&&r0&&tu);return h.log("Smoother converged to",v,"after",I,"iterations"),S}}}),u7=Ge({"src/traces/carpet/constants.js"($,G){G.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),c7=Ge({"src/traces/carpet/catmull_rom.js"($,G){var h=.5;G.exports=function(S,E,e,t){var r=S[0]-E[0],o=S[1]-E[1],n=e[0]-E[0],i=e[1]-E[1],a=Math.pow(r*r+o*o,h/2),s=Math.pow(n*n+i*i,h/2),f=(s*s*r-a*a*n)*t,c=(s*s*o-a*a*i)*t,p=s*(a+s)*3,d=a*(a+s)*3;return[[E[0]+(p&&f/p),E[1]+(p&&c/p)],[E[0]-(d&&f/d),E[1]-(d&&c/d)]]}}}),f7=Ge({"src/traces/carpet/compute_control_points.js"($,G){var h=c7(),b=yn().ensureArray;function S(E,e,t){var r=-.5*t[0]+1.5*e[0],o=-.5*t[1]+1.5*e[1];return[(2*r+E[0])/3,(2*o+E[1])/3]}G.exports=function(e,t,r,o,n,i){var a,s,f,c,p,d,T,l,g,x,A=r[0].length,M=r.length,_=n?3*A-2:A,w=i?3*M-2:M;for(e=b(e,w),t=b(t,w),f=0;fp&&_T&&wd||wl},o.setScale=function(){var _=o._x,w=o._y,m=S(o._xctrl,o._yctrl,_,w,f.smoothing,c.smoothing);o._xctrl=m[0],o._yctrl=m[1],o.evalxy=E([o._xctrl,o._yctrl],a,s,f.smoothing,c.smoothing),o.dxydi=e([o._xctrl,o._yctrl],f.smoothing,c.smoothing),o.dxydj=t([o._xctrl,o._yctrl],f.smoothing,c.smoothing)},o.i2a=function(_){var w=Math.max(0,Math.floor(_[0]),a-2),m=_[0]-w;return(1-m)*n[w]+m*n[w+1]},o.j2b=function(_){var w=Math.max(0,Math.floor(_[1]),a-2),m=_[1]-w;return(1-m)*i[w]+m*i[w+1]},o.ij2ab=function(_){return[o.i2a(_[0]),o.j2b(_[1])]},o.a2i=function(_){var w=Math.max(0,Math.min(b(_,n),a-2)),m=n[w],u=n[w+1];return Math.max(0,Math.min(a-1,w+(_-m)/(u-m)))},o.b2j=function(_){var w=Math.max(0,Math.min(b(_,i),s-2)),m=i[w],u=i[w+1];return Math.max(0,Math.min(s-1,w+(_-m)/(u-m)))},o.ab2ij=function(_){return[o.a2i(_[0]),o.b2j(_[1])]},o.i2c=function(_,w){return o.evalxy([],_,w)},o.ab2xy=function(_,w,m){if(!m&&(_n[a-1]|wi[s-1]))return[!1,!1];var u=o.a2i(_),v=o.b2j(w),y=o.evalxy([],u,v);if(m){var I=0,L=0,z=[],F,N,B,R;_n[a-1]?(F=a-2,N=1,I=(_-n[a-1])/(n[a-1]-n[a-2])):(F=Math.max(0,Math.min(a-2,Math.floor(u))),N=u-F),wi[s-1]?(B=s-2,R=1,L=(w-i[s-1])/(i[s-1]-i[s-2])):(B=Math.max(0,Math.min(s-2,Math.floor(v))),R=v-B),I&&(o.dxydi(z,F,B,N,R),y[0]+=z[0]*I,y[1]+=z[1]*I),L&&(o.dxydj(z,F,B,N,R),y[0]+=z[0]*L,y[1]+=z[1]*L)}return y},o.c2p=function(_,w,m){return[w.c2p(_[0]),m.c2p(_[1])]},o.p2x=function(_,w,m){return[w.p2c(_[0]),m.p2c(_[1])]},o.dadi=function(_){var w=Math.max(0,Math.min(n.length-2,_));return n[w+1]-n[w]},o.dbdj=function(_){var w=Math.max(0,Math.min(i.length-2,_));return i[w+1]-i[w]},o.dxyda=function(_,w,m,u){var v=o.dxydi(null,_,w,m,u),y=o.dadi(_,m);return[v[0]/y,v[1]/y]},o.dxydb=function(_,w,m,u){var v=o.dxydj(null,_,w,m,u),y=o.dbdj(w,u);return[v[0]/y,v[1]/y]},o.dxyda_rough=function(_,w,m){var u=g*(m||.1),v=o.ab2xy(_+u,w,!0),y=o.ab2xy(_-u,w,!0);return[(v[0]-y[0])*.5/u,(v[1]-y[1])*.5/u]},o.dxydb_rough=function(_,w,m){var u=x*(m||.1),v=o.ab2xy(_,w+u,!0),y=o.ab2xy(_,w-u,!0);return[(v[0]-y[0])*.5/u,(v[1]-y[1])*.5/u]},o.dpdx=function(_){return _._m},o.dpdy=function(_){return _._m}}}}),m7=Ge({"src/traces/carpet/calc.js"($,G){var h=Ss(),b=yn().isArray1D,S=n7(),E=a7(),e=i7(),t=o7(),r=s7(),o=Fx(),n=l7(),i=Ox(),a=p7();G.exports=function(f,c){var p=h.getFromId(f,c.xaxis),d=h.getFromId(f,c.yaxis),T=c.aaxis,l=c.baxis,g=c.x,x=c.y,A=[];g&&b(g)&&A.push("x"),x&&b(x)&&A.push("y"),A.length&&i(c,T,l,"a","b",A);var M=c._a=c._a||c.a,_=c._b=c._b||c.b;g=c._x||c.x,x=c._y||c.y;var w={};if(c._cheater){var m=T.cheatertype==="index"?M.length:M,u=l.cheatertype==="index"?_.length:_;g=S(m,u,c.cheaterslope)}c._x=g=o(g),c._y=x=o(x),n(g,M,_),n(x,M,_),a(c),c.setScale();var v=E(g),y=E(x),I=.5*(v[1]-v[0]),L=.5*(v[1]+v[0]),z=.5*(y[1]-y[0]),F=.5*(y[1]+y[0]),N=1.3;return v=[L-I*N,L+I*N],y=[F-z*N,F+z*N],c._extremes[p._id]=h.findExtremes(p,v,{padded:!0}),c._extremes[d._id]=h.findExtremes(d,y,{padded:!0}),e(c,"a","b"),e(c,"b","a"),t(c,T),t(c,l),w.clipsegments=r(c._xctrl,c._yctrl,T,l),w.x=g,w.y=x,w.a=M,w.b=_,[w]}}}),g7=Ge({"src/traces/carpet/index.js"($,G){G.exports={attributes:FE(),supplyDefaults:e7(),plot:r7(),calc:m7(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:ph(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),y7=Ge({"lib/carpet.js"($,G){G.exports=g7()}}),cL=Ge({"src/traces/scattercarpet/attributes.js"($,G){var h=ad(),b=jc(),S=nu(),{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=Ru(),o=Qi().extendFlat,n=b.marker,i=b.line,a=n.line;G.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:o({},b.mode,{dflt:"markers"}),text:o({},b.text,{}),texttemplate:e({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:t({editType:"plot"}),hovertext:o({},b.hovertext,{}),line:{color:i.color,width:i.width,dash:i.dash,backoff:i.backoff,shape:o({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:b.connectgaps,fill:o({},b.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:h(),marker:o({symbol:n.symbol,opacity:n.opacity,maxdisplayed:n.maxdisplayed,angle:n.angle,angleref:n.angleref,standoff:n.standoff,size:n.size,sizeref:n.sizeref,sizemin:n.sizemin,sizemode:n.sizemode,line:o({width:a.width,editType:"calc"},r("marker.line")),gradient:n.gradient,editType:"calc"},r("marker")),textfont:b.textfont,textposition:b.textposition,selected:b.selected,unselected:b.unselected,hoverinfo:o({},S.hoverinfo,{flags:["a","b","text","name"]}),hoveron:b.hoveron,hovertemplate:E(),hovertemplatefallback:t(),zorder:b.zorder}}}),_7=Ge({"src/traces/scattercarpet/defaults.js"($,G){var h=yn(),b=i0(),S=ou(),E=Gv(),e=Fp(),t=Xv(),r=ep(),o=Dv(),n=cL();G.exports=function(a,s,f,c){function p(M,_){return h.coerce(a,s,n,M,_)}p("carpet"),s.xaxis="x",s.yaxis="y";var d=p("a"),T=p("b"),l=Math.min(d.length,T.length);if(!l){s.visible=!1;return}s._length=l,p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext");var g=l0?w=M.labelprefix.replace(/ = $/,""):w=M._hovertitle,l.push(w+": "+_.toFixed(3)+M.labelsuffix)}if(!p.hovertemplate){var x=c.hi||p.hoverinfo,A=x.split("+");A.indexOf("all")!==-1&&(A=["a","b","text"]),A.indexOf("a")!==-1&&g(d.aaxis,c.a),A.indexOf("b")!==-1&&g(d.baxis,c.b),l.push("y: "+n.yLabel),A.indexOf("text")!==-1&&b(c,p,l),n.extraText=l.join("
")}return o}}}),A7=Ge({"src/traces/scattercarpet/event_data.js"($,G){G.exports=function(b,S,E,e,t){var r=e[t];return b.a=r.a,b.b=r.b,b.y=r.y,b}}}),S7=Ge({"src/traces/scattercarpet/index.js"($,G){G.exports={attributes:cL(),supplyDefaults:_7(),colorbar:Vf(),formatLabels:x7(),calc:b7(),plot:w7(),style:Eh().style,styleOnSelect:Eh().styleOnSelect,hoverPoints:T7(),selectPoints:og(),eventData:A7(),moduleType:"trace",name:"scattercarpet",basePlotModule:ph(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),M7=Ge({"lib/scattercarpet.js"($,G){G.exports=S7()}}),fL=Ge({"src/traces/contourcarpet/attributes.js"($,G){var h=gv(),b=H1(),S=Ru(),E=Qi().extendFlat,e=b.contours;G.exports=E({carpet:{valType:"string",editType:"calc"},z:h.z,a:h.x,a0:h.x0,da:h.dx,b:h.y,b0:h.y0,db:h.dy,text:h.text,hovertext:h.hovertext,transpose:h.transpose,atype:h.xtype,btype:h.ytype,fillcolor:b.fillcolor,autocontour:b.autocontour,ncontours:b.ncontours,contours:{type:e.type,start:e.start,end:e.end,size:e.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:e.showlines,showlabels:e.showlabels,labelfont:e.labelfont,labelformat:e.labelformat,operation:e.operation,value:e.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:b.line.color,width:b.line.width,dash:b.line.dash,smoothing:b.line.smoothing,editType:"plot"},zorder:b.zorder},S("",{cLetter:"z",autoColorDflt:!1}))}}),hL=Ge({"src/traces/contourcarpet/defaults.js"($,G){var h=yn(),b=gh(),S=fL(),E=I2(),e=$x(),t=G1();G.exports=function(o,n,i,a){function s(d,T){return h.coerce(o,n,S,d,T)}function f(d){return h.coerce2(o,n,S,d)}if(s("carpet"),o.a&&o.b){var c=b(o,n,s,a,"a","b");if(!c){n.visible=!1;return}s("text");var p=s("contours.type")==="constraint";p?E(o,n,s,a,i,{hasHover:!1}):(e(o,n,s,f),t(o,n,s,a,{hasHover:!1}))}else n._defaultColor=i,n._length=null;s("zorder")}}}),E7=Ge({"src/traces/contourcarpet/calc.js"($,G){var h=pv(),b=yn(),S=Ox(),E=Fx(),e=Bx(),t=Nx(),r=S2(),o=hL(),n=BE(),i=C2();G.exports=function(f,c){var p=c._carpetTrace=n(f,c);if(!(!p||!p.visible||p.visible==="legendonly")){if(!c.a||!c.b){var d=f.data[p.index],T=f.data[c.index];T.a||(T.a=d.a),T.b||(T.b=d.b),o(T,c,c._defaultColor,f._fullLayout)}var l=a(f,c);return i(c,c._z),l}};function a(s,f){var c=f._carpetTrace,p=c.aaxis,d=c.baxis,T,l,g,x,A,M,_;p._minDtick=0,d._minDtick=0,b.isArray1D(f.z)&&S(f,p,d,"a","b",["z"]),T=f._a=f._a||f.a,x=f._b=f._b||f.b,T=T?p.makeCalcdata(f,"_a"):[],x=x?d.makeCalcdata(f,"_b"):[],l=f.a0||0,g=f.da||1,A=f.b0||0,M=f.db||1,_=f._z=E(f._z||f.z,f.transpose),f._emptypoints=t(_),e(_,f._emptypoints);var w=b.maxRowLength(_),m=f.xtype==="scaled"?"":T,u=r(f,m,l,g,w,p),v=f.ytype==="scaled"?"":x,y=r(f,v,A,M,_.length,d),I={a:u,b:y,z:_};return f.contours.type==="levels"&&f.contours.coloring!=="none"&&h(s,f,{vals:_,containerStr:"",cLetter:"z"}),[I]}}}),k7=Ge({"src/traces/carpet/axis_aligned_line.js"($,G){var h=yn().isArrayOrTypedArray;G.exports=function(b,S,E,e){var t,r,o,n,i,a,s,f,c,p,d,T,l,g=h(E)?"a":"b",x=g==="a"?b.aaxis:b.baxis,A=x.smoothing,M=g==="a"?b.a2i:b.b2j,_=g==="a"?E:e,w=g==="a"?e:E,m=g==="a"?S.a.length:S.b.length,u=g==="a"?S.b.length:S.a.length,v=Math.floor(g==="a"?b.b2j(w):b.a2i(w)),y=g==="a"?function(fe){return b.evalxy([],fe,v)}:function(fe){return b.evalxy([],v,fe)};A&&(o=Math.max(0,Math.min(u-2,v)),n=v-o,r=g==="a"?function(fe,le){return b.dxydi([],fe,o,le,n)}:function(fe,le){return b.dxydj([],o,fe,n,le)});var I=M(_[0]),L=M(_[1]),z=I0?Math.floor:Math.ceil,B=z>0?Math.ceil:Math.floor,R=z>0?Math.min:Math.max,U=z>0?Math.max:Math.min,j=N(I+F),Z=B(L-F);s=y(I);var re=[[s]];for(t=j;t*z=0;ve--)H=U.clipsegments[ve],ae=b([],H.x,I.c2p),ie=b([],H.y,L.c2p),ae.reverse(),ie.reverse(),Ae.push(S(ae,ie,H.bicubic));var Ce="M"+Ae.join("L")+"Z";A(F,U.clipsegments,I,L,le,V),M(B,F,I,L,te,ne,ee,R,U,V,Ce),d(F,fe,m,N,re,u,R),E.setClipUrl(F,R._clipPathId,m)})};function p(w,m){var u,v,y,I,L,z,F,N,B;for(u=0;ufe&&(v.max=fe),v.len=v.max-v.min}function l(w,m,u){var v=w.getPointAtLength(m),y=w.getPointAtLength(u),I=y.x-v.x,L=y.y-v.y,z=Math.sqrt(I*I+L*L);return[I/z,L/z]}function g(w){var m=Math.sqrt(w[0]*w[0]+w[1]*w[1]);return[w[0]/m,w[1]/m]}function x(w,m){var u=Math.abs(w[0]*m[0]+w[1]*m[1]),v=Math.sqrt(1-u*u);return v/u}function A(w,m,u,v,y,I){var L,z,F,N,B=e.ensureSingle(w,"g","contourbg"),R=B.selectAll("path").data(I==="fill"&&!y?[0]:[]);R.enter().append("path"),R.exit().remove();var U=[];for(N=0;N=0&&(j=ae,re=fe):Math.abs(U[1]-j[1])=0&&(j=ae,re=fe):e.log("endpt to newendpt is not vert. or horz.",U,j,ae)}if(re>=0)break;N+=te(U,j),U=j}if(re===m.edgepaths.length){e.log("unclosed perimeter path");break}F=re,R=B.indexOf(F)===-1,R&&(F=B[0],N+=te(U,j)+"Z",U=null)}for(F=0;F_):M=z>y,_=z;var F=p(y,I,L,z);F.pos=v,F.yc=(y+z)/2,F.i=u,F.dir=M?"increasing":"decreasing",F.x=F.pos,F.y=[L,I],w&&(F.orig_p=s[u]),x&&(F.tx=a.text[u]),A&&(F.htx=a.hovertext[u]),m.push(F)}else m.push({pos:v,empty:!0})}return a._extremes[c._id]=S.findExtremes(c,h.concat(l,T),{padded:!0}),m.length&&(m[0].t={labels:{open:b(i,"open:")+" ",high:b(i,"high:")+" ",low:b(i,"low:")+" ",close:b(i,"close:")+" "}}),m}function n(i,a,s){var f=s._minDiff;if(!f){var c=i._fullData,p=[];f=1/0;var d;for(d=0;d"+g.labels[v]+h.hoverLabelText(T,y,l.yhoverformat)):(L=b.extendFlat({},A),L.y0=L.y1=I,L.yLabelVal=y,L.yLabel=g.labels[v]+h.hoverLabelText(T,y,l.yhoverformat),L.name="",x.push(L),m[y]=L)}return x}function a(s,f,c,p){var d=s.cd,T=s.ya,l=d[0].trace,g=d[0].t,x=n(s,f,c,p);if(!x)return[];var A=x.index,M=d[A],_=x.index=M.i,w=M.dir;function m(F){return g.labels[F]+h.hoverLabelText(T,l[F][_],l.yhoverformat)}var u=M.hi||l.hoverinfo||"",v=u.split("+"),y=u==="all",I=y||v.indexOf("y")!==-1,L=y||v.indexOf("text")!==-1,z=I?[m("open"),m("high"),m("low"),m("close")+" "+r[w]]:[];return L&&e(M,l,z),x.extraText=z.join("
"),x.y0=x.y1=T.c2p(M.yc,!0),[x]}G.exports={hoverPoints:o,hoverSplit:i,hoverOnPoints:a}}}),mL=Ge({"src/traces/ohlc/select.js"($,G){G.exports=function(b,S){var E=b.cd,e=b.xaxis,t=b.yaxis,r=[],o,n=E[0].t.bPos||0;if(S===!1)for(o=0;of?function(l){return l<=0}:function(l){return l>=0};n.c2g=function(l){var g=n.c2l(l)-s;return(T(g)?g:0)+d},n.g2c=function(l){return n.l2c(l+s-d)},n.g2p=function(l){return l*p},n.c2p=function(l){return n.g2p(n.c2g(l))}}}function t(n,i){return i==="degrees"?S(n):n}function r(n,i){return i==="degrees"?E(n):n}function o(n,i){var a=n.type;if(a==="linear"){var s=n.d2c,f=n.c2d;n.d2c=function(c,p){return t(s(c),p)},n.c2d=function(c,p){return f(r(c,p))}}n.makeCalcdata=function(c,p){var d=c[p],T=c._length,l,g,x=function(m){return n.d2c(m,c.thetaunit)};if(d)for(l=new Array(T),g=0;g0?m:1/0},M=S(x,A),_=h.mod(M+1,x.length);return[x[M],x[_]]}function p(g){return Math.abs(g)>1e-10?g:0}function d(g,x,A){x=x||0,A=A||0;for(var M=g.length,_=new Array(M),w=0;w0?1:0}function b(r){var o=r[0],n=r[1];if(!isFinite(o)||!isFinite(n))return[1,0];var i=(o+1)*(o+1)+n*n;return[(o*o+n*n-1)/i,2*n/i]}function S(r,o){var n=o[0],i=o[1];return[n*r.radius+r.cx,-i*r.radius+r.cy]}function E(r,o){return o*r.radius}function e(r,o,n,i){var a=S(r,b([n,o])),s=a[0],f=a[1],c=S(r,b([i,o])),p=c[0],d=c[1];if(o===0)return["M"+s+","+f,"L"+p+","+d].join(" ");var T=E(r,1/Math.abs(o));return["M"+s+","+f,"A"+T+","+T+" 0 0,"+(o<0?1:0)+" "+p+","+d].join(" ")}function t(r,o,n,i){var a=E(r,1/(o+1)),s=S(r,b([o,n])),f=s[0],c=s[1],p=S(r,b([o,i])),d=p[0],T=p[1];if(h(n)!==h(i)){var l=S(r,b([o,0])),g=l[0],x=l[1];return["M"+f+","+c,"A"+a+","+a+" 0 0,"+(0it?(st=ie,nt=ie*it,Te=(ve-nt)/K.h/2,Qe=[H[0],H[1]],Le=[ae[0]+Te,ae[1]-Te]):(st=ve/it,nt=ve,Te=(ie-st)/K.w/2,Qe=[H[0]+Te,H[1]-Te],Le=[ae[0],ae[1]]),ee.xLength2=st,ee.yLength2=nt,ee.xDomain2=Qe,ee.yDomain2=Le;var pe=ee.xOffset2=K.l+K.w*Qe[0],Ne=ee.yOffset2=K.t+K.h*(1-Le[1]),ot=ee.radius=st/Fe,ft=ee.innerRadius=ee.getHole(V)*ot,rt=ee.cx=pe-ot*Ce[0],Ft=ee.cy=Ne+ot*Ce[3],Nt=ee.cxx=rt-pe,$t=ee.cyy=Ft-Ne,rr=ue.side,Er;rr==="counterclockwise"?(Er=rr,rr="top"):rr==="clockwise"&&(Er=rr,rr="bottom"),ee.radialAxis=ee.mockAxis(ce,V,ue,{_id:"x",side:rr,_trueSide:Er,domain:[ft/K.w,ot/K.w]}),ee.angularAxis=ee.mockAxis(ce,V,te,{side:"right",domain:[0,Math.PI],autorange:!1}),ee.doAutoRange(ce,V),ee.updateAngularAxis(ce,V),ee.updateRadialAxis(ce,V),ee.updateRadialAxisTitle(ce,V),ee.xaxis=ee.mockCartesianAxis(ce,V,{_id:"x",domain:Qe}),ee.yaxis=ee.mockCartesianAxis(ce,V,{_id:"y",domain:Le});var Mr=ee.pathSubplot();ee.clipPaths.forTraces.select("path").attr("d",Mr).attr("transform",t(Nt,$t)),ne.frontplot.attr("transform",t(pe,Ne)).call(o.setClipUrl,ee._hasClipOnAxisFalse?null:ee.clipIds.forTraces,ee.gd),ne.bg.attr("d",Mr).attr("transform",t(rt,Ft)).call(r.fill,V.bgcolor)},j.mockAxis=function(ce,V,ee,ne){var K=E.extendFlat({},ee,ne);return s(K,V,ce),K},j.mockCartesianAxis=function(ce,V,ee){var ne=this,K=ne.isSmith,ue=ee._id,te=E.extendFlat({type:"linear"},ee);a(te,ce);var H={x:[0,2],y:[1,3]};return te.setRange=function(){var ae=ne.sectorBBox,ie=H[ue],ve=ne.radialAxis._rl,Ae=(ve[1]-ve[0])/(1-ne.getHole(V));te.range=[ae[ie[0]]*Ae,ae[ie[1]]*Ae]},te.isPtWithinRange=ue==="x"&&!K?function(ae){return ne.isPtInside(ae)}:function(){return!0},te.setRange(),te.setScale(),te},j.doAutoRange=function(ce,V){var ee=this,ne=ee.gd,K=ee.radialAxis,ue=ee.getRadial(V);f(ne,K);var te=K.range;if(ue.range=te.slice(),ue._input.range=te.slice(),K._rl=[K.r2l(te[0],null,"gregorian"),K.r2l(te[1],null,"gregorian")],K.minallowed!==void 0){var H=K.r2l(K.minallowed);K._rl[0]>K._rl[1]?K._rl[1]=Math.max(K._rl[1],H):K._rl[0]=Math.max(K._rl[0],H)}if(K.maxallowed!==void 0){var ae=K.r2l(K.maxallowed);K._rl[0]90&&ve<=270&&(Ae.tickangle=180);var ze=Fe?function(ot){var ft=z(ee,y([ot.x,0]));return t(ft[0]-H,ft[1]-ae)}:function(ot){return t(Ae.l2p(ot.x)+te,0)},Ye=Fe?function(ot){return L(ee,ot.x,-1/0,1/0)}:function(ot){return ee.pathArc(Ae.r2p(ot.x)+te)},it=Z(ie);if(ee.radialTickLayout!==it&&(K["radial-axis"].selectAll(".xtick").remove(),ee.radialTickLayout=it),Ce){Ae.setScale();var st=0,nt=Fe?(Ae.tickvals||[]).filter(function(ot){return ot>=0}).map(function(ot){return i.tickText(Ae,ot,!0,!1)}):i.calcTicks(Ae),Qe=Fe?nt:i.clipEnds(Ae,nt),Le=i.getTickSigns(Ae)[2];Fe&&((Ae.ticks==="top"&&Ae.side==="bottom"||Ae.ticks==="bottom"&&Ae.side==="top")&&(Le=-Le),Ae.ticks==="top"&&Ae.side==="top"&&(st=-Ae.ticklen),Ae.ticks==="bottom"&&Ae.side==="bottom"&&(st=Ae.ticklen)),i.drawTicks(ne,Ae,{vals:nt,layer:K["radial-axis"],path:i.makeTickPath(Ae,0,Le),transFn:ze,crisp:!1}),i.drawGrid(ne,Ae,{vals:Qe,layer:K["radial-grid"],path:Ye,transFn:E.noop,crisp:!1}),i.drawLabels(ne,Ae,{vals:nt,layer:K["radial-axis"],transFn:ze,labelFns:i.makeLabelFns(Ae,st)})}var Te=ee.radialAxisAngle=ee.vangles?R(fe(B(ie.angle),ee.vangles)):ie.angle,pe=t(H,ae),Ne=pe+e(-Te);le(K["radial-axis"],Ce&&(ie.showticklabels||ie.ticks),{transform:Ne}),le(K["radial-grid"],Ce&&ie.showgrid,{transform:Fe?"":pe}),le(K["radial-line"].select("line"),Ce&&ie.showline,{x1:Fe?-ue:te,y1:0,x2:ue,y2:0,transform:Ne}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},j.updateRadialAxisTitle=function(ce,V,ee){if(!this.isSmith){var ne=this,K=ne.gd,ue=ne.radius,te=ne.cx,H=ne.cy,ae=ne.getRadial(V),ie=ne.id+"title",ve=0;if(ae.title){var Ae=o.bBox(ne.layers["radial-axis"].node()).height,Ce=ae.title.font.size,Fe=ae.side;ve=Fe==="top"?Ce:Fe==="counterclockwise"?-(Ae+Ce*.4):Ae+Ce*.8}var ze=ee!==void 0?ee:ne.radialAxisAngle,Ye=B(ze),it=Math.cos(Ye),st=Math.sin(Ye),nt=te+ue/2*it+ve*st,Qe=H-ue/2*st+ve*it;ne.layers["radial-axis-title"]=T.draw(K,ie,{propContainer:ae,propName:ne.id+".radialaxis.title.text",placeholder:F(K,"Click to enter radial axis title"),attributes:{x:nt,y:Qe,"text-anchor":"middle"},transform:{rotate:-ze}})}},j.updateAngularAxis=function(ce,V){var ee=this,ne=ee.gd,K=ee.layers,ue=ee.radius,te=ee.innerRadius,H=ee.cx,ae=ee.cy,ie=ee.getAngular(V),ve=ee.angularAxis,Ae=ee.isSmith;Ae||(ee.fillViewInitialKey("angularaxis.rotation",ie.rotation),ve.setGeometry(),ve.setScale());var Ce=Ae?function(ft){var rt=z(ee,y([0,ft.x]));return Math.atan2(rt[0]-H,rt[1]-ae)-Math.PI/2}:function(ft){return ve.t2g(ft.x)};ve.type==="linear"&&ve.thetaunit==="radians"&&(ve.tick0=R(ve.tick0),ve.dtick=R(ve.dtick));var Fe=function(ft){return t(H+ue*Math.cos(ft),ae-ue*Math.sin(ft))},ze=Ae?function(ft){var rt=z(ee,y([0,ft.x]));return t(rt[0],rt[1])}:function(ft){return Fe(Ce(ft))},Ye=Ae?function(ft){var rt=z(ee,y([0,ft.x])),Ft=Math.atan2(rt[0]-H,rt[1]-ae)-Math.PI/2;return t(rt[0],rt[1])+e(-R(Ft))}:function(ft){var rt=Ce(ft);return Fe(rt)+e(-R(rt))},it=Ae?function(ft){return I(ee,ft.x,0,1/0)}:function(ft){var rt=Ce(ft),Ft=Math.cos(rt),Nt=Math.sin(rt);return"M"+[H+te*Ft,ae-te*Nt]+"L"+[H+ue*Ft,ae-ue*Nt]},st=i.makeLabelFns(ve,0),nt=st.labelStandoff,Qe={};Qe.xFn=function(ft){var rt=Ce(ft);return Math.cos(rt)*nt},Qe.yFn=function(ft){var rt=Ce(ft),Ft=Math.sin(rt)>0?.2:1;return-Math.sin(rt)*(nt+ft.fontSize*Ft)+Math.abs(Math.cos(rt))*(ft.fontSize*w)},Qe.anchorFn=function(ft){var rt=Ce(ft),Ft=Math.cos(rt);return Math.abs(Ft)<.1?"middle":Ft>0?"start":"end"},Qe.heightFn=function(ft,rt,Ft){var Nt=Ce(ft);return-.5*(1+Math.sin(Nt))*Ft};var Le=Z(ie);ee.angularTickLayout!==Le&&(K["angular-axis"].selectAll("."+ve._id+"tick").remove(),ee.angularTickLayout=Le);var Te=Ae?[1/0].concat(ve.tickvals||[]).map(function(ft){return i.tickText(ve,ft,!0,!1)}):i.calcTicks(ve);Ae&&(Te[0].text="∞",Te[0].fontSize*=1.75);var pe;if(V.gridshape==="linear"?(pe=Te.map(Ce),E.angleDelta(pe[0],pe[1])<0&&(pe=pe.slice().reverse())):pe=null,ee.vangles=pe,ve.type==="category"&&(Te=Te.filter(function(ft){return E.isAngleInsideSector(Ce(ft),ee.sectorInRad)})),ve.visible){var Ne=ve.ticks==="inside"?-1:1,ot=(ve.linewidth||1)/2;i.drawTicks(ne,ve,{vals:Te,layer:K["angular-axis"],path:"M"+Ne*ot+",0h"+Ne*ve.ticklen,transFn:Ye,crisp:!1}),i.drawGrid(ne,ve,{vals:Te,layer:K["angular-grid"],path:it,transFn:E.noop,crisp:!1}),i.drawLabels(ne,ve,{vals:Te,layer:K["angular-axis"],repositionOnUpdate:!0,transFn:ze,labelFns:Qe})}le(K["angular-line"].select("path"),ie.showline,{d:ee.pathSubplot(),transform:t(H,ae)}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},j.updateFx=function(ce,V){if(!this.gd._context.staticPlot){var ee=!this.isSmith;ee&&(this.updateAngularDrag(ce),this.updateRadialDrag(ce,V,0),this.updateRadialDrag(ce,V,1)),this.updateHoverAndMainDrag(ce)}},j.updateHoverAndMainDrag=function(ce){var V=this,ee=V.isSmith,ne=V.gd,K=V.layers,ue=ce._zoomlayer,te=m.MINZOOM,H=m.OFFEDGE,ae=V.radius,ie=V.innerRadius,ve=V.cx,Ae=V.cy,Ce=V.cxx,Fe=V.cyy,ze=V.sectorInRad,Ye=V.vangles,it=V.radialAxis,st=u.clampTiny,nt=u.findXYatLength,Qe=u.findEnclosingVertexAngles,Le=m.cornerHalfWidth,Te=m.cornerLen/2,pe,Ne,ot=c.makeDragger(K,"path","maindrag",ce.dragmode===!1?"none":"crosshair");h.select(ot).attr("d",V.pathSubplot()).attr("transform",t(ve,Ae)),ot.onmousemove=function(pr){d.hover(ne,pr,V.id),ne._fullLayout._lasthover=ot,ne._fullLayout._hoversubplot=V.id},ot.onmouseout=function(pr){ne._dragging||p.unhover(ne,pr)};var ft={element:ot,gd:ne,subplot:V.id,plotinfo:{id:V.id,xaxis:V.xaxis,yaxis:V.yaxis},xaxes:[V.xaxis],yaxes:[V.yaxis]},rt,Ft,Nt,$t,rr,Er,Mr,Wr,Sr;function Br(pr,hr){return Math.sqrt(pr*pr+hr*hr)}function Mt(pr,hr){return Br(pr-Ce,hr-Fe)}function je(pr,hr){return Math.atan2(Fe-hr,pr-Ce)}function $e(pr,hr){return[pr*Math.cos(hr),pr*Math.sin(-hr)]}function Ee(pr,hr){if(pr===0)return V.pathSector(2*Le);var Fr=Te/pr,En=hr-Fr,Kn=hr+Fr,qn=Math.max(0,Math.min(pr,ae)),ta=qn-Le,ra=qn+Le;return"M"+$e(ta,En)+"A"+[ta,ta]+" 0,0,0 "+$e(ta,Kn)+"L"+$e(ra,Kn)+"A"+[ra,ra]+" 0,0,1 "+$e(ra,En)+"Z"}function xe(pr,hr,Fr){if(pr===0)return V.pathSector(2*Le);var En=$e(pr,hr),Kn=$e(pr,Fr),qn=st((En[0]+Kn[0])/2),ta=st((En[1]+Kn[1])/2),ra,Nn;if(qn&&ta){var ka=ta/qn,qa=-1/ka,ir=nt(Le,ka,qn,ta);ra=nt(Te,qa,ir[0][0],ir[0][1]),Nn=nt(Te,qa,ir[1][0],ir[1][1])}else{var qt,ar;ta?(qt=Te,ar=Le):(qt=Le,ar=Te),ra=[[qn-qt,ta-ar],[qn+qt,ta-ar]],Nn=[[qn-qt,ta+ar],[qn+qt,ta+ar]]}return"M"+ra.join("L")+"L"+Nn.reverse().join("L")+"Z"}function ye(){Nt=null,$t=null,rr=V.pathSubplot(),Er=!1;var pr=ne._fullLayout[V.id];Mr=b(pr.bgcolor).getLuminance(),Wr=c.makeZoombox(ue,Mr,ve,Ae,rr),Wr.attr("fill-rule","evenodd"),Sr=c.makeCorners(ue,ve,Ae),x(ne)}function Me(pr,hr){return hr=Math.max(Math.min(hr,ae),ie),prte?(pr-1&&pr===1&&g(hr,ne,[V.xaxis],[V.yaxis],V.id,ft),Fr.indexOf("event")>-1&&d.click(ne,hr,V.id)}ft.prepFn=function(pr,hr,Fr){var En=ne._fullLayout.dragmode,Kn=ot.getBoundingClientRect();ne._fullLayout._calcInverseTransform(ne);var qn=ne._fullLayout._invTransform;pe=ne._fullLayout._invScaleX,Ne=ne._fullLayout._invScaleY;var ta=E.apply3DTransform(qn)(hr-Kn.left,Fr-Kn.top);if(rt=ta[0],Ft=ta[1],Ye){var ra=u.findPolygonOffset(ae,ze[0],ze[1],Ye);rt+=Ce+ra[0],Ft+=Fe+ra[1]}switch(En){case"zoom":ft.clickFn=_r,ee||(Ye?ft.moveFn=Ct:ft.moveFn=Je,ft.doneFn=Ot,ye());break;case"select":case"lasso":l(pr,hr,Fr,ft,En);break}},p.init(ft)},j.updateRadialDrag=function(ce,V,ee){var ne=this,K=ne.gd,ue=ne.layers,te=ne.radius,H=ne.innerRadius,ae=ne.cx,ie=ne.cy,ve=ne.radialAxis,Ae=m.radialDragBoxSize,Ce=Ae/2;if(!ve.visible)return;var Fe=B(ne.radialAxisAngle),ze=ve._rl,Ye=ze[0],it=ze[1],st=ze[ee],nt=.75*(ze[1]-ze[0])/(1-ne.getHole(V))/te,Qe,Le,Te;ee?(Qe=ae+(te+Ce)*Math.cos(Fe),Le=ie-(te+Ce)*Math.sin(Fe),Te="radialdrag"):(Qe=ae+(H-Ce)*Math.cos(Fe),Le=ie-(H-Ce)*Math.sin(Fe),Te="radialdrag-inner");var pe=c.makeRectDragger(ue,Te,"crosshair",-Ce,-Ce,Ae,Ae),Ne={element:pe,gd:K};ce.dragmode===!1&&(Ne.dragmode=!1),le(h.select(pe),ve.visible&&H0!=(ee?rt>Ye:rt=90||K>90&&ue>=450?Fe=1:H<=0&&ie<=0?Fe=0:Fe=Math.max(H,ie),K<=180&&ue>=180||K>180&&ue>=540?ve=-1:te>=0&&ae>=0?ve=0:ve=Math.min(te,ae),K<=270&&ue>=270||K>270&&ue>=630?Ae=-1:H>=0&&ie>=0?Ae=0:Ae=Math.min(H,ie),ue>=360?Ce=1:te<=0&&ae<=0?Ce=0:Ce=Math.max(te,ae),[ve,Ae,Ce,Fe]}function fe(ce,V){var ee=function(K){return E.angleDist(ce,K)},ne=E.findIndexOfMin(V,ee);return V[ne]}function le(ce,V,ee){return V?(ce.attr("display",null),ce.attr(ee)):ce&&ce.attr("display","none"),ce}}}),bL=Ge({"src/plots/polar/layout_attributes.js"($,G){var h=rh(),b=tv(),S=Sc().attributes,E=yn().extendFlat,e=Uc().overrideAll,t=e({color:b.color,showline:E({},b.showline,{dflt:!0}),linecolor:b.linecolor,linewidth:b.linewidth,showgrid:E({},b.showgrid,{dflt:!0}),gridcolor:b.gridcolor,gridwidth:b.gridwidth,griddash:b.griddash},"plot","from-root"),r=e({tickmode:b.minor.tickmode,nticks:b.nticks,tick0:b.tick0,dtick:b.dtick,tickvals:b.tickvals,ticktext:b.ticktext,ticks:b.ticks,ticklen:b.ticklen,tickwidth:b.tickwidth,tickcolor:b.tickcolor,ticklabelstep:b.ticklabelstep,showticklabels:b.showticklabels,labelalias:b.labelalias,minorloglabels:b.minorloglabels,showtickprefix:b.showtickprefix,tickprefix:b.tickprefix,showticksuffix:b.showticksuffix,ticksuffix:b.ticksuffix,showexponent:b.showexponent,exponentformat:b.exponentformat,minexponent:b.minexponent,separatethousands:b.separatethousands,tickfont:b.tickfont,tickangle:b.tickangle,tickformat:b.tickformat,tickformatstops:b.tickformatstops,layer:b.layer},"plot","from-root"),o={visible:E({},b.visible,{dflt:!0}),type:E({},b.type,{values:["-","linear","log","date","category"]}),autotypenumbers:b.autotypenumbers,autorangeoptions:{minallowed:b.autorangeoptions.minallowed,maxallowed:b.autorangeoptions.maxallowed,clipmin:b.autorangeoptions.clipmin,clipmax:b.autorangeoptions.clipmax,include:b.autorangeoptions.include,editType:"plot"},autorange:E({},b.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:E({},b.minallowed,{editType:"plot"}),maxallowed:E({},b.maxallowed,{editType:"plot"}),range:E({},b.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:b.categoryorder,categoryarray:b.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:b.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:E({},b.title.text,{editType:"plot",dflt:""}),font:E({},b.title.font,{editType:"plot"}),editType:"plot"},hoverformat:b.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(o,t,r);var n={visible:E({},b.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:b.autotypenumbers,categoryorder:b.categoryorder,categoryarray:b.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:b.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(n,t,r),G.exports={domain:S({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:h.background},radialaxis:o,angularaxis:n,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),j7=Ge({"src/plots/polar/layout_defaults.js"($,G){var h=yn(),b=So(),S=mu(),E=B0(),e=Iv().getSubplotData,t=Qm(),r=P0(),o=Lp(),n=Sd(),i=Pf(),a=Uu(),s=jT(),f=im(),c=bL(),p=yL(),d=UE(),T=d.axisNames;function l(x,A,M,_){var w=M("bgcolor");_.bgColor=b.combine(w,_.paper_bgcolor);var m=M("sector");M("hole");var u=e(_.fullData,d.name,_.id),v=_.layoutOut,y;function I(Ae,Ce){return M(y+"."+Ae,Ce)}for(var L=0;L")}}G.exports={hoverPoints:b,makeHoverPointText:S}}}),H7=Ge({"src/traces/scatterpolar/index.js"($,G){G.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:qE(),categories:["polar","symbols","showLegend","scatter-like"],attributes:nS(),supplyDefaults:VE().supplyDefaults,colorbar:Vf(),formatLabels:HE(),calc:q7(),plot:V7(),style:Eh().style,styleOnSelect:Eh().styleOnSelect,hoverPoints:GE().hoverPoints,selectPoints:og(),meta:{}}}}),G7=Ge({"lib/scatterpolar.js"($,G){G.exports=H7()}}),wL=Ge({"src/traces/scatterpolargl/attributes.js"($,G){var h=nS(),{cliponaxis:b,hoveron:S}=h,E=Lo(h,["cliponaxis","hoveron"]),{connectgaps:e,line:{color:t,dash:r,width:o},fill:n,fillcolor:i,marker:a,textfont:s,textposition:f}=ZA();G.exports=qi(ao({},E),{connectgaps:e,fill:n,fillcolor:i,line:{color:t,dash:r,editType:"calc",width:o},marker:a,textfont:s,textposition:f})}}),X7=Ge({"src/traces/scatterpolargl/defaults.js"($,G){var h=yn(),b=ou(),S=VE().handleRThetaDefaults,E=Gv(),e=Fp(),t=ep(),r=Dv(),o=i0().PTS_LINESONLY,n=wL();G.exports=function(a,s,f,c){function p(T,l){return h.coerce(a,s,n,T,l)}var d=S(a,s,c,p);if(!d){s.visible=!1;return}p("thetaunit"),p("mode",d=r&&(_.marker.cluster=g.tree),_.marker&&(_.markerSel.positions=_.markerUnsel.positions=_.marker.positions=v),_.line&&v.length>1&&t.extendFlat(_.line,e.linePositions(i,l,v)),_.text&&(t.extendFlat(_.text,{positions:v},e.textPosition(i,l,_.text,_.marker)),t.extendFlat(_.textSel,{positions:v},e.textPosition(i,l,_.text,_.markerSel)),t.extendFlat(_.textUnsel,{positions:v},e.textPosition(i,l,_.text,_.markerUnsel))),_.fill&&!p.fill2d&&(p.fill2d=!0),_.marker&&!p.scatter2d&&(p.scatter2d=!0),_.line&&!p.line2d&&(p.line2d=!0),_.text&&!p.glText&&(p.glText=!0),p.lineOptions.push(_.line),p.fillOptions.push(_.fill),p.markerOptions.push(_.marker),p.markerSelectedOptions.push(_.markerSel),p.markerUnselectedOptions.push(_.markerUnsel),p.textOptions.push(_.text),p.textSelectedOptions.push(_.textSel),p.textUnselectedOptions.push(_.textUnsel),p.selectBatch.push([]),p.unselectBatch.push([]),g.x=y,g.y=I,g.rawx=y,g.rawy=I,g.r=A,g.theta=M,g.positions=v,g._scene=p,g.index=p.count,p.count++}}),S(i,a,s)}},G.exports.reglPrecompiled=o}}),J7=Ge({"src/traces/scatterpolargl/index.js"($,G){var h=K7();h.plot=$7(),G.exports=h}}),Q7=Ge({"lib/scatterpolargl.js"($,G){G.exports=J7()}}),TL=Ge({"src/traces/barpolar/attributes.js"($,G){var{hovertemplateAttrs:h,templatefallbackAttrs:b}=Sl(),S=Qi().extendFlat,E=nS(),e=Bh();G.exports={r:E.r,theta:E.theta,r0:E.r0,dr:E.dr,theta0:E.theta0,dtheta:E.dtheta,thetaunit:E.thetaunit,base:S({},e.base,{}),offset:S({},e.offset,{}),width:S({},e.width,{}),text:S({},e.text,{}),hovertext:S({},e.hovertext,{}),marker:t(),hoverinfo:E.hoverinfo,hovertemplate:h(),hovertemplatefallback:b(),selected:e.selected,unselected:e.unselected};function t(){var r=S({},e.marker);return delete r.cornerradius,r}}}),AL=Ge({"src/traces/barpolar/layout_attributes.js"($,G){G.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),e9=Ge({"src/traces/barpolar/defaults.js"($,G){var h=yn(),b=VE().handleRThetaDefaults,S=l0(),E=TL();G.exports=function(t,r,o,n){function i(s,f){return h.coerce(t,r,E,s,f)}var a=b(t,r,n,i);if(!a){r.visible=!1;return}i("thetaunit"),i("base"),i("offset"),i("width"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),S(t,r,i,o,n),h.coerceSelectionMarkerOpacity(r,i)}}}),t9=Ge({"src/traces/barpolar/layout_defaults.js"($,G){var h=yn(),b=AL();G.exports=function(S,E,e){var t={},r;function o(a,s){return h.coerce(S[r]||{},E[r],b,a,s)}for(var n=0;n0?(c=s,p=f):(c=f,p=s);var d=e.findEnclosingVertexAngles(c,r.vangles)[0],T=e.findEnclosingVertexAngles(p,r.vangles)[1],l=[d,(c+p)/2,T];return e.pathPolygonAnnulus(i,a,c,p,l,o,n)}:function(i,a,s,f){return S.pathAnnulus(i,a,s,f,o,n)}}}}),n9=Ge({"src/traces/barpolar/hover.js"($,G){var h=qf(),b=yn(),S=Mc().getTraceColor,E=b.fillText,e=GE().makeHoverPointText,t=jE().isPtInsidePolygon;G.exports=function(o,n,i){var a=o.cd,s=a[0].trace,f=o.subplot,c=f.radialAxis,p=f.angularAxis,d=f.vangles,T=d?t:b.isPtInsideSector,l=o.maxHoverDistance,g=p._period||2*Math.PI,x=Math.abs(c.g2p(Math.sqrt(n*n+i*i))),A=Math.atan2(i,n);c.range[0]>c.range[1]&&(A+=Math.PI);var M=function(u){return T(x,A,[u.rp0,u.rp1],[u.thetag0,u.thetag1],d)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/g)-1+(u.rp1-x)/(u.rp1-u.rp0)-1:1/0};if(h.getClosest(a,M,o),o.index!==!1){var _=o.index,w=a[_];o.x0=o.x1=w.ct[0],o.y0=o.y1=w.ct[1];var m=b.extendFlat({},w,{r:w.s,theta:w.p});return E(w,s,o),e(m,s,f,o),o.hovertemplate=s.hovertemplate,o.color=S(s,w),o.xLabelVal=o.yLabelVal=void 0,w.s<0&&(o.idealAlign="left"),[o]}}}}),a9=Ge({"src/traces/barpolar/index.js"($,G){G.exports={moduleType:"trace",name:"barpolar",basePlotModule:qE(),categories:["polar","bar","showLegend"],attributes:TL(),layoutAttributes:AL(),supplyDefaults:e9(),supplyLayoutDefaults:t9(),calc:SL().calc,crossTraceCalc:SL().crossTraceCalc,plot:r9(),colorbar:Vf(),formatLabels:HE(),style:mv().style,styleOnSelect:mv().styleOnSelect,hoverPoints:n9(),selectPoints:ym(),meta:{}}}}),i9=Ge({"lib/barpolar.js"($,G){G.exports=a9()}}),ML=Ge({"src/plots/smith/constants.js"($,G){G.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),EL=Ge({"src/plots/smith/layout_attributes.js"($,G){var h=rh(),b=tv(),S=Sc().attributes,E=yn().extendFlat,e=Uc().overrideAll,t=e({color:b.color,showline:E({},b.showline,{dflt:!0}),linecolor:b.linecolor,linewidth:b.linewidth,showgrid:E({},b.showgrid,{dflt:!0}),gridcolor:b.gridcolor,gridwidth:b.gridwidth,griddash:b.griddash},"plot","from-root"),r=e({ticklen:b.ticklen,tickwidth:E({},b.tickwidth,{dflt:2}),tickcolor:b.tickcolor,showticklabels:b.showticklabels,labelalias:b.labelalias,showtickprefix:b.showtickprefix,tickprefix:b.tickprefix,showticksuffix:b.showticksuffix,ticksuffix:b.ticksuffix,tickfont:b.tickfont,tickformat:b.tickformat,hoverformat:b.hoverformat,layer:b.layer},"plot","from-root"),o=E({visible:E({},b.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:E({},b.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},t,r),n=E({visible:E({},b.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:b.ticks,editType:"calc"},t,r);G.exports={domain:S({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:h.background},realaxis:o,imaginaryaxis:n,editType:"calc"}}}),o9=Ge({"src/plots/smith/layout_defaults.js"($,G){var h=yn(),b=So(),S=mu(),E=B0(),e=Iv().getSubplotData,t=Sd(),r=Lp(),o=Uu(),n=Kd(),i=EL(),a=ML(),s=a.axisNames,f=p(function(d){return h.isTypedArray(d)&&(d=Array.from(d)),d.slice().reverse().map(function(T){return-T}).concat([0]).concat(d)},String);function c(d,T,l,g){var x=l("bgcolor");g.bgColor=b.combine(x,g.paper_bgcolor);var A=e(g.fullData,a.name,g.id),M=g.layoutOut,_;function w(j,Z){return l(_+"."+j,Z)}for(var m=0;m")}}G.exports={hoverPoints:b,makeHoverPointText:S}}}),v9=Ge({"src/traces/scattersmith/index.js"($,G){G.exports={moduleType:"trace",name:"scattersmith",basePlotModule:s9(),categories:["smith","symbols","showLegend","scatter-like"],attributes:kL(),supplyDefaults:l9(),colorbar:Vf(),formatLabels:u9(),calc:c9(),plot:f9(),style:Eh().style,styleOnSelect:Eh().styleOnSelect,hoverPoints:h9().hoverPoints,selectPoints:og(),meta:{}}}}),d9=Ge({"lib/scattersmith.js"($,G){G.exports=v9()}}),Fd=Ge({"node_modules/world-calendars/dist/main.js"($,G){var h=xv();function b(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}h(b.prototype,{instance:function(o,n){o=(o||"gregorian").toLowerCase(),n=n||"";var i=this._localCals[o+"-"+n];if(!i&&this.calendars[o]&&(i=new this.calendars[o](n),this._localCals[o+"-"+n]=i),!i)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,o);return i},newDate:function(o,n,i,a,s){return a=(o!=null&&o.year?o.calendar():typeof a=="string"?this.instance(a,s):a)||this.instance(),a.newDate(o,n,i)},substituteDigits:function(o){return function(n){return(n+"").replace(/[0-9]/g,function(i){return o[i]})}},substituteChineseDigits:function(o,n){return function(i){for(var a="",s=0;i>0;){var f=i%10;a=(f===0?"":o[f]+n[s])+a,s++,i=Math.floor(i/10)}return a.indexOf(o[1]+n[1])===0&&(a=a.substr(1)),a||o[0]}}});function S(o,n,i,a){if(this._calendar=o,this._year=n,this._month=i,this._day=a,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function E(o,n){return o=""+o,"000000".substring(0,n-o.length)+o}h(S.prototype,{newDate:function(o,n,i){return this._calendar.newDate(o??this,n,i)},year:function(o){return arguments.length===0?this._year:this.set(o,"y")},month:function(o){return arguments.length===0?this._month:this.set(o,"m")},day:function(o){return arguments.length===0?this._day:this.set(o,"d")},date:function(o,n,i){if(!this._calendar.isValid(o,n,i))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=o,this._month=n,this._day=i,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(o,n){return this._calendar.add(this,o,n)},set:function(o,n){return this._calendar.set(this,o,n)},compareTo:function(o){if(this._calendar.name!==o._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,o._calendar.local.name);var n=this._year!==o._year?this._year-o._year:this._month!==o._month?this.monthOfYear()-o.monthOfYear():this._day-o._day;return n===0?0:n<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(o){return this._calendar.fromJD(o)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(o){return this._calendar.fromJSDate(o)},toString:function(){return(this.year()<0?"-":"")+E(Math.abs(this.year()),4)+"-"+E(this.month(),2)+"-"+E(this.day(),2)}});function e(){this.shortYearCutoff="+10"}h(e.prototype,{_validateLevel:0,newDate:function(o,n,i){return o==null?this.today():(o.year&&(this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),i=o.day(),n=o.month(),o=o.year()),new S(this,o,n,i))},today:function(){return this.fromJSDate(new Date)},epoch:function(o){var n=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return n.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(o){var n=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(n.year()<0?"-":"")+E(Math.abs(n.year()),4)},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(o,n){var i=this._validate(o,n,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(i.month()+this.monthsInYear(i)-this.firstMonth)%this.monthsInYear(i)+this.minMonth},fromMonthOfYear:function(o,n){var i=(n+this.firstMonth-2*this.minMonth)%this.monthsInYear(o)+this.minMonth;return this._validate(o,i,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),i},daysInYear:function(o){var n=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(n)?366:365},dayOfYear:function(o,n,i){var a=this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return a.toJD()-this.newDate(a.year(),this.fromMonthOfYear(a.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(o,n,i){var a=this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(a))+2)%this.daysInWeek()},extraInfo:function(o,n,i){return this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(o,n,i){return this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(o,this._add(o,n,i),n,i)},_add:function(o,n,i){if(this._validateLevel++,i==="d"||i==="w"){var a=o.toJD()+n*(i==="w"?this.daysInWeek():1),s=o.calendar().fromJD(a);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var f=o.year()+(i==="y"?n:0),c=o.monthOfYear()+(i==="m"?n:0),s=o.day(),p=function(l){for(;cg-1+l.minMonth;)f++,c-=g,g=l.monthsInYear(f)};i==="y"?(o.month()!==this.fromMonthOfYear(f,c)&&(c=this.newDate(f,o.month(),this.minDay).monthOfYear()),c=Math.min(c,this.monthsInYear(f)),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,c)))):i==="m"&&(p(this),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,c))));var d=[f,this.fromMonthOfYear(f,c),s];return this._validateLevel--,d}catch(T){throw this._validateLevel--,T}},_correctAdd:function(o,n,i,a){if(!this.hasYearZero&&(a==="y"||a==="m")&&(n[0]===0||o.year()>0!=n[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[a],f=i<0?-1:1;n=this._add(o,i*s[0]+f*s[1],s[2])}return o.date(n[0],n[1],n[2])},set:function(o,n,i){this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var a=i==="y"?n:o.year(),s=i==="m"?n:o.month(),f=i==="d"?n:o.day();return(i==="y"||i==="m")&&(f=Math.min(f,this.daysInMonth(a,s))),o.date(a,s,f)},isValid:function(o,n,i){this._validateLevel++;var a=this.hasYearZero||o!==0;if(a){var s=this.newDate(o,n,this.minDay);a=n>=this.minMonth&&n-this.minMonth=this.minDay&&i-this.minDay13.5?13:1),T=s-(d>2.5?4716:4715);return T<=0&&T--,this.newDate(T,d,p)},toJSDate:function(o,n,i){var a=this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(a.year(),a.month()-1,a.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(o){return this.newDate(o.getFullYear(),o.getMonth()+1,o.getDate())}});var r=G.exports=new b;r.cdate=S,r.baseCalendar=e,r.calendars.gregorian=t}}),p9=Ge({"node_modules/world-calendars/dist/plus.js"(){var $=xv(),G=Fd();$(G.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),G.local=G.regionalOptions[""],$(G.cdate.prototype,{formatDate:function(h,b){return typeof h!="string"&&(b=h,h=""),this._calendar.formatDate(h||"",this,b)}}),$(G.baseCalendar.prototype,{UNIX_EPOCH:G.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:G.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(h,b,S){if(typeof h!="string"&&(S=b,b=h,h=""),!b)return"";if(b.calendar()!==this)throw G.local.invalidFormat||G.regionalOptions[""].invalidFormat;h=h||this.local.dateFormat,S=S||{};var E=S.dayNamesShort||this.local.dayNamesShort,e=S.dayNames||this.local.dayNames,t=S.monthNumbers||this.local.monthNumbers,r=S.monthNamesShort||this.local.monthNamesShort,o=S.monthNames||this.local.monthNames;S.calculateWeek||this.local.calculateWeek;for(var n=function(x,A){for(var M=1;g+M1},i=function(x,A,M,_){var w=""+A;if(n(x,_))for(;w.length1},g=function(I,L){var z=l(I,L),F=[2,3,z?4:2,z?4:2,10,11,20]["oyYJ@!".indexOf(I)+1],N=new RegExp("^-?\\d{1,"+F+"}"),B=b.substring(m).match(N);if(!B)throw(G.local.missingNumberAt||G.regionalOptions[""].missingNumberAt).replace(/\{0\}/,m);return m+=B[0].length,parseInt(B[0],10)},x=this,A=function(){if(typeof o=="function"){l("m");var I=o.call(x,b.substring(m));return m+=I.length,I}return g("m")},M=function(I,L,z,F){for(var N=l(I,F)?z:L,B=0;B-1){f=1,c=p;for(var y=this.daysInMonth(s,f);c>y;y=this.daysInMonth(s,f))f++,c-=y}return a>-1?this.fromJD(a):this.newDate(s,f,c)},determineDate:function(h,b,S,E,e){S&&typeof S!="object"&&(e=E,E=S,S=null),typeof E!="string"&&(e=E,E="");var t=this,r=function(o){try{return t.parseDate(E,o,e)}catch{}o=o.toLowerCase();for(var n=(o.match(/^c/)&&S?S.newDate():null)||t.today(),i=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,a=i.exec(o);a;)n.add(parseInt(a[1],10),a[2]||"d"),a=i.exec(o);return n};return b=b?b.newDate():null,h=h==null?b:typeof h=="string"?r(h):typeof h=="number"?isNaN(h)||h===1/0||h===-1/0?b:t.today().add(h,"d"):t.newDate(h),h}})}}),m9=Ge({"node_modules/world-calendars/dist/calendars/chinese.js"(){var $=Fd(),G=xv(),h=$.instance();function b(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}b.prototype=new $.baseCalendar,G(b.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(a,s){if(typeof a=="string"){var f=a.match(E);return f?f[0]:""}var c=this._validateYear(a),p=a.month(),d=""+this.toChineseMonth(c,p);return s&&d.length<2&&(d="0"+d),this.isIntercalaryMonth(c,p)&&(d+="i"),d},monthNames:function(a){if(typeof a=="string"){var s=a.match(e);return s?s[0]:""}var f=this._validateYear(a),c=a.month(),p=this.toChineseMonth(f,c),d=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][p-1];return this.isIntercalaryMonth(f,c)&&(d="闰"+d),d},monthNamesShort:function(a){if(typeof a=="string"){var s=a.match(t);return s?s[0]:""}var f=this._validateYear(a),c=a.month(),p=this.toChineseMonth(f,c),d=["一","二","三","四","五","六","七","八","九","十","十一","十二"][p-1];return this.isIntercalaryMonth(f,c)&&(d="闰"+d),d},parseMonth:function(a,s){a=this._validateYear(a);var f=parseInt(s),c;if(isNaN(f))s[0]==="闰"&&(c=!0,s=s.substring(1)),s[s.length-1]==="月"&&(s=s.substring(0,s.length-1)),f=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(s);else{var p=s[s.length-1];c=p==="i"||p==="I"}var d=this.toMonthIndex(a,f,c);return d},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(a,s){if(a.year&&(a=a.year()),typeof a!="number"||a<1888||a>2111)throw s.replace(/\{0\}/,this.local.name);return a},toMonthIndex:function(a,s,f){var c=this.intercalaryMonth(a),p=f&&s!==c;if(p||s<1||s>12)throw $.local.invalidMonth.replace(/\{0\}/,this.local.name);var d;return c?!f&&s<=c?d=s-1:d=s:d=s-1,d},toChineseMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var f=this.intercalaryMonth(a),c=f?12:11;if(s<0||s>c)throw $.local.invalidMonth.replace(/\{0\}/,this.local.name);var p;return f?s>13;return f},isIntercalaryMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var f=this.intercalaryMonth(a);return!!f&&f===s},leapYear:function(a){return this.intercalaryMonth(a)!==0},weekOfYear:function(a,s,f){var c=this._validateYear(a,$.local.invalidyear),p=o[c-o[0]],d=p>>9&4095,T=p>>5&15,l=p&31,g;g=h.newDate(d,T,l),g.add(4-(g.dayOfWeek()||7),"d");var x=this.toJD(a,s,f)-g.toJD();return 1+Math.floor(x/7)},monthsInYear:function(a){return this.leapYear(a)?13:12},daysInMonth:function(a,s){a.year&&(s=a.month(),a=a.year()),a=this._validateYear(a);var f=r[a-r[0]],c=f>>13,p=c?12:11;if(s>p)throw $.local.invalidMonth.replace(/\{0\}/,this.local.name);var d=f&1<<12-s?30:29;return d},weekDay:function(a,s,f){return(this.dayOfWeek(a,s,f)||7)<6},toJD:function(a,s,f){var c=this._validate(a,d,f,$.local.invalidDate);a=this._validateYear(c.year()),s=c.month(),f=c.day();var p=this.isIntercalaryMonth(a,s),d=this.toChineseMonth(a,s),T=i(a,d,f,p);return h.toJD(T.year,T.month,T.day)},fromJD:function(a){var s=h.fromJD(a),f=n(s.year(),s.month(),s.day()),c=this.toMonthIndex(f.year,f.month,f.isIntercalary);return this.newDate(f.year,c,f.day)},fromString:function(a){var s=a.match(S),f=this._validateYear(+s[1]),c=+s[2],p=!!s[3],d=this.toMonthIndex(f,c,p),T=+s[4];return this.newDate(f,d,T)},add:function(a,s,f){var c=a.year(),p=a.month(),d=this.isIntercalaryMonth(c,p),T=this.toChineseMonth(c,p),l=Object.getPrototypeOf(b.prototype).add.call(this,a,s,f);if(f==="y"){var g=l.year(),x=l.month(),A=this.isIntercalaryMonth(g,T),M=d&&A?this.toMonthIndex(g,T,!0):this.toMonthIndex(g,T,!1);M!==x&&l.month(M)}return l}});var S=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,E=/^\d?\d[iI]?/m,e=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;$.calendars.chinese=b;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function n(a,s,f,c){var p,d;if(typeof a=="object")p=a,d=s||{};else{var T=typeof a=="number"&&a>=1888&&a<=2111;if(!T)throw new Error("Solar year outside range 1888-2111");var l=typeof s=="number"&&s>=1&&s<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var g=typeof f=="number"&&f>=1&&f<=31;if(!g)throw new Error("Solar day outside range 1 - 31");p={year:a,month:s,day:f},d={}}var x=o[p.year-o[0]],A=p.year<<9|p.month<<5|p.day;d.year=A>=x?p.year:p.year-1,x=o[d.year-o[0]];var M=x>>9&4095,_=x>>5&15,w=x&31,m,u=new Date(M,_-1,w),v=new Date(p.year,p.month-1,p.day);m=Math.round((v-u)/(24*3600*1e3));var y=r[d.year-r[0]],I;for(I=0;I<13;I++){var L=y&1<<12-I?30:29;if(m>13;return!z||I=1888&&a<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var g=typeof s=="number"&&s>=1&&s<=12;if(!g)throw new Error("Lunar month outside range 1 - 12");var x=typeof f=="number"&&f>=1&&f<=30;if(!x)throw new Error("Lunar day outside range 1 - 30");var A;typeof c=="object"?(A=!1,d=c):(A=!!c,d={}),T={year:a,month:s,day:f,isIntercalary:A}}var M;M=T.day-1;var _=r[T.year-r[0]],w=_>>13,m;w&&(T.month>w||T.isIntercalary)?m=T.month:m=T.month-1;for(var u=0;u>9&4095,L=y>>5&15,z=y&31,F=new Date(I,L-1,z+M);return d.year=F.getFullYear(),d.month=1+F.getMonth(),d.day=F.getDate(),d}}}),g9=Ge({"node_modules/world-calendars/dist/calendars/coptic.js"(){var $=Fd(),G=xv();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var S=this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),E=S.year()+(S.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(b){return this._validate(b,this.minMonth,this.minDay,$.local.invalidYear||$.regionalOptions[""].invalidYear),13},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,$.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return(this.dayOfWeek(b,S,E)||7)<6},toJD:function(b,S,E){var e=this._validate(b,S,E,$.local.invalidDate);return b=e.year(),b<0&&b++,e.day()+(e.month()-1)*30+(b-1)*365+Math.floor(b/4)+this.jdEpoch-1},fromJD:function(b){var S=Math.floor(b)+.5-this.jdEpoch,E=Math.floor((S-Math.floor((S+366)/1461))/365)+1;E<=0&&E--,S=Math.floor(b)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(E,e,t)}}),$.calendars.coptic=h}}),y9=Ge({"node_modules/world-calendars/dist/calendars/discworld.js"(){var $=Fd(),G=xv();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(S){return this._validate(S,this.minMonth,this.minDay,$.local.invalidYear),!1},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,$.local.invalidYear),13},daysInYear:function(S){return this._validate(S,this.minMonth,this.minDay,$.local.invalidYear),400},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,$.local.invalidMonth);return this.daysPerMonth[e.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);return(t.day()+1)%8},weekDay:function(S,E,e){var t=this.dayOfWeek(S,E,e);return t>=2&&t<=6},extraInfo:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);return{century:b[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);return S=t.year()+(t.year()<0?1:0),E=t.month(),e=t.day(),e+(E>1?16:0)+(E>2?(E-2)*32:0)+(S-1)*400+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S+.5)-Math.floor(this.jdEpoch)-1;var E=Math.floor(S/400)+1;S-=(E-1)*400,S+=S>15?16:0;var e=Math.floor(S/32)+1,t=S-(e-1)*32+1;return this.newDate(E<=0?E-1:E,e,t)}});var b={20:"Fruitbat",21:"Anchovy"};$.calendars.discworld=h}}),_9=Ge({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var $=Fd(),G=xv();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var S=this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),E=S.year()+(S.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(b){return this._validate(b,this.minMonth,this.minDay,$.local.invalidYear||$.regionalOptions[""].invalidYear),13},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,$.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return(this.dayOfWeek(b,S,E)||7)<6},toJD:function(b,S,E){var e=this._validate(b,S,E,$.local.invalidDate);return b=e.year(),b<0&&b++,e.day()+(e.month()-1)*30+(b-1)*365+Math.floor(b/4)+this.jdEpoch-1},fromJD:function(b){var S=Math.floor(b)+.5-this.jdEpoch,E=Math.floor((S-Math.floor((S+366)/1461))/365)+1;E<=0&&E--,S=Math.floor(b)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(E,e,t)}}),$.calendars.ethiopian=h}}),x9=Ge({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var $=Fd(),G=xv();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,$.local.invalidYear);return this._leapYear(E.year())},_leapYear:function(S){return S=S<0?S+1:S,b(S*7+1,19)<7},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,$.local.invalidYear),this._leapYear(S.year?S.year():S)?13:12},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,$.local.invalidYear);return S=E.year(),this.toJD(S===-1?1:S+1,7,1)-this.toJD(S,7,1)},daysInMonth:function(S,E){return S.year&&(E=S.month(),S=S.year()),this._validate(S,E,this.minDay,$.local.invalidMonth),E===12&&this.leapYear(S)||E===8&&b(this.daysInYear(S),10)===5?30:E===9&&b(this.daysInYear(S),10)===3?29:this.daysPerMonth[E-1]},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==6},extraInfo:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);S=t.year(),E=t.month(),e=t.day();var r=S<=0?S+1:S,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(E<7){for(var n=7;n<=this.monthsInYear(S);n++)o+=this.daysInMonth(S,n);for(var n=1;n=this.toJD(E===-1?1:E+1,7,1);)E++;for(var e=Sthis.toJD(E,e,this.daysInMonth(E,e));)e++;var t=S-this.toJD(E,e,1)+1;return this.newDate(E,e,t)}});function b(S,E){return S-E*Math.floor(S/E)}$.calendars.hebrew=h}}),b9=Ge({"node_modules/world-calendars/dist/calendars/islamic.js"(){var $=Fd(),G=xv();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(b){var S=this._validate(b,this.minMonth,this.minDay,$.local.invalidYear);return(S.year()*11+14)%30<11},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(b){return this.leapYear(b)?355:354},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,$.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===12&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return this.dayOfWeek(b,S,E)!==5},toJD:function(b,S,E){var e=this._validate(b,S,E,$.local.invalidDate);return b=e.year(),S=e.month(),E=e.day(),b=b<=0?b+1:b,E+Math.ceil(29.5*(S-1))+(b-1)*354+Math.floor((3+11*b)/30)+this.jdEpoch-1},fromJD:function(b){b=Math.floor(b)+.5;var S=Math.floor((30*(b-this.jdEpoch)+10646)/10631);S=S<=0?S-1:S;var E=Math.min(12,Math.ceil((b-29-this.toJD(S,1,1))/29.5)+1),e=b-this.toJD(S,E,1)+1;return this.newDate(S,E,e)}}),$.calendars.islamic=h}}),w9=Ge({"node_modules/world-calendars/dist/calendars/julian.js"(){var $=Fd(),G=xv();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var S=this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),E=S.year()<0?S.year()+1:S.year();return E%4===0},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(4-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,$.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===2&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return(this.dayOfWeek(b,S,E)||7)<6},toJD:function(b,S,E){var e=this._validate(b,S,E,$.local.invalidDate);return b=e.year(),S=e.month(),E=e.day(),b<0&&b++,S<=2&&(b--,S+=12),Math.floor(365.25*(b+4716))+Math.floor(30.6001*(S+1))+E-1524.5},fromJD:function(b){var S=Math.floor(b+.5),E=S+1524,e=Math.floor((E-122.1)/365.25),t=Math.floor(365.25*e),r=Math.floor((E-t)/30.6001),o=r-Math.floor(r<14?1:13),n=e-Math.floor(o>2?4716:4715),i=E-t-Math.floor(30.6001*r);return n<=0&&n--,this.newDate(n,o,i)}}),$.calendars.julian=h}}),T9=Ge({"node_modules/world-calendars/dist/calendars/mayan.js"(){var $=Fd(),G=xv();function h(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(E){return this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),!1},formatYear:function(E){var e=this._validate(E,this.minMonth,this.minDay,$.local.invalidYear);E=e.year();var t=Math.floor(E/400);E=E%400,E+=E<0?400:0;var r=Math.floor(E/20);return t+"."+r+"."+E%20},forYear:function(E){if(E=E.split("."),E.length<3)throw"Invalid Mayan year";for(var e=0,t=0;t19||t>0&&r<0)throw"Invalid Mayan year";e=e*20+r}return e},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),18},weekOfYear:function(E,e,t){return this._validate(E,e,t,$.local.invalidDate),0},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,$.local.invalidYear),360},daysInMonth:function(E,e){return this._validate(E,e,this.minDay,$.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(E,e,t){var r=this._validate(E,e,t,$.local.invalidDate);return r.day()},weekDay:function(E,e,t){return this._validate(E,e,t,$.local.invalidDate),!0},extraInfo:function(E,e,t){var r=this._validate(E,e,t,$.local.invalidDate),o=r.toJD(),n=this._toHaab(o),i=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[n[0]-1],haabMonth:n[0],haabDay:n[1],tzolkinDayName:this.local.tzolkinMonths[i[0]-1],tzolkinDay:i[0],tzolkinTrecena:i[1]}},_toHaab:function(E){E-=this.jdEpoch;var e=b(E+8+340,365);return[Math.floor(e/20)+1,b(e,20)]},_toTzolkin:function(E){return E-=this.jdEpoch,[S(E+20,20),S(E+4,13)]},toJD:function(E,e,t){var r=this._validate(E,e,t,$.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(E){E=Math.floor(E)+.5-this.jdEpoch;var e=Math.floor(E/360);E=E%360,E+=E<0?360:0;var t=Math.floor(E/20),r=E%20;return this.newDate(e,t,r)}});function b(E,e){return E-e*Math.floor(E/e)}function S(E,e){return b(E-1,e)+1}$.calendars.mayan=h}}),A9=Ge({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var $=Fd(),G=xv();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar;var b=$.instance("gregorian");G(h.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,$.local.invalidYear||$.regionalOptions[""].invalidYear);return b.leapYear(E.year()+(E.year()<1?1:0)+1469)},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,$.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,$.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),n=1;n=this.toJD(E+1,1,1);)E++;for(var e=S-Math.floor(this.toJD(E,1,1)+.5)+1,t=1;e>this.daysInMonth(E,t);)e-=this.daysInMonth(E,t),t++;return this.newDate(E,t,e)}}),$.calendars.nanakshahi=h}}),S9=Ge({"node_modules/world-calendars/dist/calendars/nepali.js"(){var $=Fd(),G=xv();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(b){return this.daysInYear(b)!==this.daysPerYear},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(b){var S=this._validate(b,this.minMonth,this.minDay,$.local.invalidYear);if(b=S.year(),typeof this.NEPALI_CALENDAR_DATA[b]>"u")return this.daysPerYear;for(var E=0,e=this.minMonth;e<=12;e++)E+=this.NEPALI_CALENDAR_DATA[b][e];return E},daysInMonth:function(b,S){return b.year&&(S=b.month(),b=b.year()),this._validate(b,S,this.minDay,$.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[b]>"u"?this.daysPerMonth[S-1]:this.NEPALI_CALENDAR_DATA[b][S]},weekDay:function(b,S,E){return this.dayOfWeek(b,S,E)!==6},toJD:function(b,S,E){var e=this._validate(b,S,E,$.local.invalidDate);b=e.year(),S=e.month(),E=e.day();var t=$.instance(),r=0,o=S,n=b;this._createMissingCalendarData(b);var i=b-(o>9||o===9&&E>=this.NEPALI_CALENDAR_DATA[n][0]?56:57);for(S!==9&&(r=E,o--);o!==9;)o<=0&&(o=12,n--),r+=this.NEPALI_CALENDAR_DATA[n][o],o--;return S===9?(r+=E-this.NEPALI_CALENDAR_DATA[n][0],r<0&&(r+=t.daysInYear(i))):r+=this.NEPALI_CALENDAR_DATA[n][9]-this.NEPALI_CALENDAR_DATA[n][0],t.newDate(i,1,1).add(r,"d").toJD()},fromJD:function(b){var S=$.instance(),E=S.fromJD(b),e=E.year(),t=E.dayOfYear(),r=e+56;this._createMissingCalendarData(r);for(var o=9,n=this.NEPALI_CALENDAR_DATA[r][0],i=this.NEPALI_CALENDAR_DATA[r][o]-n+1;t>i;)o++,o>12&&(o=1,r++),i+=this.NEPALI_CALENDAR_DATA[r][o];var a=this.NEPALI_CALENDAR_DATA[r][o]-(i-t);return this.newDate(r,o,a)},_createMissingCalendarData:function(b){var S=this.daysPerMonth.slice(0);S.unshift(17);for(var E=b-1;E"u"&&(this.NEPALI_CALENDAR_DATA[E]=S)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),$.calendars.nepali=h}}),M9=Ge({"node_modules/world-calendars/dist/calendars/persian.js"(){var $=Fd(),G=xv();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}function b(S){var E=S-475;S<0&&E++;var e=.242197,t=e*E,r=e*(E+1),o=t-Math.floor(t),n=r-Math.floor(r);return o>n}h.prototype=new $.baseCalendar,G(h.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,$.local.invalidYear);return b(E.year())},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,$.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==5},toJD:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate);S=t.year(),E=t.month(),e=t.day();var r=0;if(S>0)for(var o=1;o0?S-1:S)*365+r+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S)+.5;var E=475+(S-this.toJD(475,1,1))/365.242197,e=Math.floor(E);e<=0&&e--,S>this.toJD(e,12,b(e)?30:29)&&(e++,e===0&&e++);var t=S-this.toJD(e,1,1)+1,r=t<=186?Math.ceil(t/31):Math.ceil((t-6)/30),o=S-this.toJD(e,r,1)+1;return this.newDate(e,r,o)}}),$.calendars.persian=h,$.calendars.jalali=h}}),E9=Ge({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var $=Fd(),G=xv(),h=$.instance();function b(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}b.prototype=new $.baseCalendar,G(b.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var E=this._validate(e,this.minMonth,this.minDay,$.local.invalidYear),e=this._t2gYear(E.year());return h.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,$.local.invalidYear),r=this._t2gYear(t.year());return h.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,$.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,$.local.invalidDate),r=this._t2gYear(t.year());return h.toJD(r,t.month(),t.day())},fromJD:function(S){var E=h.fromJD(S),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(S){return S+this.yearsOffset+(S>=-this.yearsOffset&&S<=-1?1:0)},_g2tYear:function(S){return S-this.yearsOffset-(S>=1&&S<=this.yearsOffset?1:0)}}),$.calendars.taiwan=b}}),k9=Ge({"node_modules/world-calendars/dist/calendars/thai.js"(){var $=Fd(),G=xv(),h=$.instance();function b(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}b.prototype=new $.baseCalendar,G(b.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var E=this._validate(e,this.minMonth,this.minDay,$.local.invalidYear),e=this._t2gYear(E.year());return h.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,$.local.invalidYear),r=this._t2gYear(t.year());return h.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,$.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,$.local.invalidDate),r=this._t2gYear(t.year());return h.toJD(r,t.month(),t.day())},fromJD:function(S){var E=h.fromJD(S),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(S){return S-this.yearsOffset-(S>=1&&S<=this.yearsOffset?1:0)},_g2tYear:function(S){return S+this.yearsOffset+(S>=-this.yearsOffset&&S<=-1?1:0)}}),$.calendars.thai=b}}),C9=Ge({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var $=Fd(),G=xv();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new $.baseCalendar,G(h.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,$.local.invalidYear);return this.daysInYear(E.year())===355},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){for(var E=0,e=1;e<=12;e++)E+=this.daysInMonth(S,e);return E},daysInMonth:function(S,E){for(var e=this._validate(S,E,this.minDay,$.local.invalidMonth),t=e.toJD()-24e5+.5,r=0,o=0;ot)return b[r]-b[r-1];r++}return 30},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==5},toJD:function(S,E,e){var t=this._validate(S,E,e,$.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+b[r-1]-1;return o+24e5-.5},fromJD:function(S){for(var E=S-24e5+.5,e=0,t=0;tE);t++)e++;var r=e+15292,o=Math.floor((r-1)/12),n=o+1,i=r-12*o,a=E-b[e-1]+1;return this.newDate(n,i,a)},isValid:function(S,E,e){var t=$.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(S=S.year!=null?S.year:S,t=S>=1276&&S<=1500),t},_validate:function(S,E,e,t){var r=$.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),$.calendars.ummalqura=h;var b=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),L9=Ge({"src/components/calendars/calendars.js"($,G){G.exports=Fd(),p9(),m9(),g9(),y9(),_9(),x9(),b9(),w9(),T9(),A9(),S9(),M9(),E9(),k9(),C9()}}),P9=Ge({"src/components/calendars/index.js"($,G){var h=L9(),b=yn(),S=hi(),E=S.EPOCHJD,e=S.ONEDAY,t={valType:"enumerated",values:b.sortObjectKeys(h.calendars),editType:"calc",dflt:"gregorian"},r=function(_,w,m,u){var v={};return v[m]=t,b.coerce(_,w,v,m,u)},o=function(_,w,m,u){for(var v=0;v1?Si.jsx("textarea",{value:ut,rows:sr,readOnly:wt,onChange:tn=>Tt&&Tt(tn.target.value),className:`${vr} ${br} resize-none`}):Si.jsx("input",{type:"text",value:ut,readOnly:wt,onChange:tn=>Tt&&Tt(tn.target.value),className:`${vr} ${br}`})]})}function DO({tabs:Ie,activeTab:ut,onChange:Tt}){return Si.jsx("div",{className:"flex mb-4 border-b border-gray-200",children:Ie.map(wt=>Si.jsx("button",{onClick:()=>Tt(wt),className:`px-5 py-1 cursor-pointer rounded ${ut===wt?"text-orange-400 border-b-2 border-orange-400":"text-gray-950 hover:bg-gray-200"}`,children:wt},wt))})}function zO({comparisons:Ie,data:ut,isLoading:Tt,xlim:wt,ylim:sr,setAxisLimits:vr,currentIteration:br,showGradientField:tn,bivariatePlotView:an}){const Zr=an==="Function surface"&&!!ut.functionValues?.z,Sn=(Ie??[]).flatMap((Za,Oo)=>Za.visible?[{x:Za.values?.x??[],y:Za.values?.y??[],z:Zr?Za.values?.z??[]:void 0,type:Zr?"scatter3d":"scatter",mode:"lines+markers",name:`${Oo+1}. ${Za.settings.algorithm}`,legendgroup:String(Za.id),showlegend:!0,line:{color:Za.color,width:Zr?6:2},marker:{color:Za.color,size:Zr?2.5:6}},{x:Za.values?.x.slice(-1)??[],y:Za.values?.y.slice(-1)??[],z:Zr?Za.values?.z?.slice(-1)??[]:void 0,type:Zr?"scatter3d":"scatter",mode:"markers",name:`${Oo+1}. ${Za.settings.algorithm}`,legendgroup:String(Za.id),showlegend:!1,marker:{color:Za.color,size:Zr?4:12,line:{color:"white",width:Zr?1:2}}}]:[]);let Ln=ut.functionValues?ut.functionValues.x:[],fa=ut.functionValues?ut.functionValues.y:[],Gn=ut.functionValues&&ut.functionValues.z?ut.functionValues.z:[],ao=ut.functionValues?.gradientX??[],qi=ut.functionValues?.gradientY??[];console.log("gradientX",ao),console.log("gradientY",qi);let Lo=ut.trajectoryValues?ut.trajectoryValues.x:[],si=ut.trajectoryValues?ut.trajectoryValues.y:[],Ge=ut.trajectoryValues&&ut.trajectoryValues.z?ut.trajectoryValues.z:[];const zo=ku.useMemo(()=>{if(Gn.length===0)return null;let Za=1/0,Oo=-1/0;for(const po of Gn)for(const js of po)Number.isFinite(js)&&(Za=Math.min(Za,js),Oo=Math.max(Oo,js));if(!Number.isFinite(Za)||!Number.isFinite(Oo))return null;const Mi=Oo===Za?Math.max(Math.abs(Za)*.1,1):(Oo-Za)*.1;return[Za-Mi,Oo+Mi]},[Gn]),xl=ku.useMemo(()=>{const Za={shaftX:[],shaftY:[],headX:[],headY:[],headAngles:[],hoverData:[]};if(!tn||ao.length!==fa.length||qi.length!==fa.length||Ln.length===0||fa.length===0)return Za;const Oo=5,Mi=5,po=[],js=[],Ga=[],hi=[],ai=[],yo=[],ro=[];for(let Sa=0;Sa0?ro.reduce((Sa,Vi)=>Sa+Vi,0)/ro.length:0;console.log("average_grad_length",Ll),console.log("cell diagonal",Math.hypot(Ln[Mi]-Ln[0],fa[Oo]-fa[0]));const ma=1.8*Ll/Math.hypot(Ln[Mi]-Ln[0],fa[Oo]-fa[0]);console.log("grad_scale",ma);for(let Sa=0;Sa0?1.2:1/1.2,Mi=po=>{const js=(po[0]+po[1])/2,Ga=(po[1]-po[0])*Oo/2;return[js-Ga,js+Ga]};vr(Mi(wt),Mi(sr))}return Tt&&Yi?Si.jsx(ST,{className:"min-h-[320px] flex flex-1 items-center justify-center p-6",children:Si.jsx("div",{className:"text-center",children:Si.jsx("div",{className:"text-lg font-medium",children:"Loading..."})})}):Gn.length===0?Si.jsx(ST,{className:"min-h-[320px] flex-1",children:Si.jsx(eM,{ref:go,onRelayout:Za=>{const Oo=Za["xaxis.range[0]"],Mi=Za["xaxis.range[1]"],po=Za["yaxis.range[0]"],js=Za["yaxis.range[1]"];typeof Oo=="number"&&typeof Mi=="number"&&typeof po=="number"&&typeof js=="number"&&vr([Oo,Mi],[po,js])},data:[{x:Ln,y:fa,type:"scatter",mode:"lines",line:{color:"#1f77b4",width:2},hoverinfo:"skip",showlegend:!1},{x:Lo,y:si,type:"scatter",mode:"lines+markers",line:{color:"#d97871",width:2},marker:{color:"#d97871",size:10},hoverinfo:"skip",showlegend:!1},{x:Lo[br]!==void 0?[Lo[br]]:[],y:si[br]!==void 0?[si[br]]:[],type:"scatter",mode:"markers",marker:{color:"red",size:12},hoverinfo:"skip",showlegend:!1},...Sn],layout:{...mi.current,showlegend:Ie!==void 0,legend:{x:.02,y:.98,xanchor:"left",yanchor:"top",bgcolor:"rgba(255,255,255,0.75)"}},style:{width:"100%",height:"100%"},config:{responsive:!0,displayModeBar:!0,scrollZoom:!0}})}):Zr?Si.jsx("div",{className:"min-h-[420px] flex-1",onWheel:As,children:Si.jsx(ST,{className:"h-full",children:Si.jsx(eM,{ref:go,data:[{x:Ln,y:fa,z:Gn,type:"surface",colorscale:"Viridis",opacity:.82,showscale:!0,hovertemplate:"x: %{x:.5g}
y: %{y:.5g}
z: %{z:.5g}"},{x:Lo,y:si,z:Ge,type:"scatter3d",mode:"lines+markers",line:{color:"#d97871",width:6},marker:{color:"#d97871",size:2.5},hoverinfo:"skip",showlegend:!1},{x:Lo[br]!==void 0?[Lo[br]]:[],y:si[br]!==void 0?[si[br]]:[],z:Ge[br]!==void 0?[Ge[br]]:[],type:"scatter3d",mode:"markers",marker:{color:"red",size:7},hoverinfo:"skip",showlegend:!1},...Sn],layout:{uirevision:"bivariate-surface",dragmode:"orbit",showlegend:Ie!==void 0,legend:{x:.02,y:.98,xanchor:"left",yanchor:"top",bgcolor:"rgba(255,255,255,0.75)"},scene:{aspectmode:"cube",xaxis:{title:{text:"x"},range:wt,autorange:!1},yaxis:{title:{text:"y"},range:sr,autorange:!1},zaxis:{title:{text:"z"},range:zo??void 0,autorange:!1}},margin:{t:30,r:20,b:20,l:20}},style:{width:"100%",height:"100%"},config:{responsive:!0,displayModeBar:!0,scrollZoom:!1}})})}):Si.jsx(ST,{className:"min-h-[420px] flex-1",children:Si.jsx(eM,{ref:go,onRelayout:Za=>{const Oo=Za["xaxis.range[0]"],Mi=Za["xaxis.range[1]"],po=Za["yaxis.range[0]"],js=Za["yaxis.range[1]"];typeof Oo=="number"&&typeof Mi=="number"&&typeof po=="number"&&typeof js=="number"&&vr([Oo,Mi],[po,js])},data:[{x:Ln,y:fa,z:Gn,zmin:zo?.[0],zmax:zo?.[1],type:"contour",colorscale:"Viridis",hoverinfo:"skip",showlegend:!1,contours:{coloring:"heatmap",showlines:!1}},{x:xl.shaftX,y:xl.shaftY,type:"scatter",mode:"lines",line:{color:"rgba(255, 255, 255, 0.8)",width:1},hoverinfo:"skip",showlegend:!1,cliponaxis:!0},{x:xl.headX,y:xl.headY,customdata:xl.hoverData,type:"scatter",mode:"markers",marker:{symbol:"triangle-up",size:5,color:"rgba(255, 255, 255, 0.8)",angle:xl.headAngles,angleref:"up"},hovertemplate:"x: %{customdata[0]:.5g}
y: %{customdata[1]:.5g}
gx: %{customdata[2]:.5g}
gy: %{customdata[3]:.5g}",showlegend:!1,cliponaxis:!0},{x:Lo,y:si,customdata:Ge,type:"scatter",mode:"lines+markers",line:{color:"#d97871",width:2},marker:{color:"#d97871",size:10},hovertemplate:"x: %{x:.5g}
y: %{y:.5g}
f(x, y): %{customdata:.5g}",showlegend:!1},{x:Lo[br]!==void 0?[Lo[br]]:[],y:si[br]!==void 0?[si[br]]:[],customdata:Ge[br]!==void 0?[Ge[br]]:[],type:"scatter",mode:"markers",marker:{color:"red",size:12},hovertemplate:"x: %{x:.5g}
y: %{y:.5g}
f(x, y): %{customdata:.5g}",showlegend:!1},...Sn],layout:{...mi.current,annotations:[],showlegend:Ie!==void 0,legend:{x:.02,y:.98,xanchor:"left",yanchor:"top",bgcolor:"rgba(255,255,255,0.75)"}},style:{width:"100%",height:"100%"},config:{responsive:!0,displayModeBar:!0,scrollZoom:!0}})})}const OO=["Gradient Descent","Nesterov","Newton","Adam","Adagrad","RMSProp","Adadelta"],t4={"Gradient Descent":{learningRate:"0.1",momentum:"0.0"},Nesterov:{learningRate:"0.1",momentum:"0.1"},Adam:{learningRate:"0.1",beta1:"0.9",beta2:"0.999",epsilon:"1e-8"},Adagrad:{learningRate:"0.1",epsilon:"1e-8"},RMSProp:{learningRate:"0.1",beta:"0.9",epsilon:"1e-8"},Adadelta:{beta:"0.9",epsilon:"1e-3"},Newton:{}};function r4({settings:Ie,setSettings:ut,onRandomInitialPoint:Tt,showInitialPoint:wt=!0}){function sr(an,Zr){if(an==="algorithm"){const Sn=t4[Zr];ut({mode:Ie.mode,functionExpr:Ie.functionExpr,x0:Ie.x0,y0:Ie.y0,algorithm:Zr,...Sn})}else ut({...Ie,[an]:Zr})}const[vr,br]=ku.useState(()=>[Ie.x0??"",Ie.y0??""].filter(an=>an!=="").join(", "));ku.useEffect(()=>{Ie.mode==="Bivariate"&&br([Ie.x0??"",Ie.y0??""].filter(an=>an!=="").join(", "))},[Ie.mode,Ie.x0,Ie.y0]);function tn(an){if(br(an),Ie.mode==="Bivariate"){const Zr=an.split(",").map(fa=>fa.trim()),[Sn,Ln]=Zr;ut({...Ie,x0:Sn??"",y0:Ln??Ie.y0??""})}else sr("x0",an)}return Si.jsxs(Si.Fragment,{children:[Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-0.5",children:[Si.jsx("label",{className:"text-sm font-semibold whitespace-nowrap pr-0.25",children:"Algorithm"}),Si.jsx("div",{className:"min-w-0",children:Si.jsx("select",{value:Ie.algorithm,onChange:an=>sr("algorithm",an.target.value),className:"h-10 w-full rounded border border-stone-300 bg-white px-2 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-stone-400",children:OO.map(an=>Si.jsx("option",{value:an,children:an},an))})})]}),wt&&(Ie.mode==="Bivariate"?Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-0.5",children:[Si.jsx("label",{className:"text-sm font-medium whitespace-nowrap pr-0.25",children:"Initial (X, Y)"}),Si.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[Si.jsx("input",{type:"text",value:vr,onChange:an=>tn(an.target.value),className:"h-10 w-full rounded border border-stone-300 px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-stone-400"}),Si.jsx("button",{type:"button",onClick:Tt,className:"h-10 rounded border border-gray-300 bg-orange-200 px-3 py-1 text-sm text-stone-700 hover:bg-orange-300",children:"random"})]})]}):Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-0.5",children:[Si.jsx("label",{className:"text-sm font-medium whitespace-nowrap pr-0.25",children:"Initial X"}),Si.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[Si.jsx("input",{type:"text",value:Ie.x0,onChange:an=>sr("x0",an.target.value),className:"h-10 w-full rounded border border-stone-300 px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-stone-400"}),Si.jsx("button",{type:"button",onClick:Tt,className:"h-10 rounded border border-gray-300 bg-orange-200 px-3 py-1 text-sm text-stone-700 hover:bg-orange-300",children:"random"})]})]})),Si.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[["Gradient Descent","Nesterov","Adam","Adagrad","RMSProp"].includes(Ie.algorithm)&&Si.jsx(Si.Fragment,{children:Si.jsx(K_,{label:"Learning Rate",value:Ie.learningRate,onChange:an=>sr("learningRate",an)})}),["Gradient Descent","Nesterov"].includes(Ie.algorithm)&&Si.jsx(Si.Fragment,{children:Si.jsx(K_,{label:"Momentum",value:Ie.momentum,onChange:an=>sr("momentum",an)})}),Ie.algorithm==="Adam"&&Si.jsxs(Si.Fragment,{children:[Si.jsx(K_,{label:"Beta 1",value:Ie.beta1,onChange:an=>sr("beta1",an)}),Si.jsx(K_,{label:"Beta 2",value:Ie.beta2,onChange:an=>sr("beta2",an)})]}),["RMSProp","Adadelta"].includes(Ie.algorithm)&&Si.jsx(Si.Fragment,{children:Si.jsx(K_,{label:"Beta",value:Ie.beta,onChange:an=>sr("beta",an)})}),["Adam","Adagrad","RMSProp","Adadelta"].includes(Ie.algorithm)&&Si.jsx(Si.Fragment,{children:Si.jsx(K_,{label:"Epsilon",value:Ie.epsilon,onChange:an=>sr("epsilon",an)})})]})]})}function FO(Ie,ut){const Tt={};return(Ie[Ie.length-1]===""?[...Ie,""]:Ie).join((Tt.padRight?" ":"")+","+(Tt.padLeft===!1?"":" ")).trim()}const BO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,UO={};function v8(Ie,ut){return(UO.jsx?NO:BO).test(Ie)}const jO=/[ \t\n\f\r]/g;function qO(Ie){return typeof Ie=="object"?Ie.type==="text"?d8(Ie.value):!1:d8(Ie)}function d8(Ie){return Ie.replace(jO,"")===""}class LT{constructor(ut,Tt,wt){this.normal=Tt,this.property=ut,wt&&(this.space=wt)}}LT.prototype.normal={};LT.prototype.property={};LT.prototype.space=void 0;function n4(Ie,ut){const Tt={},wt={};for(const sr of Ie)Object.assign(Tt,sr.property),Object.assign(wt,sr.normal);return new LT(Tt,wt,ut)}function $6(Ie){return Ie.toLowerCase()}class Ep{constructor(ut,Tt){this.attribute=Tt,this.property=ut}}Ep.prototype.attribute="";Ep.prototype.booleanish=!1;Ep.prototype.boolean=!1;Ep.prototype.commaOrSpaceSeparated=!1;Ep.prototype.commaSeparated=!1;Ep.prototype.defined=!1;Ep.prototype.mustUseProperty=!1;Ep.prototype.number=!1;Ep.prototype.overloadedBoolean=!1;Ep.prototype.property="";Ep.prototype.spaceSeparated=!1;Ep.prototype.space=void 0;let VO=0;const Nu=$_(),Vv=$_(),J6=$_(),Go=$_(),hh=$_(),Lw=$_(),e0=$_();function $_(){return 2**++VO}const Q6=Object.freeze(Object.defineProperty({__proto__:null,boolean:Nu,booleanish:Vv,commaOrSpaceSeparated:e0,commaSeparated:Lw,number:Go,overloadedBoolean:J6,spaceSeparated:hh},Symbol.toStringTag,{value:"Module"})),B6=Object.keys(Q6);class lk extends Ep{constructor(ut,Tt,wt,sr){let vr=-1;if(super(ut,Tt),p8(this,"space",sr),typeof wt=="number")for(;++vr4&&Tt.slice(0,4)==="data"&&ZO.test(ut)){if(ut.charAt(4)==="-"){const vr=ut.slice(5).replace(m8,$O);wt="data"+vr.charAt(0).toUpperCase()+vr.slice(1)}else{const vr=ut.slice(4);if(!m8.test(vr)){let br=vr.replace(YO,KO);br.charAt(0)!=="-"&&(br="-"+br),ut="data"+br}}sr=lk}return new sr(wt,ut)}function KO(Ie){return"-"+Ie.toLowerCase()}function $O(Ie){return Ie.charAt(1).toUpperCase()}const JO=n4([a4,HO,s4,l4,u4],"html"),uk=n4([a4,GO,s4,l4,u4],"svg");function QO(Ie){return Ie.join(" ").trim()}var kw={},N6,g8;function eF(){if(g8)return N6;g8=1;var Ie=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ut=/\n/g,Tt=/^\s*/,wt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,sr=/^:\s*/,vr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,br=/^[;\s]*/,tn=/^\s+|\s+$/g,an=` -`,Zr="/",Sn="*",Ln="",fa="comment",Gn="declaration";function ao(Lo,si){if(typeof Lo!="string")throw new TypeError("First argument must be a string");if(!Lo)return[];si=si||{};var Ge=1,zo=1;function xl(Ga){var hi=Ga.match(ut);hi&&(Ge+=hi.length);var ai=Ga.lastIndexOf(an);zo=~ai?Ga.length-ai:zo+Ga.length}function go(){var Ga={line:Ge,column:zo};return function(hi){return hi.position=new mi(Ga),Za(),hi}}function mi(Ga){this.start=Ga,this.end={line:Ge,column:zo},this.source=si.source}mi.prototype.content=Lo;function Yi(Ga){var hi=new Error(si.source+":"+Ge+":"+zo+": "+Ga);if(hi.reason=Ga,hi.filename=si.source,hi.line=Ge,hi.column=zo,hi.source=Lo,!si.silent)throw hi}function As(Ga){var hi=Ga.exec(Lo);if(hi){var ai=hi[0];return xl(ai),Lo=Lo.slice(ai.length),hi}}function Za(){As(Tt)}function Oo(Ga){var hi;for(Ga=Ga||[];hi=Mi();)hi!==!1&&Ga.push(hi);return Ga}function Mi(){var Ga=go();if(!(Zr!=Lo.charAt(0)||Sn!=Lo.charAt(1))){for(var hi=2;Ln!=Lo.charAt(hi)&&(Sn!=Lo.charAt(hi)||Zr!=Lo.charAt(hi+1));)++hi;if(hi+=2,Ln===Lo.charAt(hi-1))return Yi("End of comment missing");var ai=Lo.slice(2,hi-2);return zo+=2,xl(ai),Lo=Lo.slice(hi),zo+=2,Ga({type:fa,comment:ai})}}function po(){var Ga=go(),hi=As(wt);if(hi){if(Mi(),!As(sr))return Yi("property missing ':'");var ai=As(vr),yo=Ga({type:Gn,property:qi(hi[0].replace(Ie,Ln)),value:ai?qi(ai[0].replace(Ie,Ln)):Ln});return As(br),yo}}function js(){var Ga=[];Oo(Ga);for(var hi;hi=po();)hi!==!1&&(Ga.push(hi),Oo(Ga));return Ga}return Za(),js()}function qi(Lo){return Lo?Lo.replace(tn,Ln):Ln}return N6=ao,N6}var y8;function tF(){if(y8)return kw;y8=1;var Ie=kw&&kw.__importDefault||function(wt){return wt&&wt.__esModule?wt:{default:wt}};Object.defineProperty(kw,"__esModule",{value:!0}),kw.default=Tt;const ut=Ie(eF());function Tt(wt,sr){let vr=null;if(!wt||typeof wt!="string")return vr;const br=(0,ut.default)(wt),tn=typeof sr=="function";return br.forEach(an=>{if(an.type!=="declaration")return;const{property:Zr,value:Sn}=an;tn?sr(Zr,Sn,an):Sn&&(vr=vr||{},vr[Zr]=Sn)}),vr}return kw}var bT={},_8;function rF(){if(_8)return bT;_8=1,Object.defineProperty(bT,"__esModule",{value:!0}),bT.camelCase=void 0;var Ie=/^--[a-zA-Z0-9_-]+$/,ut=/-([a-z])/g,Tt=/^[^-]+$/,wt=/^-(webkit|moz|ms|o|khtml)-/,sr=/^-(ms)-/,vr=function(Zr){return!Zr||Tt.test(Zr)||Ie.test(Zr)},br=function(Zr,Sn){return Sn.toUpperCase()},tn=function(Zr,Sn){return"".concat(Sn,"-")},an=function(Zr,Sn){return Sn===void 0&&(Sn={}),vr(Zr)?Zr:(Zr=Zr.toLowerCase(),Sn.reactCompat?Zr=Zr.replace(sr,tn):Zr=Zr.replace(wt,tn),Zr.replace(ut,br))};return bT.camelCase=an,bT}var wT,x8;function nF(){if(x8)return wT;x8=1;var Ie=wT&&wT.__importDefault||function(sr){return sr&&sr.__esModule?sr:{default:sr}},ut=Ie(tF()),Tt=rF();function wt(sr,vr){var br={};return!sr||typeof sr!="string"||(0,ut.default)(sr,function(tn,an){tn&&an&&(br[(0,Tt.camelCase)(tn,vr)]=an)}),br}return wt.default=wt,wT=wt,wT}var aF=nF();const iF=sk(aF),c4=f4("end"),ck=f4("start");function f4(Ie){return ut;function ut(Tt){const wt=Tt&&Tt.position&&Tt.position[Ie]||{};if(typeof wt.line=="number"&&wt.line>0&&typeof wt.column=="number"&&wt.column>0)return{line:wt.line,column:wt.column,offset:typeof wt.offset=="number"&&wt.offset>-1?wt.offset:void 0}}}function oF(Ie){const ut=ck(Ie),Tt=c4(Ie);if(ut&&Tt)return{start:ut,end:Tt}}function MT(Ie){return!Ie||typeof Ie!="object"?"":"position"in Ie||"type"in Ie?b8(Ie.position):"start"in Ie||"end"in Ie?b8(Ie):"line"in Ie||"column"in Ie?ek(Ie):""}function ek(Ie){return w8(Ie&&Ie.line)+":"+w8(Ie&&Ie.column)}function b8(Ie){return ek(Ie&&Ie.start)+"-"+ek(Ie&&Ie.end)}function w8(Ie){return Ie&&typeof Ie=="number"?Ie:1}class Zd extends Error{constructor(ut,Tt,wt){super(),typeof Tt=="string"&&(wt=Tt,Tt=void 0);let sr="",vr={},br=!1;if(Tt&&("line"in Tt&&"column"in Tt?vr={place:Tt}:"start"in Tt&&"end"in Tt?vr={place:Tt}:"type"in Tt?vr={ancestors:[Tt],place:Tt.position}:vr={...Tt}),typeof ut=="string"?sr=ut:!vr.cause&&ut&&(br=!0,sr=ut.message,vr.cause=ut),!vr.ruleId&&!vr.source&&typeof wt=="string"){const an=wt.indexOf(":");an===-1?vr.ruleId=wt:(vr.source=wt.slice(0,an),vr.ruleId=wt.slice(an+1))}if(!vr.place&&vr.ancestors&&vr.ancestors){const an=vr.ancestors[vr.ancestors.length-1];an&&(vr.place=an.position)}const tn=vr.place&&"start"in vr.place?vr.place.start:vr.place;this.ancestors=vr.ancestors||void 0,this.cause=vr.cause||void 0,this.column=tn?tn.column:void 0,this.fatal=void 0,this.file="",this.message=sr,this.line=tn?tn.line:void 0,this.name=MT(vr.place)||"1:1",this.place=vr.place||void 0,this.reason=this.message,this.ruleId=vr.ruleId||void 0,this.source=vr.source||void 0,this.stack=br&&vr.cause&&typeof vr.cause.stack=="string"?vr.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zd.prototype.file="";Zd.prototype.name="";Zd.prototype.reason="";Zd.prototype.message="";Zd.prototype.stack="";Zd.prototype.column=void 0;Zd.prototype.line=void 0;Zd.prototype.ancestors=void 0;Zd.prototype.cause=void 0;Zd.prototype.fatal=void 0;Zd.prototype.place=void 0;Zd.prototype.ruleId=void 0;Zd.prototype.source=void 0;const fk={}.hasOwnProperty,sF=new Map,lF=/[A-Z]/g,uF=new Set(["table","tbody","thead","tfoot","tr"]),cF=new Set(["td","th"]),h4="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function fF(Ie,ut){if(!ut||ut.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const Tt=ut.filePath||void 0;let wt;if(ut.development){if(typeof ut.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");wt=_F(Tt,ut.jsxDEV)}else{if(typeof ut.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof ut.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");wt=yF(Tt,ut.jsx,ut.jsxs)}const sr={Fragment:ut.Fragment,ancestors:[],components:ut.components||{},create:wt,elementAttributeNameCase:ut.elementAttributeNameCase||"react",evaluater:ut.createEvaluater?ut.createEvaluater():void 0,filePath:Tt,ignoreInvalidStyle:ut.ignoreInvalidStyle||!1,passKeys:ut.passKeys!==!1,passNode:ut.passNode||!1,schema:ut.space==="svg"?uk:JO,stylePropertyNameCase:ut.stylePropertyNameCase||"dom",tableCellAlignToStyle:ut.tableCellAlignToStyle!==!1},vr=v4(sr,Ie,void 0);return vr&&typeof vr!="string"?vr:sr.create(Ie,sr.Fragment,{children:vr||void 0},void 0)}function v4(Ie,ut,Tt){if(ut.type==="element")return hF(Ie,ut,Tt);if(ut.type==="mdxFlowExpression"||ut.type==="mdxTextExpression")return vF(Ie,ut);if(ut.type==="mdxJsxFlowElement"||ut.type==="mdxJsxTextElement")return pF(Ie,ut,Tt);if(ut.type==="mdxjsEsm")return dF(Ie,ut);if(ut.type==="root")return mF(Ie,ut,Tt);if(ut.type==="text")return gF(Ie,ut)}function hF(Ie,ut,Tt){const wt=Ie.schema;let sr=wt;ut.tagName.toLowerCase()==="svg"&&wt.space==="html"&&(sr=uk,Ie.schema=sr),Ie.ancestors.push(ut);const vr=p4(Ie,ut.tagName,!1),br=xF(Ie,ut);let tn=vk(Ie,ut);return uF.has(ut.tagName)&&(tn=tn.filter(function(an){return typeof an=="string"?!qO(an):!0})),d4(Ie,br,vr,ut),hk(br,tn),Ie.ancestors.pop(),Ie.schema=wt,Ie.create(ut,vr,br,Tt)}function vF(Ie,ut){if(ut.data&&ut.data.estree&&Ie.evaluater){const wt=ut.data.estree.body[0];return wt.type,Ie.evaluater.evaluateExpression(wt.expression)}CT(Ie,ut.position)}function dF(Ie,ut){if(ut.data&&ut.data.estree&&Ie.evaluater)return Ie.evaluater.evaluateProgram(ut.data.estree);CT(Ie,ut.position)}function pF(Ie,ut,Tt){const wt=Ie.schema;let sr=wt;ut.name==="svg"&&wt.space==="html"&&(sr=uk,Ie.schema=sr),Ie.ancestors.push(ut);const vr=ut.name===null?Ie.Fragment:p4(Ie,ut.name,!0),br=bF(Ie,ut),tn=vk(Ie,ut);return d4(Ie,br,vr,ut),hk(br,tn),Ie.ancestors.pop(),Ie.schema=wt,Ie.create(ut,vr,br,Tt)}function mF(Ie,ut,Tt){const wt={};return hk(wt,vk(Ie,ut)),Ie.create(ut,Ie.Fragment,wt,Tt)}function gF(Ie,ut){return ut.value}function d4(Ie,ut,Tt,wt){typeof Tt!="string"&&Tt!==Ie.Fragment&&Ie.passNode&&(ut.node=wt)}function hk(Ie,ut){if(ut.length>0){const Tt=ut.length>1?ut:ut[0];Tt&&(Ie.children=Tt)}}function yF(Ie,ut,Tt){return wt;function wt(sr,vr,br,tn){const Zr=Array.isArray(br.children)?Tt:ut;return tn?Zr(vr,br,tn):Zr(vr,br)}}function _F(Ie,ut){return Tt;function Tt(wt,sr,vr,br){const tn=Array.isArray(vr.children),an=ck(wt);return ut(sr,vr,br,tn,{columnNumber:an?an.column-1:void 0,fileName:Ie,lineNumber:an?an.line:void 0},void 0)}}function xF(Ie,ut){const Tt={};let wt,sr;for(sr in ut.properties)if(sr!=="children"&&fk.call(ut.properties,sr)){const vr=wF(Ie,sr,ut.properties[sr]);if(vr){const[br,tn]=vr;Ie.tableCellAlignToStyle&&br==="align"&&typeof tn=="string"&&cF.has(ut.tagName)?wt=tn:Tt[br]=tn}}if(wt){const vr=Tt.style||(Tt.style={});vr[Ie.stylePropertyNameCase==="css"?"text-align":"textAlign"]=wt}return Tt}function bF(Ie,ut){const Tt={};for(const wt of ut.attributes)if(wt.type==="mdxJsxExpressionAttribute")if(wt.data&&wt.data.estree&&Ie.evaluater){const vr=wt.data.estree.body[0];vr.type;const br=vr.expression;br.type;const tn=br.properties[0];tn.type,Object.assign(Tt,Ie.evaluater.evaluateExpression(tn.argument))}else CT(Ie,ut.position);else{const sr=wt.name;let vr;if(wt.value&&typeof wt.value=="object")if(wt.value.data&&wt.value.data.estree&&Ie.evaluater){const tn=wt.value.data.estree.body[0];tn.type,vr=Ie.evaluater.evaluateExpression(tn.expression)}else CT(Ie,ut.position);else vr=wt.value===null?!0:wt.value;Tt[sr]=vr}return Tt}function vk(Ie,ut){const Tt=[];let wt=-1;const sr=Ie.passKeys?new Map:sF;for(;++wtsr?0:sr+ut:ut=ut>sr?sr:ut,Tt=Tt>0?Tt:0,wt.length<1e4)br=Array.from(wt),br.unshift(ut,Tt),Ie.splice(...br);else for(Tt&&Ie.splice(ut,Tt);vr0?(Zm(Ie,Ie.length,0,ut),Ie):ut}const S8={}.hasOwnProperty;function LF(Ie){const ut={};let Tt=-1;for(;++Tt13&&Tt<32||Tt>126&&Tt<160||Tt>55295&&Tt<57344||Tt>64975&&Tt<65008||(Tt&65535)===65535||(Tt&65535)===65534||Tt>1114111?"�":String.fromCodePoint(Tt)}function Pw(Ie){return Ie.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ym=p1(/[A-Za-z]/),t0=p1(/[\dA-Za-z]/),IF=p1(/[#-'*+\--9=?A-Z^-~]/);function tk(Ie){return Ie!==null&&(Ie<32||Ie===127)}const rk=p1(/\d/),DF=p1(/[\dA-Fa-f]/),zF=p1(/[!-/:-@[-`{-~]/);function pu(Ie){return Ie!==null&&Ie<-2}function Mp(Ie){return Ie!==null&&(Ie<0||Ie===32)}function xf(Ie){return Ie===-2||Ie===-1||Ie===32}const OF=p1(new RegExp("\\p{P}|\\p{S}","u")),FF=p1(/\s/);function p1(Ie){return ut;function ut(Tt){return Tt!==null&&Tt>-1&&Ie.test(String.fromCharCode(Tt))}}function Iw(Ie){const ut=[];let Tt=-1,wt=0,sr=0;for(;++Tt55295&&vr<57344){const tn=Ie.charCodeAt(Tt+1);vr<56320&&tn>56319&&tn<57344?(br=String.fromCharCode(vr,tn),sr=1):br="�"}else br=String.fromCharCode(vr);br&&(ut.push(Ie.slice(wt,Tt),encodeURIComponent(br)),wt=Tt+sr+1,br=""),sr&&(Tt+=sr,sr=0)}return ut.join("")+Ie.slice(wt)}function vh(Ie,ut,Tt,wt){const sr=wt?wt-1:Number.POSITIVE_INFINITY;let vr=0;return br;function br(an){return xf(an)?(Ie.enter(Tt),tn(an)):ut(an)}function tn(an){return xf(an)&&vr++br))return;const Yi=ut.events.length;let As=Yi,Za,Oo;for(;As--;)if(ut.events[As][0]==="exit"&&ut.events[As][1].type==="chunkFlow"){if(Za){Oo=ut.events[As][1].end;break}Za=!0}for(si(wt),mi=Yi;mizo;){const go=Tt[xl];ut.containerState=go[1],go[0].exit.call(ut,Ie)}Tt.length=zo}function Ge(){sr.write([null]),vr=void 0,sr=void 0,ut.containerState._closeFlow=void 0}}function qF(Ie,ut,Tt){return vh(Ie,Ie.attempt(this.parser.constructs.document,ut,Tt),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function E8(Ie){if(Ie===null||Mp(Ie)||FF(Ie))return 1;if(OF(Ie))return 2}function pk(Ie,ut,Tt){const wt=[];let sr=-1;for(;++sr1&&Ie[Tt][1].end.offset-Ie[Tt][1].start.offset>1?2:1;const Ln={...Ie[wt][1].end},fa={...Ie[Tt][1].start};k8(Ln,-an),k8(fa,an),br={type:an>1?"strongSequence":"emphasisSequence",start:Ln,end:{...Ie[wt][1].end}},tn={type:an>1?"strongSequence":"emphasisSequence",start:{...Ie[Tt][1].start},end:fa},vr={type:an>1?"strongText":"emphasisText",start:{...Ie[wt][1].end},end:{...Ie[Tt][1].start}},sr={type:an>1?"strong":"emphasis",start:{...br.start},end:{...tn.end}},Ie[wt][1].end={...br.start},Ie[Tt][1].start={...tn.end},Zr=[],Ie[wt][1].end.offset-Ie[wt][1].start.offset&&(Zr=T0(Zr,[["enter",Ie[wt][1],ut],["exit",Ie[wt][1],ut]])),Zr=T0(Zr,[["enter",sr,ut],["enter",br,ut],["exit",br,ut],["enter",vr,ut]]),Zr=T0(Zr,pk(ut.parser.constructs.insideSpan.null,Ie.slice(wt+1,Tt),ut)),Zr=T0(Zr,[["exit",vr,ut],["enter",tn,ut],["exit",tn,ut],["exit",sr,ut]]),Ie[Tt][1].end.offset-Ie[Tt][1].start.offset?(Sn=2,Zr=T0(Zr,[["enter",Ie[Tt][1],ut],["exit",Ie[Tt][1],ut]])):Sn=0,Zm(Ie,wt-1,Tt-wt+3,Zr),Tt=wt+Zr.length-Sn-2;break}}for(Tt=-1;++Tt0&&xf(mi)?vh(Ie,Ge,"linePrefix",vr+1)(mi):Ge(mi)}function Ge(mi){return mi===null||pu(mi)?Ie.check(C8,qi,xl)(mi):(Ie.enter("codeFlowValue"),zo(mi))}function zo(mi){return mi===null||pu(mi)?(Ie.exit("codeFlowValue"),Ge(mi)):(Ie.consume(mi),zo)}function xl(mi){return Ie.exit("codeFenced"),ut(mi)}function go(mi,Yi,As){let Za=0;return Oo;function Oo(hi){return mi.enter("lineEnding"),mi.consume(hi),mi.exit("lineEnding"),Mi}function Mi(hi){return mi.enter("codeFencedFence"),xf(hi)?vh(mi,po,"linePrefix",wt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(hi):po(hi)}function po(hi){return hi===tn?(mi.enter("codeFencedFenceSequence"),js(hi)):As(hi)}function js(hi){return hi===tn?(Za++,mi.consume(hi),js):Za>=br?(mi.exit("codeFencedFenceSequence"),xf(hi)?vh(mi,Ga,"whitespace")(hi):Ga(hi)):As(hi)}function Ga(hi){return hi===null||pu(hi)?(mi.exit("codeFencedFence"),Yi(hi)):As(hi)}}}function eB(Ie,ut,Tt){const wt=this;return sr;function sr(br){return br===null?Tt(br):(Ie.enter("lineEnding"),Ie.consume(br),Ie.exit("lineEnding"),vr)}function vr(br){return wt.parser.lazy[wt.now().line]?Tt(br):ut(br)}}const j6={name:"codeIndented",tokenize:rB},tB={partial:!0,tokenize:nB};function rB(Ie,ut,Tt){const wt=this;return sr;function sr(Zr){return Ie.enter("codeIndented"),vh(Ie,vr,"linePrefix",5)(Zr)}function vr(Zr){const Sn=wt.events[wt.events.length-1];return Sn&&Sn[1].type==="linePrefix"&&Sn[2].sliceSerialize(Sn[1],!0).length>=4?br(Zr):Tt(Zr)}function br(Zr){return Zr===null?an(Zr):pu(Zr)?Ie.attempt(tB,br,an)(Zr):(Ie.enter("codeFlowValue"),tn(Zr))}function tn(Zr){return Zr===null||pu(Zr)?(Ie.exit("codeFlowValue"),br(Zr)):(Ie.consume(Zr),tn)}function an(Zr){return Ie.exit("codeIndented"),ut(Zr)}}function nB(Ie,ut,Tt){const wt=this;return sr;function sr(br){return wt.parser.lazy[wt.now().line]?Tt(br):pu(br)?(Ie.enter("lineEnding"),Ie.consume(br),Ie.exit("lineEnding"),sr):vh(Ie,vr,"linePrefix",5)(br)}function vr(br){const tn=wt.events[wt.events.length-1];return tn&&tn[1].type==="linePrefix"&&tn[2].sliceSerialize(tn[1],!0).length>=4?ut(br):pu(br)?sr(br):Tt(br)}}const aB={name:"codeText",previous:oB,resolve:iB,tokenize:sB};function iB(Ie){let ut=Ie.length-4,Tt=3,wt,sr;if((Ie[Tt][1].type==="lineEnding"||Ie[Tt][1].type==="space")&&(Ie[ut][1].type==="lineEnding"||Ie[ut][1].type==="space")){for(wt=Tt;++wt=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+ut+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return utthis.left.length?this.right.slice(this.right.length-wt+this.left.length,this.right.length-ut+this.left.length).reverse():this.left.slice(ut).concat(this.right.slice(this.right.length-wt+this.left.length).reverse())}splice(ut,Tt,wt){const sr=Tt||0;this.setCursor(Math.trunc(ut));const vr=this.right.splice(this.right.length-sr,Number.POSITIVE_INFINITY);return wt&&TT(this.left,wt),vr.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(ut){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(ut)}pushMany(ut){this.setCursor(Number.POSITIVE_INFINITY),TT(this.left,ut)}unshift(ut){this.setCursor(0),this.right.push(ut)}unshiftMany(ut){this.setCursor(0),TT(this.right,ut.reverse())}setCursor(ut){if(!(ut===this.left.length||ut>this.left.length&&this.right.length===0||ut<0&&this.left.length===0))if(ut=4?ut(br):Ie.interrupt(wt.parser.constructs.flow,Tt,ut)(br)}}function w4(Ie,ut,Tt,wt,sr,vr,br,tn,an){const Zr=an||Number.POSITIVE_INFINITY;let Sn=0;return Ln;function Ln(si){return si===60?(Ie.enter(wt),Ie.enter(sr),Ie.enter(vr),Ie.consume(si),Ie.exit(vr),fa):si===null||si===32||si===41||tk(si)?Tt(si):(Ie.enter(wt),Ie.enter(br),Ie.enter(tn),Ie.enter("chunkString",{contentType:"string"}),qi(si))}function fa(si){return si===62?(Ie.enter(vr),Ie.consume(si),Ie.exit(vr),Ie.exit(sr),Ie.exit(wt),ut):(Ie.enter(tn),Ie.enter("chunkString",{contentType:"string"}),Gn(si))}function Gn(si){return si===62?(Ie.exit("chunkString"),Ie.exit(tn),fa(si)):si===null||si===60||pu(si)?Tt(si):(Ie.consume(si),si===92?ao:Gn)}function ao(si){return si===60||si===62||si===92?(Ie.consume(si),Gn):Gn(si)}function qi(si){return!Sn&&(si===null||si===41||Mp(si))?(Ie.exit("chunkString"),Ie.exit(tn),Ie.exit(br),Ie.exit(wt),ut(si)):Sn999||Gn===null||Gn===91||Gn===93&&!an||Gn===94&&!tn&&"_hiddenFootnoteSupport"in br.parser.constructs?Tt(Gn):Gn===93?(Ie.exit(vr),Ie.enter(sr),Ie.consume(Gn),Ie.exit(sr),Ie.exit(wt),ut):pu(Gn)?(Ie.enter("lineEnding"),Ie.consume(Gn),Ie.exit("lineEnding"),Sn):(Ie.enter("chunkString",{contentType:"string"}),Ln(Gn))}function Ln(Gn){return Gn===null||Gn===91||Gn===93||pu(Gn)||tn++>999?(Ie.exit("chunkString"),Sn(Gn)):(Ie.consume(Gn),an||(an=!xf(Gn)),Gn===92?fa:Ln)}function fa(Gn){return Gn===91||Gn===92||Gn===93?(Ie.consume(Gn),tn++,Ln):Ln(Gn)}}function A4(Ie,ut,Tt,wt,sr,vr){let br;return tn;function tn(fa){return fa===34||fa===39||fa===40?(Ie.enter(wt),Ie.enter(sr),Ie.consume(fa),Ie.exit(sr),br=fa===40?41:fa,an):Tt(fa)}function an(fa){return fa===br?(Ie.enter(sr),Ie.consume(fa),Ie.exit(sr),Ie.exit(wt),ut):(Ie.enter(vr),Zr(fa))}function Zr(fa){return fa===br?(Ie.exit(vr),an(br)):fa===null?Tt(fa):pu(fa)?(Ie.enter("lineEnding"),Ie.consume(fa),Ie.exit("lineEnding"),vh(Ie,Zr,"linePrefix")):(Ie.enter("chunkString",{contentType:"string"}),Sn(fa))}function Sn(fa){return fa===br||fa===null||pu(fa)?(Ie.exit("chunkString"),Zr(fa)):(Ie.consume(fa),fa===92?Ln:Sn)}function Ln(fa){return fa===br||fa===92?(Ie.consume(fa),Sn):Sn(fa)}}function ET(Ie,ut){let Tt;return wt;function wt(sr){return pu(sr)?(Ie.enter("lineEnding"),Ie.consume(sr),Ie.exit("lineEnding"),Tt=!0,wt):xf(sr)?vh(Ie,wt,Tt?"linePrefix":"lineSuffix")(sr):ut(sr)}}const pB={name:"definition",tokenize:gB},mB={partial:!0,tokenize:yB};function gB(Ie,ut,Tt){const wt=this;let sr;return vr;function vr(Gn){return Ie.enter("definition"),br(Gn)}function br(Gn){return T4.call(wt,Ie,tn,Tt,"definitionLabel","definitionLabelMarker","definitionLabelString")(Gn)}function tn(Gn){return sr=Pw(wt.sliceSerialize(wt.events[wt.events.length-1][1]).slice(1,-1)),Gn===58?(Ie.enter("definitionMarker"),Ie.consume(Gn),Ie.exit("definitionMarker"),an):Tt(Gn)}function an(Gn){return Mp(Gn)?ET(Ie,Zr)(Gn):Zr(Gn)}function Zr(Gn){return w4(Ie,Sn,Tt,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(Gn)}function Sn(Gn){return Ie.attempt(mB,Ln,Ln)(Gn)}function Ln(Gn){return xf(Gn)?vh(Ie,fa,"whitespace")(Gn):fa(Gn)}function fa(Gn){return Gn===null||pu(Gn)?(Ie.exit("definition"),wt.parser.defined.push(sr),ut(Gn)):Tt(Gn)}}function yB(Ie,ut,Tt){return wt;function wt(tn){return Mp(tn)?ET(Ie,sr)(tn):Tt(tn)}function sr(tn){return A4(Ie,vr,Tt,"definitionTitle","definitionTitleMarker","definitionTitleString")(tn)}function vr(tn){return xf(tn)?vh(Ie,br,"whitespace")(tn):br(tn)}function br(tn){return tn===null||pu(tn)?ut(tn):Tt(tn)}}const _B={name:"hardBreakEscape",tokenize:xB};function xB(Ie,ut,Tt){return wt;function wt(vr){return Ie.enter("hardBreakEscape"),Ie.consume(vr),sr}function sr(vr){return pu(vr)?(Ie.exit("hardBreakEscape"),ut(vr)):Tt(vr)}}const bB={name:"headingAtx",resolve:wB,tokenize:TB};function wB(Ie,ut){let Tt=Ie.length-2,wt=3,sr,vr;return Ie[wt][1].type==="whitespace"&&(wt+=2),Tt-2>wt&&Ie[Tt][1].type==="whitespace"&&(Tt-=2),Ie[Tt][1].type==="atxHeadingSequence"&&(wt===Tt-1||Tt-4>wt&&Ie[Tt-2][1].type==="whitespace")&&(Tt-=wt+1===Tt?2:4),Tt>wt&&(sr={type:"atxHeadingText",start:Ie[wt][1].start,end:Ie[Tt][1].end},vr={type:"chunkText",start:Ie[wt][1].start,end:Ie[Tt][1].end,contentType:"text"},Zm(Ie,wt,Tt-wt+1,[["enter",sr,ut],["enter",vr,ut],["exit",vr,ut],["exit",sr,ut]])),Ie}function TB(Ie,ut,Tt){let wt=0;return sr;function sr(Sn){return Ie.enter("atxHeading"),vr(Sn)}function vr(Sn){return Ie.enter("atxHeadingSequence"),br(Sn)}function br(Sn){return Sn===35&&wt++<6?(Ie.consume(Sn),br):Sn===null||Mp(Sn)?(Ie.exit("atxHeadingSequence"),tn(Sn)):Tt(Sn)}function tn(Sn){return Sn===35?(Ie.enter("atxHeadingSequence"),an(Sn)):Sn===null||pu(Sn)?(Ie.exit("atxHeading"),ut(Sn)):xf(Sn)?vh(Ie,tn,"whitespace")(Sn):(Ie.enter("atxHeadingText"),Zr(Sn))}function an(Sn){return Sn===35?(Ie.consume(Sn),an):(Ie.exit("atxHeadingSequence"),tn(Sn))}function Zr(Sn){return Sn===null||Sn===35||Mp(Sn)?(Ie.exit("atxHeadingText"),tn(Sn)):(Ie.consume(Sn),Zr)}}const AB=["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"],P8=["pre","script","style","textarea"],SB={concrete:!0,name:"htmlFlow",resolveTo:kB,tokenize:CB},MB={partial:!0,tokenize:PB},EB={partial:!0,tokenize:LB};function kB(Ie){let ut=Ie.length;for(;ut--&&!(Ie[ut][0]==="enter"&&Ie[ut][1].type==="htmlFlow"););return ut>1&&Ie[ut-2][1].type==="linePrefix"&&(Ie[ut][1].start=Ie[ut-2][1].start,Ie[ut+1][1].start=Ie[ut-2][1].start,Ie.splice(ut-2,2)),Ie}function CB(Ie,ut,Tt){const wt=this;let sr,vr,br,tn,an;return Zr;function Zr(Xn){return Sn(Xn)}function Sn(Xn){return Ie.enter("htmlFlow"),Ie.enter("htmlFlowData"),Ie.consume(Xn),Ln}function Ln(Xn){return Xn===33?(Ie.consume(Xn),fa):Xn===47?(Ie.consume(Xn),vr=!0,qi):Xn===63?(Ie.consume(Xn),sr=3,wt.interrupt?ut:ma):Ym(Xn)?(Ie.consume(Xn),br=String.fromCharCode(Xn),Lo):Tt(Xn)}function fa(Xn){return Xn===45?(Ie.consume(Xn),sr=2,Gn):Xn===91?(Ie.consume(Xn),sr=5,tn=0,ao):Ym(Xn)?(Ie.consume(Xn),sr=4,wt.interrupt?ut:ma):Tt(Xn)}function Gn(Xn){return Xn===45?(Ie.consume(Xn),wt.interrupt?ut:ma):Tt(Xn)}function ao(Xn){const os="CDATA[";return Xn===os.charCodeAt(tn++)?(Ie.consume(Xn),tn===os.length?wt.interrupt?ut:po:ao):Tt(Xn)}function qi(Xn){return Ym(Xn)?(Ie.consume(Xn),br=String.fromCharCode(Xn),Lo):Tt(Xn)}function Lo(Xn){if(Xn===null||Xn===47||Xn===62||Mp(Xn)){const os=Xn===47,ks=br.toLowerCase();return!os&&!vr&&P8.includes(ks)?(sr=1,wt.interrupt?ut(Xn):po(Xn)):AB.includes(br.toLowerCase())?(sr=6,os?(Ie.consume(Xn),si):wt.interrupt?ut(Xn):po(Xn)):(sr=7,wt.interrupt&&!wt.parser.lazy[wt.now().line]?Tt(Xn):vr?Ge(Xn):zo(Xn))}return Xn===45||t0(Xn)?(Ie.consume(Xn),br+=String.fromCharCode(Xn),Lo):Tt(Xn)}function si(Xn){return Xn===62?(Ie.consume(Xn),wt.interrupt?ut:po):Tt(Xn)}function Ge(Xn){return xf(Xn)?(Ie.consume(Xn),Ge):Oo(Xn)}function zo(Xn){return Xn===47?(Ie.consume(Xn),Oo):Xn===58||Xn===95||Ym(Xn)?(Ie.consume(Xn),xl):xf(Xn)?(Ie.consume(Xn),zo):Oo(Xn)}function xl(Xn){return Xn===45||Xn===46||Xn===58||Xn===95||t0(Xn)?(Ie.consume(Xn),xl):go(Xn)}function go(Xn){return Xn===61?(Ie.consume(Xn),mi):xf(Xn)?(Ie.consume(Xn),go):zo(Xn)}function mi(Xn){return Xn===null||Xn===60||Xn===61||Xn===62||Xn===96?Tt(Xn):Xn===34||Xn===39?(Ie.consume(Xn),an=Xn,Yi):xf(Xn)?(Ie.consume(Xn),mi):As(Xn)}function Yi(Xn){return Xn===an?(Ie.consume(Xn),an=null,Za):Xn===null||pu(Xn)?Tt(Xn):(Ie.consume(Xn),Yi)}function As(Xn){return Xn===null||Xn===34||Xn===39||Xn===47||Xn===60||Xn===61||Xn===62||Xn===96||Mp(Xn)?go(Xn):(Ie.consume(Xn),As)}function Za(Xn){return Xn===47||Xn===62||xf(Xn)?zo(Xn):Tt(Xn)}function Oo(Xn){return Xn===62?(Ie.consume(Xn),Mi):Tt(Xn)}function Mi(Xn){return Xn===null||pu(Xn)?po(Xn):xf(Xn)?(Ie.consume(Xn),Mi):Tt(Xn)}function po(Xn){return Xn===45&&sr===2?(Ie.consume(Xn),ai):Xn===60&&sr===1?(Ie.consume(Xn),yo):Xn===62&&sr===4?(Ie.consume(Xn),Sa):Xn===63&&sr===3?(Ie.consume(Xn),ma):Xn===93&&sr===5?(Ie.consume(Xn),Ll):pu(Xn)&&(sr===6||sr===7)?(Ie.exit("htmlFlowData"),Ie.check(MB,Vi,js)(Xn)):Xn===null||pu(Xn)?(Ie.exit("htmlFlowData"),js(Xn)):(Ie.consume(Xn),po)}function js(Xn){return Ie.check(EB,Ga,Vi)(Xn)}function Ga(Xn){return Ie.enter("lineEnding"),Ie.consume(Xn),Ie.exit("lineEnding"),hi}function hi(Xn){return Xn===null||pu(Xn)?js(Xn):(Ie.enter("htmlFlowData"),po(Xn))}function ai(Xn){return Xn===45?(Ie.consume(Xn),ma):po(Xn)}function yo(Xn){return Xn===47?(Ie.consume(Xn),br="",ro):po(Xn)}function ro(Xn){if(Xn===62){const os=br.toLowerCase();return P8.includes(os)?(Ie.consume(Xn),Sa):po(Xn)}return Ym(Xn)&&br.length<8?(Ie.consume(Xn),br+=String.fromCharCode(Xn),ro):po(Xn)}function Ll(Xn){return Xn===93?(Ie.consume(Xn),ma):po(Xn)}function ma(Xn){return Xn===62?(Ie.consume(Xn),Sa):Xn===45&&sr===2?(Ie.consume(Xn),ma):po(Xn)}function Sa(Xn){return Xn===null||pu(Xn)?(Ie.exit("htmlFlowData"),Vi(Xn)):(Ie.consume(Xn),Sa)}function Vi(Xn){return Ie.exit("htmlFlow"),ut(Xn)}}function LB(Ie,ut,Tt){const wt=this;return sr;function sr(br){return pu(br)?(Ie.enter("lineEnding"),Ie.consume(br),Ie.exit("lineEnding"),vr):Tt(br)}function vr(br){return wt.parser.lazy[wt.now().line]?Tt(br):ut(br)}}function PB(Ie,ut,Tt){return wt;function wt(sr){return Ie.enter("lineEnding"),Ie.consume(sr),Ie.exit("lineEnding"),Ie.attempt(iM,ut,Tt)}}const RB={name:"htmlText",tokenize:IB};function IB(Ie,ut,Tt){const wt=this;let sr,vr,br;return tn;function tn(ma){return Ie.enter("htmlText"),Ie.enter("htmlTextData"),Ie.consume(ma),an}function an(ma){return ma===33?(Ie.consume(ma),Zr):ma===47?(Ie.consume(ma),go):ma===63?(Ie.consume(ma),zo):Ym(ma)?(Ie.consume(ma),As):Tt(ma)}function Zr(ma){return ma===45?(Ie.consume(ma),Sn):ma===91?(Ie.consume(ma),vr=0,ao):Ym(ma)?(Ie.consume(ma),Ge):Tt(ma)}function Sn(ma){return ma===45?(Ie.consume(ma),Gn):Tt(ma)}function Ln(ma){return ma===null?Tt(ma):ma===45?(Ie.consume(ma),fa):pu(ma)?(br=Ln,yo(ma)):(Ie.consume(ma),Ln)}function fa(ma){return ma===45?(Ie.consume(ma),Gn):Ln(ma)}function Gn(ma){return ma===62?ai(ma):ma===45?fa(ma):Ln(ma)}function ao(ma){const Sa="CDATA[";return ma===Sa.charCodeAt(vr++)?(Ie.consume(ma),vr===Sa.length?qi:ao):Tt(ma)}function qi(ma){return ma===null?Tt(ma):ma===93?(Ie.consume(ma),Lo):pu(ma)?(br=qi,yo(ma)):(Ie.consume(ma),qi)}function Lo(ma){return ma===93?(Ie.consume(ma),si):qi(ma)}function si(ma){return ma===62?ai(ma):ma===93?(Ie.consume(ma),si):qi(ma)}function Ge(ma){return ma===null||ma===62?ai(ma):pu(ma)?(br=Ge,yo(ma)):(Ie.consume(ma),Ge)}function zo(ma){return ma===null?Tt(ma):ma===63?(Ie.consume(ma),xl):pu(ma)?(br=zo,yo(ma)):(Ie.consume(ma),zo)}function xl(ma){return ma===62?ai(ma):zo(ma)}function go(ma){return Ym(ma)?(Ie.consume(ma),mi):Tt(ma)}function mi(ma){return ma===45||t0(ma)?(Ie.consume(ma),mi):Yi(ma)}function Yi(ma){return pu(ma)?(br=Yi,yo(ma)):xf(ma)?(Ie.consume(ma),Yi):ai(ma)}function As(ma){return ma===45||t0(ma)?(Ie.consume(ma),As):ma===47||ma===62||Mp(ma)?Za(ma):Tt(ma)}function Za(ma){return ma===47?(Ie.consume(ma),ai):ma===58||ma===95||Ym(ma)?(Ie.consume(ma),Oo):pu(ma)?(br=Za,yo(ma)):xf(ma)?(Ie.consume(ma),Za):ai(ma)}function Oo(ma){return ma===45||ma===46||ma===58||ma===95||t0(ma)?(Ie.consume(ma),Oo):Mi(ma)}function Mi(ma){return ma===61?(Ie.consume(ma),po):pu(ma)?(br=Mi,yo(ma)):xf(ma)?(Ie.consume(ma),Mi):Za(ma)}function po(ma){return ma===null||ma===60||ma===61||ma===62||ma===96?Tt(ma):ma===34||ma===39?(Ie.consume(ma),sr=ma,js):pu(ma)?(br=po,yo(ma)):xf(ma)?(Ie.consume(ma),po):(Ie.consume(ma),Ga)}function js(ma){return ma===sr?(Ie.consume(ma),sr=void 0,hi):ma===null?Tt(ma):pu(ma)?(br=js,yo(ma)):(Ie.consume(ma),js)}function Ga(ma){return ma===null||ma===34||ma===39||ma===60||ma===61||ma===96?Tt(ma):ma===47||ma===62||Mp(ma)?Za(ma):(Ie.consume(ma),Ga)}function hi(ma){return ma===47||ma===62||Mp(ma)?Za(ma):Tt(ma)}function ai(ma){return ma===62?(Ie.consume(ma),Ie.exit("htmlTextData"),Ie.exit("htmlText"),ut):Tt(ma)}function yo(ma){return Ie.exit("htmlTextData"),Ie.enter("lineEnding"),Ie.consume(ma),Ie.exit("lineEnding"),ro}function ro(ma){return xf(ma)?vh(Ie,Ll,"linePrefix",wt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ma):Ll(ma)}function Ll(ma){return Ie.enter("htmlTextData"),br(ma)}}const mk={name:"labelEnd",resolveAll:FB,resolveTo:BB,tokenize:NB},DB={tokenize:UB},zB={tokenize:jB},OB={tokenize:qB};function FB(Ie){let ut=-1;const Tt=[];for(;++ut=3&&(Zr===null||pu(Zr))?(Ie.exit("thematicBreak"),ut(Zr)):Tt(Zr)}function an(Zr){return Zr===sr?(Ie.consume(Zr),wt++,an):(Ie.exit("thematicBreakSequence"),xf(Zr)?vh(Ie,tn,"whitespace")(Zr):tn(Zr))}}const Sp={continuation:{tokenize:JB},exit:eN,name:"list",tokenize:$B},WB={partial:!0,tokenize:tN},KB={partial:!0,tokenize:QB};function $B(Ie,ut,Tt){const wt=this,sr=wt.events[wt.events.length-1];let vr=sr&&sr[1].type==="linePrefix"?sr[2].sliceSerialize(sr[1],!0).length:0,br=0;return tn;function tn(Gn){const ao=wt.containerState.type||(Gn===42||Gn===43||Gn===45?"listUnordered":"listOrdered");if(ao==="listUnordered"?!wt.containerState.marker||Gn===wt.containerState.marker:rk(Gn)){if(wt.containerState.type||(wt.containerState.type=ao,Ie.enter(ao,{_container:!0})),ao==="listUnordered")return Ie.enter("listItemPrefix"),Gn===42||Gn===45?Ie.check(tM,Tt,Zr)(Gn):Zr(Gn);if(!wt.interrupt||Gn===49)return Ie.enter("listItemPrefix"),Ie.enter("listItemValue"),an(Gn)}return Tt(Gn)}function an(Gn){return rk(Gn)&&++br<10?(Ie.consume(Gn),an):(!wt.interrupt||br<2)&&(wt.containerState.marker?Gn===wt.containerState.marker:Gn===41||Gn===46)?(Ie.exit("listItemValue"),Zr(Gn)):Tt(Gn)}function Zr(Gn){return Ie.enter("listItemMarker"),Ie.consume(Gn),Ie.exit("listItemMarker"),wt.containerState.marker=wt.containerState.marker||Gn,Ie.check(iM,wt.interrupt?Tt:Sn,Ie.attempt(WB,fa,Ln))}function Sn(Gn){return wt.containerState.initialBlankLine=!0,vr++,fa(Gn)}function Ln(Gn){return xf(Gn)?(Ie.enter("listItemPrefixWhitespace"),Ie.consume(Gn),Ie.exit("listItemPrefixWhitespace"),fa):Tt(Gn)}function fa(Gn){return wt.containerState.size=vr+wt.sliceSerialize(Ie.exit("listItemPrefix"),!0).length,ut(Gn)}}function JB(Ie,ut,Tt){const wt=this;return wt.containerState._closeFlow=void 0,Ie.check(iM,sr,vr);function sr(tn){return wt.containerState.furtherBlankLines=wt.containerState.furtherBlankLines||wt.containerState.initialBlankLine,vh(Ie,ut,"listItemIndent",wt.containerState.size+1)(tn)}function vr(tn){return wt.containerState.furtherBlankLines||!xf(tn)?(wt.containerState.furtherBlankLines=void 0,wt.containerState.initialBlankLine=void 0,br(tn)):(wt.containerState.furtherBlankLines=void 0,wt.containerState.initialBlankLine=void 0,Ie.attempt(KB,ut,br)(tn))}function br(tn){return wt.containerState._closeFlow=!0,wt.interrupt=void 0,vh(Ie,Ie.attempt(Sp,ut,Tt),"linePrefix",wt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(tn)}}function QB(Ie,ut,Tt){const wt=this;return vh(Ie,sr,"listItemIndent",wt.containerState.size+1);function sr(vr){const br=wt.events[wt.events.length-1];return br&&br[1].type==="listItemIndent"&&br[2].sliceSerialize(br[1],!0).length===wt.containerState.size?ut(vr):Tt(vr)}}function eN(Ie){Ie.exit(this.containerState.type)}function tN(Ie,ut,Tt){const wt=this;return vh(Ie,sr,"listItemPrefixWhitespace",wt.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function sr(vr){const br=wt.events[wt.events.length-1];return!xf(vr)&&br&&br[1].type==="listItemPrefixWhitespace"?ut(vr):Tt(vr)}}const R8={name:"setextUnderline",resolveTo:rN,tokenize:nN};function rN(Ie,ut){let Tt=Ie.length,wt,sr,vr;for(;Tt--;)if(Ie[Tt][0]==="enter"){if(Ie[Tt][1].type==="content"){wt=Tt;break}Ie[Tt][1].type==="paragraph"&&(sr=Tt)}else Ie[Tt][1].type==="content"&&Ie.splice(Tt,1),!vr&&Ie[Tt][1].type==="definition"&&(vr=Tt);const br={type:"setextHeading",start:{...Ie[wt][1].start},end:{...Ie[Ie.length-1][1].end}};return Ie[sr][1].type="setextHeadingText",vr?(Ie.splice(sr,0,["enter",br,ut]),Ie.splice(vr+1,0,["exit",Ie[wt][1],ut]),Ie[wt][1].end={...Ie[vr][1].end}):Ie[wt][1]=br,Ie.push(["exit",br,ut]),Ie}function nN(Ie,ut,Tt){const wt=this;let sr;return vr;function vr(Zr){let Sn=wt.events.length,Ln;for(;Sn--;)if(wt.events[Sn][1].type!=="lineEnding"&&wt.events[Sn][1].type!=="linePrefix"&&wt.events[Sn][1].type!=="content"){Ln=wt.events[Sn][1].type==="paragraph";break}return!wt.parser.lazy[wt.now().line]&&(wt.interrupt||Ln)?(Ie.enter("setextHeadingLine"),sr=Zr,br(Zr)):Tt(Zr)}function br(Zr){return Ie.enter("setextHeadingLineSequence"),tn(Zr)}function tn(Zr){return Zr===sr?(Ie.consume(Zr),tn):(Ie.exit("setextHeadingLineSequence"),xf(Zr)?vh(Ie,an,"lineSuffix")(Zr):an(Zr))}function an(Zr){return Zr===null||pu(Zr)?(Ie.exit("setextHeadingLine"),ut(Zr)):Tt(Zr)}}const aN={tokenize:iN};function iN(Ie){const ut=this,Tt=Ie.attempt(iM,wt,Ie.attempt(this.parser.constructs.flowInitial,sr,vh(Ie,Ie.attempt(this.parser.constructs.flow,sr,Ie.attempt(cB,sr)),"linePrefix")));return Tt;function wt(vr){if(vr===null){Ie.consume(vr);return}return Ie.enter("lineEndingBlank"),Ie.consume(vr),Ie.exit("lineEndingBlank"),ut.currentConstruct=void 0,Tt}function sr(vr){if(vr===null){Ie.consume(vr);return}return Ie.enter("lineEnding"),Ie.consume(vr),Ie.exit("lineEnding"),ut.currentConstruct=void 0,Tt}}const oN={resolveAll:M4()},sN=S4("string"),lN=S4("text");function S4(Ie){return{resolveAll:M4(Ie==="text"?uN:void 0),tokenize:ut};function ut(Tt){const wt=this,sr=this.parser.constructs[Ie],vr=Tt.attempt(sr,br,tn);return br;function br(Sn){return Zr(Sn)?vr(Sn):tn(Sn)}function tn(Sn){if(Sn===null){Tt.consume(Sn);return}return Tt.enter("data"),Tt.consume(Sn),an}function an(Sn){return Zr(Sn)?(Tt.exit("data"),vr(Sn)):(Tt.consume(Sn),an)}function Zr(Sn){if(Sn===null)return!0;const Ln=sr[Sn];let fa=-1;if(Ln)for(;++fa-1){const tn=br[0];typeof tn=="string"?br[0]=tn.slice(wt):br.shift()}vr>0&&br.push(Ie[sr].slice(0,vr))}return br}function wN(Ie,ut){let Tt=-1;const wt=[];let sr;for(;++Tt0){const Wd=eu.tokenStack[eu.tokenStack.length-1];(Wd[1]||D8).call(eu,void 0,Wd[0])}for(hs.position={start:d1(lo.length>0?lo[0][1].start:{line:1,column:1,offset:0}),end:d1(lo.length>0?lo[lo.length-2][1].end:{line:1,column:1,offset:0})},Kc=-1;++Kc0&&(wt.className=["language-"+sr[0]]);let vr={type:"element",tagName:"code",properties:wt,children:[{type:"text",value:Tt}]};return ut.meta&&(vr.data={meta:ut.meta}),Ie.patch(ut,vr),vr=Ie.applyData(ut,vr),vr={type:"element",tagName:"pre",properties:{},children:[vr]},Ie.patch(ut,vr),vr}function ON(Ie,ut){const Tt={type:"element",tagName:"del",properties:{},children:Ie.all(ut)};return Ie.patch(ut,Tt),Ie.applyData(ut,Tt)}function FN(Ie,ut){const Tt={type:"element",tagName:"em",properties:{},children:Ie.all(ut)};return Ie.patch(ut,Tt),Ie.applyData(ut,Tt)}function BN(Ie,ut){const Tt=typeof Ie.options.clobberPrefix=="string"?Ie.options.clobberPrefix:"user-content-",wt=String(ut.identifier).toUpperCase(),sr=Iw(wt.toLowerCase()),vr=Ie.footnoteOrder.indexOf(wt);let br,tn=Ie.footnoteCounts.get(wt);tn===void 0?(tn=0,Ie.footnoteOrder.push(wt),br=Ie.footnoteOrder.length):br=vr+1,tn+=1,Ie.footnoteCounts.set(wt,tn);const an={type:"element",tagName:"a",properties:{href:"#"+Tt+"fn-"+sr,id:Tt+"fnref-"+sr+(tn>1?"-"+tn:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(br)}]};Ie.patch(ut,an);const Zr={type:"element",tagName:"sup",properties:{},children:[an]};return Ie.patch(ut,Zr),Ie.applyData(ut,Zr)}function NN(Ie,ut){const Tt={type:"element",tagName:"h"+ut.depth,properties:{},children:Ie.all(ut)};return Ie.patch(ut,Tt),Ie.applyData(ut,Tt)}function UN(Ie,ut){if(Ie.options.allowDangerousHtml){const Tt={type:"raw",value:ut.value};return Ie.patch(ut,Tt),Ie.applyData(ut,Tt)}}function C4(Ie,ut){const Tt=ut.referenceType;let wt="]";if(Tt==="collapsed"?wt+="[]":Tt==="full"&&(wt+="["+(ut.label||ut.identifier)+"]"),ut.type==="imageReference")return[{type:"text",value:"!["+ut.alt+wt}];const sr=Ie.all(ut),vr=sr[0];vr&&vr.type==="text"?vr.value="["+vr.value:sr.unshift({type:"text",value:"["});const br=sr[sr.length-1];return br&&br.type==="text"?br.value+=wt:sr.push({type:"text",value:wt}),sr}function jN(Ie,ut){const Tt=String(ut.identifier).toUpperCase(),wt=Ie.definitionById.get(Tt);if(!wt)return C4(Ie,ut);const sr={src:Iw(wt.url||""),alt:ut.alt};wt.title!==null&&wt.title!==void 0&&(sr.title=wt.title);const vr={type:"element",tagName:"img",properties:sr,children:[]};return Ie.patch(ut,vr),Ie.applyData(ut,vr)}function qN(Ie,ut){const Tt={src:Iw(ut.url)};ut.alt!==null&&ut.alt!==void 0&&(Tt.alt=ut.alt),ut.title!==null&&ut.title!==void 0&&(Tt.title=ut.title);const wt={type:"element",tagName:"img",properties:Tt,children:[]};return Ie.patch(ut,wt),Ie.applyData(ut,wt)}function VN(Ie,ut){const Tt={type:"text",value:ut.value.replace(/\r?\n|\r/g," ")};Ie.patch(ut,Tt);const wt={type:"element",tagName:"code",properties:{},children:[Tt]};return Ie.patch(ut,wt),Ie.applyData(ut,wt)}function HN(Ie,ut){const Tt=String(ut.identifier).toUpperCase(),wt=Ie.definitionById.get(Tt);if(!wt)return C4(Ie,ut);const sr={href:Iw(wt.url||"")};wt.title!==null&&wt.title!==void 0&&(sr.title=wt.title);const vr={type:"element",tagName:"a",properties:sr,children:Ie.all(ut)};return Ie.patch(ut,vr),Ie.applyData(ut,vr)}function GN(Ie,ut){const Tt={href:Iw(ut.url)};ut.title!==null&&ut.title!==void 0&&(Tt.title=ut.title);const wt={type:"element",tagName:"a",properties:Tt,children:Ie.all(ut)};return Ie.patch(ut,wt),Ie.applyData(ut,wt)}function XN(Ie,ut,Tt){const wt=Ie.all(ut),sr=Tt?YN(Tt):L4(ut),vr={},br=[];if(typeof ut.checked=="boolean"){const Sn=wt[0];let Ln;Sn&&Sn.type==="element"&&Sn.tagName==="p"?Ln=Sn:(Ln={type:"element",tagName:"p",properties:{},children:[]},wt.unshift(Ln)),Ln.children.length>0&&Ln.children.unshift({type:"text",value:" "}),Ln.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:ut.checked,disabled:!0},children:[]}),vr.className=["task-list-item"]}let tn=-1;for(;++tn1}function ZN(Ie,ut){const Tt={},wt=Ie.all(ut);let sr=-1;for(typeof ut.start=="number"&&ut.start!==1&&(Tt.start=ut.start);++sr0){const br={type:"element",tagName:"tbody",properties:{},children:Ie.wrap(Tt,!0)},tn=ck(ut.children[1]),an=c4(ut.children[ut.children.length-1]);tn&&an&&(br.position={start:tn,end:an}),sr.push(br)}const vr={type:"element",tagName:"table",properties:{},children:Ie.wrap(sr,!0)};return Ie.patch(ut,vr),Ie.applyData(ut,vr)}function QN(Ie,ut,Tt){const wt=Tt?Tt.children:void 0,vr=(wt?wt.indexOf(ut):1)===0?"th":"td",br=Tt&&Tt.type==="table"?Tt.align:void 0,tn=br?br.length:ut.children.length;let an=-1;const Zr=[];for(;++an0,!0),wt[0]),sr=wt.index+wt[0].length,wt=Tt.exec(ut);return vr.push(F8(ut.slice(sr),sr>0,!1)),vr.join("")}function F8(Ie,ut,Tt){let wt=0,sr=Ie.length;if(ut){let vr=Ie.codePointAt(wt);for(;vr===z8||vr===O8;)wt++,vr=Ie.codePointAt(wt)}if(Tt){let vr=Ie.codePointAt(sr-1);for(;vr===z8||vr===O8;)sr--,vr=Ie.codePointAt(sr-1)}return sr>wt?Ie.slice(wt,sr):""}function rU(Ie,ut){const Tt={type:"text",value:tU(String(ut.value))};return Ie.patch(ut,Tt),Ie.applyData(ut,Tt)}function nU(Ie,ut){const Tt={type:"element",tagName:"hr",properties:{},children:[]};return Ie.patch(ut,Tt),Ie.applyData(ut,Tt)}const aU={blockquote:IN,break:DN,code:zN,delete:ON,emphasis:FN,footnoteReference:BN,heading:NN,html:UN,imageReference:jN,image:qN,inlineCode:VN,linkReference:HN,link:GN,listItem:XN,list:ZN,paragraph:WN,root:KN,strong:$N,table:JN,tableCell:eU,tableRow:QN,text:rU,thematicBreak:nU,toml:KS,yaml:KS,definition:KS,footnoteDefinition:KS};function KS(){}const P4=-1,oM=0,kT=1,rM=2,gk=3,yk=4,_k=5,xk=6,R4=7,I4=8,B8=typeof self=="object"?self:globalThis,iU=(Ie,ut)=>{const Tt=(sr,vr)=>(Ie.set(vr,sr),sr),wt=sr=>{if(Ie.has(sr))return Ie.get(sr);const[vr,br]=ut[sr];switch(vr){case oM:case P4:return Tt(br,sr);case kT:{const tn=Tt([],sr);for(const an of br)tn.push(wt(an));return tn}case rM:{const tn=Tt({},sr);for(const[an,Zr]of br)tn[wt(an)]=wt(Zr);return tn}case gk:return Tt(new Date(br),sr);case yk:{const{source:tn,flags:an}=br;return Tt(new RegExp(tn,an),sr)}case _k:{const tn=Tt(new Map,sr);for(const[an,Zr]of br)tn.set(wt(an),wt(Zr));return tn}case xk:{const tn=Tt(new Set,sr);for(const an of br)tn.add(wt(an));return tn}case R4:{const{name:tn,message:an}=br;return Tt(new B8[tn](an),sr)}case I4:return Tt(BigInt(br),sr);case"BigInt":return Tt(Object(BigInt(br)),sr);case"ArrayBuffer":return Tt(new Uint8Array(br).buffer,br);case"DataView":{const{buffer:tn}=new Uint8Array(br);return Tt(new DataView(tn),br)}}return Tt(new B8[vr](br),sr)};return wt},N8=Ie=>iU(new Map,Ie)(0),Cw="",{toString:oU}={},{keys:sU}=Object,AT=Ie=>{const ut=typeof Ie;if(ut!=="object"||!Ie)return[oM,ut];const Tt=oU.call(Ie).slice(8,-1);switch(Tt){case"Array":return[kT,Cw];case"Object":return[rM,Cw];case"Date":return[gk,Cw];case"RegExp":return[yk,Cw];case"Map":return[_k,Cw];case"Set":return[xk,Cw];case"DataView":return[kT,Tt]}return Tt.includes("Array")?[kT,Tt]:Tt.includes("Error")?[R4,Tt]:[rM,Tt]},$S=([Ie,ut])=>Ie===oM&&(ut==="function"||ut==="symbol"),lU=(Ie,ut,Tt,wt)=>{const sr=(br,tn)=>{const an=wt.push(br)-1;return Tt.set(tn,an),an},vr=br=>{if(Tt.has(br))return Tt.get(br);let[tn,an]=AT(br);switch(tn){case oM:{let Sn=br;switch(an){case"bigint":tn=I4,Sn=br.toString();break;case"function":case"symbol":if(Ie)throw new TypeError("unable to serialize "+an);Sn=null;break;case"undefined":return sr([P4],br)}return sr([tn,Sn],br)}case kT:{if(an){let fa=br;return an==="DataView"?fa=new Uint8Array(br.buffer):an==="ArrayBuffer"&&(fa=new Uint8Array(br)),sr([an,[...fa]],br)}const Sn=[],Ln=sr([tn,Sn],br);for(const fa of br)Sn.push(vr(fa));return Ln}case rM:{if(an)switch(an){case"BigInt":return sr([an,br.toString()],br);case"Boolean":case"Number":case"String":return sr([an,br.valueOf()],br)}if(ut&&"toJSON"in br)return vr(br.toJSON());const Sn=[],Ln=sr([tn,Sn],br);for(const fa of sU(br))(Ie||!$S(AT(br[fa])))&&Sn.push([vr(fa),vr(br[fa])]);return Ln}case gk:return sr([tn,br.toISOString()],br);case yk:{const{source:Sn,flags:Ln}=br;return sr([tn,{source:Sn,flags:Ln}],br)}case _k:{const Sn=[],Ln=sr([tn,Sn],br);for(const[fa,Gn]of br)(Ie||!($S(AT(fa))||$S(AT(Gn))))&&Sn.push([vr(fa),vr(Gn)]);return Ln}case xk:{const Sn=[],Ln=sr([tn,Sn],br);for(const fa of br)(Ie||!$S(AT(fa)))&&Sn.push(vr(fa));return Ln}}const{message:Zr}=br;return sr([tn,{name:an,message:Zr}],br)};return vr},U8=(Ie,{json:ut,lossy:Tt}={})=>{const wt=[];return lU(!(ut||Tt),!!ut,new Map,wt)(Ie),wt},nM=typeof structuredClone=="function"?(Ie,ut)=>ut&&("json"in ut||"lossy"in ut)?N8(U8(Ie,ut)):structuredClone(Ie):(Ie,ut)=>N8(U8(Ie,ut));function uU(Ie,ut){const Tt=[{type:"text",value:"↩"}];return ut>1&&Tt.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(ut)}]}),Tt}function cU(Ie,ut){return"Back to reference "+(Ie+1)+(ut>1?"-"+ut:"")}function fU(Ie){const ut=typeof Ie.options.clobberPrefix=="string"?Ie.options.clobberPrefix:"user-content-",Tt=Ie.options.footnoteBackContent||uU,wt=Ie.options.footnoteBackLabel||cU,sr=Ie.options.footnoteLabel||"Footnotes",vr=Ie.options.footnoteLabelTagName||"h2",br=Ie.options.footnoteLabelProperties||{className:["sr-only"]},tn=[];let an=-1;for(;++an0&&ao.push({type:"text",value:" "});let Ge=typeof Tt=="string"?Tt:Tt(an,Gn);typeof Ge=="string"&&(Ge={type:"text",value:Ge}),ao.push({type:"element",tagName:"a",properties:{href:"#"+ut+"fnref-"+fa+(Gn>1?"-"+Gn:""),dataFootnoteBackref:"",ariaLabel:typeof wt=="string"?wt:wt(an,Gn),className:["data-footnote-backref"]},children:Array.isArray(Ge)?Ge:[Ge]})}const Lo=Sn[Sn.length-1];if(Lo&&Lo.type==="element"&&Lo.tagName==="p"){const Ge=Lo.children[Lo.children.length-1];Ge&&Ge.type==="text"?Ge.value+=" ":Lo.children.push({type:"text",value:" "}),Lo.children.push(...ao)}else Sn.push(...ao);const si={type:"element",tagName:"li",properties:{id:ut+"fn-"+fa},children:Ie.wrap(Sn,!0)};Ie.patch(Zr,si),tn.push(si)}if(tn.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:vr,properties:{...nM(br),id:"footnote-label"},children:[{type:"text",value:sr}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:Ie.wrap(tn,!0)},{type:"text",value:` -`}]}}const D4=(function(Ie){if(Ie==null)return pU;if(typeof Ie=="function")return sM(Ie);if(typeof Ie=="object")return Array.isArray(Ie)?hU(Ie):vU(Ie);if(typeof Ie=="string")return dU(Ie);throw new Error("Expected function, string, or object as test")});function hU(Ie){const ut=[];let Tt=-1;for(;++Tt":""))+")"})}return fa;function fa(){let Gn=z4,ao,qi,Lo;if((!ut||vr(an,Zr,Sn[Sn.length-1]||void 0))&&(Gn=xU(Tt(an,Sn)),Gn[0]===j8))return Gn;if("children"in an&&an.children){const si=an;if(si.children&&Gn[0]!==yU)for(qi=(wt?si.children.length:-1)+br,Lo=Sn.concat(si);qi>-1&&qi0&&Tt.push({type:"text",value:` -`}),Tt}function q8(Ie){let ut=0,Tt=Ie.charCodeAt(ut);for(;Tt===9||Tt===32;)ut++,Tt=Ie.charCodeAt(ut);return Ie.slice(ut)}function V8(Ie,ut){const Tt=wU(Ie,ut),wt=Tt.one(Ie,void 0),sr=fU(Tt),vr=Array.isArray(wt)?{type:"root",children:wt}:wt||{type:"root",children:[]};return sr&&vr.children.push({type:"text",value:` -`},sr),vr}function EU(Ie,ut){return Ie&&"run"in Ie?async function(Tt,wt){const sr=V8(Tt,{file:wt,...ut});await Ie.run(sr,wt)}:function(Tt,wt){return V8(Tt,{file:wt,...Ie||ut})}}function H8(Ie){if(Ie)throw Ie}var V6,G8;function kU(){if(G8)return V6;G8=1;var Ie=Object.prototype.hasOwnProperty,ut=Object.prototype.toString,Tt=Object.defineProperty,wt=Object.getOwnPropertyDescriptor,sr=function(Zr){return typeof Array.isArray=="function"?Array.isArray(Zr):ut.call(Zr)==="[object Array]"},vr=function(Zr){if(!Zr||ut.call(Zr)!=="[object Object]")return!1;var Sn=Ie.call(Zr,"constructor"),Ln=Zr.constructor&&Zr.constructor.prototype&&Ie.call(Zr.constructor.prototype,"isPrototypeOf");if(Zr.constructor&&!Sn&&!Ln)return!1;var fa;for(fa in Zr);return typeof fa>"u"||Ie.call(Zr,fa)},br=function(Zr,Sn){Tt&&Sn.name==="__proto__"?Tt(Zr,Sn.name,{enumerable:!0,configurable:!0,value:Sn.newValue,writable:!0}):Zr[Sn.name]=Sn.newValue},tn=function(Zr,Sn){if(Sn==="__proto__")if(Ie.call(Zr,Sn)){if(wt)return wt(Zr,Sn).value}else return;return Zr[Sn]};return V6=function an(){var Zr,Sn,Ln,fa,Gn,ao,qi=arguments[0],Lo=1,si=arguments.length,Ge=!1;for(typeof qi=="boolean"&&(Ge=qi,qi=arguments[1]||{},Lo=2),(qi==null||typeof qi!="object"&&typeof qi!="function")&&(qi={});Lobr.length;let an;tn&&br.push(sr);try{an=Ie.apply(this,br)}catch(Zr){const Sn=Zr;if(tn&&Tt)throw Sn;return sr(Sn)}tn||(an&&an.then&&typeof an.then=="function"?an.then(vr,sr):an instanceof Error?sr(an):vr(an))}function sr(br,...tn){Tt||(Tt=!0,ut(br,...tn))}function vr(br){sr(null,br)}}const Xm={basename:RU,dirname:IU,extname:DU,join:zU,sep:"/"};function RU(Ie,ut){if(ut!==void 0&&typeof ut!="string")throw new TypeError('"ext" argument must be a string');PT(Ie);let Tt=0,wt=-1,sr=Ie.length,vr;if(ut===void 0||ut.length===0||ut.length>Ie.length){for(;sr--;)if(Ie.codePointAt(sr)===47){if(vr){Tt=sr+1;break}}else wt<0&&(vr=!0,wt=sr+1);return wt<0?"":Ie.slice(Tt,wt)}if(ut===Ie)return"";let br=-1,tn=ut.length-1;for(;sr--;)if(Ie.codePointAt(sr)===47){if(vr){Tt=sr+1;break}}else br<0&&(vr=!0,br=sr+1),tn>-1&&(Ie.codePointAt(sr)===ut.codePointAt(tn--)?tn<0&&(wt=sr):(tn=-1,wt=br));return Tt===wt?wt=br:wt<0&&(wt=Ie.length),Ie.slice(Tt,wt)}function IU(Ie){if(PT(Ie),Ie.length===0)return".";let ut=-1,Tt=Ie.length,wt;for(;--Tt;)if(Ie.codePointAt(Tt)===47){if(wt){ut=Tt;break}}else wt||(wt=!0);return ut<0?Ie.codePointAt(0)===47?"/":".":ut===1&&Ie.codePointAt(0)===47?"//":Ie.slice(0,ut)}function DU(Ie){PT(Ie);let ut=Ie.length,Tt=-1,wt=0,sr=-1,vr=0,br;for(;ut--;){const tn=Ie.codePointAt(ut);if(tn===47){if(br){wt=ut+1;break}continue}Tt<0&&(br=!0,Tt=ut+1),tn===46?sr<0?sr=ut:vr!==1&&(vr=1):sr>-1&&(vr=-1)}return sr<0||Tt<0||vr===0||vr===1&&sr===Tt-1&&sr===wt+1?"":Ie.slice(sr,Tt)}function zU(...Ie){let ut=-1,Tt;for(;++ut0&&Ie.codePointAt(Ie.length-1)===47&&(Tt+="/"),ut?"/"+Tt:Tt}function FU(Ie,ut){let Tt="",wt=0,sr=-1,vr=0,br=-1,tn,an;for(;++br<=Ie.length;){if(br2){if(an=Tt.lastIndexOf("/"),an!==Tt.length-1){an<0?(Tt="",wt=0):(Tt=Tt.slice(0,an),wt=Tt.length-1-Tt.lastIndexOf("/")),sr=br,vr=0;continue}}else if(Tt.length>0){Tt="",wt=0,sr=br,vr=0;continue}}ut&&(Tt=Tt.length>0?Tt+"/..":"..",wt=2)}else Tt.length>0?Tt+="/"+Ie.slice(sr+1,br):Tt=Ie.slice(sr+1,br),wt=br-sr-1;sr=br,vr=0}else tn===46&&vr>-1?vr++:vr=-1}return Tt}function PT(Ie){if(typeof Ie!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(Ie))}const BU={cwd:NU};function NU(){return"/"}function ok(Ie){return!!(Ie!==null&&typeof Ie=="object"&&"href"in Ie&&Ie.href&&"protocol"in Ie&&Ie.protocol&&Ie.auth===void 0)}function UU(Ie){if(typeof Ie=="string")Ie=new URL(Ie);else if(!ok(Ie)){const ut=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+Ie+"`");throw ut.code="ERR_INVALID_ARG_TYPE",ut}if(Ie.protocol!=="file:"){const ut=new TypeError("The URL must be of scheme file");throw ut.code="ERR_INVALID_URL_SCHEME",ut}return jU(Ie)}function jU(Ie){if(Ie.hostname!==""){const wt=new TypeError('File URL host must be "localhost" or empty on darwin');throw wt.code="ERR_INVALID_FILE_URL_HOST",wt}const ut=Ie.pathname;let Tt=-1;for(;++Tt0){let[Gn,...ao]=Sn;const qi=wt[fa][1];ik(qi)&&ik(Gn)&&(Gn=H6(!0,qi,Gn)),wt[fa]=[Zr,Gn,...ao]}}}}const GU=new bk().freeze();function Z6(Ie,ut){if(typeof ut!="function")throw new TypeError("Cannot `"+Ie+"` without `parser`")}function W6(Ie,ut){if(typeof ut!="function")throw new TypeError("Cannot `"+Ie+"` without `compiler`")}function K6(Ie,ut){if(ut)throw new Error("Cannot call `"+Ie+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Y8(Ie){if(!ik(Ie)||typeof Ie.type!="string")throw new TypeError("Expected node, got `"+Ie+"`")}function Z8(Ie,ut,Tt){if(!Tt)throw new Error("`"+Ie+"` finished async. Use `"+ut+"` instead")}function JS(Ie){return XU(Ie)?Ie:new F4(Ie)}function XU(Ie){return!!(Ie&&typeof Ie=="object"&&"message"in Ie&&"messages"in Ie)}function YU(Ie){return typeof Ie=="string"||ZU(Ie)}function ZU(Ie){return!!(Ie&&typeof Ie=="object"&&"byteLength"in Ie&&"byteOffset"in Ie)}const WU="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",W8=[],K8={allowDangerousHtml:!0},KU=/^(https?|ircs?|mailto|xmpp)$/i,$U=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function JU(Ie){const ut=QU(Ie),Tt=ej(Ie);return tj(ut.runSync(ut.parse(Tt),Tt),Ie)}function QU(Ie){const ut=Ie.rehypePlugins||W8,Tt=Ie.remarkPlugins||W8,wt=Ie.remarkRehypeOptions?{...Ie.remarkRehypeOptions,...K8}:K8;return GU().use(RN).use(Tt).use(EU,wt).use(ut)}function ej(Ie){const ut=Ie.children||"",Tt=new F4;return typeof ut=="string"&&(Tt.value=ut),Tt}function tj(Ie,ut){const Tt=ut.allowedElements,wt=ut.allowElement,sr=ut.components,vr=ut.disallowedElements,br=ut.skipHtml,tn=ut.unwrapDisallowed,an=ut.urlTransform||rj;for(const Sn of $U)Object.hasOwn(ut,Sn.from)&&(""+Sn.from+(Sn.to?"use `"+Sn.to+"` instead":"remove it")+WU+Sn.id,void 0);return O4(Ie,Zr),fF(Ie,{Fragment:Si.Fragment,components:sr,ignoreInvalidStyle:!0,jsx:Si.jsx,jsxs:Si.jsxs,passKeys:!0,passNode:!0});function Zr(Sn,Ln,fa){if(Sn.type==="raw"&&fa&&typeof Ln=="number")return br?fa.children.splice(Ln,1):fa.children[Ln]={type:"text",value:Sn.value},Ln;if(Sn.type==="element"){let Gn;for(Gn in U6)if(Object.hasOwn(U6,Gn)&&Object.hasOwn(Sn.properties,Gn)){const ao=Sn.properties[Gn],qi=U6[Gn];(qi===null||qi.includes(Sn.tagName))&&(Sn.properties[Gn]=an(String(ao||""),Gn,Sn))}}if(Sn.type==="element"){let Gn=Tt?!Tt.includes(Sn.tagName):vr?vr.includes(Sn.tagName):!1;if(!Gn&&wt&&typeof Ln=="number"&&(Gn=!wt(Sn,Ln,fa)),Gn&&fa&&typeof Ln=="number")return tn&&Sn.children?fa.children.splice(Ln,1,...Sn.children):fa.children.splice(Ln,1),Ln}}}function rj(Ie){const ut=Ie.indexOf(":"),Tt=Ie.indexOf("?"),wt=Ie.indexOf("#"),sr=Ie.indexOf("/");return ut===-1||sr!==-1&&ut>sr||Tt!==-1&&ut>Tt||wt!==-1&&ut>wt||KU.test(Ie.slice(0,ut))?Ie:""}const nj=`This visualizer allows you to define a function and minimize it using one of several iterative optimization algorithms. - -## Settings - -In this tab, you can: - -- Select a preset function to optimize -- Or choose **--Custom--** to define your own function - -When entering a custom function: - -- Use **\`x\`** for univariate functions -- Use **\`x\`** and **\`y\`** for bivariate functions - -## Optimize - -In this tab, you can: - -- Step through the optimization process -- See the optimizer’s trajectory - -## Plot Screen - -The plot is interactive: - -- Click and drag to pan -- Scroll to zoom - - -## Compare algorithms - -Open **Compare** after **Optimize**. Choose an algorithm, configure its initial point and parameters, and click **Add**. Repeat to compare different algorithms or parameter choices. Each entry has a matching trajectory color and can be removed. - -**Animate** advances all selected algorithms together. **Pause** stops playback; **Previous** and **Next** step through iterations; **Reset** returns to the initial points. Adding an algorithm restarts the comparison at iteration zero. Each added algorithm keeps its own initial point, shown in the selected algorithms list. The objective is shared with Settings. Changing the objective or the initial point in Settings restarts the comparison while preserving each algorithm’s configured initial point. -`;function aj({mode:Ie,trajectoryValues:ut,currentIteration:Tt}){const wt=ut?.x??[],sr=ut?.y??[],vr=Ie==="Bivariate"?ut?.z??[]:sr,br=wt.map((an,Zr)=>Zr),tn=Ie==="Bivariate"?[{name:"x",values:wt,color:"#2563eb"},{name:"y",values:sr,color:"#16a34a"},{name:"Objective",values:vr,color:"#dc2626"}]:[{name:"x",values:wt,color:"#2563eb"},{name:"Objective",values:vr,color:"#dc2626"}];return Si.jsx("div",{className:"h-64 min-h-64 w-full rounded border border-stone-200 bg-white",children:Si.jsx(eM,{data:[...tn.map(an=>({x:br.slice(0,an.values.length),y:an.values,name:an.name,type:"scatter",mode:"lines+markers",line:{color:an.color,width:2},marker:{color:an.color,size:5},hovertemplate:`${an.name}: %{y:.5g}`})),...tn.map(an=>({x:an.values[Tt]!==void 0?[Tt]:[],y:an.values[Tt]!==void 0?[an.values[Tt]]:[],name:`${an.name} selected`,type:"scatter",mode:"markers",marker:{color:an.color,size:11,line:{color:"white",width:2}},hoverinfo:"skip",showlegend:!1}))],layout:{title:{text:"Optimization history",font:{size:14}},xaxis:{title:{text:"Iteration"},showticklabels:!1,ticks:"",rangemode:"tozero"},yaxis:{title:{text:"Value"},automargin:!0},legend:{orientation:"h",x:.5,xanchor:"center",y:1.12},margin:{t:58,r:18,b:45,l:55},hovermode:"x unified",paper_bgcolor:"transparent",plot_bgcolor:"transparent"},style:{width:"100%",height:"100%"},config:{responsive:!0,displayModeBar:!1}})})}const $8={"--Custom--":"x^2",Quadratic:"x^2","Local Minima":"x^2 - 0.1cos(20x)",Plateau:"x^4"},J8={"--Custom--":"x^2 + 3y^2",Quadratic:"x^2 + 3y^2",Small:"(0.05x)^2 + 3(0.05y)^2",Ackley:"-20exp(-0.2 sqrt(0.5(x^2 + y^2))) - exp(0.5(cos(2 pi x) + cos(2 pi y))) + e + 20",Rasteringin:"20 + (x^2 - 10cos(2 pi x)) + (y^2 - 10cos(2 pi y))",Rosenbrock:"(1 - x)^2 + 100(y - x^2)^2"};function ij({comparison:Ie,onTabChange:ut,settings:Tt,setSettings:wt,onRandomInitialPoint:sr,trajectoryValues:vr,onReset:br,onNextStep:tn,onPrevStep:an,onAnimate:Zr,onPause:Sn,isAnimating:Ln=!1,currentIteration:fa,totalIterations:Gn,showGradientField:ao,onShowGradientFieldChange:qi}){const Lo=["Settings","Optimize","Compare","Usage"],[si,Ge]=ku.useState("Settings"),[zo,xl]=ku.useState("--Custom--");function go(ro,Ll){wt({...Tt,[ro]:Ll})}function mi(ro){const[Ll,ma]=ro.split("::"),Sa=ma??"--Custom--",Vi=Ll==="Bivariate"?J8[Sa]:$8[Sa];xl(Sa),wt({...Tt,mode:Ll,functionExpr:Vi})}function Yi(ro){return ro?.[fa]??null}const As=Yi(vr?.x),Za=Yi(vr?.y),Oo=Yi(vr?.derivative),Mi=Yi(vr?.secondDerivative),po=Yi(vr?.z),js=Yi(vr?.gradient),Ga=Yi(vr?.hessian),hi=ku.useRef(null),ai=ku.useCallback(()=>{hi.current!==null&&(window.clearInterval(hi.current),hi.current=null)},[]),yo=ku.useCallback(ro=>{!ro||hi.current!==null||(ro(),hi.current=window.setInterval(ro,200))},[]);return ku.useEffect(()=>{function ro(ma){si!=="Optimize"||ma.target?.matches("input, textarea, select, [contenteditable='true']")||ma.repeat||(ma.key==="ArrowLeft"?(ma.preventDefault(),yo(an)):ma.key==="ArrowRight"&&(ma.preventDefault(),yo(tn)))}function Ll(ma){(ma.key==="ArrowLeft"||ma.key==="ArrowRight")&&ai()}return window.addEventListener("keydown",ro),window.addEventListener("keyup",Ll),window.addEventListener("blur",ai),()=>{ai(),window.removeEventListener("keydown",ro),window.removeEventListener("keyup",Ll),window.removeEventListener("blur",ai)}},[si,tn,an,yo,ai]),Si.jsxs(ST,{className:"flex flex-col h-full p-4 gap-2 min-w-0 min-h-0 overflow-auto",children:[Si.jsx("div",{className:"w-full [&>div]:w-full [&>div>button]:w-1/4 [&>div>button]:px-1",children:Si.jsx(DO,{tabs:Lo,activeTab:si,onChange:ro=>{Ge(ro),ut(ro)}})}),Si.jsxs("div",{className:"flex flex-1 flex-col gap-4 min-h-0 min-w-0 overflow-auto",children:[si==="Settings"&&Si.jsxs(Si.Fragment,{children:[Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-0.5",children:[Si.jsx("label",{className:"text-sm font-semibold whitespace-nowrap pr-0.25",children:"Objective"}),Si.jsx("div",{className:"min-w-0",children:Si.jsxs("select",{value:`${Tt.mode}::${zo}`,onChange:ro=>mi(ro.target.value),className:"h-10 w-full rounded border border-stone-300 bg-white px-2 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-stone-400",children:[Si.jsx("optgroup",{label:"Univariate",className:"font-semibold",children:Object.keys($8).map(ro=>Si.jsx("option",{value:`Univariate::${ro}`,children:ro},`Univariate::${ro}`))}),Si.jsx("optgroup",{label:"Bivariate",className:"font-semibold",children:Object.keys(J8).map(ro=>Si.jsx("option",{value:`Bivariate::${ro}`,children:ro},`Bivariate::${ro}`))})]})})]}),Si.jsx(K_,{label:"",value:Tt.functionExpr,onChange:ro=>go("functionExpr",ro),readonly:zo!=="--Custom--",rows:3}),Tt.mode==="Bivariate"&&Si.jsxs("fieldset",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-0.5",children:[Si.jsx("legend",{className:"text-sm font-medium whitespace-nowrap pr-0.25",children:"Gradient field"}),Si.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[Si.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5",children:[Si.jsx("input",{type:"radio",name:"gradient-field",checked:ao,onChange:()=>qi(!0)}),"Show"]}),Si.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5",children:[Si.jsx("input",{type:"radio",name:"gradient-field",checked:!ao,onChange:()=>qi(!1)}),"Hide"]})]})]}),Si.jsx(r4,{settings:Tt,setSettings:wt,onRandomInitialPoint:sr})]}),si==="Optimize"&&Si.jsxs(Si.Fragment,{children:[Si.jsx(aj,{mode:Tt.mode,trajectoryValues:vr,currentIteration:fa}),Si.jsxs("div",{className:"hidden lg:flex flex-none flex-col gap-1 min-w-0",children:[Si.jsxs("div",{className:"flex items-center justify-between gap-2 text-sm font-semibold",children:[Si.jsx("span",{children:"Current values"}),Si.jsxs("span",{className:"whitespace-nowrap font-normal text-stone-500",children:["Iteration ",fa," of ",Gn]})]}),Tt.mode==="Univariate"&&Si.jsxs(Si.Fragment,{children:[Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-2",children:[Si.jsx("label",{className:"text-right text-sm font-medium whitespace-nowrap",children:"X"}),Si.jsx("input",{type:"text",value:As!==null?As.toFixed(4):"",readOnly:!0,className:"w-full rounded border border-stone-300 bg-stone-50 px-2 py-1 text-sm"})]}),Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-2",children:[Si.jsx("label",{className:"text-right text-sm font-medium whitespace-nowrap",children:"Y"}),Si.jsx("input",{type:"text",value:Za!==null?Za.toFixed(4):"",readOnly:!0,className:"w-full rounded border border-stone-300 bg-stone-50 px-2 py-1 text-sm"})]}),Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-2",children:[Si.jsx("label",{className:"text-right text-sm font-medium whitespace-nowrap",children:"1st derivative"}),Si.jsx("input",{type:"text",value:Oo!==null?Oo.toFixed(4):"",readOnly:!0,className:"w-full rounded border border-stone-300 bg-stone-50 px-2 py-1 text-sm"})]}),Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-2",children:[Si.jsx("label",{className:"text-right text-sm font-medium whitespace-nowrap",children:"2nd derivative"}),Si.jsx("input",{type:"text",value:Mi!==null?Mi.toFixed(4):"",readOnly:!0,className:"w-full rounded border border-stone-300 bg-stone-50 px-2 py-1 text-sm"})]})]}),Tt.mode==="Bivariate"&&Si.jsxs(Si.Fragment,{children:[Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-2",children:[Si.jsx("label",{className:"text-right text-sm font-medium whitespace-nowrap",children:"(X, Y)"}),Si.jsx("input",{type:"text",value:As!==null&&Za!==null?`${As.toFixed(4)}, ${Za.toFixed(4)}`:"",readOnly:!0,className:"w-full rounded border border-stone-300 bg-stone-50 px-2 py-1 text-sm"})]}),Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-2",children:[Si.jsx("label",{className:"text-right text-sm font-medium whitespace-nowrap",children:"Z"}),Si.jsx("input",{type:"text",value:po!==null?po.toFixed(4):"",readOnly:!0,className:"w-full rounded border border-stone-300 bg-stone-50 px-2 py-1 text-sm"})]}),Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-2",children:[Si.jsx("label",{className:"text-right text-sm font-medium whitespace-nowrap",children:"Gradient"}),Si.jsx("input",{type:"text",value:js!==null?`[${js.map(ro=>ro.toFixed(4)).join(", ")}]`:"",readOnly:!0,className:"w-full rounded border border-stone-300 bg-stone-50 px-2 py-1 text-sm"})]}),Si.jsxs("div",{className:"grid grid-cols-[6rem_minmax(0,1fr)] items-center gap-2",children:[Si.jsx("label",{className:"text-right text-sm font-medium whitespace-nowrap",children:"Hessian"}),Si.jsx("input",{type:"text",value:Ga!==null?`[${Ga.map(ro=>`[${ro.map(Ll=>Ll.toFixed(4)).join(", ")}]`).join(", ")}]`:"",readOnly:!0,className:"w-full rounded border border-stone-300 bg-stone-50 px-2 py-1 text-sm"})]})]})]}),Si.jsxs("div",{className:"-mt-2 flex flex-col gap-1",children:[Si.jsxs("div",{className:"flex gap-2",children:[Si.jsx("button",{type:"button",onPointerDown:()=>yo(tn),onPointerUp:ai,onPointerCancel:ai,onPointerLeave:ai,disabled:!tn,className:"h-8 flex-1 rounded border border-gray-300 bg-orange-200 px-3 py-1 text-sm text-stone-700 hover:bg-orange-300 disabled:cursor-not-allowed disabled:opacity-50",children:"Next"}),Si.jsx("button",{type:"button",onPointerDown:()=>yo(an),onPointerUp:ai,onPointerCancel:ai,onPointerLeave:ai,className:"h-8 flex-1 rounded border border-gray-300 bg-orange-200 px-3 py-1 text-sm text-stone-700 hover:bg-orange-300",children:"Previous"}),Si.jsx("button",{type:"button",onClick:br,className:"h-8 flex-1 rounded border border-gray-300 bg-orange-200 px-3 py-1 text-sm text-stone-700 hover:bg-orange-300",children:"Reset"})]}),Si.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[Si.jsx("button",{type:"button",onClick:Zr,disabled:Ln||!Zr,className:"h-8 rounded border border-gray-300 bg-orange-200 px-3 py-1 text-sm text-stone-700 hover:bg-orange-300 disabled:cursor-not-allowed disabled:opacity-50",children:"Animate"}),Si.jsx("button",{type:"button",onClick:Sn,disabled:!Ln,className:"h-8 rounded border border-gray-300 bg-stone-100 px-3 py-1 text-sm text-stone-700 hover:bg-stone-200 disabled:cursor-not-allowed disabled:opacity-50",children:"Pause"})]})]})]}),si==="Compare"&&Ie,si==="Usage"&&Si.jsx(JU,{components:{h1:({children:ro})=>Si.jsx("h1",{className:"text-2xl font-bold mt-0 -mb-2",children:ro}),h2:({children:ro})=>Si.jsx("h2",{className:"text-xl font-semibold mt-0 -mb-2",children:ro}),h3:({children:ro})=>Si.jsx("h3",{className:"text-lg font-semibold mt-0 -mb-2",children:ro}),p:({children:ro})=>Si.jsx("p",{className:"leading-6 mb-3 last:mb-0",children:ro}),ul:({children:ro})=>Si.jsx("ul",{className:"-mt-6 mb-0 list-disc pl-4 [&_p]:mb-0",children:ro}),ol:({children:ro})=>Si.jsx("ol",{className:"-mt-5 mb-0 list-decimal pl-4 [&_p]:mb-0",children:ro}),li:({children:ro})=>Si.jsx("li",{className:"mb-0",children:ro})},children:nj})]})]})}function oj({settings:Ie,entries:ut,trajectories:Tt,onAdd:wt,onRemove:sr,onToggleVisibility:vr,iteration:br,busy:tn,ready:an,animating:Zr,onAction:Sn}){const[Ln,fa]=ku.useState(Ie),Gn={algorithm:Ln.algorithm,x0:Ln.x0,y0:Ln.y0,mode:Ie.mode,functionExpr:Ie.functionExpr,...Object.fromEntries(Object.entries(t4[Ln.algorithm]).map(([qi,Lo])=>[qi,Ln[qi]??Lo]))},ao=[Gn.x0,...Gn.mode==="Bivariate"?[Gn.y0]:[],...Object.entries(Gn).filter(([qi])=>["learningRate","momentum","beta","beta1","beta2","epsilon"].includes(qi)).map(([,qi])=>qi)].every(qi=>qi!==void 0&&qi.trim()!==""&&Number.isFinite(Number(qi)));return Si.jsxs(Si.Fragment,{children:[Si.jsx(r4,{settings:Gn,setSettings:fa,onRandomInitialPoint:()=>fa({...Gn,x0:(Math.random()*2-1).toFixed(2),y0:(Math.random()*2-1).toFixed(2)})}),Si.jsx("button",{className:"rounded border border-gray-300 bg-orange-200 px-3 py-1 disabled:opacity-50",disabled:!ao||!an||tn||Zr,onClick:()=>wt(Gn),children:"Add"}),Si.jsx("div",{className:"text-sm font-semibold",children:"Selected algorithms"}),ut.length===0&&Si.jsx("p",{className:"text-sm text-stone-500",children:"Add algorithms to compare their trajectories on the same objective."}),Si.jsx("ul",{className:"flex flex-col gap-2",children:ut.map((qi,Lo)=>Si.jsxs("li",{className:"rounded border border-stone-300 p-2 text-sm",children:[Si.jsxs("div",{className:"flex items-center gap-2",children:[Si.jsx("span",{className:"h-3 w-3 rounded-full shrink-0",style:{background:qi.color}}),Si.jsxs("span",{className:"flex-1 font-semibold",children:[Lo+1,". ",qi.settings.algorithm]}),Si.jsx("button",{"aria-label":`${qi.visible?"Hide":"Show"} ${Lo+1}. ${qi.settings.algorithm}`,"aria-pressed":!qi.visible,onClick:()=>vr(qi.id),children:qi.visible?"Hide":"Show"}),Si.jsx("button",{"aria-label":`Remove ${Lo+1}. ${qi.settings.algorithm}`,onClick:()=>sr(qi.id),children:"Remove"})]}),Si.jsx("div",{className:"text-xs text-stone-600",children:Object.entries(qi.settings).filter(([si])=>!["mode","functionExpr","algorithm"].includes(si)&&(si!=="y0"||Ie.mode==="Bivariate")).map(([si,Ge])=>`${si}: ${Ge}`).join(", ")}),Tt.find(si=>si.id===qi.id)?.error&&Si.jsx("p",{role:"alert",className:"text-red-700",children:"Unable to compute this trajectory. Check its settings."})]},qi.id))}),Si.jsxs("div",{className:"text-sm",role:"status",children:["Iteration ",br,tn?" · Computing…":""]}),Si.jsx("div",{className:"flex flex-wrap gap-2",children:["Animate","Previous","Next","Reset","Pause"].map(qi=>Si.jsx("button",{className:"rounded border border-gray-300 bg-orange-200 px-3 py-1 text-sm disabled:opacity-50",disabled:qi==="Pause"?!Zr:!an||!ut.length||tn||Zr||(qi==="Previous"||qi==="Reset")&&br===0,onClick:()=>Sn(qi),children:qi},qi))})]})}function sj(Ie){return new Worker("/assets/pyodide.worker-Cq5E6qzM.js",{name:Ie?.name})}function lj(Ie){const[ut,Tt]=ku.useState([]),[wt,sr]=ku.useState(!1),vr=ku.useRef(0),br=ku.useCallback((go,mi,Yi)=>{sr(!0),Gn.current?.postMessage({type:"COMPARE",requestId:++vr.current,settings:go,ids:mi,iteration:Yi})},[]),[tn,an]=ku.useState({}),[Zr,Sn]=ku.useState(0),[Ln,fa]=ku.useState(!0),Gn=ku.useRef(null),ao=ku.useRef({}),qi=ku.useRef(0);function Lo(go){qi.current=go,Sn(go)}const si=ku.useCallback(go=>{Gn.current&&Gn.current.postMessage({type:"INIT",settings:go})},[]),Ge=ku.useCallback(()=>{const go=Math.max((ao.current.trajectoryValues?.x.length??1)-1,0);if(qi.current{Lo(Math.max(qi.current-1,0))},[]),xl=ku.useCallback(()=>{Lo(0)},[]);return ku.useEffect(()=>{const go=new sj;return Gn.current=go,go.onmessage=mi=>{const Yi=mi.data;Yi.type==="COMPARISON_RESULT"?Yi.requestId===vr.current&&(Tt(Yi.trajectories),sr(!1)):Yi.type==="READY"?(console.log("Pyodide is ready"),fa(!1),si(Ie)):Yi.type==="RESULT"&&an(As=>{const Za={functionValues:Yi.data.functionValues||As.functionValues,trajectoryValues:Yi.data.trajectoryValues||As.trajectoryValues};if(ao.current=Za,Yi.data.trajectoryValues){const Oo=Math.max(Yi.data.trajectoryValues.x.length-1,0);(Oo<=0||Oo>qi.current)&&Lo(Oo)}return Za})},()=>{go.terminate()}},[]),{comparison:ut,comparisonBusy:wt,compare:br,isLoading:Ln,plotData:tn,currentIteration:Zr,sendInit:si,sendReset:xl,sendNextStep:Ge,sendPrevStep:zo}}const uj={mode:"Univariate",functionExpr:"x^2",algorithm:"Gradient Descent",x0:"0.5",y0:"0.5",learningRate:"0.1",momentum:"0.0"},cj=[-1,1],fj=[-1,1],Q8=["#0072B2","#E69F00","#009E73","#D55E00","#CC79A7","#6F4EBA","#A6761D","#E7298A","#1B9E77","#7570B3","#E6AB02","#666666"];function hj(Ie){return Ie<=Q8.length?Q8[Ie-1]:`hsl(${(Ie-1)*137.508%360}, 72%, 40%)`}function vj(){const[Ie,ut]=ku.useState(uj),[Tt,wt]=ku.useState(!1),[sr,vr]=ku.useState([]),[br,tn]=ku.useState(0),[an,Zr]=ku.useState(!1),Sn=ku.useRef(1),[Ln,fa]=ku.useState(!1),[Gn,ao]=ku.useState(!1),[qi,Lo]=ku.useState("Contour heatmap"),si=ku.useRef(cj),Ge=ku.useRef(fj),zo={...Ie,xlim:si.current,ylim:Ge.current};function xl(Ga){fa(!1),(Ga.mode!==Ie.mode||Ga.functionExpr!==Ie.functionExpr||Ga.x0!==Ie.x0||Ga.y0!==Ie.y0)&&(Zr(!1),tn(0),vr(hi=>hi.map(ai=>({...ai,settings:{...ai.settings,mode:Ga.mode,functionExpr:Ga.functionExpr}})))),ut(Ga),Yi.sendInit({...Ga,xlim:si.current,ylim:Ge.current})}function go(Ga,hi){si.current=Ga,Ge.current=hi,Yi.sendInit({...Ie,xlim:Ga,ylim:hi})}function mi(){const Ga=si.current[1]-si.current[0],hi=Ge.current[1]-Ge.current[0],ai=(si.current[0]+Math.random()*Ga*.95).toFixed(2),yo=(Ge.current[0]+Math.random()*hi*.95).toFixed(2),ro={...Ie,x0:ai,y0:yo};xl(ro)}const Yi=lj(zo),{compare:As,comparisonBusy:Za,isLoading:Oo}=Yi;ku.useEffect(()=>{Oo||As(sr.map(Ga=>({...Ga.settings,xlim:si.current,ylim:Ge.current})),sr.map(Ga=>Ga.id),br)},[sr,br,As,Oo]),ku.useEffect(()=>{if(!an||Za||Oo)return;const Ga=window.setTimeout(()=>tn(hi=>hi+1),200);return()=>window.clearTimeout(Ga)},[an,Za,Oo,br]);const Mi=Yi.sendNextStep,po=Yi.currentIteration,js=Math.max((Yi.plotData.trajectoryValues?.x.length??1)-1,0);return ku.useEffect(()=>{if(!Ln)return;const Ga=window.setInterval(()=>Mi(),200);return()=>window.clearInterval(Ga)},[Ln,Mi]),Si.jsxs("div",{className:"grid grid-cols-[1fr_12fr_1fr] lg:h-dvh bg-stone-50",children:[Si.jsx("div",{}),Si.jsxs("div",{className:"flex flex-col gap-6 p-6 min-h-0",children:[Si.jsxs("header",{className:"grid grid-cols-1 items-center gap-3 lg:grid-cols-[2fr_1fr] lg:gap-12",children:[Si.jsx("div",{className:"title",children:"Optimization Trajectory Visualizer"}),Si.jsxs("div",{id:"runtime-status",className:`status translate-y-4 w-fit justify-self-end ${Yi.isLoading?"loading":"ready"}`,role:"status","aria-live":"polite",children:[Si.jsx("span",{}),Yi.isLoading?"Loading Python runtime…":"Python runtime ready"]})]}),Si.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] gap-12 flex-1 min-h-0 overflow-auto",children:[Si.jsxs("div",{className:"flex h-full min-h-0 min-w-0 flex-col gap-2",children:[Ie.mode==="Bivariate"&&Si.jsx("div",{className:"flex w-full border-b border-gray-200",role:"tablist","aria-label":"Bivariate plot view",children:["Contour heatmap","Function surface"].map(Ga=>Si.jsx("button",{type:"button",role:"tab","aria-selected":qi===Ga,onClick:()=>Lo(Ga),className:`w-1/2 cursor-pointer rounded px-5 py-1 ${qi===Ga?"border-b-2 border-orange-400 text-orange-400":"text-gray-950 hover:bg-gray-200"}`,children:Ga},Ga))}),Si.jsx(zO,{data:Tt?{functionValues:Yi.plotData.functionValues}:Yi.plotData,comparisons:Tt?sr.map(Ga=>({...Ga,values:Yi.comparison.find(hi=>hi.id===Ga.id)?.values})):void 0,isLoading:Yi.isLoading,xlim:si.current,ylim:Ge.current,setAxisLimits:go,currentIteration:po,showGradientField:Gn,bivariatePlotView:qi})]}),Si.jsx(ij,{onTabChange:Ga=>{wt(Ga==="Compare"),fa(!1),Zr(!1)},comparison:Si.jsx(oj,{settings:Ie,entries:sr,trajectories:Yi.comparison,iteration:br,busy:Za,ready:!Yi.isLoading,animating:an,onAdd:Ga=>{const hi=Sn.current++;tn(0),vr(ai=>[...ai,{id:hi,settings:Ga,color:hj(hi),visible:!0}])},onRemove:Ga=>{Zr(!1),vr(hi=>hi.filter(ai=>ai.id!==Ga))},onToggleVisibility:Ga=>vr(hi=>hi.map(ai=>ai.id===Ga?{...ai,visible:!ai.visible}:ai)),onAction:Ga=>{Ga==="Animate"?Zr(!0):Ga==="Pause"?Zr(!1):tn(Ga==="Reset"?0:hi=>Math.max(0,hi+(Ga==="Next"?1:-1)))}}),settings:Ie,setSettings:xl,onRandomInitialPoint:mi,trajectoryValues:Yi.plotData.trajectoryValues,onReset:()=>{fa(!1),Yi.sendReset()},onNextStep:Yi.sendNextStep,onPrevStep:Yi.sendPrevStep,onAnimate:()=>fa(!0),onPause:()=>fa(!1),isAnimating:Ln,currentIteration:po,totalIterations:js,showGradientField:Gn,onShowGradientFieldChange:ao})]})]}),Si.jsx("div",{})]})}SO.createRoot(document.getElementById("root")).render(Si.jsx(ku.StrictMode,{children:Si.jsx(vj,{})})); + ${Ar} ${Lr} ${tn} = u_${tn}; +#endif +`}),staticAttributes:Me,staticUniforms:_t}}class lr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(P,oe,Me,Ce,Be,_t,kt,Xt,fr){this.context=P;let Ar=this.boundPaintVertexBuffers.length!==Ce.length;for(let Lr=0;!Ar&&Lr({u_matrix:Ue,u_texture:0,u_ele_delta:P,u_fog_matrix:oe,u_fog_color:Me?Me.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:Me?Me.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Me?Me.calculateFogBlendOpacity(Ce):0,u_horizon_color:Me?Me.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:Me?Me.properties.get("horizon-fog-blend"):1});function cn(Ue){const P=[];for(let oe=0;oe({u_depth:new t.aH(Tr,Pr.u_depth),u_terrain:new t.aH(Tr,Pr.u_terrain),u_terrain_dim:new t.aI(Tr,Pr.u_terrain_dim),u_terrain_matrix:new t.aJ(Tr,Pr.u_terrain_matrix),u_terrain_unpack:new t.aK(Tr,Pr.u_terrain_unpack),u_terrain_exaggeration:new t.aI(Tr,Pr.u_terrain_exaggeration)}))(P,gr),this.binderUniforms=Me?Me.getUniforms(P,gr):[]}draw(P,oe,Me,Ce,Be,_t,kt,Xt,fr,Ar,Lr,tn,xn,Ze,tt,vt,bt,zt){const Et=P.gl;if(this.failedToCreate)return;if(P.program.set(this.program),P.setDepthMode(Me),P.setStencilMode(Ce),P.setColorMode(Be),P.setCullFace(_t),Xt){P.activeTexture.set(Et.TEXTURE2),Et.bindTexture(Et.TEXTURE_2D,Xt.depthTexture),P.activeTexture.set(Et.TEXTURE3),Et.bindTexture(Et.TEXTURE_2D,Xt.texture);for(const gr in this.terrainUniforms)this.terrainUniforms[gr].set(Xt[gr])}for(const gr in this.fixedUniforms)this.fixedUniforms[gr].set(kt[gr]);tt&&tt.setUniforms(P,this.binderUniforms,xn,{zoom:Ze});let Ut=0;switch(oe){case Et.LINES:Ut=2;break;case Et.TRIANGLES:Ut=3;break;case Et.LINE_STRIP:Ut=1}for(const gr of tn.get()){const Tr=gr.vaos||(gr.vaos={});(Tr[fr]||(Tr[fr]=new lr)).bind(P,this,Ar,tt?tt.getPaintVertexBuffers():[],Lr,gr.vertexOffset,vt,bt,zt),Et.drawElements(oe,gr.primitiveLength*Ut,Et.UNSIGNED_SHORT,gr.primitiveOffset*Ut*2)}}}function qn(Ue,P,oe){const Me=1/$n(oe,1,P.transform.tileZoom),Ce=Math.pow(2,oe.tileID.overscaledZ),Be=oe.tileSize*Math.pow(2,P.transform.tileZoom)/Ce,_t=Be*(oe.tileID.canonical.x+oe.tileID.wrap*Ce),kt=Be*oe.tileID.canonical.y;return{u_image:0,u_texsize:oe.imageAtlasTexture.size,u_scale:[Me,Ue.fromScale,Ue.toScale],u_fade:Ue.t,u_pixel_coord_upper:[_t>>16,kt>>16],u_pixel_coord_lower:[65535&_t,65535&kt]}}const jn=(Ue,P,oe,Me)=>{const Ce=P.style.light,Be=Ce.properties.get("position"),_t=[Be.x,Be.y,Be.z],kt=(function(){var fr=new t.A(9);return t.A!=Float32Array&&(fr[1]=0,fr[2]=0,fr[3]=0,fr[5]=0,fr[6]=0,fr[7]=0),fr[0]=1,fr[4]=1,fr[8]=1,fr})();Ce.properties.get("anchor")==="viewport"&&(function(fr,Ar){var Lr=Math.sin(Ar),tn=Math.cos(Ar);fr[0]=tn,fr[1]=Lr,fr[2]=0,fr[3]=-Lr,fr[4]=tn,fr[5]=0,fr[6]=0,fr[7]=0,fr[8]=1})(kt,-P.transform.angle),(function(fr,Ar,Lr){var tn=Ar[0],xn=Ar[1],Ze=Ar[2];fr[0]=tn*Lr[0]+xn*Lr[3]+Ze*Lr[6],fr[1]=tn*Lr[1]+xn*Lr[4]+Ze*Lr[7],fr[2]=tn*Lr[2]+xn*Lr[5]+Ze*Lr[8]})(_t,_t,kt);const Xt=Ce.properties.get("color");return{u_matrix:Ue,u_lightpos:_t,u_lightintensity:Ce.properties.get("intensity"),u_lightcolor:[Xt.r,Xt.g,Xt.b],u_vertical_gradient:+oe,u_opacity:Me}},fn=(Ue,P,oe,Me,Ce,Be,_t)=>t.e(jn(Ue,P,oe,Me),qn(Be,P,_t),{u_height_factor:-Math.pow(2,Ce.overscaledZ)/_t.tileSize/8}),In=Ue=>({u_matrix:Ue}),gi=(Ue,P,oe,Me)=>t.e(In(Ue),qn(oe,P,Me)),Ea=(Ue,P)=>({u_matrix:Ue,u_world:P}),Ci=(Ue,P,oe,Me,Ce)=>t.e(gi(Ue,P,oe,Me),{u_world:Ce}),Xi=(Ue,P,oe,Me)=>{const Ce=Ue.transform;let Be,_t;if(Me.paint.get("circle-pitch-alignment")==="map"){const kt=$n(oe,1,Ce.zoom);Be=!0,_t=[kt,kt]}else Be=!1,_t=Ce.pixelsToGLUnits;return{u_camera_to_center_distance:Ce.cameraToCenterDistance,u_scale_with_map:+(Me.paint.get("circle-pitch-scale")==="map"),u_matrix:Ue.translatePosMatrix(P.posMatrix,oe,Me.paint.get("circle-translate"),Me.paint.get("circle-translate-anchor")),u_pitch_with_map:+Be,u_device_pixel_ratio:Ue.pixelRatio,u_extrude_scale:_t}},so=(Ue,P,oe)=>({u_matrix:Ue,u_inv_matrix:P,u_camera_to_center_distance:oe.cameraToCenterDistance,u_viewport_size:[oe.width,oe.height]}),io=(Ue,P,oe=1)=>({u_matrix:Ue,u_color:P,u_overlay:0,u_overlay_scale:oe}),Mo=Ue=>({u_matrix:Ue}),ui=(Ue,P,oe,Me)=>({u_matrix:Ue,u_extrude_scale:$n(P,1,oe),u_intensity:Me}),ts=(Ue,P,oe,Me)=>{const Ce=t.H();t.aP(Ce,0,Ue.width,Ue.height,0,0,1);const Be=Ue.context.gl;return{u_matrix:Ce,u_world:[Be.drawingBufferWidth,Be.drawingBufferHeight],u_image:oe,u_color_ramp:Me,u_opacity:P.paint.get("heatmap-opacity")}};function Ho(Ue,P){const oe=Math.pow(2,P.canonical.z),Me=P.canonical.y;return[new t.Z(0,Me/oe).toLngLat().lat,new t.Z(0,(Me+1)/oe).toLngLat().lat]}const Xs=(Ue,P,oe,Me)=>{const Ce=Ue.transform;return{u_matrix:Vs(Ue,P,oe,Me),u_ratio:1/$n(P,1,Ce.zoom),u_device_pixel_ratio:Ue.pixelRatio,u_units_to_pixels:[1/Ce.pixelsToGLUnits[0],1/Ce.pixelsToGLUnits[1]]}},cs=(Ue,P,oe,Me,Ce)=>t.e(Xs(Ue,P,oe,Ce),{u_image:0,u_image_height:Me}),Jo=(Ue,P,oe,Me,Ce)=>{const Be=Ue.transform,_t=Ys(P,Be);return{u_matrix:Vs(Ue,P,oe,Ce),u_texsize:P.imageAtlasTexture.size,u_ratio:1/$n(P,1,Be.zoom),u_device_pixel_ratio:Ue.pixelRatio,u_image:0,u_scale:[_t,Me.fromScale,Me.toScale],u_fade:Me.t,u_units_to_pixels:[1/Be.pixelsToGLUnits[0],1/Be.pixelsToGLUnits[1]]}},Uo=(Ue,P,oe,Me,Ce,Be)=>{const _t=Ue.lineAtlas,kt=Ys(P,Ue.transform),Xt=oe.layout.get("line-cap")==="round",fr=_t.getDash(Me.from,Xt),Ar=_t.getDash(Me.to,Xt),Lr=fr.width*Ce.fromScale,tn=Ar.width*Ce.toScale;return t.e(Xs(Ue,P,oe,Be),{u_patternscale_a:[kt/Lr,-fr.height/2],u_patternscale_b:[kt/tn,-Ar.height/2],u_sdfgamma:_t.width/(256*Math.min(Lr,tn)*Ue.pixelRatio)/2,u_image:0,u_tex_y_a:fr.y,u_tex_y_b:Ar.y,u_mix:Ce.t})};function Ys(Ue,P){return 1/$n(Ue,1,P.tileZoom)}function Vs(Ue,P,oe,Me){return Ue.translatePosMatrix(Me?Me.posMatrix:P.tileID.posMatrix,P,oe.paint.get("line-translate"),oe.paint.get("line-translate-anchor"))}const ll=(Ue,P,oe,Me,Ce)=>{return{u_matrix:Ue,u_tl_parent:P,u_scale_parent:oe,u_buffer_scale:1,u_fade_t:Me.mix,u_opacity:Me.opacity*Ce.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Ce.paint.get("raster-brightness-min"),u_brightness_high:Ce.paint.get("raster-brightness-max"),u_saturation_factor:(_t=Ce.paint.get("raster-saturation"),_t>0?1-1/(1.001-_t):-_t),u_contrast_factor:(Be=Ce.paint.get("raster-contrast"),Be>0?1/(1-Be):1+Be),u_spin_weights:fs(Ce.paint.get("raster-hue-rotate"))};var Be,_t};function fs(Ue){Ue*=Math.PI/180;const P=Math.sin(Ue),oe=Math.cos(Ue);return[(2*oe+1)/3,(-Math.sqrt(3)*P-oe+1)/3,(Math.sqrt(3)*P-oe+1)/3]}const Zo=(Ue,P,oe,Me,Ce,Be,_t,kt,Xt,fr,Ar,Lr,tn,xn)=>{const Ze=_t.transform;return{u_is_size_zoom_constant:+(Ue==="constant"||Ue==="source"),u_is_size_feature_constant:+(Ue==="constant"||Ue==="camera"),u_size_t:P?P.uSizeT:0,u_size:P?P.uSize:0,u_camera_to_center_distance:Ze.cameraToCenterDistance,u_pitch:Ze.pitch/360*2*Math.PI,u_rotate_symbol:+oe,u_aspect_ratio:Ze.width/Ze.height,u_fade_change:_t.options.fadeDuration?_t.symbolFadeChange:1,u_matrix:kt,u_label_plane_matrix:Xt,u_coord_matrix:fr,u_is_text:+Lr,u_pitch_with_map:+Me,u_is_along_line:Ce,u_is_variable_anchor:Be,u_texsize:tn,u_texture:0,u_translation:Ar,u_pitched_scale:xn}},po=(Ue,P,oe,Me,Ce,Be,_t,kt,Xt,fr,Ar,Lr,tn,xn,Ze)=>{const tt=_t.transform;return t.e(Zo(Ue,P,oe,Me,Ce,Be,_t,kt,Xt,fr,Ar,Lr,tn,Ze),{u_gamma_scale:Me?Math.cos(tt._pitch)*tt.cameraToCenterDistance:1,u_device_pixel_ratio:_t.pixelRatio,u_is_halo:1})},hs=(Ue,P,oe,Me,Ce,Be,_t,kt,Xt,fr,Ar,Lr,tn,xn)=>t.e(po(Ue,P,oe,Me,Ce,Be,_t,kt,Xt,fr,Ar,!0,Lr,!0,xn),{u_texsize_icon:tn,u_texture_icon:1}),ul=(Ue,P,oe)=>({u_matrix:Ue,u_opacity:P,u_color:oe}),kl=(Ue,P,oe,Me,Ce,Be)=>t.e((function(_t,kt,Xt,fr){const Ar=Xt.imageManager.getPattern(_t.from.toString()),Lr=Xt.imageManager.getPattern(_t.to.toString()),{width:tn,height:xn}=Xt.imageManager.getPixelSize(),Ze=Math.pow(2,fr.tileID.overscaledZ),tt=fr.tileSize*Math.pow(2,Xt.transform.tileZoom)/Ze,vt=tt*(fr.tileID.canonical.x+fr.tileID.wrap*Ze),bt=tt*fr.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Ar.tl,u_pattern_br_a:Ar.br,u_pattern_tl_b:Lr.tl,u_pattern_br_b:Lr.br,u_texsize:[tn,xn],u_mix:kt.t,u_pattern_size_a:Ar.displaySize,u_pattern_size_b:Lr.displaySize,u_scale_a:kt.fromScale,u_scale_b:kt.toScale,u_tile_units_to_pixels:1/$n(fr,1,Xt.transform.tileZoom),u_pixel_coord_upper:[vt>>16,bt>>16],u_pixel_coord_lower:[65535&vt,65535&bt]}})(Me,Be,oe,Ce),{u_matrix:Ue,u_opacity:P}),Rl={fillExtrusion:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_lightpos:new t.aN(Ue,P.u_lightpos),u_lightintensity:new t.aI(Ue,P.u_lightintensity),u_lightcolor:new t.aN(Ue,P.u_lightcolor),u_vertical_gradient:new t.aI(Ue,P.u_vertical_gradient),u_opacity:new t.aI(Ue,P.u_opacity)}),fillExtrusionPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_lightpos:new t.aN(Ue,P.u_lightpos),u_lightintensity:new t.aI(Ue,P.u_lightintensity),u_lightcolor:new t.aN(Ue,P.u_lightcolor),u_vertical_gradient:new t.aI(Ue,P.u_vertical_gradient),u_height_factor:new t.aI(Ue,P.u_height_factor),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade),u_opacity:new t.aI(Ue,P.u_opacity)}),fill:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix)}),fillPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),fillOutline:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world)}),fillOutlinePattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world),u_image:new t.aH(Ue,P.u_image),u_texsize:new t.aO(Ue,P.u_texsize),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),circle:(Ue,P)=>({u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_scale_with_map:new t.aH(Ue,P.u_scale_with_map),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_extrude_scale:new t.aO(Ue,P.u_extrude_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_matrix:new t.aJ(Ue,P.u_matrix)}),collisionBox:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_pixel_extrude_scale:new t.aO(Ue,P.u_pixel_extrude_scale)}),collisionCircle:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_inv_matrix:new t.aJ(Ue,P.u_inv_matrix),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_viewport_size:new t.aO(Ue,P.u_viewport_size)}),debug:(Ue,P)=>({u_color:new t.aL(Ue,P.u_color),u_matrix:new t.aJ(Ue,P.u_matrix),u_overlay:new t.aH(Ue,P.u_overlay),u_overlay_scale:new t.aI(Ue,P.u_overlay_scale)}),clippingMask:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix)}),heatmap:(Ue,P)=>({u_extrude_scale:new t.aI(Ue,P.u_extrude_scale),u_intensity:new t.aI(Ue,P.u_intensity),u_matrix:new t.aJ(Ue,P.u_matrix)}),heatmapTexture:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_world:new t.aO(Ue,P.u_world),u_image:new t.aH(Ue,P.u_image),u_color_ramp:new t.aH(Ue,P.u_color_ramp),u_opacity:new t.aI(Ue,P.u_opacity)}),hillshade:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_latrange:new t.aO(Ue,P.u_latrange),u_light:new t.aO(Ue,P.u_light),u_shadow:new t.aL(Ue,P.u_shadow),u_highlight:new t.aL(Ue,P.u_highlight),u_accent:new t.aL(Ue,P.u_accent)}),hillshadePrepare:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_image:new t.aH(Ue,P.u_image),u_dimension:new t.aO(Ue,P.u_dimension),u_zoom:new t.aI(Ue,P.u_zoom),u_unpack:new t.aK(Ue,P.u_unpack)}),line:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels)}),lineGradient:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_image:new t.aH(Ue,P.u_image),u_image_height:new t.aI(Ue,P.u_image_height)}),linePattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texsize:new t.aO(Ue,P.u_texsize),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_image:new t.aH(Ue,P.u_image),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_scale:new t.aN(Ue,P.u_scale),u_fade:new t.aI(Ue,P.u_fade)}),lineSDF:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ratio:new t.aI(Ue,P.u_ratio),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Ue,P.u_units_to_pixels),u_patternscale_a:new t.aO(Ue,P.u_patternscale_a),u_patternscale_b:new t.aO(Ue,P.u_patternscale_b),u_sdfgamma:new t.aI(Ue,P.u_sdfgamma),u_image:new t.aH(Ue,P.u_image),u_tex_y_a:new t.aI(Ue,P.u_tex_y_a),u_tex_y_b:new t.aI(Ue,P.u_tex_y_b),u_mix:new t.aI(Ue,P.u_mix)}),raster:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_tl_parent:new t.aO(Ue,P.u_tl_parent),u_scale_parent:new t.aI(Ue,P.u_scale_parent),u_buffer_scale:new t.aI(Ue,P.u_buffer_scale),u_fade_t:new t.aI(Ue,P.u_fade_t),u_opacity:new t.aI(Ue,P.u_opacity),u_image0:new t.aH(Ue,P.u_image0),u_image1:new t.aH(Ue,P.u_image1),u_brightness_low:new t.aI(Ue,P.u_brightness_low),u_brightness_high:new t.aI(Ue,P.u_brightness_high),u_saturation_factor:new t.aI(Ue,P.u_saturation_factor),u_contrast_factor:new t.aI(Ue,P.u_contrast_factor),u_spin_weights:new t.aN(Ue,P.u_spin_weights)}),symbolIcon:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texture:new t.aH(Ue,P.u_texture),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),symbolSDF:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texture:new t.aH(Ue,P.u_texture),u_gamma_scale:new t.aI(Ue,P.u_gamma_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_is_halo:new t.aH(Ue,P.u_is_halo),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),symbolTextAndIcon:(Ue,P)=>({u_is_size_zoom_constant:new t.aH(Ue,P.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Ue,P.u_is_size_feature_constant),u_size_t:new t.aI(Ue,P.u_size_t),u_size:new t.aI(Ue,P.u_size),u_camera_to_center_distance:new t.aI(Ue,P.u_camera_to_center_distance),u_pitch:new t.aI(Ue,P.u_pitch),u_rotate_symbol:new t.aH(Ue,P.u_rotate_symbol),u_aspect_ratio:new t.aI(Ue,P.u_aspect_ratio),u_fade_change:new t.aI(Ue,P.u_fade_change),u_matrix:new t.aJ(Ue,P.u_matrix),u_label_plane_matrix:new t.aJ(Ue,P.u_label_plane_matrix),u_coord_matrix:new t.aJ(Ue,P.u_coord_matrix),u_is_text:new t.aH(Ue,P.u_is_text),u_pitch_with_map:new t.aH(Ue,P.u_pitch_with_map),u_is_along_line:new t.aH(Ue,P.u_is_along_line),u_is_variable_anchor:new t.aH(Ue,P.u_is_variable_anchor),u_texsize:new t.aO(Ue,P.u_texsize),u_texsize_icon:new t.aO(Ue,P.u_texsize_icon),u_texture:new t.aH(Ue,P.u_texture),u_texture_icon:new t.aH(Ue,P.u_texture_icon),u_gamma_scale:new t.aI(Ue,P.u_gamma_scale),u_device_pixel_ratio:new t.aI(Ue,P.u_device_pixel_ratio),u_is_halo:new t.aH(Ue,P.u_is_halo),u_translation:new t.aO(Ue,P.u_translation),u_pitched_scale:new t.aI(Ue,P.u_pitched_scale)}),background:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_opacity:new t.aI(Ue,P.u_opacity),u_color:new t.aL(Ue,P.u_color)}),backgroundPattern:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_opacity:new t.aI(Ue,P.u_opacity),u_image:new t.aH(Ue,P.u_image),u_pattern_tl_a:new t.aO(Ue,P.u_pattern_tl_a),u_pattern_br_a:new t.aO(Ue,P.u_pattern_br_a),u_pattern_tl_b:new t.aO(Ue,P.u_pattern_tl_b),u_pattern_br_b:new t.aO(Ue,P.u_pattern_br_b),u_texsize:new t.aO(Ue,P.u_texsize),u_mix:new t.aI(Ue,P.u_mix),u_pattern_size_a:new t.aO(Ue,P.u_pattern_size_a),u_pattern_size_b:new t.aO(Ue,P.u_pattern_size_b),u_scale_a:new t.aI(Ue,P.u_scale_a),u_scale_b:new t.aI(Ue,P.u_scale_b),u_pixel_coord_upper:new t.aO(Ue,P.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Ue,P.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(Ue,P.u_tile_units_to_pixels)}),terrain:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texture:new t.aH(Ue,P.u_texture),u_ele_delta:new t.aI(Ue,P.u_ele_delta),u_fog_matrix:new t.aJ(Ue,P.u_fog_matrix),u_fog_color:new t.aL(Ue,P.u_fog_color),u_fog_ground_blend:new t.aI(Ue,P.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(Ue,P.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(Ue,P.u_horizon_color),u_horizon_fog_blend:new t.aI(Ue,P.u_horizon_fog_blend)}),terrainDepth:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_ele_delta:new t.aI(Ue,P.u_ele_delta)}),terrainCoords:(Ue,P)=>({u_matrix:new t.aJ(Ue,P.u_matrix),u_texture:new t.aH(Ue,P.u_texture),u_terrain_coords_id:new t.aI(Ue,P.u_terrain_coords_id),u_ele_delta:new t.aI(Ue,P.u_ele_delta)}),sky:(Ue,P)=>({u_sky_color:new t.aL(Ue,P.u_sky_color),u_horizon_color:new t.aL(Ue,P.u_horizon_color),u_horizon:new t.aI(Ue,P.u_horizon),u_sky_horizon_blend:new t.aI(Ue,P.u_sky_horizon_blend)})};class Ms{constructor(P,oe,Me){this.context=P;const Ce=P.gl;this.buffer=Ce.createBuffer(),this.dynamicDraw=!!Me,this.context.unbindVAO(),P.bindElementBuffer.set(this.buffer),Ce.bufferData(Ce.ELEMENT_ARRAY_BUFFER,oe.arrayBuffer,this.dynamicDraw?Ce.DYNAMIC_DRAW:Ce.STATIC_DRAW),this.dynamicDraw||delete oe.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(P){const oe=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),oe.bufferSubData(oe.ELEMENT_ARRAY_BUFFER,0,P.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const fi={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class to{constructor(P,oe,Me,Ce){this.length=oe.length,this.attributes=Me,this.itemSize=oe.bytesPerElement,this.dynamicDraw=Ce,this.context=P;const Be=P.gl;this.buffer=Be.createBuffer(),P.bindVertexBuffer.set(this.buffer),Be.bufferData(Be.ARRAY_BUFFER,oe.arrayBuffer,this.dynamicDraw?Be.DYNAMIC_DRAW:Be.STATIC_DRAW),this.dynamicDraw||delete oe.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(P){if(P.length!==this.length)throw new Error(`Length of new data is ${P.length}, which doesn't match current length of ${this.length}`);const oe=this.context.gl;this.bind(),oe.bufferSubData(oe.ARRAY_BUFFER,0,P.arrayBuffer)}enableAttributes(P,oe){for(let Me=0;Me0){const Tr=t.H();t.aQ(Tr,Et.placementInvProjMatrix,Ue.transform.glCoordMatrix),t.aQ(Tr,Tr,Et.placementViewportMatrix),Xt.push({circleArray:gr,circleOffset:Ar,transform:zt.posMatrix,invTransform:Tr,coord:zt}),fr+=gr.length/4,Ar=fr}Ut&&kt.draw(Be,_t.LINES,Fs.disabled,pl.disabled,Ue.colorModeForRenderPass(),Oo.disabled,{u_matrix:zt.posMatrix,u_pixel_extrude_scale:[1/(Lr=Ue.transform).width,1/Lr.height]},Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(zt),oe.id,Ut.layoutVertexBuffer,Ut.indexBuffer,Ut.segments,null,Ue.transform.zoom,null,null,Ut.collisionVertexBuffer)}var Lr;if(!Ce||!Xt.length)return;const tn=Ue.useProgram("collisionCircle"),xn=new t.aR;xn.resize(4*fr),xn._trim();let Ze=0;for(const bt of Xt)for(let zt=0;zt=0&&(bt[Et.associatedIconIndex]={shiftedAnchor:$i,angle:bo})}else mr(Et.numGlyphs,tt)}if(fr){vt.clear();const zt=Ue.icon.placedSymbolArray;for(let Et=0;EtUe.style.map.terrain.getElevation(Pn,Cn,La):null,Mn=oe.layout.get("text-rotation-alignment")==="map";ke(Ta,Pn.posMatrix,Ue,Ce,uc,ge,bt,fr,Mn,tt,Pn.toUnwrapped(),Ze.width,Ze.height,Oe,dn)}const St=Pn.posMatrix,It=Ce&&Yr||wt,tr=zt||It?Ou:uc,er=Uc,_r=ni&&oe.paint.get(Ce?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Zr;Zr=ni?Ta.iconsInText?hs($i.kind,Wo,Et,bt,zt,It,Ue,St,tr,er,Oe,Js,ou,En):po($i.kind,Wo,Et,bt,zt,It,Ue,St,tr,er,Oe,Ce,Js,!0,En):Zo($i.kind,Wo,Et,bt,zt,It,Ue,St,tr,er,Oe,Ce,Js,En);const Xr={program:vo,buffers:ri,uniformValues:Zr,atlasTexture:Es,atlasTextureIcon:ks,atlasInterpolation:il,atlasInterpolationIcon:mu,isSDF:ni,hasHalo:_r};if(gr&&Ta.canOverlap){Tr=!0;const dn=ri.segments.get();for(const Mn of dn)sn.push({segments:new t.a0([Mn]),sortKey:Mn.sortKey,state:Xr,terrainData:Ks})}else sn.push({segments:ri.segments,sortKey:0,state:Xr,terrainData:Ks})}Tr&&sn.sort((Pn,Xn)=>Pn.sortKey-Xn.sortKey);for(const Pn of sn){const Xn=Pn.state;if(tn.activeTexture.set(xn.TEXTURE0),Xn.atlasTexture.bind(Xn.atlasInterpolation,xn.CLAMP_TO_EDGE),Xn.atlasTextureIcon&&(tn.activeTexture.set(xn.TEXTURE1),Xn.atlasTextureIcon&&Xn.atlasTextureIcon.bind(Xn.atlasInterpolationIcon,xn.CLAMP_TO_EDGE)),Xn.isSDF){const Ta=Xn.uniformValues;Xn.hasHalo&&(Ta.u_is_halo=1,Hh(Xn.buffers,Pn.segments,oe,Ue,Xn.program,Pr,Ar,Lr,Ta,Pn.terrainData)),Ta.u_is_halo=0}Hh(Xn.buffers,Pn.segments,oe,Ue,Xn.program,Pr,Ar,Lr,Xn.uniformValues,Pn.terrainData)}}function Hh(Ue,P,oe,Me,Ce,Be,_t,kt,Xt,fr){const Ar=Me.context;Ce.draw(Ar,Ar.gl.TRIANGLES,Be,_t,kt,Oo.disabled,Xt,fr,oe.id,Ue.layoutVertexBuffer,Ue.indexBuffer,P,oe.paint,Me.transform.zoom,Ue.programConfigurations.get(oe.id),Ue.dynamicLayoutVertexBuffer,Ue.opacityVertexBuffer)}function ch(Ue,P,oe,Me){const Ce=Ue.context,Be=Ce.gl,_t=pl.disabled,kt=new fu([Be.ONE,Be.ONE],t.aM.transparent,[!0,!0,!0,!0]),Xt=P.getBucket(oe);if(!Xt)return;const fr=Me.key;let Ar=oe.heatmapFbos.get(fr);Ar||(Ar=Fh(Ce,P.tileSize,P.tileSize),oe.heatmapFbos.set(fr,Ar)),Ce.bindFramebuffer.set(Ar.framebuffer),Ce.viewport.set([0,0,P.tileSize,P.tileSize]),Ce.clear({color:t.aM.transparent});const Lr=Xt.programConfigurations.get(oe.id),tn=Ue.useProgram("heatmap",Lr),xn=Ue.style.map.terrain.getTerrainData(Me);tn.draw(Ce,Be.TRIANGLES,Fs.disabled,_t,kt,Oo.disabled,ui(Me.posMatrix,P,Ue.transform.zoom,oe.paint.get("heatmap-intensity")),xn,oe.id,Xt.layoutVertexBuffer,Xt.indexBuffer,Xt.segments,oe.paint,Ue.transform.zoom,Lr)}function Nf(Ue,P,oe){const Me=Ue.context,Ce=Me.gl;Me.setColorMode(Ue.colorModeForRenderPass());const Be=Bh(Me,P),_t=oe.key,kt=P.heatmapFbos.get(_t);kt&&(Me.activeTexture.set(Ce.TEXTURE0),Ce.bindTexture(Ce.TEXTURE_2D,kt.colorAttachment.get()),Me.activeTexture.set(Ce.TEXTURE1),Be.bind(Ce.LINEAR,Ce.CLAMP_TO_EDGE),Ue.useProgram("heatmapTexture").draw(Me,Ce.TRIANGLES,Fs.disabled,pl.disabled,Ue.colorModeForRenderPass(),Oo.disabled,ts(Ue,P,0,1),null,P.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments,P.paint,Ue.transform.zoom),kt.destroy(),P.heatmapFbos.delete(_t))}function Fh(Ue,P,oe){var Me,Ce;const Be=Ue.gl,_t=Be.createTexture();Be.bindTexture(Be.TEXTURE_2D,_t),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_S,Be.CLAMP_TO_EDGE),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_WRAP_T,Be.CLAMP_TO_EDGE),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MIN_FILTER,Be.LINEAR),Be.texParameteri(Be.TEXTURE_2D,Be.TEXTURE_MAG_FILTER,Be.LINEAR);const kt=(Me=Ue.HALF_FLOAT)!==null&&Me!==void 0?Me:Be.UNSIGNED_BYTE,Xt=(Ce=Ue.RGBA16F)!==null&&Ce!==void 0?Ce:Be.RGBA;Be.texImage2D(Be.TEXTURE_2D,0,Xt,P,oe,0,Be.RGBA,kt,null);const fr=Ue.createFramebuffer(P,oe,!1,!1);return fr.colorAttachment.set(_t),fr}function Bh(Ue,P){return P.colorRampTexture||(P.colorRampTexture=new u(Ue,P.colorRamp,Ue.gl.RGBA)),P.colorRampTexture}function of(Ue,P,oe,Me,Ce){if(!oe||!Me||!Me.imageAtlas)return;const Be=Me.imageAtlas.patternPositions;let _t=Be[oe.to.toString()],kt=Be[oe.from.toString()];if(!_t&&kt&&(_t=kt),!kt&&_t&&(kt=_t),!_t||!kt){const Xt=Ce.getPaintProperty(P);_t=Be[Xt],kt=Be[Xt]}_t&&kt&&Ue.setConstantPatternPositions(_t,kt)}function Gh(Ue,P,oe,Me,Ce,Be,_t){const kt=Ue.context.gl,Xt="fill-pattern",fr=oe.paint.get(Xt),Ar=fr&&fr.constantOr(1),Lr=oe.getCrossfadeParameters();let tn,xn,Ze,tt,vt;_t?(xn=Ar&&!oe.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",tn=kt.LINES):(xn=Ar?"fillPattern":"fill",tn=kt.TRIANGLES);const bt=fr.constantOr(null);for(const zt of Me){const Et=P.getTile(zt);if(Ar&&!Et.patternsLoaded())continue;const Ut=Et.getBucket(oe);if(!Ut)continue;const gr=Ut.programConfigurations.get(oe.id),Tr=Ue.useProgram(xn,gr),Pr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(zt);Ar&&(Ue.context.activeTexture.set(kt.TEXTURE0),Et.imageAtlasTexture.bind(kt.LINEAR,kt.CLAMP_TO_EDGE),gr.updatePaintBuffers(Lr)),of(gr,Xt,bt,Et,oe);const Yr=Pr?zt:null,sn=Ue.translatePosMatrix(Yr?Yr.posMatrix:zt.posMatrix,Et,oe.paint.get("fill-translate"),oe.paint.get("fill-translate-anchor"));if(_t){tt=Ut.indexBuffer2,vt=Ut.segments2;const En=[kt.drawingBufferWidth,kt.drawingBufferHeight];Ze=xn==="fillOutlinePattern"&&Ar?Ci(sn,Ue,Lr,Et,En):Ea(sn,En)}else tt=Ut.indexBuffer,vt=Ut.segments,Ze=Ar?gi(sn,Ue,Lr,Et):In(sn);Tr.draw(Ue.context,tn,Ce,Ue.stencilModeForClipping(zt),Be,Oo.disabled,Ze,Pr,oe.id,Ut.layoutVertexBuffer,tt,vt,oe.paint,Ue.transform.zoom,gr)}}function Ef(Ue,P,oe,Me,Ce,Be,_t){const kt=Ue.context,Xt=kt.gl,fr="fill-extrusion-pattern",Ar=oe.paint.get(fr),Lr=Ar.constantOr(1),tn=oe.getCrossfadeParameters(),xn=oe.paint.get("fill-extrusion-opacity"),Ze=Ar.constantOr(null);for(const tt of Me){const vt=P.getTile(tt),bt=vt.getBucket(oe);if(!bt)continue;const zt=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(tt),Et=bt.programConfigurations.get(oe.id),Ut=Ue.useProgram(Lr?"fillExtrusionPattern":"fillExtrusion",Et);Lr&&(Ue.context.activeTexture.set(Xt.TEXTURE0),vt.imageAtlasTexture.bind(Xt.LINEAR,Xt.CLAMP_TO_EDGE),Et.updatePaintBuffers(tn)),of(Et,fr,Ze,vt,oe);const gr=Ue.translatePosMatrix(tt.posMatrix,vt,oe.paint.get("fill-extrusion-translate"),oe.paint.get("fill-extrusion-translate-anchor")),Tr=oe.paint.get("fill-extrusion-vertical-gradient"),Pr=Lr?fn(gr,Ue,Tr,xn,tt,tn,vt):jn(gr,Ue,Tr,xn);Ut.draw(kt,kt.gl.TRIANGLES,Ce,Be,_t,Oo.backCCW,Pr,zt,oe.id,bt.layoutVertexBuffer,bt.indexBuffer,bt.segments,oe.paint,Ue.transform.zoom,Et,Ue.style.map.terrain&&bt.centroidVertexBuffer)}}function vf(Ue,P,oe,Me,Ce,Be,_t){const kt=Ue.context,Xt=kt.gl,fr=oe.fbo;if(!fr)return;const Ar=Ue.useProgram("hillshade"),Lr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(P);kt.activeTexture.set(Xt.TEXTURE0),Xt.bindTexture(Xt.TEXTURE_2D,fr.colorAttachment.get()),Ar.draw(kt,Xt.TRIANGLES,Ce,Be,_t,Oo.disabled,((tn,xn,Ze,tt)=>{const vt=Ze.paint.get("hillshade-shadow-color"),bt=Ze.paint.get("hillshade-highlight-color"),zt=Ze.paint.get("hillshade-accent-color");let Et=Ze.paint.get("hillshade-illumination-direction")*(Math.PI/180);Ze.paint.get("hillshade-illumination-anchor")==="viewport"&&(Et-=tn.transform.angle);const Ut=!tn.options.moving;return{u_matrix:tt?tt.posMatrix:tn.transform.calculatePosMatrix(xn.tileID.toUnwrapped(),Ut),u_image:0,u_latrange:Ho(0,xn.tileID),u_light:[Ze.paint.get("hillshade-exaggeration"),Et],u_shadow:vt,u_highlight:bt,u_accent:zt}})(Ue,oe,Me,Lr?P:null),Lr,Me.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments)}function Ju(Ue,P,oe,Me,Ce,Be){const _t=Ue.context,kt=_t.gl,Xt=P.dem;if(Xt&&Xt.data){const fr=Xt.dim,Ar=Xt.stride,Lr=Xt.getPixels();if(_t.activeTexture.set(kt.TEXTURE1),_t.pixelStoreUnpackPremultiplyAlpha.set(!1),P.demTexture=P.demTexture||Ue.getTileTexture(Ar),P.demTexture){const xn=P.demTexture;xn.update(Lr,{premultiply:!1}),xn.bind(kt.NEAREST,kt.CLAMP_TO_EDGE)}else P.demTexture=new u(_t,Lr,kt.RGBA,{premultiply:!1}),P.demTexture.bind(kt.NEAREST,kt.CLAMP_TO_EDGE);_t.activeTexture.set(kt.TEXTURE0);let tn=P.fbo;if(!tn){const xn=new u(_t,{width:fr,height:fr,data:null},kt.RGBA);xn.bind(kt.LINEAR,kt.CLAMP_TO_EDGE),tn=P.fbo=_t.createFramebuffer(fr,fr,!0,!1),tn.colorAttachment.set(xn.texture)}_t.bindFramebuffer.set(tn.framebuffer),_t.viewport.set([0,0,fr,fr]),Ue.useProgram("hillshadePrepare").draw(_t,kt.TRIANGLES,Me,Ce,Be,Oo.disabled,((xn,Ze)=>{const tt=Ze.stride,vt=t.H();return t.aP(vt,0,t.X,-t.X,0,0,1),t.J(vt,vt,[0,-t.X,0]),{u_matrix:vt,u_image:1,u_dimension:[tt,tt],u_zoom:xn.overscaledZ,u_unpack:Ze.getUnpackVector()}})(P.tileID,Xt),null,oe.id,Ue.rasterBoundsBuffer,Ue.quadTriangleIndexBuffer,Ue.rasterBoundsSegments),P.needsHillshadePrepare=!1}}function Wf(Ue,P,oe,Me,Ce,Be){const _t=Me.paint.get("raster-fade-duration");if(!Be&&_t>0){const kt=i.now(),Xt=(kt-Ue.timeAdded)/_t,fr=P?(kt-P.timeAdded)/_t:-1,Ar=oe.getSource(),Lr=Ce.coveringZoomLevel({tileSize:Ar.tileSize,roundZoom:Ar.roundZoom}),tn=!P||Math.abs(P.tileID.overscaledZ-Lr)>Math.abs(Ue.tileID.overscaledZ-Lr),xn=tn&&Ue.refreshedUponExpiration?1:t.ac(tn?Xt:1-fr,0,1);return Ue.refreshedUponExpiration&&Xt>=1&&(Ue.refreshedUponExpiration=!1),P?{opacity:1,mix:1-xn}:{opacity:xn,mix:0}}return{opacity:1,mix:0}}const Nh=new t.aM(1,0,0,1),Ul=new t.aM(0,1,0,1),Th=new t.aM(0,0,1,1),Md=new t.aM(1,0,1,1),Xh=new t.aM(0,1,1,1);function fh(Ue,P,oe,Me){zc(Ue,0,P+oe/2,Ue.transform.width,oe,Me)}function Yh(Ue,P,oe,Me){zc(Ue,P-oe/2,0,oe,Ue.transform.height,Me)}function zc(Ue,P,oe,Me,Ce,Be){const _t=Ue.context,kt=_t.gl;kt.enable(kt.SCISSOR_TEST),kt.scissor(P*Ue.pixelRatio,oe*Ue.pixelRatio,Me*Ue.pixelRatio,Ce*Ue.pixelRatio),_t.clear({color:Be}),kt.disable(kt.SCISSOR_TEST)}function Zh(Ue,P,oe){const Me=Ue.context,Ce=Me.gl,Be=oe.posMatrix,_t=Ue.useProgram("debug"),kt=Fs.disabled,Xt=pl.disabled,fr=Ue.colorModeForRenderPass(),Ar="$debug",Lr=Ue.style.map.terrain&&Ue.style.map.terrain.getTerrainData(oe);Me.activeTexture.set(Ce.TEXTURE0);const tn=P.getTileByID(oe.key).latestRawTileData,xn=Math.floor((tn&&tn.byteLength||0)/1024),Ze=P.getTile(oe).tileSize,tt=512/Math.min(Ze,512)*(oe.overscaledZ/Ue.transform.zoom)*.5;let vt=oe.canonical.toString();oe.overscaledZ!==oe.canonical.z&&(vt+=` => ${oe.overscaledZ}`),(function(bt,zt){bt.initDebugOverlayCanvas();const Et=bt.debugOverlayCanvas,Ut=bt.context.gl,gr=bt.debugOverlayCanvas.getContext("2d");gr.clearRect(0,0,Et.width,Et.height),gr.shadowColor="white",gr.shadowBlur=2,gr.lineWidth=1.5,gr.strokeStyle="white",gr.textBaseline="top",gr.font="bold 36px Open Sans, sans-serif",gr.fillText(zt,5,5),gr.strokeText(zt,5,5),bt.debugOverlayTexture.update(Et),bt.debugOverlayTexture.bind(Ut.LINEAR,Ut.CLAMP_TO_EDGE)})(Ue,`${vt} ${xn}kB`),_t.draw(Me,Ce.TRIANGLES,kt,Xt,fu.alphaBlended,Oo.disabled,io(Be,t.aM.transparent,tt),null,Ar,Ue.debugBuffer,Ue.quadTriangleIndexBuffer,Ue.debugSegments),_t.draw(Me,Ce.LINE_STRIP,kt,Xt,fr,Oo.disabled,io(Be,t.aM.red),Lr,Ar,Ue.debugBuffer,Ue.tileBorderIndexBuffer,Ue.debugSegments)}function wu(Ue,P,oe){const Me=Ue.context,Ce=Me.gl,Be=Ue.colorModeForRenderPass(),_t=new Fs(Ce.LEQUAL,Fs.ReadWrite,Ue.depthRangeFor3D),kt=Ue.useProgram("terrain"),Xt=P.getTerrainMesh();Me.bindFramebuffer.set(null),Me.viewport.set([0,0,Ue.width,Ue.height]);for(const fr of oe){const Ar=Ue.renderToTexture.getTexture(fr),Lr=P.getTerrainData(fr.tileID);Me.activeTexture.set(Ce.TEXTURE0),Ce.bindTexture(Ce.TEXTURE_2D,Ar.texture);const tn=Ue.transform.calculatePosMatrix(fr.tileID.toUnwrapped()),xn=P.getMeshFrameDelta(Ue.transform.zoom),Ze=Ue.transform.calculateFogMatrix(fr.tileID.toUnwrapped()),tt=zr(tn,xn,Ze,Ue.style.sky,Ue.transform.pitch);kt.draw(Me,Ce.TRIANGLES,_t,pl.disabled,Be,Oo.backCCW,tt,Lr,"terrain",Xt.vertexBuffer,Xt.indexBuffer,Xt.segments)}}class Oc{constructor(P,oe,Me){this.vertexBuffer=P,this.indexBuffer=oe,this.segments=Me}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Uf{constructor(P,oe){this.context=new Sd(P),this.transform=oe,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Nt.maxUnderzooming+Nt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new jr}resize(P,oe,Me){if(this.width=Math.floor(P*Me),this.height=Math.floor(oe*Me),this.pixelRatio=Me,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const Ce of this.style._order)this.style._layers[Ce].resize()}setup(){const P=this.context,oe=new t.aX;oe.emplaceBack(0,0),oe.emplaceBack(t.X,0),oe.emplaceBack(0,t.X),oe.emplaceBack(t.X,t.X),this.tileExtentBuffer=P.createVertexBuffer(oe,un.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);const Me=new t.aX;Me.emplaceBack(0,0),Me.emplaceBack(t.X,0),Me.emplaceBack(0,t.X),Me.emplaceBack(t.X,t.X),this.debugBuffer=P.createVertexBuffer(Me,un.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);const Ce=new t.$;Ce.emplaceBack(0,0,0,0),Ce.emplaceBack(t.X,0,t.X,0),Ce.emplaceBack(0,t.X,0,t.X),Ce.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=P.createVertexBuffer(Ce,Ye.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);const Be=new t.aX;Be.emplaceBack(0,0),Be.emplaceBack(1,0),Be.emplaceBack(0,1),Be.emplaceBack(1,1),this.viewportBuffer=P.createVertexBuffer(Be,un.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);const _t=new t.aZ;_t.emplaceBack(0),_t.emplaceBack(1),_t.emplaceBack(3),_t.emplaceBack(2),_t.emplaceBack(0),this.tileBorderIndexBuffer=P.createIndexBuffer(_t);const kt=new t.aY;kt.emplaceBack(0,1,2),kt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=P.createIndexBuffer(kt);const Xt=this.context.gl;this.stencilClearMode=new pl({func:Xt.ALWAYS,mask:0},0,255,Xt.ZERO,Xt.ZERO,Xt.ZERO)}clearStencil(){const P=this.context,oe=P.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const Me=t.H();t.aP(Me,0,this.width,this.height,0,0,1),t.K(Me,Me,[oe.drawingBufferWidth,oe.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(P,oe.TRIANGLES,Fs.disabled,this.stencilClearMode,fu.disabled,Oo.disabled,Mo(Me),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(P,oe){if(this.currentStencilSource===P.source||!P.isTileClipped()||!oe||!oe.length)return;this.currentStencilSource=P.source;const Me=this.context,Ce=Me.gl;this.nextStencilID+oe.length>256&&this.clearStencil(),Me.setColorMode(fu.disabled),Me.setDepthMode(Fs.disabled);const Be=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const _t of oe){const kt=this._tileClippingMaskIDs[_t.key]=this.nextStencilID++,Xt=this.style.map.terrain&&this.style.map.terrain.getTerrainData(_t);Be.draw(Me,Ce.TRIANGLES,Fs.disabled,new pl({func:Ce.ALWAYS,mask:0},kt,255,Ce.KEEP,Ce.KEEP,Ce.REPLACE),fu.disabled,Oo.disabled,Mo(_t.posMatrix),Xt,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const P=this.nextStencilID++,oe=this.context.gl;return new pl({func:oe.NOTEQUAL,mask:255},P,255,oe.KEEP,oe.KEEP,oe.REPLACE)}stencilModeForClipping(P){const oe=this.context.gl;return new pl({func:oe.EQUAL,mask:255},this._tileClippingMaskIDs[P.key],0,oe.KEEP,oe.KEEP,oe.REPLACE)}stencilConfigForOverlap(P){const oe=this.context.gl,Me=P.sort((_t,kt)=>kt.overscaledZ-_t.overscaledZ),Ce=Me[Me.length-1].overscaledZ,Be=Me[0].overscaledZ-Ce+1;if(Be>1){this.currentStencilSource=void 0,this.nextStencilID+Be>256&&this.clearStencil();const _t={};for(let kt=0;kt({u_sky_color:bt.properties.get("sky-color"),u_horizon_color:bt.properties.get("horizon-color"),u_horizon:(zt.height/2+zt.getHorizon())*Et,u_sky_horizon_blend:bt.properties.get("sky-horizon-blend")*zt.height/2*Et}))(fr,Xt.style.map.transform,Xt.pixelRatio),xn=new Fs(Lr.LEQUAL,Fs.ReadWrite,[0,1]),Ze=pl.disabled,tt=Xt.colorModeForRenderPass(),vt=Xt.useProgram("sky");if(!fr.mesh){const bt=new t.aX;bt.emplaceBack(-1,-1),bt.emplaceBack(1,-1),bt.emplaceBack(1,1),bt.emplaceBack(-1,1);const zt=new t.aY;zt.emplaceBack(0,1,2),zt.emplaceBack(0,2,3),fr.mesh=new Oc(Ar.createVertexBuffer(bt,un.members),Ar.createIndexBuffer(zt),t.a0.simpleSegment(0,0,bt.length,zt.length))}vt.draw(Ar,Lr.TRIANGLES,xn,Ze,tt,Oo.disabled,tn,void 0,"sky",fr.mesh.vertexBuffer,fr.mesh.indexBuffer,fr.mesh.segments)})(this,this.style.sky),this._showOverdrawInspector=oe.showOverdrawInspector,this.depthRangeFor3D=[0,1-(P._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Me.length-1;this.currentLayer>=0;this.currentLayer--){const Xt=this.style._layers[Me[this.currentLayer]],fr=Ce[Xt.source],Ar=Be[Xt.source];this._renderTileClippingMasks(Xt,Ar),this.renderLayer(this,fr,Xt,Ar)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayervt.source&&!vt.isHidden(Ar)?[fr.sourceCaches[vt.source]]:[]),xn=tn.filter(vt=>vt.getSource().type==="vector"),Ze=tn.filter(vt=>vt.getSource().type!=="vector"),tt=vt=>{(!Lr||Lr.getSource().maxzoomtt(vt)),Lr||Ze.forEach(vt=>tt(vt)),Lr})(this.style,this.transform.zoom);Xt&&(function(fr,Ar,Lr){for(let tn=0;tn0),Ce&&(t.b0(oe,Me),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(Be,_t){const kt=Be.context,Xt=kt.gl,fr=fu.unblended,Ar=new Fs(Xt.LEQUAL,Fs.ReadWrite,[0,1]),Lr=_t.getTerrainMesh(),tn=_t.sourceCache.getRenderableTiles(),xn=Be.useProgram("terrainDepth");kt.bindFramebuffer.set(_t.getFramebuffer("depth").framebuffer),kt.viewport.set([0,0,Be.width/devicePixelRatio,Be.height/devicePixelRatio]),kt.clear({color:t.aM.transparent,depth:1});for(const Ze of tn){const tt=_t.getTerrainData(Ze.tileID),vt={u_matrix:Be.transform.calculatePosMatrix(Ze.tileID.toUnwrapped()),u_ele_delta:_t.getMeshFrameDelta(Be.transform.zoom)};xn.draw(kt,Xt.TRIANGLES,Ar,pl.disabled,fr,Oo.backCCW,vt,tt,"terrain",Lr.vertexBuffer,Lr.indexBuffer,Lr.segments)}kt.bindFramebuffer.set(null),kt.viewport.set([0,0,Be.width,Be.height])})(this,this.style.map.terrain),(function(Be,_t){const kt=Be.context,Xt=kt.gl,fr=fu.unblended,Ar=new Fs(Xt.LEQUAL,Fs.ReadWrite,[0,1]),Lr=_t.getTerrainMesh(),tn=_t.getCoordsTexture(),xn=_t.sourceCache.getRenderableTiles(),Ze=Be.useProgram("terrainCoords");kt.bindFramebuffer.set(_t.getFramebuffer("coords").framebuffer),kt.viewport.set([0,0,Be.width/devicePixelRatio,Be.height/devicePixelRatio]),kt.clear({color:t.aM.transparent,depth:1}),_t.coordsIndex=[];for(const tt of xn){const vt=_t.getTerrainData(tt.tileID);kt.activeTexture.set(Xt.TEXTURE0),Xt.bindTexture(Xt.TEXTURE_2D,tn.texture);const bt={u_matrix:Be.transform.calculatePosMatrix(tt.tileID.toUnwrapped()),u_terrain_coords_id:(255-_t.coordsIndex.length)/255,u_texture:0,u_ele_delta:_t.getMeshFrameDelta(Be.transform.zoom)};Ze.draw(kt,Xt.TRIANGLES,Ar,pl.disabled,fr,Oo.backCCW,bt,vt,"terrain",Lr.vertexBuffer,Lr.indexBuffer,Lr.segments),_t.coordsIndex.push(tt.tileID.key)}kt.bindFramebuffer.set(null),kt.viewport.set([0,0,Be.width,Be.height])})(this,this.style.map.terrain))}renderLayer(P,oe,Me,Ce){if(!Me.isHidden(this.transform.zoom)&&(Me.type==="background"||Me.type==="custom"||(Ce||[]).length))switch(this.id=Me.id,Me.type){case"symbol":(function(Be,_t,kt,Xt,fr){if(Be.renderPass!=="translucent")return;const Ar=pl.disabled,Lr=Be.colorModeForRenderPass();(kt._unevaluatedLayout.hasValue("text-variable-anchor")||kt._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(tn,xn,Ze,tt,vt,bt,zt,Et,Ut){const gr=xn.transform,Tr=Ca(),Pr=vt==="map",Yr=bt==="map";for(const sn of tn){const En=tt.getTile(sn),Pn=En.getBucket(Ze);if(!Pn||!Pn.text||!Pn.text.segments.get().length)continue;const Xn=t.ag(Pn.textSizeData,gr.zoom),Ta=$n(En,1,xn.transform.zoom),ri=Sr(sn.posMatrix,Yr,Pr,xn.transform,Ta),Wa=Ze.layout.get("icon-text-fit")!=="none"&&Pn.hasIconData();if(Xn){const ni=Math.pow(2,gr.zoom-En.tileID.overscaledZ),$i=xn.style.map.terrain?(vo,Wo)=>xn.style.map.terrain.getElevation(sn,vo,Wo):null,bo=Tr.translatePosition(gr,En,zt,Et);uh(Pn,Pr,Yr,Ut,gr,ri,sn.posMatrix,ni,Xn,Wa,Tr,bo,sn.toUnwrapped(),$i)}}})(Xt,Be,kt,_t,kt.layout.get("text-rotation-alignment"),kt.layout.get("text-pitch-alignment"),kt.paint.get("text-translate"),kt.paint.get("text-translate-anchor"),fr),kt.paint.get("icon-opacity").constantOr(1)!==0&&fd(Be,_t,kt,Xt,!1,kt.paint.get("icon-translate"),kt.paint.get("icon-translate-anchor"),kt.layout.get("icon-rotation-alignment"),kt.layout.get("icon-pitch-alignment"),kt.layout.get("icon-keep-upright"),Ar,Lr),kt.paint.get("text-opacity").constantOr(1)!==0&&fd(Be,_t,kt,Xt,!0,kt.paint.get("text-translate"),kt.paint.get("text-translate-anchor"),kt.layout.get("text-rotation-alignment"),kt.layout.get("text-pitch-alignment"),kt.layout.get("text-keep-upright"),Ar,Lr),_t.map.showCollisionBoxes&&(af(Be,_t,kt,Xt,!0),af(Be,_t,kt,Xt,!1))})(P,oe,Me,Ce,this.style.placement.variableOffsets);break;case"circle":(function(Be,_t,kt,Xt){if(Be.renderPass!=="translucent")return;const fr=kt.paint.get("circle-opacity"),Ar=kt.paint.get("circle-stroke-width"),Lr=kt.paint.get("circle-stroke-opacity"),tn=!kt.layout.get("circle-sort-key").isConstant();if(fr.constantOr(1)===0&&(Ar.constantOr(1)===0||Lr.constantOr(1)===0))return;const xn=Be.context,Ze=xn.gl,tt=Be.depthModeForSublayer(0,Fs.ReadOnly),vt=pl.disabled,bt=Be.colorModeForRenderPass(),zt=[];for(let Et=0;EtEt.sortKey-Ut.sortKey);for(const Et of zt){const{programConfiguration:Ut,program:gr,layoutVertexBuffer:Tr,indexBuffer:Pr,uniformValues:Yr,terrainData:sn}=Et.state;gr.draw(xn,Ze.TRIANGLES,tt,vt,bt,Oo.disabled,Yr,sn,kt.id,Tr,Pr,Et.segments,kt.paint,Be.transform.zoom,Ut)}})(P,oe,Me,Ce);break;case"heatmap":(function(Be,_t,kt,Xt){if(kt.paint.get("heatmap-opacity")===0)return;const fr=Be.context;if(Be.style.map.terrain){for(const Ar of Xt){const Lr=_t.getTile(Ar);_t.hasRenderableParent(Ar)||(Be.renderPass==="offscreen"?ch(Be,Lr,kt,Ar):Be.renderPass==="translucent"&&Nf(Be,kt,Ar))}fr.viewport.set([0,0,Be.width,Be.height])}else Be.renderPass==="offscreen"?(function(Ar,Lr,tn,xn){const Ze=Ar.context,tt=Ze.gl,vt=pl.disabled,bt=new fu([tt.ONE,tt.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(zt,Et,Ut){const gr=zt.gl;zt.activeTexture.set(gr.TEXTURE1),zt.viewport.set([0,0,Et.width/4,Et.height/4]);let Tr=Ut.heatmapFbos.get(t.aU);Tr?(gr.bindTexture(gr.TEXTURE_2D,Tr.colorAttachment.get()),zt.bindFramebuffer.set(Tr.framebuffer)):(Tr=Fh(zt,Et.width/4,Et.height/4),Ut.heatmapFbos.set(t.aU,Tr))})(Ze,Ar,tn),Ze.clear({color:t.aM.transparent});for(let zt=0;zt20&&Ar.texParameterf(Ar.TEXTURE_2D,fr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,fr.extTextureFilterAnisotropicMax);const Pn=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(zt),Xn=Pn?zt:null,Ta=Xn?Xn.posMatrix:Be.transform.calculatePosMatrix(zt.toUnwrapped(),bt),ri=ll(Ta,sn||[0,0],Yr||1,Pr,kt);Lr instanceof st?tn.draw(fr,Ar.TRIANGLES,Et,pl.disabled,xn,Oo.disabled,ri,Pn,kt.id,Lr.boundsBuffer,Be.quadTriangleIndexBuffer,Lr.boundsSegments):tn.draw(fr,Ar.TRIANGLES,Et,Ze[zt.overscaledZ],xn,Oo.disabled,ri,Pn,kt.id,Be.rasterBoundsBuffer,Be.quadTriangleIndexBuffer,Be.rasterBoundsSegments)}})(P,oe,Me,Ce);break;case"background":(function(Be,_t,kt,Xt){const fr=kt.paint.get("background-color"),Ar=kt.paint.get("background-opacity");if(Ar===0)return;const Lr=Be.context,tn=Lr.gl,xn=Be.transform,Ze=xn.tileSize,tt=kt.paint.get("background-pattern");if(Be.isPatternMissing(tt))return;const vt=!tt&&fr.a===1&&Ar===1&&Be.opaquePassEnabledForLayer()?"opaque":"translucent";if(Be.renderPass!==vt)return;const bt=pl.disabled,zt=Be.depthModeForSublayer(0,vt==="opaque"?Fs.ReadWrite:Fs.ReadOnly),Et=Be.colorModeForRenderPass(),Ut=Be.useProgram(tt?"backgroundPattern":"background"),gr=Xt||xn.coveringTiles({tileSize:Ze,terrain:Be.style.map.terrain});tt&&(Lr.activeTexture.set(tn.TEXTURE0),Be.imageManager.bind(Be.context));const Tr=kt.getCrossfadeParameters();for(const Pr of gr){const Yr=Xt?Pr.posMatrix:Be.transform.calculatePosMatrix(Pr.toUnwrapped()),sn=tt?kl(Yr,Ar,Be,tt,{tileID:Pr,tileSize:Ze},Tr):ul(Yr,Ar,fr),En=Be.style.map.terrain&&Be.style.map.terrain.getTerrainData(Pr);Ut.draw(Lr,tn.TRIANGLES,zt,bt,Et,Oo.disabled,sn,En,kt.id,Be.tileExtentBuffer,Be.quadTriangleIndexBuffer,Be.tileExtentSegments)}})(P,0,Me,Ce);break;case"custom":(function(Be,_t,kt){const Xt=Be.context,fr=kt.implementation;if(Be.renderPass==="offscreen"){const Ar=fr.prerender;Ar&&(Be.setCustomLayerDefaults(),Xt.setColorMode(Be.colorModeForRenderPass()),Ar.call(fr,Xt.gl,Be.transform.customLayerMatrix()),Xt.setDirty(),Be.setBaseState())}else if(Be.renderPass==="translucent"){Be.setCustomLayerDefaults(),Xt.setColorMode(Be.colorModeForRenderPass()),Xt.setStencilMode(pl.disabled);const Ar=fr.renderingMode==="3d"?new Fs(Be.context.gl.LEQUAL,Fs.ReadWrite,Be.depthRangeFor3D):Be.depthModeForSublayer(0,Fs.ReadOnly);Xt.setDepthMode(Ar),fr.render(Xt.gl,Be.transform.customLayerMatrix(),{farZ:Be.transform.farZ,nearZ:Be.transform.nearZ,fov:Be.transform._fov,modelViewProjectionMatrix:Be.transform.modelViewProjectionMatrix,projectionMatrix:Be.transform.projectionMatrix}),Xt.setDirty(),Be.setBaseState(),Xt.bindFramebuffer.set(null)}})(P,0,Me)}}translatePosMatrix(P,oe,Me,Ce,Be){if(!Me[0]&&!Me[1])return P;const _t=Be?Ce==="map"?this.transform.angle:0:Ce==="viewport"?-this.transform.angle:0;if(_t){const fr=Math.sin(_t),Ar=Math.cos(_t);Me=[Me[0]*Ar-Me[1]*fr,Me[0]*fr+Me[1]*Ar]}const kt=[Be?Me[0]:$n(oe,Me[0],this.transform.zoom),Be?Me[1]:$n(oe,Me[1],this.transform.zoom),0],Xt=new Float32Array(16);return t.J(Xt,P,kt),Xt}saveTileTexture(P){const oe=this._tileTextures[P.size[0]];oe?oe.push(P):this._tileTextures[P.size[0]]=[P]}getTileTexture(P){const oe=this._tileTextures[P];return oe&&oe.length>0?oe.pop():null}isPatternMissing(P){if(!P)return!1;if(!P.from||!P.to)return!0;const oe=this.imageManager.getPattern(P.from.toString()),Me=this.imageManager.getPattern(P.to.toString());return!oe||!Me}useProgram(P,oe){this.cache=this.cache||{};const Me=P+(oe?oe.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Me]||(this.cache[Me]=new Rn(this.context,Jr[P],oe,Rl[P],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Me]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const P=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(P.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:P,drawingBufferHeight:oe}=this.context.gl;return this.width!==P||this.height!==oe}}class tu{constructor(P,oe){this.points=P,this.planes=oe}static fromInvProjectionMatrix(P,oe,Me){const Ce=Math.pow(2,Me),Be=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(kt=>{const Xt=1/(kt=t.af([],kt,P))[3]/oe*Ce;return t.b1(kt,kt,[Xt,Xt,1/kt[3],Xt])}),_t=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(kt=>{const Xt=(function(tn,xn){var Ze=xn[0],tt=xn[1],vt=xn[2],bt=Ze*Ze+tt*tt+vt*vt;return bt>0&&(bt=1/Math.sqrt(bt)),tn[0]=xn[0]*bt,tn[1]=xn[1]*bt,tn[2]=xn[2]*bt,tn})([],(function(tn,xn,Ze){var tt=xn[0],vt=xn[1],bt=xn[2],zt=Ze[0],Et=Ze[1],Ut=Ze[2];return tn[0]=vt*Ut-bt*Et,tn[1]=bt*zt-tt*Ut,tn[2]=tt*Et-vt*zt,tn})([],M([],Be[kt[0]],Be[kt[1]]),M([],Be[kt[2]],Be[kt[1]]))),fr=-((Ar=Xt)[0]*(Lr=Be[kt[1]])[0]+Ar[1]*Lr[1]+Ar[2]*Lr[2]);var Ar,Lr;return Xt.concat(fr)});return new tu(Be,_t)}}class kf{constructor(P,oe){this.min=P,this.max=oe,this.center=(function(Me,Ce,Be){return Me[0]=.5*Ce[0],Me[1]=.5*Ce[1],Me[2]=.5*Ce[2],Me})([],(function(Me,Ce,Be){return Me[0]=Ce[0]+Be[0],Me[1]=Ce[1]+Be[1],Me[2]=Ce[2]+Be[2],Me})([],this.min,this.max))}quadrant(P){const oe=[P%2==0,P<2],Me=x(this.min),Ce=x(this.max);for(let Be=0;Be=0&&_t++;if(_t===0)return 0;_t!==oe.length&&(Me=!1)}if(Me)return 2;for(let Ce=0;Ce<3;Ce++){let Be=Number.MAX_VALUE,_t=-Number.MAX_VALUE;for(let kt=0;ktthis.max[Ce]-this.min[Ce])return 0}return 1}}class gc{constructor(P=0,oe=0,Me=0,Ce=0){if(isNaN(P)||P<0||isNaN(oe)||oe<0||isNaN(Me)||Me<0||isNaN(Ce)||Ce<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=P,this.bottom=oe,this.left=Me,this.right=Ce}interpolate(P,oe,Me){return oe.top!=null&&P.top!=null&&(this.top=t.y.number(P.top,oe.top,Me)),oe.bottom!=null&&P.bottom!=null&&(this.bottom=t.y.number(P.bottom,oe.bottom,Me)),oe.left!=null&&P.left!=null&&(this.left=t.y.number(P.left,oe.left,Me)),oe.right!=null&&P.right!=null&&(this.right=t.y.number(P.right,oe.right,Me)),this}getCenter(P,oe){const Me=t.ac((this.left+P-this.right)/2,0,P),Ce=t.ac((this.top+oe-this.bottom)/2,0,oe);return new t.P(Me,Ce)}equals(P){return this.top===P.top&&this.bottom===P.bottom&&this.left===P.left&&this.right===P.right}clone(){return new gc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Fc=85.051129;class hu{constructor(P,oe,Me,Ce,Be){this.tileSize=512,this._renderWorldCopies=Be===void 0||!!Be,this._minZoom=P||0,this._maxZoom=oe||22,this._minPitch=Me??0,this._maxPitch=Ce??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new gc,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const P=new hu(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return P.apply(this),P}apply(P){this.tileSize=P.tileSize,this.latRange=P.latRange,this.lngRange=P.lngRange,this.width=P.width,this.height=P.height,this._center=P._center,this._elevation=P._elevation,this.minElevationForCurrentTile=P.minElevationForCurrentTile,this.zoom=P.zoom,this.angle=P.angle,this._fov=P._fov,this._pitch=P._pitch,this._unmodified=P._unmodified,this._edgeInsets=P._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(P){this._minZoom!==P&&(this._minZoom=P,this.zoom=Math.max(this.zoom,P))}get maxZoom(){return this._maxZoom}set maxZoom(P){this._maxZoom!==P&&(this._maxZoom=P,this.zoom=Math.min(this.zoom,P))}get minPitch(){return this._minPitch}set minPitch(P){this._minPitch!==P&&(this._minPitch=P,this.pitch=Math.max(this.pitch,P))}get maxPitch(){return this._maxPitch}set maxPitch(P){this._maxPitch!==P&&(this._maxPitch=P,this.pitch=Math.min(this.pitch,P))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(P){P===void 0?P=!0:P===null&&(P=!1),this._renderWorldCopies=P}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(P){const oe=-t.b3(P,-180,180)*Math.PI/180;this.angle!==oe&&(this._unmodified=!1,this.angle=oe,this._calcMatrices(),this.rotationMatrix=(function(){var Me=new t.A(4);return t.A!=Float32Array&&(Me[1]=0,Me[2]=0),Me[0]=1,Me[3]=1,Me})(),(function(Me,Ce,Be){var _t=Ce[0],kt=Ce[1],Xt=Ce[2],fr=Ce[3],Ar=Math.sin(Be),Lr=Math.cos(Be);Me[0]=_t*Lr+Xt*Ar,Me[1]=kt*Lr+fr*Ar,Me[2]=_t*-Ar+Xt*Lr,Me[3]=kt*-Ar+fr*Lr})(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(P){const oe=t.ac(P,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==oe&&(this._unmodified=!1,this._pitch=oe,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(P){P=Math.max(.01,Math.min(60,P)),this._fov!==P&&(this._unmodified=!1,this._fov=P/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(P){const oe=Math.min(Math.max(P,this.minZoom),this.maxZoom);this._zoom!==oe&&(this._unmodified=!1,this._zoom=oe,this.tileZoom=Math.max(0,Math.floor(oe)),this.scale=this.zoomScale(oe),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(P){P.lat===this._center.lat&&P.lng===this._center.lng||(this._unmodified=!1,this._center=P,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(P){P!==this._elevation&&(this._elevation=P,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(P){this._edgeInsets.equals(P)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,P,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(P){return this._edgeInsets.equals(P)}interpolatePadding(P,oe,Me){this._unmodified=!1,this._edgeInsets.interpolate(P,oe,Me),this._constrain(),this._calcMatrices()}coveringZoomLevel(P){const oe=(P.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/P.tileSize));return Math.max(0,oe)}getVisibleUnwrappedCoordinates(P){const oe=[new t.b4(0,P)];if(this._renderWorldCopies){const Me=this.pointCoordinate(new t.P(0,0)),Ce=this.pointCoordinate(new t.P(this.width,0)),Be=this.pointCoordinate(new t.P(this.width,this.height)),_t=this.pointCoordinate(new t.P(0,this.height)),kt=Math.floor(Math.min(Me.x,Ce.x,Be.x,_t.x)),Xt=Math.floor(Math.max(Me.x,Ce.x,Be.x,_t.x)),fr=1;for(let Ar=kt-fr;Ar<=Xt+fr;Ar++)Ar!==0&&oe.push(new t.b4(Ar,P))}return oe}coveringTiles(P){var oe,Me;let Ce=this.coveringZoomLevel(P);const Be=Ce;if(P.minzoom!==void 0&&CeP.maxzoom&&(Ce=P.maxzoom);const _t=this.pointCoordinate(this.getCameraPoint()),kt=t.Z.fromLngLat(this.center),Xt=Math.pow(2,Ce),fr=[Xt*_t.x,Xt*_t.y,0],Ar=[Xt*kt.x,Xt*kt.y,0],Lr=tu.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Ce);let tn=P.minzoom||0;!P.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(tn=Ce);const xn=P.terrain?2/Math.min(this.tileSize,P.tileSize)*this.tileSize:3,Ze=Et=>({aabb:new kf([Et*Xt,0,0],[(Et+1)*Xt,Xt,0]),zoom:0,x:0,y:0,wrap:Et,fullyVisible:!1}),tt=[],vt=[],bt=Ce,zt=P.reparseOverscaled?Be:Ce;if(this._renderWorldCopies)for(let Et=1;Et<=3;Et++)tt.push(Ze(-Et)),tt.push(Ze(Et));for(tt.push(Ze(0));tt.length>0;){const Et=tt.pop(),Ut=Et.x,gr=Et.y;let Tr=Et.fullyVisible;if(!Tr){const Pn=Et.aabb.intersects(Lr);if(Pn===0)continue;Tr=Pn===2}const Pr=P.terrain?fr:Ar,Yr=Et.aabb.distanceX(Pr),sn=Et.aabb.distanceY(Pr),En=Math.max(Math.abs(Yr),Math.abs(sn));if(Et.zoom===bt||En>xn+(1<=tn){const Pn=bt-Et.zoom,Xn=fr[0]-.5-(Ut<>1),ri=Et.zoom+1;let Wa=Et.aabb.quadrant(Pn);if(P.terrain){const ni=new t.S(ri,Et.wrap,ri,Xn,Ta),$i=P.terrain.getMinMaxElevation(ni),bo=(oe=$i.minElevation)!==null&&oe!==void 0?oe:this.elevation,vo=(Me=$i.maxElevation)!==null&&Me!==void 0?Me:this.elevation;Wa=new kf([Wa.min[0],Wa.min[1],bo],[Wa.max[0],Wa.max[1],vo])}tt.push({aabb:Wa,zoom:ri,x:Xn,y:Ta,wrap:Et.wrap,fullyVisible:Tr})}}return vt.sort((Et,Ut)=>Et.distanceSq-Ut.distanceSq).map(Et=>Et.tileID)}resize(P,oe){this.width=P,this.height=oe,this.pixelsToGLUnits=[2/P,-2/oe],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(P){return Math.pow(2,P)}scaleZoom(P){return Math.log(P)/Math.LN2}project(P){const oe=t.ac(P.lat,-85.051129,Fc);return new t.P(t.O(P.lng)*this.worldSize,t.Q(oe)*this.worldSize)}unproject(P){return new t.Z(P.x/this.worldSize,P.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(P){const oe=this.elevation,Me=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Ce=this.pointLocation(this.centerPoint,P),Be=P.getElevationForLngLatZoom(Ce,this.tileZoom);if(!(this.elevation-Be))return;const _t=Me+oe-Be,kt=Math.cos(this._pitch)*this.cameraToCenterDistance/_t/t.b5(1,Ce.lat),Xt=this.scaleZoom(kt/this.tileSize);this._elevation=Be,this._center=Ce,this.zoom=Xt}setLocationAtPoint(P,oe){const Me=this.pointCoordinate(oe),Ce=this.pointCoordinate(this.centerPoint),Be=this.locationCoordinate(P),_t=new t.Z(Be.x-(Me.x-Ce.x),Be.y-(Me.y-Ce.y));this.center=this.coordinateLocation(_t),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(P,oe){return oe?this.coordinatePoint(this.locationCoordinate(P),oe.getElevationForLngLatZoom(P,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(P))}pointLocation(P,oe){return this.coordinateLocation(this.pointCoordinate(P,oe))}locationCoordinate(P){return t.Z.fromLngLat(P)}coordinateLocation(P){return P&&P.toLngLat()}pointCoordinate(P,oe){if(oe){const tn=oe.pointCoordinate(P);if(tn!=null)return tn}const Me=[P.x,P.y,0,1],Ce=[P.x,P.y,1,1];t.af(Me,Me,this.pixelMatrixInverse),t.af(Ce,Ce,this.pixelMatrixInverse);const Be=Me[3],_t=Ce[3],kt=Me[1]/Be,Xt=Ce[1]/_t,fr=Me[2]/Be,Ar=Ce[2]/_t,Lr=fr===Ar?0:(0-fr)/(Ar-fr);return new t.Z(t.y.number(Me[0]/Be,Ce[0]/_t,Lr)/this.worldSize,t.y.number(kt,Xt,Lr)/this.worldSize)}coordinatePoint(P,oe=0,Me=this.pixelMatrix){const Ce=[P.x*this.worldSize,P.y*this.worldSize,oe,1];return t.af(Ce,Ce,Me),new t.P(Ce[0]/Ce[3],Ce[1]/Ce[3])}getBounds(){const P=Math.max(0,this.height/2-this.getHorizon());return new ie().extend(this.pointLocation(new t.P(0,P))).extend(this.pointLocation(new t.P(this.width,P))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new ie([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(P){P?(this.lngRange=[P.getWest(),P.getEast()],this.latRange=[P.getSouth(),P.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Fc])}calculateTileMatrix(P){const oe=P.canonical,Me=this.worldSize/this.zoomScale(oe.z),Ce=oe.x+Math.pow(2,oe.z)*P.wrap,Be=t.an(new Float64Array(16));return t.J(Be,Be,[Ce*Me,oe.y*Me,0]),t.K(Be,Be,[Me/t.X,Me/t.X,1]),Be}calculatePosMatrix(P,oe=!1){const Me=P.key,Ce=oe?this._alignedPosMatrixCache:this._posMatrixCache;if(Ce[Me])return Ce[Me];const Be=this.calculateTileMatrix(P);return t.L(Be,oe?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Be),Ce[Me]=new Float32Array(Be),Ce[Me]}calculateFogMatrix(P){const oe=P.key,Me=this._fogMatrixCache;if(Me[oe])return Me[oe];const Ce=this.calculateTileMatrix(P);return t.L(Ce,this.fogMatrix,Ce),Me[oe]=new Float32Array(Ce),Me[oe]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(P,oe){oe=t.ac(+oe,this.minZoom,this.maxZoom);const Me={center:new t.N(P.lng,P.lat),zoom:oe};let Ce=this.lngRange;if(!this._renderWorldCopies&&Ce===null){const Et=179.9999999999;Ce=[-Et,Et]}const Be=this.tileSize*this.zoomScale(Me.zoom);let _t=0,kt=Be,Xt=0,fr=Be,Ar=0,Lr=0;const{x:tn,y:xn}=this.size;if(this.latRange){const Et=this.latRange;_t=t.Q(Et[1])*Be,kt=t.Q(Et[0])*Be,kt-_tkt&&(bt=kt-Et)}if(Ce){const Et=(Xt+fr)/2;let Ut=Ze;this._renderWorldCopies&&(Ut=t.b3(Ze,Et-Be/2,Et+Be/2));const gr=tn/2;Ut-grfr&&(vt=fr-gr)}if(vt!==void 0||bt!==void 0){const Et=new t.P(vt??Ze,bt??tt);Me.center=this.unproject.call({worldSize:Be},Et).wrap()}return Me}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const P=this._unmodified,{center:oe,zoom:Me}=this.getConstrained(this.center,this.zoom);this.center=oe,this.zoom=Me,this._unmodified=P,this._constraining=!1}_calcMatrices(){if(!this.height)return;const P=this.centerOffset,oe=this.point.x,Me=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let Ce=t.an(new Float64Array(16));t.K(Ce,Ce,[this.width/2,-this.height/2,1]),t.J(Ce,Ce,[1,-1,0]),this.labelPlaneMatrix=Ce,Ce=t.an(new Float64Array(16)),t.K(Ce,Ce,[1,-1,1]),t.J(Ce,Ce,[-1,-1,0]),t.K(Ce,Ce,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ce;const Be=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),_t=Math.min(this.elevation,this.minElevationForCurrentTile),kt=Be-_t*this._pixelPerMeter/Math.cos(this._pitch),Xt=_t<0?kt:Be,fr=Math.PI/2+this._pitch,Ar=this._fov*(.5+P.y/this.height),Lr=Math.sin(Ar)*Xt/Math.sin(t.ac(Math.PI-fr-Ar,.01,Math.PI-.01)),tn=this.getHorizon(),xn=2*Math.atan(tn/this.cameraToCenterDistance)*(.5+P.y/(2*tn)),Ze=Math.sin(xn)*Xt/Math.sin(t.ac(Math.PI-fr-xn,.01,Math.PI-.01)),tt=Math.min(Lr,Ze);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*tt+Xt),this.nearZ=this.height/50,Ce=new Float64Array(16),t.b6(Ce,this._fov,this.width/this.height,this.nearZ,this.farZ),Ce[8]=2*-P.x/this.width,Ce[9]=2*P.y/this.height,this.projectionMatrix=t.ae(Ce),t.K(Ce,Ce,[1,-1,1]),t.J(Ce,Ce,[0,0,-this.cameraToCenterDistance]),t.b7(Ce,Ce,this._pitch),t.ad(Ce,Ce,this.angle),t.J(Ce,Ce,[-oe,-Me,0]),this.mercatorMatrix=t.K([],Ce,[this.worldSize,this.worldSize,this.worldSize]),t.K(Ce,Ce,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,Ce),t.J(Ce,Ce,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Ce,this.invModelViewProjectionMatrix=t.as([],Ce),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,Be,this.farZ),this.fogMatrix[8]=2*-P.x/this.width,this.fogMatrix[9]=2*P.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-oe,-Me,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,Ce);const vt=this.width%2/2,bt=this.height%2/2,zt=Math.cos(this.angle),Et=Math.sin(this.angle),Ut=oe-Math.round(oe)+zt*vt+Et*bt,gr=Me-Math.round(Me)+zt*bt+Et*vt,Tr=new Float64Array(Ce);if(t.J(Tr,Tr,[Ut>.5?Ut-1:Ut,gr>.5?gr-1:gr,0]),this.alignedModelViewProjectionMatrix=Tr,Ce=t.as(new Float64Array(16),this.pixelMatrix),!Ce)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ce,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const P=this.pointCoordinate(new t.P(0,0)),oe=[P.x*this.worldSize,P.y*this.worldSize,0,1];return t.af(oe,oe,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const P=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,P))}getCameraQueryGeometry(P){const oe=this.getCameraPoint();if(P.length===1)return[P[0],oe];{let Me=oe.x,Ce=oe.y,Be=oe.x,_t=oe.y;for(const kt of P)Me=Math.min(Me,kt.x),Ce=Math.min(Ce,kt.y),Be=Math.max(Be,kt.x),_t=Math.max(_t,kt.y);return[new t.P(Me,Ce),new t.P(Be,Ce),new t.P(Be,_t),new t.P(Me,_t),new t.P(Me,Ce)]}}lngLatToCameraDepth(P,oe){const Me=this.locationCoordinate(P),Ce=[Me.x*this.worldSize,Me.y*this.worldSize,oe,1];return t.af(Ce,Ce,this.modelViewProjectionMatrix),Ce[2]/Ce[3]}}function rh(Ue,P){let oe,Me=!1,Ce=null,Be=null;const _t=()=>{Ce=null,Me&&(Ue.apply(Be,oe),Ce=setTimeout(_t,P),Me=!1)};return(...kt)=>(Me=!0,Be=this,oe=kt,Ce||_t(),Ce)}class pf{constructor(P){this._getCurrentHash=()=>{const oe=window.location.hash.replace("#","");if(this._hashName){let Me;return oe.split("&").map(Ce=>Ce.split("=")).forEach(Ce=>{Ce[0]===this._hashName&&(Me=Ce)}),(Me&&Me[1]||"").split("/")}return oe.split("/")},this._onHashChange=()=>{const oe=this._getCurrentHash();if(oe.length>=3&&!oe.some(Me=>isNaN(Me))){const Me=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(oe[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+oe[2],+oe[1]],zoom:+oe[0],bearing:Me,pitch:+(oe[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const oe=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,oe)},this._removeHash=()=>{const oe=this._getCurrentHash();if(oe.length===0)return;const Me=oe.join("/");let Ce=Me;Ce.split("&").length>0&&(Ce=Ce.split("&")[0]),this._hashName&&(Ce=`${this._hashName}=${Me}`);let Be=window.location.hash.replace(Ce,"");Be.startsWith("#&")?Be=Be.slice(0,1)+Be.slice(2):Be==="#"&&(Be="");let _t=window.location.href.replace(/(#.+)?$/,Be);_t=_t.replace("&&","&"),window.history.replaceState(window.history.state,null,_t)},this._updateHash=rh(this._updateHashUnthrottled,300),this._hashName=P&&encodeURIComponent(P)}addTo(P){return this._map=P,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(P){const oe=this._map.getCenter(),Me=Math.round(100*this._map.getZoom())/100,Ce=Math.ceil((Me*Math.LN2+Math.log(512/360/.5))/Math.LN10),Be=Math.pow(10,Ce),_t=Math.round(oe.lng*Be)/Be,kt=Math.round(oe.lat*Be)/Be,Xt=this._map.getBearing(),fr=this._map.getPitch();let Ar="";if(Ar+=P?`/${_t}/${kt}/${Me}`:`${Me}/${kt}/${_t}`,(Xt||fr)&&(Ar+="/"+Math.round(10*Xt)/10),fr&&(Ar+=`/${Math.round(fr)}`),this._hashName){const Lr=this._hashName;let tn=!1;const xn=window.location.hash.slice(1).split("&").map(Ze=>{const tt=Ze.split("=")[0];return tt===Lr?(tn=!0,`${tt}=${Ar}`):Ze}).filter(Ze=>Ze);return tn||xn.push(`${Lr}=${Ar}`),`#${xn.join("&")}`}return`#${Ar}`}}const jf={linearity:.3,easing:t.b8(0,0,.3,1)},Ah=t.e({deceleration:2500,maxSpeed:1400},jf),Ed=t.e({deceleration:20,maxSpeed:1400},jf),tv=t.e({deceleration:1e3,maxSpeed:360},jf),nh=t.e({deceleration:1e3,maxSpeed:90},jf);class Sh{constructor(P){this._map=P,this.clear()}clear(){this._inertiaBuffer=[]}record(P){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.now(),settings:P})}_drainInertiaBuffer(){const P=this._inertiaBuffer,oe=i.now();for(;P.length>0&&oe-P[0].time>160;)P.shift()}_onMoveEnd(P){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const oe={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Be}of this._inertiaBuffer)oe.zoom+=Be.zoomDelta||0,oe.bearing+=Be.bearingDelta||0,oe.pitch+=Be.pitchDelta||0,Be.panDelta&&oe.pan._add(Be.panDelta),Be.around&&(oe.around=Be.around),Be.pinchAround&&(oe.pinchAround=Be.pinchAround);const Me=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Ce={};if(oe.pan.mag()){const Be=Mh(oe.pan.mag(),Me,t.e({},Ah,P||{}));Ce.offset=oe.pan.mult(Be.amount/oe.pan.mag()),Ce.center=this._map.transform.center,Yc(Ce,Be)}if(oe.zoom){const Be=Mh(oe.zoom,Me,Ed);Ce.zoom=this._map.transform.zoom+Be.amount,Yc(Ce,Be)}if(oe.bearing){const Be=Mh(oe.bearing,Me,tv);Ce.bearing=this._map.transform.bearing+t.ac(Be.amount,-179,179),Yc(Ce,Be)}if(oe.pitch){const Be=Mh(oe.pitch,Me,nh);Ce.pitch=this._map.transform.pitch+Be.amount,Yc(Ce,Be)}if(Ce.zoom||Ce.bearing){const Be=oe.pinchAround===void 0?oe.around:oe.pinchAround;Ce.around=Be?this._map.unproject(Be):this._map.getCenter()}return this.clear(),t.e(Ce,{noMoveStart:!0})}}function Yc(Ue,P){(!Ue.duration||Ue.durationoe.unproject(Xt)),kt=Be.reduce((Xt,fr,Ar,Lr)=>Xt.add(fr.div(Lr.length)),new t.P(0,0));super(P,{points:Be,point:kt,lngLats:_t,lngLat:oe.unproject(kt),originalEvent:Me}),this._defaultPrevented=!1}}class Wh extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(P,oe,Me){super(P,{originalEvent:Me}),this._defaultPrevented=!1}}class ih{constructor(P,oe){this._map=P,this._clickTolerance=oe.clickTolerance}reset(){delete this._mousedownPos}wheel(P){return this._firePreventable(new Wh(P.type,this._map,P))}mousedown(P,oe){return this._mousedownPos=oe,this._firePreventable(new lc(P.type,this._map,P))}mouseup(P){this._map.fire(new lc(P.type,this._map,P))}click(P,oe){this._mousedownPos&&this._mousedownPos.dist(oe)>=this._clickTolerance||this._map.fire(new lc(P.type,this._map,P))}dblclick(P){return this._firePreventable(new lc(P.type,this._map,P))}mouseover(P){this._map.fire(new lc(P.type,this._map,P))}mouseout(P){this._map.fire(new lc(P.type,this._map,P))}touchstart(P){return this._firePreventable(new ah(P.type,this._map,P))}touchmove(P){this._map.fire(new ah(P.type,this._map,P))}touchend(P){this._map.fire(new ah(P.type,this._map,P))}touchcancel(P){this._map.fire(new ah(P.type,this._map,P))}_firePreventable(P){if(this._map.fire(P),P.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iu{constructor(P){this._map=P}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(P){this._map.fire(new lc(P.type,this._map,P))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new lc("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(P){this._delayContextMenu?this._contextMenuEvent=P:this._ignoreContextMenu||this._map.fire(new lc(P.type,this._map,P)),this._map.listens("contextmenu")&&P.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Bc{constructor(P){this._map=P}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(P){return this.transform.pointLocation(t.P.convert(P),this._map.terrain)}}class sf{constructor(P,oe){this._map=P,this._tr=new Bc(P),this._el=P.getCanvasContainer(),this._container=P.getContainer(),this._clickTolerance=oe.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(P,oe){this.isEnabled()&&P.shiftKey&&P.button===0&&(a.disableDrag(),this._startPos=this._lastPos=oe,this._active=!0)}mousemoveWindow(P,oe){if(!this._active)return;const Me=oe;if(this._lastPos.equals(Me)||!this._box&&Me.dist(this._startPos)Be.fitScreenCoordinates(Me,Ce,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",P)}keydown(P){this._active&&P.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",P))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(a.remove(this._box),this._box=null),a.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(P,oe){return this._map.fire(new t.k(P,{originalEvent:oe}))}}function Uh(Ue,P){if(Ue.length!==P.length)throw new Error(`The number of touches and points are not equal - touches ${Ue.length}, points ${P.length}`);const oe={};for(let Me=0;Methis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=P.timeStamp),Me.length===this.numTouches&&(this.centroid=(function(Ce){const Be=new t.P(0,0);for(const _t of Ce)Be._add(_t);return Be.div(Ce.length)})(oe),this.touches=Uh(Me,oe)))}touchmove(P,oe,Me){if(this.aborted||!this.centroid)return;const Ce=Uh(Me,oe);for(const Be in this.touches){const _t=Ce[Be];(!_t||_t.dist(this.touches[Be])>30)&&(this.aborted=!0)}}touchend(P,oe,Me){if((!this.centroid||P.timeStamp-this.startTime>500)&&(this.aborted=!0),Me.length===0){const Ce=!this.aborted&&this.centroid;if(this.reset(),Ce)return Ce}}}class hh{constructor(P){this.singleTap=new lu(P),this.numTaps=P.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(P,oe,Me){this.singleTap.touchstart(P,oe,Me)}touchmove(P,oe,Me){this.singleTap.touchmove(P,oe,Me)}touchend(P,oe,Me){const Ce=this.singleTap.touchend(P,oe,Me);if(Ce){const Be=P.timeStamp-this.lastTime<500,_t=!this.lastTap||this.lastTap.dist(Ce)<30;if(Be&&_t||this.reset(),this.count++,this.lastTime=P.timeStamp,this.lastTap=Ce,this.count===this.numTaps)return this.reset(),Ce}}}class qf{constructor(P){this._tr=new Bc(P),this._zoomIn=new hh({numTouches:1,numTaps:2}),this._zoomOut=new hh({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(P,oe,Me){this._zoomIn.touchstart(P,oe,Me),this._zoomOut.touchstart(P,oe,Me)}touchmove(P,oe,Me){this._zoomIn.touchmove(P,oe,Me),this._zoomOut.touchmove(P,oe,Me)}touchend(P,oe,Me){const Ce=this._zoomIn.touchend(P,oe,Me),Be=this._zoomOut.touchend(P,oe,Me),_t=this._tr;return Ce?(this._active=!0,P.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:kt=>kt.easeTo({duration:300,zoom:_t.zoom+1,around:_t.unproject(Ce)},{originalEvent:P})}):Be?(this._active=!0,P.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:kt=>kt.easeTo({duration:300,zoom:_t.zoom-1,around:_t.unproject(Be)},{originalEvent:P})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Zc{constructor(P){this._enabled=!!P.enable,this._moveStateManager=P.moveStateManager,this._clickTolerance=P.clickTolerance||1,this._moveFunction=P.move,this._activateOnStart=!!P.activateOnStart,P.assignEvents(this),this.reset()}reset(P){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(P)}_move(...P){const oe=this._moveFunction(...P);if(oe.bearingDelta||oe.pitchDelta||oe.around||oe.panDelta)return this._active=!0,oe}dragStart(P,oe){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(P)&&(this._moveStateManager.startMove(P),this._lastPoint=oe.length?oe[0]:oe,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(P,oe){if(!this.isEnabled())return;const Me=this._lastPoint;if(!Me)return;if(P.preventDefault(),!this._moveStateManager.isValidMoveEvent(P))return void this.reset(P);const Ce=oe.length?oe[0]:oe;return!this._moved&&Ce.dist(Me){Ue.mousedown=Ue.dragStart,Ue.mousemoveWindow=Ue.dragMove,Ue.mouseup=Ue.dragEnd,Ue.contextmenu=P=>{P.preventDefault()}},hc=({enable:Ue,clickTolerance:P,bearingDegreesPerPixelMoved:oe=.8})=>{const Me=new mf({checkCorrectEvent:Ce=>a.mouseButton(Ce)===0&&Ce.ctrlKey||a.mouseButton(Ce)===2});return new Zc({clickTolerance:P,move:(Ce,Be)=>({bearingDelta:(Be.x-Ce.x)*oe}),moveStateManager:Me,enable:Ue,assignEvents:kd})},$h=({enable:Ue,clickTolerance:P,pitchDegreesPerPixelMoved:oe=-.5})=>{const Me=new mf({checkCorrectEvent:Ce=>a.mouseButton(Ce)===0&&Ce.ctrlKey||a.mouseButton(Ce)===2});return new Zc({clickTolerance:P,move:(Ce,Be)=>({pitchDelta:(Be.y-Ce.y)*oe}),moveStateManager:Me,enable:Ue,assignEvents:kd})};class Wc{constructor(P,oe){this._clickTolerance=P.clickTolerance||1,this._map=oe,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(P){return P<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(P,oe,Me){return this._calculateTransform(P,oe,Me)}touchmove(P,oe,Me){if(this._active){if(!this._shouldBePrevented(Me.length))return P.preventDefault(),this._calculateTransform(P,oe,Me);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",P)}}touchend(P,oe,Me){this._calculateTransform(P,oe,Me),this._active&&this._shouldBePrevented(Me.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(P,oe,Me){Me.length>0&&(this._active=!0);const Ce=Uh(Me,oe),Be=new t.P(0,0),_t=new t.P(0,0);let kt=0;for(const fr in Ce){const Ar=Ce[fr],Lr=this._touches[fr];Lr&&(Be._add(Ar),_t._add(Ar.sub(Lr)),kt++,Ce[fr]=Ar)}if(this._touches=Ce,this._shouldBePrevented(kt)||!_t.mag())return;const Xt=_t.div(kt);return this._sum._add(Xt),this._sum.mag()Math.abs(Ue.x)}class jh extends Cf{constructor(P){super(),this._currentTouchCount=0,this._map=P}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(P,oe,Me){super.touchstart(P,oe,Me),this._currentTouchCount=Me.length}_start(P){this._lastPoints=P,yf(P[0].sub(P[1]))&&(this._valid=!1)}_move(P,oe,Me){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const Ce=P[0].sub(this._lastPoints[0]),Be=P[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Ce,Be,Me.timeStamp),this._valid?(this._lastPoints=P,this._active=!0,{pitchDelta:(Ce.y+Be.y)/2*-.5}):void 0}gestureBeginsVertically(P,oe,Me){if(this._valid!==void 0)return this._valid;const Ce=P.mag()>=2,Be=oe.mag()>=2;if(!Ce&&!Be)return;if(!Ce||!Be)return this._firstMove===void 0&&(this._firstMove=Me),Me-this._firstMove<100&&void 0;const _t=P.y>0==oe.y>0;return yf(P)&&yf(oe)&&_t}}const cr={panStep:100,bearingStep:15,pitchStep:10};class Rr{constructor(P){this._tr=new Bc(P);const oe=cr;this._panStep=oe.panStep,this._bearingStep=oe.bearingStep,this._pitchStep=oe.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(P){if(P.altKey||P.ctrlKey||P.metaKey)return;let oe=0,Me=0,Ce=0,Be=0,_t=0;switch(P.keyCode){case 61:case 107:case 171:case 187:oe=1;break;case 189:case 109:case 173:oe=-1;break;case 37:P.shiftKey?Me=-1:(P.preventDefault(),Be=-1);break;case 39:P.shiftKey?Me=1:(P.preventDefault(),Be=1);break;case 38:P.shiftKey?Ce=1:(P.preventDefault(),_t=-1);break;case 40:P.shiftKey?Ce=-1:(P.preventDefault(),_t=1);break;default:return}return this._rotationDisabled&&(Me=0,Ce=0),{cameraAnimation:kt=>{const Xt=this._tr;kt.easeTo({duration:300,easeId:"keyboardHandler",easing:pn,zoom:oe?Math.round(Xt.zoom)+oe*(P.shiftKey?2:1):Xt.zoom,bearing:Xt.bearing+Me*this._bearingStep,pitch:Xt.pitch+Ce*this._pitchStep,offset:[-Be*this._panStep,-_t*this._panStep],center:Xt.center},{originalEvent:P})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function pn(Ue){return Ue*(2-Ue)}const an=4.000244140625;class On{constructor(P,oe){this._onTimeout=Me=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Me)},this._map=P,this._tr=new Bc(P),this._triggerRenderFrame=oe,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(P){this._defaultZoomRate=P}setWheelZoomRate(P){this._wheelZoomRate=P}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(P){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!P&&P.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(P){return!!this._map.cooperativeGestures.isEnabled()&&!(P.ctrlKey||this._map.cooperativeGestures.isBypassed(P))}wheel(P){if(!this.isEnabled())return;if(this._shouldBePrevented(P))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",P);let oe=P.deltaMode===WheelEvent.DOM_DELTA_LINE?40*P.deltaY:P.deltaY;const Me=i.now(),Ce=Me-(this._lastWheelEventTime||0);this._lastWheelEventTime=Me,oe!==0&&oe%an==0?this._type="wheel":oe!==0&&Math.abs(oe)<4?this._type="trackpad":Ce>400?(this._type=null,this._lastValue=oe,this._timeout=setTimeout(this._onTimeout,40,P)):this._type||(this._type=Math.abs(Ce*oe)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,oe+=this._lastValue)),P.shiftKey&&oe&&(oe/=4),this._type&&(this._lastWheelEvent=P,this._delta-=oe,this._active||this._start(P)),P.preventDefault()}_start(P){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const oe=a.mousePos(this._map.getCanvas(),P),Me=this._tr;this._around=oe.y>Me.transform.height/2-Me.transform.getHorizon()?t.N.convert(this._aroundCenter?Me.center:Me.unproject(oe)):t.N.convert(Me.center),this._aroundPoint=Me.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const P=this._tr.transform;if(this._delta!==0){const Xt=this._type==="wheel"&&Math.abs(this._delta)>an?this._wheelZoomRate:this._defaultZoomRate;let fr=2/(1+Math.exp(-Math.abs(this._delta*Xt)));this._delta<0&&fr!==0&&(fr=1/fr);const Ar=typeof this._targetZoom=="number"?P.zoomScale(this._targetZoom):P.scale;this._targetZoom=Math.min(P.maxZoom,Math.max(P.minZoom,P.scaleZoom(Ar*fr))),this._type==="wheel"&&(this._startZoom=P.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const oe=typeof this._targetZoom=="number"?this._targetZoom:P.zoom,Me=this._startZoom,Ce=this._easing;let Be,_t=!1;const kt=i.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Me&&Ce&&kt){const Xt=Math.min(kt/200,1),fr=Ce(Xt);Be=t.y.number(Me,oe,fr),Xt<1?this._frameId||(this._frameId=!0):_t=!0}else Be=oe,_t=!0;return this._active=!0,_t&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!_t,zoomDelta:Be-P.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(P){let oe=t.b9;if(this._prevEase){const Me=this._prevEase,Ce=(i.now()-Me.start)/Me.duration,Be=Me.easing(Ce+.01)-Me.easing(Ce),_t=.27/Math.sqrt(Be*Be+1e-4)*.01,kt=Math.sqrt(.0729-_t*_t);oe=t.b8(_t,kt,.25,1)}return this._prevEase={start:i.now(),duration:P,easing:oe},oe}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Aa{constructor(P,oe){this._clickZoom=P,this._tapZoom=oe}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class xa{constructor(P){this._tr=new Bc(P),this.reset()}reset(){this._active=!1}dblclick(P,oe){return P.preventDefault(),{cameraAnimation:Me=>{Me.easeTo({duration:300,zoom:this._tr.zoom+(P.shiftKey?-1:1),around:this._tr.unproject(oe)},{originalEvent:P})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ti{constructor(){this._tap=new hh({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(P,oe,Me){if(!this._swipePoint)if(this._tapTime){const Ce=oe[0],Be=P.timeStamp-this._tapTime<500,_t=this._tapPoint.dist(Ce)<30;Be&&_t?Me.length>0&&(this._swipePoint=Ce,this._swipeTouch=Me[0].identifier):this.reset()}else this._tap.touchstart(P,oe,Me)}touchmove(P,oe,Me){if(this._tapTime){if(this._swipePoint){if(Me[0].identifier!==this._swipeTouch)return;const Ce=oe[0],Be=Ce.y-this._swipePoint.y;return this._swipePoint=Ce,P.preventDefault(),this._active=!0,{zoomDelta:Be/128}}}else this._tap.touchmove(P,oe,Me)}touchend(P,oe,Me){if(this._tapTime)this._swipePoint&&Me.length===0&&this.reset();else{const Ce=this._tap.touchend(P,oe,Me);Ce&&(this._tapTime=P.timeStamp,this._tapPoint=Ce)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class li{constructor(P,oe,Me){this._el=P,this._mousePan=oe,this._touchPan=Me}enable(P){this._inertiaOptions=P||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ni{constructor(P,oe,Me){this._pitchWithRotate=P.pitchWithRotate,this._mouseRotate=oe,this._mousePitch=Me}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ha{constructor(P,oe,Me,Ce){this._el=P,this._touchZoom=oe,this._touchRotate=Me,this._tapDragZoom=Ce,this._rotationDisabled=!1,this._enabled=!0}enable(P){this._touchZoom.enable(P),this._rotationDisabled||this._touchRotate.enable(P),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class bi{constructor(P,oe){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=P,this._options=oe,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const P=this._map.getCanvasContainer();P.classList.add("maplibregl-cooperative-gestures"),this._container=a.create("div","maplibregl-cooperative-gesture-screen",P);let oe=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(oe=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const Me=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Ce=document.createElement("div");Ce.className="maplibregl-desktop-message",Ce.textContent=oe,this._container.appendChild(Ce);const Be=document.createElement("div");Be.className="maplibregl-mobile-message",Be.textContent=Me,this._container.appendChild(Be),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(a.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(P){return P[this._bypassKey]}notifyGestureBlocked(P,oe){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:P,originalEvent:oe})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Qa=Ue=>Ue.zoom||Ue.drag||Ue.pitch||Ue.rotate;class Na extends t.k{}function Yi(Ue){return Ue.panDelta&&Ue.panDelta.mag()||Ue.zoomDelta||Ue.bearingDelta||Ue.pitchDelta}class No{constructor(P,oe){this.handleWindowEvent=Ce=>{this.handleEvent(Ce,`${Ce.type}Window`)},this.handleEvent=(Ce,Be)=>{if(Ce.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const _t=Ce.type==="renderFrame"?void 0:Ce,kt={needsRenderFrame:!1},Xt={},fr={},Ar=Ce.touches,Lr=Ar?this._getMapTouches(Ar):void 0,tn=Lr?a.touchPos(this._map.getCanvas(),Lr):a.mousePos(this._map.getCanvas(),Ce);for(const{handlerName:tt,handler:vt,allowed:bt}of this._handlers){if(!vt.isEnabled())continue;let zt;this._blockedByActive(fr,bt,tt)?vt.reset():vt[Be||Ce.type]&&(zt=vt[Be||Ce.type](Ce,tn,Lr),this.mergeHandlerResult(kt,Xt,zt,tt,_t),zt&&zt.needsRenderFrame&&this._triggerRenderFrame()),(zt||vt.isActive())&&(fr[tt]=vt)}const xn={};for(const tt in this._previousActiveHandlers)fr[tt]||(xn[tt]=_t);this._previousActiveHandlers=fr,(Object.keys(xn).length||Yi(kt))&&(this._changes.push([kt,Xt,xn]),this._triggerRenderFrame()),(Object.keys(fr).length||Yi(kt))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:Ze}=kt;Ze&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],Ze(this._map))},this._map=P,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Sh(P),this._bearingSnap=oe.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(oe);const Me=this._el;this._listeners=[[Me,"touchstart",{passive:!0}],[Me,"touchmove",{passive:!1}],[Me,"touchend",void 0],[Me,"touchcancel",void 0],[Me,"mousedown",void 0],[Me,"mousemove",void 0],[Me,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Me,"mouseover",void 0],[Me,"mouseout",void 0],[Me,"dblclick",void 0],[Me,"click",void 0],[Me,"keydown",{capture:!1}],[Me,"keyup",void 0],[Me,"wheel",{passive:!1}],[Me,"contextmenu",void 0],[window,"blur",void 0]];for(const[Ce,Be,_t]of this._listeners)a.addEventListener(Ce,Be,Ce===document?this.handleWindowEvent:this.handleEvent,_t)}destroy(){for(const[P,oe,Me]of this._listeners)a.removeEventListener(P,oe,P===document?this.handleWindowEvent:this.handleEvent,Me)}_addDefaultHandlers(P){const oe=this._map,Me=oe.getCanvasContainer();this._add("mapEvent",new ih(oe,P));const Ce=oe.boxZoom=new sf(oe,P);this._add("boxZoom",Ce),P.interactive&&P.boxZoom&&Ce.enable();const Be=oe.cooperativeGestures=new bi(oe,P.cooperativeGestures);this._add("cooperativeGestures",Be),P.cooperativeGestures&&Be.enable();const _t=new qf(oe),kt=new xa(oe);oe.doubleClickZoom=new Aa(kt,_t),this._add("tapZoom",_t),this._add("clickZoom",kt),P.interactive&&P.doubleClickZoom&&oe.doubleClickZoom.enable();const Xt=new ti;this._add("tapDragZoom",Xt);const fr=oe.touchPitch=new jh(oe);this._add("touchPitch",fr),P.interactive&&P.touchPitch&&oe.touchPitch.enable(P.touchPitch);const Ar=hc(P),Lr=$h(P);oe.dragRotate=new Ni(P,Ar,Lr),this._add("mouseRotate",Ar,["mousePitch"]),this._add("mousePitch",Lr,["mouseRotate"]),P.interactive&&P.dragRotate&&oe.dragRotate.enable();const tn=(({enable:zt,clickTolerance:Et})=>{const Ut=new mf({checkCorrectEvent:gr=>a.mouseButton(gr)===0&&!gr.ctrlKey});return new Zc({clickTolerance:Et,move:(gr,Tr)=>({around:Tr,panDelta:Tr.sub(gr)}),activateOnStart:!0,moveStateManager:Ut,enable:zt,assignEvents:kd})})(P),xn=new Wc(P,oe);oe.dragPan=new li(Me,tn,xn),this._add("mousePan",tn),this._add("touchPan",xn,["touchZoom","touchRotate"]),P.interactive&&P.dragPan&&oe.dragPan.enable(P.dragPan);const Ze=new Vf,tt=new Tc;oe.touchZoomRotate=new Ha(Me,tt,Ze,Xt),this._add("touchRotate",Ze,["touchPan","touchZoom"]),this._add("touchZoom",tt,["touchPan","touchRotate"]),P.interactive&&P.touchZoomRotate&&oe.touchZoomRotate.enable(P.touchZoomRotate);const vt=oe.scrollZoom=new On(oe,()=>this._triggerRenderFrame());this._add("scrollZoom",vt,["mousePan"]),P.interactive&&P.scrollZoom&&oe.scrollZoom.enable(P.scrollZoom);const bt=oe.keyboard=new Rr(oe);this._add("keyboard",bt),P.interactive&&P.keyboard&&oe.keyboard.enable(),this._add("blockableMapEvent",new iu(oe))}_add(P,oe,Me){this._handlers.push({handlerName:P,handler:oe,allowed:Me}),this._handlersById[P]=oe}stop(P){if(!this._updatingCamera){for(const{handler:oe}of this._handlers)oe.reset();this._inertia.clear(),this._fireEvents({},{},P),this._changes=[]}}isActive(){for(const{handler:P}of this._handlers)if(P.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Qa(this._eventsInProgress)||this.isZooming()}_blockedByActive(P,oe,Me){for(const Ce in P)if(Ce!==Me&&(!oe||oe.indexOf(Ce)<0))return!0;return!1}_getMapTouches(P){const oe=[];for(const Me of P)this._el.contains(Me.target)&&oe.push(Me);return oe}mergeHandlerResult(P,oe,Me,Ce,Be){if(!Me)return;t.e(P,Me);const _t={handlerName:Ce,originalEvent:Me.originalEvent||Be};Me.zoomDelta!==void 0&&(oe.zoom=_t),Me.panDelta!==void 0&&(oe.drag=_t),Me.pitchDelta!==void 0&&(oe.pitch=_t),Me.bearingDelta!==void 0&&(oe.rotate=_t)}_applyChanges(){const P={},oe={},Me={};for(const[Ce,Be,_t]of this._changes)Ce.panDelta&&(P.panDelta=(P.panDelta||new t.P(0,0))._add(Ce.panDelta)),Ce.zoomDelta&&(P.zoomDelta=(P.zoomDelta||0)+Ce.zoomDelta),Ce.bearingDelta&&(P.bearingDelta=(P.bearingDelta||0)+Ce.bearingDelta),Ce.pitchDelta&&(P.pitchDelta=(P.pitchDelta||0)+Ce.pitchDelta),Ce.around!==void 0&&(P.around=Ce.around),Ce.pinchAround!==void 0&&(P.pinchAround=Ce.pinchAround),Ce.noInertia&&(P.noInertia=Ce.noInertia),t.e(oe,Be),t.e(Me,_t);this._updateMapTransform(P,oe,Me),this._changes=[]}_updateMapTransform(P,oe,Me){const Ce=this._map,Be=Ce._getTransformForUpdate(),_t=Ce.terrain;if(!(Yi(P)||_t&&this._terrainMovement))return this._fireEvents(oe,Me,!0);let{panDelta:kt,zoomDelta:Xt,bearingDelta:fr,pitchDelta:Ar,around:Lr,pinchAround:tn}=P;tn!==void 0&&(Lr=tn),Ce._stop(!0),Lr=Lr||Ce.transform.centerPoint;const xn=Be.pointLocation(kt?Lr.sub(kt):Lr);fr&&(Be.bearing+=fr),Ar&&(Be.pitch+=Ar),Xt&&(Be.zoom+=Xt),_t?this._terrainMovement||!oe.drag&&!oe.zoom?oe.drag&&this._terrainMovement?Be.center=Be.pointLocation(Be.centerPoint.sub(kt)):Be.setLocationAtPoint(xn,Lr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Be.setLocationAtPoint(xn,Lr)):Be.setLocationAtPoint(xn,Lr),Ce._applyUpdatedTransform(Be),this._map._update(),P.noInertia||this._inertia.record(P),this._fireEvents(oe,Me,!0)}_fireEvents(P,oe,Me){const Ce=Qa(this._eventsInProgress),Be=Qa(P),_t={};for(const Lr in P){const{originalEvent:tn}=P[Lr];this._eventsInProgress[Lr]||(_t[`${Lr}start`]=tn),this._eventsInProgress[Lr]=P[Lr]}!Ce&&Be&&this._fireEvent("movestart",Be.originalEvent);for(const Lr in _t)this._fireEvent(Lr,_t[Lr]);Be&&this._fireEvent("move",Be.originalEvent);for(const Lr in P){const{originalEvent:tn}=P[Lr];this._fireEvent(Lr,tn)}const kt={};let Xt;for(const Lr in this._eventsInProgress){const{handlerName:tn,originalEvent:xn}=this._eventsInProgress[Lr];this._handlersById[tn].isActive()||(delete this._eventsInProgress[Lr],Xt=oe[tn]||xn,kt[`${Lr}end`]=Xt)}for(const Lr in kt)this._fireEvent(Lr,kt[Lr]);const fr=Qa(this._eventsInProgress),Ar=(Ce||Be)&&!fr;if(Ar&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const Lr=this._map._getTransformForUpdate();Lr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Lr)}if(Me&&Ar){this._updatingCamera=!0;const Lr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),tn=xn=>xn!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Na("renderFrame",{timeStamp:P})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Do extends t.E{constructor(P,oe){super(),this._renderFrameCallback=()=>{const Me=Math.min((i.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Me)),Me<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=P,this._bearingSnap=oe.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(P,oe){return this.jumpTo({center:P},oe)}panBy(P,oe,Me){return P=t.P.convert(P).mult(-1),this.panTo(this.transform.center,t.e({offset:P},oe),Me)}panTo(P,oe,Me){return this.easeTo(t.e({center:P},oe),Me)}getZoom(){return this.transform.zoom}setZoom(P,oe){return this.jumpTo({zoom:P},oe),this}zoomTo(P,oe,Me){return this.easeTo(t.e({zoom:P},oe),Me)}zoomIn(P,oe){return this.zoomTo(this.getZoom()+1,P,oe),this}zoomOut(P,oe){return this.zoomTo(this.getZoom()-1,P,oe),this}getBearing(){return this.transform.bearing}setBearing(P,oe){return this.jumpTo({bearing:P},oe),this}getPadding(){return this.transform.padding}setPadding(P,oe){return this.jumpTo({padding:P},oe),this}rotateTo(P,oe,Me){return this.easeTo(t.e({bearing:P},oe),Me)}resetNorth(P,oe){return this.rotateTo(0,t.e({duration:1e3},P),oe),this}resetNorthPitch(P,oe){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},P),oe),this}snapToNorth(P,oe){return Math.abs(this.getBearing()){if(this._zooming&&(Ce.zoom=t.y.number(Be,vt,Pr)),this._rotating&&(Ce.bearing=t.y.number(_t,fr,Pr)),this._pitching&&(Ce.pitch=t.y.number(kt,Ar,Pr)),this._padding&&(Ce.interpolatePadding(Xt,Lr,Pr),xn=Ce.centerPoint.add(tn)),this.terrain&&!P.freezeElevation&&this._updateElevation(Pr),Ut)Ce.setLocationAtPoint(Ut,gr);else{const Yr=Ce.zoomScale(Ce.zoom-Be),sn=vt>Be?Math.min(2,Et):Math.max(.5,Et),En=Math.pow(sn,1-Pr),Pn=Ce.unproject(bt.add(zt.mult(Pr*En)).mult(Yr));Ce.setLocationAtPoint(Ce.renderWorldCopies?Pn.wrap():Pn,xn)}this._applyUpdatedTransform(Ce),this._fireMoveEvents(oe)},Pr=>{this.terrain&&P.freezeElevation&&this._finalizeElevation(),this._afterEase(oe,Pr)},P),this}_prepareEase(P,oe,Me={}){this._moving=!0,oe||Me.moving||this.fire(new t.k("movestart",P)),this._zooming&&!Me.zooming&&this.fire(new t.k("zoomstart",P)),this._rotating&&!Me.rotating&&this.fire(new t.k("rotatestart",P)),this._pitching&&!Me.pitching&&this.fire(new t.k("pitchstart",P))}_prepareElevation(P){this._elevationCenter=P,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(P,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(P){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const oe=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(P<1&&oe!==this._elevationTarget){const Me=this._elevationTarget-this._elevationStart;this._elevationStart+=P*(Me-(oe-(Me*P+this._elevationStart))/(1-P)),this._elevationTarget=oe}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,P)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(P){const oe=P.getCameraPosition(),Me=this.terrain.getElevationForLngLatZoom(oe.lngLat,P.zoom);if(oe.altitudethis._elevateCameraIfInsideTerrain(Ce)),this.transformCameraUpdate&&oe.push(Ce=>this.transformCameraUpdate(Ce)),!oe.length)return;const Me=P.clone();for(const Ce of oe){const Be=Me.clone(),{center:_t,zoom:kt,pitch:Xt,bearing:fr,elevation:Ar}=Ce(Be);_t&&(Be.center=_t),kt!==void 0&&(Be.zoom=kt),Xt!==void 0&&(Be.pitch=Xt),fr!==void 0&&(Be.bearing=fr),Ar!==void 0&&(Be.elevation=Ar),Me.apply(Be)}this.transform.apply(Me)}_fireMoveEvents(P){this.fire(new t.k("move",P)),this._zooming&&this.fire(new t.k("zoom",P)),this._rotating&&this.fire(new t.k("rotate",P)),this._pitching&&this.fire(new t.k("pitch",P))}_afterEase(P,oe){if(this._easeId&&oe&&this._easeId===oe)return;delete this._easeId;const Me=this._zooming,Ce=this._rotating,Be=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Me&&this.fire(new t.k("zoomend",P)),Ce&&this.fire(new t.k("rotateend",P)),Be&&this.fire(new t.k("pitchend",P)),this.fire(new t.k("moveend",P))}flyTo(P,oe){var Me;if(!P.essential&&i.prefersReducedMotion){const ni=t.M(P,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ni,oe)}this.stop(),P=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},P);const Ce=this._getTransformForUpdate(),Be=Ce.zoom,_t=Ce.bearing,kt=Ce.pitch,Xt=Ce.padding,fr="bearing"in P?this._normalizeBearing(P.bearing,_t):_t,Ar="pitch"in P?+P.pitch:kt,Lr="padding"in P?P.padding:Ce.padding,tn=t.P.convert(P.offset);let xn=Ce.centerPoint.add(tn);const Ze=Ce.pointLocation(xn),{center:tt,zoom:vt}=Ce.getConstrained(t.N.convert(P.center||Ze),(Me=P.zoom)!==null&&Me!==void 0?Me:Be);this._normalizeCenter(tt,Ce);const bt=Ce.zoomScale(vt-Be),zt=Ce.project(Ze),Et=Ce.project(tt).sub(zt);let Ut=P.curve;const gr=Math.max(Ce.width,Ce.height),Tr=gr/bt,Pr=Et.mag();if("minZoom"in P){const ni=t.ac(Math.min(P.minZoom,Be,vt),Ce.minZoom,Ce.maxZoom),$i=gr/Ce.zoomScale(ni-Be);Ut=Math.sqrt($i/Pr*2)}const Yr=Ut*Ut;function sn(ni){const $i=(Tr*Tr-gr*gr+(ni?-1:1)*Yr*Yr*Pr*Pr)/(2*(ni?Tr:gr)*Yr*Pr);return Math.log(Math.sqrt($i*$i+1)-$i)}function En(ni){return(Math.exp(ni)-Math.exp(-ni))/2}function Pn(ni){return(Math.exp(ni)+Math.exp(-ni))/2}const Xn=sn(!1);let Ta=function(ni){return Pn(Xn)/Pn(Xn+Ut*ni)},ri=function(ni){return gr*((Pn(Xn)*(En($i=Xn+Ut*ni)/Pn($i))-En(Xn))/Yr)/Pr;var $i},Wa=(sn(!0)-Xn)/Ut;if(Math.abs(Pr)<1e-6||!isFinite(Wa)){if(Math.abs(gr-Tr)<1e-6)return this.easeTo(P,oe);const ni=Tr0,Ta=$i=>Math.exp(ni*Ut*$i)}return P.duration="duration"in P?+P.duration:1e3*Wa/("screenSpeed"in P?+P.screenSpeed/Ut:+P.speed),P.maxDuration&&P.duration>P.maxDuration&&(P.duration=0),this._zooming=!0,this._rotating=_t!==fr,this._pitching=Ar!==kt,this._padding=!Ce.isPaddingEqual(Lr),this._prepareEase(oe,!1),this.terrain&&this._prepareElevation(tt),this._ease(ni=>{const $i=ni*Wa,bo=1/Ta($i);Ce.zoom=ni===1?vt:Be+Ce.scaleZoom(bo),this._rotating&&(Ce.bearing=t.y.number(_t,fr,ni)),this._pitching&&(Ce.pitch=t.y.number(kt,Ar,ni)),this._padding&&(Ce.interpolatePadding(Xt,Lr,ni),xn=Ce.centerPoint.add(tn)),this.terrain&&!P.freezeElevation&&this._updateElevation(ni);const vo=ni===1?tt:Ce.unproject(zt.add(Et.mult(ri($i))).mult(bo));Ce.setLocationAtPoint(Ce.renderWorldCopies?vo.wrap():vo,xn),this._applyUpdatedTransform(Ce),this._fireMoveEvents(oe)},()=>{this.terrain&&P.freezeElevation&&this._finalizeElevation(),this._afterEase(oe)},P),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(P,oe){var Me;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const Ce=this._onEaseEnd;delete this._onEaseEnd,Ce.call(this,oe)}return P||(Me=this.handlers)===null||Me===void 0||Me.stop(!1),this}_ease(P,oe,Me){Me.animate===!1||Me.duration===0?(P(1),oe()):(this._easeStart=i.now(),this._easeOptions=Me,this._onEaseFrame=P,this._onEaseEnd=oe,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(P,oe){P=t.b3(P,-180,180);const Me=Math.abs(P-oe);return Math.abs(P-360-oe)180?-360:Me<-180?360:0}queryTerrainElevation(P){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(P),this.transform.tileZoom)-this.transform.elevation:null}}const Go={compact:!0,customAttribution:'
MapLibre'};class jo{constructor(P=Go){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=oe=>{!oe||oe.sourceDataType!=="metadata"&&oe.sourceDataType!=="visibility"&&oe.dataType!=="style"&&oe.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=P}getDefaultPosition(){return"bottom-right"}onAdd(P){return this._map=P,this._compact=this.options.compact,this._container=a.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=a.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){a.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(P,oe){const Me=this._map._getUIString(`AttributionControl.${oe}`);P.title=Me,P.setAttribute("aria-label",Me)}_updateAttributions(){if(!this._map.style)return;let P=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?P=P.concat(this.options.customAttribution.map(Ce=>typeof Ce!="string"?"":Ce)):typeof this.options.customAttribution=="string"&&P.push(this.options.customAttribution)),this._map.style.stylesheet){const Ce=this._map.style.stylesheet;this.styleOwner=Ce.owner,this.styleId=Ce.id}const oe=this._map.style.sourceCaches;for(const Ce in oe){const Be=oe[Ce];if(Be.used||Be.usedForTerrain){const _t=Be.getSource();_t.attribution&&P.indexOf(_t.attribution)<0&&P.push(_t.attribution)}}P=P.filter(Ce=>String(Ce).trim()),P.sort((Ce,Be)=>Ce.length-Be.length),P=P.filter((Ce,Be)=>{for(let _t=Be+1;_t=0)return!1;return!0});const Me=P.join(" | ");Me!==this._attribHTML&&(this._attribHTML=Me,P.length?(this._innerContainer.innerHTML=Me,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Wi{constructor(P={}){this._updateCompact=()=>{const oe=this._container.children;if(oe.length){const Me=oe[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Me.classList.add("maplibregl-compact"):Me.classList.remove("maplibregl-compact")}},this.options=P}getDefaultPosition(){return"bottom-left"}onAdd(P){this._map=P,this._compact=this.options&&this.options.compact,this._container=a.create("div","maplibregl-ctrl");const oe=a.create("a","maplibregl-ctrl-logo");return oe.target="_blank",oe.rel="noopener nofollow",oe.href="https://maplibre.org/",oe.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),oe.setAttribute("rel","noopener nofollow"),this._container.appendChild(oe),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){a.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Li{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(P){const oe=++this._id;return this._queue.push({callback:P,id:oe,cancelled:!1}),oe}remove(P){const oe=this._currentlyRunning,Me=oe?this._queue.concat(oe):this._queue;for(const Ce of Me)if(Ce.id===P)return void(Ce.cancelled=!0)}run(P=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const oe=this._currentlyRunning=this._queue;this._queue=[];for(const Me of oe)if(!Me.cancelled&&(Me.callback(P),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var ns=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Bs extends t.E{constructor(P){super(),this.sourceCache=P,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,P.usedForTerrain=!0,P.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(P,oe){this.sourceCache.update(P,oe),this._renderableTilesKeys=[];const Me={};for(const Ce of P.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:oe}))Me[Ce.key]=!0,this._renderableTilesKeys.push(Ce.key),this._tiles[Ce.key]||(Ce.posMatrix=new Float64Array(16),t.aP(Ce.posMatrix,0,t.X,0,t.X,0,1),this._tiles[Ce.key]=new dt(Ce,this.tileSize));for(const Ce in this._tiles)Me[Ce]||delete this._tiles[Ce]}freeRtt(P){for(const oe in this._tiles){const Me=this._tiles[oe];(!P||Me.tileID.equals(P)||Me.tileID.isChildOf(P)||P.isChildOf(Me.tileID))&&(Me.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(P=>this.getTileByID(P))}getTileByID(P){return this._tiles[P]}getTerrainCoords(P){const oe={};for(const Me of this._renderableTilesKeys){const Ce=this._tiles[Me].tileID;if(Ce.canonical.equals(P.canonical)){const Be=P.clone();Be.posMatrix=new Float64Array(16),t.aP(Be.posMatrix,0,t.X,0,t.X,0,1),oe[Me]=Be}else if(Ce.canonical.isChildOf(P.canonical)){const Be=P.clone();Be.posMatrix=new Float64Array(16);const _t=Ce.canonical.z-P.canonical.z,kt=Ce.canonical.x-(Ce.canonical.x>>_t<<_t),Xt=Ce.canonical.y-(Ce.canonical.y>>_t<<_t),fr=t.X>>_t;t.aP(Be.posMatrix,0,fr,0,fr,0,1),t.J(Be.posMatrix,Be.posMatrix,[-kt*fr,-Xt*fr,0]),oe[Me]=Be}else if(P.canonical.isChildOf(Ce.canonical)){const Be=P.clone();Be.posMatrix=new Float64Array(16);const _t=P.canonical.z-Ce.canonical.z,kt=P.canonical.x-(P.canonical.x>>_t<<_t),Xt=P.canonical.y-(P.canonical.y>>_t<<_t),fr=t.X>>_t;t.aP(Be.posMatrix,0,t.X,0,t.X,0,1),t.J(Be.posMatrix,Be.posMatrix,[kt*fr,Xt*fr,0]),t.K(Be.posMatrix,Be.posMatrix,[1/2**_t,1/2**_t,0]),oe[Me]=Be}}return oe}getSourceTile(P,oe){const Me=this.sourceCache._source;let Ce=P.overscaledZ-this.deltaZoom;if(Ce>Me.maxzoom&&(Ce=Me.maxzoom),Ce=Me.minzoom&&(!Be||!Be.dem);)Be=this.sourceCache.getTileByID(P.scaledTo(Ce--).key);return Be}tilesAfterTime(P=Date.now()){return Object.values(this._tiles).filter(oe=>oe.timeAdded>=P)}}class Al{constructor(P,oe,Me){this.painter=P,this.sourceCache=new Bs(oe),this.options=Me,this.exaggeration=typeof Me.exaggeration=="number"?Me.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(P,oe,Me,Ce=t.X){var Be;if(!(oe>=0&&oe=0&&MeP.canonical.z&&(P.canonical.z>=Ce?Be=P.canonical.z-Ce:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const _t=P.canonical.x-(P.canonical.x>>Be<>Be<>8<<4|Be>>8,oe[_t+3]=0;const Me=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(oe.buffer)),Ce=new u(P,Me,P.gl.RGBA,{premultiply:!1});return Ce.bind(P.gl.NEAREST,P.gl.CLAMP_TO_EDGE),this._coordsTexture=Ce,Ce}pointCoordinate(P){this.painter.maybeDrawDepthAndCoords(!0);const oe=new Uint8Array(4),Me=this.painter.context,Ce=Me.gl,Be=Math.round(P.x*this.painter.pixelRatio/devicePixelRatio),_t=Math.round(P.y*this.painter.pixelRatio/devicePixelRatio),kt=Math.round(this.painter.height/devicePixelRatio);Me.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Ce.readPixels(Be,kt-_t-1,1,1,Ce.RGBA,Ce.UNSIGNED_BYTE,oe),Me.bindFramebuffer.set(null);const Xt=oe[0]+(oe[2]>>4<<8),fr=oe[1]+((15&oe[2])<<8),Ar=this.coordsIndex[255-oe[3]],Lr=Ar&&this.sourceCache.getTileByID(Ar);if(!Lr)return null;const tn=this._coordsTextureSize,xn=(1<P.id!==oe),this._recentlyUsed.push(P.id)}stampObject(P){P.stamp=++this._stamp}getOrCreateFreeObject(){for(const oe of this._recentlyUsed)if(!this._objects[oe].inUse)return this._objects[oe];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const P=this._createObject(this._objects.length);return this._objects.push(P),P}freeObject(P){P.inUse=!1}freeAllObjects(){for(const P of this._objects)this.freeObject(P)}isFull(){return!(this._objects.length!P.inUse)===!1}}const Ml={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Wl{constructor(P,oe){this.painter=P,this.terrain=oe,this.pool=new Zl(P.context,30,oe.sourceCache.tileSize*oe.qualityFactor)}destruct(){this.pool.destruct()}getTexture(P){return this.pool.getObjectForId(P.rtt[this._stacks.length-1].id).texture}prepareForRender(P,oe){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=P._order.filter(Me=>!P._layers[Me].isHidden(oe)),this._coordsDescendingInv={};for(const Me in P.sourceCaches){this._coordsDescendingInv[Me]={};const Ce=P.sourceCaches[Me].getVisibleCoordinates();for(const Be of Ce){const _t=this.terrain.sourceCache.getTerrainCoords(Be);for(const kt in _t)this._coordsDescendingInv[Me][kt]||(this._coordsDescendingInv[Me][kt]=[]),this._coordsDescendingInv[Me][kt].push(_t[kt])}}this._coordsDescendingInvStr={};for(const Me of P._order){const Ce=P._layers[Me],Be=Ce.source;if(Ml[Ce.type]&&!this._coordsDescendingInvStr[Be]){this._coordsDescendingInvStr[Be]={};for(const _t in this._coordsDescendingInv[Be])this._coordsDescendingInvStr[Be][_t]=this._coordsDescendingInv[Be][_t].map(kt=>kt.key).sort().join()}}for(const Me of this._renderableTiles)for(const Ce in this._coordsDescendingInvStr){const Be=this._coordsDescendingInvStr[Ce][Me.tileID.key];Be&&Be!==Me.rttCoords[Ce]&&(Me.rtt=[])}}renderLayer(P){if(P.isHidden(this.painter.transform.zoom))return!1;const oe=P.type,Me=this.painter,Ce=this._renderableLayerIds[this._renderableLayerIds.length-1]===P.id;if(Ml[oe]&&(this._prevType&&Ml[this._prevType]||this._stacks.push([]),this._prevType=oe,this._stacks[this._stacks.length-1].push(P.id),!Ce))return!0;if(Ml[this._prevType]||Ml[oe]&&Ce){this._prevType=oe;const Be=this._stacks.length-1,_t=this._stacks[Be]||[];for(const kt of this._renderableTiles){if(this.pool.isFull()&&(wu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(kt),kt.rtt[Be]){const fr=this.pool.getObjectForId(kt.rtt[Be].id);if(fr.stamp===kt.rtt[Be].stamp){this.pool.useObject(fr);continue}}const Xt=this.pool.getOrCreateFreeObject();this.pool.useObject(Xt),this.pool.stampObject(Xt),kt.rtt[Be]={id:Xt.id,stamp:Xt.stamp},Me.context.bindFramebuffer.set(Xt.fbo.framebuffer),Me.context.clear({color:t.aM.transparent,stencil:0}),Me.currentStencilSource=void 0;for(let fr=0;fr<_t.length;fr++){const Ar=Me.style._layers[_t[fr]],Lr=Ar.source?this._coordsDescendingInv[Ar.source][kt.tileID.key]:[kt.tileID];Me.context.viewport.set([0,0,Xt.fbo.width,Xt.fbo.height]),Me._renderTileClippingMasks(Ar,Lr),Me.renderLayer(Me,Me.style.sourceCaches[Ar.source],Ar,Lr),Ar.source&&(kt.rttCoords[Ar.source]=this._coordsDescendingInvStr[Ar.source][kt.tileID.key])}}return wu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Ml[oe]}return!1}}const rl={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Cu=r,Mu={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Go,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:t.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},Hl=Ue=>{Ue.touchstart=Ue.dragStart,Ue.touchmoveWindow=Ue.dragMove,Ue.touchend=Ue.dragEnd},yo={showCompass:!0,showZoom:!0,visualizePitch:!1};class ys{constructor(P,oe,Me=!1){this.mousedown=_t=>{this.startMouse(t.e({},_t,{ctrlKey:!0,preventDefault:()=>_t.preventDefault()}),a.mousePos(this.element,_t)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=_t=>{this.moveMouse(_t,a.mousePos(this.element,_t))},this.mouseup=_t=>{this.mouseRotate.dragEnd(_t),this.mousePitch&&this.mousePitch.dragEnd(_t),this.offTemp()},this.touchstart=_t=>{_t.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,_t.targetTouches)[0],this.startTouch(_t,this._startPos),a.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.addEventListener(window,"touchend",this.touchend))},this.touchmove=_t=>{_t.targetTouches.length!==1?this.reset():(this._lastPos=a.touchPos(this.element,_t.targetTouches)[0],this.moveTouch(_t,this._lastPos))},this.touchend=_t=>{_t.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const Ce=P.dragRotate._mouseRotate.getClickTolerance(),Be=P.dragRotate._mousePitch.getClickTolerance();this.element=oe,this.mouseRotate=hc({clickTolerance:Ce,enable:!0}),this.touchRotate=(({enable:_t,clickTolerance:kt,bearingDegreesPerPixelMoved:Xt=.8})=>{const fr=new vh;return new Zc({clickTolerance:kt,move:(Ar,Lr)=>({bearingDelta:(Lr.x-Ar.x)*Xt}),moveStateManager:fr,enable:_t,assignEvents:Hl})})({clickTolerance:Ce,enable:!0}),this.map=P,Me&&(this.mousePitch=$h({clickTolerance:Be,enable:!0}),this.touchPitch=(({enable:_t,clickTolerance:kt,pitchDegreesPerPixelMoved:Xt=-.5})=>{const fr=new vh;return new Zc({clickTolerance:kt,move:(Ar,Lr)=>({pitchDelta:(Lr.y-Ar.y)*Xt}),moveStateManager:fr,enable:_t,assignEvents:Hl})})({clickTolerance:Be,enable:!0})),a.addEventListener(oe,"mousedown",this.mousedown),a.addEventListener(oe,"touchstart",this.touchstart,{passive:!1}),a.addEventListener(oe,"touchcancel",this.reset)}startMouse(P,oe){this.mouseRotate.dragStart(P,oe),this.mousePitch&&this.mousePitch.dragStart(P,oe),a.disableDrag()}startTouch(P,oe){this.touchRotate.dragStart(P,oe),this.touchPitch&&this.touchPitch.dragStart(P,oe),a.disableDrag()}moveMouse(P,oe){const Me=this.map,{bearingDelta:Ce}=this.mouseRotate.dragMove(P,oe)||{};if(Ce&&Me.setBearing(Me.getBearing()+Ce),this.mousePitch){const{pitchDelta:Be}=this.mousePitch.dragMove(P,oe)||{};Be&&Me.setPitch(Me.getPitch()+Be)}}moveTouch(P,oe){const Me=this.map,{bearingDelta:Ce}=this.touchRotate.dragMove(P,oe)||{};if(Ce&&Me.setBearing(Me.getBearing()+Ce),this.touchPitch){const{pitchDelta:Be}=this.touchPitch.dragMove(P,oe)||{};Be&&Me.setPitch(Me.getPitch()+Be)}}off(){const P=this.element;a.removeEventListener(P,"mousedown",this.mousedown),a.removeEventListener(P,"touchstart",this.touchstart,{passive:!1}),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend),a.removeEventListener(P,"touchcancel",this.reset),this.offTemp()}offTemp(){a.enableDrag(),a.removeEventListener(window,"mousemove",this.mousemove),a.removeEventListener(window,"mouseup",this.mouseup),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend)}}let zl;function ml(Ue,P,oe){const Me=new t.N(Ue.lng,Ue.lat);if(Ue=new t.N(Ue.lng,Ue.lat),P){const Ce=new t.N(Ue.lng-360,Ue.lat),Be=new t.N(Ue.lng+360,Ue.lat),_t=oe.locationPoint(Ue).distSqr(P);oe.locationPoint(Ce).distSqr(P)<_t?Ue=Ce:oe.locationPoint(Be).distSqr(P)<_t&&(Ue=Be)}for(;Math.abs(Ue.lng-oe.center.lng)>180;){const Ce=oe.locationPoint(Ue);if(Ce.x>=0&&Ce.y>=0&&Ce.x<=oe.width&&Ce.y<=oe.height)break;Ue.lng>oe.center.lng?Ue.lng-=360:Ue.lng+=360}return Ue.lng!==Me.lng&&oe.locationPoint(Ue).y>oe.height/2-oe.getHorizon()?Ue:Me}const yc={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function _c(Ue,P,oe){const Me=Ue.classList;for(const Ce in yc)Me.remove(`maplibregl-${oe}-anchor-${Ce}`);Me.add(`maplibregl-${oe}-anchor-${P}`)}class Ac extends t.E{constructor(P){if(super(),this._onKeyPress=oe=>{const Me=oe.code,Ce=oe.charCode||oe.keyCode;Me!=="Space"&&Me!=="Enter"&&Ce!==32&&Ce!==13||this.togglePopup()},this._onMapClick=oe=>{const Me=oe.originalEvent.target,Ce=this._element;this._popup&&(Me===Ce||Ce.contains(Me))&&this.togglePopup()},this._update=oe=>{var Me;if(!this._map)return;const Ce=this._map.loaded()&&!this._map.isMoving();(oe?.type==="terrain"||oe?.type==="render"&&!Ce)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?ml(this._lngLat,this._flatPos,this._map.transform):(Me=this._lngLat)===null||Me===void 0?void 0:Me.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Be="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Be=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Be=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let _t="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?_t="rotateX(0deg)":this._pitchAlignment==="map"&&(_t=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||oe&&oe.type!=="moveend"||(this._pos=this._pos.round()),a.setTransform(this._element,`${yc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${_t} ${Be}`),i.frameAsync(new AbortController).then(()=>{this._updateOpacity(oe&&oe.type==="moveend")}).catch(()=>{})},this._onMove=oe=>{if(!this._isDragging){const Me=this._clickTolerance||this._map._clickTolerance;this._isDragging=oe.point.dist(this._pointerdownPos)>=Me}this._isDragging&&(this._pos=oe.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=oe=>{this._element.contains(oe.originalEvent.target)&&(oe.preventDefault(),this._positionDelta=oe.point.sub(this._pos).add(this._offset),this._pointerdownPos=oe.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=P&&P.anchor||"center",this._color=P&&P.color||"#3FB1CE",this._scale=P&&P.scale||1,this._draggable=P&&P.draggable||!1,this._clickTolerance=P&&P.clickTolerance||0,this._subpixelPositioning=P&&P.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=P&&P.rotation||0,this._rotationAlignment=P&&P.rotationAlignment||"auto",this._pitchAlignment=P&&P.pitchAlignment&&P.pitchAlignment!=="auto"?P.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(P?.opacity,P?.opacityWhenCovered),P&&P.element)this._element=P.element,this._offset=t.P.convert(P&&P.offset||[0,0]);else{this._defaultMarker=!0,this._element=a.create("div");const oe=a.createNS("http://www.w3.org/2000/svg","svg"),Me=41,Ce=27;oe.setAttributeNS(null,"display","block"),oe.setAttributeNS(null,"height",`${Me}px`),oe.setAttributeNS(null,"width",`${Ce}px`),oe.setAttributeNS(null,"viewBox",`0 0 ${Ce} ${Me}`);const Be=a.createNS("http://www.w3.org/2000/svg","g");Be.setAttributeNS(null,"stroke","none"),Be.setAttributeNS(null,"stroke-width","1"),Be.setAttributeNS(null,"fill","none"),Be.setAttributeNS(null,"fill-rule","evenodd");const _t=a.createNS("http://www.w3.org/2000/svg","g");_t.setAttributeNS(null,"fill-rule","nonzero");const kt=a.createNS("http://www.w3.org/2000/svg","g");kt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),kt.setAttributeNS(null,"fill","#000000");const Xt=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const bt of Xt){const zt=a.createNS("http://www.w3.org/2000/svg","ellipse");zt.setAttributeNS(null,"opacity","0.04"),zt.setAttributeNS(null,"cx","10.5"),zt.setAttributeNS(null,"cy","5.80029008"),zt.setAttributeNS(null,"rx",bt.rx),zt.setAttributeNS(null,"ry",bt.ry),kt.appendChild(zt)}const fr=a.createNS("http://www.w3.org/2000/svg","g");fr.setAttributeNS(null,"fill",this._color);const Ar=a.createNS("http://www.w3.org/2000/svg","path");Ar.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),fr.appendChild(Ar);const Lr=a.createNS("http://www.w3.org/2000/svg","g");Lr.setAttributeNS(null,"opacity","0.25"),Lr.setAttributeNS(null,"fill","#000000");const tn=a.createNS("http://www.w3.org/2000/svg","path");tn.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),Lr.appendChild(tn);const xn=a.createNS("http://www.w3.org/2000/svg","g");xn.setAttributeNS(null,"transform","translate(6.0, 7.0)"),xn.setAttributeNS(null,"fill","#FFFFFF");const Ze=a.createNS("http://www.w3.org/2000/svg","g");Ze.setAttributeNS(null,"transform","translate(8.0, 8.0)");const tt=a.createNS("http://www.w3.org/2000/svg","circle");tt.setAttributeNS(null,"fill","#000000"),tt.setAttributeNS(null,"opacity","0.25"),tt.setAttributeNS(null,"cx","5.5"),tt.setAttributeNS(null,"cy","5.5"),tt.setAttributeNS(null,"r","5.4999962");const vt=a.createNS("http://www.w3.org/2000/svg","circle");vt.setAttributeNS(null,"fill","#FFFFFF"),vt.setAttributeNS(null,"cx","5.5"),vt.setAttributeNS(null,"cy","5.5"),vt.setAttributeNS(null,"r","5.4999962"),Ze.appendChild(tt),Ze.appendChild(vt),_t.appendChild(kt),_t.appendChild(fr),_t.appendChild(Lr),_t.appendChild(xn),_t.appendChild(Ze),oe.appendChild(_t),oe.setAttributeNS(null,"height",Me*this._scale+"px"),oe.setAttributeNS(null,"width",Ce*this._scale+"px"),this._element.appendChild(oe),this._offset=t.P.convert(P&&P.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",oe=>{oe.preventDefault()}),this._element.addEventListener("mousedown",oe=>{oe.preventDefault()}),_c(this._element,this._anchor,"marker"),P&&P.className)for(const oe of P.className.split(" "))this._element.classList.add(oe);this._popup=null}addTo(P){return this.remove(),this._map=P,this._element.setAttribute("aria-label",P._getUIString("Marker.Title")),P.getCanvasContainer().appendChild(this._element),P.on("move",this._update),P.on("moveend",this._update),P.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),a.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(P){return this._lngLat=t.N.convert(P),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(P){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),P){if(!("offset"in P.options)){const Ce=Math.abs(13.5)/Math.SQRT2;P.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[Ce,-1*(38.1-13.5+Ce)],"bottom-right":[-Ce,-1*(38.1-13.5+Ce)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=P,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(P){return this._subpixelPositioning=P,this}getPopup(){return this._popup}togglePopup(){const P=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:P?(P.isOpen()?P.remove():(P.setLngLat(this._lngLat),P.addTo(this._map)),this):this}_updateOpacity(P=!1){var oe,Me;if(!(!((oe=this._map)===null||oe===void 0)&&oe.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(P)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const Ce=this._map,Be=Ce.terrain.depthAtPoint(this._pos),_t=Ce.terrain.getElevationForLngLatZoom(this._lngLat,Ce.transform.tileZoom);if(Ce.transform.lngLatToCameraDepth(this._lngLat,_t)-Be<.006)return void(this._element.style.opacity=this._opacity);const kt=-this._offset.y/Ce.transform._pixelPerMeter,Xt=Math.sin(Ce.getPitch()*Math.PI/180)*kt,fr=Ce.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),Ar=Ce.transform.lngLatToCameraDepth(this._lngLat,_t+Xt)-fr>.006;!((Me=this._popup)===null||Me===void 0)&&Me.isOpen()&&Ar&&this._popup.remove(),this._element.style.opacity=Ar?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(P){return this._offset=t.P.convert(P),this._update(),this}addClassName(P){this._element.classList.add(P)}removeClassName(P){this._element.classList.remove(P)}toggleClassName(P){return this._element.classList.toggle(P)}setDraggable(P){return this._draggable=!!P,this._map&&(P?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(P){return this._rotation=P||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(P){return this._rotationAlignment=P||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(P){return this._pitchAlignment=P&&P!=="auto"?P:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(P,oe){return P===void 0&&oe===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),P!==void 0&&(this._opacity=P),oe!==void 0&&(this._opacityWhenCovered=oe),this._map&&this._updateOpacity(!0),this}}const $f={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let xc=0,Lf=!1;const Lu={maxWidth:100,unit:"metric"};function Pf(Ue,P,oe){const Me=oe&&oe.maxWidth||100,Ce=Ue._container.clientHeight/2,Be=Ue.unproject([0,Ce]),_t=Ue.unproject([Me,Ce]),kt=Be.distanceTo(_t);if(oe&&oe.unit==="imperial"){const Xt=3.2808*kt;Xt>5280?Xo(P,Me,Xt/5280,Ue._getUIString("ScaleControl.Miles")):Xo(P,Me,Xt,Ue._getUIString("ScaleControl.Feet"))}else oe&&oe.unit==="nautical"?Xo(P,Me,kt/1852,Ue._getUIString("ScaleControl.NauticalMiles")):kt>=1e3?Xo(P,Me,kt/1e3,Ue._getUIString("ScaleControl.Kilometers")):Xo(P,Me,kt,Ue._getUIString("ScaleControl.Meters"))}function Xo(Ue,P,oe,Me){const Ce=(function(Be){const _t=Math.pow(10,`${Math.floor(Be)}`.length-1);let kt=Be/_t;return kt=kt>=10?10:kt>=5?5:kt>=3?3:kt>=2?2:kt>=1?1:(function(Xt){const fr=Math.pow(10,Math.ceil(-Math.log(Xt)/Math.LN10));return Math.round(Xt*fr)/fr})(kt),_t*kt})(oe);Ue.style.width=P*(Ce/oe)+"px",Ue.innerHTML=`${Ce} ${Me}`}const as={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Rf=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function $c(Ue){if(Ue){if(typeof Ue=="number"){const P=Math.round(Math.abs(Ue)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,Ue),"top-left":new t.P(P,P),"top-right":new t.P(-P,P),bottom:new t.P(0,-Ue),"bottom-left":new t.P(P,-P),"bottom-right":new t.P(-P,-P),left:new t.P(Ue,0),right:new t.P(-Ue,0)}}if(Ue instanceof t.P||Array.isArray(Ue)){const P=t.P.convert(Ue);return{center:P,top:P,"top-left":P,"top-right":P,bottom:P,"bottom-left":P,"bottom-right":P,left:P,right:P}}return{center:t.P.convert(Ue.center||[0,0]),top:t.P.convert(Ue.top||[0,0]),"top-left":t.P.convert(Ue["top-left"]||[0,0]),"top-right":t.P.convert(Ue["top-right"]||[0,0]),bottom:t.P.convert(Ue.bottom||[0,0]),"bottom-left":t.P.convert(Ue["bottom-left"]||[0,0]),"bottom-right":t.P.convert(Ue["bottom-right"]||[0,0]),left:t.P.convert(Ue.left||[0,0]),right:t.P.convert(Ue.right||[0,0])}}return $c(new t.P(0,0))}const Nc=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=jo,e.BoxZoomHandler=sf,e.CanvasSource=at,e.CooperativeGesturesHandler=bi,e.DoubleClickZoomHandler=Aa,e.DragPanHandler=li,e.DragRotateHandler=Ni,e.EdgeInsets=gc,e.FullscreenControl=class extends t.E{constructor(Ue={}){super(),this._onFullscreenChange=()=>{var P;let oe=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((P=oe?.shadowRoot)===null||P===void 0)&&P.fullscreenElement;)oe=oe.shadowRoot.fullscreenElement;oe===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Ue&&Ue.container&&(Ue.container instanceof HTMLElement?this._container=Ue.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(Ue){return this._map=Ue,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){a.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const Ue=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);a.create("span","maplibregl-ctrl-icon",Ue).setAttribute("aria-hidden","true"),Ue.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const Ue=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Ue),this._fullscreenButton.title=Ue}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=ze,e.GeolocateControl=class extends t.E{constructor(Ue){super(),this._onSuccess=P=>{if(this._map){if(this._isOutOfMapMaxBounds(P))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",P)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=P,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(P),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(P),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",P)),this._finish()}},this._updateCamera=P=>{const oe=new t.N(P.coords.longitude,P.coords.latitude),Me=P.coords.accuracy,Ce=this._map.getBearing(),Be=t.e({bearing:Ce},this.options.fitBoundsOptions),_t=ie.fromLngLat(oe,Me);this._map.fitBounds(_t,Be,{geolocateSource:!0})},this._updateMarker=P=>{if(P){const oe=new t.N(P.coords.longitude,P.coords.latitude);this._accuracyCircleMarker.setLngLat(oe).addTo(this._map),this._userLocationDotMarker.setLngLat(oe).addTo(this._map),this._accuracy=P.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=P=>{if(this._map){if(this.options.trackUserLocation)if(P.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const oe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=oe,this._geolocateButton.setAttribute("aria-label",oe),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(P.code===3&&Lf)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",P)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",P=>P.preventDefault()),this._geolocateButton=a.create("button","maplibregl-ctrl-geolocate",this._container),a.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=P=>{if(this._map){if(P===!1){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");const oe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=oe,this._geolocateButton.setAttribute("aria-label",oe)}else{const oe=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=oe,this._geolocateButton.setAttribute("aria-label",oe)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Ac({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ac({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",oe=>{oe.geolocateSource||this._watchState!=="ACTIVE_LOCK"||oe.originalEvent&&oe.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))})}},this.options=t.e({},$f,Ue)}onAdd(Ue){return this._map=Ue,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return t._(this,arguments,void 0,function*(P=!1){if(zl!==void 0&&!P)return zl;if(window.navigator.permissions===void 0)return zl=!!window.navigator.geolocation,zl;try{zl=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{zl=!!window.navigator.geolocation}return zl})})().then(P=>this._finishSetupUI(P)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,xc=0,Lf=!1}_isOutOfMapMaxBounds(Ue){const P=this._map.getMaxBounds(),oe=Ue.coords;return P&&(oe.longitudeP.getEast()||oe.latitudeP.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const Ue=this._map.getBounds(),P=Ue.getSouthEast(),oe=Ue.getNorthEast(),Me=P.distanceTo(oe),Ce=Math.ceil(this._accuracy/(Me/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Ce}px`,this._circleElement.style.height=`${Ce}px`}trigger(){if(!this._setup)return t.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":xc--,Lf=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart")),this.fire(new t.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let Ue;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),xc++,xc>1?(Ue={maximumAge:6e5,timeout:0},Lf=!0):(Ue=this.options.positionOptions,Lf=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Ue)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},e.Hash=pf,e.ImageSource=st,e.KeyboardHandler=Rr,e.LngLatBounds=ie,e.LogoControl=Wi,e.Map=class extends Do{constructor(Ue){t.bf.mark(t.bg.create);const P=Object.assign(Object.assign({},Mu),Ue);if(P.minZoom!=null&&P.maxZoom!=null&&P.minZoom>P.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(P.minPitch!=null&&P.maxPitch!=null&&P.minPitch>P.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(P.minPitch!=null&&P.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(P.maxPitch!=null&&P.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new hu(P.minZoom,P.maxZoom,P.minPitch,P.maxPitch,P.renderWorldCopies),{bearingSnap:P.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Li,this._controls=[],this._mapId=t.a4(),this._contextLost=oe=>{oe.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:oe}))},this._contextRestored=oe=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:oe}))},this._onMapScroll=oe=>{if(oe.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=P.interactive,this._maxTileCacheSize=P.maxTileCacheSize,this._maxTileCacheZoomLevels=P.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=P.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=P.preserveDrawingBuffer===!0,this._antialias=P.antialias===!0,this._trackResize=P.trackResize===!0,this._bearingSnap=P.bearingSnap,this._refreshExpiredTiles=P.refreshExpiredTiles===!0,this._fadeDuration=P.fadeDuration,this._crossSourceCollisions=P.crossSourceCollisions===!0,this._collectResourceTiming=P.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},rl),P.locale),this._clickTolerance=P.clickTolerance,this._overridePixelRatio=P.pixelRatio,this._maxCanvasSize=P.maxCanvasSize,this.transformCameraUpdate=P.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=P.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new g(P.transformRequest),typeof P.container=="string"){if(this._container=document.getElementById(P.container),!this._container)throw new Error(`Container '${P.container}' not found.`)}else{if(!(P.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=P.container}if(P.maxBounds&&this.setMaxBounds(P.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let oe=!1;const Me=rh(Ce=>{this._trackResize&&!this._removed&&(this.resize(Ce),this.redraw())},50);this._resizeObserver=new ResizeObserver(Ce=>{oe?Me(Ce):oe=!0}),this._resizeObserver.observe(this._container)}this.handlers=new No(this,P),this._hash=P.hash&&new pf(typeof P.hash=="string"&&P.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:P.center,zoom:P.zoom,bearing:P.bearing,pitch:P.pitch}),P.bounds&&(this.resize(),this.fitBounds(P.bounds,t.e({},P.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=P.localIdeographFontFamily,this._validateStyle=P.validateStyle,P.style&&this.setStyle(P.style,{localIdeographFontFamily:P.localIdeographFontFamily}),P.attributionControl&&this.addControl(new jo(typeof P.attributionControl=="boolean"?void 0:P.attributionControl)),P.maplibreLogo&&this.addControl(new Wi,P.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",oe=>{this._update(oe.dataType==="style"),this.fire(new t.k(`${oe.dataType}data`,oe))}),this.on("dataloading",oe=>{this.fire(new t.k(`${oe.dataType}dataloading`,oe))}),this.on("dataabort",oe=>{this.fire(new t.k("sourcedataabort",oe))})}_getMapId(){return this._mapId}addControl(Ue,P){if(P===void 0&&(P=Ue.getDefaultPosition?Ue.getDefaultPosition():"top-right"),!Ue||!Ue.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const oe=Ue.onAdd(this);this._controls.push(Ue);const Me=this._controlPositions[P];return P.indexOf("bottom")!==-1?Me.insertBefore(oe,Me.firstChild):Me.appendChild(oe),this}removeControl(Ue){if(!Ue||!Ue.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const P=this._controls.indexOf(Ue);return P>-1&&this._controls.splice(P,1),Ue.onRemove(this),this}hasControl(Ue){return this._controls.indexOf(Ue)>-1}calculateCameraOptionsFromTo(Ue,P,oe,Me){return Me==null&&this.terrain&&(Me=this.terrain.getElevationForLngLatZoom(oe,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Ue,P,oe,Me)}resize(Ue){var P;const oe=this._containerDimensions(),Me=oe[0],Ce=oe[1],Be=this._getClampedPixelRatio(Me,Ce);if(this._resizeCanvas(Me,Ce,Be),this.painter.resize(Me,Ce,Be),this.painter.overLimit()){const kt=this.painter.context.gl;this._maxCanvasSize=[kt.drawingBufferWidth,kt.drawingBufferHeight];const Xt=this._getClampedPixelRatio(Me,Ce);this._resizeCanvas(Me,Ce,Xt),this.painter.resize(Me,Ce,Xt)}this.transform.resize(Me,Ce),(P=this._requestedCameraState)===null||P===void 0||P.resize(Me,Ce);const _t=!this._moving;return _t&&(this.stop(),this.fire(new t.k("movestart",Ue)).fire(new t.k("move",Ue))),this.fire(new t.k("resize",Ue)),_t&&this.fire(new t.k("moveend",Ue)),this}_getClampedPixelRatio(Ue,P){const{0:oe,1:Me}=this._maxCanvasSize,Ce=this.getPixelRatio(),Be=Ue*Ce,_t=P*Ce;return Math.min(Be>oe?oe/Be:1,_t>Me?Me/_t:1)*Ce}getPixelRatio(){var Ue;return(Ue=this._overridePixelRatio)!==null&&Ue!==void 0?Ue:devicePixelRatio}setPixelRatio(Ue){this._overridePixelRatio=Ue,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Ue){return this.transform.setMaxBounds(ie.convert(Ue)),this._update()}setMinZoom(Ue){if((Ue=Ue??-2)>=-2&&Ue<=this.transform.maxZoom)return this.transform.minZoom=Ue,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Ue,this._update(),this.getZoom()>Ue&&this.setZoom(Ue),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Ue){if((Ue=Ue??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Ue>=0&&Ue<=this.transform.maxPitch)return this.transform.minPitch=Ue,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Ue>=this.transform.minPitch)return this.transform.maxPitch=Ue,this._update(),this.getPitch()>Ue&&this.setPitch(Ue),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Ue){return this.transform.renderWorldCopies=Ue,this._update()}project(Ue){return this.transform.locationPoint(t.N.convert(Ue),this.style&&this.terrain)}unproject(Ue){return this.transform.pointLocation(t.P.convert(Ue),this.terrain)}isMoving(){var Ue;return this._moving||((Ue=this.handlers)===null||Ue===void 0?void 0:Ue.isMoving())}isZooming(){var Ue;return this._zooming||((Ue=this.handlers)===null||Ue===void 0?void 0:Ue.isZooming())}isRotating(){var Ue;return this._rotating||((Ue=this.handlers)===null||Ue===void 0?void 0:Ue.isRotating())}_createDelegatedListener(Ue,P,oe){if(Ue==="mouseenter"||Ue==="mouseover"){let Me=!1;return{layers:P,listener:oe,delegates:{mousemove:Be=>{const _t=P.filter(Xt=>this.getLayer(Xt)),kt=_t.length!==0?this.queryRenderedFeatures(Be.point,{layers:_t}):[];kt.length?Me||(Me=!0,oe.call(this,new lc(Ue,this,Be.originalEvent,{features:kt}))):Me=!1},mouseout:()=>{Me=!1}}}}if(Ue==="mouseleave"||Ue==="mouseout"){let Me=!1;return{layers:P,listener:oe,delegates:{mousemove:_t=>{const kt=P.filter(Xt=>this.getLayer(Xt));(kt.length!==0?this.queryRenderedFeatures(_t.point,{layers:kt}):[]).length?Me=!0:Me&&(Me=!1,oe.call(this,new lc(Ue,this,_t.originalEvent)))},mouseout:_t=>{Me&&(Me=!1,oe.call(this,new lc(Ue,this,_t.originalEvent)))}}}}{const Me=Ce=>{const Be=P.filter(kt=>this.getLayer(kt)),_t=Be.length!==0?this.queryRenderedFeatures(Ce.point,{layers:Be}):[];_t.length&&(Ce.features=_t,oe.call(this,Ce),delete Ce.features)};return{layers:P,listener:oe,delegates:{[Ue]:Me}}}}_saveDelegatedListener(Ue,P){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Ue]=this._delegatedListeners[Ue]||[],this._delegatedListeners[Ue].push(P)}_removeDelegatedListener(Ue,P,oe){if(!this._delegatedListeners||!this._delegatedListeners[Ue])return;const Me=this._delegatedListeners[Ue];for(let Ce=0;CeP.includes(_t))){for(const _t in Be.delegates)this.off(_t,Be.delegates[_t]);return void Me.splice(Ce,1)}}}on(Ue,P,oe){if(oe===void 0)return super.on(Ue,P);const Me=this._createDelegatedListener(Ue,typeof P=="string"?[P]:P,oe);this._saveDelegatedListener(Ue,Me);for(const Ce in Me.delegates)this.on(Ce,Me.delegates[Ce]);return this}once(Ue,P,oe){if(oe===void 0)return super.once(Ue,P);const Me=typeof P=="string"?[P]:P,Ce=this._createDelegatedListener(Ue,Me,oe);for(const Be in Ce.delegates){const _t=Ce.delegates[Be];Ce.delegates[Be]=(...kt)=>{this._removeDelegatedListener(Ue,Me,oe),_t(...kt)}}this._saveDelegatedListener(Ue,Ce);for(const Be in Ce.delegates)this.once(Be,Ce.delegates[Be]);return this}off(Ue,P,oe){return oe===void 0?super.off(Ue,P):(this._removeDelegatedListener(Ue,typeof P=="string"?[P]:P,oe),this)}queryRenderedFeatures(Ue,P){if(!this.style)return[];let oe;const Me=Ue instanceof t.P||Array.isArray(Ue),Ce=Me?Ue:[[0,0],[this.transform.width,this.transform.height]];if(P=P||(Me?{}:Ue)||{},Ce instanceof t.P||typeof Ce[0]=="number")oe=[t.P.convert(Ce)];else{const Be=t.P.convert(Ce[0]),_t=t.P.convert(Ce[1]);oe=[Be,new t.P(_t.x,Be.y),_t,new t.P(Be.x,_t.y),Be]}return this.style.queryRenderedFeatures(oe,P,this.transform)}querySourceFeatures(Ue,P){return this.style.querySourceFeatures(Ue,P)}setStyle(Ue,P){return(P=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},P)).diff!==!1&&P.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Ue?(this._diffStyle(Ue,P),this):(this._localIdeographFontFamily=P.localIdeographFontFamily,this._updateStyle(Ue,P))}setTransformRequest(Ue){return this._requestManager.setTransformRequest(Ue),this}_getUIString(Ue){const P=this._locale[Ue];if(P==null)throw new Error(`Missing UI string '${Ue}'`);return P}_updateStyle(Ue,P){if(P.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Ue,P));const oe=this.style&&P.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Ue)),Ue?(this.style=new qr(this,P||{}),this.style.setEventedParent(this,{style:this.style}),typeof Ue=="string"?this.style.loadURL(Ue,P,oe):this.style.loadJSON(Ue,P,oe),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new qr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Ue,P){if(typeof Ue=="string"){const oe=this._requestManager.transformRequest(Ue,"Style");t.h(oe,new AbortController).then(Me=>{this._updateDiff(Me.data,P)}).catch(Me=>{Me&&this.fire(new t.j(Me))})}else typeof Ue=="object"&&this._updateDiff(Ue,P)}_updateDiff(Ue,P){try{this.style.setState(Ue,P)&&this._update(!0)}catch(oe){t.w(`Unable to perform style diff: ${oe.message||oe.error||oe}. Rebuilding the style from scratch.`),this._updateStyle(Ue,P)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(Ue,P){return this._lazyInitEmptyStyle(),this.style.addSource(Ue,P),this._update(!0)}isSourceLoaded(Ue){const P=this.style&&this.style.sourceCaches[Ue];if(P!==void 0)return P.loaded();this.fire(new t.j(new Error(`There is no source with ID '${Ue}'`)))}setTerrain(Ue){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Ue){const P=this.style.sourceCaches[Ue.source];if(!P)throw new Error(`cannot load terrain, because there exists no source with ID: ${Ue.source}`);this.terrain===null&&P.reload();for(const oe in this.style._layers){const Me=this.style._layers[oe];Me.type==="hillshade"&&Me.source===Ue.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Al(this.painter,P,Ue),this.painter.renderToTexture=new Wl(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=oe=>{oe.dataType==="style"?this.terrain.sourceCache.freeRtt():oe.dataType==="source"&&oe.tile&&(oe.sourceId!==Ue.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(oe.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:Ue})),this}getTerrain(){var Ue,P;return(P=(Ue=this.terrain)===null||Ue===void 0?void 0:Ue.options)!==null&&P!==void 0?P:null}areTilesLoaded(){const Ue=this.style&&this.style.sourceCaches;for(const P in Ue){const oe=Ue[P]._tiles;for(const Me in oe){const Ce=oe[Me];if(Ce.state!=="loaded"&&Ce.state!=="errored")return!1}}return!0}removeSource(Ue){return this.style.removeSource(Ue),this._update(!0)}getSource(Ue){return this.style.getSource(Ue)}addImage(Ue,P,oe={}){const{pixelRatio:Me=1,sdf:Ce=!1,stretchX:Be,stretchY:_t,content:kt,textFitWidth:Xt,textFitHeight:fr}=oe;if(this._lazyInitEmptyStyle(),!(P instanceof HTMLImageElement||t.b(P))){if(P.width===void 0||P.height===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:Ar,height:Lr,data:tn}=P,xn=P;return this.style.addImage(Ue,{data:new t.R({width:Ar,height:Lr},new Uint8Array(tn)),pixelRatio:Me,stretchX:Be,stretchY:_t,content:kt,textFitWidth:Xt,textFitHeight:fr,sdf:Ce,version:0,userImage:xn}),xn.onAdd&&xn.onAdd(this,Ue),this}}{const{width:Ar,height:Lr,data:tn}=i.getImageData(P);this.style.addImage(Ue,{data:new t.R({width:Ar,height:Lr},tn),pixelRatio:Me,stretchX:Be,stretchY:_t,content:kt,textFitWidth:Xt,textFitHeight:fr,sdf:Ce,version:0})}}updateImage(Ue,P){const oe=this.style.getImage(Ue);if(!oe)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const Me=P instanceof HTMLImageElement||t.b(P)?i.getImageData(P):P,{width:Ce,height:Be,data:_t}=Me;if(Ce===void 0||Be===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Ce!==oe.data.width||Be!==oe.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const kt=!(P instanceof HTMLImageElement||t.b(P));return oe.data.replace(_t,kt),this.style.updateImage(Ue,oe),this}getImage(Ue){return this.style.getImage(Ue)}hasImage(Ue){return Ue?!!this.style.getImage(Ue):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(Ue){this.style.removeImage(Ue)}loadImage(Ue){return l.getImage(this._requestManager.transformRequest(Ue,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Ue,P){return this._lazyInitEmptyStyle(),this.style.addLayer(Ue,P),this._update(!0)}moveLayer(Ue,P){return this.style.moveLayer(Ue,P),this._update(!0)}removeLayer(Ue){return this.style.removeLayer(Ue),this._update(!0)}getLayer(Ue){return this.style.getLayer(Ue)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Ue,P,oe){return this.style.setLayerZoomRange(Ue,P,oe),this._update(!0)}setFilter(Ue,P,oe={}){return this.style.setFilter(Ue,P,oe),this._update(!0)}getFilter(Ue){return this.style.getFilter(Ue)}setPaintProperty(Ue,P,oe,Me={}){return this.style.setPaintProperty(Ue,P,oe,Me),this._update(!0)}getPaintProperty(Ue,P){return this.style.getPaintProperty(Ue,P)}setLayoutProperty(Ue,P,oe,Me={}){return this.style.setLayoutProperty(Ue,P,oe,Me),this._update(!0)}getLayoutProperty(Ue,P){return this.style.getLayoutProperty(Ue,P)}setGlyphs(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Ue,P),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Ue,P,oe={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Ue,P,oe,Me=>{Me||this._update(!0)}),this}removeSprite(Ue){return this._lazyInitEmptyStyle(),this.style.removeSprite(Ue),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Ue,P,oe=>{oe||this._update(!0)}),this}setLight(Ue,P={}){return this._lazyInitEmptyStyle(),this.style.setLight(Ue,P),this._update(!0)}getLight(){return this.style.getLight()}setSky(Ue){return this._lazyInitEmptyStyle(),this.style.setSky(Ue),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Ue,P){return this.style.setFeatureState(Ue,P),this._update()}removeFeatureState(Ue,P){return this.style.removeFeatureState(Ue,P),this._update()}getFeatureState(Ue){return this.style.getFeatureState(Ue)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Ue=0,P=0;return this._container&&(Ue=this._container.clientWidth||400,P=this._container.clientHeight||300),[Ue,P]}_setupContainer(){const Ue=this._container;Ue.classList.add("maplibregl-map");const P=this._canvasContainer=a.create("div","maplibregl-canvas-container",Ue);this._interactive&&P.classList.add("maplibregl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas",P),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const oe=this._containerDimensions(),Me=this._getClampedPixelRatio(oe[0],oe[1]);this._resizeCanvas(oe[0],oe[1],Me);const Ce=this._controlContainer=a.create("div","maplibregl-control-container",Ue),Be=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(_t=>{Be[_t]=a.create("div",`maplibregl-ctrl-${_t} `,Ce)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Ue,P,oe){this._canvas.width=Math.floor(oe*Ue),this._canvas.height=Math.floor(oe*P),this._canvas.style.width=`${Ue}px`,this._canvas.style.height=`${P}px`}_setupPainter(){const Ue={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let P=null;this._canvas.addEventListener("webglcontextcreationerror",Me=>{P={requestedAttributes:Ue},Me&&(P.statusMessage=Me.statusMessage,P.type=Me.type)},{once:!0});const oe=this._canvas.getContext("webgl2",Ue)||this._canvas.getContext("webgl",Ue);if(!oe){const Me="Failed to initialize WebGL";throw P?(P.message=Me,new Error(JSON.stringify(P))):new Error(Me)}this.painter=new Uf(oe,this.transform),s.testSupport(oe)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Ue){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Ue,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Ue){return this._update(),this._renderTaskQueue.add(Ue)}_cancelRenderFrame(Ue){this._renderTaskQueue.remove(Ue)}_render(Ue){const P=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Ue),this._removed)return;let oe=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const Ce=this.transform.zoom,Be=i.now();this.style.zoomHistory.update(Ce,Be);const _t=new t.z(Ce,{now:Be,fadeDuration:P,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),kt=_t.crossFadingFactor();kt===1&&kt===this._crossFadingFactor||(oe=!0,this._crossFadingFactor=kt),this.style.update(_t)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,P,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:P,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||oe)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const Me=this._sourcesDirty||this._styleDirty||this._placementDirty;return Me||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||Me||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var Ue;this._hash&&this._hash.remove();for(const oe of this._controls)oe.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),l.removeThrottleControl(this._imageQueueHandle),(Ue=this._resizeObserver)===null||Ue===void 0||Ue.disconnect();const P=this.painter.context.gl.getExtension("WEBGL_lose_context");P?.loseContext&&P.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),a.remove(this._canvasContainer),a.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(Ue=>{t.bf.frame(Ue),this._frameRequest=null,this._render(Ue)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Ue){this._showTileBoundaries!==Ue&&(this._showTileBoundaries=Ue,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Ue){this._showPadding!==Ue&&(this._showPadding=Ue,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Ue){this._showCollisionBoxes!==Ue&&(this._showCollisionBoxes=Ue,Ue?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Ue){this._showOverdrawInspector!==Ue&&(this._showOverdrawInspector=Ue,this._update())}get repaint(){return!!this._repaint}set repaint(Ue){this._repaint!==Ue&&(this._repaint=Ue,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Ue){this._vertices=Ue,this._update()}get version(){return Cu}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=lc,e.MapTouchEvent=ah,e.MapWheelEvent=Wh,e.Marker=Ac,e.NavigationControl=class{constructor(Ue){this._updateZoomButtons=()=>{const P=this._map.getZoom(),oe=P===this._map.getMaxZoom(),Me=P===this._map.getMinZoom();this._zoomInButton.disabled=oe,this._zoomOutButton.disabled=Me,this._zoomInButton.setAttribute("aria-disabled",oe.toString()),this._zoomOutButton.setAttribute("aria-disabled",Me.toString())},this._rotateCompassArrow=()=>{const P=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=P},this._setButtonTitle=(P,oe)=>{const Me=this._map._getUIString(`NavigationControl.${oe}`);P.title=Me,P.setAttribute("aria-label",Me)},this.options=t.e({},yo,Ue),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",P=>P.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",P=>this._map.zoomIn({},{originalEvent:P})),a.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",P=>this._map.zoomOut({},{originalEvent:P})),a.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",P=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:P}):this._map.resetNorth({},{originalEvent:P})}),this._compassIcon=a.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Ue){return this._map=Ue,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ys(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){a.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(Ue,P){const oe=a.create("button",Ue,this._container);return oe.type="button",oe.addEventListener("click",P),oe}},e.Popup=class extends t.E{constructor(Ue){super(),this.remove=()=>(this._content&&a.remove(this._content),this._container&&(a.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=P=>{this._update(P.point)},this._onMouseMove=P=>{this._update(P.point)},this._onDrag=P=>{this._update(P.point)},this._update=P=>{var oe;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=a.create("div","maplibregl-popup",this._map.getContainer()),this._tip=a.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const kt of this.options.className.split(" "))this._container.classList.add(kt);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?ml(this._lngLat,this._flatPos,this._map.transform):(oe=this._lngLat)===null||oe===void 0?void 0:oe.wrap(),this._trackPointer&&!P)return;const Me=this._flatPos=this._pos=this._trackPointer&&P?P:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&P?P:this._map.transform.locationPoint(this._lngLat));let Ce=this.options.anchor;const Be=$c(this.options.offset);if(!Ce){const kt=this._container.offsetWidth,Xt=this._container.offsetHeight;let fr;fr=Me.y+Be.bottom.ythis._map.transform.height-Xt?["bottom"]:[],Me.xthis._map.transform.width-kt/2&&fr.push("right"),Ce=fr.length===0?"bottom":fr.join("-")}let _t=Me.add(Be[Ce]);this.options.subpixelPositioning||(_t=_t.round()),a.setTransform(this._container,`${yc[Ce]} translate(${_t.x}px,${_t.y}px)`),_c(this._container,Ce,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(as),Ue)}addTo(Ue){return this._map&&this.remove(),this._map=Ue,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Ue){return this._lngLat=t.N.convert(Ue),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(Ue){return this.setDOMContent(document.createTextNode(Ue))}setHTML(Ue){const P=document.createDocumentFragment(),oe=document.createElement("body");let Me;for(oe.innerHTML=Ue;Me=oe.firstChild,Me;)P.appendChild(Me);return this.setDOMContent(P)}getMaxWidth(){var Ue;return(Ue=this._container)===null||Ue===void 0?void 0:Ue.style.maxWidth}setMaxWidth(Ue){return this.options.maxWidth=Ue,this._update(),this}setDOMContent(Ue){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Ue),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Ue){return this._container&&this._container.classList.add(Ue),this}removeClassName(Ue){return this._container&&this._container.classList.remove(Ue),this}setOffset(Ue){return this.options.offset=Ue,this._update(),this}toggleClassName(Ue){if(this._container)return this._container.classList.toggle(Ue)}setSubpixelPositioning(Ue){this.options.subpixelPositioning=Ue}_createCloseButton(){this.options.closeButton&&(this._closeButton=a.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const Ue=this._container.querySelector(Rf);Ue&&Ue.focus()}},e.RasterDEMTileSource=Fe,e.RasterTileSource=Le,e.ScaleControl=class{constructor(Ue){this._onMove=()=>{Pf(this._map,this._container,this.options)},this.setUnit=P=>{this.options.unit=P,Pf(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Lu),Ue)}getDefaultPosition(){return"bottom-left"}onAdd(Ue){return this._map=Ue,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Ue.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=On,e.Style=qr,e.TerrainControl=class{constructor(Ue){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=Ue}onAdd(Ue){return this._map=Ue,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=a.create("button","maplibregl-ctrl-terrain",this._container),a.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){a.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=jh,e.TwoFingersTouchRotateHandler=Vf,e.TwoFingersTouchZoomHandler=Tc,e.TwoFingersTouchZoomRotateHandler=Ha,e.VectorTileSource=Se,e.VideoSource=ct,e.addSourceType=(Ue,P)=>t._(void 0,void 0,void 0,function*(){if(Pe(Ue))throw new Error(`A source type called "${Ue}" already exists.`);((oe,Me)=>{et[oe]=Me})(Ue,P)}),e.clearPrewarmedResources=function(){const Ue=ce;Ue&&(Ue.isPreloaded()&&Ue.numActive()===1?(Ue.release(re),ce=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return ut().getRTLTextPluginStatus()},e.getVersion=function(){return Nc},e.getWorkerCount=function(){return fe.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(Ue){return $().broadcast("IS",Ue)},e.prewarm=function(){ee().acquire(re)},e.setMaxParallelImageRequests=function(Ue){t.a.MAX_PARALLEL_IMAGE_REQUESTS=Ue},e.setRTLTextPlugin=function(Ue,P){return ut().setRTLTextPlugin(Ue,P)},e.setWorkerCount=function(Ue){fe.workerCount=Ue},e.setWorkerUrl=function(Ue){t.a.WORKER_URL=Ue}});var E=h;return E})}}),L7=Ge({"src/plots/map/layers.js"(K,G){var h=_n(),b=nc().sanitizeHTML,S=LL(),E=j_();function e(i,a){this.subplot=i,this.uid=i.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(a){this.visible?this.needsNewImage(a)?this.updateImage(a):this.needsNewSource(a)?(this.removeLayer(),this.updateSource(a),this.updateLayer(a)):this.needsNewLayer(a)?this.updateLayer(a):this.updateStyle(a):(this.updateSource(a),this.updateLayer(a)),this.visible=r(a)},t.needsNewImage=function(i){var a=this.subplot.map;return a.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var a=this.subplot.map;a.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var a=this.subplot.map;if(a.getSource(this.idSource)&&a.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=n(i);a.addSource(this.idSource,s)}},t.findFollowingMapLayerId=function(i){if(i==="traces")for(var a=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var a={},s={};switch(i.type){case"circle":h.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":h.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":h.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var f=i.symbol,c=S(f.textposition,f.iconsize);h.extendFlat(a,{"icon-image":f.icon+"-15","icon-size":f.iconsize/10,"text-field":f.text,"text-size":f.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":f.placement}),h.extendFlat(s,{"icon-color":i.color,"text-color":f.textfont.color,"text-opacity":i.opacity});break;case"raster":h.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:a,paint:s}}function n(i){var a=i.sourcetype,s=i.source,f={type:a},c;return a==="geojson"?c="data":a==="vector"?c=typeof s=="string"?"url":"tiles":a==="raster"?(c="tiles",f.tileSize=256):a==="image"&&(c="url",f.coordinates=i.coordinates),f[c]=s,i.sourceattribution&&(f.attribution=b(i.sourceattribution)),f}G.exports=function(a,s,f){var c=new e(a,s);return c.update(f),c}}}),P7=Ge({"src/plots/map/map.js"(K,G){var h=C7(),b=_n(),S=F_(),E=Ro(),e=Ts(),t=uv(),r=Yf(),o=jp(),n=o.drawMode,i=o.selectMode,a=Qf().prepSelect,s=Qf().clearOutline,f=Qf().clearSelectionsCache,c=Qf().selectOnClick,p=j_(),v=L7();function T(_,w){this.id=w,this.gd=_;var m=_._fullLayout,u=_._context;this.container=m._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=m._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(m),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(_,w,m){var u=this,d;u.map?d=new Promise(function(y,I){u.updateMap(_,w,y,I)}):d=new Promise(function(y,I){u.createMap(_,w,y,I)}),m.push(d)},l.createMap=function(_,w,m,u){var d=this,y=w[d.id],I=d.styleObj=x(y.style),L=y.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,F=d.map=new h.Map({container:d.div,style:I.style,center:M(y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch,maxBounds:z,interactive:!d.isStatic,preserveDrawingBuffer:d.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new h.AttributionControl({compact:!0})),N={};F.on("styleimagemissing",function(R){var U=R.id;if(!N[U]&&U.includes("-15")){N[U]=!0;var j=new Image(15,15);j.onload=function(){F.addImage(U,j)},j.crossOrigin="Anonymous",j.src="https://unpkg.com/maki@2.1.0/icons/"+U+".svg"}}),F.setTransformRequest(function(R){return R=R.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),R=R.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),R=R.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:R}}),F._canvas.style.left="0px",F._canvas.style.top="0px",d.rejectOnError(u),d.isStatic||d.initFx(_,w);var B=[];B.push(new Promise(function(R){F.once("load",R)})),B=B.concat(S.fetchTraceGeoData(_)),Promise.all(B).then(function(){d.fillBelowLookup(_,w),d.updateData(_),d.updateLayout(w),d.resolveOnRender(m)}).catch(u)},l.updateMap=function(_,w,m,u){var d=this,y=d.map,I=w[this.id];d.rejectOnError(u);var L=[],z=x(I.style);JSON.stringify(d.styleObj)!==JSON.stringify(z)&&(d.styleObj=z,y.setStyle(z.style),d.traceHash={},L.push(new Promise(function(F){y.once("styledata",F)}))),L=L.concat(S.fetchTraceGeoData(_)),Promise.all(L).then(function(){d.fillBelowLookup(_,w),d.updateData(_),d.updateLayout(w),d.resolveOnRender(m)}).catch(u)},l.fillBelowLookup=function(_,w){var m=w[this.id],u=m.layers,d,y,I=this.belowLookup={},L=!1;for(d=0;d<_.length;d++){var z=_[d][0].trace,F=z._module;typeof z.below=="string"?y=z.below:F.getBelow&&(y=F.getBelow(z,this)),y===""&&(L=!0),I["trace-"+z.uid]=y||""}for(d=0;d1)for(d=0;d-1&&c(z.originalEvent,u,[m.xaxis],[m.yaxis],m.id,L),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,m=w.map,u=w.gd;if(w.isStatic)return;function d(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var y=_.dragmode,I;I=function(z,F){if(F.isRect){var N=z.range={};N[w.id]=[d([F.xmin,F.ymin]),d([F.xmax,F.ymax])]}else{var B=z.lassoPoints={};B[w.id]=F.map(d)}};var L=w.dragOptions;w.dragOptions=b.extendDeep(L||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:I},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),m.off("click",w.onClickInPanHandler),i(y)||n(y)?(m.dragPan.disable(),m.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,N){a(z,F,N,w.dragOptions,y)},t.init(w.dragOptions)):(m.dragPan.enable(),m.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),m.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,m=_._size,u=this.div.style;u.width=m.w*(w.x[1]-w.x[0])+"px",u.height=m.h*(w.y[1]-w.y[0])+"px",u.left=m.l+w.x[0]*m.w+"px",u.top=m.t+(1-w.y[1])*m.h+"px",this.xaxis._offset=m.l+w.x[0]*m.w,this.xaxis._length=m.w*(w.x[1]-w.x[0]),this.yaxis._offset=m.t+(1-w.y[1])*m.h,this.yaxis._length=m.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],m=w.layers,u=this.layerList,d;if(m.length!==u.length){for(d=0;dm/2){var u=A.split("|").join("
");_.text(u).attr("data-unformatted",u).call(r.convertToTspans,i),w=t.bBox(_.node())}_.attr("transform",h(-3,-w.height+8)),M.insert("rect",".static-attribution").attr({x:-w.width-6,y:-w.height-3,width:w.width+6,height:w.height+3,fill:"rgba(255, 255, 255, 0.75)"});var d=1;w.width+6>m&&(d=m/(w.width+6));var y=[f.l+f.w*v.x[1],f.t+f.h*(1-v.y[0])];M.attr("transform",h(y[0],y[1])+b(d))}},K.updateFx=function(i){for(var a=i._fullLayout,s=a._subplots[n],f=0;f=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var n=o[0].trace,i=new E(r,n.uid),a=i.sourceId,s=h(o),f=i.below=r.belowLookup["trace-"+n.uid];return r.map.addSource(a,{type:"geojson",data:s.geojson}),i._addLayers(s,f),o[0].trace._glTrace=i,i}}}),F7=Ge({"src/traces/choroplethmap/index.js"(K,G){G.exports={attributes:PL(),supplyDefaults:z7(),colorbar:Sm(),calc:RE(),plot:O7(),hoverPoints:DE(),eventData:zE(),selectPoints:OE(),styleOnSelect:function(h,b){if(b){var S=b[0].trace;S._glTrace.updateOnSelect(b)}},getBelow:function(h,b){for(var S=b.getMapLayers(),E=S.length-2;E>=0;E--){var e=S[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+v[c]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:x},properties:A})}}var _=E.extractOpts(n),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,m=w[0][1],u=S.opacity(m)<1?m:S.addOpacity(m,0),d=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,n=new S(t,o.uid),i=n.sourceId,a=h(r),s=n.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:a.geojson}),n._addLayers(a,s),n}}}),V7=Ge({"src/traces/densitymap/hover.js"(K,G){var h=Ts(),b=JE().hoverPoints,S=JE().getExtraText;G.exports=function(e,t,r){var o=b(e,t,r);if(o){var n=o[0],i=n.cd,a=i[0].trace,s=i[n.index];if(delete n.color,"z"in s){var f=n.subplot.mockAxis;n.z=s.z,n.zLabel=h.tickText(f,f.c2l(s.z),"hover").text}return n.extraText=S(a,s,i[0].t.labels),[n]}}}}),H7=Ge({"src/traces/densitymap/event_data.js"(K,G){G.exports=function(b,S){return b.lon=S.lon,b.lat=S.lat,b.z=S.z,b}}}),G7=Ge({"src/traces/densitymap/index.js"(K,G){G.exports={attributes:IL(),supplyDefaults:N7(),colorbar:Sm(),formatLabels:CL(),calc:U7(),plot:q7(),hoverPoints:V7(),eventData:H7(),getBelow:function(h,b){for(var S=b.getMapLayers(),E=0;E0;){l=x[x.length-1];var A=b[l];if(r[l]=0&&n[l].push(o[_])}r[l]=M}else{if(e[l]===E[l]){for(var w=[],m=[],u=0,M=g.length-1;M>=0;--M){var d=g[M];if(t[d]=!1,w.push(d),m.push(n[d]),u+=n[d].length,o[d]=s.length,d===l){g.length=M;break}}s.push(w);for(var y=new Array(u),M=0;M_&&(_=a.source[g]),a.target[g]>_&&(_=a.target[g]);var w=_+1;n.node._count=w;var m,u=n.node.groups,d={};for(g=0;g0&&e(N,w)&&e(B,w)&&!(d.hasOwnProperty(N)&&d.hasOwnProperty(B)&&d[N]===d[B])){d.hasOwnProperty(B)&&(B=d[B]),d.hasOwnProperty(N)&&(N=d[N]),N=+N,B=+B,v[N]=v[B]=!0;var R="";a.label&&a.label[g]&&(R=a.label[g]);var U=null;R&&T.hasOwnProperty(R)&&(U=T[R]),s.push({pointNumber:g,label:R,color:f?a.color[g]:a.color,hovercolor:c?a.hovercolor[g]:a.hovercolor,customdata:p?a.customdata[g]:a.customdata,concentrationscale:U,source:N,target:B,value:+F}),z.source.push(N),z.target.push(B)}}var j=w+u.length,Z=E(i.color),re=E(i.customdata),fe=[];for(g=0;gw-1,childrenNodes:[],pointNumber:g,label:le,color:Z?i.color[g]:i.color,customdata:re?i.customdata[g]:i.customdata})}var ce=!1;return o(j,z.source,z.target)&&(ce=!0),{circular:ce,links:s,nodes:fe,groups:u,groupLookup:d}}function o(n,i,a){for(var s=b.init2dArray(n,0),f=0;f1})}G.exports=function(i,a){var s=r(a);return S({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}}),W7=Ge({"node_modules/d3-quadtree/dist/d3-quadtree.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K):(h=h||self,b(h.d3=h.d3||{}))})(K,function(h){function b(w){var m=+this._x.call(null,w),u=+this._y.call(null,w);return S(this.cover(m,u),m,u,w)}function S(w,m,u,d){if(isNaN(m)||isNaN(u))return w;var y,I=w._root,L={data:d},z=w._x0,F=w._y0,N=w._x1,B=w._y1,R,U,j,Z,re,fe,le,ce;if(!I)return w._root=L,w;for(;I.length;)if((re=m>=(R=(z+N)/2))?z=R:N=R,(fe=u>=(U=(F+B)/2))?F=U:B=U,y=I,!(I=I[le=fe<<1|re]))return y[le]=L,w;if(j=+w._x.call(null,I.data),Z=+w._y.call(null,I.data),m===j&&u===Z)return L.next=I,y?y[le]=L:w._root=L,w;do y=y?y[le]=new Array(4):w._root=new Array(4),(re=m>=(R=(z+N)/2))?z=R:N=R,(fe=u>=(U=(F+B)/2))?F=U:B=U;while((le=fe<<1|re)===(ce=(Z>=U)<<1|j>=R));return y[ce]=I,y[le]=L,w}function E(w){var m,u,d=w.length,y,I,L=new Array(d),z=new Array(d),F=1/0,N=1/0,B=-1/0,R=-1/0;for(u=0;uB&&(B=y),IR&&(R=I));if(F>B||N>R)return this;for(this.cover(F,N).cover(B,R),u=0;uw||w>=y||d>m||m>=I;)switch(N=(mB||(z=Z.y0)>R||(F=Z.x1)=le)<<1|w>=fe)&&(Z=U[U.length-1],U[U.length-1]=U[U.length-1-re],U[U.length-1-re]=Z)}else{var ce=w-+this._x.call(null,j.data),V=m-+this._y.call(null,j.data),ee=ce*ce+V*V;if(ee=(U=(L+F)/2))?L=U:F=U,(re=R>=(j=(z+N)/2))?z=j:N=j,m=u,!(u=u[fe=re<<1|Z]))return this;if(!u.length)break;(m[fe+1&3]||m[fe+2&3]||m[fe+3&3])&&(d=m,le=fe)}for(;u.data!==w;)if(y=u,!(u=u.next))return this;return(I=u.next)&&delete u.next,y?(I?y.next=I:delete y.next,this):m?(I?m[fe]=I:delete m[fe],(u=m[0]||m[1]||m[2]||m[3])&&u===(m[3]||m[2]||m[1]||m[0])&&!u.length&&(d?d[le]=u:this._root=u),this):(this._root=I,this)}function a(w){for(var m=0,u=w.length;m=v.length)return l!=null&&_.sort(l),g!=null?g(_):_;for(var d=-1,y=_.length,I=v[w++],L,z,F=E(),N,B=m();++dv.length)return _;var m,u=T[w-1];return g!=null&&w>=v.length?m=_.entries():(m=[],_.each(function(d,y){m.push({key:y,values:M(d,w)})})),u!=null?m.sort(function(d,y){return u(d.key,y.key)}):m}return x={object:function(_){return A(_,0,t,r)},map:function(_){return A(_,0,o,n)},entries:function(_){return M(A(_,0,o,n),0)},key:function(_){return v.push(_),x},sortKeys:function(_){return T[v.length-1]=_,x},sortValues:function(_){return l=_,x},rollup:function(_){return g=_,x}}}function t(){return{}}function r(v,T,l){v[T]=l}function o(){return E()}function n(v,T,l){v.set(T,l)}function i(){}var a=E.prototype;i.prototype=s.prototype={constructor:i,has:a.has,add:function(v){return v+="",this[b+v]=v,this},remove:a.remove,clear:a.clear,values:a.keys,size:a.size,empty:a.empty,each:a.each};function s(v,T){var l=new i;if(v instanceof i)v.each(function(A){l.add(A)});else if(v){var g=-1,x=v.length;if(T==null)for(;++g=0&&(a=i.slice(s+1),i=i.slice(0,s)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}E.prototype=S.prototype={constructor:E,on:function(o,n){var i=this._,a=e(o+"",i),s,f=-1,c=a.length;if(arguments.length<2){for(;++f0)for(var i=new Array(s),a=0,s,f;a=0&&w._call.call(null,m),w=w._next;--b}function l(){n=(o=a.now())+i,b=S=0;try{T()}finally{b=0,x(),n=0}}function g(){var w=a.now(),m=w-o;m>e&&(i-=m,o=w)}function x(){for(var w,m=t,u,d=1/0;m;)m._call?(d>m._time&&(d=m._time),w=m,m=m._next):(u=m._next,m._next=null,m=w?w._next=u:t=u);r=w,A(d)}function A(w){if(!b){S&&(S=clearTimeout(S));var m=w-n;m>24?(w<1/0&&(S=setTimeout(l,w-a.now()-i)),E&&(E=clearInterval(E))):(E||(o=a.now(),E=setInterval(g,e)),b=1,s(l))}}function M(w,m,u){var d=new p;return m=m==null?0:+m,d.restart(function(y){d.stop(),w(y+m)},m,u),d}function _(w,m,u){var d=new p,y=m;return m==null?(d.restart(w,m,u),d):(m=+m,u=u==null?f():+u,d.restart(function I(L){L+=y,d.restart(I,y+=m,u),w(L)},m,u),d)}h.interval=_,h.now=f,h.timeout=M,h.timer=v,h.timerFlush=T,Object.defineProperty(h,"__esModule",{value:!0})})}}),J7=Ge({"node_modules/d3-force/dist/d3-force.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,W7(),e6(),$7(),K7()):b(h.d3=h.d3||{},h.d3,h.d3,h.d3,h.d3)})(K,function(h,b,S,E,e){function t(w,m){var u;w==null&&(w=0),m==null&&(m=0);function d(){var y,I=u.length,L,z=0,F=0;for(y=0;yR.index){var ae=U-ue.x-ue.vx,ie=j-ue.y-ue.vy,de=ae*ae+ie*ie;deU+H||nej+H||$F.r&&(F.r=F[N].r)}function z(){if(m){var F,N=m.length,B;for(u=new Array(N),F=0;F1?(re==null?z.remove(Z):z.set(Z,j(re)),m):z.get(Z)},find:function(Z,re,fe){var le=0,ce=w.length,V,ee,ne,$,ue;for(fe==null?fe=1/0:fe*=fe,le=0;le1?(N.on(Z,re),m):N.on(Z)}}}function x(){var w,m,u,d=r(-30),y,I=1,L=1/0,z=.81;function F(U){var j,Z=w.length,re=b.quadtree(w,p,v).visitAfter(B);for(u=U,j=0;j=L)return;(U.data!==m||U.next)&&(fe===0&&(fe=o(),V+=fe*fe),le===0&&(le=o(),V+=le*le),VE)if(!(Math.abs(l*p-v*T)>E)||!s)this._+="L"+(this._x1=o)+","+(this._y1=n);else{var x=i-f,A=a-c,M=p*p+v*v,_=x*x+A*A,w=Math.sqrt(M),m=Math.sqrt(g),u=s*Math.tan((b-Math.acos((M+g-_)/(2*w*m)))/2),d=u/m,y=u/w;Math.abs(d-1)>E&&(this._+="L"+(o+d*T)+","+(n+d*l)),this._+="A"+s+","+s+",0,0,"+ +(l*x>T*A)+","+(this._x1=o+y*p)+","+(this._y1=n+y*v)}},arc:function(o,n,i,a,s,f){o=+o,n=+n,i=+i,f=!!f;var c=i*Math.cos(a),p=i*Math.sin(a),v=o+c,T=n+p,l=1^f,g=f?a-s:s-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+v+","+T:(Math.abs(this._x1-v)>E||Math.abs(this._y1-T)>E)&&(this._+="L"+v+","+T),i&&(g<0&&(g=g%S+S),g>e?this._+="A"+i+","+i+",0,1,"+l+","+(o-c)+","+(n-p)+"A"+i+","+i+",0,1,"+l+","+(this._x1=v)+","+(this._y1=T):g>E&&(this._+="A"+i+","+i+",0,"+ +(g>=b)+","+l+","+(this._x1=o+i*Math.cos(s))+","+(this._y1=n+i*Math.sin(s))))},rect:function(o,n,i,a){this._+="M"+(this._x0=this._x1=+o)+","+(this._y0=this._y1=+n)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}},h.path=r,Object.defineProperty(h,"__esModule",{value:!0})})}}),OL=Ge({"node_modules/d3-shape/dist/d3-shape.js"(K,G){(function(h,b){typeof K=="object"&&typeof G<"u"?b(K,Q7()):(h=h||self,b(h.d3=h.d3||{},h.d3))})(K,function(h,b){function S(At){return function(){return At}}var E=Math.abs,e=Math.atan2,t=Math.cos,r=Math.max,o=Math.min,n=Math.sin,i=Math.sqrt,a=1e-12,s=Math.PI,f=s/2,c=2*s;function p(At){return At>1?0:At<-1?s:Math.acos(At)}function v(At){return At>=1?f:At<=-1?-f:Math.asin(At)}function T(At){return At.innerRadius}function l(At){return At.outerRadius}function g(At){return At.startAngle}function x(At){return At.endAngle}function A(At){return At&&At.padAngle}function M(At,lr,zr,cn,Rn,qn,jn,fn){var In=zr-At,gi=cn-lr,Ea=jn-Rn,Ci=fn-qn,Xi=Ci*In-Ea*gi;if(!(Xi*Xiul*ul+kl*kl&&(Vs=fs,ll=Zo),{cx:Vs,cy:ll,x01:-Ea,y01:-Ci,x11:Vs*(Rn/Jo-1),y11:ll*(Rn/Jo-1)}}function w(){var At=T,lr=l,zr=S(0),cn=null,Rn=g,qn=x,jn=A,fn=null;function In(){var gi,Ea,Ci=+At.apply(this,arguments),Xi=+lr.apply(this,arguments),so=Rn.apply(this,arguments)-f,io=qn.apply(this,arguments)-f,Mo=E(io-so),ui=io>so;if(fn||(fn=gi=b.path()),Xia))fn.moveTo(0,0);else if(Mo>c-a)fn.moveTo(Xi*t(so),Xi*n(so)),fn.arc(0,0,Xi,so,io,!ui),Ci>a&&(fn.moveTo(Ci*t(io),Ci*n(io)),fn.arc(0,0,Ci,io,so,ui));else{var ts=so,Ho=io,Xs=so,cs=io,Jo=Mo,Uo=Mo,Ys=jn.apply(this,arguments)/2,Vs=Ys>a&&(cn?+cn.apply(this,arguments):i(Ci*Ci+Xi*Xi)),ll=o(E(Xi-Ci)/2,+zr.apply(this,arguments)),fs=ll,Zo=ll,po,hs;if(Vs>a){var ul=v(Vs/Ci*n(Ys)),kl=v(Vs/Xi*n(Ys));(Jo-=ul*2)>a?(ul*=ui?1:-1,Xs+=ul,cs-=ul):(Jo=0,Xs=cs=(so+io)/2),(Uo-=kl*2)>a?(kl*=ui?1:-1,ts+=kl,Ho-=kl):(Uo=0,ts=Ho=(so+io)/2)}var Rl=Xi*t(ts),Ms=Xi*n(ts),fi=Ci*t(cs),to=Ci*n(cs);if(ll>a){var Cl=Xi*t(Ho),Ps=Xi*n(Ho),Fo=Ci*t(Xs),Il=Ci*n(Xs),Zs;if(Moa?Zo>a?(po=_(Fo,Il,Rl,Ms,Xi,Zo,ui),hs=_(Cl,Ps,fi,to,Xi,Zo,ui),fn.moveTo(po.cx+po.x01,po.cy+po.y01),Zoa)||!(Jo>a)?fn.lineTo(fi,to):fs>a?(po=_(fi,to,Cl,Ps,Ci,-fs,ui),hs=_(Rl,Ms,Fo,Il,Ci,-fs,ui),fn.lineTo(po.cx+po.x01,po.cy+po.y01),fs=Xi;--so)fn.point(Ho[so],Xs[so]);fn.lineEnd(),fn.areaEnd()}ui&&(Ho[Ci]=+At(Mo,Ci,Ea),Xs[Ci]=+zr(Mo,Ci,Ea),fn.point(lr?+lr(Mo,Ci,Ea):Ho[Ci],cn?+cn(Mo,Ci,Ea):Xs[Ci]))}if(ts)return fn=null,ts+""||null}function gi(){return I().defined(Rn).curve(jn).context(qn)}return In.x=function(Ea){return arguments.length?(At=typeof Ea=="function"?Ea:S(+Ea),lr=null,In):At},In.x0=function(Ea){return arguments.length?(At=typeof Ea=="function"?Ea:S(+Ea),In):At},In.x1=function(Ea){return arguments.length?(lr=Ea==null?null:typeof Ea=="function"?Ea:S(+Ea),In):lr},In.y=function(Ea){return arguments.length?(zr=typeof Ea=="function"?Ea:S(+Ea),cn=null,In):zr},In.y0=function(Ea){return arguments.length?(zr=typeof Ea=="function"?Ea:S(+Ea),In):zr},In.y1=function(Ea){return arguments.length?(cn=Ea==null?null:typeof Ea=="function"?Ea:S(+Ea),In):cn},In.lineX0=In.lineY0=function(){return gi().x(At).y(zr)},In.lineY1=function(){return gi().x(At).y(cn)},In.lineX1=function(){return gi().x(lr).y(zr)},In.defined=function(Ea){return arguments.length?(Rn=typeof Ea=="function"?Ea:S(!!Ea),In):Rn},In.curve=function(Ea){return arguments.length?(jn=Ea,qn!=null&&(fn=jn(qn)),In):jn},In.context=function(Ea){return arguments.length?(Ea==null?qn=fn=null:fn=jn(qn=Ea),In):qn},In}function z(At,lr){return lrAt?1:lr>=At?0:NaN}function F(At){return At}function N(){var At=F,lr=z,zr=null,cn=S(0),Rn=S(c),qn=S(0);function jn(fn){var In,gi=fn.length,Ea,Ci,Xi=0,so=new Array(gi),io=new Array(gi),Mo=+cn.apply(this,arguments),ui=Math.min(c,Math.max(-c,Rn.apply(this,arguments)-Mo)),ts,Ho=Math.min(Math.abs(ui)/gi,qn.apply(this,arguments)),Xs=Ho*(ui<0?-1:1),cs;for(In=0;In0&&(Xi+=cs);for(lr!=null?so.sort(function(Jo,Uo){return lr(io[Jo],io[Uo])}):zr!=null&&so.sort(function(Jo,Uo){return zr(fn[Jo],fn[Uo])}),In=0,Ci=Xi?(ui-gi*Xs)/Xi:0;In0?cs*Ci:0)+Xs,io[Ea]={data:fn[Ea],index:In,value:cs,startAngle:Mo,endAngle:ts,padAngle:Ho};return io}return jn.value=function(fn){return arguments.length?(At=typeof fn=="function"?fn:S(+fn),jn):At},jn.sortValues=function(fn){return arguments.length?(lr=fn,zr=null,jn):lr},jn.sort=function(fn){return arguments.length?(zr=fn,lr=null,jn):zr},jn.startAngle=function(fn){return arguments.length?(cn=typeof fn=="function"?fn:S(+fn),jn):cn},jn.endAngle=function(fn){return arguments.length?(Rn=typeof fn=="function"?fn:S(+fn),jn):Rn},jn.padAngle=function(fn){return arguments.length?(qn=typeof fn=="function"?fn:S(+fn),jn):qn},jn}var B=U(u);function R(At){this._curve=At}R.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(At,lr){this._curve.point(lr*Math.sin(At),lr*-Math.cos(At))}};function U(At){function lr(zr){return new R(At(zr))}return lr._curve=At,lr}function j(At){var lr=At.curve;return At.angle=At.x,delete At.x,At.radius=At.y,delete At.y,At.curve=function(zr){return arguments.length?lr(U(zr)):lr()._curve},At}function Z(){return j(I().curve(B))}function re(){var At=L().curve(B),lr=At.curve,zr=At.lineX0,cn=At.lineX1,Rn=At.lineY0,qn=At.lineY1;return At.angle=At.x,delete At.x,At.startAngle=At.x0,delete At.x0,At.endAngle=At.x1,delete At.x1,At.radius=At.y,delete At.y,At.innerRadius=At.y0,delete At.y0,At.outerRadius=At.y1,delete At.y1,At.lineStartAngle=function(){return j(zr())},delete At.lineX0,At.lineEndAngle=function(){return j(cn())},delete At.lineX1,At.lineInnerRadius=function(){return j(Rn())},delete At.lineY0,At.lineOuterRadius=function(){return j(qn())},delete At.lineY1,At.curve=function(jn){return arguments.length?lr(U(jn)):lr()._curve},At}function fe(At,lr){return[(lr=+lr)*Math.cos(At-=Math.PI/2),lr*Math.sin(At)]}var le=Array.prototype.slice;function ce(At){return At.source}function V(At){return At.target}function ee(At){var lr=ce,zr=V,cn=d,Rn=y,qn=null;function jn(){var fn,In=le.call(arguments),gi=lr.apply(this,In),Ea=zr.apply(this,In);if(qn||(qn=fn=b.path()),At(qn,+cn.apply(this,(In[0]=gi,In)),+Rn.apply(this,In),+cn.apply(this,(In[0]=Ea,In)),+Rn.apply(this,In)),fn)return qn=null,fn+""||null}return jn.source=function(fn){return arguments.length?(lr=fn,jn):lr},jn.target=function(fn){return arguments.length?(zr=fn,jn):zr},jn.x=function(fn){return arguments.length?(cn=typeof fn=="function"?fn:S(+fn),jn):cn},jn.y=function(fn){return arguments.length?(Rn=typeof fn=="function"?fn:S(+fn),jn):Rn},jn.context=function(fn){return arguments.length?(qn=fn??null,jn):qn},jn}function ne(At,lr,zr,cn,Rn){At.moveTo(lr,zr),At.bezierCurveTo(lr=(lr+cn)/2,zr,lr,Rn,cn,Rn)}function $(At,lr,zr,cn,Rn){At.moveTo(lr,zr),At.bezierCurveTo(lr,zr=(zr+Rn)/2,cn,zr,cn,Rn)}function ue(At,lr,zr,cn,Rn){var qn=fe(lr,zr),jn=fe(lr,zr=(zr+Rn)/2),fn=fe(cn,zr),In=fe(cn,Rn);At.moveTo(qn[0],qn[1]),At.bezierCurveTo(jn[0],jn[1],fn[0],fn[1],In[0],In[1])}function te(){return ee(ne)}function H(){return ee($)}function ae(){var At=ee(ue);return At.angle=At.x,delete At.x,At.radius=At.y,delete At.y,At}var ie={draw:function(At,lr){var zr=Math.sqrt(lr/s);At.moveTo(zr,0),At.arc(0,0,zr,0,c)}},de={draw:function(At,lr){var zr=Math.sqrt(lr/5)/2;At.moveTo(-3*zr,-zr),At.lineTo(-zr,-zr),At.lineTo(-zr,-3*zr),At.lineTo(zr,-3*zr),At.lineTo(zr,-zr),At.lineTo(3*zr,-zr),At.lineTo(3*zr,zr),At.lineTo(zr,zr),At.lineTo(zr,3*zr),At.lineTo(-zr,3*zr),At.lineTo(-zr,zr),At.lineTo(-3*zr,zr),At.closePath()}},Se=Math.sqrt(1/3),Le=Se*2,Fe={draw:function(At,lr){var zr=Math.sqrt(lr/Le),cn=zr*Se;At.moveTo(0,-zr),At.lineTo(cn,0),At.lineTo(0,zr),At.lineTo(-cn,0),At.closePath()}},ze=.8908130915292852,Ye=Math.sin(s/10)/Math.sin(7*s/10),st=Math.sin(c/10)*Ye,ct=-Math.cos(c/10)*Ye,at={draw:function(At,lr){var zr=Math.sqrt(lr*ze),cn=st*zr,Rn=ct*zr;At.moveTo(0,-zr),At.lineTo(cn,Rn);for(var qn=1;qn<5;++qn){var jn=c*qn/5,fn=Math.cos(jn),In=Math.sin(jn);At.lineTo(In*zr,-fn*zr),At.lineTo(fn*cn-In*Rn,In*cn+fn*Rn)}At.closePath()}},et={draw:function(At,lr){var zr=Math.sqrt(lr),cn=-zr/2;At.rect(cn,cn,zr,zr)}},Pe=Math.sqrt(3),Ae={draw:function(At,lr){var zr=-Math.sqrt(lr/(Pe*3));At.moveTo(0,zr*2),At.lineTo(-Pe*zr,-zr),At.lineTo(Pe*zr,-zr),At.closePath()}},pe=-.5,Ne=Math.sqrt(3)/2,ut=1/Math.sqrt(12),dt=(ut/2+1)*3,nt={draw:function(At,lr){var zr=Math.sqrt(lr/dt),cn=zr/2,Rn=zr*ut,qn=cn,jn=zr*ut+zr,fn=-qn,In=jn;At.moveTo(cn,Rn),At.lineTo(qn,jn),At.lineTo(fn,In),At.lineTo(pe*cn-Ne*Rn,Ne*cn+pe*Rn),At.lineTo(pe*qn-Ne*jn,Ne*qn+pe*jn),At.lineTo(pe*fn-Ne*In,Ne*fn+pe*In),At.lineTo(pe*cn+Ne*Rn,pe*Rn-Ne*cn),At.lineTo(pe*qn+Ne*jn,pe*jn-Ne*qn),At.lineTo(pe*fn+Ne*In,pe*In-Ne*fn),At.closePath()}},Ft=[ie,de,Fe,et,at,Ae,nt];function Nt(){var At=S(ie),lr=S(64),zr=null;function cn(){var Rn;if(zr||(zr=Rn=b.path()),At.apply(this,arguments).draw(zr,+lr.apply(this,arguments)),Rn)return zr=null,Rn+""||null}return cn.type=function(Rn){return arguments.length?(At=typeof Rn=="function"?Rn:S(Rn),cn):At},cn.size=function(Rn){return arguments.length?(lr=typeof Rn=="function"?Rn:S(+Rn),cn):lr},cn.context=function(Rn){return arguments.length?(zr=Rn??null,cn):zr},cn}function Qt(){}function ar(At,lr,zr){At._context.bezierCurveTo((2*At._x0+At._x1)/3,(2*At._y0+At._y1)/3,(At._x0+2*At._x1)/3,(At._y0+2*At._y1)/3,(At._x0+4*At._x1+lr)/6,(At._y0+4*At._y1+zr)/6)}function kr(At){this._context=At}kr.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:ar(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(At,lr){switch(At=+At,lr=+lr,this._point){case 0:this._point=1,this._line?this._context.lineTo(At,lr):this._context.moveTo(At,lr);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:ar(this,At,lr);break}this._x0=this._x1,this._x1=At,this._y0=this._y1,this._y1=lr}};function Er(At){return new kr(At)}function $r(At){this._context=At}$r.prototype={areaStart:Qt,areaEnd:Qt,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(At,lr){switch(At=+At,lr=+lr,this._point){case 0:this._point=1,this._x2=At,this._y2=lr;break;case 1:this._point=2,this._x3=At,this._y3=lr;break;case 2:this._point=3,this._x4=At,this._y4=lr,this._context.moveTo((this._x0+4*this._x1+At)/6,(this._y0+4*this._y1+lr)/6);break;default:ar(this,At,lr);break}this._x0=this._x1,this._x1=At,this._y0=this._y1,this._y1=lr}};function Sr(At){return new $r(At)}function Ur(At){this._context=At}Ur.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(At,lr){switch(At=+At,lr=+lr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var zr=(this._x0+4*this._x1+At)/6,cn=(this._y0+4*this._y1+lr)/6;this._line?this._context.lineTo(zr,cn):this._context.moveTo(zr,cn);break;case 3:this._point=4;default:ar(this,At,lr);break}this._x0=this._x1,this._x1=At,this._y0=this._y1,this._y1=lr}};function Mt(At){return new Ur(At)}function je(At,lr){this._basis=new kr(At),this._beta=lr}je.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var At=this._x,lr=this._y,zr=At.length-1;if(zr>0)for(var cn=At[0],Rn=lr[0],qn=At[zr]-cn,jn=lr[zr]-Rn,fn=-1,In;++fn<=zr;)In=fn/zr,this._basis.point(this._beta*At[fn]+(1-this._beta)*(cn+In*qn),this._beta*lr[fn]+(1-this._beta)*(Rn+In*jn));this._x=this._y=null,this._basis.lineEnd()},point:function(At,lr){this._x.push(+At),this._y.push(+lr)}};var Je=(function At(lr){function zr(cn){return lr===1?new kr(cn):new je(cn,lr)}return zr.beta=function(cn){return At(+cn)},zr})(.85);function ke(At,lr,zr){At._context.bezierCurveTo(At._x1+At._k*(At._x2-At._x0),At._y1+At._k*(At._y2-At._y0),At._x2+At._k*(At._x1-lr),At._y2+At._k*(At._y1-zr),At._x2,At._y2)}function xe(At,lr){this._context=At,this._k=(1-lr)/6}xe.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:ke(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(At,lr){switch(At=+At,lr=+lr,this._point){case 0:this._point=1,this._line?this._context.lineTo(At,lr):this._context.moveTo(At,lr);break;case 1:this._point=2,this._x1=At,this._y1=lr;break;case 2:this._point=3;default:ke(this,At,lr);break}this._x0=this._x1,this._x1=this._x2,this._x2=At,this._y0=this._y1,this._y1=this._y2,this._y2=lr}};var ye=(function At(lr){function zr(cn){return new xe(cn,lr)}return zr.tension=function(cn){return At(+cn)},zr})(0);function Ee(At,lr){this._context=At,this._k=(1-lr)/6}Ee.prototype={areaStart:Qt,areaEnd:Qt,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(At,lr){switch(At=+At,lr=+lr,this._point){case 0:this._point=1,this._x3=At,this._y3=lr;break;case 1:this._point=2,this._context.moveTo(this._x4=At,this._y4=lr);break;case 2:this._point=3,this._x5=At,this._y5=lr;break;default:ke(this,At,lr);break}this._x0=this._x1,this._x1=this._x2,this._x2=At,this._y0=this._y1,this._y1=this._y2,this._y2=lr}};var Xe=(function At(lr){function zr(cn){return new Ee(cn,lr)}return zr.tension=function(cn){return At(+cn)},zr})(0);function Qe(At,lr){this._context=At,this._k=(1-lr)/6}Qe.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(At,lr){switch(At=+At,lr=+lr,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:ke(this,At,lr);break}this._x0=this._x1,this._x1=this._x2,this._x2=At,this._y0=this._y1,this._y1=this._y2,this._y2=lr}};var Lt=(function At(lr){function zr(cn){return new Qe(cn,lr)}return zr.tension=function(cn){return At(+cn)},zr})(0);function Ct(At,lr,zr){var cn=At._x1,Rn=At._y1,qn=At._x2,jn=At._y2;if(At._l01_a>a){var fn=2*At._l01_2a+3*At._l01_a*At._l12_a+At._l12_2a,In=3*At._l01_a*(At._l01_a+At._l12_a);cn=(cn*fn-At._x0*At._l12_2a+At._x2*At._l01_2a)/In,Rn=(Rn*fn-At._y0*At._l12_2a+At._y2*At._l01_2a)/In}if(At._l23_a>a){var gi=2*At._l23_2a+3*At._l23_a*At._l12_a+At._l12_2a,Ea=3*At._l23_a*(At._l23_a+At._l12_a);qn=(qn*gi+At._x1*At._l23_2a-lr*At._l12_2a)/Ea,jn=(jn*gi+At._y1*At._l23_2a-zr*At._l12_2a)/Ea}At._context.bezierCurveTo(cn,Rn,qn,jn,At._x2,At._y2)}function Ot(At,lr){this._context=At,this._alpha=lr}Ot.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(At,lr){if(At=+At,lr=+lr,this._point){var zr=this._x2-At,cn=this._y2-lr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(zr*zr+cn*cn,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(At,lr):this._context.moveTo(At,lr);break;case 1:this._point=2;break;case 2:this._point=3;default:Ct(this,At,lr);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=At,this._y0=this._y1,this._y1=this._y2,this._y2=lr}};var Kt=(function At(lr){function zr(cn){return lr?new Ot(cn,lr):new xe(cn,0)}return zr.alpha=function(cn){return At(+cn)},zr})(.5);function xr(At,lr){this._context=At,this._alpha=lr}xr.prototype={areaStart:Qt,areaEnd:Qt,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(At,lr){if(At=+At,lr=+lr,this._point){var zr=this._x2-At,cn=this._y2-lr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(zr*zr+cn*cn,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=At,this._y3=lr;break;case 1:this._point=2,this._context.moveTo(this._x4=At,this._y4=lr);break;case 2:this._point=3,this._x5=At,this._y5=lr;break;default:Ct(this,At,lr);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=At,this._y0=this._y1,this._y1=this._y2,this._y2=lr}};var mr=(function At(lr){function zr(cn){return lr?new xr(cn,lr):new Ee(cn,0)}return zr.alpha=function(cn){return At(+cn)},zr})(.5);function vr(At,lr){this._context=At,this._alpha=lr}vr.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(At,lr){if(At=+At,lr=+lr,this._point){var zr=this._x2-At,cn=this._y2-lr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(zr*zr+cn*cn,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:Ct(this,At,lr);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=At,this._y0=this._y1,this._y1=this._y2,this._y2=lr}};var Nr=(function At(lr){function zr(cn){return lr?new vr(cn,lr):new Qe(cn,0)}return zr.alpha=function(cn){return At(+cn)},zr})(.5);function kn(At){this._context=At}kn.prototype={areaStart:Qt,areaEnd:Qt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(At,lr){At=+At,lr=+lr,this._point?this._context.lineTo(At,lr):(this._point=1,this._context.moveTo(At,lr))}};function $n(At){return new kn(At)}function Vn(At){return At<0?-1:1}function ra(At,lr,zr){var cn=At._x1-At._x0,Rn=lr-At._x1,qn=(At._y1-At._y0)/(cn||Rn<0&&-0),jn=(zr-At._y1)/(Rn||cn<0&&-0),fn=(qn*Rn+jn*cn)/(cn+Rn);return(Vn(qn)+Vn(jn))*Math.min(Math.abs(qn),Math.abs(jn),.5*Math.abs(fn))||0}function na(At,lr){var zr=At._x1-At._x0;return zr?(3*(At._y1-At._y0)/zr-lr)/2:lr}function Un(At,lr,zr){var cn=At._x0,Rn=At._y0,qn=At._x1,jn=At._y1,fn=(qn-cn)/3;At._context.bezierCurveTo(cn+fn,Rn+fn*lr,qn-fn,jn-fn*zr,qn,jn)}function ka(At){this._context=At}ka.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:Un(this,this._t0,na(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(At,lr){var zr=NaN;if(At=+At,lr=+lr,!(At===this._x1&&lr===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(At,lr):this._context.moveTo(At,lr);break;case 1:this._point=2;break;case 2:this._point=3,Un(this,na(this,zr=ra(this,At,lr)),zr);break;default:Un(this,this._t0,zr=ra(this,At,lr));break}this._x0=this._x1,this._x1=At,this._y0=this._y1,this._y1=lr,this._t0=zr}}};function Va(At){this._context=new sr(At)}(Va.prototype=Object.create(ka.prototype)).point=function(At,lr){ka.prototype.point.call(this,lr,At)};function sr(At){this._context=At}sr.prototype={moveTo:function(At,lr){this._context.moveTo(lr,At)},closePath:function(){this._context.closePath()},lineTo:function(At,lr){this._context.lineTo(lr,At)},bezierCurveTo:function(At,lr,zr,cn,Rn,qn){this._context.bezierCurveTo(lr,At,cn,zr,qn,Rn)}};function Vt(At){return new ka(At)}function or(At){return new Va(At)}function ur(At){this._context=At}ur.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var At=this._x,lr=this._y,zr=At.length;if(zr)if(this._line?this._context.lineTo(At[0],lr[0]):this._context.moveTo(At[0],lr[0]),zr===2)this._context.lineTo(At[1],lr[1]);else for(var cn=Gr(At),Rn=Gr(lr),qn=0,jn=1;jn=0;--lr)Rn[lr]=(jn[lr]-Rn[lr+1])/qn[lr];for(qn[zr-1]=(At[zr]+Rn[zr-1])/2,lr=0;lr=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(At,lr){switch(At=+At,lr=+lr,this._point){case 0:this._point=1,this._line?this._context.lineTo(At,lr):this._context.moveTo(At,lr);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,lr),this._context.lineTo(At,lr);else{var zr=this._x*(1-this._t)+At*this._t;this._context.lineTo(zr,this._y),this._context.lineTo(zr,lr)}break}}this._x=At,this._y=lr}};function An(At){return new gn(At,.5)}function Qn(At){return new gn(At,0)}function pa(At){return new gn(At,1)}function ha(At,lr){if((jn=At.length)>1)for(var zr=1,cn,Rn,qn=At[lr[0]],jn,fn=qn.length;zr=0;)zr[lr]=lr;return zr}function Ca(At,lr){return At[lr]}function Hn(){var At=S([]),lr=_a,zr=ha,cn=Ca;function Rn(qn){var jn=At.apply(this,arguments),fn,In=qn.length,gi=jn.length,Ea=new Array(gi),Ci;for(fn=0;fn0){for(var zr,cn,Rn=0,qn=At[0].length,jn;Rn0)for(var zr,cn=0,Rn,qn,jn,fn,In,gi=At[lr[0]].length;cn0?(Rn[0]=jn,Rn[1]=jn+=qn):qn<0?(Rn[1]=fn,Rn[0]=fn+=qn):(Rn[0]=0,Rn[1]=qn)}function Dt(At,lr){if((Rn=At.length)>0){for(var zr=0,cn=At[lr[0]],Rn,qn=cn.length;zr0)||!((qn=(Rn=At[lr[0]]).length)>0))){for(var zr=0,cn=1,Rn,qn,jn;cnqn&&(qn=Rn,zr=lr);return zr}function Vr(At){var lr=At.map(Dr);return _a(At).sort(function(zr,cn){return lr[zr]-lr[cn]})}function Dr(At){for(var lr=0,zr=-1,cn=At.length,Rn;++zr0;--ue)ae($*=.99),ie(),H($),ie();function te(){var de=b.max(ne,function(Fe){return Fe.length}),Se=j*(I-d)/(de-1);z>Se&&(z=Se);var Le=b.min(ne,function(Fe){return(I-d-(Fe.length-1)*z)/b.sum(Fe,c)});ne.forEach(function(Fe){Fe.forEach(function(ze,Ye){ze.y1=(ze.y0=Ye)+ze.value*Le})}),ee.links.forEach(function(Fe){Fe.width=Fe.value*Le})}function H(de){ne.forEach(function(Se){Se.forEach(function(Le){if(Le.targetLinks.length){var Fe=(b.sum(Le.targetLinks,v)/b.sum(Le.targetLinks,c)-p(Le))*de;Le.y0+=Fe,Le.y1+=Fe}})})}function ae(de){ne.slice().reverse().forEach(function(Se){Se.forEach(function(Le){if(Le.sourceLinks.length){var Fe=(b.sum(Le.sourceLinks,T)/b.sum(Le.sourceLinks,c)-p(Le))*de;Le.y0+=Fe,Le.y1+=Fe}})})}function ie(){ne.forEach(function(de){var Se,Le,Fe=d,ze=de.length,Ye;for(de.sort(f),Ye=0;Ye0&&(Se.y0+=Le,Se.y1+=Le),Fe=Se.y1+z;if(Le=Fe-z-I,Le>0)for(Fe=Se.y0-=Le,Se.y1-=Le,Ye=ze-2;Ye>=0;--Ye)Se=de[Ye],Le=Se.y1+z-Fe,Le>0&&(Se.y0-=Le,Se.y1-=Le),Fe=Se.y0})}}function V(ee){ee.nodes.forEach(function(ne){ne.sourceLinks.sort(s),ne.targetLinks.sort(a)}),ee.nodes.forEach(function(ne){var $=ne.y0,ue=$;ne.sourceLinks.forEach(function(te){te.y0=$+te.width/2,$+=te.width}),ne.targetLinks.forEach(function(te){te.y1=ue+te.width/2,ue+=te.width})})}return Z};function _(u){return[u.source.x1,u.y0]}function w(u){return[u.target.x0,u.y1]}var m=function(){return E.linkHorizontal().source(_).target(w)};h.sankey=M,h.sankeyCenter=n,h.sankeyLeft=t,h.sankeyRight=r,h.sankeyJustify=o,h.sankeyLinkHorizontal=m,Object.defineProperty(h,"__esModule",{value:!0})})}}),t9=Ge({"node_modules/elementary-circuits-directed-graph/johnson.js"(K,G){var h=zL();G.exports=function(S,E){var e=[],t=[],r=[],o={},n=[],i;function a(A){r[A]=!1,o.hasOwnProperty(A)&&Object.keys(o[A]).forEach(function(M){delete o[A][M],r[M]&&a(M)})}function s(A){var M=!1;t.push(A),r[A]=!0;var _,w;for(_=0;_=A})}function p(A){c(A);for(var M=S,_=h(M),w=_.components.filter(function(z){return z.length>1}),m=1/0,u,d=0;d"u"?"undefined":s(xe))!=="object"&&(xe=Je.source=_(je,xe)),(typeof ye>"u"?"undefined":s(ye))!=="object"&&(ye=Je.target=_(je,ye)),xe.sourceLinks.push(Je),ye.targetLinks.push(Je)}),Mt}function ar(Mt){Mt.nodes.forEach(function(je){je.partOfCycle=!1,je.value=Math.max(b.sum(je.sourceLinks,v),b.sum(je.targetLinks,v)),je.sourceLinks.forEach(function(Je){Je.circular&&(je.partOfCycle=!0,je.circularLinkType=Je.circularLinkType)}),je.targetLinks.forEach(function(Je){Je.circular&&(je.partOfCycle=!0,je.circularLinkType=Je.circularLinkType)})})}function kr(Mt){var je=0,Je=0,ke=0,xe=0,ye=b.max(Mt.nodes,function(Ee){return Ee.column});return Mt.links.forEach(function(Ee){Ee.circular&&(Ee.circularLinkType=="top"?je=je+Ee.width:Je=Je+Ee.width,Ee.target.column==0&&(xe=xe+Ee.width),Ee.source.column==ye&&(ke=ke+Ee.width))}),je=je>0?je+m+u:je,Je=Je>0?Je+m+u:Je,ke=ke>0?ke+m+u:ke,xe=xe>0?xe+m+u:xe,{top:je,bottom:Je,left:xe,right:ke}}function Er(Mt,je){var Je=b.max(Mt.nodes,function(Lt){return Lt.column}),ke=st-ze,xe=ct-Ye,ye=ke+je.right+je.left,Ee=xe+je.top+je.bottom,Xe=ke/ye,Qe=xe/Ee;return ze=ze*Xe+je.left,st=je.right==0?st:st*Xe,Ye=Ye*Qe+je.top,ct=ct*Qe,Mt.nodes.forEach(function(Lt){Lt.x0=ze+Lt.column*((st-ze-at)/Je),Lt.x1=Lt.x0+at}),Qe}function $r(Mt){var je,Je,ke;for(je=Mt.nodes,Je=[],ke=0;je.length;++ke,je=Je,Je=[])je.forEach(function(xe){xe.depth=ke,xe.sourceLinks.forEach(function(ye){Je.indexOf(ye.target)<0&&!ye.circular&&Je.push(ye.target)})});for(je=Mt.nodes,Je=[],ke=0;je.length;++ke,je=Je,Je=[])je.forEach(function(xe){xe.height=ke,xe.targetLinks.forEach(function(ye){Je.indexOf(ye.source)<0&&!ye.circular&&Je.push(ye.source)})});Mt.nodes.forEach(function(xe){xe.column=Math.floor(Ae.call(null,xe,ke))})}function Sr(Mt,je,Je){var ke=S.nest().key(function(Lt){return Lt.column}).sortKeys(b.ascending).entries(Mt.nodes).map(function(Lt){return Lt.values});Ee(Je),Qe();for(var xe=1,ye=je;ye>0;--ye)Xe(xe*=.99,Je),Qe();function Ee(Lt){if(nt){var Ct=1/0;ke.forEach(function(mr){var vr=ct*nt/(mr.length+1);Ct=vr0))if(mr==0&&xr==1)Nr=vr.y1-vr.y0,vr.y0=ct/2-Nr/2,vr.y1=ct/2+Nr/2;else if(mr==Ot-1&&xr==1)Nr=vr.y1-vr.y0,vr.y0=ct/2-Nr/2,vr.y1=ct/2+Nr/2;else{var kn=0,$n=b.mean(vr.sourceLinks,g),Vn=b.mean(vr.targetLinks,l);$n&&Vn?kn=($n+Vn)/2:kn=$n||Vn;var ra=(kn-T(vr))*Lt;vr.y0+=ra,vr.y1+=ra}})})}function Qe(){ke.forEach(function(Lt){var Ct,Ot,Kt=Ye,xr=Lt.length,mr;for(Lt.sort(p),mr=0;mr0&&(Ct.y0+=Ot,Ct.y1+=Ot),Kt=Ct.y1+et;if(Ot=Kt-et-ct,Ot>0)for(Kt=Ct.y0-=Ot,Ct.y1-=Ot,mr=xr-2;mr>=0;--mr)Ct=Lt[mr],Ot=Ct.y1+et-Kt,Ot>0&&(Ct.y0-=Ot,Ct.y1-=Ot),Kt=Ct.y0})}}function Ur(Mt){Mt.nodes.forEach(function(je){je.sourceLinks.sort(c),je.targetLinks.sort(f)}),Mt.nodes.forEach(function(je){var Je=je.y0,ke=Je,xe=je.y1,ye=xe;je.sourceLinks.forEach(function(Ee){Ee.circular?(Ee.y0=xe-Ee.width/2,xe=xe-Ee.width):(Ee.y0=Je+Ee.width/2,Je+=Ee.width)}),je.targetLinks.forEach(function(Ee){Ee.circular?(Ee.y1=ye-Ee.width/2,ye=ye-Ee.width):(Ee.y1=ke+Ee.width/2,ke+=Ee.width)})})}return Nt}function I(ze,Ye,st){var ct=0;if(st===null){for(var at=[],et=0;etYe.source.column)}function N(ze,Ye){var st=0;ze.sourceLinks.forEach(function(at){st=at.circular&&!Le(at,Ye)?st+1:st});var ct=0;return ze.targetLinks.forEach(function(at){ct=at.circular&&!Le(at,Ye)?ct+1:ct}),st+ct}function B(ze){var Ye=ze.source.sourceLinks,st=0;Ye.forEach(function(et){st=et.circular?st+1:st});var ct=ze.target.targetLinks,at=0;return ct.forEach(function(et){at=et.circular?at+1:at}),!(st>1||at>1)}function R(ze,Ye,st){return ze.sort(Z),ze.forEach(function(ct,at){var et=0;if(Le(ct,st)&&B(ct))ct.circularPathData.verticalBuffer=et+ct.width/2;else{var Pe=0;for(Pe;Peet?Ae:et}ct.circularPathData.verticalBuffer=et+ct.width/2}}),ze}function U(ze,Ye,st,ct){var at=5,et=b.min(ze.links,function(pe){return pe.source.y0});ze.links.forEach(function(pe){pe.circular&&(pe.circularPathData={})});var Pe=ze.links.filter(function(pe){return pe.circularLinkType=="top"});R(Pe,Ye,ct);var Ae=ze.links.filter(function(pe){return pe.circularLinkType=="bottom"});R(Ae,Ye,ct),ze.links.forEach(function(pe){if(pe.circular){if(pe.circularPathData.arcRadius=pe.width+u,pe.circularPathData.leftNodeBuffer=at,pe.circularPathData.rightNodeBuffer=at,pe.circularPathData.sourceWidth=pe.source.x1-pe.source.x0,pe.circularPathData.sourceX=pe.source.x0+pe.circularPathData.sourceWidth,pe.circularPathData.targetX=pe.target.x0,pe.circularPathData.sourceY=pe.y0,pe.circularPathData.targetY=pe.y1,Le(pe,ct)&&B(pe))pe.circularPathData.leftSmallArcRadius=u+pe.width/2,pe.circularPathData.leftLargeArcRadius=u+pe.width/2,pe.circularPathData.rightSmallArcRadius=u+pe.width/2,pe.circularPathData.rightLargeArcRadius=u+pe.width/2,pe.circularLinkType=="bottom"?(pe.circularPathData.verticalFullExtent=pe.source.y1+m+pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.rightLargeArcRadius):(pe.circularPathData.verticalFullExtent=pe.source.y0-m-pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.rightLargeArcRadius);else{var Ne=pe.source.column,ut=pe.circularLinkType,dt=ze.links.filter(function(Nt){return Nt.source.column==Ne&&Nt.circularLinkType==ut});pe.circularLinkType=="bottom"?dt.sort(fe):dt.sort(re);var nt=0;dt.forEach(function(Nt,Qt){Nt.circularLinkID==pe.circularLinkID&&(pe.circularPathData.leftSmallArcRadius=u+pe.width/2+nt,pe.circularPathData.leftLargeArcRadius=u+pe.width/2+Qt*Ye+nt),nt=nt+Nt.width}),Ne=pe.target.column,dt=ze.links.filter(function(Nt){return Nt.target.column==Ne&&Nt.circularLinkType==ut}),pe.circularLinkType=="bottom"?dt.sort(ce):dt.sort(le),nt=0,dt.forEach(function(Nt,Qt){Nt.circularLinkID==pe.circularLinkID&&(pe.circularPathData.rightSmallArcRadius=u+pe.width/2+nt,pe.circularPathData.rightLargeArcRadius=u+pe.width/2+Qt*Ye+nt),nt=nt+Nt.width}),pe.circularLinkType=="bottom"?(pe.circularPathData.verticalFullExtent=Math.max(st,pe.source.y1,pe.target.y1)+m+pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent-pe.circularPathData.rightLargeArcRadius):(pe.circularPathData.verticalFullExtent=et-m-pe.circularPathData.verticalBuffer,pe.circularPathData.verticalLeftInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.leftLargeArcRadius,pe.circularPathData.verticalRightInnerExtent=pe.circularPathData.verticalFullExtent+pe.circularPathData.rightLargeArcRadius)}pe.circularPathData.leftInnerExtent=pe.circularPathData.sourceX+pe.circularPathData.leftNodeBuffer,pe.circularPathData.rightInnerExtent=pe.circularPathData.targetX-pe.circularPathData.rightNodeBuffer,pe.circularPathData.leftFullExtent=pe.circularPathData.sourceX+pe.circularPathData.leftLargeArcRadius+pe.circularPathData.leftNodeBuffer,pe.circularPathData.rightFullExtent=pe.circularPathData.targetX-pe.circularPathData.rightLargeArcRadius-pe.circularPathData.rightNodeBuffer}if(pe.circular)pe.path=j(pe);else{var Ft=E.linkHorizontal().source(function(Nt){var Qt=Nt.source.x0+(Nt.source.x1-Nt.source.x0),ar=Nt.y0;return[Qt,ar]}).target(function(Nt){var Qt=Nt.target.x0,ar=Nt.y1;return[Qt,ar]});pe.path=Ft(pe)}})}function j(ze){var Ye="";return ze.circularLinkType=="top"?Ye="M"+ze.circularPathData.sourceX+" "+ze.circularPathData.sourceY+" L"+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.sourceY+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftSmallArcRadius+" 0 0 0 "+ze.circularPathData.leftFullExtent+" "+(ze.circularPathData.sourceY-ze.circularPathData.leftSmallArcRadius)+" L"+ze.circularPathData.leftFullExtent+" "+ze.circularPathData.verticalLeftInnerExtent+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftLargeArcRadius+" 0 0 0 "+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.verticalFullExtent+" L"+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.verticalFullExtent+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightLargeArcRadius+" 0 0 0 "+ze.circularPathData.rightFullExtent+" "+ze.circularPathData.verticalRightInnerExtent+" L"+ze.circularPathData.rightFullExtent+" "+(ze.circularPathData.targetY-ze.circularPathData.rightSmallArcRadius)+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightSmallArcRadius+" 0 0 0 "+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.targetY+" L"+ze.circularPathData.targetX+" "+ze.circularPathData.targetY:Ye="M"+ze.circularPathData.sourceX+" "+ze.circularPathData.sourceY+" L"+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.sourceY+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftSmallArcRadius+" 0 0 1 "+ze.circularPathData.leftFullExtent+" "+(ze.circularPathData.sourceY+ze.circularPathData.leftSmallArcRadius)+" L"+ze.circularPathData.leftFullExtent+" "+ze.circularPathData.verticalLeftInnerExtent+" A"+ze.circularPathData.leftLargeArcRadius+" "+ze.circularPathData.leftLargeArcRadius+" 0 0 1 "+ze.circularPathData.leftInnerExtent+" "+ze.circularPathData.verticalFullExtent+" L"+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.verticalFullExtent+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightLargeArcRadius+" 0 0 1 "+ze.circularPathData.rightFullExtent+" "+ze.circularPathData.verticalRightInnerExtent+" L"+ze.circularPathData.rightFullExtent+" "+(ze.circularPathData.targetY+ze.circularPathData.rightSmallArcRadius)+" A"+ze.circularPathData.rightLargeArcRadius+" "+ze.circularPathData.rightSmallArcRadius+" 0 0 1 "+ze.circularPathData.rightInnerExtent+" "+ze.circularPathData.targetY+" L"+ze.circularPathData.targetX+" "+ze.circularPathData.targetY,Ye}function Z(ze,Ye){return V(ze)==V(Ye)?ze.circularLinkType=="bottom"?fe(ze,Ye):re(ze,Ye):V(Ye)-V(ze)}function re(ze,Ye){return ze.y0-Ye.y0}function fe(ze,Ye){return Ye.y0-ze.y0}function le(ze,Ye){return ze.y1-Ye.y1}function ce(ze,Ye){return Ye.y1-ze.y1}function V(ze){return ze.target.column-ze.source.column}function ee(ze){return ze.target.x0-ze.source.x1}function ne(ze,Ye){var st=z(ze),ct=ee(Ye)/Math.tan(st),at=Se(ze)=="up"?ze.y1+ct:ze.y1-ct;return at}function $(ze,Ye){var st=z(ze),ct=ee(Ye)/Math.tan(st),at=Se(ze)=="up"?ze.y1-ct:ze.y1+ct;return at}function ue(ze,Ye,st,ct){ze.links.forEach(function(at){if(!at.circular&&at.target.column-at.source.column>1){var et=at.source.column+1,Pe=at.target.column-1,Ae=1,pe=Pe-et+1;for(Ae=1;et<=Pe;et++,Ae++)ze.nodes.forEach(function(Ne){if(Ne.column==et){var ut=Ae/(pe+1),dt=Math.pow(1-ut,3),nt=3*ut*Math.pow(1-ut,2),Ft=3*Math.pow(ut,2)*(1-ut),Nt=Math.pow(ut,3),Qt=dt*at.y0+nt*at.y0+Ft*at.y1+Nt*at.y1,ar=Qt-at.width/2,kr=Qt+at.width/2,Er;ar>Ne.y0&&arNe.y0&&krNe.y1&&H($r,Er,Ye,st)})):arNe.y1&&(Er=kr-Ne.y0+10,Ne=H(Ne,Er,Ye,st),ze.nodes.forEach(function($r){w($r,ct)==w(Ne,ct)||$r.column!=Ne.column||$r.y0Ne.y1&&H($r,Er,Ye,st)}))}})}})}function te(ze,Ye){return ze.y0>Ye.y0&&ze.y0Ye.y0&&ze.y1Ye.y1}function H(ze,Ye,st,ct){return ze.y0+Ye>=st&&ze.y1+Ye<=ct&&(ze.y0=ze.y0+Ye,ze.y1=ze.y1+Ye,ze.targetLinks.forEach(function(at){at.y1=at.y1+Ye}),ze.sourceLinks.forEach(function(at){at.y0=at.y0+Ye})),ze}function ae(ze,Ye,st,ct){ze.nodes.forEach(function(at){ct&&at.y+(at.y1-at.y0)>Ye&&(at.y=at.y-(at.y+(at.y1-at.y0)-Ye));var et=ze.links.filter(function(pe){return w(pe.source,st)==w(at,st)}),Pe=et.length;Pe>1&&et.sort(function(pe,Ne){if(!pe.circular&&!Ne.circular){if(pe.target.column==Ne.target.column)return pe.y1-Ne.y1;if(de(pe,Ne)){if(pe.target.column>Ne.target.column){var ut=$(Ne,pe);return pe.y1-ut}if(Ne.target.column>pe.target.column){var dt=$(pe,Ne);return dt-Ne.y1}}else return pe.y1-Ne.y1}if(pe.circular&&!Ne.circular)return pe.circularLinkType=="top"?-1:1;if(Ne.circular&&!pe.circular)return Ne.circularLinkType=="top"?1:-1;if(pe.circular&&Ne.circular)return pe.circularLinkType===Ne.circularLinkType&&pe.circularLinkType=="top"?pe.target.column===Ne.target.column?pe.target.y1-Ne.target.y1:Ne.target.column-pe.target.column:pe.circularLinkType===Ne.circularLinkType&&pe.circularLinkType=="bottom"?pe.target.column===Ne.target.column?Ne.target.y1-pe.target.y1:pe.target.column-Ne.target.column:pe.circularLinkType=="top"?-1:1});var Ae=at.y0;et.forEach(function(pe){pe.y0=Ae+pe.width/2,Ae=Ae+pe.width}),et.forEach(function(pe,Ne){if(pe.circularLinkType=="bottom"){var ut=Ne+1,dt=0;for(ut;ut1&&at.sort(function(Ae,pe){if(!Ae.circular&&!pe.circular){if(Ae.source.column==pe.source.column)return Ae.y0-pe.y0;if(de(Ae,pe)){if(pe.source.column0?"up":"down"}function Le(ze,Ye){return w(ze.source,Ye)==w(ze.target,Ye)}function Fe(ze,Ye,st){var ct=ze.nodes,at=ze.links,et=!1,Pe=!1;if(at.forEach(function(nt){nt.circularLinkType=="top"?et=!0:nt.circularLinkType=="bottom"&&(Pe=!0)}),et==!1||Pe==!1){var Ae=b.min(ct,function(nt){return nt.y0}),pe=b.max(ct,function(nt){return nt.y1}),Ne=pe-Ae,ut=st-Ye,dt=ut/Ne;ct.forEach(function(nt){var Ft=(nt.y1-nt.y0)*dt;nt.y0=(nt.y0-Ae)*dt,nt.y1=nt.y0+Ft}),at.forEach(function(nt){nt.y0=(nt.y0-Ae)*dt,nt.y1=(nt.y1-Ae)*dt,nt.width=nt.width*dt})}}h.sankeyCircular=y,h.sankeyCenter=i,h.sankeyLeft=r,h.sankeyRight=o,h.sankeyJustify=n,Object.defineProperty(h,"__esModule",{value:!0})})}}),FL=Ge({"src/traces/sankey/constants.js"(K,G){G.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}}),n9=Ge({"src/traces/sankey/render.js"(K,G){var h=J7(),b=(ao(),di(xi)).interpolateNumber,S=ki(),E=e9(),e=r9(),t=FL(),r=Rs(),o=go(),n=As(),i=_n(),a=i.strTranslate,s=i.strRotate,f=Fg(),c=f.keyFun,p=f.repeat,v=f.unwrap,T=nc(),l=Ro(),g=ad(),x=g.CAP_SHIFT,A=g.LINE_SPACING,M=3;function _(ne,$,ue){var te=v($),H=te.trace,ae=H.domain,ie=H.orientation==="h",de=H.node.pad,Se=H.node.thickness,Le={justify:E.sankeyJustify,left:E.sankeyLeft,right:E.sankeyRight,center:E.sankeyCenter}[H.node.align],Fe=ne.width*(ae.x[1]-ae.x[0]),ze=ne.height*(ae.y[1]-ae.y[0]),Ye=te._nodes,st=te._links,ct=te.circular,at;ct?at=e.sankeyCircular().circularLinkGap(0):at=E.sankey(),at.iterations(t.sankeyIterations).size(ie?[Fe,ze]:[ze,Fe]).nodeWidth(Se).nodePadding(de).nodeId(function($r){return $r.pointNumber}).nodeAlign(Le).nodes(Ye).links(st);var et=at();at.nodePadding()=je||(Mt=je-Ur.y0,Mt>1e-6&&(Ur.y0+=Mt,Ur.y1+=Mt)),je=Ur.y1+de})}function Qt($r){var Sr=$r.map(function(ye,Ee){return{x0:ye.x0,index:Ee}}).sort(function(ye,Ee){return ye.x0-Ee.x0}),Ur=[],Mt=-1,je,Je=-1/0,ke;for(Pe=0;PeJe+Se&&(Mt+=1,je=xe.x0),Je=xe.x0,Ur[Mt]||(Ur[Mt]=[]),Ur[Mt].push(xe),ke=je-xe.x0,xe.x0+=ke,xe.x1+=ke}return Ur}if(H.node.x.length&&H.node.y.length){for(Pe=0;Pe0?" L "+H.targetX+" "+H.targetY:"")+"Z"):(ue="M "+(H.targetX-$)+" "+(H.targetY-te)+" L "+(H.rightInnerExtent-$)+" "+(H.targetY-te)+" A "+(H.rightLargeArcRadius+te)+" "+(H.rightSmallArcRadius+te)+" 0 0 0 "+(H.rightFullExtent-te-$)+" "+(H.targetY+H.rightSmallArcRadius)+" L "+(H.rightFullExtent-te-$)+" "+H.verticalRightInnerExtent,ae&&ie?ue+=" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.rightInnerExtent-te-$)+" "+(H.verticalFullExtent+te)+" L "+(H.rightFullExtent+te-$-(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent+te)+" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.leftFullExtent+te)+" "+H.verticalLeftInnerExtent:ae?ue+=" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.rightFullExtent-$-te-(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" L "+(H.leftFullExtent+te+(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.leftFullExtent+te)+" "+H.verticalLeftInnerExtent:ue+=" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.rightInnerExtent-$)+" "+(H.verticalFullExtent+te)+" L "+H.leftInnerExtent+" "+(H.verticalFullExtent+te)+" A "+(H.leftLargeArcRadius+te)+" "+(H.leftLargeArcRadius+te)+" 0 0 0 "+(H.leftFullExtent+te)+" "+H.verticalLeftInnerExtent,ue+=" L "+(H.leftFullExtent+te)+" "+(H.sourceY+H.leftSmallArcRadius)+" A "+(H.leftLargeArcRadius+te)+" "+(H.leftSmallArcRadius+te)+" 0 0 0 "+H.leftInnerExtent+" "+(H.sourceY-te)+" L "+H.sourceX+" "+(H.sourceY-te)+" L "+H.sourceX+" "+(H.sourceY+te)+" L "+H.leftInnerExtent+" "+(H.sourceY+te)+" A "+(H.leftLargeArcRadius-te)+" "+(H.leftSmallArcRadius-te)+" 0 0 1 "+(H.leftFullExtent-te)+" "+(H.sourceY+H.leftSmallArcRadius)+" L "+(H.leftFullExtent-te)+" "+H.verticalLeftInnerExtent,ae&&ie?ue+=" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.leftFullExtent-te-(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" L "+(H.rightFullExtent+te-$+(H.rightLargeArcRadius-te))+" "+(H.verticalFullExtent-te)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.rightFullExtent+te-$)+" "+H.verticalRightInnerExtent:ae?ue+=" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.leftFullExtent+te)+" "+(H.verticalFullExtent+te)+" L "+(H.rightFullExtent-$-te)+" "+(H.verticalFullExtent+te)+" A "+(H.rightLargeArcRadius+te)+" "+(H.rightLargeArcRadius+te)+" 0 0 0 "+(H.rightFullExtent+te-$)+" "+H.verticalRightInnerExtent:ue+=" A "+(H.leftLargeArcRadius-te)+" "+(H.leftLargeArcRadius-te)+" 0 0 1 "+H.leftInnerExtent+" "+(H.verticalFullExtent-te)+" L "+(H.rightInnerExtent-$)+" "+(H.verticalFullExtent-te)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightLargeArcRadius-te)+" 0 0 1 "+(H.rightFullExtent+te-$)+" "+H.verticalRightInnerExtent,ue+=" L "+(H.rightFullExtent+te-$)+" "+(H.targetY+H.rightSmallArcRadius)+" A "+(H.rightLargeArcRadius-te)+" "+(H.rightSmallArcRadius-te)+" 0 0 1 "+(H.rightInnerExtent-$)+" "+(H.targetY+te)+" L "+(H.targetX-$)+" "+(H.targetY+te)+($>0?" L "+H.targetX+" "+H.targetY:"")+"Z"),ue}function u(){var ne=.5;function $(ue){var te=ue.linkArrowLength;if(ue.link.circular)return m(ue.link,te);var H=Math.abs((ue.link.target.x0-ue.link.source.x1)/2);te>H&&(te=H);var ae=ue.link.source.x1,ie=ue.link.target.x0-te,de=b(ae,ie),Se=de(ne),Le=de(1-ne),Fe=ue.link.y0-ue.link.width/2,ze=ue.link.y0+ue.link.width/2,Ye=ue.link.y1-ue.link.width/2,st=ue.link.y1+ue.link.width/2,ct="M"+ae+","+Fe,at="C"+Se+","+Fe+" "+Le+","+Ye+" "+ie+","+Ye,et="C"+Le+","+st+" "+Se+","+ze+" "+ae+","+ze,Pe=te>0?"L"+(ie+te)+","+(Ye+ue.link.width/2):"";return Pe+="L"+ie+","+st,ct+at+Pe+et+"Z"}return $}function d(ne,$){var ue=r($.color),te=t.nodePadAcross,H=ne.nodePad/2;$.dx=$.x1-$.x0,$.dy=$.y1-$.y0;var ae=$.dx,ie=Math.max(.5,$.dy),de="node_"+$.pointNumber;return $.group&&(de=i.randstr()),$.trace=ne.trace,$.curveNumber=ne.trace.index,{index:$.pointNumber,key:de,partOfGroup:$.partOfGroup||!1,group:$.group,traceId:ne.key,trace:ne.trace,node:$,nodePad:ne.nodePad,nodeLineColor:ne.nodeLineColor,nodeLineWidth:ne.nodeLineWidth,textFont:ne.textFont,size:ne.horizontal?ne.height:ne.width,visibleWidth:Math.ceil(ae),visibleHeight:ie,zoneX:-te,zoneY:-H,zoneWidth:ae+2*te,zoneHeight:ie+2*H,labelY:ne.horizontal?$.dy/2+1:$.dx/2+1,left:$.originalLayer===1,sizeAcross:ne.width,forceLayouts:ne.forceLayouts,horizontal:ne.horizontal,darkBackground:ue.getBrightness()<=128,tinyColorHue:o.tinyRGB(ue),tinyColorAlpha:ue.getAlpha(),valueFormat:ne.valueFormat,valueSuffix:ne.valueSuffix,sankey:ne.sankey,graph:ne.graph,arrangement:ne.arrangement,uniqueNodeLabelPathId:[ne.guid,ne.key,de].join("_"),interactionState:ne.interactionState,figure:ne}}function y(ne){ne.attr("transform",function($){return a($.node.x0.toFixed(3),$.node.y0.toFixed(3))})}function I(ne){ne.call(y)}function L(ne,$){ne.call(I),$.attr("d",u())}function z(ne){ne.attr("width",function($){return $.node.x1-$.node.x0}).attr("height",function($){return $.visibleHeight})}function F(ne){return ne.link.width>1||ne.linkLineWidth>0}function N(ne){var $=a(ne.translateX,ne.translateY);return $+(ne.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function B(ne,$,ue){ne.on(".basic",null).on("mouseover.basic",function(te){!te.interactionState.dragInProgress&&!te.partOfGroup&&(ue.hover(this,te,$),te.interactionState.hovered=[this,te])}).on("mousemove.basic",function(te){!te.interactionState.dragInProgress&&!te.partOfGroup&&(ue.follow(this,te),te.interactionState.hovered=[this,te])}).on("mouseout.basic",function(te){!te.interactionState.dragInProgress&&!te.partOfGroup&&(ue.unhover(this,te,$),te.interactionState.hovered=!1)}).on("click.basic",function(te){te.interactionState.hovered&&(ue.unhover(this,te,$),te.interactionState.hovered=!1),!te.interactionState.dragInProgress&&!te.partOfGroup&&ue.select(this,te,$)})}function R(ne,$,ue,te){var H=S.behavior.drag().origin(function(ae){return{x:ae.node.x0+ae.visibleWidth/2,y:ae.node.y0+ae.visibleHeight/2}}).on("dragstart",function(ae){if(ae.arrangement!=="fixed"&&(i.ensureSingle(te._fullLayout._infolayer,"g","dragcover",function(de){te._fullLayout._dragCover=de}),i.raiseToTop(this),ae.interactionState.dragInProgress=ae.node,le(ae.node),ae.interactionState.hovered&&(ue.nodeEvents.unhover.apply(0,ae.interactionState.hovered),ae.interactionState.hovered=!1),ae.arrangement==="snap")){var ie=ae.traceId+"|"+ae.key;ae.forceLayouts[ie]?ae.forceLayouts[ie].alpha(1):U(ne,ie,ae),j(ne,$,ae,ie,te)}}).on("drag",function(ae){if(ae.arrangement!=="fixed"){var ie=S.event.x,de=S.event.y;ae.arrangement==="snap"?(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2,ae.node.y0=de-ae.visibleHeight/2,ae.node.y1=de+ae.visibleHeight/2):(ae.arrangement==="freeform"&&(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2),de=Math.max(0,Math.min(ae.size-ae.visibleHeight/2,de)),ae.node.y0=de-ae.visibleHeight/2,ae.node.y1=de+ae.visibleHeight/2),le(ae.node),ae.arrangement!=="snap"&&(ae.sankey.update(ae.graph),L(ne.filter(ce(ae)),$))}}).on("dragend",function(ae){if(ae.arrangement!=="fixed"){ae.interactionState.dragInProgress=!1;for(var ie=0;ie0)window.requestAnimationFrame(ae);else{var Se=ue.node.originalX;ue.node.x0=Se-ue.visibleWidth/2,ue.node.x1=Se+ue.visibleWidth/2,re(ue,H)}})}function Z(ne,$,ue,te){return function(){for(var ae=0,ie=0;ie0&&te.forceLayouts[$].alpha(0)}}function re(ne,$){for(var ue=[],te=[],H=0;H"),color:g(V,"bgcolor")||t.addOpacity(te.color,1),borderColor:g(V,"bordercolor"),fontFamily:g(V,"font.family"),fontSize:g(V,"font.size"),fontColor:g(V,"font.color"),fontWeight:g(V,"font.weight"),fontStyle:g(V,"font.style"),fontVariant:g(V,"font.variant"),fontTextcase:g(V,"font.textcase"),fontLineposition:g(V,"font.lineposition"),fontShadow:g(V,"font.shadow"),nameLength:g(V,"namelength"),textAlign:g(V,"align"),idealAlign:h.event.x"),color:g(V,"bgcolor")||ce.tinyColorHue,borderColor:g(V,"bordercolor"),fontFamily:g(V,"font.family"),fontSize:g(V,"font.size"),fontColor:g(V,"font.color"),fontWeight:g(V,"font.weight"),fontStyle:g(V,"font.style"),fontVariant:g(V,"font.variant"),fontTextcase:g(V,"font.textcase"),fontLineposition:g(V,"font.lineposition"),fontShadow:g(V,"font.shadow"),nameLength:g(V,"namelength"),textAlign:g(V,"align"),idealAlign:"left",hovertemplate:V.hovertemplate,hovertemplateLabels:ae,eventData:[ce.node]},{container:_._hoverlayer.node(),outerContainer:_._paper.node(),gd:A});a(Se,.85),s(Se)}}},fe=function(le,ce,V){A._fullLayout.hovermode!==!1&&(h.select(le).call(v,ce,V),ce.node.trace.node.hoverinfo!=="skip"&&(ce.node.fullData=ce.node.trace,A.emit("plotly_unhover",{event:h.event,points:[ce.node]})),e.loneUnhover(_._hoverlayer.node()))};E(A,w,M,{width:m.w,height:m.h,margin:{t:m.t,r:m.r,b:m.b,l:m.l}},{linkEvents:{hover:I,follow:R,unhover:U,select:y},nodeEvents:{hover:Z,follow:re,unhover:fe,select:j}})}}}),a9=Ge({"src/traces/sankey/base_plot.js"(K){var G=Hc().overrideAll,h=Bd().getModuleCalcData,b=BL(),S=cc(),E=Up(),e=uv(),t=Qf().prepSelect,r=_n(),o=Ro(),n="sankey";K.name=n,K.baseLayoutAttrOverrides=G({hoverlabel:S.hoverlabel},"plot","nested"),K.plot=function(a){var s=h(a.calcdata,n)[0];b(a,s),K.updateFx(a)},K.clean=function(a,s,f,c){var p=c._has&&c._has(n),v=s._has&&s._has(n);p&&!v&&(c._paperdiv.selectAll(".sankey").remove(),c._paperdiv.selectAll(".bgsankey").remove())},K.updateFx=function(a){for(var s=0;s0}G.exports=function(F,N,B,R){var U=F._fullLayout,j;x(B)&&R&&(j=R()),E.makeTraceGroups(U._indicatorlayer,N,"trace").each(function(Z){var re=Z[0],fe=re.trace,le=h.select(this),ce=fe._hasGauge,V=fe._isAngular,ee=fe._isBullet,ne=fe.domain,$={w:U._size.w*(ne.x[1]-ne.x[0]),h:U._size.h*(ne.y[1]-ne.y[0]),l:U._size.l+U._size.w*ne.x[0],r:U._size.r+U._size.w*(1-ne.x[1]),t:U._size.t+U._size.h*(1-ne.y[1]),b:U._size.b+U._size.h*ne.y[0]},ue=$.l+$.w/2,te=$.t+$.h/2,H=Math.min($.w/2,$.h),ae=i.innerRadius*H,ie,de,Se,Le=fe.align||"center";if(de=te,!ce)ie=$.l+l[Le]*$.w,Se=function(pe){return d(pe,$.w,$.h)};else if(V&&(ie=ue,de=te+H/2,Se=function(pe){return y(pe,.9*ae)}),ee){var Fe=i.bulletPadding,ze=1-i.bulletNumberDomainSize+Fe;ie=$.l+(ze+(1-ze)*l[Le])*$.w,Se=function(pe){return d(pe,(i.bulletNumberDomainSize-Fe)*$.w,$.h)}}_(F,le,Z,{numbersX:ie,numbersY:de,numbersScaler:Se,transitionOpts:B,onComplete:j});var Ye,st;ce&&(Ye={range:fe.gauge.axis.range,color:fe.gauge.bgcolor,line:{color:fe.gauge.bordercolor,width:0},thickness:1},st={range:fe.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:fe.gauge.bordercolor,width:fe.gauge.borderwidth},thickness:1});var ct=le.selectAll("g.angular").data(V?Z:[]);ct.exit().remove();var at=le.selectAll("g.angularaxis").data(V?Z:[]);at.exit().remove(),V&&M(F,le,Z,{radius:H,innerRadius:ae,gauge:ct,layer:at,size:$,gaugeBg:Ye,gaugeOutline:st,transitionOpts:B,onComplete:j});var et=le.selectAll("g.bullet").data(ee?Z:[]);et.exit().remove();var Pe=le.selectAll("g.bulletaxis").data(ee?Z:[]);Pe.exit().remove(),ee&&A(F,le,Z,{gauge:et,layer:Pe,size:$,gaugeBg:Ye,gaugeOutline:st,transitionOpts:B,onComplete:j});var Ae=le.selectAll("text.title").data(Z);Ae.exit().remove(),Ae.enter().append("text").classed("title",!0),Ae.attr("text-anchor",function(){return ee?T.right:T[fe.title.align]}).text(fe.title.text).call(n.font,fe.title.font).call(a.convertToTspans,F),Ae.attr("transform",function(){var pe=$.l+$.w*l[fe.title.align],Ne,ut=i.titlePadding,dt=n.bBox(Ae.node());if(ce){if(V)if(fe.gauge.axis.visible){var nt=n.bBox(at.node());Ne=nt.top-ut-dt.bottom}else Ne=$.t+$.h/2-H/2-dt.bottom-ut;ee&&(Ne=de-(dt.top+dt.bottom)/2,pe=$.l-i.bulletPadding*$.w)}else Ne=fe._numbersTop-ut-dt.bottom;return t(pe,Ne)})})};function A(z,F,N,B){var R=N[0].trace,U=B.gauge,j=B.layer,Z=B.gaugeBg,re=B.gaugeOutline,fe=B.size,le=R.domain,ce=B.transitionOpts,V=B.onComplete,ee,ne,$,ue,te;U.enter().append("g").classed("bullet",!0),U.attr("transform",t(fe.l,fe.t)),j.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),j.selectAll("g.xbulletaxistick,path,text").remove();var H=fe.h,ae=R.gauge.bar.thickness*H,ie=le.x[0],de=le.x[0]+(le.x[1]-le.x[0])*(R._hasNumber||R._hasDelta?1-i.bulletNumberDomainSize:1);ee=u(z,R.gauge.axis),ee._id="xbulletaxis",ee.domain=[ie,de],ee.setScale(),ne=s.calcTicks(ee),$=s.makeTransTickFn(ee),ue=s.getTickSigns(ee)[2],te=fe.t+fe.h,ee.visible&&(s.drawTicks(z,ee,{vals:ee.ticks==="inside"?s.clipEnds(ee,ne):ne,layer:j,path:s.makeTickPath(ee,te,ue),transFn:$}),s.drawLabels(z,ee,{vals:ne,layer:j,transFn:$,labelFns:s.makeLabelFns(ee,te)}));function Se(at){at.attr("width",function(et){return Math.max(0,ee.c2p(et.range[1])-ee.c2p(et.range[0]))}).attr("x",function(et){return ee.c2p(et.range[0])}).attr("y",function(et){return .5*(1-et.thickness)*H}).attr("height",function(et){return et.thickness*H})}var Le=[Z].concat(R.gauge.steps),Fe=U.selectAll("g.bg-bullet").data(Le);Fe.enter().append("g").classed("bg-bullet",!0).append("rect"),Fe.select("rect").call(Se).call(w),Fe.exit().remove();var ze=U.selectAll("g.value-bullet").data([R.gauge.bar]);ze.enter().append("g").classed("value-bullet",!0).append("rect"),ze.select("rect").attr("height",ae).attr("y",(H-ae)/2).call(w),x(ce)?ze.select("rect").transition().duration(ce.duration).ease(ce.easing).each("end",function(){V&&V()}).each("interrupt",function(){V&&V()}).attr("width",Math.max(0,ee.c2p(Math.min(R.gauge.axis.range[1],N[0].y)))):ze.select("rect").attr("width",typeof N[0].y=="number"?Math.max(0,ee.c2p(Math.min(R.gauge.axis.range[1],N[0].y))):0),ze.exit().remove();var Ye=N.filter(function(){return R.gauge.threshold.value||R.gauge.threshold.value===0}),st=U.selectAll("g.threshold-bullet").data(Ye);st.enter().append("g").classed("threshold-bullet",!0).append("line"),st.select("line").attr("x1",ee.c2p(R.gauge.threshold.value)).attr("x2",ee.c2p(R.gauge.threshold.value)).attr("y1",(1-R.gauge.threshold.thickness)/2*H).attr("y2",(1-(1-R.gauge.threshold.thickness)/2)*H).call(v.stroke,R.gauge.threshold.line.color).style("stroke-width",R.gauge.threshold.line.width),st.exit().remove();var ct=U.selectAll("g.gauge-outline").data([re]);ct.enter().append("g").classed("gauge-outline",!0).append("rect"),ct.select("rect").call(Se).call(w),ct.exit().remove()}function M(z,F,N,B){var R=N[0].trace,U=B.size,j=B.radius,Z=B.innerRadius,re=B.gaugeBg,fe=B.gaugeOutline,le=[U.l+U.w/2,U.t+U.h/2+j/2],ce=B.gauge,V=B.layer,ee=B.transitionOpts,ne=B.onComplete,$=Math.PI/2;function ue(Ft){var Nt=R.gauge.axis.range[0],Qt=R.gauge.axis.range[1],ar=(Ft-Nt)/(Qt-Nt)*Math.PI-$;return ar<-$?-$:ar>$?$:ar}function te(Ft){return h.svg.arc().innerRadius((Z+j)/2-Ft/2*(j-Z)).outerRadius((Z+j)/2+Ft/2*(j-Z)).startAngle(-$)}function H(Ft){Ft.attr("d",function(Nt){return te(Nt.thickness).startAngle(ue(Nt.range[0])).endAngle(ue(Nt.range[1]))()})}var ae,ie,de,Se;ce.enter().append("g").classed("angular",!0),ce.attr("transform",t(le[0],le[1])),V.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),V.selectAll("g.xangularaxistick,path,text").remove(),ae=u(z,R.gauge.axis),ae.type="linear",ae.range=R.gauge.axis.range,ae._id="xangularaxis",ae.ticklabeloverflow="allow",ae.setScale();var Le=function(Ft){return(ae.range[0]-Ft.x)/(ae.range[1]-ae.range[0])*Math.PI+Math.PI},Fe={},ze=s.makeLabelFns(ae,0),Ye=ze.labelStandoff;Fe.xFn=function(Ft){var Nt=Le(Ft);return Math.cos(Nt)*Ye},Fe.yFn=function(Ft){var Nt=Le(Ft),Qt=Math.sin(Nt)>0?.2:1;return-Math.sin(Nt)*(Ye+Ft.fontSize*Qt)+Math.abs(Math.cos(Nt))*(Ft.fontSize*o)},Fe.anchorFn=function(Ft){var Nt=Le(Ft),Qt=Math.cos(Nt);return Math.abs(Qt)<.1?"middle":Qt>0?"start":"end"},Fe.heightFn=function(Ft,Nt,Qt){var ar=Le(Ft);return-.5*(1+Math.sin(ar))*Qt};var st=function(Ft){return t(le[0]+j*Math.cos(Ft),le[1]-j*Math.sin(Ft))};de=function(Ft){return st(Le(Ft))};var ct=function(Ft){var Nt=Le(Ft);return st(Nt)+"rotate("+-r(Nt)+")"};if(ie=s.calcTicks(ae),Se=s.getTickSigns(ae)[2],ae.visible){Se=ae.ticks==="inside"?-1:1;var at=(ae.linewidth||1)/2;s.drawTicks(z,ae,{vals:ie,layer:V,path:"M"+Se*at+",0h"+Se*ae.ticklen,transFn:ct}),s.drawLabels(z,ae,{vals:ie,layer:V,transFn:de,labelFns:Fe})}var et=[re].concat(R.gauge.steps),Pe=ce.selectAll("g.bg-arc").data(et);Pe.enter().append("g").classed("bg-arc",!0).append("path"),Pe.select("path").call(H).call(w),Pe.exit().remove();var Ae=te(R.gauge.bar.thickness),pe=ce.selectAll("g.value-arc").data([R.gauge.bar]);pe.enter().append("g").classed("value-arc",!0).append("path");var Ne=pe.select("path");x(ee)?(Ne.transition().duration(ee.duration).ease(ee.easing).each("end",function(){ne&&ne()}).each("interrupt",function(){ne&&ne()}).attrTween("d",m(Ae,ue(N[0].lastY),ue(N[0].y))),R._lastValue=N[0].y):Ne.attr("d",typeof N[0].y=="number"?Ae.endAngle(ue(N[0].y)):"M0,0Z"),Ne.call(w),pe.exit().remove(),et=[];var ut=R.gauge.threshold.value;(ut||ut===0)&&et.push({range:[ut,ut],color:R.gauge.threshold.color,line:{color:R.gauge.threshold.line.color,width:R.gauge.threshold.line.width},thickness:R.gauge.threshold.thickness});var dt=ce.selectAll("g.threshold-arc").data(et);dt.enter().append("g").classed("threshold-arc",!0).append("path"),dt.select("path").call(H).call(w),dt.exit().remove();var nt=ce.selectAll("g.gauge-outline").data([fe]);nt.enter().append("g").classed("gauge-outline",!0).append("path"),nt.select("path").call(H).call(w),nt.exit().remove()}function _(z,F,N,B){var R=N[0].trace,U=B.numbersX,j=B.numbersY,Z=R.align||"center",re=T[Z],fe=B.transitionOpts,le=B.onComplete,ce=E.ensureSingle(F,"g","numbers"),V,ee,ne,$=[];R._hasNumber&&$.push("number"),R._hasDelta&&($.push("delta"),R.delta.position==="left"&&$.reverse());var ue=ce.selectAll("text").data($);ue.enter().append("text"),ue.attr("text-anchor",function(){return re}).attr("class",function(st){return st}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),ue.exit().remove();function te(st,ct,at,et){if(st.match("s")&&at>=0!=et>=0&&!ct(at).slice(-1).match(g)&&!ct(et).slice(-1).match(g)){var Pe=st.slice().replace("s","f").replace(/\d+/,function(pe){return parseInt(pe)-1}),Ae=u(z,{tickformat:Pe});return function(pe){return Math.abs(pe)<1?s.tickText(Ae,pe).text:ct(pe)}}else return ct}function H(){var st=u(z,{tickformat:R.number.valueformat},R._range);st.setScale(),s.prepTicks(st);var ct=function(pe){return s.tickText(st,pe).text},at=R.number.suffix,et=R.number.prefix,Pe=ce.select("text.number");function Ae(){var pe=typeof N[0].y=="number"?et+ct(N[0].y)+at:"-";Pe.text(pe).call(n.font,R.number.font).call(a.convertToTspans,z)}return x(fe)?Pe.transition().duration(fe.duration).ease(fe.easing).each("end",function(){Ae(),le&&le()}).each("interrupt",function(){Ae(),le&&le()}).attrTween("text",function(){var pe=h.select(this),Ne=S(N[0].lastY,N[0].y);R._lastValue=N[0].y;var ut=te(R.number.valueformat,ct,N[0].lastY,N[0].y);return function(dt){pe.text(et+ut(Ne(dt))+at)}}):Ae(),V=I(et+ct(N[0].y)+at,R.number.font,re,z),Pe}function ae(){var st=u(z,{tickformat:R.delta.valueformat},R._range);st.setScale(),s.prepTicks(st);var ct=function(dt){return s.tickText(st,dt).text},at=R.delta.suffix,et=R.delta.prefix,Pe=function(dt){var nt=R.delta.relative?dt.relativeDelta:dt.delta;return nt},Ae=function(dt,nt){return dt===0||typeof dt!="number"||isNaN(dt)?"-":(dt>0?R.delta.increasing.symbol:R.delta.decreasing.symbol)+et+nt(dt)+at},pe=function(dt){return dt.delta>=0?R.delta.increasing.color:R.delta.decreasing.color};R._deltaLastValue===void 0&&(R._deltaLastValue=Pe(N[0]));var Ne=ce.select("text.delta");Ne.call(n.font,R.delta.font).call(v.fill,pe({delta:R._deltaLastValue}));function ut(){Ne.text(Ae(Pe(N[0]),ct)).call(v.fill,pe(N[0])).call(a.convertToTspans,z)}return x(fe)?Ne.transition().duration(fe.duration).ease(fe.easing).tween("text",function(){var dt=h.select(this),nt=Pe(N[0]),Ft=R._deltaLastValue,Nt=te(R.delta.valueformat,ct,Ft,nt),Qt=S(Ft,nt);return R._deltaLastValue=nt,function(ar){dt.text(Ae(Qt(ar),Nt)),dt.call(v.fill,pe({delta:Qt(ar)}))}}).each("end",function(){ut(),le&&le()}).each("interrupt",function(){ut(),le&&le()}):ut(),ee=I(Ae(Pe(N[0]),ct),R.delta.font,re,z),Ne}var ie=R.mode+R.align,de;if(R._hasDelta&&(de=ae(),ie+=R.delta.position+R.delta.font.size+R.delta.font.family+R.delta.valueformat,ie+=R.delta.increasing.symbol+R.delta.decreasing.symbol,ne=ee),R._hasNumber&&(H(),ie+=R.number.font.size+R.number.font.family+R.number.valueformat+R.number.suffix+R.number.prefix,ne=V),R._hasDelta&&R._hasNumber){var Se=[(V.left+V.right)/2,(V.top+V.bottom)/2],Le=[(ee.left+ee.right)/2,(ee.top+ee.bottom)/2],Fe,ze,Ye=.75*R.delta.font.size;R.delta.position==="left"&&(Fe=L(R,"deltaPos",0,-1*(V.width*l[R.align]+ee.width*(1-l[R.align])+Ye),ie,Math.min),ze=Se[1]-Le[1],ne={width:V.width+ee.width+Ye,height:Math.max(V.height,ee.height),left:ee.left+Fe,right:V.right,top:Math.min(V.top,ee.top+ze),bottom:Math.max(V.bottom,ee.bottom+ze)}),R.delta.position==="right"&&(Fe=L(R,"deltaPos",0,V.width*(1-l[R.align])+ee.width*l[R.align]+Ye,ie,Math.max),ze=Se[1]-Le[1],ne={width:V.width+ee.width+Ye,height:Math.max(V.height,ee.height),left:V.left,right:ee.right+Fe,top:Math.min(V.top,ee.top+ze),bottom:Math.max(V.bottom,ee.bottom+ze)}),R.delta.position==="bottom"&&(Fe=null,ze=ee.height,ne={width:Math.max(V.width,ee.width),height:V.height+ee.height,left:Math.min(V.left,ee.left),right:Math.max(V.right,ee.right),top:V.bottom-V.height,bottom:V.bottom+ee.height}),R.delta.position==="top"&&(Fe=null,ze=V.top,ne={width:Math.max(V.width,ee.width),height:V.height+ee.height,left:Math.min(V.left,ee.left),right:Math.max(V.right,ee.right),top:V.bottom-V.height-ee.height,bottom:V.bottom}),de.attr({dx:Fe,dy:ze})}(R._hasNumber||R._hasDelta)&&ce.attr("transform",function(){var st=B.numbersScaler(ne);ie+=st[2];var ct=L(R,"numbersScale",1,st[0],ie,Math.min),at;R._scaleNumbers||(ct=1),R._isAngular?at=j-ct*ne.bottom:at=j-ct*(ne.top+ne.bottom)/2,R._numbersTop=ct*ne.top+at;var et=ne[Z];Z==="center"&&(et=(ne.left+ne.right)/2);var Pe=U-ct*et;return Pe=L(R,"numbersTranslate",0,Pe,ie,Math.max),t(Pe,at)+e(ct)})}function w(z){z.each(function(F){v.stroke(h.select(this),F.line.color)}).each(function(F){v.fill(h.select(this),F.color)}).style("stroke-width",function(F){return F.line.width})}function m(z,F,N){return function(){var B=b(F,N);return function(R){return z.endAngle(B(R))()}}}function u(z,F,N){var B=z._fullLayout,R=E.extendFlat({type:"linear",ticks:"outside",range:N,showline:!0},F),U={type:"linear",_id:"x"+F._id},j={letter:"x",font:B.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function Z(re,fe){return E.coerce(R,U,p,re,fe)}return f(R,U,Z,j,B),c(R,U,Z,j),U}function d(z,F,N){var B=Math.min(F/z.width,N/z.height);return[B,z,F+"x"+N]}function y(z,F){var N=Math.sqrt(z.width/2*(z.width/2)+z.height*z.height),B=F/N;return[B,z,F]}function I(z,F,N,B){var R=document.createElementNS("http://www.w3.org/2000/svg","text"),U=h.select(R);return U.text(z).attr("x",0).attr("y",0).attr("text-anchor",N).attr("data-unformatted",z).call(a.convertToTspans,B).call(n.font,F),n.bBox(U.node())}function L(z,F,N,B,R,U){var j="_cache"+F;z[j]&&z[j].key===R||(z[j]={key:R,value:N});var Z=E.aggNums(U,null,[z[j].value,B],2);return z[j].value=Z,Z}}}),h9=Ge({"src/traces/indicator/index.js"(K,G){G.exports={moduleType:"trace",name:"indicator",basePlotModule:l9(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:NL(),supplyDefaults:u9().supplyDefaults,calc:c9().calc,plot:f9(),meta:{}}}}),d9=Ge({"lib/indicator.js"(K,G){G.exports=h9()}}),jL=Ge({"src/traces/table/attributes.js"(K,G){var h=dm(),b=Ji().extendFlat,S=Hc().overrideAll,E=Us(),e=Cc().attributes,t=mc().descriptionOnlyNumbers;G.exports=S({domain:e({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:b({},h.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:b({},E({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:b({},h.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:b({},E({arrayOk:!0}))}},"calc","from-root")}}),v9=Ge({"src/traces/table/defaults.js"(K,G){var h=_n(),b=jL(),S=Cc().defaults;function E(e,t){for(var r=e.columnorder||[],o=e.header.values.length,n=r.slice(0,o),i=n.slice().sort(function(f,c){return f-c}),a=n.map(function(f){return i.indexOf(f)}),s=a.length;s",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),m9=Ge({"src/traces/table/data_preparation_helper.js"(K,G){var h=qL(),b=Ji().extendFlat,S=Ei(),E=ws().isTypedArray,e=ws().isArrayOrTypedArray;G.exports=function(p,v){var T=o(v.cells.values),l=function(re){return re.slice(v.header.values.length,re.length)},g=o(v.header.values);g.length&&!g[0].length&&(g[0]=[""],g=o(g));var x=g.concat(l(T).map(function(){return n((g[0]||[""]).length)})),A=v.domain,M=Math.floor(p._fullLayout._size.w*(A.x[1]-A.x[0])),_=Math.floor(p._fullLayout._size.h*(A.y[1]-A.y[0])),w=v.header.values.length?x[0].map(function(){return v.header.height}):[h.emptyHeaderHeight],m=T.length?T[0].map(function(){return v.cells.height}):[],u=w.reduce(r,0),d=_-u,y=d+h.uplift,I=s(m,y),L=s(w,u),z=a(L,[]),F=a(I,z),N={},B=v._fullInput.columnorder;e(B)&&(B=Array.from(B)),B=B.concat(l(T.map(function(re,fe){return fe})));var R=x.map(function(re,fe){var le=e(v.columnwidth)?v.columnwidth[Math.min(fe,v.columnwidth.length-1)]:v.columnwidth;return S(le)?Number(le):1}),U=R.reduce(r,0);R=R.map(function(re){return re/U*M});var j=Math.max(t(v.header.line.width),t(v.cells.line.width)),Z={key:v.uid+p._context.staticPlot,translateX:A.x[0]*p._fullLayout._size.w,translateY:p._fullLayout._size.h*(1-A.y[1]),size:p._fullLayout._size,width:M,maxLineWidth:j,height:_,columnOrder:B,groupHeight:_,rowBlocks:F,headerRowBlocks:z,scrollY:0,cells:b({},v.cells,{values:T}),headerCells:b({},v.header,{values:x}),gdColumns:x.map(function(re){return re[0]}),gdColumnsOriginalOrder:x.map(function(re){return re[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:x.map(function(re,fe){var le=N[re];N[re]=(le||0)+1;var ce=re+"__"+N[re];return{key:ce,label:re,specIndex:fe,xIndex:B[fe],xScale:i,x:void 0,calcdata:void 0,columnWidth:R[fe]}})};return Z.columns.forEach(function(re){re.calcdata=Z,re.x=i(re)}),Z};function t(c){if(e(c)){for(var p=0,v=0;v=p||_===c.length-1)&&(v[l]=x,x.key=M++,x.firstRowIndex=A,x.lastRowIndex=_,x=f(),l+=g,A=_+1,g=0);return v}function f(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),g9=Ge({"src/traces/table/data_split_helpers.js"(K){var G=Ji().extendFlat;K.splitToPanels=function(b){var S=[0,0],E=G({},b,{key:"header",type:"header",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!0,values:b.calcdata.headerCells.values[b.specIndex],rowBlocks:b.calcdata.headerRowBlocks,calcdata:G({},b.calcdata,{cells:b.calcdata.headerCells})}),e=G({},b,{key:"cells1",type:"cells",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:b.calcdata.cells.values[b.specIndex],rowBlocks:b.calcdata.rowBlocks}),t=G({},b,{key:"cells2",type:"cells",page:1,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:b.calcdata.cells.values[b.specIndex],rowBlocks:b.calcdata.rowBlocks});return[e,t,E]},K.splitToCells=function(b){var S=h(b);return(b.values||[]).slice(S[0],S[1]).map(function(E,e){var t=typeof E=="string"&&E.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:e+t,key:S[0]+e,column:b,calcdata:b.calcdata,page:b.page,rowBlocks:b.rowBlocks,value:E}})};function h(b){var S=b.rowBlocks[b.page],E=S?S.rows[0].rowIndex:0,e=S?E+S.rows.length:0;return[E,e]}}}),VL=Ge({"src/traces/table/plot.js"(K,G){var h=qL(),b=ki(),S=_n(),E=S.numberFormat,e=Fg(),t=As(),r=nc(),o=_n().raiseToTop,n=_n().strTranslate,i=_n().cancelTransition,a=m9(),s=g9(),f=go();G.exports=function(ie,de){var Se=!ie._context.staticPlot,Le=ie._fullLayout._paper.selectAll("."+h.cn.table).data(de.map(function(nt){var Ft=e.unwrap(nt),Nt=Ft.trace;return a(ie,Nt)}),e.keyFun);Le.exit().remove(),Le.enter().append("g").classed(h.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Le.attr("width",function(nt){return nt.width+nt.size.l+nt.size.r}).attr("height",function(nt){return nt.height+nt.size.t+nt.size.b}).attr("transform",function(nt){return n(nt.translateX,nt.translateY)});var Fe=Le.selectAll("."+h.cn.tableControlView).data(e.repeat,e.keyFun),ze=Fe.enter().append("g").classed(h.cn.tableControlView,!0).style("box-sizing","content-box");if(Se){var Ye="onwheel"in document?"wheel":"mousewheel";ze.on("mousemove",function(nt){Fe.filter(function(Ft){return nt===Ft}).call(l,ie)}).on(Ye,function(nt){if(!nt.scrollbarState.wheeling){nt.scrollbarState.wheeling=!0;var Ft=nt.scrollY+b.event.deltaY,Nt=re(ie,Fe,null,Ft)(nt);Nt||(b.event.stopPropagation(),b.event.preventDefault()),nt.scrollbarState.wheeling=!1}}).call(l,ie,!0)}Fe.attr("transform",function(nt){return n(nt.size.l,nt.size.t)});var st=Fe.selectAll("."+h.cn.scrollBackground).data(e.repeat,e.keyFun);st.enter().append("rect").classed(h.cn.scrollBackground,!0).attr("fill","none"),st.attr("width",function(nt){return nt.width}).attr("height",function(nt){return nt.height}),Fe.each(function(nt){t.setClipUrl(b.select(this),p(ie,nt),ie)});var ct=Fe.selectAll("."+h.cn.yColumn).data(function(nt){return nt.columns},e.keyFun);ct.enter().append("g").classed(h.cn.yColumn,!0),ct.exit().remove(),ct.attr("transform",function(nt){return n(nt.x,0)}),Se&&ct.call(b.behavior.drag().origin(function(nt){var Ft=b.select(this);return N(Ft,nt,-h.uplift),o(this),nt.calcdata.columnDragInProgress=!0,l(Fe.filter(function(Nt){return nt.calcdata.key===Nt.key}),ie),nt}).on("drag",function(nt){var Ft=b.select(this),Nt=function(kr){return(nt===kr?b.event.x:kr.x)+kr.columnWidth/2};nt.x=Math.max(-h.overdrag,Math.min(nt.calcdata.width+h.overdrag-nt.columnWidth,b.event.x));var Qt=T(ct).filter(function(kr){return kr.calcdata.key===nt.calcdata.key}),ar=Qt.sort(function(kr,Er){return Nt(kr)-Nt(Er)});ar.forEach(function(kr,Er){kr.xIndex=Er,kr.x=nt===kr?kr.x:kr.xScale(kr)}),ct.filter(function(kr){return nt!==kr}).transition().ease(h.transitionEase).duration(h.transitionDuration).attr("transform",function(kr){return n(kr.x,0)}),Ft.call(i).attr("transform",n(nt.x,-h.uplift))}).on("dragend",function(nt){var Ft=b.select(this),Nt=nt.calcdata;nt.x=nt.xScale(nt),nt.calcdata.columnDragInProgress=!1,N(Ft,nt,0),z(ie,Nt,Nt.columns.map(function(Qt){return Qt.xIndex}))})),ct.each(function(nt){t.setClipUrl(b.select(this),v(ie,nt),ie)});var at=ct.selectAll("."+h.cn.columnBlock).data(s.splitToPanels,e.keyFun);at.enter().append("g").classed(h.cn.columnBlock,!0).attr("id",function(nt){return nt.key}),at.style("cursor",function(nt){return nt.dragHandle?"ew-resize":nt.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var et=at.filter(R),Pe=at.filter(B);Se&&Pe.call(b.behavior.drag().origin(function(nt){return b.event.stopPropagation(),nt}).on("drag",re(ie,Fe,-1)).on("dragend",function(){})),g(ie,Fe,et,at),g(ie,Fe,Pe,at);var Ae=Fe.selectAll("."+h.cn.scrollAreaClip).data(e.repeat,e.keyFun);Ae.enter().append("clipPath").classed(h.cn.scrollAreaClip,!0).attr("id",function(nt){return p(ie,nt)});var pe=Ae.selectAll("."+h.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);pe.enter().append("rect").classed(h.cn.scrollAreaClipRect,!0).attr("x",-h.overdrag).attr("y",-h.uplift).attr("fill","none"),pe.attr("width",function(nt){return nt.width+2*h.overdrag}).attr("height",function(nt){return nt.height+h.uplift});var Ne=ct.selectAll("."+h.cn.columnBoundary).data(e.repeat,e.keyFun);Ne.enter().append("g").classed(h.cn.columnBoundary,!0);var ut=ct.selectAll("."+h.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);ut.enter().append("clipPath").classed(h.cn.columnBoundaryClippath,!0),ut.attr("id",function(nt){return v(ie,nt)});var dt=ut.selectAll("."+h.cn.columnBoundaryRect).data(e.repeat,e.keyFun);dt.enter().append("rect").classed(h.cn.columnBoundaryRect,!0).attr("fill","none"),dt.attr("width",function(nt){return nt.columnWidth+2*c(nt)}).attr("height",function(nt){return nt.calcdata.height+2*c(nt)+h.uplift}).attr("x",function(nt){return-c(nt)}).attr("y",function(nt){return-c(nt)}),Z(null,Pe,Fe)};function c(ae){return Math.ceil(ae.calcdata.maxLineWidth/2)}function p(ae,ie){return"clip"+ae._fullLayout._uid+"_scrollAreaBottomClip_"+ie.key}function v(ae,ie){return"clip"+ae._fullLayout._uid+"_columnBoundaryClippath_"+ie.calcdata.key+"_"+ie.specIndex}function T(ae){return[].concat.apply([],ae.map(function(ie){return ie})).map(function(ie){return ie.__data__})}function l(ae,ie,de){function Se(ct){var at=ct.rowBlocks;return ne(at,at.length-1)+(at.length?$(at[at.length-1],1/0):1)}var Le=ae.selectAll("."+h.cn.scrollbarKit).data(e.repeat,e.keyFun);Le.enter().append("g").classed(h.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Le.each(function(ct){var at=ct.scrollbarState;at.totalHeight=Se(ct),at.scrollableAreaHeight=ct.groupHeight-U(ct),at.currentlyVisibleHeight=Math.min(at.totalHeight,at.scrollableAreaHeight),at.ratio=at.currentlyVisibleHeight/at.totalHeight,at.barLength=Math.max(at.ratio*at.currentlyVisibleHeight,h.goldenRatio*h.scrollbarWidth),at.barWiggleRoom=at.currentlyVisibleHeight-at.barLength,at.wiggleRoom=Math.max(0,at.totalHeight-at.scrollableAreaHeight),at.topY=at.barWiggleRoom===0?0:ct.scrollY/at.wiggleRoom*at.barWiggleRoom,at.bottomY=at.topY+at.barLength,at.dragMultiplier=at.wiggleRoom/at.barWiggleRoom}).attr("transform",function(ct){var at=ct.width+h.scrollbarWidth/2+h.scrollbarOffset;return n(at,U(ct))});var Fe=Le.selectAll("."+h.cn.scrollbar).data(e.repeat,e.keyFun);Fe.enter().append("g").classed(h.cn.scrollbar,!0);var ze=Fe.selectAll("."+h.cn.scrollbarSlider).data(e.repeat,e.keyFun);ze.enter().append("g").classed(h.cn.scrollbarSlider,!0),ze.attr("transform",function(ct){return n(0,ct.scrollbarState.topY||0)});var Ye=ze.selectAll("."+h.cn.scrollbarGlyph).data(e.repeat,e.keyFun);Ye.enter().append("line").classed(h.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",h.scrollbarWidth).attr("stroke-linecap","round").attr("y1",h.scrollbarWidth/2),Ye.attr("y2",function(ct){return ct.scrollbarState.barLength-h.scrollbarWidth/2}).attr("stroke-opacity",function(ct){return ct.columnDragInProgress||!ct.scrollbarState.barWiggleRoom||de?0:.4}),Ye.transition().delay(0).duration(0),Ye.transition().delay(h.scrollbarHideDelay).duration(h.scrollbarHideDuration).attr("stroke-opacity",0);var st=Fe.selectAll("."+h.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);st.enter().append("line").classed(h.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",h.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(ct){var at=b.event.y,et=this.getBoundingClientRect(),Pe=ct.scrollbarState,Ae=at-et.top,pe=b.scale.linear().domain([0,Pe.scrollableAreaHeight]).range([0,Pe.totalHeight]).clamp(!0);Pe.topY<=Ae&&Ae<=Pe.bottomY||re(ie,ae,null,pe(Ae-Pe.barLength/2))(ct)}).call(b.behavior.drag().origin(function(ct){return b.event.stopPropagation(),ct.scrollbarState.scrollbarScrollInProgress=!0,ct}).on("drag",re(ie,ae)).on("dragend",function(){})),st.attr("y2",function(ct){return ct.scrollbarState.scrollableAreaHeight}),ie._context.staticPlot&&(Ye.remove(),st.remove())}function g(ae,ie,de,Se){var Le=x(de),Fe=A(Le);m(Fe);var ze=M(Fe);d(ze);var Ye=w(Fe),st=_(Ye);u(st),y(st,ie,Se,ae),ee(Fe)}function x(ae){var ie=ae.selectAll("."+h.cn.columnCells).data(e.repeat,e.keyFun);return ie.enter().append("g").classed(h.cn.columnCells,!0),ie.exit().remove(),ie}function A(ae){var ie=ae.selectAll("."+h.cn.columnCell).data(s.splitToCells,function(de){return de.keyWithinBlock});return ie.enter().append("g").classed(h.cn.columnCell,!0),ie.exit().remove(),ie}function M(ae){var ie=ae.selectAll("."+h.cn.cellRect).data(e.repeat,function(de){return de.keyWithinBlock});return ie.enter().append("rect").classed(h.cn.cellRect,!0),ie}function _(ae){var ie=ae.selectAll("."+h.cn.cellText).data(e.repeat,function(de){return de.keyWithinBlock});return ie.enter().append("text").classed(h.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){b.event.stopPropagation()}),ie}function w(ae){var ie=ae.selectAll("."+h.cn.cellTextHolder).data(e.repeat,function(de){return de.keyWithinBlock});return ie.enter().append("g").classed(h.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),ie}function m(ae){ae.each(function(ie,de){var Se=ie.calcdata.cells.font,Le=ie.column.specIndex,Fe={size:F(Se.size,Le,de),color:F(Se.color,Le,de),family:F(Se.family,Le,de),weight:F(Se.weight,Le,de),style:F(Se.style,Le,de),variant:F(Se.variant,Le,de),textcase:F(Se.textcase,Le,de),lineposition:F(Se.lineposition,Le,de),shadow:F(Se.shadow,Le,de)};ie.rowNumber=ie.key,ie.align=F(ie.calcdata.cells.align,Le,de),ie.cellBorderWidth=F(ie.calcdata.cells.line.width,Le,de),ie.font=Fe})}function u(ae){ae.each(function(ie){t.font(b.select(this),ie.font)})}function d(ae){ae.attr("width",function(ie){return ie.column.columnWidth}).attr("stroke-width",function(ie){return ie.cellBorderWidth}).each(function(ie){var de=b.select(this);f.stroke(de,F(ie.calcdata.cells.line.color,ie.column.specIndex,ie.rowNumber)),f.fill(de,F(ie.calcdata.cells.fill.color,ie.column.specIndex,ie.rowNumber))})}function y(ae,ie,de,Se){ae.text(function(Le){var Fe=Le.column.specIndex,ze=Le.rowNumber,Ye=Le.value,st=typeof Ye=="string",ct=st&&Ye.match(/
/i),at=!st||ct;Le.mayHaveMarkup=st&&Ye.match(/[<&>]/);var et=I(Ye);Le.latex=et;var Pe=et?"":F(Le.calcdata.cells.prefix,Fe,ze)||"",Ae=et?"":F(Le.calcdata.cells.suffix,Fe,ze)||"",pe=et?null:F(Le.calcdata.cells.format,Fe,ze)||null,Ne=Pe+(pe?E(pe)(Le.value):Le.value)+Ae,ut;Le.wrappingNeeded=!Le.wrapped&&!at&&!et&&(ut=L(Ne)),Le.cellHeightMayIncrease=ct||et||Le.mayHaveMarkup||(ut===void 0?L(Ne):ut),Le.needsConvertToTspans=Le.mayHaveMarkup||Le.wrappingNeeded||Le.latex;var dt;if(Le.wrappingNeeded){var nt=h.wrapSplitCharacter===" "?Ne.replace(/Le&&Se.push(Fe),Le+=st}return Se}function Z(ae,ie,de){var Se=T(ie)[0];if(Se!==void 0){var Le=Se.rowBlocks,Fe=Se.calcdata,ze=ne(Le,Le.length),Ye=Se.calcdata.groupHeight-U(Se),st=Fe.scrollY=Math.max(0,Math.min(ze-Ye,Fe.scrollY)),ct=j(Le,st,Ye);ct.length===1&&(ct[0]===Le.length-1?ct.unshift(ct[0]-1):ct.push(ct[0]+1)),ct[0]%2&&ct.reverse(),ie.each(function(at,et){at.page=ct[et],at.scrollY=st}),ie.attr("transform",function(at){var et=ne(at.rowBlocks,at.page)-at.scrollY;return n(0,et)}),ae&&(fe(ae,de,ie,ct,Se.prevPages,Se,0),fe(ae,de,ie,ct,Se.prevPages,Se,1),l(de,ae))}}function re(ae,ie,de,Se){return function(Fe){var ze=Fe.calcdata?Fe.calcdata:Fe,Ye=ie.filter(function(et){return ze.key===et.key}),st=de||ze.scrollbarState.dragMultiplier,ct=ze.scrollY;ze.scrollY=Se===void 0?ze.scrollY+st*b.event.dy:Se;var at=Ye.selectAll("."+h.cn.yColumn).selectAll("."+h.cn.columnBlock).filter(B);return Z(ae,at,Ye),ze.scrollY===ct}}function fe(ae,ie,de,Se,Le,Fe,ze){var Ye=Se[ze]!==Le[ze];Ye&&(clearTimeout(Fe.currentRepaint[ze]),Fe.currentRepaint[ze]=setTimeout(function(){var st=de.filter(function(ct,at){return at===ze&&Se[at]!==Le[at]});g(ae,ie,st,de),Le[ze]=Se[ze]}))}function le(ae,ie,de,Se){return function(){var Fe=b.select(ie.parentNode);Fe.each(function(ze){var Ye=ze.fragments;Fe.selectAll("tspan.line").each(function(Ne,ut){Ye[ut].width=this.getComputedTextLength()});var st=Ye[Ye.length-1].width,ct=Ye.slice(0,-1),at=[],et,Pe,Ae=0,pe=ze.column.columnWidth-2*h.cellPad;for(ze.value="";ct.length;)et=ct.shift(),Pe=et.width+st,Ae+Pe>pe&&(ze.value+=at.join(h.wrapSpacer)+h.lineBreaker,at=[],Ae=0),at.push(et.text),Ae+=Pe;Ae&&(ze.value+=at.join(h.wrapSpacer)),ze.wrapped=!0}),Fe.selectAll("tspan.line").remove(),y(Fe.select("."+h.cn.cellText),de,ae,Se),b.select(ie.parentNode.parentNode).call(ee)}}function ce(ae,ie,de,Se,Le){return function(){if(!Le.settledY){var ze=b.select(ie.parentNode),Ye=te(Le),st=Le.key-Ye.firstRowIndex,ct=Ye.rows[st].rowHeight,at=Le.cellHeightMayIncrease?ie.parentNode.getBoundingClientRect().height+2*h.cellPad:ct,et=Math.max(at,ct),Pe=et-Ye.rows[st].rowHeight;Pe&&(Ye.rows[st].rowHeight=et,ae.selectAll("."+h.cn.columnCell).call(ee),Z(null,ae.filter(B),0),l(de,Se,!0)),ze.attr("transform",function(){var Ae=this,pe=Ae.parentNode,Ne=pe.getBoundingClientRect(),ut=b.select(Ae.parentNode).select("."+h.cn.cellRect).node().getBoundingClientRect(),dt=Ae.transform.baseVal.consolidate(),nt=ut.top-Ne.top+(dt?dt.matrix.f:h.cellPad);return n(V(Le,b.select(Ae.parentNode).select("."+h.cn.cellTextHolder).node().getBoundingClientRect().width),nt)}),Le.settledY=!0}}}function V(ae,ie){switch(ae.align){case"left":return h.cellPad;case"right":return ae.column.columnWidth-(ie||0)-h.cellPad;case"center":return(ae.column.columnWidth-(ie||0))/2;default:return h.cellPad}}function ee(ae){ae.attr("transform",function(ie){var de=ie.rowBlocks[0].auxiliaryBlocks.reduce(function(ze,Ye){return ze+$(Ye,1/0)},0),Se=te(ie),Le=$(Se,ie.key),Fe=Le+de;return n(0,Fe)}).selectAll("."+h.cn.cellRect).attr("height",function(ie){return H(te(ie),ie.key).rowHeight})}function ne(ae,ie){for(var de=0,Se=ie-1;Se>=0;Se--)de+=ue(ae[Se]);return de}function $(ae,ie){for(var de=0,Se=0;SeE.length&&(S=S.slice(0,E.length)):S=[],t=0;t90&&(p-=180,i=-i),{angle:p,flip:i,p:b.c2p(e,S,E),offsetMultplier:a}}}}),E9=Ge({"src/traces/carpet/plot.js"(K,G){var h=ki(),b=As(),S=HL(),E=GL(),e=M9(),t=nc(),r=_n(),o=r.strRotate,n=r.strTranslate,i=ad();G.exports=function(g,x,A,M){var _=g._context.staticPlot,w=x.xaxis,m=x.yaxis,u=g._fullLayout,d=u._clips;r.makeTraceGroups(M,A,"trace").each(function(y){var I=h.select(this),L=y[0],z=L.trace,F=z.aaxis,N=z.baxis,B=r.ensureSingle(I,"g","minorlayer"),R=r.ensureSingle(I,"g","majorlayer"),U=r.ensureSingle(I,"g","boundarylayer"),j=r.ensureSingle(I,"g","labellayer");I.style("opacity",z.opacity),s(w,m,R,F,"a",F._gridlines,!0),s(w,m,R,N,"b",N._gridlines,!0),s(w,m,B,F,"a",F._minorgridlines,!0),s(w,m,B,N,"b",N._minorgridlines,!0),s(w,m,U,F,"a-boundary",F._boundarylines,_),s(w,m,U,N,"b-boundary",N._boundarylines,_);var Z=f(g,w,m,z,L,j,F._labels,"a-label"),re=f(g,w,m,z,L,j,N._labels,"b-label");c(g,j,z,L,w,m,Z,re),a(z,L,d,w,m)})};function a(l,g,x,A,M){var _,w,m,u,d=x.select("#"+l._clipPathId);d.size()||(d=x.append("clipPath").classed("carpetclip",!0));var y=r.ensureSingle(d,"path","carpetboundary"),I=g.clipsegments,L=[];for(u=0;u0?"start":"end","data-notex":1}).call(b.font,I.font).text(I.text).call(t.convertToTspans,l),R=b.bBox(this);B.attr("transform",n(z.p[0],z.p[1])+o(z.angle)+n(I.axis.labelpadding*N,R.height*.3)),d=Math.max(d,R.width+I.axis.labelpadding)}),u.exit().remove(),y.maxExtent=d,y}function c(l,g,x,A,M,_,w,m){var u,d,y,I,L=r.aggNums(Math.min,null,x.a),z=r.aggNums(Math.max,null,x.a),F=r.aggNums(Math.min,null,x.b),N=r.aggNums(Math.max,null,x.b);u=.5*(L+z),d=F,y=x.ab2xy(u,d,!0),I=x.dxyda_rough(u,d),w.angle===void 0&&r.extendFlat(w,e(x,M,_,y,x.dxydb_rough(u,d))),T(l,g,x,A,y,I,x.aaxis,M,_,w,"a-title"),u=L,d=.5*(F+N),y=x.ab2xy(u,d,!0),I=x.dxydb_rough(u,d),m.angle===void 0&&r.extendFlat(m,e(x,M,_,y,x.dxyda_rough(u,d))),T(l,g,x,A,y,I,x.baxis,M,_,m,"b-title")}var p=i.LINE_SPACING,v=(1-i.MID_SHIFT)/p+1;function T(l,g,x,A,M,_,w,m,u,d,y){var I=[];w.title.text&&I.push(w.title.text);var L=g.selectAll("text."+y).data(I),z=d.maxExtent;L.enter().append("text").classed(y,!0),L.each(function(){var F=e(x,m,u,M,_);["start","both"].indexOf(w.showticklabels)===-1&&(z=0);var N=w.title.font.size;z+=N+w.title.offset;var B=d.angle+(d.flip<0?180:0),R=(B-F.angle+450)%360,U=R>90&&R<270,j=h.select(this);j.text(w.title.text).call(t.convertToTspans,l),U&&(z=(-t.lineCount(j)+v)*p*N-z),j.attr("transform",n(F.p[0],F.p[1])+o(F.angle)+n(0,z)).attr("text-anchor","middle").call(b.font,w.title.font)}),L.exit().remove()}}}),k9=Ge({"src/traces/carpet/cheater_basis.js"(K,G){var h=_n().isArrayOrTypedArray;G.exports=function(b,S,E){var e,t,r,o,n,i,a=[],s=h(b)?b.length:b,f=h(S)?S.length:S,c=h(b)?b:null,p=h(S)?S:null;c&&(r=(c.length-1)/(c[c.length-1]-c[0])/(s-1)),p&&(o=(p.length-1)/(p[p.length-1]-p[0])/(f-1));var v,T=1/0,l=-1/0;for(t=0;t=10)return null;for(var e=1/0,t=-1/0,r=S.length,o=0;o0&&($=E.dxydi([],Z-1,fe,0,le),ae.push(ce[0]+$[0]/3),ie.push(ce[1]+$[1]/3),ue=E.dxydi([],Z-1,fe,1,le),ae.push(ne[0]-ue[0]/3),ie.push(ne[1]-ue[1]/3)),ae.push(ne[0]),ie.push(ne[1]),ce=ne;else for(Z=E.a2i(j),V=Math.floor(Math.max(0,Math.min(F-2,Z))),ee=Z-V,de.length=F,de.crossLength=N,de.xy=function(Se){return E.evalxy([],Z,Se)},de.dxy=function(Se,Le){return E.dxydj([],V,Se,ee,Le)},re=0;re0&&(te=E.dxydj([],V,re-1,ee,0),ae.push(ce[0]+te[0]/3),ie.push(ce[1]+te[1]/3),H=E.dxydj([],V,re-1,ee,1),ae.push(ne[0]-H[0]/3),ie.push(ne[1]-H[1]/3)),ae.push(ne[0]),ie.push(ne[1]),ce=ne;return de.axisLetter=e,de.axis=M,de.crossAxis=d,de.value=j,de.constvar=t,de.index=c,de.x=ae,de.y=ie,de.smoothing=d.smoothing,de}function U(j){var Z,re,fe,le,ce,V=[],ee=[],ne={};if(ne.length=A.length,ne.crossLength=u.length,e==="b")for(fe=Math.max(0,Math.min(N-2,j)),ce=Math.min(1,Math.max(0,j-fe)),ne.xy=function($){return E.evalxy([],$,j)},ne.dxy=function($,ue){return E.dxydi([],$,fe,ue,ce)},Z=0;ZA.length-1)&&_.push(b(U(o),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(c=s;cA.length-1)&&!(T<0||T>A.length-1))for(l=A[n],g=A[T],r=0;rA[A.length-1])&&w.push(b(R(v),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash})));M.startline&&m.push(b(U(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&m.push(b(U(A.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(i=5e-15,a=[Math.floor((A[A.length-1]-M.tick0)/M.dtick*(1+i)),Math.ceil((A[0]-M.tick0)/M.dtick/(1+i))].sort(function(j,Z){return j-Z}),s=a[0],f=a[1],c=s;c<=f;c++)p=M.tick0+M.dtick*c,_.push(b(R(p),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(c=s-1;cA[A.length-1])&&w.push(b(R(v),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash}));M.startline&&m.push(b(R(A[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&m.push(b(R(A[A.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}}}),P9=Ge({"src/traces/carpet/calc_labels.js"(K,G){var h=Ts(),b=Ji().extendFlat;G.exports=function(E,e){var t,r,o,n,i,a=e._labels=[],s=e._gridlines;for(t=0;t=0;t--)r[s-t]=b[f][t],o[s-t]=S[f][t];for(n.push({x:r,y:o,bicubic:i}),t=f,r=[],o=[];t>=0;t--)r[f-t]=b[t][0],o[f-t]=S[t][0];return n.push({x:r,y:o,bicubic:a}),n}}}),I9=Ge({"src/traces/carpet/smooth_fill_2d_array.js"(K,G){var h=_n();G.exports=function(S,E,e){var t,r,o,n=[],i=[],a=S[0].length,s=S.length;function f(re,fe){var le=0,ce,V=0;return re>0&&(ce=S[fe][re-1])!==void 0&&(V++,le+=ce),re0&&(ce=S[fe-1][re])!==void 0&&(V++,le+=ce),fe0&&r0&&tu);return h.log("Smoother converged to",d,"after",I,"iterations"),S}}}),D9=Ge({"src/traces/carpet/constants.js"(K,G){G.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),z9=Ge({"src/traces/carpet/catmull_rom.js"(K,G){var h=.5;G.exports=function(S,E,e,t){var r=S[0]-E[0],o=S[1]-E[1],n=e[0]-E[0],i=e[1]-E[1],a=Math.pow(r*r+o*o,h/2),s=Math.pow(n*n+i*i,h/2),f=(s*s*r-a*a*n)*t,c=(s*s*o-a*a*i)*t,p=s*(a+s)*3,v=a*(a+s)*3;return[[E[0]+(p&&f/p),E[1]+(p&&c/p)],[E[0]-(v&&f/v),E[1]-(v&&c/v)]]}}}),O9=Ge({"src/traces/carpet/compute_control_points.js"(K,G){var h=z9(),b=_n().ensureArray;function S(E,e,t){var r=-.5*t[0]+1.5*e[0],o=-.5*t[1]+1.5*e[1];return[(2*r+E[0])/3,(2*o+E[1])/3]}G.exports=function(e,t,r,o,n,i){var a,s,f,c,p,v,T,l,g,x,A=r[0].length,M=r.length,_=n?3*A-2:A,w=i?3*M-2:M;for(e=b(e,w),t=b(t,w),f=0;fp&&_T&&wv||wl},o.setScale=function(){var _=o._x,w=o._y,m=S(o._xctrl,o._yctrl,_,w,f.smoothing,c.smoothing);o._xctrl=m[0],o._yctrl=m[1],o.evalxy=E([o._xctrl,o._yctrl],a,s,f.smoothing,c.smoothing),o.dxydi=e([o._xctrl,o._yctrl],f.smoothing,c.smoothing),o.dxydj=t([o._xctrl,o._yctrl],f.smoothing,c.smoothing)},o.i2a=function(_){var w=Math.max(0,Math.floor(_[0]),a-2),m=_[0]-w;return(1-m)*n[w]+m*n[w+1]},o.j2b=function(_){var w=Math.max(0,Math.floor(_[1]),a-2),m=_[1]-w;return(1-m)*i[w]+m*i[w+1]},o.ij2ab=function(_){return[o.i2a(_[0]),o.j2b(_[1])]},o.a2i=function(_){var w=Math.max(0,Math.min(b(_,n),a-2)),m=n[w],u=n[w+1];return Math.max(0,Math.min(a-1,w+(_-m)/(u-m)))},o.b2j=function(_){var w=Math.max(0,Math.min(b(_,i),s-2)),m=i[w],u=i[w+1];return Math.max(0,Math.min(s-1,w+(_-m)/(u-m)))},o.ab2ij=function(_){return[o.a2i(_[0]),o.b2j(_[1])]},o.i2c=function(_,w){return o.evalxy([],_,w)},o.ab2xy=function(_,w,m){if(!m&&(_n[a-1]|wi[s-1]))return[!1,!1];var u=o.a2i(_),d=o.b2j(w),y=o.evalxy([],u,d);if(m){var I=0,L=0,z=[],F,N,B,R;_n[a-1]?(F=a-2,N=1,I=(_-n[a-1])/(n[a-1]-n[a-2])):(F=Math.max(0,Math.min(a-2,Math.floor(u))),N=u-F),wi[s-1]?(B=s-2,R=1,L=(w-i[s-1])/(i[s-1]-i[s-2])):(B=Math.max(0,Math.min(s-2,Math.floor(d))),R=d-B),I&&(o.dxydi(z,F,B,N,R),y[0]+=z[0]*I,y[1]+=z[1]*I),L&&(o.dxydj(z,F,B,N,R),y[0]+=z[0]*L,y[1]+=z[1]*L)}return y},o.c2p=function(_,w,m){return[w.c2p(_[0]),m.c2p(_[1])]},o.p2x=function(_,w,m){return[w.p2c(_[0]),m.p2c(_[1])]},o.dadi=function(_){var w=Math.max(0,Math.min(n.length-2,_));return n[w+1]-n[w]},o.dbdj=function(_){var w=Math.max(0,Math.min(i.length-2,_));return i[w+1]-i[w]},o.dxyda=function(_,w,m,u){var d=o.dxydi(null,_,w,m,u),y=o.dadi(_,m);return[d[0]/y,d[1]/y]},o.dxydb=function(_,w,m,u){var d=o.dxydj(null,_,w,m,u),y=o.dbdj(w,u);return[d[0]/y,d[1]/y]},o.dxyda_rough=function(_,w,m){var u=g*(m||.1),d=o.ab2xy(_+u,w,!0),y=o.ab2xy(_-u,w,!0);return[(d[0]-y[0])*.5/u,(d[1]-y[1])*.5/u]},o.dxydb_rough=function(_,w,m){var u=x*(m||.1),d=o.ab2xy(_,w+u,!0),y=o.ab2xy(_,w-u,!0);return[(d[0]-y[0])*.5/u,(d[1]-y[1])*.5/u]},o.dpdx=function(_){return _._m},o.dpdy=function(_){return _._m}}}}),j9=Ge({"src/traces/carpet/calc.js"(K,G){var h=Ts(),b=_n().isArray1D,S=k9(),E=C9(),e=L9(),t=P9(),r=R9(),o=Ux(),n=I9(),i=Nx(),a=U9();G.exports=function(f,c){var p=h.getFromId(f,c.xaxis),v=h.getFromId(f,c.yaxis),T=c.aaxis,l=c.baxis,g=c.x,x=c.y,A=[];g&&b(g)&&A.push("x"),x&&b(x)&&A.push("y"),A.length&&i(c,T,l,"a","b",A);var M=c._a=c._a||c.a,_=c._b=c._b||c.b;g=c._x||c.x,x=c._y||c.y;var w={};if(c._cheater){var m=T.cheatertype==="index"?M.length:M,u=l.cheatertype==="index"?_.length:_;g=S(m,u,c.cheaterslope)}c._x=g=o(g),c._y=x=o(x),n(g,M,_),n(x,M,_),a(c),c.setScale();var d=E(g),y=E(x),I=.5*(d[1]-d[0]),L=.5*(d[1]+d[0]),z=.5*(y[1]-y[0]),F=.5*(y[1]+y[0]),N=1.3;return d=[L-I*N,L+I*N],y=[F-z*N,F+z*N],c._extremes[p._id]=h.findExtremes(p,d,{padded:!0}),c._extremes[v._id]=h.findExtremes(v,y,{padded:!0}),e(c,"a","b"),e(c,"b","a"),t(c,T),t(c,l),w.clipsegments=r(c._xctrl,c._yctrl,T,l),w.x=g,w.y=x,w.a=M,w.b=_,[w]}}}),q9=Ge({"src/traces/carpet/index.js"(K,G){G.exports={attributes:t6(),supplyDefaults:S9(),plot:E9(),calc:j9(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:_h(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),V9=Ge({"lib/carpet.js"(K,G){G.exports=q9()}}),XL=Ge({"src/traces/scattercarpet/attributes.js"(K,G){var h=cv(),b=Gc(),S=Jl(),{hovertemplateAttrs:E,texttemplateAttrs:e,templatefallbackAttrs:t}=Sl(),r=zu(),o=Ji().extendFlat,n=b.marker,i=b.line,a=n.line;G.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:o({},b.mode,{dflt:"markers"}),text:o({},b.text,{}),texttemplate:e({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:t({editType:"plot"}),hovertext:o({},b.hovertext,{}),line:{color:i.color,width:i.width,dash:i.dash,backoff:i.backoff,shape:o({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:b.connectgaps,fill:o({},b.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:h(),marker:o({symbol:n.symbol,opacity:n.opacity,maxdisplayed:n.maxdisplayed,angle:n.angle,angleref:n.angleref,standoff:n.standoff,size:n.size,sizeref:n.sizeref,sizemin:n.sizemin,sizemode:n.sizemode,line:o({width:a.width,editType:"calc"},r("marker.line")),gradient:n.gradient,editType:"calc"},r("marker")),textfont:b.textfont,textposition:b.textposition,selected:b.selected,unselected:b.unselected,hoverinfo:o({},S.hoverinfo,{flags:["a","b","text","name"]}),hoveron:b.hoveron,hovertemplate:E(),hovertemplatefallback:t(),zorder:b.zorder}}}),H9=Ge({"src/traces/scattercarpet/defaults.js"(K,G){var h=_n(),b=c0(),S=uu(),E=Jd(),e=Hp(),t=Qd(),r=op(),o=Nd(),n=XL();G.exports=function(a,s,f,c){function p(M,_){return h.coerce(a,s,n,M,_)}p("carpet"),s.xaxis="x",s.yaxis="y";var v=p("a"),T=p("b"),l=Math.min(v.length,T.length);if(!l){s.visible=!1;return}s._length=l,p("text"),p("texttemplate"),p("texttemplatefallback"),p("hovertext");var g=l0?w=M.labelprefix.replace(/ = $/,""):w=M._hovertitle,l.push(w+": "+_.toFixed(3)+M.labelsuffix)}if(!p.hovertemplate){var x=c.hi||p.hoverinfo,A=x.split("+");A.indexOf("all")!==-1&&(A=["a","b","text"]),A.indexOf("a")!==-1&&g(v.aaxis,c.a),A.indexOf("b")!==-1&&g(v.baxis,c.b),l.push("y: "+n.yLabel),A.indexOf("text")!==-1&&b(c,p,l),n.extraText=l.join("
")}return o}}}),W9=Ge({"src/traces/scattercarpet/event_data.js"(K,G){G.exports=function(b,S,E,e,t){var r=e[t];return b.a=r.a,b.b=r.b,b.y=r.y,b}}}),$9=Ge({"src/traces/scattercarpet/index.js"(K,G){G.exports={attributes:XL(),supplyDefaults:H9(),colorbar:Zf(),formatLabels:G9(),calc:X9(),plot:Y9(),style:Ph().style,styleOnSelect:Ph().styleOnSelect,hoverPoints:Z9(),selectPoints:ug(),eventData:W9(),moduleType:"trace",name:"scattercarpet",basePlotModule:_h(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),K9=Ge({"lib/scattercarpet.js"(K,G){G.exports=$9()}}),YL=Ge({"src/traces/contourcarpet/attributes.js"(K,G){var h=bd(),b=Z1(),S=zu(),E=Ji().extendFlat,e=b.contours;G.exports=E({carpet:{valType:"string",editType:"calc"},z:h.z,a:h.x,a0:h.x0,da:h.dx,b:h.y,b0:h.y0,db:h.dy,text:h.text,hovertext:h.hovertext,transpose:h.transpose,atype:h.xtype,btype:h.ytype,fillcolor:b.fillcolor,autocontour:b.autocontour,ncontours:b.ncontours,contours:{type:e.type,start:e.start,end:e.end,size:e.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:e.showlines,showlabels:e.showlabels,labelfont:e.labelfont,labelformat:e.labelformat,operation:e.operation,value:e.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:b.line.color,width:b.line.width,dash:b.line.dash,smoothing:b.line.smoothing,editType:"plot"},zorder:b.zorder},S("",{cLetter:"z",autoColorDflt:!1}))}}),ZL=Ge({"src/traces/contourcarpet/defaults.js"(K,G){var h=_n(),b=bh(),S=YL(),E=B2(),e=eb(),t=W1();G.exports=function(o,n,i,a){function s(v,T){return h.coerce(o,n,S,v,T)}function f(v){return h.coerce2(o,n,S,v)}if(s("carpet"),o.a&&o.b){var c=b(o,n,s,a,"a","b");if(!c){n.visible=!1;return}s("text");var p=s("contours.type")==="constraint";p?E(o,n,s,a,i,{hasHover:!1}):(e(o,n,s,f),t(o,n,s,a,{hasHover:!1}))}else n._defaultColor=i,n._length=null;s("zorder")}}}),J9=Ge({"src/traces/contourcarpet/calc.js"(K,G){var h=_d(),b=_n(),S=Nx(),E=Ux(),e=jx(),t=qx(),r=L2(),o=ZL(),n=r6(),i=D2();G.exports=function(f,c){var p=c._carpetTrace=n(f,c);if(!(!p||!p.visible||p.visible==="legendonly")){if(!c.a||!c.b){var v=f.data[p.index],T=f.data[c.index];T.a||(T.a=v.a),T.b||(T.b=v.b),o(T,c,c._defaultColor,f._fullLayout)}var l=a(f,c);return i(c,c._z),l}};function a(s,f){var c=f._carpetTrace,p=c.aaxis,v=c.baxis,T,l,g,x,A,M,_;p._minDtick=0,v._minDtick=0,b.isArray1D(f.z)&&S(f,p,v,"a","b",["z"]),T=f._a=f._a||f.a,x=f._b=f._b||f.b,T=T?p.makeCalcdata(f,"_a"):[],x=x?v.makeCalcdata(f,"_b"):[],l=f.a0||0,g=f.da||1,A=f.b0||0,M=f.db||1,_=f._z=E(f._z||f.z,f.transpose),f._emptypoints=t(_),e(_,f._emptypoints);var w=b.maxRowLength(_),m=f.xtype==="scaled"?"":T,u=r(f,m,l,g,w,p),d=f.ytype==="scaled"?"":x,y=r(f,d,A,M,_.length,v),I={a:u,b:y,z:_};return f.contours.type==="levels"&&f.contours.coloring!=="none"&&h(s,f,{vals:_,containerStr:"",cLetter:"z"}),[I]}}}),Q9=Ge({"src/traces/carpet/axis_aligned_line.js"(K,G){var h=_n().isArrayOrTypedArray;G.exports=function(b,S,E,e){var t,r,o,n,i,a,s,f,c,p,v,T,l,g=h(E)?"a":"b",x=g==="a"?b.aaxis:b.baxis,A=x.smoothing,M=g==="a"?b.a2i:b.b2j,_=g==="a"?E:e,w=g==="a"?e:E,m=g==="a"?S.a.length:S.b.length,u=g==="a"?S.b.length:S.a.length,d=Math.floor(g==="a"?b.b2j(w):b.a2i(w)),y=g==="a"?function(fe){return b.evalxy([],fe,d)}:function(fe){return b.evalxy([],d,fe)};A&&(o=Math.max(0,Math.min(u-2,d)),n=d-o,r=g==="a"?function(fe,le){return b.dxydi([],fe,o,le,n)}:function(fe,le){return b.dxydj([],o,fe,n,le)});var I=M(_[0]),L=M(_[1]),z=I0?Math.floor:Math.ceil,B=z>0?Math.ceil:Math.floor,R=z>0?Math.min:Math.max,U=z>0?Math.max:Math.min,j=N(I+F),Z=B(L-F);s=y(I);var re=[[s]];for(t=j;t*z=0;de--)H=U.clipsegments[de],ae=b([],H.x,I.c2p),ie=b([],H.y,L.c2p),ae.reverse(),ie.reverse(),Se.push(S(ae,ie,H.bicubic));var Le="M"+Se.join("L")+"Z";A(F,U.clipsegments,I,L,le,V),M(B,F,I,L,te,ne,ee,R,U,V,Le),v(F,fe,m,N,re,u,R),E.setClipUrl(F,R._clipPathId,m)})};function p(w,m){var u,d,y,I,L,z,F,N,B;for(u=0;ufe&&(d.max=fe),d.len=d.max-d.min}function l(w,m,u){var d=w.getPointAtLength(m),y=w.getPointAtLength(u),I=y.x-d.x,L=y.y-d.y,z=Math.sqrt(I*I+L*L);return[I/z,L/z]}function g(w){var m=Math.sqrt(w[0]*w[0]+w[1]*w[1]);return[w[0]/m,w[1]/m]}function x(w,m){var u=Math.abs(w[0]*m[0]+w[1]*m[1]),d=Math.sqrt(1-u*u);return d/u}function A(w,m,u,d,y,I){var L,z,F,N,B=e.ensureSingle(w,"g","contourbg"),R=B.selectAll("path").data(I==="fill"&&!y?[0]:[]);R.enter().append("path"),R.exit().remove();var U=[];for(N=0;N=0&&(j=ae,re=fe):Math.abs(U[1]-j[1])=0&&(j=ae,re=fe):e.log("endpt to newendpt is not vert. or horz.",U,j,ae)}if(re>=0)break;N+=te(U,j),U=j}if(re===m.edgepaths.length){e.log("unclosed perimeter path");break}F=re,R=B.indexOf(F)===-1,R&&(F=B[0],N+=te(U,j)+"Z",U=null)}for(F=0;F_):M=z>y,_=z;var F=p(y,I,L,z);F.pos=d,F.yc=(y+z)/2,F.i=u,F.dir=M?"increasing":"decreasing",F.x=F.pos,F.y=[L,I],w&&(F.orig_p=s[u]),x&&(F.tx=a.text[u]),A&&(F.htx=a.hovertext[u]),m.push(F)}else m.push({pos:d,empty:!0})}return a._extremes[c._id]=S.findExtremes(c,h.concat(l,T),{padded:!0}),m.length&&(m[0].t={labels:{open:b(i,"open:")+" ",high:b(i,"high:")+" ",low:b(i,"low:")+" ",close:b(i,"close:")+" "}}),m}function n(i,a,s){var f=s._minDiff;if(!f){var c=i._fullData,p=[];f=1/0;var v;for(v=0;v"+g.labels[d]+h.hoverLabelText(T,y,l.yhoverformat)):(L=b.extendFlat({},A),L.y0=L.y1=I,L.yLabelVal=y,L.yLabel=g.labels[d]+h.hoverLabelText(T,y,l.yhoverformat),L.name="",x.push(L),m[y]=L)}return x}function a(s,f,c,p){var v=s.cd,T=s.ya,l=v[0].trace,g=v[0].t,x=n(s,f,c,p);if(!x)return[];var A=x.index,M=v[A],_=x.index=M.i,w=M.dir;function m(F){return g.labels[F]+h.hoverLabelText(T,l[F][_],l.yhoverformat)}var u=M.hi||l.hoverinfo||"",d=u.split("+"),y=u==="all",I=y||d.indexOf("y")!==-1,L=y||d.indexOf("text")!==-1,z=I?[m("open"),m("high"),m("low"),m("close")+" "+r[w]]:[];return L&&e(M,l,z),x.extraText=z.join("
"),x.y0=x.y1=T.c2p(M.yc,!0),[x]}G.exports={hoverPoints:o,hoverSplit:i,hoverOnPoints:a}}}),JL=Ge({"src/traces/ohlc/select.js"(K,G){G.exports=function(b,S){var E=b.cd,e=b.xaxis,t=b.yaxis,r=[],o,n=E[0].t.bPos||0;if(S===!1)for(o=0;of?function(l){return l<=0}:function(l){return l>=0};n.c2g=function(l){var g=n.c2l(l)-s;return(T(g)?g:0)+v},n.g2c=function(l){return n.l2c(l+s-v)},n.g2p=function(l){return l*p},n.c2p=function(l){return n.g2p(n.c2g(l))}}}function t(n,i){return i==="degrees"?S(n):n}function r(n,i){return i==="degrees"?E(n):n}function o(n,i){var a=n.type;if(a==="linear"){var s=n.d2c,f=n.c2d;n.d2c=function(c,p){return t(s(c),p)},n.c2d=function(c,p){return f(r(c,p))}}n.makeCalcdata=function(c,p){var v=c[p],T=c._length,l,g,x=function(m){return n.d2c(m,c.thetaunit)};if(v)for(l=new Array(T),g=0;g0?m:1/0},M=S(x,A),_=h.mod(M+1,x.length);return[x[M],x[_]]}function p(g){return Math.abs(g)>1e-10?g:0}function v(g,x,A){x=x||0,A=A||0;for(var M=g.length,_=new Array(M),w=0;w0?1:0}function b(r){var o=r[0],n=r[1];if(!isFinite(o)||!isFinite(n))return[1,0];var i=(o+1)*(o+1)+n*n;return[(o*o+n*n-1)/i,2*n/i]}function S(r,o){var n=o[0],i=o[1];return[n*r.radius+r.cx,-i*r.radius+r.cy]}function E(r,o){return o*r.radius}function e(r,o,n,i){var a=S(r,b([n,o])),s=a[0],f=a[1],c=S(r,b([i,o])),p=c[0],v=c[1];if(o===0)return["M"+s+","+f,"L"+p+","+v].join(" ");var T=E(r,1/Math.abs(o));return["M"+s+","+f,"A"+T+","+T+" 0 0,"+(o<0?1:0)+" "+p+","+v].join(" ")}function t(r,o,n,i){var a=E(r,1/(o+1)),s=S(r,b([o,n])),f=s[0],c=s[1],p=S(r,b([o,i])),v=p[0],T=p[1];if(h(n)!==h(i)){var l=S(r,b([o,0])),g=l[0],x=l[1];return["M"+f+","+c,"A"+a+","+a+" 0 0,"+(0st?(ct=ie,at=ie*st,Ae=(de-at)/$.h/2,et=[H[0],H[1]],Pe=[ae[0]+Ae,ae[1]-Ae]):(ct=de/st,at=de,Ae=(ie-ct)/$.w/2,et=[H[0]+Ae,H[1]-Ae],Pe=[ae[0],ae[1]]),ee.xLength2=ct,ee.yLength2=at,ee.xDomain2=et,ee.yDomain2=Pe;var pe=ee.xOffset2=$.l+$.w*et[0],Ne=ee.yOffset2=$.t+$.h*(1-Pe[1]),ut=ee.radius=ct/Fe,dt=ee.innerRadius=ee.getHole(V)*ut,nt=ee.cx=pe-ut*Le[0],Ft=ee.cy=Ne+ut*Le[3],Nt=ee.cxx=nt-pe,Qt=ee.cyy=Ft-Ne,ar=ue.side,kr;ar==="counterclockwise"?(kr=ar,ar="top"):ar==="clockwise"&&(kr=ar,ar="bottom"),ee.radialAxis=ee.mockAxis(ce,V,ue,{_id:"x",side:ar,_trueSide:kr,domain:[dt/$.w,ut/$.w]}),ee.angularAxis=ee.mockAxis(ce,V,te,{side:"right",domain:[0,Math.PI],autorange:!1}),ee.doAutoRange(ce,V),ee.updateAngularAxis(ce,V),ee.updateRadialAxis(ce,V),ee.updateRadialAxisTitle(ce,V),ee.xaxis=ee.mockCartesianAxis(ce,V,{_id:"x",domain:et}),ee.yaxis=ee.mockCartesianAxis(ce,V,{_id:"y",domain:Pe});var Er=ee.pathSubplot();ee.clipPaths.forTraces.select("path").attr("d",Er).attr("transform",t(Nt,Qt)),ne.frontplot.attr("transform",t(pe,Ne)).call(o.setClipUrl,ee._hasClipOnAxisFalse?null:ee.clipIds.forTraces,ee.gd),ne.bg.attr("d",Er).attr("transform",t(nt,Ft)).call(r.fill,V.bgcolor)},j.mockAxis=function(ce,V,ee,ne){var $=E.extendFlat({},ee,ne);return s($,V,ce),$},j.mockCartesianAxis=function(ce,V,ee){var ne=this,$=ne.isSmith,ue=ee._id,te=E.extendFlat({type:"linear"},ee);a(te,ce);var H={x:[0,2],y:[1,3]};return te.setRange=function(){var ae=ne.sectorBBox,ie=H[ue],de=ne.radialAxis._rl,Se=(de[1]-de[0])/(1-ne.getHole(V));te.range=[ae[ie[0]]*Se,ae[ie[1]]*Se]},te.isPtWithinRange=ue==="x"&&!$?function(ae){return ne.isPtInside(ae)}:function(){return!0},te.setRange(),te.setScale(),te},j.doAutoRange=function(ce,V){var ee=this,ne=ee.gd,$=ee.radialAxis,ue=ee.getRadial(V);f(ne,$);var te=$.range;if(ue.range=te.slice(),ue._input.range=te.slice(),$._rl=[$.r2l(te[0],null,"gregorian"),$.r2l(te[1],null,"gregorian")],$.minallowed!==void 0){var H=$.r2l($.minallowed);$._rl[0]>$._rl[1]?$._rl[1]=Math.max($._rl[1],H):$._rl[0]=Math.max($._rl[0],H)}if($.maxallowed!==void 0){var ae=$.r2l($.maxallowed);$._rl[0]<$._rl[1]?$._rl[1]=Math.min($._rl[1],ae):$._rl[0]=Math.min($._rl[0],ae)}},j.updateRadialAxis=function(ce,V){var ee=this,ne=ee.gd,$=ee.layers,ue=ee.radius,te=ee.innerRadius,H=ee.cx,ae=ee.cy,ie=ee.getRadial(V),de=N(ee.getSector(V)[0],360),Se=ee.radialAxis,Le=te90&&de<=270&&(Se.tickangle=180);var ze=Fe?function(ut){var dt=z(ee,y([ut.x,0]));return t(dt[0]-H,dt[1]-ae)}:function(ut){return t(Se.l2p(ut.x)+te,0)},Ye=Fe?function(ut){return L(ee,ut.x,-1/0,1/0)}:function(ut){return ee.pathArc(Se.r2p(ut.x)+te)},st=Z(ie);if(ee.radialTickLayout!==st&&($["radial-axis"].selectAll(".xtick").remove(),ee.radialTickLayout=st),Le){Se.setScale();var ct=0,at=Fe?(Se.tickvals||[]).filter(function(ut){return ut>=0}).map(function(ut){return i.tickText(Se,ut,!0,!1)}):i.calcTicks(Se),et=Fe?at:i.clipEnds(Se,at),Pe=i.getTickSigns(Se)[2];Fe&&((Se.ticks==="top"&&Se.side==="bottom"||Se.ticks==="bottom"&&Se.side==="top")&&(Pe=-Pe),Se.ticks==="top"&&Se.side==="top"&&(ct=-Se.ticklen),Se.ticks==="bottom"&&Se.side==="bottom"&&(ct=Se.ticklen)),i.drawTicks(ne,Se,{vals:at,layer:$["radial-axis"],path:i.makeTickPath(Se,0,Pe),transFn:ze,crisp:!1}),i.drawGrid(ne,Se,{vals:et,layer:$["radial-grid"],path:Ye,transFn:E.noop,crisp:!1}),i.drawLabels(ne,Se,{vals:at,layer:$["radial-axis"],transFn:ze,labelFns:i.makeLabelFns(Se,ct)})}var Ae=ee.radialAxisAngle=ee.vangles?R(fe(B(ie.angle),ee.vangles)):ie.angle,pe=t(H,ae),Ne=pe+e(-Ae);le($["radial-axis"],Le&&(ie.showticklabels||ie.ticks),{transform:Ne}),le($["radial-grid"],Le&&ie.showgrid,{transform:Fe?"":pe}),le($["radial-line"].select("line"),Le&&ie.showline,{x1:Fe?-ue:te,y1:0,x2:ue,y2:0,transform:Ne}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},j.updateRadialAxisTitle=function(ce,V,ee){if(!this.isSmith){var ne=this,$=ne.gd,ue=ne.radius,te=ne.cx,H=ne.cy,ae=ne.getRadial(V),ie=ne.id+"title",de=0;if(ae.title){var Se=o.bBox(ne.layers["radial-axis"].node()).height,Le=ae.title.font.size,Fe=ae.side;de=Fe==="top"?Le:Fe==="counterclockwise"?-(Se+Le*.4):Se+Le*.8}var ze=ee!==void 0?ee:ne.radialAxisAngle,Ye=B(ze),st=Math.cos(Ye),ct=Math.sin(Ye),at=te+ue/2*st+de*ct,et=H-ue/2*ct+de*st;ne.layers["radial-axis-title"]=T.draw($,ie,{propContainer:ae,propName:ne.id+".radialaxis.title.text",placeholder:F($,"Click to enter radial axis title"),attributes:{x:at,y:et,"text-anchor":"middle"},transform:{rotate:-ze}})}},j.updateAngularAxis=function(ce,V){var ee=this,ne=ee.gd,$=ee.layers,ue=ee.radius,te=ee.innerRadius,H=ee.cx,ae=ee.cy,ie=ee.getAngular(V),de=ee.angularAxis,Se=ee.isSmith;Se||(ee.fillViewInitialKey("angularaxis.rotation",ie.rotation),de.setGeometry(),de.setScale());var Le=Se?function(dt){var nt=z(ee,y([0,dt.x]));return Math.atan2(nt[0]-H,nt[1]-ae)-Math.PI/2}:function(dt){return de.t2g(dt.x)};de.type==="linear"&&de.thetaunit==="radians"&&(de.tick0=R(de.tick0),de.dtick=R(de.dtick));var Fe=function(dt){return t(H+ue*Math.cos(dt),ae-ue*Math.sin(dt))},ze=Se?function(dt){var nt=z(ee,y([0,dt.x]));return t(nt[0],nt[1])}:function(dt){return Fe(Le(dt))},Ye=Se?function(dt){var nt=z(ee,y([0,dt.x])),Ft=Math.atan2(nt[0]-H,nt[1]-ae)-Math.PI/2;return t(nt[0],nt[1])+e(-R(Ft))}:function(dt){var nt=Le(dt);return Fe(nt)+e(-R(nt))},st=Se?function(dt){return I(ee,dt.x,0,1/0)}:function(dt){var nt=Le(dt),Ft=Math.cos(nt),Nt=Math.sin(nt);return"M"+[H+te*Ft,ae-te*Nt]+"L"+[H+ue*Ft,ae-ue*Nt]},ct=i.makeLabelFns(de,0),at=ct.labelStandoff,et={};et.xFn=function(dt){var nt=Le(dt);return Math.cos(nt)*at},et.yFn=function(dt){var nt=Le(dt),Ft=Math.sin(nt)>0?.2:1;return-Math.sin(nt)*(at+dt.fontSize*Ft)+Math.abs(Math.cos(nt))*(dt.fontSize*w)},et.anchorFn=function(dt){var nt=Le(dt),Ft=Math.cos(nt);return Math.abs(Ft)<.1?"middle":Ft>0?"start":"end"},et.heightFn=function(dt,nt,Ft){var Nt=Le(dt);return-.5*(1+Math.sin(Nt))*Ft};var Pe=Z(ie);ee.angularTickLayout!==Pe&&($["angular-axis"].selectAll("."+de._id+"tick").remove(),ee.angularTickLayout=Pe);var Ae=Se?[1/0].concat(de.tickvals||[]).map(function(dt){return i.tickText(de,dt,!0,!1)}):i.calcTicks(de);Se&&(Ae[0].text="∞",Ae[0].fontSize*=1.75);var pe;if(V.gridshape==="linear"?(pe=Ae.map(Le),E.angleDelta(pe[0],pe[1])<0&&(pe=pe.slice().reverse())):pe=null,ee.vangles=pe,de.type==="category"&&(Ae=Ae.filter(function(dt){return E.isAngleInsideSector(Le(dt),ee.sectorInRad)})),de.visible){var Ne=de.ticks==="inside"?-1:1,ut=(de.linewidth||1)/2;i.drawTicks(ne,de,{vals:Ae,layer:$["angular-axis"],path:"M"+Ne*ut+",0h"+Ne*de.ticklen,transFn:Ye,crisp:!1}),i.drawGrid(ne,de,{vals:Ae,layer:$["angular-grid"],path:st,transFn:E.noop,crisp:!1}),i.drawLabels(ne,de,{vals:Ae,layer:$["angular-axis"],repositionOnUpdate:!0,transFn:ze,labelFns:et})}le($["angular-line"].select("path"),ie.showline,{d:ee.pathSubplot(),transform:t(H,ae)}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},j.updateFx=function(ce,V){if(!this.gd._context.staticPlot){var ee=!this.isSmith;ee&&(this.updateAngularDrag(ce),this.updateRadialDrag(ce,V,0),this.updateRadialDrag(ce,V,1)),this.updateHoverAndMainDrag(ce)}},j.updateHoverAndMainDrag=function(ce){var V=this,ee=V.isSmith,ne=V.gd,$=V.layers,ue=ce._zoomlayer,te=m.MINZOOM,H=m.OFFEDGE,ae=V.radius,ie=V.innerRadius,de=V.cx,Se=V.cy,Le=V.cxx,Fe=V.cyy,ze=V.sectorInRad,Ye=V.vangles,st=V.radialAxis,ct=u.clampTiny,at=u.findXYatLength,et=u.findEnclosingVertexAngles,Pe=m.cornerHalfWidth,Ae=m.cornerLen/2,pe,Ne,ut=c.makeDragger($,"path","maindrag",ce.dragmode===!1?"none":"crosshair");h.select(ut).attr("d",V.pathSubplot()).attr("transform",t(de,Se)),ut.onmousemove=function(mr){v.hover(ne,mr,V.id),ne._fullLayout._lasthover=ut,ne._fullLayout._hoversubplot=V.id},ut.onmouseout=function(mr){ne._dragging||p.unhover(ne,mr)};var dt={element:ut,gd:ne,subplot:V.id,plotinfo:{id:V.id,xaxis:V.xaxis,yaxis:V.yaxis},xaxes:[V.xaxis],yaxes:[V.yaxis]},nt,Ft,Nt,Qt,ar,kr,Er,$r,Sr;function Ur(mr,vr){return Math.sqrt(mr*mr+vr*vr)}function Mt(mr,vr){return Ur(mr-Le,vr-Fe)}function je(mr,vr){return Math.atan2(Fe-vr,mr-Le)}function Je(mr,vr){return[mr*Math.cos(vr),mr*Math.sin(-vr)]}function ke(mr,vr){if(mr===0)return V.pathSector(2*Pe);var Nr=Ae/mr,kn=vr-Nr,$n=vr+Nr,Vn=Math.max(0,Math.min(mr,ae)),ra=Vn-Pe,na=Vn+Pe;return"M"+Je(ra,kn)+"A"+[ra,ra]+" 0,0,0 "+Je(ra,$n)+"L"+Je(na,$n)+"A"+[na,na]+" 0,0,1 "+Je(na,kn)+"Z"}function xe(mr,vr,Nr){if(mr===0)return V.pathSector(2*Pe);var kn=Je(mr,vr),$n=Je(mr,Nr),Vn=ct((kn[0]+$n[0])/2),ra=ct((kn[1]+$n[1])/2),na,Un;if(Vn&&ra){var ka=ra/Vn,Va=-1/ka,sr=at(Pe,ka,Vn,ra);na=at(Ae,Va,sr[0][0],sr[0][1]),Un=at(Ae,Va,sr[1][0],sr[1][1])}else{var Vt,or;ra?(Vt=Ae,or=Pe):(Vt=Pe,or=Ae),na=[[Vn-Vt,ra-or],[Vn+Vt,ra-or]],Un=[[Vn-Vt,ra+or],[Vn+Vt,ra+or]]}return"M"+na.join("L")+"L"+Un.reverse().join("L")+"Z"}function ye(){Nt=null,Qt=null,ar=V.pathSubplot(),kr=!1;var mr=ne._fullLayout[V.id];Er=b(mr.bgcolor).getLuminance(),$r=c.makeZoombox(ue,Er,de,Se,ar),$r.attr("fill-rule","evenodd"),Sr=c.makeCorners(ue,de,Se),x(ne)}function Ee(mr,vr){return vr=Math.max(Math.min(vr,ae),ie),mrte?(mr-1&&mr===1&&g(vr,ne,[V.xaxis],[V.yaxis],V.id,dt),Nr.indexOf("event")>-1&&v.click(ne,vr,V.id)}dt.prepFn=function(mr,vr,Nr){var kn=ne._fullLayout.dragmode,$n=ut.getBoundingClientRect();ne._fullLayout._calcInverseTransform(ne);var Vn=ne._fullLayout._invTransform;pe=ne._fullLayout._invScaleX,Ne=ne._fullLayout._invScaleY;var ra=E.apply3DTransform(Vn)(vr-$n.left,Nr-$n.top);if(nt=ra[0],Ft=ra[1],Ye){var na=u.findPolygonOffset(ae,ze[0],ze[1],Ye);nt+=Le+na[0],Ft+=Fe+na[1]}switch(kn){case"zoom":dt.clickFn=xr,ee||(Ye?dt.moveFn=Ct:dt.moveFn=Qe,dt.doneFn=Ot,ye());break;case"select":case"lasso":l(mr,vr,Nr,dt,kn);break}},p.init(dt)},j.updateRadialDrag=function(ce,V,ee){var ne=this,$=ne.gd,ue=ne.layers,te=ne.radius,H=ne.innerRadius,ae=ne.cx,ie=ne.cy,de=ne.radialAxis,Se=m.radialDragBoxSize,Le=Se/2;if(!de.visible)return;var Fe=B(ne.radialAxisAngle),ze=de._rl,Ye=ze[0],st=ze[1],ct=ze[ee],at=.75*(ze[1]-ze[0])/(1-ne.getHole(V))/te,et,Pe,Ae;ee?(et=ae+(te+Le)*Math.cos(Fe),Pe=ie-(te+Le)*Math.sin(Fe),Ae="radialdrag"):(et=ae+(H-Le)*Math.cos(Fe),Pe=ie-(H-Le)*Math.sin(Fe),Ae="radialdrag-inner");var pe=c.makeRectDragger(ue,Ae,"crosshair",-Le,-Le,Se,Se),Ne={element:pe,gd:$};ce.dragmode===!1&&(Ne.dragmode=!1),le(h.select(pe),de.visible&&H0!=(ee?nt>Ye:nt=90||$>90&&ue>=450?Fe=1:H<=0&&ie<=0?Fe=0:Fe=Math.max(H,ie),$<=180&&ue>=180||$>180&&ue>=540?de=-1:te>=0&&ae>=0?de=0:de=Math.min(te,ae),$<=270&&ue>=270||$>270&&ue>=630?Se=-1:H>=0&&ie>=0?Se=0:Se=Math.min(H,ie),ue>=360?Le=1:te<=0&&ae<=0?Le=0:Le=Math.max(te,ae),[de,Se,Le,Fe]}function fe(ce,V){var ee=function($){return E.angleDist(ce,$)},ne=E.findIndexOfMin(V,ee);return V[ne]}function le(ce,V,ee){return V?(ce.attr("display",null),ce.attr(ee)):ce&&ce.attr("display","none"),ce}}}),n8=Ge({"src/plots/polar/layout_attributes.js"(K,G){var h=Xf(),b=id(),S=Cc().attributes,E=_n().extendFlat,e=Hc().overrideAll,t=e({color:b.color,showline:E({},b.showline,{dflt:!0}),linecolor:b.linecolor,linewidth:b.linewidth,showgrid:E({},b.showgrid,{dflt:!0}),gridcolor:b.gridcolor,gridwidth:b.gridwidth,griddash:b.griddash},"plot","from-root"),r=e({tickmode:b.minor.tickmode,nticks:b.nticks,tick0:b.tick0,dtick:b.dtick,tickvals:b.tickvals,ticktext:b.ticktext,ticks:b.ticks,ticklen:b.ticklen,tickwidth:b.tickwidth,tickcolor:b.tickcolor,ticklabelstep:b.ticklabelstep,showticklabels:b.showticklabels,labelalias:b.labelalias,minorloglabels:b.minorloglabels,showtickprefix:b.showtickprefix,tickprefix:b.tickprefix,showticksuffix:b.showticksuffix,ticksuffix:b.ticksuffix,showexponent:b.showexponent,exponentformat:b.exponentformat,minexponent:b.minexponent,separatethousands:b.separatethousands,tickfont:b.tickfont,tickangle:b.tickangle,tickformat:b.tickformat,tickformatstops:b.tickformatstops,layer:b.layer},"plot","from-root"),o={visible:E({},b.visible,{dflt:!0}),type:E({},b.type,{values:["-","linear","log","date","category"]}),autotypenumbers:b.autotypenumbers,autorangeoptions:{minallowed:b.autorangeoptions.minallowed,maxallowed:b.autorangeoptions.maxallowed,clipmin:b.autorangeoptions.clipmin,clipmax:b.autorangeoptions.clipmax,include:b.autorangeoptions.include,editType:"plot"},autorange:E({},b.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:E({},b.minallowed,{editType:"plot"}),maxallowed:E({},b.maxallowed,{editType:"plot"}),range:E({},b.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:b.categoryorder,categoryarray:b.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:b.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:E({},b.title.text,{editType:"plot",dflt:""}),font:E({},b.title.font,{editType:"plot"}),editType:"plot"},hoverformat:b.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(o,t,r);var n={visible:E({},b.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:b.autotypenumbers,categoryorder:b.categoryorder,categoryarray:b.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:b.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(n,t,r),G.exports={domain:S({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:h.background},radialaxis:o,angularaxis:n,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),hO=Ge({"src/plots/polar/layout_defaults.js"(K,G){var h=_n(),b=go(),S=_u(),E=q0(),e=Bd().getSubplotData,t=rg(),r=z0(),o=Fp(),n=Pv(),i=zf(),a=Hu(),s=$T(),f=cm(),c=n8(),p=e8(),v=a6(),T=v.axisNames;function l(x,A,M,_){var w=M("bgcolor");_.bgColor=b.combine(w,_.paper_bgcolor);var m=M("sector");M("hole");var u=e(_.fullData,v.name,_.id),d=_.layoutOut,y;function I(Se,Le){return M(y+"."+Se,Le)}for(var L=0;L")}}G.exports={hoverPoints:b,makeHoverPointText:S}}}),pO=Ge({"src/traces/scatterpolar/index.js"(K,G){G.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:o6(),categories:["polar","symbols","showLegend","scatter-like"],attributes:hS(),supplyDefaults:s6().supplyDefaults,colorbar:Zf(),formatLabels:l6(),calc:dO(),plot:vO(),style:Ph().style,styleOnSelect:Ph().styleOnSelect,hoverPoints:u6().hoverPoints,selectPoints:ug(),meta:{}}}}),mO=Ge({"lib/scatterpolar.js"(K,G){G.exports=pO()}}),a8=Ge({"src/traces/scatterpolargl/attributes.js"(K,G){var h=hS(),{cliponaxis:b,hoveron:S}=h,E=Gi(h,["cliponaxis","hoveron"]),{connectgaps:e,line:{color:t,dash:r,width:o},fill:n,fillcolor:i,marker:a,textfont:s,textposition:f}=nS();G.exports=wo(Hi({},E),{connectgaps:e,fill:n,fillcolor:i,line:{color:t,dash:r,editType:"calc",width:o},marker:a,textfont:s,textposition:f})}}),gO=Ge({"src/traces/scatterpolargl/defaults.js"(K,G){var h=_n(),b=uu(),S=s6().handleRThetaDefaults,E=Jd(),e=Hp(),t=op(),r=Nd(),o=c0().PTS_LINESONLY,n=a8();G.exports=function(a,s,f,c){function p(T,l){return h.coerce(a,s,n,T,l)}var v=S(a,s,c,p);if(!v){s.visible=!1;return}p("thetaunit"),p("mode",v=r&&(_.marker.cluster=g.tree),_.marker&&(_.markerSel.positions=_.markerUnsel.positions=_.marker.positions=d),_.line&&d.length>1&&t.extendFlat(_.line,e.linePositions(i,l,d)),_.text&&(t.extendFlat(_.text,{positions:d},e.textPosition(i,l,_.text,_.marker)),t.extendFlat(_.textSel,{positions:d},e.textPosition(i,l,_.text,_.markerSel)),t.extendFlat(_.textUnsel,{positions:d},e.textPosition(i,l,_.text,_.markerUnsel))),_.fill&&!p.fill2d&&(p.fill2d=!0),_.marker&&!p.scatter2d&&(p.scatter2d=!0),_.line&&!p.line2d&&(p.line2d=!0),_.text&&!p.glText&&(p.glText=!0),p.lineOptions.push(_.line),p.fillOptions.push(_.fill),p.markerOptions.push(_.marker),p.markerSelectedOptions.push(_.markerSel),p.markerUnselectedOptions.push(_.markerUnsel),p.textOptions.push(_.text),p.textSelectedOptions.push(_.textSel),p.textUnselectedOptions.push(_.textUnsel),p.selectBatch.push([]),p.unselectBatch.push([]),g.x=y,g.y=I,g.rawx=y,g.rawy=I,g.r=A,g.theta=M,g.positions=d,g._scene=p,g.index=p.count,p.count++}}),S(i,a,s)}},G.exports.reglPrecompiled=o}}),TO=Ge({"src/traces/scatterpolargl/index.js"(K,G){var h=bO();h.plot=wO(),G.exports=h}}),AO=Ge({"lib/scatterpolargl.js"(K,G){G.exports=TO()}}),i8=Ge({"src/traces/barpolar/attributes.js"(K,G){var{hovertemplateAttrs:h,templatefallbackAttrs:b}=Sl(),S=Ji().extendFlat,E=hS(),e=qh();G.exports={r:E.r,theta:E.theta,r0:E.r0,dr:E.dr,theta0:E.theta0,dtheta:E.dtheta,thetaunit:E.thetaunit,base:S({},e.base,{}),offset:S({},e.offset,{}),width:S({},e.width,{}),text:S({},e.text,{}),hovertext:S({},e.hovertext,{}),marker:t(),hoverinfo:E.hoverinfo,hovertemplate:h(),hovertemplatefallback:b(),selected:e.selected,unselected:e.unselected};function t(){var r=S({},e.marker);return delete r.cornerradius,r}}}),o8=Ge({"src/traces/barpolar/layout_attributes.js"(K,G){G.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),SO=Ge({"src/traces/barpolar/defaults.js"(K,G){var h=_n(),b=s6().handleRThetaDefaults,S=d0(),E=i8();G.exports=function(t,r,o,n){function i(s,f){return h.coerce(t,r,E,s,f)}var a=b(t,r,n,i);if(!a){r.visible=!1;return}i("thetaunit"),i("base"),i("offset"),i("width"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),S(t,r,i,o,n),h.coerceSelectionMarkerOpacity(r,i)}}}),MO=Ge({"src/traces/barpolar/layout_defaults.js"(K,G){var h=_n(),b=o8();G.exports=function(S,E,e){var t={},r;function o(a,s){return h.coerce(S[r]||{},E[r],b,a,s)}for(var n=0;n0?(c=s,p=f):(c=f,p=s);var v=e.findEnclosingVertexAngles(c,r.vangles)[0],T=e.findEnclosingVertexAngles(p,r.vangles)[1],l=[v,(c+p)/2,T];return e.pathPolygonAnnulus(i,a,c,p,l,o,n)}:function(i,a,s,f){return S.pathAnnulus(i,a,s,f,o,n)}}}}),kO=Ge({"src/traces/barpolar/hover.js"(K,G){var h=Yf(),b=_n(),S=Lc().getTraceColor,E=b.fillText,e=u6().makeHoverPointText,t=i6().isPtInsidePolygon;G.exports=function(o,n,i){var a=o.cd,s=a[0].trace,f=o.subplot,c=f.radialAxis,p=f.angularAxis,v=f.vangles,T=v?t:b.isPtInsideSector,l=o.maxHoverDistance,g=p._period||2*Math.PI,x=Math.abs(c.g2p(Math.sqrt(n*n+i*i))),A=Math.atan2(i,n);c.range[0]>c.range[1]&&(A+=Math.PI);var M=function(u){return T(x,A,[u.rp0,u.rp1],[u.thetag0,u.thetag1],v)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/g)-1+(u.rp1-x)/(u.rp1-u.rp0)-1:1/0};if(h.getClosest(a,M,o),o.index!==!1){var _=o.index,w=a[_];o.x0=o.x1=w.ct[0],o.y0=o.y1=w.ct[1];var m=b.extendFlat({},w,{r:w.s,theta:w.p});return E(w,s,o),e(m,s,f,o),o.hovertemplate=s.hovertemplate,o.color=S(s,w),o.xLabelVal=o.yLabelVal=void 0,w.s<0&&(o.idealAlign="left"),[o]}}}}),CO=Ge({"src/traces/barpolar/index.js"(K,G){G.exports={moduleType:"trace",name:"barpolar",basePlotModule:o6(),categories:["polar","bar","showLegend"],attributes:i8(),layoutAttributes:o8(),supplyDefaults:SO(),supplyLayoutDefaults:MO(),calc:s8().calc,crossTraceCalc:s8().crossTraceCalc,plot:EO(),colorbar:Zf(),formatLabels:l6(),style:xd().style,styleOnSelect:xd().styleOnSelect,hoverPoints:kO(),selectPoints:Tm(),meta:{}}}}),LO=Ge({"lib/barpolar.js"(K,G){G.exports=CO()}}),l8=Ge({"src/plots/smith/constants.js"(K,G){G.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),u8=Ge({"src/plots/smith/layout_attributes.js"(K,G){var h=Xf(),b=id(),S=Cc().attributes,E=_n().extendFlat,e=Hc().overrideAll,t=e({color:b.color,showline:E({},b.showline,{dflt:!0}),linecolor:b.linecolor,linewidth:b.linewidth,showgrid:E({},b.showgrid,{dflt:!0}),gridcolor:b.gridcolor,gridwidth:b.gridwidth,griddash:b.griddash},"plot","from-root"),r=e({ticklen:b.ticklen,tickwidth:E({},b.tickwidth,{dflt:2}),tickcolor:b.tickcolor,showticklabels:b.showticklabels,labelalias:b.labelalias,showtickprefix:b.showtickprefix,tickprefix:b.tickprefix,showticksuffix:b.showticksuffix,ticksuffix:b.ticksuffix,tickfont:b.tickfont,tickformat:b.tickformat,hoverformat:b.hoverformat,layer:b.layer},"plot","from-root"),o=E({visible:E({},b.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:E({},b.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},t,r),n=E({visible:E({},b.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:b.ticks,editType:"calc"},t,r);G.exports={domain:S({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:h.background},realaxis:o,imaginaryaxis:n,editType:"calc"}}}),PO=Ge({"src/plots/smith/layout_defaults.js"(K,G){var h=_n(),b=go(),S=_u(),E=q0(),e=Bd().getSubplotData,t=Pv(),r=Fp(),o=Hu(),n=rp(),i=u8(),a=l8(),s=a.axisNames,f=p(function(v){return h.isTypedArray(v)&&(v=Array.from(v)),v.slice().reverse().map(function(T){return-T}).concat([0]).concat(v)},String);function c(v,T,l,g){var x=l("bgcolor");g.bgColor=b.combine(x,g.paper_bgcolor);var A=e(g.fullData,a.name,g.id),M=g.layoutOut,_;function w(j,Z){return l(_+"."+j,Z)}for(var m=0;m")}}G.exports={hoverPoints:b,makeHoverPointText:S}}}),BO=Ge({"src/traces/scattersmith/index.js"(K,G){G.exports={moduleType:"trace",name:"scattersmith",basePlotModule:RO(),categories:["smith","symbols","showLegend","scatter-like"],attributes:c8(),supplyDefaults:IO(),colorbar:Zf(),formatLabels:DO(),calc:zO(),plot:OO(),style:Ph().style,styleOnSelect:Ph().styleOnSelect,hoverPoints:FO().hoverPoints,selectPoints:ug(),meta:{}}}}),NO=Ge({"lib/scattersmith.js"(K,G){G.exports=BO()}}),Vv=Ge({"node_modules/world-calendars/dist/main.js"(K,G){var h=Ad();function b(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}h(b.prototype,{instance:function(o,n){o=(o||"gregorian").toLowerCase(),n=n||"";var i=this._localCals[o+"-"+n];if(!i&&this.calendars[o]&&(i=new this.calendars[o](n),this._localCals[o+"-"+n]=i),!i)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,o);return i},newDate:function(o,n,i,a,s){return a=(o!=null&&o.year?o.calendar():typeof a=="string"?this.instance(a,s):a)||this.instance(),a.newDate(o,n,i)},substituteDigits:function(o){return function(n){return(n+"").replace(/[0-9]/g,function(i){return o[i]})}},substituteChineseDigits:function(o,n){return function(i){for(var a="",s=0;i>0;){var f=i%10;a=(f===0?"":o[f]+n[s])+a,s++,i=Math.floor(i/10)}return a.indexOf(o[1]+n[1])===0&&(a=a.substr(1)),a||o[0]}}});function S(o,n,i,a){if(this._calendar=o,this._year=n,this._month=i,this._day=a,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function E(o,n){return o=""+o,"000000".substring(0,n-o.length)+o}h(S.prototype,{newDate:function(o,n,i){return this._calendar.newDate(o??this,n,i)},year:function(o){return arguments.length===0?this._year:this.set(o,"y")},month:function(o){return arguments.length===0?this._month:this.set(o,"m")},day:function(o){return arguments.length===0?this._day:this.set(o,"d")},date:function(o,n,i){if(!this._calendar.isValid(o,n,i))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=o,this._month=n,this._day=i,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(o,n){return this._calendar.add(this,o,n)},set:function(o,n){return this._calendar.set(this,o,n)},compareTo:function(o){if(this._calendar.name!==o._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,o._calendar.local.name);var n=this._year!==o._year?this._year-o._year:this._month!==o._month?this.monthOfYear()-o.monthOfYear():this._day-o._day;return n===0?0:n<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(o){return this._calendar.fromJD(o)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(o){return this._calendar.fromJSDate(o)},toString:function(){return(this.year()<0?"-":"")+E(Math.abs(this.year()),4)+"-"+E(this.month(),2)+"-"+E(this.day(),2)}});function e(){this.shortYearCutoff="+10"}h(e.prototype,{_validateLevel:0,newDate:function(o,n,i){return o==null?this.today():(o.year&&(this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),i=o.day(),n=o.month(),o=o.year()),new S(this,o,n,i))},today:function(){return this.fromJSDate(new Date)},epoch:function(o){var n=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return n.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(o){var n=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(n.year()<0?"-":"")+E(Math.abs(n.year()),4)},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(o,n){var i=this._validate(o,n,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(i.month()+this.monthsInYear(i)-this.firstMonth)%this.monthsInYear(i)+this.minMonth},fromMonthOfYear:function(o,n){var i=(n+this.firstMonth-2*this.minMonth)%this.monthsInYear(o)+this.minMonth;return this._validate(o,i,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),i},daysInYear:function(o){var n=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(n)?366:365},dayOfYear:function(o,n,i){var a=this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return a.toJD()-this.newDate(a.year(),this.fromMonthOfYear(a.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(o,n,i){var a=this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(a))+2)%this.daysInWeek()},extraInfo:function(o,n,i){return this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(o,n,i){return this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(o,this._add(o,n,i),n,i)},_add:function(o,n,i){if(this._validateLevel++,i==="d"||i==="w"){var a=o.toJD()+n*(i==="w"?this.daysInWeek():1),s=o.calendar().fromJD(a);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var f=o.year()+(i==="y"?n:0),c=o.monthOfYear()+(i==="m"?n:0),s=o.day(),p=function(l){for(;cg-1+l.minMonth;)f++,c-=g,g=l.monthsInYear(f)};i==="y"?(o.month()!==this.fromMonthOfYear(f,c)&&(c=this.newDate(f,o.month(),this.minDay).monthOfYear()),c=Math.min(c,this.monthsInYear(f)),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,c)))):i==="m"&&(p(this),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,c))));var v=[f,this.fromMonthOfYear(f,c),s];return this._validateLevel--,v}catch(T){throw this._validateLevel--,T}},_correctAdd:function(o,n,i,a){if(!this.hasYearZero&&(a==="y"||a==="m")&&(n[0]===0||o.year()>0!=n[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[a],f=i<0?-1:1;n=this._add(o,i*s[0]+f*s[1],s[2])}return o.date(n[0],n[1],n[2])},set:function(o,n,i){this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var a=i==="y"?n:o.year(),s=i==="m"?n:o.month(),f=i==="d"?n:o.day();return(i==="y"||i==="m")&&(f=Math.min(f,this.daysInMonth(a,s))),o.date(a,s,f)},isValid:function(o,n,i){this._validateLevel++;var a=this.hasYearZero||o!==0;if(a){var s=this.newDate(o,n,this.minDay);a=n>=this.minMonth&&n-this.minMonth=this.minDay&&i-this.minDay13.5?13:1),T=s-(v>2.5?4716:4715);return T<=0&&T--,this.newDate(T,v,p)},toJSDate:function(o,n,i){var a=this._validate(o,n,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(a.year(),a.month()-1,a.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(o){return this.newDate(o.getFullYear(),o.getMonth()+1,o.getDate())}});var r=G.exports=new b;r.cdate=S,r.baseCalendar=e,r.calendars.gregorian=t}}),UO=Ge({"node_modules/world-calendars/dist/plus.js"(){var K=Ad(),G=Vv();K(G.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),G.local=G.regionalOptions[""],K(G.cdate.prototype,{formatDate:function(h,b){return typeof h!="string"&&(b=h,h=""),this._calendar.formatDate(h||"",this,b)}}),K(G.baseCalendar.prototype,{UNIX_EPOCH:G.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:G.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(h,b,S){if(typeof h!="string"&&(S=b,b=h,h=""),!b)return"";if(b.calendar()!==this)throw G.local.invalidFormat||G.regionalOptions[""].invalidFormat;h=h||this.local.dateFormat,S=S||{};var E=S.dayNamesShort||this.local.dayNamesShort,e=S.dayNames||this.local.dayNames,t=S.monthNumbers||this.local.monthNumbers,r=S.monthNamesShort||this.local.monthNamesShort,o=S.monthNames||this.local.monthNames;S.calculateWeek||this.local.calculateWeek;for(var n=function(x,A){for(var M=1;g+M1},i=function(x,A,M,_){var w=""+A;if(n(x,_))for(;w.length1},g=function(I,L){var z=l(I,L),F=[2,3,z?4:2,z?4:2,10,11,20]["oyYJ@!".indexOf(I)+1],N=new RegExp("^-?\\d{1,"+F+"}"),B=b.substring(m).match(N);if(!B)throw(G.local.missingNumberAt||G.regionalOptions[""].missingNumberAt).replace(/\{0\}/,m);return m+=B[0].length,parseInt(B[0],10)},x=this,A=function(){if(typeof o=="function"){l("m");var I=o.call(x,b.substring(m));return m+=I.length,I}return g("m")},M=function(I,L,z,F){for(var N=l(I,F)?z:L,B=0;B-1){f=1,c=p;for(var y=this.daysInMonth(s,f);c>y;y=this.daysInMonth(s,f))f++,c-=y}return a>-1?this.fromJD(a):this.newDate(s,f,c)},determineDate:function(h,b,S,E,e){S&&typeof S!="object"&&(e=E,E=S,S=null),typeof E!="string"&&(e=E,E="");var t=this,r=function(o){try{return t.parseDate(E,o,e)}catch{}o=o.toLowerCase();for(var n=(o.match(/^c/)&&S?S.newDate():null)||t.today(),i=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,a=i.exec(o);a;)n.add(parseInt(a[1],10),a[2]||"d"),a=i.exec(o);return n};return b=b?b.newDate():null,h=h==null?b:typeof h=="string"?r(h):typeof h=="number"?isNaN(h)||h===1/0||h===-1/0?b:t.today().add(h,"d"):t.newDate(h),h}})}}),jO=Ge({"node_modules/world-calendars/dist/calendars/chinese.js"(){var K=Vv(),G=Ad(),h=K.instance();function b(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}b.prototype=new K.baseCalendar,G(b.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(a,s){if(typeof a=="string"){var f=a.match(E);return f?f[0]:""}var c=this._validateYear(a),p=a.month(),v=""+this.toChineseMonth(c,p);return s&&v.length<2&&(v="0"+v),this.isIntercalaryMonth(c,p)&&(v+="i"),v},monthNames:function(a){if(typeof a=="string"){var s=a.match(e);return s?s[0]:""}var f=this._validateYear(a),c=a.month(),p=this.toChineseMonth(f,c),v=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][p-1];return this.isIntercalaryMonth(f,c)&&(v="闰"+v),v},monthNamesShort:function(a){if(typeof a=="string"){var s=a.match(t);return s?s[0]:""}var f=this._validateYear(a),c=a.month(),p=this.toChineseMonth(f,c),v=["一","二","三","四","五","六","七","八","九","十","十一","十二"][p-1];return this.isIntercalaryMonth(f,c)&&(v="闰"+v),v},parseMonth:function(a,s){a=this._validateYear(a);var f=parseInt(s),c;if(isNaN(f))s[0]==="闰"&&(c=!0,s=s.substring(1)),s[s.length-1]==="月"&&(s=s.substring(0,s.length-1)),f=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(s);else{var p=s[s.length-1];c=p==="i"||p==="I"}var v=this.toMonthIndex(a,f,c);return v},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(a,s){if(a.year&&(a=a.year()),typeof a!="number"||a<1888||a>2111)throw s.replace(/\{0\}/,this.local.name);return a},toMonthIndex:function(a,s,f){var c=this.intercalaryMonth(a),p=f&&s!==c;if(p||s<1||s>12)throw K.local.invalidMonth.replace(/\{0\}/,this.local.name);var v;return c?!f&&s<=c?v=s-1:v=s:v=s-1,v},toChineseMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var f=this.intercalaryMonth(a),c=f?12:11;if(s<0||s>c)throw K.local.invalidMonth.replace(/\{0\}/,this.local.name);var p;return f?s>13;return f},isIntercalaryMonth:function(a,s){a.year&&(a=a.year(),s=a.month());var f=this.intercalaryMonth(a);return!!f&&f===s},leapYear:function(a){return this.intercalaryMonth(a)!==0},weekOfYear:function(a,s,f){var c=this._validateYear(a,K.local.invalidyear),p=o[c-o[0]],v=p>>9&4095,T=p>>5&15,l=p&31,g;g=h.newDate(v,T,l),g.add(4-(g.dayOfWeek()||7),"d");var x=this.toJD(a,s,f)-g.toJD();return 1+Math.floor(x/7)},monthsInYear:function(a){return this.leapYear(a)?13:12},daysInMonth:function(a,s){a.year&&(s=a.month(),a=a.year()),a=this._validateYear(a);var f=r[a-r[0]],c=f>>13,p=c?12:11;if(s>p)throw K.local.invalidMonth.replace(/\{0\}/,this.local.name);var v=f&1<<12-s?30:29;return v},weekDay:function(a,s,f){return(this.dayOfWeek(a,s,f)||7)<6},toJD:function(a,s,f){var c=this._validate(a,v,f,K.local.invalidDate);a=this._validateYear(c.year()),s=c.month(),f=c.day();var p=this.isIntercalaryMonth(a,s),v=this.toChineseMonth(a,s),T=i(a,v,f,p);return h.toJD(T.year,T.month,T.day)},fromJD:function(a){var s=h.fromJD(a),f=n(s.year(),s.month(),s.day()),c=this.toMonthIndex(f.year,f.month,f.isIntercalary);return this.newDate(f.year,c,f.day)},fromString:function(a){var s=a.match(S),f=this._validateYear(+s[1]),c=+s[2],p=!!s[3],v=this.toMonthIndex(f,c,p),T=+s[4];return this.newDate(f,v,T)},add:function(a,s,f){var c=a.year(),p=a.month(),v=this.isIntercalaryMonth(c,p),T=this.toChineseMonth(c,p),l=Object.getPrototypeOf(b.prototype).add.call(this,a,s,f);if(f==="y"){var g=l.year(),x=l.month(),A=this.isIntercalaryMonth(g,T),M=v&&A?this.toMonthIndex(g,T,!0):this.toMonthIndex(g,T,!1);M!==x&&l.month(M)}return l}});var S=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,E=/^\d?\d[iI]?/m,e=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;K.calendars.chinese=b;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function n(a,s,f,c){var p,v;if(typeof a=="object")p=a,v=s||{};else{var T=typeof a=="number"&&a>=1888&&a<=2111;if(!T)throw new Error("Solar year outside range 1888-2111");var l=typeof s=="number"&&s>=1&&s<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var g=typeof f=="number"&&f>=1&&f<=31;if(!g)throw new Error("Solar day outside range 1 - 31");p={year:a,month:s,day:f},v={}}var x=o[p.year-o[0]],A=p.year<<9|p.month<<5|p.day;v.year=A>=x?p.year:p.year-1,x=o[v.year-o[0]];var M=x>>9&4095,_=x>>5&15,w=x&31,m,u=new Date(M,_-1,w),d=new Date(p.year,p.month-1,p.day);m=Math.round((d-u)/(24*3600*1e3));var y=r[v.year-r[0]],I;for(I=0;I<13;I++){var L=y&1<<12-I?30:29;if(m>13;return!z||I=1888&&a<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var g=typeof s=="number"&&s>=1&&s<=12;if(!g)throw new Error("Lunar month outside range 1 - 12");var x=typeof f=="number"&&f>=1&&f<=30;if(!x)throw new Error("Lunar day outside range 1 - 30");var A;typeof c=="object"?(A=!1,v=c):(A=!!c,v={}),T={year:a,month:s,day:f,isIntercalary:A}}var M;M=T.day-1;var _=r[T.year-r[0]],w=_>>13,m;w&&(T.month>w||T.isIntercalary)?m=T.month:m=T.month-1;for(var u=0;u>9&4095,L=y>>5&15,z=y&31,F=new Date(I,L-1,z+M);return v.year=F.getFullYear(),v.month=1+F.getMonth(),v.day=F.getDate(),v}}}),qO=Ge({"node_modules/world-calendars/dist/calendars/coptic.js"(){var K=Vv(),G=Ad();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new K.baseCalendar,G(h.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var S=this._validate(E,this.minMonth,this.minDay,K.local.invalidYear),E=S.year()+(S.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(b){return this._validate(b,this.minMonth,this.minDay,K.local.invalidYear||K.regionalOptions[""].invalidYear),13},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,K.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return(this.dayOfWeek(b,S,E)||7)<6},toJD:function(b,S,E){var e=this._validate(b,S,E,K.local.invalidDate);return b=e.year(),b<0&&b++,e.day()+(e.month()-1)*30+(b-1)*365+Math.floor(b/4)+this.jdEpoch-1},fromJD:function(b){var S=Math.floor(b)+.5-this.jdEpoch,E=Math.floor((S-Math.floor((S+366)/1461))/365)+1;E<=0&&E--,S=Math.floor(b)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(E,e,t)}}),K.calendars.coptic=h}}),VO=Ge({"node_modules/world-calendars/dist/calendars/discworld.js"(){var K=Vv(),G=Ad();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new K.baseCalendar,G(h.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(S){return this._validate(S,this.minMonth,this.minDay,K.local.invalidYear),!1},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,K.local.invalidYear),13},daysInYear:function(S){return this._validate(S,this.minMonth,this.minDay,K.local.invalidYear),400},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,K.local.invalidMonth);return this.daysPerMonth[e.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(S,E,e){var t=this._validate(S,E,e,K.local.invalidDate);return(t.day()+1)%8},weekDay:function(S,E,e){var t=this.dayOfWeek(S,E,e);return t>=2&&t<=6},extraInfo:function(S,E,e){var t=this._validate(S,E,e,K.local.invalidDate);return{century:b[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(S,E,e){var t=this._validate(S,E,e,K.local.invalidDate);return S=t.year()+(t.year()<0?1:0),E=t.month(),e=t.day(),e+(E>1?16:0)+(E>2?(E-2)*32:0)+(S-1)*400+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S+.5)-Math.floor(this.jdEpoch)-1;var E=Math.floor(S/400)+1;S-=(E-1)*400,S+=S>15?16:0;var e=Math.floor(S/32)+1,t=S-(e-1)*32+1;return this.newDate(E<=0?E-1:E,e,t)}});var b={20:"Fruitbat",21:"Anchovy"};K.calendars.discworld=h}}),HO=Ge({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var K=Vv(),G=Ad();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new K.baseCalendar,G(h.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var S=this._validate(E,this.minMonth,this.minDay,K.local.invalidYear),E=S.year()+(S.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(b){return this._validate(b,this.minMonth,this.minDay,K.local.invalidYear||K.regionalOptions[""].invalidYear),13},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,K.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return(this.dayOfWeek(b,S,E)||7)<6},toJD:function(b,S,E){var e=this._validate(b,S,E,K.local.invalidDate);return b=e.year(),b<0&&b++,e.day()+(e.month()-1)*30+(b-1)*365+Math.floor(b/4)+this.jdEpoch-1},fromJD:function(b){var S=Math.floor(b)+.5-this.jdEpoch,E=Math.floor((S-Math.floor((S+366)/1461))/365)+1;E<=0&&E--,S=Math.floor(b)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(E,e,t)}}),K.calendars.ethiopian=h}}),GO=Ge({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var K=Vv(),G=Ad();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new K.baseCalendar,G(h.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,K.local.invalidYear);return this._leapYear(E.year())},_leapYear:function(S){return S=S<0?S+1:S,b(S*7+1,19)<7},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,K.local.invalidYear),this._leapYear(S.year?S.year():S)?13:12},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,K.local.invalidYear);return S=E.year(),this.toJD(S===-1?1:S+1,7,1)-this.toJD(S,7,1)},daysInMonth:function(S,E){return S.year&&(E=S.month(),S=S.year()),this._validate(S,E,this.minDay,K.local.invalidMonth),E===12&&this.leapYear(S)||E===8&&b(this.daysInYear(S),10)===5?30:E===9&&b(this.daysInYear(S),10)===3?29:this.daysPerMonth[E-1]},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==6},extraInfo:function(S,E,e){var t=this._validate(S,E,e,K.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(S,E,e){var t=this._validate(S,E,e,K.local.invalidDate);S=t.year(),E=t.month(),e=t.day();var r=S<=0?S+1:S,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(E<7){for(var n=7;n<=this.monthsInYear(S);n++)o+=this.daysInMonth(S,n);for(var n=1;n=this.toJD(E===-1?1:E+1,7,1);)E++;for(var e=Sthis.toJD(E,e,this.daysInMonth(E,e));)e++;var t=S-this.toJD(E,e,1)+1;return this.newDate(E,e,t)}});function b(S,E){return S-E*Math.floor(S/E)}K.calendars.hebrew=h}}),XO=Ge({"node_modules/world-calendars/dist/calendars/islamic.js"(){var K=Vv(),G=Ad();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new K.baseCalendar,G(h.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(b){var S=this._validate(b,this.minMonth,this.minDay,K.local.invalidYear);return(S.year()*11+14)%30<11},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(b){return this.leapYear(b)?355:354},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,K.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===12&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return this.dayOfWeek(b,S,E)!==5},toJD:function(b,S,E){var e=this._validate(b,S,E,K.local.invalidDate);return b=e.year(),S=e.month(),E=e.day(),b=b<=0?b+1:b,E+Math.ceil(29.5*(S-1))+(b-1)*354+Math.floor((3+11*b)/30)+this.jdEpoch-1},fromJD:function(b){b=Math.floor(b)+.5;var S=Math.floor((30*(b-this.jdEpoch)+10646)/10631);S=S<=0?S-1:S;var E=Math.min(12,Math.ceil((b-29-this.toJD(S,1,1))/29.5)+1),e=b-this.toJD(S,E,1)+1;return this.newDate(S,E,e)}}),K.calendars.islamic=h}}),YO=Ge({"node_modules/world-calendars/dist/calendars/julian.js"(){var K=Vv(),G=Ad();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new K.baseCalendar,G(h.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var S=this._validate(E,this.minMonth,this.minDay,K.local.invalidYear),E=S.year()<0?S.year()+1:S.year();return E%4===0},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(4-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(b,S){var E=this._validate(b,S,this.minDay,K.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===2&&this.leapYear(E.year())?1:0)},weekDay:function(b,S,E){return(this.dayOfWeek(b,S,E)||7)<6},toJD:function(b,S,E){var e=this._validate(b,S,E,K.local.invalidDate);return b=e.year(),S=e.month(),E=e.day(),b<0&&b++,S<=2&&(b--,S+=12),Math.floor(365.25*(b+4716))+Math.floor(30.6001*(S+1))+E-1524.5},fromJD:function(b){var S=Math.floor(b+.5),E=S+1524,e=Math.floor((E-122.1)/365.25),t=Math.floor(365.25*e),r=Math.floor((E-t)/30.6001),o=r-Math.floor(r<14?1:13),n=e-Math.floor(o>2?4716:4715),i=E-t-Math.floor(30.6001*r);return n<=0&&n--,this.newDate(n,o,i)}}),K.calendars.julian=h}}),ZO=Ge({"node_modules/world-calendars/dist/calendars/mayan.js"(){var K=Vv(),G=Ad();function h(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}h.prototype=new K.baseCalendar,G(h.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(E){return this._validate(E,this.minMonth,this.minDay,K.local.invalidYear),!1},formatYear:function(E){var e=this._validate(E,this.minMonth,this.minDay,K.local.invalidYear);E=e.year();var t=Math.floor(E/400);E=E%400,E+=E<0?400:0;var r=Math.floor(E/20);return t+"."+r+"."+E%20},forYear:function(E){if(E=E.split("."),E.length<3)throw"Invalid Mayan year";for(var e=0,t=0;t19||t>0&&r<0)throw"Invalid Mayan year";e=e*20+r}return e},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,K.local.invalidYear),18},weekOfYear:function(E,e,t){return this._validate(E,e,t,K.local.invalidDate),0},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,K.local.invalidYear),360},daysInMonth:function(E,e){return this._validate(E,e,this.minDay,K.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(E,e,t){var r=this._validate(E,e,t,K.local.invalidDate);return r.day()},weekDay:function(E,e,t){return this._validate(E,e,t,K.local.invalidDate),!0},extraInfo:function(E,e,t){var r=this._validate(E,e,t,K.local.invalidDate),o=r.toJD(),n=this._toHaab(o),i=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[n[0]-1],haabMonth:n[0],haabDay:n[1],tzolkinDayName:this.local.tzolkinMonths[i[0]-1],tzolkinDay:i[0],tzolkinTrecena:i[1]}},_toHaab:function(E){E-=this.jdEpoch;var e=b(E+8+340,365);return[Math.floor(e/20)+1,b(e,20)]},_toTzolkin:function(E){return E-=this.jdEpoch,[S(E+20,20),S(E+4,13)]},toJD:function(E,e,t){var r=this._validate(E,e,t,K.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(E){E=Math.floor(E)+.5-this.jdEpoch;var e=Math.floor(E/360);E=E%360,E+=E<0?360:0;var t=Math.floor(E/20),r=E%20;return this.newDate(e,t,r)}});function b(E,e){return E-e*Math.floor(E/e)}function S(E,e){return b(E-1,e)+1}K.calendars.mayan=h}}),WO=Ge({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var K=Vv(),G=Ad();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new K.baseCalendar;var b=K.instance("gregorian");G(h.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,K.local.invalidYear||K.regionalOptions[""].invalidYear);return b.leapYear(E.year()+(E.year()<1?1:0)+1469)},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,K.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,K.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),n=1;n=this.toJD(E+1,1,1);)E++;for(var e=S-Math.floor(this.toJD(E,1,1)+.5)+1,t=1;e>this.daysInMonth(E,t);)e-=this.daysInMonth(E,t),t++;return this.newDate(E,t,e)}}),K.calendars.nanakshahi=h}}),$O=Ge({"node_modules/world-calendars/dist/calendars/nepali.js"(){var K=Vv(),G=Ad();function h(b){this.local=this.regionalOptions[b||""]||this.regionalOptions[""]}h.prototype=new K.baseCalendar,G(h.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(b){return this.daysInYear(b)!==this.daysPerYear},weekOfYear:function(b,S,E){var e=this.newDate(b,S,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(b){var S=this._validate(b,this.minMonth,this.minDay,K.local.invalidYear);if(b=S.year(),typeof this.NEPALI_CALENDAR_DATA[b]>"u")return this.daysPerYear;for(var E=0,e=this.minMonth;e<=12;e++)E+=this.NEPALI_CALENDAR_DATA[b][e];return E},daysInMonth:function(b,S){return b.year&&(S=b.month(),b=b.year()),this._validate(b,S,this.minDay,K.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[b]>"u"?this.daysPerMonth[S-1]:this.NEPALI_CALENDAR_DATA[b][S]},weekDay:function(b,S,E){return this.dayOfWeek(b,S,E)!==6},toJD:function(b,S,E){var e=this._validate(b,S,E,K.local.invalidDate);b=e.year(),S=e.month(),E=e.day();var t=K.instance(),r=0,o=S,n=b;this._createMissingCalendarData(b);var i=b-(o>9||o===9&&E>=this.NEPALI_CALENDAR_DATA[n][0]?56:57);for(S!==9&&(r=E,o--);o!==9;)o<=0&&(o=12,n--),r+=this.NEPALI_CALENDAR_DATA[n][o],o--;return S===9?(r+=E-this.NEPALI_CALENDAR_DATA[n][0],r<0&&(r+=t.daysInYear(i))):r+=this.NEPALI_CALENDAR_DATA[n][9]-this.NEPALI_CALENDAR_DATA[n][0],t.newDate(i,1,1).add(r,"d").toJD()},fromJD:function(b){var S=K.instance(),E=S.fromJD(b),e=E.year(),t=E.dayOfYear(),r=e+56;this._createMissingCalendarData(r);for(var o=9,n=this.NEPALI_CALENDAR_DATA[r][0],i=this.NEPALI_CALENDAR_DATA[r][o]-n+1;t>i;)o++,o>12&&(o=1,r++),i+=this.NEPALI_CALENDAR_DATA[r][o];var a=this.NEPALI_CALENDAR_DATA[r][o]-(i-t);return this.newDate(r,o,a)},_createMissingCalendarData:function(b){var S=this.daysPerMonth.slice(0);S.unshift(17);for(var E=b-1;E"u"&&(this.NEPALI_CALENDAR_DATA[E]=S)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),K.calendars.nepali=h}}),KO=Ge({"node_modules/world-calendars/dist/calendars/persian.js"(){var K=Vv(),G=Ad();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}function b(S){var E=S-475;S<0&&E++;var e=.242197,t=e*E,r=e*(E+1),o=t-Math.floor(t),n=r-Math.floor(r);return o>n}h.prototype=new K.baseCalendar,G(h.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,K.local.invalidYear);return b(E.year())},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,K.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==5},toJD:function(S,E,e){var t=this._validate(S,E,e,K.local.invalidDate);S=t.year(),E=t.month(),e=t.day();var r=0;if(S>0)for(var o=1;o0?S-1:S)*365+r+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S)+.5;var E=475+(S-this.toJD(475,1,1))/365.242197,e=Math.floor(E);e<=0&&e--,S>this.toJD(e,12,b(e)?30:29)&&(e++,e===0&&e++);var t=S-this.toJD(e,1,1)+1,r=t<=186?Math.ceil(t/31):Math.ceil((t-6)/30),o=S-this.toJD(e,r,1)+1;return this.newDate(e,r,o)}}),K.calendars.persian=h,K.calendars.jalali=h}}),JO=Ge({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var K=Vv(),G=Ad(),h=K.instance();function b(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}b.prototype=new K.baseCalendar,G(b.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var E=this._validate(e,this.minMonth,this.minDay,K.local.invalidYear),e=this._t2gYear(E.year());return h.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,K.local.invalidYear),r=this._t2gYear(t.year());return h.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,K.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,K.local.invalidDate),r=this._t2gYear(t.year());return h.toJD(r,t.month(),t.day())},fromJD:function(S){var E=h.fromJD(S),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(S){return S+this.yearsOffset+(S>=-this.yearsOffset&&S<=-1?1:0)},_g2tYear:function(S){return S-this.yearsOffset-(S>=1&&S<=this.yearsOffset?1:0)}}),K.calendars.taiwan=b}}),QO=Ge({"node_modules/world-calendars/dist/calendars/thai.js"(){var K=Vv(),G=Ad(),h=K.instance();function b(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}b.prototype=new K.baseCalendar,G(b.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var E=this._validate(e,this.minMonth,this.minDay,K.local.invalidYear),e=this._t2gYear(E.year());return h.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,K.local.invalidYear),r=this._t2gYear(t.year());return h.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,E){var e=this._validate(S,E,this.minDay,K.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,E,e){return(this.dayOfWeek(S,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,K.local.invalidDate),r=this._t2gYear(t.year());return h.toJD(r,t.month(),t.day())},fromJD:function(S){var E=h.fromJD(S),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(S){return S-this.yearsOffset-(S>=1&&S<=this.yearsOffset?1:0)},_g2tYear:function(S){return S+this.yearsOffset+(S>=-this.yearsOffset&&S<=-1?1:0)}}),K.calendars.thai=b}}),eF=Ge({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var K=Vv(),G=Ad();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new K.baseCalendar,G(h.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(S){var E=this._validate(S,this.minMonth,this.minDay,K.local.invalidYear);return this.daysInYear(E.year())===355},weekOfYear:function(S,E,e){var t=this.newDate(S,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){for(var E=0,e=1;e<=12;e++)E+=this.daysInMonth(S,e);return E},daysInMonth:function(S,E){for(var e=this._validate(S,E,this.minDay,K.local.invalidMonth),t=e.toJD()-24e5+.5,r=0,o=0;ot)return b[r]-b[r-1];r++}return 30},weekDay:function(S,E,e){return this.dayOfWeek(S,E,e)!==5},toJD:function(S,E,e){var t=this._validate(S,E,e,K.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+b[r-1]-1;return o+24e5-.5},fromJD:function(S){for(var E=S-24e5+.5,e=0,t=0;tE);t++)e++;var r=e+15292,o=Math.floor((r-1)/12),n=o+1,i=r-12*o,a=E-b[e-1]+1;return this.newDate(n,i,a)},isValid:function(S,E,e){var t=K.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(S=S.year!=null?S.year:S,t=S>=1276&&S<=1500),t},_validate:function(S,E,e,t){var r=K.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),K.calendars.ummalqura=h;var b=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),tF=Ge({"src/components/calendars/calendars.js"(K,G){G.exports=Vv(),UO(),jO(),qO(),VO(),HO(),GO(),XO(),YO(),ZO(),WO(),$O(),KO(),JO(),QO(),eF()}}),rF=Ge({"src/components/calendars/index.js"(K,G){var h=tF(),b=_n(),S=Ii(),E=S.EPOCHJD,e=S.ONEDAY,t={valType:"enumerated",values:b.sortObjectKeys(h.calendars),editType:"calc",dflt:"gregorian"},r=function(_,w,m,u){var d={};return d[m]=t,b.coerce(_,w,d,m,u)},o=function(_,w,m,u){for(var d=0;d{const Mr=hr.path.map(ot);return{x:hr.path.map((en,Br)=>Br),y:lt?Mr.map(en=>Math.max(en,QB)):Mr,customdata:Mr,type:"scatter",mode:"lines+markers",name:hr.label,line:{color:jt.color(hr.color),width:2},marker:{color:jt.color(hr.color),size:4},hovertemplate:`%{fullData.name}
iteration %{x}
${Ke} = %{customdata:.4g}`}});return ga.jsxs("div",{className:"flex flex-col gap-1",children:[ga.jsxs("span",{className:"text-sm text-label",children:[Ke," at each iteration",lt&&" (log scale)"]}),ga.jsx("div",{className:"h-40",children:ga.jsx(Lk,{data:Yt,layout:{...jt.layout,showlegend:!1,margin:{t:8,r:8,b:32,l:48},font:{...jt.layout.font,size:11},xaxis:{...jt.axis,title:{text:"iteration",standoff:4},rangemode:"tozero"},yaxis:{...jt.axis,automargin:!0,...lt&&{type:"log",exponentformat:"power"}}},config:{displayModeBar:!1,responsive:!0},style:{width:"100%",height:"100%"}})})]})}const a4={scrollZoom:!0,displayModeBar:!0,doubleClick:!1,responsive:!0},i4={x:.02,y:.98,xanchor:"left",yanchor:"top"};function eN({values:we,trajectories:Ke,xRange:ot,yRange:lt,onViewChange:jt,onClick:Yt,surface:hr,arrows:Mr}){const en=Bl.useRef(null),Br=dP(),[on,wn]=Bl.useState(void 0),[Wn,Bn]=Bl.useState(null);RB(()=>en.current?.el,hr?null:Yt);const Hi=we!==null&&"y"in we,wo=Ke.length>1;if(Hi&&hr){const Ge=[rN(we),...Ke.flatMap(Ns=>o4(Ns,Br,!0))],Ao={uirevision:"surface",...Br.layout,showlegend:wo,legend:{...i4,bgcolor:Br.legend},margin:{t:20,r:20,b:20,l:20},scene:{camera:on,aspectmode:"cube",xaxis:{...Br.axis,title:{text:"x"},range:[...ot.current]},yaxis:{...Br.axis,title:{text:"y"},range:[...lt.current]},zaxis:{...Br.axis,title:{text:"f(x, y)"}}}};return ga.jsx("div",{className:"flex-1 min-h-[320px]",onPointerDown:()=>{Bn({data:Ge,layout:Ao}),window.addEventListener("pointerup",()=>setTimeout(()=>Bn(null),50),{once:!0})},children:ga.jsx(Lk,{data:Wn?.data??Ge,layout:Wn?.layout??Ao,onRelayout:Ns=>{const uo=Ns["scene.camera"];uo&&wn(uo)},config:a4,style:{width:"100%",height:"100%"}},"surface")})}const Gi=[];we&&"y"in we?(Gi.push(tN(we)),Mr&&Gi.push(...nN(we,ot.current,lt.current))):we&&Gi.push({x:we.x,y:we.f,type:"scatter",mode:"lines",line:{color:Br.ink,width:2},name:"f(x)",showlegend:!1,hovertemplate:"x = %{x:.4g}
f(x) = %{y:.4g}"}),Gi.push(...Ke.flatMap(Ge=>o4(Ge,Br,!1,Hi)));const hi={dragmode:"pan",uirevision:"view",...Br.layout,showlegend:wo,legend:{...i4,bgcolor:Br.legend},margin:{t:40,r:40,b:40,l:40},xaxis:{...Br.axis,title:{text:"x"},range:[...ot.current]},yaxis:{...Br.axis,title:{text:Hi?"y":"f(x)"},range:[...lt.current]}};return ga.jsx("div",{className:"flex-1 min-h-[320px]",children:ga.jsx(Lk,{ref:en,data:Gi,layout:hi,onRelayout:Ge=>{const Ao=en.current?.el?._fullLayout,Ns=Ao?.xaxis?.range??[Ge["xaxis.range[0]"],Ge["xaxis.range[1]"]],uo=Ao?.yaxis?.range??[Ge["yaxis.range[0]"],Ge["yaxis.range[1]"]];(Ns[0]!==ot.current[0]||Ns[1]!==ot.current[1]||uo[0]!==lt.current[0]||uo[1]!==lt.current[1])&&Ns.every(Number.isFinite)&&uo.every(Number.isFinite)&&jt([Ns[0],Ns[1]],[uo[0],uo[1]])},config:a4,style:{width:"100%",height:"100%",minWidth:0}},"flat")})}function tN(we){return{x:we.x,y:we.y,z:we.f,type:"contour",colorscale:"Viridis",contours:{coloring:"heatmap",showlines:!1},colorbar:{thickness:12,title:{text:"f"}},hovertemplate:"x = %{x:.3g}, y = %{y:.3g}
f = %{z:.4g}"}}function rN(we){return{x:we.x,y:we.y,z:we.f,type:"surface",colorscale:"Viridis",opacity:.85,colorbar:{thickness:12,title:{text:"f"}},hovertemplate:"x = %{x:.3g}, y = %{y:.3g}
f = %{z:.4g}"}}function o4(we,Ke,ot,lt=!0){const jt=Ke.color(we.color),Yt=we.path.map(wn=>wn.position[0]),hr=lt?we.path.map(wn=>wn.position[1]):we.path.map(wn=>wn.value),Mr=we.path.map(wn=>wn.value),en=we.path.map(wn=>[wn.value,...wn.gradient,...wn.hessian.flat()]),Br=lt?"x = %{x:.4g}, y = %{y:.4g}
f = %{customdata[0]:.4g}
∇f = (%{customdata[1]:.4g}, %{customdata[2]:.4g})
∇²f = [[%{customdata[3]:.4g}, %{customdata[4]:.4g}], [%{customdata[5]:.4g}, %{customdata[6]:.4g}]]%{fullData.name}":"x = %{x:.4g}
f(x) = %{y:.4g}
f′(x) = %{customdata[1]:.4g}
f″(x) = %{customdata[2]:.4g}%{fullData.name}",on=we.path.length-1;return ot?[{x:Yt,y:hr,z:Mr,type:"scatter3d",mode:"lines+markers",name:we.label,legendgroup:we.label,line:{color:jt,width:5},marker:{color:jt,size:2.5},hoverinfo:"skip"},{x:Yt.slice(on),y:hr.slice(on),z:Mr.slice(on),type:"scatter3d",mode:"markers",name:we.label,legendgroup:we.label,showlegend:!1,marker:{color:jt,size:6,line:{color:Ke.halo,width:1}},hoverinfo:"skip"}]:[{x:Yt,y:hr,customdata:en,type:"scatter",mode:"lines+markers",name:we.label,legendgroup:we.label,line:{color:jt,width:2},marker:{color:jt,size:7},hovertemplate:Br},{x:Yt.slice(on),y:hr.slice(on),customdata:en.slice(on),type:"scatter",mode:"markers",name:we.label,legendgroup:we.label,showlegend:!1,marker:{color:jt,size:14,line:{color:Ke.halo,width:2}},hovertemplate:Br}]}function nN({arrows:we},[Ke,ot],[lt,jt]){const Yt=Math.sqrt(we.x.length),hr=we.u.map((Gi,hi)=>Math.hypot((Gi??NaN)/(ot-Ke),(we.v[hi]??NaN)/(jt-lt))),Mr=hr.filter(Gi=>Number.isFinite(Gi)&&Gi>0).sort((Gi,hi)=>Gi-hi),en=Mr[Math.floor(.9*(Mr.length-1))]??1,Br=[],on=[],wn=[],Wn=[],Bn=[],Hi=[];we.x.forEach((Gi,hi)=>{const Ge=we.u[hi],Ao=we.v[hi];if(Ge===null||Ao===null||!(hr[hi]>0))return;const Ns=.9*Math.min(1,hr[hi]/en)/(hr[hi]*Yt),uo=Ge*Ns,di=Ao*Ns,Eo=we.y[hi];Br.push(Gi,Gi+uo,null),on.push(Eo,Eo+di,null),wn.push(0,6,0),Wn.push(Gi+uo),Bn.push(Eo+di),Hi.push([Gi,Eo,Ge,Ao])});const wo="rgba(255, 255, 255, 0.85)";return[{x:Br,y:on,type:"scatter",mode:"lines+markers",line:{color:wo,width:1},hoverinfo:"skip",showlegend:!1,marker:{symbol:"triangle-up",size:wn,color:wo,angleref:"previous"}},{x:Wn,y:Bn,customdata:Hi,type:"scatter",mode:"markers",showlegend:!1,marker:{size:6,opacity:0},hovertemplate:"x = %{customdata[0]:.3g}, y = %{customdata[1]:.3g}
∇f = (%{customdata[2]:.3g}, %{customdata[3]:.3g})"}]}const aN=[{id:"gradient_descent",label:"Gradient descent",params:[{name:"learning_rate",label:"Learning rate η",symbol:"η",kind:"number",min:0,minExclusive:!0,default:.1,description:"How far each step moves along the negative gradient."},{name:"momentum",label:"Momentum μ",symbol:"μ",kind:"number",min:0,max:1,maxExclusive:!0,default:0,description:"How much of the previous step carries over into the next one."}]},{id:"nesterov",label:"Nesterov momentum",params:[{name:"learning_rate",label:"Learning rate η",symbol:"η",kind:"number",min:0,minExclusive:!0,default:.1,description:"How far each step moves along the negative gradient."},{name:"momentum",label:"Momentum μ",symbol:"μ",kind:"number",min:0,max:1,maxExclusive:!0,default:.1,description:"How much of the previous step carries over; the gradient is taken at the look-ahead point."}]},{id:"newton",label:"Newton's method",params:[]},{id:"adam",label:"Adam",params:[{name:"learning_rate",label:"Learning rate η",symbol:"η",kind:"number",min:0,minExclusive:!0,default:.1,description:"The largest step size, roughly."},{name:"beta1",label:"Decay β₁",symbol:"β₁",kind:"number",min:0,max:1,maxExclusive:!0,default:.9,description:"Decay rate of the moving average of gradients (first moment)."},{name:"beta2",label:"Decay β₂",symbol:"β₂",kind:"number",min:0,max:1,maxExclusive:!0,default:.999,description:"Decay rate of the moving average of squared gradients (second moment)."},{name:"epsilon",label:"Epsilon ε",symbol:"ε",kind:"number",min:0,minExclusive:!0,default:1e-8,description:"Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero."}]},{id:"adagrad",label:"Adagrad",params:[{name:"learning_rate",label:"Learning rate η",symbol:"η",kind:"number",min:0,minExclusive:!0,default:.1,description:"Divided by the root of the summed squared gradients."},{name:"epsilon",label:"Epsilon ε",symbol:"ε",kind:"number",min:0,minExclusive:!0,default:1e-8,description:"Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero."}]},{id:"rmsprop",label:"RMSProp",params:[{name:"learning_rate",label:"Learning rate η",symbol:"η",kind:"number",min:0,minExclusive:!0,default:.1,description:"Divided by the root of the moving average of squared gradients."},{name:"beta",label:"Decay β",symbol:"β",kind:"number",min:0,max:1,maxExclusive:!0,default:.9,description:"Decay rate of the moving average of squared gradients."},{name:"epsilon",label:"Epsilon ε",symbol:"ε",kind:"number",min:0,minExclusive:!0,default:1e-8,description:"Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero."}]},{id:"adadelta",label:"Adadelta",params:[{name:"beta",label:"Decay β",symbol:"β",kind:"number",min:0,max:1,maxExclusive:!0,default:.9,description:"Decay rate of the moving averages of squared gradients and squared updates."},{name:"epsilon",label:"Epsilon ε",symbol:"ε",kind:"number",min:0,minExclusive:!0,default:.001,description:"Sets the first step size, and avoids dividing by zero."}]}],iN={algorithms:aN},FT=iN.algorithms;function oN(we){return FT.find(Ke=>Ke.id===we)??FT[0]}const sN="text-sm text-ink-muted";function lN({editor:we,twoVariables:Ke,onResetStart:ot,onRandomStart:lt,hint:jt}){const Yt=oN(we.algorithm),[hr,Mr]=Bl.useState(!1),en=Bl.useId(),Br=Yt.params.length>0,on=Object.keys(we.params).length>0;function wn(Bn,Hi){we.changeParams({...we.params,[Bn]:Hi})}function Wn(Bn){we.changeParams(Object.fromEntries(Object.entries(we.params).filter(([Hi])=>Hi!==Bn)))}return ga.jsxs(ga.Fragment,{children:[ga.jsxs("div",{className:"flex items-center gap-2",children:[ga.jsx("div",{className:"min-w-0 flex-1",children:ga.jsx(hP,{label:"Algorithm",hideLabel:!0,options:FT.map(Bn=>Bn.label),activeOption:Yt.label,onChange:Bn=>we.changeAlgorithm(FT.find(Hi=>Hi.label===Bn).id)})}),ga.jsx(PT,{label:`About the ${Yt.label} settings`,onClick:()=>Mr(!0),disabled:!Br,children:ga.jsx(fB,{size:16})}),ga.jsx(PT,{label:"Reset the settings to their defaults",onClick:()=>we.changeParams({}),disabled:!on,children:ga.jsx(dM,{size:16})})]}),ga.jsx(VB,{model:Yt,values:we.params,onChange:we.changeParams,inline:!0}),ga.jsx(Vk,{title:`${Yt.label} settings`,open:hr,onClose:()=>Mr(!1),wide:!0,children:ga.jsx(yP,{model:Yt,values:we.params,onChange:wn,onResetOne:Wn,onReset:()=>we.changeParams({})})}),ga.jsxs("div",{className:"flex flex-col gap-2",children:[ga.jsxs("div",{role:"group","aria-labelledby":`${en}-initial`,className:"flex flex-col gap-1",children:[ga.jsx("span",{id:`${en}-initial`,className:"text-sm text-label",children:"Initial point"}),ga.jsxs("div",{className:"flex items-center gap-2",children:[ga.jsx("div",{className:"min-w-0 flex-1",children:ga.jsx(Mk,{label:"Initial x",hideLabel:!0,prefix:Ke?"x":void 0,value:we.startText[0],onChange:Bn=>we.changeStart(0,Bn),mono:!0})}),Ke&&ga.jsx("div",{className:"min-w-0 flex-1",children:ga.jsx(Mk,{label:"Initial y",hideLabel:!0,prefix:"y",value:we.startText[1],onChange:Bn=>we.changeStart(1,Bn),mono:!0})}),ga.jsx(PT,{label:"Random initial point",onClick:lt,children:ga.jsx(uB,{size:16})}),ga.jsx(PT,{label:"Reset the initial point",onClick:ot,children:ga.jsx(dM,{size:16})})]})]}),!we.startValid&&ga.jsx("p",{className:"text-danger font-semibold",children:"The initial point must be numbers."}),jt&&ga.jsx("p",{className:sN,children:jt})]})]})}function s4(we){const Ke=Math.abs(we);return Ke!==0&&(Ke<.001||Ke>=1e5)?we.toExponential(2):String(Number(we.toPrecision(3)))}function uN(we){const Ke=we.path.length;if(Ke<2)return null;const[ot,lt]=[we.path[Ke-2].position,we.path[Ke-1].position];return Math.hypot(...lt.map((jt,Yt)=>jt-ot[Yt]))}function cN({trajectories:we}){const Ke=wM();return ga.jsxs("table",{className:"w-full border-collapse text-sm",children:[ga.jsx("thead",{children:ga.jsxs("tr",{className:"text-xs text-ink-muted",children:[ga.jsx("th",{scope:"col",className:"pb-1 text-left font-normal",children:"Optimiser"}),ga.jsx("th",{scope:"col",className:"pb-1 text-right font-normal",children:"f"}),ga.jsx("th",{scope:"col",className:"pb-1 text-right font-normal",title:"How far the latest iteration moved",children:"Last step ‖Δx‖"})]})}),ga.jsx("tbody",{children:we.map(ot=>{const lt=ot.path[ot.path.length-1],jt=uN(ot);return ga.jsxs("tr",{className:"border-t border-grid",children:[ga.jsx("th",{scope:"row",className:"py-1 text-left font-normal text-label",children:ga.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[ga.jsx("span",{"aria-hidden":!0,className:"size-3 shrink-0 rounded-full",style:{backgroundColor:vM(ot.color,Ke)}}),ga.jsx("span",{className:"truncate",children:ot.label})]})}),ga.jsx("td",{className:"py-1 text-right font-mono text-ink",children:lt?s4(lt.value):"–"}),ga.jsx("td",{className:"py-1 text-right font-mono text-ink",children:jt===null?"–":s4(jt)})]},ot.id)})})]})}function fN(we,Ke){const ot={};return(we[we.length-1]===""?[...we,""]:we).join((ot.padRight?" ":"")+","+(ot.padLeft===!1?"":" ")).trim()}const hN=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vN={};function l4(we,Ke){return(vN.jsx?dN:hN).test(we)}const pN=/[ \t\n\f\r]/g;function mN(we){return typeof we=="object"?we.type==="text"?u4(we.value):!1:u4(we)}function u4(we){return we.replace(pN,"")===""}class NT{constructor(Ke,ot,lt){this.normal=ot,this.property=Ke,lt&&(this.space=lt)}}NT.prototype.normal={};NT.prototype.property={};NT.prototype.space=void 0;function xP(we,Ke){const ot={},lt={};for(const jt of we)Object.assign(ot,jt.property),Object.assign(lt,jt.normal);return new NT(ot,lt,Ke)}function Pk(we){return we.toLowerCase()}class Dp{constructor(Ke,ot){this.attribute=ot,this.property=Ke}}Dp.prototype.attribute="";Dp.prototype.booleanish=!1;Dp.prototype.boolean=!1;Dp.prototype.commaOrSpaceSeparated=!1;Dp.prototype.commaSeparated=!1;Dp.prototype.defined=!1;Dp.prototype.mustUseProperty=!1;Dp.prototype.number=!1;Dp.prototype.overloadedBoolean=!1;Dp.prototype.property="";Dp.prototype.spaceSeparated=!1;Dp.prototype.space=void 0;let gN=0;const qu=rx(),Zd=rx(),Rk=rx(),Vo=rx(),mh=rx(),zw=rx(),s0=rx();function rx(){return 2**++gN}const Ik=Object.freeze(Object.defineProperty({__proto__:null,boolean:qu,booleanish:Zd,commaOrSpaceSeparated:s0,commaSeparated:zw,number:Vo,overloadedBoolean:Rk,spaceSeparated:mh},Symbol.toStringTag,{value:"Module"})),sk=Object.keys(Ik);class Hk extends Dp{constructor(Ke,ot,lt,jt){let Yt=-1;if(super(Ke,ot),c4(this,"space",jt),typeof lt=="number")for(;++Yt4&&ot.slice(0,4)==="data"&&wN.test(Ke)){if(Ke.charAt(4)==="-"){const Yt=Ke.slice(5).replace(f4,SN);lt="data"+Yt.charAt(0).toUpperCase()+Yt.slice(1)}else{const Yt=Ke.slice(4);if(!f4.test(Yt)){let hr=Yt.replace(bN,AN);hr.charAt(0)!=="-"&&(hr="-"+hr),Ke="data"+hr}}jt=Hk}return new jt(lt,Ke)}function AN(we){return"-"+we.toLowerCase()}function SN(we){return we.charAt(1).toUpperCase()}const MN=xP([bP,yN,AP,SP,MP],"html"),Gk=xP([bP,_N,AP,SP,MP],"svg");function EN(we){return we.join(" ").trim()}var Pw={},lk,h4;function kN(){if(h4)return lk;h4=1;var we=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ke=/\n/g,ot=/^\s*/,lt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,jt=/^:\s*/,Yt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,hr=/^[;\s]*/,Mr=/^\s+|\s+$/g,en=` +`,Br="/",on="*",wn="",Wn="comment",Bn="declaration";function Hi(Gi,hi){if(typeof Gi!="string")throw new TypeError("First argument must be a string");if(!Gi)return[];hi=hi||{};var Ge=1,Ao=1;function Ns(Ei){var Ii=Ei.match(Ke);Ii&&(Ge+=Ii.length);var Ti=Ei.lastIndexOf(en);Ao=~Ti?Ei.length-Ti:Ao+Ei.length}function uo(){var Ei={line:Ge,column:Ao};return function(Ii){return Ii.position=new di(Ei),ki(),Ii}}function di(Ei){this.start=Ei,this.end={line:Ge,column:Ao},this.source=hi.source}di.prototype.content=Gi;function Eo(Ei){var Ii=new Error(hi.source+":"+Ge+":"+Ao+": "+Ei);if(Ii.reason=Ei,Ii.filename=hi.source,Ii.line=Ge,Ii.column=Ao,Ii.source=Gi,!hi.silent)throw Ii}function zs(Ei){var Ii=Ei.exec(Gi);if(Ii){var Ti=Ii[0];return Ns(Ti),Gi=Gi.slice(Ti.length),Ii}}function ki(){zs(ot)}function tl(Ei){var Ii;for(Ei=Ei||[];Ii=Bi();)Ii!==!1&&Ei.push(Ii);return Ei}function Bi(){var Ei=uo();if(!(Br!=Gi.charAt(0)||on!=Gi.charAt(1))){for(var Ii=2;wn!=Gi.charAt(Ii)&&(on!=Gi.charAt(Ii)||Br!=Gi.charAt(Ii+1));)++Ii;if(Ii+=2,wn===Gi.charAt(Ii-1))return Eo("End of comment missing");var Ti=Gi.slice(2,Ii-2);return Ao+=2,Ns(Ti),Gi=Gi.slice(Ii),Ao+=2,Ei({type:Wn,comment:Ti})}}function zo(){var Ei=uo(),Ii=zs(lt);if(Ii){if(Bi(),!zs(jt))return Eo("property missing ':'");var Ti=zs(Yt),So=Ei({type:Bn,property:wo(Ii[0].replace(we,wn)),value:Ti?wo(Ti[0].replace(we,wn)):wn});return zs(hr),So}}function Ll(){var Ei=[];tl(Ei);for(var Ii;Ii=zo();)Ii!==!1&&(Ei.push(Ii),tl(Ei));return Ei}return ki(),Ll()}function wo(Gi){return Gi?Gi.replace(Mr,wn):wn}return lk=Hi,lk}var d4;function CN(){if(d4)return Pw;d4=1;var we=Pw&&Pw.__importDefault||function(lt){return lt&<.__esModule?lt:{default:lt}};Object.defineProperty(Pw,"__esModule",{value:!0}),Pw.default=ot;const Ke=we(kN());function ot(lt,jt){let Yt=null;if(!lt||typeof lt!="string")return Yt;const hr=(0,Ke.default)(lt),Mr=typeof jt=="function";return hr.forEach(en=>{if(en.type!=="declaration")return;const{property:Br,value:on}=en;Mr?jt(Br,on,en):on&&(Yt=Yt||{},Yt[Br]=on)}),Yt}return Pw}var MT={},v4;function LN(){if(v4)return MT;v4=1,Object.defineProperty(MT,"__esModule",{value:!0}),MT.camelCase=void 0;var we=/^--[a-zA-Z0-9_-]+$/,Ke=/-([a-z])/g,ot=/^[^-]+$/,lt=/^-(webkit|moz|ms|o|khtml)-/,jt=/^-(ms)-/,Yt=function(Br){return!Br||ot.test(Br)||we.test(Br)},hr=function(Br,on){return on.toUpperCase()},Mr=function(Br,on){return"".concat(on,"-")},en=function(Br,on){return on===void 0&&(on={}),Yt(Br)?Br:(Br=Br.toLowerCase(),on.reactCompat?Br=Br.replace(jt,Mr):Br=Br.replace(lt,Mr),Br.replace(Ke,hr))};return MT.camelCase=en,MT}var ET,p4;function PN(){if(p4)return ET;p4=1;var we=ET&&ET.__importDefault||function(jt){return jt&&jt.__esModule?jt:{default:jt}},Ke=we(CN()),ot=LN();function lt(jt,Yt){var hr={};return!jt||typeof jt!="string"||(0,Ke.default)(jt,function(Mr,en){Mr&&en&&(hr[(0,ot.camelCase)(Mr,Yt)]=en)}),hr}return lt.default=lt,ET=lt,ET}var RN=PN();const IN=qk(RN),EP=kP("end"),Xk=kP("start");function kP(we){return Ke;function Ke(ot){const lt=ot&&ot.position&&ot.position[we]||{};if(typeof lt.line=="number"&<.line>0&&typeof lt.column=="number"&<.column>0)return{line:lt.line,column:lt.column,offset:typeof lt.offset=="number"&<.offset>-1?lt.offset:void 0}}}function DN(we){const Ke=Xk(we),ot=EP(we);if(Ke&&ot)return{start:Ke,end:ot}}function IT(we){return!we||typeof we!="object"?"":"position"in we||"type"in we?m4(we.position):"start"in we||"end"in we?m4(we):"line"in we||"column"in we?Dk(we):""}function Dk(we){return g4(we&&we.line)+":"+g4(we&&we.column)}function m4(we){return Dk(we&&we.start)+"-"+Dk(we&&we.end)}function g4(we){return we&&typeof we=="number"?we:1}class ep extends Error{constructor(Ke,ot,lt){super(),typeof ot=="string"&&(lt=ot,ot=void 0);let jt="",Yt={},hr=!1;if(ot&&("line"in ot&&"column"in ot?Yt={place:ot}:"start"in ot&&"end"in ot?Yt={place:ot}:"type"in ot?Yt={ancestors:[ot],place:ot.position}:Yt={...ot}),typeof Ke=="string"?jt=Ke:!Yt.cause&&Ke&&(hr=!0,jt=Ke.message,Yt.cause=Ke),!Yt.ruleId&&!Yt.source&&typeof lt=="string"){const en=lt.indexOf(":");en===-1?Yt.ruleId=lt:(Yt.source=lt.slice(0,en),Yt.ruleId=lt.slice(en+1))}if(!Yt.place&&Yt.ancestors&&Yt.ancestors){const en=Yt.ancestors[Yt.ancestors.length-1];en&&(Yt.place=en.position)}const Mr=Yt.place&&"start"in Yt.place?Yt.place.start:Yt.place;this.ancestors=Yt.ancestors||void 0,this.cause=Yt.cause||void 0,this.column=Mr?Mr.column:void 0,this.fatal=void 0,this.file="",this.message=jt,this.line=Mr?Mr.line:void 0,this.name=IT(Yt.place)||"1:1",this.place=Yt.place||void 0,this.reason=this.message,this.ruleId=Yt.ruleId||void 0,this.source=Yt.source||void 0,this.stack=hr&&Yt.cause&&typeof Yt.cause.stack=="string"?Yt.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ep.prototype.file="";ep.prototype.name="";ep.prototype.reason="";ep.prototype.message="";ep.prototype.stack="";ep.prototype.column=void 0;ep.prototype.line=void 0;ep.prototype.ancestors=void 0;ep.prototype.cause=void 0;ep.prototype.fatal=void 0;ep.prototype.place=void 0;ep.prototype.ruleId=void 0;ep.prototype.source=void 0;const Yk={}.hasOwnProperty,zN=new Map,ON=/[A-Z]/g,FN=new Set(["table","tbody","thead","tfoot","tr"]),BN=new Set(["td","th"]),CP="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function NN(we,Ke){if(!Ke||Ke.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const ot=Ke.filePath||void 0;let lt;if(Ke.development){if(typeof Ke.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");lt=YN(ot,Ke.jsxDEV)}else{if(typeof Ke.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof Ke.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");lt=XN(ot,Ke.jsx,Ke.jsxs)}const jt={Fragment:Ke.Fragment,ancestors:[],components:Ke.components||{},create:lt,elementAttributeNameCase:Ke.elementAttributeNameCase||"react",evaluater:Ke.createEvaluater?Ke.createEvaluater():void 0,filePath:ot,ignoreInvalidStyle:Ke.ignoreInvalidStyle||!1,passKeys:Ke.passKeys!==!1,passNode:Ke.passNode||!1,schema:Ke.space==="svg"?Gk:MN,stylePropertyNameCase:Ke.stylePropertyNameCase||"dom",tableCellAlignToStyle:Ke.tableCellAlignToStyle!==!1},Yt=LP(jt,we,void 0);return Yt&&typeof Yt!="string"?Yt:jt.create(we,jt.Fragment,{children:Yt||void 0},void 0)}function LP(we,Ke,ot){if(Ke.type==="element")return UN(we,Ke,ot);if(Ke.type==="mdxFlowExpression"||Ke.type==="mdxTextExpression")return jN(we,Ke);if(Ke.type==="mdxJsxFlowElement"||Ke.type==="mdxJsxTextElement")return VN(we,Ke,ot);if(Ke.type==="mdxjsEsm")return qN(we,Ke);if(Ke.type==="root")return HN(we,Ke,ot);if(Ke.type==="text")return GN(we,Ke)}function UN(we,Ke,ot){const lt=we.schema;let jt=lt;Ke.tagName.toLowerCase()==="svg"&<.space==="html"&&(jt=Gk,we.schema=jt),we.ancestors.push(Ke);const Yt=RP(we,Ke.tagName,!1),hr=ZN(we,Ke);let Mr=Wk(we,Ke);return FN.has(Ke.tagName)&&(Mr=Mr.filter(function(en){return typeof en=="string"?!mN(en):!0})),PP(we,hr,Yt,Ke),Zk(hr,Mr),we.ancestors.pop(),we.schema=lt,we.create(Ke,Yt,hr,ot)}function jN(we,Ke){if(Ke.data&&Ke.data.estree&&we.evaluater){const lt=Ke.data.estree.body[0];return lt.type,we.evaluater.evaluateExpression(lt.expression)}BT(we,Ke.position)}function qN(we,Ke){if(Ke.data&&Ke.data.estree&&we.evaluater)return we.evaluater.evaluateProgram(Ke.data.estree);BT(we,Ke.position)}function VN(we,Ke,ot){const lt=we.schema;let jt=lt;Ke.name==="svg"&<.space==="html"&&(jt=Gk,we.schema=jt),we.ancestors.push(Ke);const Yt=Ke.name===null?we.Fragment:RP(we,Ke.name,!0),hr=WN(we,Ke),Mr=Wk(we,Ke);return PP(we,hr,Yt,Ke),Zk(hr,Mr),we.ancestors.pop(),we.schema=lt,we.create(Ke,Yt,hr,ot)}function HN(we,Ke,ot){const lt={};return Zk(lt,Wk(we,Ke)),we.create(Ke,we.Fragment,lt,ot)}function GN(we,Ke){return Ke.value}function PP(we,Ke,ot,lt){typeof ot!="string"&&ot!==we.Fragment&&we.passNode&&(Ke.node=lt)}function Zk(we,Ke){if(Ke.length>0){const ot=Ke.length>1?Ke:Ke[0];ot&&(we.children=ot)}}function XN(we,Ke,ot){return lt;function lt(jt,Yt,hr,Mr){const Br=Array.isArray(hr.children)?ot:Ke;return Mr?Br(Yt,hr,Mr):Br(Yt,hr)}}function YN(we,Ke){return ot;function ot(lt,jt,Yt,hr){const Mr=Array.isArray(Yt.children),en=Xk(lt);return Ke(jt,Yt,hr,Mr,{columnNumber:en?en.column-1:void 0,fileName:we,lineNumber:en?en.line:void 0},void 0)}}function ZN(we,Ke){const ot={};let lt,jt;for(jt in Ke.properties)if(jt!=="children"&&Yk.call(Ke.properties,jt)){const Yt=$N(we,jt,Ke.properties[jt]);if(Yt){const[hr,Mr]=Yt;we.tableCellAlignToStyle&&hr==="align"&&typeof Mr=="string"&&BN.has(Ke.tagName)?lt=Mr:ot[hr]=Mr}}if(lt){const Yt=ot.style||(ot.style={});Yt[we.stylePropertyNameCase==="css"?"text-align":"textAlign"]=lt}return ot}function WN(we,Ke){const ot={};for(const lt of Ke.attributes)if(lt.type==="mdxJsxExpressionAttribute")if(lt.data&<.data.estree&&we.evaluater){const Yt=lt.data.estree.body[0];Yt.type;const hr=Yt.expression;hr.type;const Mr=hr.properties[0];Mr.type,Object.assign(ot,we.evaluater.evaluateExpression(Mr.argument))}else BT(we,Ke.position);else{const jt=lt.name;let Yt;if(lt.value&&typeof lt.value=="object")if(lt.value.data&<.value.data.estree&&we.evaluater){const Mr=lt.value.data.estree.body[0];Mr.type,Yt=we.evaluater.evaluateExpression(Mr.expression)}else BT(we,Ke.position);else Yt=lt.value===null?!0:lt.value;ot[jt]=Yt}return ot}function Wk(we,Ke){const ot=[];let lt=-1;const jt=we.passKeys?new Map:zN;for(;++ltjt?0:jt+Ke:Ke=Ke>jt?jt:Ke,ot=ot>0?ot:0,lt.length<1e4)hr=Array.from(lt),hr.unshift(Ke,ot),we.splice(...hr);else for(ot&&we.splice(Ke,ot);Yt0?(Qm(we,we.length,0,Ke),we):Ke}const x4={}.hasOwnProperty;function aU(we){const Ke={};let ot=-1;for(;++ot13&&ot<32||ot>126&&ot<160||ot>55295&&ot<57344||ot>64975&&ot<65008||(ot&65535)===65535||(ot&65535)===65534||ot>1114111?"�":String.fromCodePoint(ot)}function Ow(we){return we.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jm=_1(/[A-Za-z]/),l0=_1(/[\dA-Za-z]/),sU=_1(/[#-'*+\--9=?A-Z^-~]/);function zk(we){return we!==null&&(we<32||we===127)}const Ok=_1(/\d/),lU=_1(/[\dA-Fa-f]/),uU=_1(/[!-/:-@[-`{-~]/);function yu(we){return we!==null&&we<-2}function Rp(we){return we!==null&&(we<0||we===32)}function Af(we){return we===-2||we===-1||we===32}const cU=_1(new RegExp("\\p{P}|\\p{S}","u")),fU=_1(/\s/);function _1(we){return Ke;function Ke(ot){return ot!==null&&ot>-1&&we.test(String.fromCharCode(ot))}}function Nw(we){const Ke=[];let ot=-1,lt=0,jt=0;for(;++ot55295&&Yt<57344){const Mr=we.charCodeAt(ot+1);Yt<56320&&Mr>56319&&Mr<57344?(hr=String.fromCharCode(Yt,Mr),jt=1):hr="�"}else hr=String.fromCharCode(Yt);hr&&(Ke.push(we.slice(lt,ot),encodeURIComponent(hr)),lt=ot+jt+1,hr=""),jt&&(ot+=jt,jt=0)}return Ke.join("")+we.slice(lt)}function gh(we,Ke,ot,lt){const jt=lt?lt-1:Number.POSITIVE_INFINITY;let Yt=0;return hr;function hr(en){return Af(en)?(we.enter(ot),Mr(en)):Ke(en)}function Mr(en){return Af(en)&&Yt++hr))return;const Eo=Ke.events.length;let zs=Eo,ki,tl;for(;zs--;)if(Ke.events[zs][0]==="exit"&&Ke.events[zs][1].type==="chunkFlow"){if(ki){tl=Ke.events[zs][1].end;break}ki=!0}for(hi(lt),di=Eo;diAo;){const uo=ot[Ns];Ke.containerState=uo[1],uo[0].exit.call(Ke,we)}ot.length=Ao}function Ge(){jt.write([null]),Yt=void 0,jt=void 0,Ke.containerState._closeFlow=void 0}}function mU(we,Ke,ot){return gh(we,we.attempt(this.parser.constructs.document,Ke,ot),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function w4(we){if(we===null||Rp(we)||fU(we))return 1;if(cU(we))return 2}function Kk(we,Ke,ot){const lt=[];let jt=-1;for(;++jt1&&we[ot][1].end.offset-we[ot][1].start.offset>1?2:1;const wn={...we[lt][1].end},Wn={...we[ot][1].start};T4(wn,-en),T4(Wn,en),hr={type:en>1?"strongSequence":"emphasisSequence",start:wn,end:{...we[lt][1].end}},Mr={type:en>1?"strongSequence":"emphasisSequence",start:{...we[ot][1].start},end:Wn},Yt={type:en>1?"strongText":"emphasisText",start:{...we[lt][1].end},end:{...we[ot][1].start}},jt={type:en>1?"strong":"emphasis",start:{...hr.start},end:{...Mr.end}},we[lt][1].end={...hr.start},we[ot][1].start={...Mr.end},Br=[],we[lt][1].end.offset-we[lt][1].start.offset&&(Br=k0(Br,[["enter",we[lt][1],Ke],["exit",we[lt][1],Ke]])),Br=k0(Br,[["enter",jt,Ke],["enter",hr,Ke],["exit",hr,Ke],["enter",Yt,Ke]]),Br=k0(Br,Kk(Ke.parser.constructs.insideSpan.null,we.slice(lt+1,ot),Ke)),Br=k0(Br,[["exit",Yt,Ke],["enter",Mr,Ke],["exit",Mr,Ke],["exit",jt,Ke]]),we[ot][1].end.offset-we[ot][1].start.offset?(on=2,Br=k0(Br,[["enter",we[ot][1],Ke],["exit",we[ot][1],Ke]])):on=0,Qm(we,lt-1,ot-lt+3,Br),ot=lt+Br.length-on-2;break}}for(ot=-1;++ot0&&Af(di)?gh(we,Ge,"linePrefix",Yt+1)(di):Ge(di)}function Ge(di){return di===null||yu(di)?we.check(A4,wo,Ns)(di):(we.enter("codeFlowValue"),Ao(di))}function Ao(di){return di===null||yu(di)?(we.exit("codeFlowValue"),Ge(di)):(we.consume(di),Ao)}function Ns(di){return we.exit("codeFenced"),Ke(di)}function uo(di,Eo,zs){let ki=0;return tl;function tl(Ii){return di.enter("lineEnding"),di.consume(Ii),di.exit("lineEnding"),Bi}function Bi(Ii){return di.enter("codeFencedFence"),Af(Ii)?gh(di,zo,"linePrefix",lt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ii):zo(Ii)}function zo(Ii){return Ii===Mr?(di.enter("codeFencedFenceSequence"),Ll(Ii)):zs(Ii)}function Ll(Ii){return Ii===Mr?(ki++,di.consume(Ii),Ll):ki>=hr?(di.exit("codeFencedFenceSequence"),Af(Ii)?gh(di,Ei,"whitespace")(Ii):Ei(Ii)):zs(Ii)}function Ei(Ii){return Ii===null||yu(Ii)?(di.exit("codeFencedFence"),Eo(Ii)):zs(Ii)}}}function kU(we,Ke,ot){const lt=this;return jt;function jt(hr){return hr===null?ot(hr):(we.enter("lineEnding"),we.consume(hr),we.exit("lineEnding"),Yt)}function Yt(hr){return lt.parser.lazy[lt.now().line]?ot(hr):Ke(hr)}}const ck={name:"codeIndented",tokenize:LU},CU={partial:!0,tokenize:PU};function LU(we,Ke,ot){const lt=this;return jt;function jt(Br){return we.enter("codeIndented"),gh(we,Yt,"linePrefix",5)(Br)}function Yt(Br){const on=lt.events[lt.events.length-1];return on&&on[1].type==="linePrefix"&&on[2].sliceSerialize(on[1],!0).length>=4?hr(Br):ot(Br)}function hr(Br){return Br===null?en(Br):yu(Br)?we.attempt(CU,hr,en)(Br):(we.enter("codeFlowValue"),Mr(Br))}function Mr(Br){return Br===null||yu(Br)?(we.exit("codeFlowValue"),hr(Br)):(we.consume(Br),Mr)}function en(Br){return we.exit("codeIndented"),Ke(Br)}}function PU(we,Ke,ot){const lt=this;return jt;function jt(hr){return lt.parser.lazy[lt.now().line]?ot(hr):yu(hr)?(we.enter("lineEnding"),we.consume(hr),we.exit("lineEnding"),jt):gh(we,Yt,"linePrefix",5)(hr)}function Yt(hr){const Mr=lt.events[lt.events.length-1];return Mr&&Mr[1].type==="linePrefix"&&Mr[2].sliceSerialize(Mr[1],!0).length>=4?Ke(hr):yu(hr)?jt(hr):ot(hr)}}const RU={name:"codeText",previous:DU,resolve:IU,tokenize:zU};function IU(we){let Ke=we.length-4,ot=3,lt,jt;if((we[ot][1].type==="lineEnding"||we[ot][1].type==="space")&&(we[Ke][1].type==="lineEnding"||we[Ke][1].type==="space")){for(lt=ot;++lt=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+Ke+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return Kethis.left.length?this.right.slice(this.right.length-lt+this.left.length,this.right.length-Ke+this.left.length).reverse():this.left.slice(Ke).concat(this.right.slice(this.right.length-lt+this.left.length).reverse())}splice(Ke,ot,lt){const jt=ot||0;this.setCursor(Math.trunc(Ke));const Yt=this.right.splice(this.right.length-jt,Number.POSITIVE_INFINITY);return lt&&kT(this.left,lt),Yt.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(Ke){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(Ke)}pushMany(Ke){this.setCursor(Number.POSITIVE_INFINITY),kT(this.left,Ke)}unshift(Ke){this.setCursor(0),this.right.push(Ke)}unshiftMany(Ke){this.setCursor(0),kT(this.right,Ke.reverse())}setCursor(Ke){if(!(Ke===this.left.length||Ke>this.left.length&&this.right.length===0||Ke<0&&this.left.length===0))if(Ke=4?Ke(hr):we.interrupt(lt.parser.constructs.flow,ot,Ke)(hr)}}function NP(we,Ke,ot,lt,jt,Yt,hr,Mr,en){const Br=en||Number.POSITIVE_INFINITY;let on=0;return wn;function wn(hi){return hi===60?(we.enter(lt),we.enter(jt),we.enter(Yt),we.consume(hi),we.exit(Yt),Wn):hi===null||hi===32||hi===41||zk(hi)?ot(hi):(we.enter(lt),we.enter(hr),we.enter(Mr),we.enter("chunkString",{contentType:"string"}),wo(hi))}function Wn(hi){return hi===62?(we.enter(Yt),we.consume(hi),we.exit(Yt),we.exit(jt),we.exit(lt),Ke):(we.enter(Mr),we.enter("chunkString",{contentType:"string"}),Bn(hi))}function Bn(hi){return hi===62?(we.exit("chunkString"),we.exit(Mr),Wn(hi)):hi===null||hi===60||yu(hi)?ot(hi):(we.consume(hi),hi===92?Hi:Bn)}function Hi(hi){return hi===60||hi===62||hi===92?(we.consume(hi),Bn):Bn(hi)}function wo(hi){return!on&&(hi===null||hi===41||Rp(hi))?(we.exit("chunkString"),we.exit(Mr),we.exit(hr),we.exit(lt),Ke(hi)):on999||Bn===null||Bn===91||Bn===93&&!en||Bn===94&&!Mr&&"_hiddenFootnoteSupport"in hr.parser.constructs?ot(Bn):Bn===93?(we.exit(Yt),we.enter(jt),we.consume(Bn),we.exit(jt),we.exit(lt),Ke):yu(Bn)?(we.enter("lineEnding"),we.consume(Bn),we.exit("lineEnding"),on):(we.enter("chunkString",{contentType:"string"}),wn(Bn))}function wn(Bn){return Bn===null||Bn===91||Bn===93||yu(Bn)||Mr++>999?(we.exit("chunkString"),on(Bn)):(we.consume(Bn),en||(en=!Af(Bn)),Bn===92?Wn:wn)}function Wn(Bn){return Bn===91||Bn===92||Bn===93?(we.consume(Bn),Mr++,wn):wn(Bn)}}function jP(we,Ke,ot,lt,jt,Yt){let hr;return Mr;function Mr(Wn){return Wn===34||Wn===39||Wn===40?(we.enter(lt),we.enter(jt),we.consume(Wn),we.exit(jt),hr=Wn===40?41:Wn,en):ot(Wn)}function en(Wn){return Wn===hr?(we.enter(jt),we.consume(Wn),we.exit(jt),we.exit(lt),Ke):(we.enter(Yt),Br(Wn))}function Br(Wn){return Wn===hr?(we.exit(Yt),en(hr)):Wn===null?ot(Wn):yu(Wn)?(we.enter("lineEnding"),we.consume(Wn),we.exit("lineEnding"),gh(we,Br,"linePrefix")):(we.enter("chunkString",{contentType:"string"}),on(Wn))}function on(Wn){return Wn===hr||Wn===null||yu(Wn)?(we.exit("chunkString"),Br(Wn)):(we.consume(Wn),Wn===92?wn:on)}function wn(Wn){return Wn===hr||Wn===92?(we.consume(Wn),on):on(Wn)}}function DT(we,Ke){let ot;return lt;function lt(jt){return yu(jt)?(we.enter("lineEnding"),we.consume(jt),we.exit("lineEnding"),ot=!0,lt):Af(jt)?gh(we,lt,ot?"linePrefix":"lineSuffix")(jt):Ke(jt)}}const VU={name:"definition",tokenize:GU},HU={partial:!0,tokenize:XU};function GU(we,Ke,ot){const lt=this;let jt;return Yt;function Yt(Bn){return we.enter("definition"),hr(Bn)}function hr(Bn){return UP.call(lt,we,Mr,ot,"definitionLabel","definitionLabelMarker","definitionLabelString")(Bn)}function Mr(Bn){return jt=Ow(lt.sliceSerialize(lt.events[lt.events.length-1][1]).slice(1,-1)),Bn===58?(we.enter("definitionMarker"),we.consume(Bn),we.exit("definitionMarker"),en):ot(Bn)}function en(Bn){return Rp(Bn)?DT(we,Br)(Bn):Br(Bn)}function Br(Bn){return NP(we,on,ot,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(Bn)}function on(Bn){return we.attempt(HU,wn,wn)(Bn)}function wn(Bn){return Af(Bn)?gh(we,Wn,"whitespace")(Bn):Wn(Bn)}function Wn(Bn){return Bn===null||yu(Bn)?(we.exit("definition"),lt.parser.defined.push(jt),Ke(Bn)):ot(Bn)}}function XU(we,Ke,ot){return lt;function lt(Mr){return Rp(Mr)?DT(we,jt)(Mr):ot(Mr)}function jt(Mr){return jP(we,Yt,ot,"definitionTitle","definitionTitleMarker","definitionTitleString")(Mr)}function Yt(Mr){return Af(Mr)?gh(we,hr,"whitespace")(Mr):hr(Mr)}function hr(Mr){return Mr===null||yu(Mr)?Ke(Mr):ot(Mr)}}const YU={name:"hardBreakEscape",tokenize:ZU};function ZU(we,Ke,ot){return lt;function lt(Yt){return we.enter("hardBreakEscape"),we.consume(Yt),jt}function jt(Yt){return yu(Yt)?(we.exit("hardBreakEscape"),Ke(Yt)):ot(Yt)}}const WU={name:"headingAtx",resolve:$U,tokenize:KU};function $U(we,Ke){let ot=we.length-2,lt=3,jt,Yt;return we[lt][1].type==="whitespace"&&(lt+=2),ot-2>lt&&we[ot][1].type==="whitespace"&&(ot-=2),we[ot][1].type==="atxHeadingSequence"&&(lt===ot-1||ot-4>lt&&we[ot-2][1].type==="whitespace")&&(ot-=lt+1===ot?2:4),ot>lt&&(jt={type:"atxHeadingText",start:we[lt][1].start,end:we[ot][1].end},Yt={type:"chunkText",start:we[lt][1].start,end:we[ot][1].end,contentType:"text"},Qm(we,lt,ot-lt+1,[["enter",jt,Ke],["enter",Yt,Ke],["exit",Yt,Ke],["exit",jt,Ke]])),we}function KU(we,Ke,ot){let lt=0;return jt;function jt(on){return we.enter("atxHeading"),Yt(on)}function Yt(on){return we.enter("atxHeadingSequence"),hr(on)}function hr(on){return on===35&<++<6?(we.consume(on),hr):on===null||Rp(on)?(we.exit("atxHeadingSequence"),Mr(on)):ot(on)}function Mr(on){return on===35?(we.enter("atxHeadingSequence"),en(on)):on===null||yu(on)?(we.exit("atxHeading"),Ke(on)):Af(on)?gh(we,Mr,"whitespace")(on):(we.enter("atxHeadingText"),Br(on))}function en(on){return on===35?(we.consume(on),en):(we.exit("atxHeadingSequence"),Mr(on))}function Br(on){return on===null||on===35||Rp(on)?(we.exit("atxHeadingText"),Mr(on)):(we.consume(on),Br)}}const JU=["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"],M4=["pre","script","style","textarea"],QU={concrete:!0,name:"htmlFlow",resolveTo:rj,tokenize:nj},ej={partial:!0,tokenize:ij},tj={partial:!0,tokenize:aj};function rj(we){let Ke=we.length;for(;Ke--&&!(we[Ke][0]==="enter"&&we[Ke][1].type==="htmlFlow"););return Ke>1&&we[Ke-2][1].type==="linePrefix"&&(we[Ke][1].start=we[Ke-2][1].start,we[Ke+1][1].start=we[Ke-2][1].start,we.splice(Ke-2,2)),we}function nj(we,Ke,ot){const lt=this;let jt,Yt,hr,Mr,en;return Br;function Br(Jn){return on(Jn)}function on(Jn){return we.enter("htmlFlow"),we.enter("htmlFlowData"),we.consume(Jn),wn}function wn(Jn){return Jn===33?(we.consume(Jn),Wn):Jn===47?(we.consume(Jn),Yt=!0,wo):Jn===63?(we.consume(Jn),jt=3,lt.interrupt?Ke:ba):Jm(Jn)?(we.consume(Jn),hr=String.fromCharCode(Jn),Gi):ot(Jn)}function Wn(Jn){return Jn===45?(we.consume(Jn),jt=2,Bn):Jn===91?(we.consume(Jn),jt=5,Mr=0,Hi):Jm(Jn)?(we.consume(Jn),jt=4,lt.interrupt?Ke:ba):ot(Jn)}function Bn(Jn){return Jn===45?(we.consume(Jn),lt.interrupt?Ke:ba):ot(Jn)}function Hi(Jn){const vs="CDATA[";return Jn===vs.charCodeAt(Mr++)?(we.consume(Jn),Mr===vs.length?lt.interrupt?Ke:zo:Hi):ot(Jn)}function wo(Jn){return Jm(Jn)?(we.consume(Jn),hr=String.fromCharCode(Jn),Gi):ot(Jn)}function Gi(Jn){if(Jn===null||Jn===47||Jn===62||Rp(Jn)){const vs=Jn===47,Rs=hr.toLowerCase();return!vs&&!Yt&&M4.includes(Rs)?(jt=1,lt.interrupt?Ke(Jn):zo(Jn)):JU.includes(hr.toLowerCase())?(jt=6,vs?(we.consume(Jn),hi):lt.interrupt?Ke(Jn):zo(Jn)):(jt=7,lt.interrupt&&!lt.parser.lazy[lt.now().line]?ot(Jn):Yt?Ge(Jn):Ao(Jn))}return Jn===45||l0(Jn)?(we.consume(Jn),hr+=String.fromCharCode(Jn),Gi):ot(Jn)}function hi(Jn){return Jn===62?(we.consume(Jn),lt.interrupt?Ke:zo):ot(Jn)}function Ge(Jn){return Af(Jn)?(we.consume(Jn),Ge):tl(Jn)}function Ao(Jn){return Jn===47?(we.consume(Jn),tl):Jn===58||Jn===95||Jm(Jn)?(we.consume(Jn),Ns):Af(Jn)?(we.consume(Jn),Ao):tl(Jn)}function Ns(Jn){return Jn===45||Jn===46||Jn===58||Jn===95||l0(Jn)?(we.consume(Jn),Ns):uo(Jn)}function uo(Jn){return Jn===61?(we.consume(Jn),di):Af(Jn)?(we.consume(Jn),uo):Ao(Jn)}function di(Jn){return Jn===null||Jn===60||Jn===61||Jn===62||Jn===96?ot(Jn):Jn===34||Jn===39?(we.consume(Jn),en=Jn,Eo):Af(Jn)?(we.consume(Jn),di):zs(Jn)}function Eo(Jn){return Jn===en?(we.consume(Jn),en=null,ki):Jn===null||yu(Jn)?ot(Jn):(we.consume(Jn),Eo)}function zs(Jn){return Jn===null||Jn===34||Jn===39||Jn===47||Jn===60||Jn===61||Jn===62||Jn===96||Rp(Jn)?uo(Jn):(we.consume(Jn),zs)}function ki(Jn){return Jn===47||Jn===62||Af(Jn)?Ao(Jn):ot(Jn)}function tl(Jn){return Jn===62?(we.consume(Jn),Bi):ot(Jn)}function Bi(Jn){return Jn===null||yu(Jn)?zo(Jn):Af(Jn)?(we.consume(Jn),Bi):ot(Jn)}function zo(Jn){return Jn===45&&jt===2?(we.consume(Jn),Ti):Jn===60&&jt===1?(we.consume(Jn),So):Jn===62&&jt===4?(we.consume(Jn),qa):Jn===63&&jt===3?(we.consume(Jn),ba):Jn===93&&jt===5?(we.consume(Jn),bu):yu(Jn)&&(jt===6||jt===7)?(we.exit("htmlFlowData"),we.check(ej,ro,Ll)(Jn)):Jn===null||yu(Jn)?(we.exit("htmlFlowData"),Ll(Jn)):(we.consume(Jn),zo)}function Ll(Jn){return we.check(tj,Ei,ro)(Jn)}function Ei(Jn){return we.enter("lineEnding"),we.consume(Jn),we.exit("lineEnding"),Ii}function Ii(Jn){return Jn===null||yu(Jn)?Ll(Jn):(we.enter("htmlFlowData"),zo(Jn))}function Ti(Jn){return Jn===45?(we.consume(Jn),ba):zo(Jn)}function So(Jn){return Jn===47?(we.consume(Jn),hr="",ws):zo(Jn)}function ws(Jn){if(Jn===62){const vs=hr.toLowerCase();return M4.includes(vs)?(we.consume(Jn),qa):zo(Jn)}return Jm(Jn)&&hr.length<8?(we.consume(Jn),hr+=String.fromCharCode(Jn),ws):zo(Jn)}function bu(Jn){return Jn===93?(we.consume(Jn),ba):zo(Jn)}function ba(Jn){return Jn===62?(we.consume(Jn),qa):Jn===45&&jt===2?(we.consume(Jn),ba):zo(Jn)}function qa(Jn){return Jn===null||yu(Jn)?(we.exit("htmlFlowData"),ro(Jn)):(we.consume(Jn),qa)}function ro(Jn){return we.exit("htmlFlow"),Ke(Jn)}}function aj(we,Ke,ot){const lt=this;return jt;function jt(hr){return yu(hr)?(we.enter("lineEnding"),we.consume(hr),we.exit("lineEnding"),Yt):ot(hr)}function Yt(hr){return lt.parser.lazy[lt.now().line]?ot(hr):Ke(hr)}}function ij(we,Ke,ot){return lt;function lt(jt){return we.enter("lineEnding"),we.consume(jt),we.exit("lineEnding"),we.attempt(TM,Ke,ot)}}const oj={name:"htmlText",tokenize:sj};function sj(we,Ke,ot){const lt=this;let jt,Yt,hr;return Mr;function Mr(ba){return we.enter("htmlText"),we.enter("htmlTextData"),we.consume(ba),en}function en(ba){return ba===33?(we.consume(ba),Br):ba===47?(we.consume(ba),uo):ba===63?(we.consume(ba),Ao):Jm(ba)?(we.consume(ba),zs):ot(ba)}function Br(ba){return ba===45?(we.consume(ba),on):ba===91?(we.consume(ba),Yt=0,Hi):Jm(ba)?(we.consume(ba),Ge):ot(ba)}function on(ba){return ba===45?(we.consume(ba),Bn):ot(ba)}function wn(ba){return ba===null?ot(ba):ba===45?(we.consume(ba),Wn):yu(ba)?(hr=wn,So(ba)):(we.consume(ba),wn)}function Wn(ba){return ba===45?(we.consume(ba),Bn):wn(ba)}function Bn(ba){return ba===62?Ti(ba):ba===45?Wn(ba):wn(ba)}function Hi(ba){const qa="CDATA[";return ba===qa.charCodeAt(Yt++)?(we.consume(ba),Yt===qa.length?wo:Hi):ot(ba)}function wo(ba){return ba===null?ot(ba):ba===93?(we.consume(ba),Gi):yu(ba)?(hr=wo,So(ba)):(we.consume(ba),wo)}function Gi(ba){return ba===93?(we.consume(ba),hi):wo(ba)}function hi(ba){return ba===62?Ti(ba):ba===93?(we.consume(ba),hi):wo(ba)}function Ge(ba){return ba===null||ba===62?Ti(ba):yu(ba)?(hr=Ge,So(ba)):(we.consume(ba),Ge)}function Ao(ba){return ba===null?ot(ba):ba===63?(we.consume(ba),Ns):yu(ba)?(hr=Ao,So(ba)):(we.consume(ba),Ao)}function Ns(ba){return ba===62?Ti(ba):Ao(ba)}function uo(ba){return Jm(ba)?(we.consume(ba),di):ot(ba)}function di(ba){return ba===45||l0(ba)?(we.consume(ba),di):Eo(ba)}function Eo(ba){return yu(ba)?(hr=Eo,So(ba)):Af(ba)?(we.consume(ba),Eo):Ti(ba)}function zs(ba){return ba===45||l0(ba)?(we.consume(ba),zs):ba===47||ba===62||Rp(ba)?ki(ba):ot(ba)}function ki(ba){return ba===47?(we.consume(ba),Ti):ba===58||ba===95||Jm(ba)?(we.consume(ba),tl):yu(ba)?(hr=ki,So(ba)):Af(ba)?(we.consume(ba),ki):Ti(ba)}function tl(ba){return ba===45||ba===46||ba===58||ba===95||l0(ba)?(we.consume(ba),tl):Bi(ba)}function Bi(ba){return ba===61?(we.consume(ba),zo):yu(ba)?(hr=Bi,So(ba)):Af(ba)?(we.consume(ba),Bi):ki(ba)}function zo(ba){return ba===null||ba===60||ba===61||ba===62||ba===96?ot(ba):ba===34||ba===39?(we.consume(ba),jt=ba,Ll):yu(ba)?(hr=zo,So(ba)):Af(ba)?(we.consume(ba),zo):(we.consume(ba),Ei)}function Ll(ba){return ba===jt?(we.consume(ba),jt=void 0,Ii):ba===null?ot(ba):yu(ba)?(hr=Ll,So(ba)):(we.consume(ba),Ll)}function Ei(ba){return ba===null||ba===34||ba===39||ba===60||ba===61||ba===96?ot(ba):ba===47||ba===62||Rp(ba)?ki(ba):(we.consume(ba),Ei)}function Ii(ba){return ba===47||ba===62||Rp(ba)?ki(ba):ot(ba)}function Ti(ba){return ba===62?(we.consume(ba),we.exit("htmlTextData"),we.exit("htmlText"),Ke):ot(ba)}function So(ba){return we.exit("htmlTextData"),we.enter("lineEnding"),we.consume(ba),we.exit("lineEnding"),ws}function ws(ba){return Af(ba)?gh(we,bu,"linePrefix",lt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ba):bu(ba)}function bu(ba){return we.enter("htmlTextData"),hr(ba)}}const Jk={name:"labelEnd",resolveAll:fj,resolveTo:hj,tokenize:dj},lj={tokenize:vj},uj={tokenize:pj},cj={tokenize:mj};function fj(we){let Ke=-1;const ot=[];for(;++Ke=3&&(Br===null||yu(Br))?(we.exit("thematicBreak"),Ke(Br)):ot(Br)}function en(Br){return Br===jt?(we.consume(Br),lt++,en):(we.exit("thematicBreakSequence"),Af(Br)?gh(we,Mr,"whitespace")(Br):Mr(Br))}}const Pp={continuation:{tokenize:Mj},exit:kj,name:"list",tokenize:Sj},Tj={partial:!0,tokenize:Cj},Aj={partial:!0,tokenize:Ej};function Sj(we,Ke,ot){const lt=this,jt=lt.events[lt.events.length-1];let Yt=jt&&jt[1].type==="linePrefix"?jt[2].sliceSerialize(jt[1],!0).length:0,hr=0;return Mr;function Mr(Bn){const Hi=lt.containerState.type||(Bn===42||Bn===43||Bn===45?"listUnordered":"listOrdered");if(Hi==="listUnordered"?!lt.containerState.marker||Bn===lt.containerState.marker:Ok(Bn)){if(lt.containerState.type||(lt.containerState.type=Hi,we.enter(Hi,{_container:!0})),Hi==="listUnordered")return we.enter("listItemPrefix"),Bn===42||Bn===45?we.check(fM,ot,Br)(Bn):Br(Bn);if(!lt.interrupt||Bn===49)return we.enter("listItemPrefix"),we.enter("listItemValue"),en(Bn)}return ot(Bn)}function en(Bn){return Ok(Bn)&&++hr<10?(we.consume(Bn),en):(!lt.interrupt||hr<2)&&(lt.containerState.marker?Bn===lt.containerState.marker:Bn===41||Bn===46)?(we.exit("listItemValue"),Br(Bn)):ot(Bn)}function Br(Bn){return we.enter("listItemMarker"),we.consume(Bn),we.exit("listItemMarker"),lt.containerState.marker=lt.containerState.marker||Bn,we.check(TM,lt.interrupt?ot:on,we.attempt(Tj,Wn,wn))}function on(Bn){return lt.containerState.initialBlankLine=!0,Yt++,Wn(Bn)}function wn(Bn){return Af(Bn)?(we.enter("listItemPrefixWhitespace"),we.consume(Bn),we.exit("listItemPrefixWhitespace"),Wn):ot(Bn)}function Wn(Bn){return lt.containerState.size=Yt+lt.sliceSerialize(we.exit("listItemPrefix"),!0).length,Ke(Bn)}}function Mj(we,Ke,ot){const lt=this;return lt.containerState._closeFlow=void 0,we.check(TM,jt,Yt);function jt(Mr){return lt.containerState.furtherBlankLines=lt.containerState.furtherBlankLines||lt.containerState.initialBlankLine,gh(we,Ke,"listItemIndent",lt.containerState.size+1)(Mr)}function Yt(Mr){return lt.containerState.furtherBlankLines||!Af(Mr)?(lt.containerState.furtherBlankLines=void 0,lt.containerState.initialBlankLine=void 0,hr(Mr)):(lt.containerState.furtherBlankLines=void 0,lt.containerState.initialBlankLine=void 0,we.attempt(Aj,Ke,hr)(Mr))}function hr(Mr){return lt.containerState._closeFlow=!0,lt.interrupt=void 0,gh(we,we.attempt(Pp,Ke,ot),"linePrefix",lt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Mr)}}function Ej(we,Ke,ot){const lt=this;return gh(we,jt,"listItemIndent",lt.containerState.size+1);function jt(Yt){const hr=lt.events[lt.events.length-1];return hr&&hr[1].type==="listItemIndent"&&hr[2].sliceSerialize(hr[1],!0).length===lt.containerState.size?Ke(Yt):ot(Yt)}}function kj(we){we.exit(this.containerState.type)}function Cj(we,Ke,ot){const lt=this;return gh(we,jt,"listItemPrefixWhitespace",lt.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function jt(Yt){const hr=lt.events[lt.events.length-1];return!Af(Yt)&&hr&&hr[1].type==="listItemPrefixWhitespace"?Ke(Yt):ot(Yt)}}const E4={name:"setextUnderline",resolveTo:Lj,tokenize:Pj};function Lj(we,Ke){let ot=we.length,lt,jt,Yt;for(;ot--;)if(we[ot][0]==="enter"){if(we[ot][1].type==="content"){lt=ot;break}we[ot][1].type==="paragraph"&&(jt=ot)}else we[ot][1].type==="content"&&we.splice(ot,1),!Yt&&we[ot][1].type==="definition"&&(Yt=ot);const hr={type:"setextHeading",start:{...we[lt][1].start},end:{...we[we.length-1][1].end}};return we[jt][1].type="setextHeadingText",Yt?(we.splice(jt,0,["enter",hr,Ke]),we.splice(Yt+1,0,["exit",we[lt][1],Ke]),we[lt][1].end={...we[Yt][1].end}):we[lt][1]=hr,we.push(["exit",hr,Ke]),we}function Pj(we,Ke,ot){const lt=this;let jt;return Yt;function Yt(Br){let on=lt.events.length,wn;for(;on--;)if(lt.events[on][1].type!=="lineEnding"&<.events[on][1].type!=="linePrefix"&<.events[on][1].type!=="content"){wn=lt.events[on][1].type==="paragraph";break}return!lt.parser.lazy[lt.now().line]&&(lt.interrupt||wn)?(we.enter("setextHeadingLine"),jt=Br,hr(Br)):ot(Br)}function hr(Br){return we.enter("setextHeadingLineSequence"),Mr(Br)}function Mr(Br){return Br===jt?(we.consume(Br),Mr):(we.exit("setextHeadingLineSequence"),Af(Br)?gh(we,en,"lineSuffix")(Br):en(Br))}function en(Br){return Br===null||yu(Br)?(we.exit("setextHeadingLine"),Ke(Br)):ot(Br)}}const Rj={tokenize:Ij};function Ij(we){const Ke=this,ot=we.attempt(TM,lt,we.attempt(this.parser.constructs.flowInitial,jt,gh(we,we.attempt(this.parser.constructs.flow,jt,we.attempt(BU,jt)),"linePrefix")));return ot;function lt(Yt){if(Yt===null){we.consume(Yt);return}return we.enter("lineEndingBlank"),we.consume(Yt),we.exit("lineEndingBlank"),Ke.currentConstruct=void 0,ot}function jt(Yt){if(Yt===null){we.consume(Yt);return}return we.enter("lineEnding"),we.consume(Yt),we.exit("lineEnding"),Ke.currentConstruct=void 0,ot}}const Dj={resolveAll:VP()},zj=qP("string"),Oj=qP("text");function qP(we){return{resolveAll:VP(we==="text"?Fj:void 0),tokenize:Ke};function Ke(ot){const lt=this,jt=this.parser.constructs[we],Yt=ot.attempt(jt,hr,Mr);return hr;function hr(on){return Br(on)?Yt(on):Mr(on)}function Mr(on){if(on===null){ot.consume(on);return}return ot.enter("data"),ot.consume(on),en}function en(on){return Br(on)?(ot.exit("data"),Yt(on)):(ot.consume(on),en)}function Br(on){if(on===null)return!0;const wn=jt[on];let Wn=-1;if(wn)for(;++Wn-1){const Mr=hr[0];typeof Mr=="string"?hr[0]=Mr.slice(lt):hr.shift()}Yt>0&&hr.push(we[jt].slice(0,Yt))}return hr}function $j(we,Ke){let ot=-1;const lt=[];let jt;for(;++ot0){const tp=au.tokenStack[au.tokenStack.length-1];(tp[1]||C4).call(au,void 0,tp[0])}for(us.position={start:y1(oo.length>0?oo[0][1].start:{line:1,column:1,offset:0}),end:y1(oo.length>0?oo[oo.length-2][1].end:{line:1,column:1,offset:0})},Qc=-1;++Qc0&&(lt.className=["language-"+jt[0]]);let Yt={type:"element",tagName:"code",properties:lt,children:[{type:"text",value:ot}]};return Ke.meta&&(Yt.data={meta:Ke.meta}),we.patch(Ke,Yt),Yt=we.applyData(Ke,Yt),Yt={type:"element",tagName:"pre",properties:{},children:[Yt]},we.patch(Ke,Yt),Yt}function cq(we,Ke){const ot={type:"element",tagName:"del",properties:{},children:we.all(Ke)};return we.patch(Ke,ot),we.applyData(Ke,ot)}function fq(we,Ke){const ot={type:"element",tagName:"em",properties:{},children:we.all(Ke)};return we.patch(Ke,ot),we.applyData(Ke,ot)}function hq(we,Ke){const ot=typeof we.options.clobberPrefix=="string"?we.options.clobberPrefix:"user-content-",lt=String(Ke.identifier).toUpperCase(),jt=Nw(lt.toLowerCase()),Yt=we.footnoteOrder.indexOf(lt);let hr,Mr=we.footnoteCounts.get(lt);Mr===void 0?(Mr=0,we.footnoteOrder.push(lt),hr=we.footnoteOrder.length):hr=Yt+1,Mr+=1,we.footnoteCounts.set(lt,Mr);const en={type:"element",tagName:"a",properties:{href:"#"+ot+"fn-"+jt,id:ot+"fnref-"+jt+(Mr>1?"-"+Mr:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(hr)}]};we.patch(Ke,en);const Br={type:"element",tagName:"sup",properties:{},children:[en]};return we.patch(Ke,Br),we.applyData(Ke,Br)}function dq(we,Ke){const ot={type:"element",tagName:"h"+Ke.depth,properties:{},children:we.all(Ke)};return we.patch(Ke,ot),we.applyData(Ke,ot)}function vq(we,Ke){if(we.options.allowDangerousHtml){const ot={type:"raw",value:Ke.value};return we.patch(Ke,ot),we.applyData(Ke,ot)}}function XP(we,Ke){const ot=Ke.referenceType;let lt="]";if(ot==="collapsed"?lt+="[]":ot==="full"&&(lt+="["+(Ke.label||Ke.identifier)+"]"),Ke.type==="imageReference")return[{type:"text",value:"!["+Ke.alt+lt}];const jt=we.all(Ke),Yt=jt[0];Yt&&Yt.type==="text"?Yt.value="["+Yt.value:jt.unshift({type:"text",value:"["});const hr=jt[jt.length-1];return hr&&hr.type==="text"?hr.value+=lt:jt.push({type:"text",value:lt}),jt}function pq(we,Ke){const ot=String(Ke.identifier).toUpperCase(),lt=we.definitionById.get(ot);if(!lt)return XP(we,Ke);const jt={src:Nw(lt.url||""),alt:Ke.alt};lt.title!==null&<.title!==void 0&&(jt.title=lt.title);const Yt={type:"element",tagName:"img",properties:jt,children:[]};return we.patch(Ke,Yt),we.applyData(Ke,Yt)}function mq(we,Ke){const ot={src:Nw(Ke.url)};Ke.alt!==null&&Ke.alt!==void 0&&(ot.alt=Ke.alt),Ke.title!==null&&Ke.title!==void 0&&(ot.title=Ke.title);const lt={type:"element",tagName:"img",properties:ot,children:[]};return we.patch(Ke,lt),we.applyData(Ke,lt)}function gq(we,Ke){const ot={type:"text",value:Ke.value.replace(/\r?\n|\r/g," ")};we.patch(Ke,ot);const lt={type:"element",tagName:"code",properties:{},children:[ot]};return we.patch(Ke,lt),we.applyData(Ke,lt)}function yq(we,Ke){const ot=String(Ke.identifier).toUpperCase(),lt=we.definitionById.get(ot);if(!lt)return XP(we,Ke);const jt={href:Nw(lt.url||"")};lt.title!==null&<.title!==void 0&&(jt.title=lt.title);const Yt={type:"element",tagName:"a",properties:jt,children:we.all(Ke)};return we.patch(Ke,Yt),we.applyData(Ke,Yt)}function _q(we,Ke){const ot={href:Nw(Ke.url)};Ke.title!==null&&Ke.title!==void 0&&(ot.title=Ke.title);const lt={type:"element",tagName:"a",properties:ot,children:we.all(Ke)};return we.patch(Ke,lt),we.applyData(Ke,lt)}function xq(we,Ke,ot){const lt=we.all(Ke),jt=ot?bq(ot):YP(Ke),Yt={},hr=[];if(typeof Ke.checked=="boolean"){const on=lt[0];let wn;on&&on.type==="element"&&on.tagName==="p"?wn=on:(wn={type:"element",tagName:"p",properties:{},children:[]},lt.unshift(wn)),wn.children.length>0&&wn.children.unshift({type:"text",value:" "}),wn.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:Ke.checked,disabled:!0},children:[]}),Yt.className=["task-list-item"]}let Mr=-1;for(;++Mr1}function wq(we,Ke){const ot={},lt=we.all(Ke);let jt=-1;for(typeof Ke.start=="number"&&Ke.start!==1&&(ot.start=Ke.start);++jt0){const hr={type:"element",tagName:"tbody",properties:{},children:we.wrap(ot,!0)},Mr=Xk(Ke.children[1]),en=EP(Ke.children[Ke.children.length-1]);Mr&&en&&(hr.position={start:Mr,end:en}),jt.push(hr)}const Yt={type:"element",tagName:"table",properties:{},children:we.wrap(jt,!0)};return we.patch(Ke,Yt),we.applyData(Ke,Yt)}function Eq(we,Ke,ot){const lt=ot?ot.children:void 0,Yt=(lt?lt.indexOf(Ke):1)===0?"th":"td",hr=ot&&ot.type==="table"?ot.align:void 0,Mr=hr?hr.length:Ke.children.length;let en=-1;const Br=[];for(;++en0,!0),lt[0]),jt=lt.index+lt[0].length,lt=ot.exec(Ke);return Yt.push(R4(Ke.slice(jt),jt>0,!1)),Yt.join("")}function R4(we,Ke,ot){let lt=0,jt=we.length;if(Ke){let Yt=we.codePointAt(lt);for(;Yt===L4||Yt===P4;)lt++,Yt=we.codePointAt(lt)}if(ot){let Yt=we.codePointAt(jt-1);for(;Yt===L4||Yt===P4;)jt--,Yt=we.codePointAt(jt-1)}return jt>lt?we.slice(lt,jt):""}function Lq(we,Ke){const ot={type:"text",value:Cq(String(Ke.value))};return we.patch(Ke,ot),we.applyData(Ke,ot)}function Pq(we,Ke){const ot={type:"element",tagName:"hr",properties:{},children:[]};return we.patch(Ke,ot),we.applyData(Ke,ot)}const Rq={blockquote:sq,break:lq,code:uq,delete:cq,emphasis:fq,footnoteReference:hq,heading:dq,html:vq,imageReference:pq,image:mq,inlineCode:gq,linkReference:yq,link:_q,listItem:xq,list:wq,paragraph:Tq,root:Aq,strong:Sq,table:Mq,tableCell:kq,tableRow:Eq,text:Lq,thematicBreak:Pq,toml:oM,yaml:oM,definition:oM,footnoteDefinition:oM};function oM(){}const ZP=-1,AM=0,zT=1,mM=2,Qk=3,eC=4,tC=5,rC=6,WP=7,$P=8,I4=typeof self=="object"?self:globalThis,Iq=(we,Ke)=>{const ot=(jt,Yt)=>(we.set(Yt,jt),jt),lt=jt=>{if(we.has(jt))return we.get(jt);const[Yt,hr]=Ke[jt];switch(Yt){case AM:case ZP:return ot(hr,jt);case zT:{const Mr=ot([],jt);for(const en of hr)Mr.push(lt(en));return Mr}case mM:{const Mr=ot({},jt);for(const[en,Br]of hr)Mr[lt(en)]=lt(Br);return Mr}case Qk:return ot(new Date(hr),jt);case eC:{const{source:Mr,flags:en}=hr;return ot(new RegExp(Mr,en),jt)}case tC:{const Mr=ot(new Map,jt);for(const[en,Br]of hr)Mr.set(lt(en),lt(Br));return Mr}case rC:{const Mr=ot(new Set,jt);for(const en of hr)Mr.add(lt(en));return Mr}case WP:{const{name:Mr,message:en}=hr;return ot(new I4[Mr](en),jt)}case $P:return ot(BigInt(hr),jt);case"BigInt":return ot(Object(BigInt(hr)),jt);case"ArrayBuffer":return ot(new Uint8Array(hr).buffer,hr);case"DataView":{const{buffer:Mr}=new Uint8Array(hr);return ot(new DataView(Mr),hr)}}return ot(new I4[Yt](hr),jt)};return lt},D4=we=>Iq(new Map,we)(0),Rw="",{toString:Dq}={},{keys:zq}=Object,CT=we=>{const Ke=typeof we;if(Ke!=="object"||!we)return[AM,Ke];const ot=Dq.call(we).slice(8,-1);switch(ot){case"Array":return[zT,Rw];case"Object":return[mM,Rw];case"Date":return[Qk,Rw];case"RegExp":return[eC,Rw];case"Map":return[tC,Rw];case"Set":return[rC,Rw];case"DataView":return[zT,ot]}return ot.includes("Array")?[zT,ot]:ot.includes("Error")?[WP,ot]:[mM,ot]},sM=([we,Ke])=>we===AM&&(Ke==="function"||Ke==="symbol"),Oq=(we,Ke,ot,lt)=>{const jt=(hr,Mr)=>{const en=lt.push(hr)-1;return ot.set(Mr,en),en},Yt=hr=>{if(ot.has(hr))return ot.get(hr);let[Mr,en]=CT(hr);switch(Mr){case AM:{let on=hr;switch(en){case"bigint":Mr=$P,on=hr.toString();break;case"function":case"symbol":if(we)throw new TypeError("unable to serialize "+en);on=null;break;case"undefined":return jt([ZP],hr)}return jt([Mr,on],hr)}case zT:{if(en){let Wn=hr;return en==="DataView"?Wn=new Uint8Array(hr.buffer):en==="ArrayBuffer"&&(Wn=new Uint8Array(hr)),jt([en,[...Wn]],hr)}const on=[],wn=jt([Mr,on],hr);for(const Wn of hr)on.push(Yt(Wn));return wn}case mM:{if(en)switch(en){case"BigInt":return jt([en,hr.toString()],hr);case"Boolean":case"Number":case"String":return jt([en,hr.valueOf()],hr)}if(Ke&&"toJSON"in hr)return Yt(hr.toJSON());const on=[],wn=jt([Mr,on],hr);for(const Wn of zq(hr))(we||!sM(CT(hr[Wn])))&&on.push([Yt(Wn),Yt(hr[Wn])]);return wn}case Qk:return jt([Mr,hr.toISOString()],hr);case eC:{const{source:on,flags:wn}=hr;return jt([Mr,{source:on,flags:wn}],hr)}case tC:{const on=[],wn=jt([Mr,on],hr);for(const[Wn,Bn]of hr)(we||!(sM(CT(Wn))||sM(CT(Bn))))&&on.push([Yt(Wn),Yt(Bn)]);return wn}case rC:{const on=[],wn=jt([Mr,on],hr);for(const Wn of hr)(we||!sM(CT(Wn)))&&on.push(Yt(Wn));return wn}}const{message:Br}=hr;return jt([Mr,{name:en,message:Br}],hr)};return Yt},z4=(we,{json:Ke,lossy:ot}={})=>{const lt=[];return Oq(!(Ke||ot),!!Ke,new Map,lt)(we),lt},gM=typeof structuredClone=="function"?(we,Ke)=>Ke&&("json"in Ke||"lossy"in Ke)?D4(z4(we,Ke)):structuredClone(we):(we,Ke)=>D4(z4(we,Ke));function Fq(we,Ke){const ot=[{type:"text",value:"↩"}];return Ke>1&&ot.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(Ke)}]}),ot}function Bq(we,Ke){return"Back to reference "+(we+1)+(Ke>1?"-"+Ke:"")}function Nq(we){const Ke=typeof we.options.clobberPrefix=="string"?we.options.clobberPrefix:"user-content-",ot=we.options.footnoteBackContent||Fq,lt=we.options.footnoteBackLabel||Bq,jt=we.options.footnoteLabel||"Footnotes",Yt=we.options.footnoteLabelTagName||"h2",hr=we.options.footnoteLabelProperties||{className:["sr-only"]},Mr=[];let en=-1;for(;++en0&&Hi.push({type:"text",value:" "});let Ge=typeof ot=="string"?ot:ot(en,Bn);typeof Ge=="string"&&(Ge={type:"text",value:Ge}),Hi.push({type:"element",tagName:"a",properties:{href:"#"+Ke+"fnref-"+Wn+(Bn>1?"-"+Bn:""),dataFootnoteBackref:"",ariaLabel:typeof lt=="string"?lt:lt(en,Bn),className:["data-footnote-backref"]},children:Array.isArray(Ge)?Ge:[Ge]})}const Gi=on[on.length-1];if(Gi&&Gi.type==="element"&&Gi.tagName==="p"){const Ge=Gi.children[Gi.children.length-1];Ge&&Ge.type==="text"?Ge.value+=" ":Gi.children.push({type:"text",value:" "}),Gi.children.push(...Hi)}else on.push(...Hi);const hi={type:"element",tagName:"li",properties:{id:Ke+"fn-"+Wn},children:we.wrap(on,!0)};we.patch(Br,hi),Mr.push(hi)}if(Mr.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:Yt,properties:{...gM(hr),id:"footnote-label"},children:[{type:"text",value:jt}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:we.wrap(Mr,!0)},{type:"text",value:` +`}]}}const KP=(function(we){if(we==null)return Vq;if(typeof we=="function")return SM(we);if(typeof we=="object")return Array.isArray(we)?Uq(we):jq(we);if(typeof we=="string")return qq(we);throw new Error("Expected function, string, or object as test")});function Uq(we){const Ke=[];let ot=-1;for(;++ot":""))+")"})}return Wn;function Wn(){let Bn=JP,Hi,wo,Gi;if((!Ke||Yt(en,Br,on[on.length-1]||void 0))&&(Bn=Zq(ot(en,on)),Bn[0]===O4))return Bn;if("children"in en&&en.children){const hi=en;if(hi.children&&Bn[0]!==Xq)for(wo=(lt?hi.children.length:-1)+hr,Gi=on.concat(hi);wo>-1&&wo0&&ot.push({type:"text",value:` +`}),ot}function F4(we){let Ke=0,ot=we.charCodeAt(Ke);for(;ot===9||ot===32;)Ke++,ot=we.charCodeAt(Ke);return we.slice(Ke)}function B4(we,Ke){const ot=$q(we,Ke),lt=ot.one(we,void 0),jt=Nq(ot),Yt=Array.isArray(lt)?{type:"root",children:lt}:lt||{type:"root",children:[]};return jt&&Yt.children.push({type:"text",value:` +`},jt),Yt}function tV(we,Ke){return we&&"run"in we?async function(ot,lt){const jt=B4(ot,{file:lt,...Ke});await we.run(jt,lt)}:function(ot,lt){return B4(ot,{file:lt,...we||Ke})}}function N4(we){if(we)throw we}var hk,U4;function rV(){if(U4)return hk;U4=1;var we=Object.prototype.hasOwnProperty,Ke=Object.prototype.toString,ot=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,jt=function(Br){return typeof Array.isArray=="function"?Array.isArray(Br):Ke.call(Br)==="[object Array]"},Yt=function(Br){if(!Br||Ke.call(Br)!=="[object Object]")return!1;var on=we.call(Br,"constructor"),wn=Br.constructor&&Br.constructor.prototype&&we.call(Br.constructor.prototype,"isPrototypeOf");if(Br.constructor&&!on&&!wn)return!1;var Wn;for(Wn in Br);return typeof Wn>"u"||we.call(Br,Wn)},hr=function(Br,on){ot&&on.name==="__proto__"?ot(Br,on.name,{enumerable:!0,configurable:!0,value:on.newValue,writable:!0}):Br[on.name]=on.newValue},Mr=function(Br,on){if(on==="__proto__")if(we.call(Br,on)){if(lt)return lt(Br,on).value}else return;return Br[on]};return hk=function en(){var Br,on,wn,Wn,Bn,Hi,wo=arguments[0],Gi=1,hi=arguments.length,Ge=!1;for(typeof wo=="boolean"&&(Ge=wo,wo=arguments[1]||{},Gi=2),(wo==null||typeof wo!="object"&&typeof wo!="function")&&(wo={});Gihr.length;let en;Mr&&hr.push(jt);try{en=we.apply(this,hr)}catch(Br){const on=Br;if(Mr&&ot)throw on;return jt(on)}Mr||(en&&en.then&&typeof en.then=="function"?en.then(Yt,jt):en instanceof Error?jt(en):Yt(en))}function jt(hr,...Mr){ot||(ot=!0,Ke(hr,...Mr))}function Yt(hr){jt(null,hr)}}const Km={basename:oV,dirname:sV,extname:lV,join:uV,sep:"/"};function oV(we,Ke){if(Ke!==void 0&&typeof Ke!="string")throw new TypeError('"ext" argument must be a string');UT(we);let ot=0,lt=-1,jt=we.length,Yt;if(Ke===void 0||Ke.length===0||Ke.length>we.length){for(;jt--;)if(we.codePointAt(jt)===47){if(Yt){ot=jt+1;break}}else lt<0&&(Yt=!0,lt=jt+1);return lt<0?"":we.slice(ot,lt)}if(Ke===we)return"";let hr=-1,Mr=Ke.length-1;for(;jt--;)if(we.codePointAt(jt)===47){if(Yt){ot=jt+1;break}}else hr<0&&(Yt=!0,hr=jt+1),Mr>-1&&(we.codePointAt(jt)===Ke.codePointAt(Mr--)?Mr<0&&(lt=jt):(Mr=-1,lt=hr));return ot===lt?lt=hr:lt<0&&(lt=we.length),we.slice(ot,lt)}function sV(we){if(UT(we),we.length===0)return".";let Ke=-1,ot=we.length,lt;for(;--ot;)if(we.codePointAt(ot)===47){if(lt){Ke=ot;break}}else lt||(lt=!0);return Ke<0?we.codePointAt(0)===47?"/":".":Ke===1&&we.codePointAt(0)===47?"//":we.slice(0,Ke)}function lV(we){UT(we);let Ke=we.length,ot=-1,lt=0,jt=-1,Yt=0,hr;for(;Ke--;){const Mr=we.codePointAt(Ke);if(Mr===47){if(hr){lt=Ke+1;break}continue}ot<0&&(hr=!0,ot=Ke+1),Mr===46?jt<0?jt=Ke:Yt!==1&&(Yt=1):jt>-1&&(Yt=-1)}return jt<0||ot<0||Yt===0||Yt===1&&jt===ot-1&&jt===lt+1?"":we.slice(jt,ot)}function uV(...we){let Ke=-1,ot;for(;++Ke0&&we.codePointAt(we.length-1)===47&&(ot+="/"),Ke?"/"+ot:ot}function fV(we,Ke){let ot="",lt=0,jt=-1,Yt=0,hr=-1,Mr,en;for(;++hr<=we.length;){if(hr2){if(en=ot.lastIndexOf("/"),en!==ot.length-1){en<0?(ot="",lt=0):(ot=ot.slice(0,en),lt=ot.length-1-ot.lastIndexOf("/")),jt=hr,Yt=0;continue}}else if(ot.length>0){ot="",lt=0,jt=hr,Yt=0;continue}}Ke&&(ot=ot.length>0?ot+"/..":"..",lt=2)}else ot.length>0?ot+="/"+we.slice(jt+1,hr):ot=we.slice(jt+1,hr),lt=hr-jt-1;jt=hr,Yt=0}else Mr===46&&Yt>-1?Yt++:Yt=-1}return ot}function UT(we){if(typeof we!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(we))}const hV={cwd:dV};function dV(){return"/"}function Uk(we){return!!(we!==null&&typeof we=="object"&&"href"in we&&we.href&&"protocol"in we&&we.protocol&&we.auth===void 0)}function vV(we){if(typeof we=="string")we=new URL(we);else if(!Uk(we)){const Ke=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+we+"`");throw Ke.code="ERR_INVALID_ARG_TYPE",Ke}if(we.protocol!=="file:"){const Ke=new TypeError("The URL must be of scheme file");throw Ke.code="ERR_INVALID_URL_SCHEME",Ke}return pV(we)}function pV(we){if(we.hostname!==""){const lt=new TypeError('File URL host must be "localhost" or empty on darwin');throw lt.code="ERR_INVALID_FILE_URL_HOST",lt}const Ke=we.pathname;let ot=-1;for(;++ot0){let[Bn,...Hi]=on;const wo=lt[Wn][1];Nk(wo)&&Nk(Bn)&&(Bn=dk(!0,wo,Bn)),lt[Wn]=[Br,Bn,...Hi]}}}}const _V=new nC().freeze();function gk(we,Ke){if(typeof Ke!="function")throw new TypeError("Cannot `"+we+"` without `parser`")}function yk(we,Ke){if(typeof Ke!="function")throw new TypeError("Cannot `"+we+"` without `compiler`")}function _k(we,Ke){if(Ke)throw new Error("Cannot call `"+we+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function q4(we){if(!Nk(we)||typeof we.type!="string")throw new TypeError("Expected node, got `"+we+"`")}function V4(we,Ke,ot){if(!ot)throw new Error("`"+we+"` finished async. Use `"+Ke+"` instead")}function lM(we){return xV(we)?we:new eR(we)}function xV(we){return!!(we&&typeof we=="object"&&"message"in we&&"messages"in we)}function bV(we){return typeof we=="string"||wV(we)}function wV(we){return!!(we&&typeof we=="object"&&"byteLength"in we&&"byteOffset"in we)}const TV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",H4=[],G4={allowDangerousHtml:!0},AV=/^(https?|ircs?|mailto|xmpp)$/i,SV=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function MV(we){const Ke=EV(we),ot=kV(we);return CV(Ke.runSync(Ke.parse(ot),ot),we)}function EV(we){const Ke=we.rehypePlugins||H4,ot=we.remarkPlugins||H4,lt=we.remarkRehypeOptions?{...we.remarkRehypeOptions,...G4}:G4;return _V().use(oq).use(ot).use(tV,lt).use(Ke)}function kV(we){const Ke=we.children||"",ot=new eR;return typeof Ke=="string"&&(ot.value=Ke),ot}function CV(we,Ke){const ot=Ke.allowedElements,lt=Ke.allowElement,jt=Ke.components,Yt=Ke.disallowedElements,hr=Ke.skipHtml,Mr=Ke.unwrapDisallowed,en=Ke.urlTransform||LV;for(const on of SV)Object.hasOwn(Ke,on.from)&&(""+on.from+(on.to?"use `"+on.to+"` instead":"remove it")+TV+on.id,void 0);return QP(we,Br),NN(we,{Fragment:ga.Fragment,components:jt,ignoreInvalidStyle:!0,jsx:ga.jsx,jsxs:ga.jsxs,passKeys:!0,passNode:!0});function Br(on,wn,Wn){if(on.type==="raw"&&Wn&&typeof wn=="number")return hr?Wn.children.splice(wn,1):Wn.children[wn]={type:"text",value:on.value},wn;if(on.type==="element"){let Bn;for(Bn in uk)if(Object.hasOwn(uk,Bn)&&Object.hasOwn(on.properties,Bn)){const Hi=on.properties[Bn],wo=uk[Bn];(wo===null||wo.includes(on.tagName))&&(on.properties[Bn]=en(String(Hi||""),Bn,on))}}if(on.type==="element"){let Bn=ot?!ot.includes(on.tagName):Yt?Yt.includes(on.tagName):!1;if(!Bn&<&&typeof wn=="number"&&(Bn=!lt(on,wn,Wn)),Bn&&Wn&&typeof wn=="number")return Mr&&on.children?Wn.children.splice(wn,1,...on.children):Wn.children.splice(wn,1),wn}}}function LV(we){const Ke=we.indexOf(":"),ot=we.indexOf("?"),lt=we.indexOf("#"),jt=we.indexOf("/");return Ke===-1||jt!==-1&&Ke>jt||ot!==-1&&Ke>ot||lt!==-1&&Ke>lt||AV.test(we.slice(0,Ke))?we:""}const PV="Watch optimisers walk downhill on a function you choose, one iteration at a time, side by side.\n\n## Steps\n\n1. **Function** (Configure tab): pick a univariate f(x) or bivariate f(x, y) function from the list, or type your own in the box, e.g. `x^4 - 2x^2 + 0.3x` or `sin(x) cos(y)`. A function that uses `y` has two variables. You can use `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `exp`, `log` (or `ln`), `sqrt`, `abs`, `pi` and `e`; `2x` means `2*x`.\n2. **Optimisers:** each optimiser is a card with its colour, name and latest f. The name is its algorithm's until you type your own: click it to rename (the plot legend uses it; clear it to go back), or click the rest of the card to open it, then pick an algorithm and change its settings in the boxes below it, e.g. η, the learning rate. Hover over a box for its name, or press ⓘ for every setting with a description. The reset arrow beside it puts the settings back to their defaults.\n3. **Initial point:** type it, click on the plot (this moves the open optimiser's point), or press the dice for a random one. The reset arrow beside it goes back to the function's usual initial point.\n4. **Step** (bottom of the panel, in every tab): press Play, or step forward and back. Type a number in the **×** box to move several iterations per step; each one is shown in turn.\n\nPress **+ Add optimiser** for another one on the same function, starting from a random point; every optimiser steps together, from the start again after a change. Click an optimiser's colour to pick another, or × to remove it. Hover over a point on a path to see f there and its derivatives: f′ and f″, or the gradient ∇f and the Hessian ∇²f.\n\nThe **Metrics** tab has a summary row per optimiser (its latest f, and how far its latest step moved, ‖Δx‖) and charts of f and of the gradient size ‖∇f‖ at each iteration, one line per optimiser. ‖∇f‖ is on a log scale, so steady convergence shows as a straight line. A run stops after 1000 iterations, or earlier if it diverges.\n\n## Two variables\n\nThe plot is a contour map of f, coloured from low (purple) to high (yellow). Above the plot, tick **Gradient field** to draw ∇f as arrows (contour only); they point uphill, so the optimiser moves against them. **Surface** (also above the plot) shows f in 3D; drag to turn it.\n\n## Plot\n\nDrag to pan and scroll to zoom. The function is redrawn for the new view.\n";function RV(){return ga.jsx("div",{className:"prose leading-loose",children:ga.jsx(MV,{components:{h2:({children:we})=>ga.jsx("h2",{className:"text-xl font-semibold mt-12 mb-2 first:mt-4",children:we}),p:({children:we})=>ga.jsx("p",{className:"leading-6 mb-3 last:mb-0",children:we}),ol:({children:we})=>ga.jsx("ol",{className:"list-decimal pl-5 mb-3",children:we}),li:({children:we})=>ga.jsx("li",{className:"mb-1",children:we}),code:({children:we})=>ga.jsx("code",{className:"bg-grid px-1 py-0.5 rounded",children:we})},children:PV})})}const tR=Symbol("Comlink.proxy"),IV=Symbol("Comlink.endpoint"),DV=Symbol("Comlink.releaseProxy"),xk=Symbol("Comlink.finalizer"),hM=Symbol("Comlink.thrown"),rR=we=>typeof we=="object"&&we!==null||typeof we=="function",zV={canHandle:we=>rR(we)&&we[tR],serialize(we){const{port1:Ke,port2:ot}=new MessageChannel;return aR(we,Ke),[ot,[ot]]},deserialize(we){return we.start(),oR(we)}},OV={canHandle:we=>rR(we)&&hM in we,serialize({value:we}){let Ke;return we instanceof Error?Ke={isError:!0,value:{message:we.message,name:we.name,stack:we.stack}}:Ke={isError:!1,value:we},[Ke,[]]},deserialize(we){throw we.isError?Object.assign(new Error(we.value.message),we.value):we.value}},nR=new Map([["proxy",zV],["throw",OV]]);function FV(we,Ke){for(const ot of we)if(Ke===ot||ot==="*"||ot instanceof RegExp&&ot.test(Ke))return!0;return!1}function aR(we,Ke=globalThis,ot=["*"]){Ke.addEventListener("message",function lt(jt){if(!jt||!jt.data)return;if(!FV(ot,jt.origin)){console.warn(`Invalid origin '${jt.origin}' for comlink proxy`);return}const{id:Yt,type:hr,path:Mr}=Object.assign({path:[]},jt.data),en=(jt.data.argumentList||[]).map(tx);let Br;try{const on=Mr.slice(0,-1).reduce((Wn,Bn)=>Wn[Bn],we),wn=Mr.reduce((Wn,Bn)=>Wn[Bn],we);switch(hr){case"GET":Br=wn;break;case"SET":on[Mr.slice(-1)[0]]=tx(jt.data.value),Br=!0;break;case"APPLY":Br=wn.apply(on,en);break;case"CONSTRUCT":{const Wn=new wn(...en);Br=VV(Wn)}break;case"ENDPOINT":{const{port1:Wn,port2:Bn}=new MessageChannel;aR(we,Bn),Br=qV(Wn,[Wn])}break;case"RELEASE":Br=void 0;break;default:return}}catch(on){Br={value:on,[hM]:0}}Promise.resolve(Br).catch(on=>({value:on,[hM]:0})).then(on=>{const[wn,Wn]=xM(on);Ke.postMessage(Object.assign(Object.assign({},wn),{id:Yt}),Wn),hr==="RELEASE"&&(Ke.removeEventListener("message",lt),iR(Ke),xk in we&&typeof we[xk]=="function"&&we[xk]())}).catch(on=>{const[wn,Wn]=xM({value:new TypeError("Unserializable return value"),[hM]:0});Ke.postMessage(Object.assign(Object.assign({},wn),{id:Yt}),Wn)})}),Ke.start&&Ke.start()}function BV(we){return we.constructor.name==="MessagePort"}function iR(we){BV(we)&&we.close()}function oR(we,Ke){const ot=new Map;return we.addEventListener("message",function(jt){const{data:Yt}=jt;if(!Yt||!Yt.id)return;const hr=ot.get(Yt.id);if(hr)try{hr(Yt)}finally{ot.delete(Yt.id)}}),jk(we,ot,[],Ke)}function uM(we){if(we)throw new Error("Proxy has been released and is not useable")}function sR(we){return Dw(we,new Map,{type:"RELEASE"}).then(()=>{iR(we)})}const yM=new WeakMap,_M="FinalizationRegistry"in globalThis&&new FinalizationRegistry(we=>{const Ke=(yM.get(we)||0)-1;yM.set(we,Ke),Ke===0&&sR(we)});function NV(we,Ke){const ot=(yM.get(Ke)||0)+1;yM.set(Ke,ot),_M&&_M.register(we,Ke,we)}function UV(we){_M&&_M.unregister(we)}function jk(we,Ke,ot=[],lt=function(){}){let jt=!1;const Yt=new Proxy(lt,{get(hr,Mr){if(uM(jt),Mr===DV)return()=>{UV(Yt),sR(we),Ke.clear(),jt=!0};if(Mr==="then"){if(ot.length===0)return{then:()=>Yt};const en=Dw(we,Ke,{type:"GET",path:ot.map(Br=>Br.toString())}).then(tx);return en.then.bind(en)}return jk(we,Ke,[...ot,Mr])},set(hr,Mr,en){uM(jt);const[Br,on]=xM(en);return Dw(we,Ke,{type:"SET",path:[...ot,Mr].map(wn=>wn.toString()),value:Br},on).then(tx)},apply(hr,Mr,en){uM(jt);const Br=ot[ot.length-1];if(Br===IV)return Dw(we,Ke,{type:"ENDPOINT"}).then(tx);if(Br==="bind")return jk(we,Ke,ot.slice(0,-1));const[on,wn]=X4(en);return Dw(we,Ke,{type:"APPLY",path:ot.map(Wn=>Wn.toString()),argumentList:on},wn).then(tx)},construct(hr,Mr){uM(jt);const[en,Br]=X4(Mr);return Dw(we,Ke,{type:"CONSTRUCT",path:ot.map(on=>on.toString()),argumentList:en},Br).then(tx)}});return NV(Yt,we),Yt}function jV(we){return Array.prototype.concat.apply([],we)}function X4(we){const Ke=we.map(xM);return[Ke.map(ot=>ot[0]),jV(Ke.map(ot=>ot[1]))]}const lR=new WeakMap;function qV(we,Ke){return lR.set(we,Ke),we}function VV(we){return Object.assign(we,{[tR]:!0})}function xM(we){for(const[Ke,ot]of nR)if(ot.canHandle(we)){const[lt,jt]=ot.serialize(we);return[{type:"HANDLER",name:Ke,value:lt},jt]}return[{type:"RAW",value:we},lR.get(we)||[]]}function tx(we){switch(we.type){case"HANDLER":return nR.get(we.name).deserialize(we.value);case"RAW":return we.value}}function Dw(we,Ke,ot,lt){return new Promise(jt=>{const Yt=HV();Ke.set(Yt,jt),we.start&&we.start(),we.postMessage(Object.assign({id:Yt},ot),lt)})}function HV(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function GV(we){const Ke=oR(we),ot=new Set;let lt="loading";Ke.init().then(()=>jt("ready"),Yt=>{console.error("Python failed to load:",Yt),jt("failed")});function jt(Yt){lt=Yt,ot.forEach(hr=>hr())}return{call:(Yt,...hr)=>Ke.call(Yt,hr[0]),getStatus:()=>lt,subscribe(Yt){return ot.add(Yt),()=>ot.delete(Yt)}}}function XV(we){return Bl.useSyncExternalStore(we.subscribe,we.getStatus)}const LT=GV(new Worker(new URL("/assets/pyodide.worker-B-lwJug5.js",import.meta.url),{type:"module"})),Y4=500,YV=200,ZV=150,WV=RT.length,$V=we=>Math.hypot(...we.gradient);function KV(we){const Ke=we.filter(Yt=>Yt!==null&&Number.isFinite(Yt));if(Ke.length===0)return null;const ot=Math.min(...Ke),lt=Math.max(...Ke),jt=lt>ot?.1*(lt-ot):1;return[ot-jt,lt+jt]}function OT([we,Ke],ot){const lt=Math.max(0,2-Math.floor(Math.log10(Math.abs(Ke-we))));return String(Number(ot.toFixed(lt)))}function bk(we,Ke,ot){const lt=([Yt,hr])=>Yt+(.05+.9*Math.random())*(hr-Yt),jt=OT(Ke,lt(Ke));return we===1?[jt]:[jt,OT(ot,lt(ot))]}function JV(we){const Ke=new Map;return we.map(ot=>{const lt=ot.name.trim();if(lt)return lt;const jt=FT.find(hr=>hr.id===ot.algorithm)?.label??ot.algorithm,Yt=(Ke.get(jt)??0)+1;return Ke.set(jt,Yt),Yt===1?jt:`${jt} ${Yt}`})}function Z4(we){return{algorithm:"gradient_descent",params:{},startText:we}}function QV(we,Ke,ot){const lt=we.startText.map(Yt=>Yt.trim()===""?NaN:Number(Yt)),jt={algorithm:we.algorithm,start:lt,params:we.params};return{algorithm:we.algorithm,params:we.params,startText:we.startText,startValid:lt.every(Number.isFinite),settings:jt,setStartText(Yt){Ke(hr=>({...hr,startText:Yt}))},changeAlgorithm(Yt){Ke(hr=>({...hr,algorithm:Yt,params:{}}))},changeParams(Yt){ot(),Ke(hr=>({...hr,params:Yt}))},changeStart(Yt,hr){ot(),Ke(Mr=>({...Mr,startText:Mr.startText.map((en,Br)=>Br===Yt?hr:en)}))}}}function eH(){const we=XV(LT),Ke=Fw[1][0],[ot,lt]=Bl.useState(Ke.expression),jt=$8(ot),[Yt,hr]=Bl.useState(()=>[{id:1,color:RT[0].value,name:"",...Z4(Ke.start.map(String))}]),Mr=Bl.useRef(2),[en,Br]=Bl.useState(!1),[on,wn]=Bl.useState(!1),[Wn,Bn]=Bl.useState(null),[Hi,wo]=Bl.useState(null),[Gi,hi]=Bl.useState(null),[Ge,Ao]=Bl.useState([]),Ns=Bl.useRef(Ke.x),uo=Bl.useRef([-1,1]),di=Bl.useRef(!0),Eo=Bl.useRef(0),zs=Bl.useRef(void 0),ki=Bl.useRef(0),tl=()=>{ki.current=Y4},Bi=Yt.map(al=>QV(al,jl=>hr(Ql=>Ql.map(Vu=>Vu.id===al.id?{...Vu,...jl(Vu)}:Vu)),tl)),zo=Bl.useRef(null),Ll=Bl.useRef(0),Ei=Bl.useRef([]),Ii=JV(Yt),Ti=Yt.map((al,jl)=>({id:al.id,settings:Bi[jl].settings,color:al.color,label:Ii[jl]})),So=Ti.map(al=>al.settings),ws=Bi.every(al=>al.startValid),bu=Bl.useCallback(async al=>{const jl=Ll.current,Ql=await LT.call("handle_state",{iteration:al});if(!Ql.ok)throw new Error(Ql.error.message);return Ql.data&&jl===Ll.current&&(Ei.current[al]=Ql.data),Ql.data},[]),ba=OB(bu,{intervalMs:YV}),{stepper:qa}=ba;async function ro(){const al=++Eo.current,jl=await LT.call("handle_function_values",{x_range:Ns.current,y_range:uo.current});if(al!==Eo.current)return;if(!jl.ok){console.error(`Python ${jl.error.kind} error: ${jl.error.message}`);return}const Ql=jl.data;Ql&&!("y"in Ql)&&di.current&&(uo.current=KV(Ql.f)??uo.current),di.current=!1,hi(Ql)}async function Jn(al,jl){const Ql=++Ll.current;if(qa.pause(),al!==zo.current){zo.current=null;const Wd=await LT.call("handle_set_function",{variables:jt,expression:ot});if(Ql!==Ll.current)return;if(Bn(Wd.ok?null:Wd.error.message),!Wd.ok){hi(null),Ao([]),Ei.current=[],await qa.restart();return}if(zo.current=al,di.current=!0,await ro(),Ql!==Ll.current)return}const Vu=await LT.call("handle_set_runs",{runs:jl.map(Wd=>Wd.settings)});Ql===Ll.current&&(wo(Vu.ok?null:Vu.error.message),Ei.current=[],Ao(Vu.ok?jl:[]),await qa.restart())}const vs=`${jt} +${ot}`,Rs=JSON.stringify(So);Bl.useEffect(()=>{if(!ws)return;const al=setTimeout(()=>Jn(vs,Ti),ki.current);return()=>clearTimeout(al)},[vs,Rs]),Bl.useEffect(()=>{ki.current=0});function Ji(al,jl){const Ql=$8(al);if(lt(al),Ql!==jt&&(Ao([]),hi(null),!jl)){const Vu=Wd=>Ql===2?[Wd[0],"0"]:[Wd[0]];hr(Wd=>Wd.map(nm=>({...nm,startText:Vu(nm.startText)}))),Ql===2&&(uo.current=Ns.current)}if(jl){const Vu=jl.y??uo.current;hr(Wd=>Wd.map((nm,$d)=>({...nm,startText:$d===0?jl.start.map(String):bk(Ql,jl.x,Vu)}))),Ns.current=jl.x,jl.y&&(uo.current=jl.y)}}function Us(al){Ji(al.expression,al)}function ff(al){ki.current=Y4,Ji(al)}function cc(al,jl,Ql){al.setStartText(jt===1?[OT(Ns.current,jl)]:[OT(Ns.current,jl),OT(uo.current,Ql)])}function Od(al){al.setStartText(bk(jt,Ns.current,uo.current))}function Jl(){return(Ck.find(al=>al.expression===ot)??Fw[jt][0]).start}function pp(al){al.setStartText(Jl().map(String))}function Xf(){const al=new Set(Yt.map(Vu=>Vu.color)),jl=RT.find(Vu=>!al.has(Vu.value))?.value??RT[0].value,Ql=Mr.current++;return hr([...Yt,{id:Ql,color:jl,name:"",...Z4(bk(jt,Ns.current,uo.current))}]),Ql}function go(al){const jl=Yt.filter(Ql=>Ql.id!==al);jl.length===0&&(Mr.current=1),hr(jl)}function kv(al,jl){Ns.current=al,uo.current=jl,clearTimeout(zs.current),zs.current=setTimeout(ro,ZV)}const mp=Ei.current.slice(0,ba.iteration+1),$g=Ge.map((al,jl)=>{const Ql=Yt.findIndex(Vu=>Vu.id===al.id);return{...al,...Ql>=0&&{color:Yt[Ql].color,label:Ii[Ql]},path:mp.map(Vu=>Vu?.runs[jl]?.point).filter(Vu=>!!Vu),stopped:ba.state?.runs[jl]?.stopped??null}});return{pythonStatus:we,variables:jt,expression:ot,changeExpression:ff,choosePreset:Us,functionError:Wn,surface:en,setSurface:Br,showArrows:on,setShowArrows:wn,startAt:cc,randomStart:Od,resetStart:pp,runError:Hi,optimisers:Yt.map((al,jl)=>({id:al.id,color:al.color,name:al.name,shownName:Ii[jl],editor:Bi[jl]})),canAddOptimiser:Yt.lengthhr(Ql=>Ql.map(Vu=>Vu.id===al?{...Vu,color:jl}:Vu)),setOptimiserName:(al,jl)=>hr(Ql=>Ql.map(Vu=>Vu.id===al?{...Vu,name:jl}:Vu)),values:Gi,xRange:Ns,yRange:uo,handleViewChange:kv,trajectories:$g,step:ba}}const tH=[{label:"Univariate: f(x)",options:Fw[1].map(we=>we.name)},{label:"Bivariate: f(x, y)",options:Fw[2].map(we=>we.name)}],rH=[{value:"contour",label:"Contour"},{value:"surface",label:"Surface"}],wk="text-sm text-ink-muted";function nH(){const we=eH(),Ke=Ck.find(Mr=>Mr.expression===we.expression),ot=we.variables===2,[lt,jt]=Bl.useState(1),Yt=we.optimisers.find(Mr=>Mr.id===lt),hr=!(ot&&we.surface);return Bl.useEffect(()=>{window.dispatchEvent(new Event("resize"))},[ot]),ga.jsxs(AB,{title:"Optimisation",usage:ga.jsx(RV,{}),examples:ga.jsx("p",{children:"Examples are coming soon."}),tabs:[{label:"Configure",content:ga.jsxs(ga.Fragment,{children:[ga.jsxs(iM,{label:"Function",children:[ga.jsx(hP,{label:"Function",hideLabel:!0,options:Ke?[]:[W8],groupedOptions:tH,activeOption:Ke?.name??W8,onChange:Mr=>{const en=Ck.find(Br=>Br.name===Mr);en&&we.choosePreset(en)}}),ga.jsx(Mk,{label:ot?"f(x, y) =":"f(x) =",hideLabel:!0,prefix:ot?"f(x, y) =":"f(x) =",value:we.expression,onChange:we.changeExpression,error:we.functionError,mono:!0,rows:2})]}),ga.jsxs(iM,{label:"Optimisers",children:[we.optimisers.length>0&&ga.jsx("ul",{className:"flex flex-col gap-2",children:we.optimisers.map(Mr=>ga.jsx(iH,{id:Mr.id,color:Mr.color,name:Mr.name,shownName:Mr.shownName,onNameChange:en=>we.setOptimiserName(Mr.id,en),editor:Mr.editor,trajectory:we.trajectories.find(en=>en.id===Mr.id),taken:we.optimisers.map(en=>en.color),open:lt===Mr.id,onToggle:()=>jt(lt===Mr.id?null:Mr.id),onColorChange:en=>we.setOptimiserColor(Mr.id,en),onRemove:()=>we.removeOptimiser(Mr.id),twoVariables:ot,onResetStart:()=>we.resetStart(Mr.editor),onRandomStart:()=>we.randomStart(Mr.editor),hint:hr?"Or click the plot to move this initial point.":void 0},Mr.id))}),ga.jsx(pM,{label:"+ Add optimiser",onClick:()=>jt(we.addOptimiser()),disabled:!we.canAddOptimiser})]})]})},{label:"Metrics",content:we.trajectories.some(Mr=>Mr.path.length>0)?ga.jsxs(ga.Fragment,{children:[ga.jsx(iM,{label:"Summary",children:ga.jsx(cN,{trajectories:we.trajectories})}),ga.jsxs(iM,{label:"History",children:[ga.jsx(n4,{trajectories:we.trajectories,name:"f",value:Mr=>Mr.value}),ga.jsx(n4,{trajectories:we.trajectories,name:"‖∇f‖",value:$V,log:!0})]})]}):ga.jsx("p",{className:wk,children:"Add an optimiser to see how each one is doing."})}],footer:ga.jsxs(ga.Fragment,{children:[we.pythonStatus==="loading"&&ga.jsx("p",{className:wk,children:"Loading Python… actions will run once it is ready."}),we.pythonStatus==="failed"&&ga.jsx("p",{className:"text-danger font-semibold",children:"Python failed to load. Try reloading the page."}),we.runError&&ga.jsx("p",{className:"text-danger font-semibold",children:we.runError}),ga.jsx(BB,{stepper:we.step}),we.trajectories.filter(Mr=>Mr.stopped).map(Mr=>ga.jsxs("p",{className:wk,children:[Mr.label," stopped at iteration ",Mr.path.length-1,". ",Mr.stopped]},Mr.label))]}),children:[ot&&ga.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-x-4 gap-y-2 pb-2",children:[ga.jsx("div",{className:"w-48",children:ga.jsx(PB,{label:"Plot",options:rH,value:we.surface?"surface":"contour",onChange:Mr=>we.setSurface(Mr==="surface")})}),ga.jsx(kB,{label:"Gradient field",checked:we.showArrows,disabled:we.surface,title:we.surface?"Only on the contour plot":void 0,onChange:we.setShowArrows})]}),ga.jsx(eN,{values:we.values,trajectories:we.trajectories,xRange:we.xRange,yRange:we.yRange,onViewChange:we.handleViewChange,onClick:Yt?(Mr,en)=>we.startAt(Yt.editor,Mr,en):null,surface:we.surface,arrows:we.showArrows})]})}function aH({trajectory:we}){const Ke=we?.path[we.path.length-1];return Ke?ga.jsxs("span",{className:"shrink-0 font-mono text-ink",children:["f = ",Number(Ke.value.toPrecision(3))]}):null}function iH({id:we,color:Ke,name:ot,shownName:lt,onNameChange:jt,editor:Yt,trajectory:hr,open:Mr,onToggle:en,onColorChange:Br,onRemove:on,taken:wn,twoVariables:Wn,onResetStart:Bn,onRandomStart:Hi,hint:wo}){return ga.jsxs("li",{className:"rounded-md border-[1.5px] border-grid",children:[ga.jsxs("div",{className:"flex items-center gap-2 py-1 pl-1 pr-1",children:[ga.jsx(CB,{label:`Colour of optimiser ${we}`,colors:RT,value:Ke,onChange:Br,taken:wn}),ga.jsx("input",{value:ot,onChange:Gi=>jt(Gi.target.value),placeholder:lt,"aria-label":`Name of optimiser ${we}`,title:"Rename",className:"h-8 w-40 min-w-0 rounded border border-transparent bg-transparent px-1.5 text-sm text-ink placeholder:text-ink hover:border-line focus:border-ink focus:outline-none focus:placeholder:text-ink-muted"}),ga.jsxs("button",{type:"button",onClick:en,"aria-expanded":Mr,"aria-label":`Settings of optimiser ${we}`,className:"flex min-w-fit flex-1 cursor-pointer items-center gap-2 self-stretch rounded px-1 text-left text-sm text-label hover:bg-paper",children:[ga.jsx("span",{className:"min-w-0 flex-1",children:!Yt.startValid&&ga.jsx("span",{className:"block text-xs font-semibold text-danger",children:"Check the initial point"})}),ga.jsx(aH,{trajectory:hr}),ga.jsx(lB,{size:16,"aria-hidden":!0,className:`shrink-0 text-ink-muted transition-transform ${Mr?"rotate-180":""}`})]}),ga.jsx(PT,{label:`Remove optimiser ${we}`,onClick:on,children:ga.jsx(uP,{size:16})})]}),Mr&&ga.jsx("div",{className:"flex flex-col gap-4 border-t border-grid p-3",children:ga.jsx(lN,{editor:Yt,twoVariables:Wn,onResetStart:Bn,onRandomStart:Hi,hint:wo})})]})}$F.createRoot(document.getElementById("root")).render(ga.jsx(Bl.StrictMode,{children:ga.jsx(nH,{})})); diff --git a/dist/assets/index-BO7EriOM.css b/dist/assets/index-BO7EriOM.css new file mode 100644 index 0000000000000000000000000000000000000000..395aab3cbf92029396a4137436e6f6f2fdb604b3 --- /dev/null +++ b/dist/assets/index-BO7EriOM.css @@ -0,0 +1 @@ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--font-sans:"Instrument Sans Variable",ui-sans-serif,system-ui,sans-serif;--font-mono:"IBM Plex Mono",ui-monospace,monospace;--color-red-600:oklch(57.7% .245 27.325);--color-orange-400:oklch(75% .183 55.934);--color-blue-600:oklch(54.6% .245 262.881);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-950:oklch(13% .028 261.692);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-widest:.1em;--leading-loose:2;--radius-md:.375rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-ink:#1b2a4a;--color-ink-muted:#4a5878;--color-marker:#ffe14d;--color-marker-soft:#fff3b0;--color-marker-band:var(--color-marker);--color-paper:#f6f7f3;--color-grid:#e3e7ee;--color-surface:#fff;--color-label:var(--color-gray-700);--color-line:var(--color-gray-300);--color-danger:var(--color-red-600)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}body{background-color:var(--color-paper);color:var(--color-ink)}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-full{top:100%}.left-0{left:calc(var(--spacing)*0)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.m-0{margin:calc(var(--spacing)*0)}.m-auto{margin:auto}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-12{margin-top:calc(var(--spacing)*12)}.mr-auto{margin-right:auto}.-mb-\[1\.5px\]{margin-bottom:-1.5px}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.size-3{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-6{width:calc(var(--spacing)*6);height:calc(var(--spacing)*6)}.size-7{width:calc(var(--spacing)*7);height:calc(var(--spacing)*7)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-11{width:calc(var(--spacing)*11);height:calc(var(--spacing)*11)}.size-16{width:calc(var(--spacing)*16);height:calc(var(--spacing)*16)}.h-1{height:calc(var(--spacing)*1)}.h-5{height:calc(var(--spacing)*5)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-11{height:calc(var(--spacing)*11)}.h-16{height:calc(var(--spacing)*16)}.h-40{height:calc(var(--spacing)*40)}.h-px{height:1px}.max-h-60{max-height:calc(var(--spacing)*60)}.max-h-\[65dvh\]{max-height:65dvh}.max-h-\[85dvh\]{max-height:85dvh}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-9{min-height:calc(var(--spacing)*9)}.min-h-15{min-height:calc(var(--spacing)*15)}.min-h-\[320px\]{min-height:320px}.w-11{width:calc(var(--spacing)*11)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-28{width:calc(var(--spacing)*28)}.w-40{width:calc(var(--spacing)*40)}.w-48{width:calc(var(--spacing)*48)}.w-\[min\(48rem\,calc\(100vw-2rem\)\)\]{width:min(48rem,100vw - 2rem)}.w-\[min\(72rem\,calc\(100vw-2rem\)\)\]{width:min(72rem,100vw - 2rem)}.w-full{width:100%}.w-max{width:max-content}.max-w-prose{max-width:65ch}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-fit{min-width:fit-content}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-decimal{list-style-type:decimal}.appearance-none{appearance:none}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.grid-flow-col{grid-auto-flow:column}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-2{column-gap:calc(var(--spacing)*2)}.gap-x-4{column-gap:calc(var(--spacing)*4)}.gap-y-1{row-gap:calc(var(--spacing)*1)}.gap-y-2{row-gap:calc(var(--spacing)*2)}.self-center{align-self:center}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-\[6px\]{border-style:var(--tw-border-style);border-width:6px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-\[1\.5px\]{border-top-style:var(--tw-border-style);border-top-width:1.5px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-b-\[1\.5px\]{border-bottom-style:var(--tw-border-style);border-bottom-width:1.5px}.border-danger{border-color:var(--color-danger)}.border-gray-200{border-color:var(--color-gray-200)}.border-grid{border-color:var(--color-grid)}.border-ink{border-color:var(--color-ink)}.border-ink\/15{border-color:#1b2a4a26}@supports (color:color-mix(in lab,red,red)){.border-ink\/15{border-color:color-mix(in oklab,var(--color-ink)15%,transparent)}}.border-line{border-color:var(--color-line)}.border-orange-400{border-color:var(--color-orange-400)}.border-slate-200{border-color:var(--color-slate-200)}.border-surface{border-color:var(--color-surface)}.border-transparent{border-color:#0000}.border-t-blue-600{border-top-color:var(--color-blue-600)}.border-t-ink\/80{border-top-color:#1b2a4acc}@supports (color:color-mix(in lab,red,red)){.border-t-ink\/80{border-top-color:color-mix(in oklab,var(--color-ink)80%,transparent)}}.border-b-surface{border-bottom-color:var(--color-surface)}.border-b-transparent{border-bottom-color:#0000}.bg-grid{background-color:var(--color-grid)}.bg-ink{background-color:var(--color-ink)}.bg-marker-soft{background-color:var(--color-marker-soft)}.bg-paper{background-color:var(--color-paper)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-surface{background-color:var(--color-surface)}.bg-surface\/40{background-color:#fff6}@supports (color:color-mix(in lab,red,red)){.bg-surface\/40{background-color:color-mix(in oklab,var(--color-surface)40%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-\[linear-gradient\(transparent_58\%\,var\(--color-marker-band\)_58\%\,var\(--color-marker-band\)_92\%\,transparent_92\%\)\]{background-image:linear-gradient(transparent 58%,var(--color-marker-band)58%,var(--color-marker-band)92%,transparent 92%)}.p-0{padding:calc(var(--spacing)*0)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.px-0{padding-inline:calc(var(--spacing)*0)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3\.5{padding-top:calc(var(--spacing)*3.5)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-1\.5{padding-right:calc(var(--spacing)*1.5)}.pr-2{padding-right:calc(var(--spacing)*2)}.pb-0\.5{padding-bottom:calc(var(--spacing)*.5)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-5{padding-left:calc(var(--spacing)*5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-bottom{vertical-align:bottom}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.leading-loose{--tw-leading:var(--leading-loose);line-height:var(--leading-loose)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-danger{color:var(--color-danger)}.text-gray-700{color:var(--color-gray-700)}.text-gray-950{color:var(--color-gray-950)}.text-ink{color:var(--color-ink)}.text-ink-muted{color:var(--color-ink-muted)}.text-ink-muted\/60{color:#4a587899}@supports (color:color-mix(in lab,red,red)){.text-ink-muted\/60{color:color-mix(in oklab,var(--color-ink-muted)60%,transparent)}}.text-label{color:var(--color-label)}.text-orange-400{color:var(--color-orange-400)}.text-slate-800{color:var(--color-slate-800)}.text-surface{color:var(--color-surface)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.accent-ink{accent-color:var(--color-ink)}.opacity-50{opacity:.5}.shadow-\[3px_3px_0_var\(--color-marker\)\]{--tw-shadow:3px 3px 0 var(--tw-shadow-color,var(--color-marker));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-\[1\.5px\]{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1.5px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-\[3px\]{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-grid{--tw-ring-color:var(--color-grid)}.ring-ink{--tw-ring-color:var(--color-ink)}.outline-danger{outline-color:var(--color-danger)}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.peer-checked\:ring-\[3px\]:is(:where(.peer):checked~*){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-checked\:ring-ink:is(:where(.peer):checked~*){--tw-ring-color:var(--color-ink)}.peer-focus-visible\:outline-2:is(:where(.peer):focus-visible~*){outline-style:var(--tw-outline-style);outline-width:2px}.peer-focus-visible\:outline-offset-4:is(:where(.peer):focus-visible~*){outline-offset:4px}.peer-focus-visible\:outline-ink:is(:where(.peer):focus-visible~*){outline-color:var(--color-ink)}.placeholder\:text-ink::placeholder{color:var(--color-ink)}.backdrop\:bg-ink\/40::backdrop{background-color:#1b2a4a66}@supports (color:color-mix(in lab,red,red)){.backdrop\:bg-ink\/40::backdrop{background-color:color-mix(in oklab,var(--color-ink)40%,transparent)}}.first\:mt-4:first-child{margin-top:calc(var(--spacing)*4)}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}.focus-within\:outline-2:focus-within{outline-style:var(--tw-outline-style);outline-width:2px}.focus-within\:outline-danger:focus-within{outline-color:var(--color-danger)}.focus-within\:outline-ink:focus-within{outline-color:var(--color-ink)}@media(hover:hover){.hover\:border-line:hover{border-color:var(--color-line)}.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-paper:hover{background-color:var(--color-paper)}}.focus\:border-ink:focus{border-color:var(--color-ink)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus\:placeholder\:text-ink-muted:focus::placeholder{color:var(--color-ink-muted)}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\:outline-ink:focus-visible{outline-color:var(--color-ink)}.enabled\:cursor-pointer:enabled{cursor:pointer}@media(hover:hover){.enabled\:hover\:bg-marker-soft:enabled:hover{background-color:var(--color-marker-soft)}.enabled\:hover\:bg-paper:enabled:hover{background-color:var(--color-paper)}}.enabled\:active\:translate-x-px:enabled:active{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.enabled\:active\:translate-y-px:enabled:active{--tw-translate-y:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.enabled\:active\:shadow-\[2px_2px_0_var\(--color-marker\)\]:enabled:active{--tw-shadow:2px 2px 0 var(--tw-shadow-color,var(--color-marker));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-25:disabled{opacity:.25}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:64rem){.lg\:h-dvh{height:100dvh}.lg\:min-h-0{min-height:calc(var(--spacing)*0)}.lg\:max-w-\[calc\(100dvh-44px\+24rem\)\]{max-width:calc(100dvh - 44px + 24rem)}.lg\:grid-cols-\[16rem_minmax\(0\,1fr\)\]{grid-template-columns:16rem minmax(0,1fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_24rem\]{grid-template-columns:minmax(0,1fr) 24rem}.lg\:p-7{padding:calc(var(--spacing)*7)}.lg\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}}.dark\:bg-surface:where([data-theme=dark],[data-theme=dark] *){background-color:var(--color-surface)}.dark\:text-ink:where([data-theme=dark],[data-theme=dark] *){color:var(--color-ink)}.dark\:backdrop\:bg-black\/60:where([data-theme=dark],[data-theme=dark] *)::backdrop{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.dark\:backdrop\:bg-black\/60:where([data-theme=dark],[data-theme=dark] *)::backdrop{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.\[\&\:\:-moz-range-thumb\]\:size-4::-moz-range-thumb{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\:\:-moz-range-thumb\]\:cursor-grab::-moz-range-thumb{cursor:grab}.\[\&\:\:-moz-range-thumb\]\:rounded-full::-moz-range-thumb{border-radius:3.40282e38px}.\[\&\:\:-moz-range-thumb\]\:border-2::-moz-range-thumb{border-style:var(--tw-border-style);border-width:2px}.\[\&\:\:-moz-range-thumb\]\:border-surface::-moz-range-thumb{border-color:var(--color-surface)}.\[\&\:\:-moz-range-thumb\]\:bg-ink::-moz-range-thumb{background-color:var(--color-ink)}.\[\&\:\:-webkit-slider-thumb\]\:size-4::-webkit-slider-thumb{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&\:\:-webkit-slider-thumb\]\:cursor-grab::-webkit-slider-thumb{cursor:grab}.\[\&\:\:-webkit-slider-thumb\]\:appearance-none::-webkit-slider-thumb{appearance:none}.\[\&\:\:-webkit-slider-thumb\]\:rounded-full::-webkit-slider-thumb{border-radius:3.40282e38px}.\[\&\:\:-webkit-slider-thumb\]\:border-2::-webkit-slider-thumb{border-style:var(--tw-border-style);border-width:2px}.\[\&\:\:-webkit-slider-thumb\]\:border-surface::-webkit-slider-thumb{border-color:var(--color-surface)}.\[\&\:\:-webkit-slider-thumb\]\:bg-ink::-webkit-slider-thumb{background-color:var(--color-ink)}}@font-face{font-family:Instrument Sans Variable;font-style:normal;font-display:swap;font-weight:400 700;src:url(/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Instrument Sans Variable;font-style:normal;font-display:swap;font-weight:400 700;src:url(/assets/instrument-sans-latin-wght-normal-BbzFLZTg.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2)format("woff2"),url(/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2)format("woff2"),url(/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2)format("woff2"),url(/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2)format("woff2"),url(/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2)format("woff2"),url(/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff)format("woff");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2)format("woff2"),url(/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root[data-theme=dark]{color-scheme:dark;--color-ink:#e4e9f2;--color-ink-muted:#a3aec4;--color-marker-soft:#3d3a22;--color-marker-band:#8f7600;--color-paper:#0f1626;--color-grid:#2c3852;--color-surface:#172036;--color-label:#c4ccda;--color-line:#3a4766;--color-danger:#f87171}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/dist/assets/index-DSUxBIVD.css b/dist/assets/index-DSUxBIVD.css deleted file mode 100644 index 71e70f3db575dd47c7174b83e7f62bc728c0ad0d..0000000000000000000000000000000000000000 --- a/dist/assets/index-DSUxBIVD.css +++ /dev/null @@ -1 +0,0 @@ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-700:oklch(50.5% .213 27.518);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-blue-600:oklch(54.6% .245 262.881);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-950:oklch(13% .028 261.692);--color-stone-50:oklch(98.5% .001 106.423);--color-stone-100:oklch(97% .001 106.424);--color-stone-200:oklch(92.3% .003 48.717);--color-stone-300:oklch(86.9% .005 56.366);--color-stone-400:oklch(70.9% .01 56.259);--color-stone-500:oklch(55.3% .013 58.071);--color-stone-600:oklch(44.4% .011 73.639);--color-stone-700:oklch(37.4% .01 67.558);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--animate-spin:spin 1s linear infinite;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.z-50{z-index:50}.m-4{margin:calc(var(--spacing)*4)}.-mt-2{margin-top:calc(var(--spacing)*-2)}.-mt-5{margin-top:calc(var(--spacing)*-5)}.-mt-6{margin-top:calc(var(--spacing)*-6)}.mt-0{margin-top:calc(var(--spacing)*0)}.-mb-2{margin-bottom:calc(var(--spacing)*-2)}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-3{height:calc(var(--spacing)*3)}.h-8{height:calc(var(--spacing)*8)}.h-10{height:calc(var(--spacing)*10)}.h-16{height:calc(var(--spacing)*16)}.h-64{height:calc(var(--spacing)*64)}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-64{min-height:calc(var(--spacing)*64)}.min-h-\[320px\]{min-height:320px}.min-h-\[420px\]{min-height:420px}.w-1\/2{width:50%}.w-3{width:calc(var(--spacing)*3)}.w-16{width:calc(var(--spacing)*16)}.w-fit{width:fit-content}.w-full{width:100%}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.flex-none{flex:none}.shrink-0{flex-shrink:0}.translate-y-4{--tw-translate-y:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[1fr_12fr_1fr\]{grid-template-columns:1fr 12fr 1fr}.grid-cols-\[6rem_minmax\(0\,1fr\)\]{grid-template-columns:6rem minmax(0,1fr)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-12{gap:calc(var(--spacing)*12)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.justify-self-end{justify-self:flex-end}.overflow-auto{overflow:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-orange-400{border-color:var(--color-orange-400)}.border-slate-200{border-color:var(--color-slate-200)}.border-stone-200{border-color:var(--color-stone-200)}.border-stone-300{border-color:var(--color-stone-300)}.border-t-blue-600{border-top-color:var(--color-blue-600)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-orange-200{background-color:var(--color-orange-200)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-300{background-color:var(--color-slate-300)}.bg-stone-50{background-color:var(--color-stone-50)}.bg-stone-100{background-color:var(--color-stone-100)}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.pr-0\.25{padding-right:calc(var(--spacing)*.25)}.pl-4{padding-left:calc(var(--spacing)*4)}.text-center{text-align:center}.text-right{text-align:right}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.whitespace-nowrap{white-space:nowrap}.text-gray-700{color:var(--color-gray-700)}.text-gray-950{color:var(--color-gray-950)}.text-orange-400{color:var(--color-orange-400)}.text-red-700{color:var(--color-red-700)}.text-slate-600{color:var(--color-slate-600)}.text-slate-800{color:var(--color-slate-800)}.text-stone-500{color:var(--color-stone-500)}.text-stone-600{color:var(--color-stone-600)}.text-stone-700{color:var(--color-stone-700)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.last\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}@media(hover:hover){.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-orange-300:hover{background-color:var(--color-orange-300)}.hover\:bg-stone-200:hover{background-color:var(--color-stone-200)}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-stone-400:focus{--tw-ring-color:var(--color-stone-400)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:64rem){.lg\:flex{display:flex}.lg\:h-dvh{height:100dvh}.lg\:grid-cols-\[2fr_1fr\]{grid-template-columns:2fr 1fr}.lg\:gap-12{gap:calc(var(--spacing)*12)}}.\[\&_p\]\:mb-0 p{margin-bottom:calc(var(--spacing)*0)}.\[\&\>div\]\:w-full>div{width:100%}.\[\&\>div\>button\]\:w-1\/4>div>button{width:25%}.\[\&\>div\>button\]\:px-1>div>button{padding-inline:calc(var(--spacing)*1)}}.title{font-size:32px;font-weight:700}.status{color:var(--ink-soft);border:1px solid var(--line);background:#ffffffbf;border-radius:999px;flex:none;align-items:center;gap:8px;padding:8px 12px;font-size:12px;display:flex}.status span{background:#d69b25;border-radius:50%;width:8px;height:8px;box-shadow:0 0 0 4px #f8ebca}.status.ready span{background:#2c9b68;box-shadow:0 0 0 4px #d9f0e5}.status.error span{background:#c74848;box-shadow:0 0 0 4px #f5dddd}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/dist/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g.woff2 b/dist/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..0ea0da04cb2bdacb918460c16ca2863138a19f4d Binary files /dev/null and b/dist/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g.woff2 differ diff --git a/dist/assets/instrument-sans-latin-wght-normal-BbzFLZTg.woff2 b/dist/assets/instrument-sans-latin-wght-normal-BbzFLZTg.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..8611e41b14c75cfc8360e50d0d22a22d20a1de50 Binary files /dev/null and b/dist/assets/instrument-sans-latin-wght-normal-BbzFLZTg.woff2 differ diff --git a/dist/assets/pyodide.worker-B-lwJug5.js b/dist/assets/pyodide.worker-B-lwJug5.js new file mode 100644 index 0000000000000000000000000000000000000000..23aca3b387fb23fefa9c9b6d91c69c0580ca87dd --- /dev/null +++ b/dist/assets/pyodide.worker-B-lwJug5.js @@ -0,0 +1,442 @@ +(function(){"use strict";const A=Symbol("Comlink.proxy"),M=Symbol("Comlink.endpoint"),D=Symbol("Comlink.releaseProxy"),x=Symbol("Comlink.finalizer"),v=Symbol("Comlink.thrown"),S=e=>typeof e=="object"&&e!==null||typeof e=="function",L={canHandle:e=>S(e)&&e[A],serialize(e){const{port1:n,port2:t}=new MessageChannel;return E(e,n),[t,[t]]},deserialize(e){return e.start(),U(e)}},C={canHandle:e=>S(e)&&v in e,serialize({value:e}){let n;return e instanceof Error?n={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:n={isError:!1,value:e},[n,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},R=new Map([["proxy",L],["throw",C]]);function V(e,n){for(const t of e)if(n===t||t==="*"||t instanceof RegExp&&t.test(n))return!0;return!1}function E(e,n=globalThis,t=["*"]){n.addEventListener("message",function u(i){if(!i||!i.data)return;if(!V(t,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:a,type:d,path:f}=Object.assign({path:[]},i.data),o=(i.data.argumentList||[]).map(c);let r;try{const s=f.slice(0,-1).reduce((p,g)=>p[g],e),l=f.reduce((p,g)=>p[g],e);switch(d){case"GET":r=l;break;case"SET":s[f.slice(-1)[0]]=c(i.data.value),r=!0;break;case"APPLY":r=l.apply(s,o);break;case"CONSTRUCT":{const p=new l(...o);r=W(p)}break;case"ENDPOINT":{const{port1:p,port2:g}=new MessageChannel;E(e,g),r=F(p,[p])}break;case"RELEASE":r=void 0;break;default:return}}catch(s){r={value:s,[v]:0}}Promise.resolve(r).catch(s=>({value:s,[v]:0})).then(s=>{const[l,p]=_(s);n.postMessage(Object.assign(Object.assign({},l),{id:a}),p),d==="RELEASE"&&(n.removeEventListener("message",u),j(n),x in e&&typeof e[x]=="function"&&e[x]())}).catch(s=>{const[l,p]=_({value:new TypeError("Unserializable return value"),[v]:0});n.postMessage(Object.assign(Object.assign({},l),{id:a}),p)})}),n.start&&n.start()}function H(e){return e.constructor.name==="MessagePort"}function j(e){H(e)&&e.close()}function U(e,n){const t=new Map;return e.addEventListener("message",function(i){const{data:a}=i;if(!a||!a.id)return;const d=t.get(a.id);if(d)try{d(a)}finally{t.delete(a.id)}}),w(e,t,[],n)}function b(e){if(e)throw new Error("Proxy has been released and is not useable")}function I(e){return m(e,new Map,{type:"RELEASE"}).then(()=>{j(e)})}const y=new WeakMap,h="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const n=(y.get(e)||0)-1;y.set(e,n),n===0&&I(e)});function q(e,n){const t=(y.get(n)||0)+1;y.set(n,t),h&&h.register(e,n,e)}function z(e){h&&h.unregister(e)}function w(e,n,t=[],u=function(){}){let i=!1;const a=new Proxy(u,{get(d,f){if(b(i),f===D)return()=>{z(a),I(e),n.clear(),i=!0};if(f==="then"){if(t.length===0)return{then:()=>a};const o=m(e,n,{type:"GET",path:t.map(r=>r.toString())}).then(c);return o.then.bind(o)}return w(e,n,[...t,f])},set(d,f,o){b(i);const[r,s]=_(o);return m(e,n,{type:"SET",path:[...t,f].map(l=>l.toString()),value:r},s).then(c)},apply(d,f,o){b(i);const r=t[t.length-1];if(r===M)return m(e,n,{type:"ENDPOINT"}).then(c);if(r==="bind")return w(e,n,t.slice(0,-1));const[s,l]=O(o);return m(e,n,{type:"APPLY",path:t.map(p=>p.toString()),argumentList:s},l).then(c)},construct(d,f){b(i);const[o,r]=O(f);return m(e,n,{type:"CONSTRUCT",path:t.map(s=>s.toString()),argumentList:o},r).then(c)}});return q(a,e),a}function G(e){return Array.prototype.concat.apply([],e)}function O(e){const n=e.map(_);return[n.map(t=>t[0]),G(n.map(t=>t[1]))]}const T=new WeakMap;function F(e,n){return T.set(e,n),e}function W(e){return Object.assign(e,{[A]:!0})}function _(e){for(const[n,t]of R)if(t.canHandle(e)){const[u,i]=t.serialize(e);return[{type:"HANDLER",name:n,value:u},i]}return[{type:"RAW",value:e},T.get(e)||[]]}function c(e){switch(e.type){case"HANDLER":return R.get(e.name).deserialize(e.value);case"RAW":return e.value}}function m(e,n,t,u){return new Promise(i=>{const a=B();n.set(a,i),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),u)})}function B(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const P="https://cdn.jsdelivr.net/pyodide/v0.26.1/full/";function $(e){let n,t=null;function u(){return t??(t=(async()=>{const{loadPyodide:a}=await import(`${P}pyodide.mjs`);n=await a({indexURL:P}),await n.loadPackage(e.packages);for(const[o,r]of Object.entries(e.files))n.FS.writeFile(o,r instanceof URL?await X(r):r);const{module:d,className:f}=e.manager??{module:"manager",className:"Manager"};return n.pyimport(d)[f]()})()),t}E({async init(){await u()},async call(a,d){let f;try{f=await u()}catch(l){return k(`Python failed to load: ${N(l)}`)}let o,r,s;try{return o=f[a],typeof o!="function"?k(`Manager has no method "${a}"`):(r=d===void 0?void 0:n.toPy(d),s=r===void 0?o():o(r),{ok:!0,data:(s?.toJs?s.toJs({dict_converter:Object.fromEntries}):s)??null})}catch(l){return l.type==="UserError"?{ok:!1,error:{kind:"user",message:J(N(l))}}:(console.error(l),k(N(l)))}finally{o?.destroy?.(),r?.destroy?.(),s?.destroy?.()}}})}async function X(e){const n=await fetch(e);if(!n.ok)throw new Error(`Could not fetch ${e}: ${n.status}`);return new Uint8Array(await n.arrayBuffer())}function k(e){return{ok:!1,error:{kind:"internal",message:e}}}function N(e){return e instanceof Error?e.message:String(e)}function J(e){const n="UserError: ",t=e.lastIndexOf(n);return t===-1?e:e.slice(t+n.length).trim()}var Y=`import json +from pathlib import Path + +import numpy as np + +from logic import OPTIMISERS, Objective, Run, parse_function + +ALGORITHMS = { + spec["id"]: spec + for spec in json.loads((Path(__file__).parent / "algorithms.json").read_text())["algorithms"] +} + +# Iterations a run can take before stepping stops +MAX_ITERATIONS = 1000 +LIMIT_REACHED = f"Reached the {MAX_ITERATIONS}-iteration limit." +# Sample points for the plotted curve (one variable) or surface (two, per side) +CURVE_POINTS = 401 +GRID_POINTS = 101 +# Gradient arrows per side +ARROW_POINTS = 15 + + +class UserError(Exception): + """A mistake the student can fix; its message is shown in the UI.""" + + +def _json_values(values: np.ndarray) -> list: + """Values as JSON numbers, with null where f has no finite value.""" + return [float(v) if np.isfinite(v) else None for v in values] + + +class Manager: + def __init__(self): + self._objective: Objective | None = None + self._runs: list[Run] = [] + + def handle_set_function(self, args: dict) -> None: + """{variables: 1 | 2, expression}; clears the runs.""" + self._objective = None + self._runs = [] + n = int(args["variables"]) + try: + expr = parse_function(str(args["expression"]), n) + except ValueError as e: + raise UserError(str(e)) + try: + objective = Objective(expr, n) + # Evaluate everything once, so a failure shows here rather than mid-run. + # Values may be inf or nan (outside the domain); only errors count. + p = np.full(n, 0.5) + with np.errstate(all="ignore"): + objective.value(p), objective.gradient(p), objective.hessian(p) + except Exception: + raise UserError("This function can't be evaluated or differentiated. Try writing it another way.") + self._objective = objective + + def handle_function_values(self, args: dict) -> dict | None: + """f sampled over the plot's {x_range, y_range}; None with no function.""" + f = self._objective + if f is None: + return None + with np.errstate(all="ignore"): + if f.n == 1: + x = np.linspace(*args["x_range"], CURVE_POINTS) + return {"x": x.tolist(), "f": _json_values(f.values_on(x))} + + x = np.linspace(*args["x_range"], GRID_POINTS) + y = np.linspace(*args["y_range"], GRID_POINTS) + z = f.values_on(*np.meshgrid(x, y)) + ax, ay = np.meshgrid(np.linspace(*args["x_range"], ARROW_POINTS), np.linspace(*args["y_range"], ARROW_POINTS)) + u, v = f.gradient_on(ax, ay) + return { + "x": x.tolist(), + "y": y.tolist(), + # Rows follow y, columns follow x + "f": [_json_values(row) for row in z], + "arrows": { + "x": ax.ravel().tolist(), + "y": ay.ravel().tolist(), + "u": _json_values(u.ravel()), + "v": _json_values(v.ravel()), + }, + } + + def handle_set_runs(self, args: dict) -> None: + """{runs: [{algorithm, start, params}]}: the optimisers to step together.""" + self._runs = [] + f = self._objective + if f is None: + raise ValueError("Function not set") + runs = [] + for run in args["runs"]: + spec = ALGORITHMS[run["algorithm"]] + given = dict(run.get("params", {})) + params = {p["name"]: float(given.get(p["name"], p["default"])) for p in spec["params"]} + start = np.array(run["start"], dtype=float) + if start.shape != (f.n,): + raise ValueError(f"Start point needs {f.n} coordinates, got {start.tolist()}") + with np.errstate(all="ignore"): + if not np.isfinite(f.value(start)): + point = ", ".join(f"{c:g}" for c in start) + raise UserError(f"The function has no finite value at the initial point ({point}).") + runs.append(Run(f, OPTIMISERS[spec["id"]](f, **params), start)) + self._runs = runs + + def handle_state(self, args: dict) -> dict | None: + """Every run after {iteration} iterations; None once all have stopped. + + "stopped" says why a run ended, at its last point and after it (where + point is None). It is None while the run carries on. + """ + k = int(args["iteration"]) + if not self._runs or k > MAX_ITERATIONS: + return None + points = [run.point(k) for run in self._runs] + if all(p is None for p in points): + return None + # Look one iteration ahead to know whether this is a run's last point + ended = [p is None or run.point(k + 1) is None for run, p in zip(self._runs, points)] + return { + "runs": [ + {"point": p, "stopped": run.stopped if end else (LIMIT_REACHED if k == MAX_ITERATIONS else None)} + for run, p, end in zip(self._runs, points, ended) + ] + } +`,Z=`"""Objective functions and optimisers, in one or two variables. + +Positions, gradients and Hessians are NumPy arrays of length 1 or 2, so each +optimiser is written once for both. +""" + +import re + +import numpy as np +from sympy import Abs, DiracDelta, Expr, Float, Integer, Rational, Symbol, acos, asin, atan, cos, exp, lambdify, log, pi, sin, sqrt, symbols, tan +from sympy.parsing.sympy_parser import ( + convert_xor, + implicit_multiplication_application, + parse_expr, + standard_transformations, +) + +# Real, so that e.g. d/dx |x| is sign(x) +VARIABLES = symbols("x y", real=True) + +ALLOWED_NAMES = { + "sin": sin, "cos": cos, "tan": tan, "asin": asin, "acos": acos, "atan": atan, + "log": log, "ln": log, "sqrt": sqrt, "abs": Abs, "exp": exp, + "e": exp(1), "pi": pi, "π": pi, +} +# The parser's own helpers for numbers and names, and nothing else: no other +# sympy functions and no Python builtins +PARSER_NAMES = {"Integer": Integer, "Float": Float, "Rational": Rational, "Symbol": Symbol, "__builtins__": {}} +FUNCTION_NAMES = "sin, cos, tan, asin, acos, atan, exp, log, sqrt, abs, e and pi" + + +def _unknown_names(expression: str, variables: list[str]) -> list[str]: + """Words that aren't a variable, a run of variables (xy is x·y) or an allowed name.""" + words = re.findall(r"[A-Za-z_]\\w*", expression) + return sorted({w for w in words if w not in ALLOWED_NAMES and not set(w) <= set(variables)}) + + +def parse_function(expression: str, n_variables: int) -> Expr: + """Parse e.g. "x^2 + 3y^2"; raises ValueError with a message for students.""" + if not expression.strip(): + raise ValueError("Enter a function.") + variables = VARIABLES[:n_variables] + allowed = " and ".join(str(v) for v in variables) + unknown = _unknown_names(expression, [str(v) for v in variables]) + if unknown: + raise ValueError(f"Unknown name {', '.join(unknown)}: functions can use {allowed}, and {FUNCTION_NAMES}.") + names = {str(v): v for v in VARIABLES} | ALLOWED_NAMES + try: + expr = parse_expr( + expression, + local_dict=names, + global_dict=PARSER_NAMES, + transformations=standard_transformations + (implicit_multiplication_application, convert_xor), + ) + except Exception: + raise ValueError("This isn't a function sympy can read. Check the brackets and operators.") + if not isinstance(expr, Expr): + raise ValueError("This isn't a function sympy can read. Check the brackets and operators.") + unknown = expr.free_symbols - set(variables) + if unknown: + raise ValueError(f"Unknown name {', '.join(sorted(map(str, unknown)))}: functions can use {allowed}, and {FUNCTION_NAMES}.") + return expr + + +def derivative(expr: Expr, *variables) -> Expr: + """∂expr/∂variables, with kinks treated as PyTorch's autograd does: d|x|/dx is + sign(x) (0 at x = 0) and sign has no curvature, so the Dirac delta sympy + gives for d²|x|/dx² becomes 0. NumPy has no Dirac delta to evaluate anyway.""" + return expr.diff(*variables).replace(DiracDelta, lambda *args: 0) + + +class Objective: + """f with its gradient and Hessian, evaluated at a point or on a grid.""" + + def __init__(self, expr: Expr, n_variables: int): + variables = VARIABLES[:n_variables] + self.n = n_variables + self._f = lambdify(variables, expr, modules="numpy") + self._gradient = [lambdify(variables, derivative(expr, v), modules="numpy") for v in variables] + self._hessian = [[lambdify(variables, derivative(expr, a, b), modules="numpy") for b in variables] for a in variables] + + def value(self, p: np.ndarray) -> float: + return float(self._f(*p)) + + def gradient(self, p: np.ndarray) -> np.ndarray: + return np.array([float(g(*p)) for g in self._gradient]) + + def hessian(self, p: np.ndarray) -> np.ndarray: + return np.array([[float(h(*p)) for h in row] for row in self._hessian]) + + def values_on(self, *grid: np.ndarray) -> np.ndarray: + # Constant expressions give a scalar; spread it over the grid + return np.broadcast_to(np.asarray(self._f(*grid), dtype=float), grid[0].shape) + + def gradient_on(self, *grid: np.ndarray) -> list[np.ndarray]: + return [np.broadcast_to(np.asarray(g(*grid), dtype=float), grid[0].shape) for g in self._gradient] + + +class SingularHessian(Exception): + pass + + +# Each optimiser keeps its own state between steps; step(p) returns the next position. + +class GradientDescent: + """Heavy-ball momentum: v ← μv − η∇f(x), x ← x + v.""" + + def __init__(self, objective: Objective, learning_rate: float, momentum: float): + self.f, self.lr, self.momentum = objective, learning_rate, momentum + self.v = 0.0 + + def step(self, p: np.ndarray) -> np.ndarray: + self.v = self.momentum * self.v - self.lr * self.f.gradient(p) + return p + self.v + + +class Nesterov: + """Gradient taken at the look-ahead point x + μv.""" + + def __init__(self, objective: Objective, learning_rate: float, momentum: float): + self.f, self.lr, self.momentum = objective, learning_rate, momentum + self.v = 0.0 + + def step(self, p: np.ndarray) -> np.ndarray: + self.v = self.momentum * self.v - self.lr * self.f.gradient(p + self.momentum * self.v) + return p + self.v + + +class Newton: + """x ← x − H⁻¹∇f(x).""" + + def __init__(self, objective: Objective): + self.f = objective + + def step(self, p: np.ndarray) -> np.ndarray: + h, g = self.f.hessian(p), self.f.gradient(p) + try: + delta = np.linalg.solve(h, g) + except np.linalg.LinAlgError: + raise SingularHessian() + # Pyodide's NumPy can't see floating-point errors, so solve returns inf or nan instead of raising + if np.all(np.isfinite(h)) and np.all(np.isfinite(g)) and not np.all(np.isfinite(delta)): + raise SingularHessian() + return p - delta + + +class Adagrad: + def __init__(self, objective: Objective, learning_rate: float, epsilon: float): + self.f, self.lr, self.eps = objective, learning_rate, epsilon + self.v = 0.0 # sum of squared gradients + + def step(self, p: np.ndarray) -> np.ndarray: + g = self.f.gradient(p) + self.v = self.v + g**2 + # ε outside the square root, as PyTorch does + return p - self.lr / (np.sqrt(self.v) + self.eps) * g + + +class RMSProp: + def __init__(self, objective: Objective, learning_rate: float, beta: float, epsilon: float): + self.f, self.lr, self.beta, self.eps = objective, learning_rate, beta, epsilon + self.v = 0.0 # moving average of squared gradients + + def step(self, p: np.ndarray) -> np.ndarray: + g = self.f.gradient(p) + self.v = self.beta * self.v + (1 - self.beta) * g**2 + # ε outside the square root, as PyTorch does + return p - self.lr / (np.sqrt(self.v) + self.eps) * g + + +class Adadelta: + def __init__(self, objective: Objective, beta: float, epsilon: float): + self.f, self.beta, self.eps = objective, beta, epsilon + self.v = 0.0 # moving average of squared gradients + self.s = 0.0 # moving average of squared updates + + def step(self, p: np.ndarray) -> np.ndarray: + g = self.f.gradient(p) + self.v = self.beta * self.v + (1 - self.beta) * g**2 + delta = -np.sqrt(self.s + self.eps) / np.sqrt(self.v + self.eps) * g + self.s = self.beta * self.s + (1 - self.beta) * delta**2 + return p + delta + + +class Adam: + def __init__(self, objective: Objective, learning_rate: float, beta1: float, beta2: float, epsilon: float): + self.f, self.lr, self.beta1, self.beta2, self.eps = objective, learning_rate, beta1, beta2, epsilon + self.m = 0.0 # first moment + self.v = 0.0 # second moment + self.t = 0 + + def step(self, p: np.ndarray) -> np.ndarray: + g = self.f.gradient(p) + self.t += 1 + self.m = self.beta1 * self.m + (1 - self.beta1) * g + self.v = self.beta2 * self.v + (1 - self.beta2) * g**2 + m_hat = self.m / (1 - self.beta1**self.t) + v_hat = self.v / (1 - self.beta2**self.t) + return p - self.lr / (np.sqrt(v_hat) + self.eps) * m_hat + + +# Ids match backend/src/algorithms.json +OPTIMISERS = { + "gradient_descent": GradientDescent, + "nesterov": Nesterov, + "newton": Newton, + "adam": Adam, + "adagrad": Adagrad, + "rmsprop": RMSProp, + "adadelta": Adadelta, +} + +# A run that gets further than this from the origin has diverged +DIVERGENCE_LIMIT = 1e6 + +DIVERGED = "The next point has no finite value or is beyond 1,000,000: the run diverged or left the function's domain." +SINGULAR = "The Hessian is singular here, so Newton's method can't take a step." + + +class Run: + """One optimiser's trajectory, computed as far as it has been asked for.""" + + def __init__(self, objective: Objective, optimiser, start: np.ndarray): + self.f = objective + self.optimiser = optimiser + self.points = [self._describe(start)] + self.position = start + # Why the run ended, once it has + self.stopped: str | None = None + + def point(self, k: int) -> dict | None: + """The point after k iterations, or None if the run stopped before then.""" + with np.errstate(all="ignore"): + while len(self.points) <= k and self.stopped is None: + self._advance() + return self.points[k] if k < len(self.points) else None + + def _advance(self) -> None: + try: + p = self.optimiser.step(self.position) + except SingularHessian: + self.stopped = SINGULAR + return + if not np.all(np.abs(p) <= DIVERGENCE_LIMIT) or not np.isfinite(self.f.value(p)): + self.stopped = DIVERGED + return + self.position = p + self.points.append(self._describe(p)) + + def _describe(self, p: np.ndarray) -> dict: + return { + "position": p.tolist(), + "value": self.f.value(p), + "gradient": self.f.gradient(p).tolist(), + "hessian": self.f.hessian(p).tolist(), + } +`,K=`{ + "algorithms": [ + { + "id": "gradient_descent", + "label": "Gradient descent", + "params": [ + { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "How far each step moves along the negative gradient." }, + { "name": "momentum", "label": "Momentum μ", "symbol": "μ", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.0, "description": "How much of the previous step carries over into the next one." } + ] + }, + { + "id": "nesterov", + "label": "Nesterov momentum", + "params": [ + { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "How far each step moves along the negative gradient." }, + { "name": "momentum", "label": "Momentum μ", "symbol": "μ", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.1, "description": "How much of the previous step carries over; the gradient is taken at the look-ahead point." } + ] + }, + { + "id": "newton", + "label": "Newton's method", + "params": [] + }, + { + "id": "adam", + "label": "Adam", + "params": [ + { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "The largest step size, roughly." }, + { "name": "beta1", "label": "Decay β₁", "symbol": "β₁", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving average of gradients (first moment)." }, + { "name": "beta2", "label": "Decay β₂", "symbol": "β₂", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.999, "description": "Decay rate of the moving average of squared gradients (second moment)." }, + { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." } + ] + }, + { + "id": "adagrad", + "label": "Adagrad", + "params": [ + { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "Divided by the root of the summed squared gradients." }, + { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." } + ] + }, + { + "id": "rmsprop", + "label": "RMSProp", + "params": [ + { "name": "learning_rate", "label": "Learning rate η", "symbol": "η", "kind": "number", "min": 0, "minExclusive": true, "default": 0.1, "description": "Divided by the root of the moving average of squared gradients." }, + { "name": "beta", "label": "Decay β", "symbol": "β", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving average of squared gradients." }, + { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 1e-8, "description": "Added to √v in the denominator, η / (√v + ε), to avoid dividing by zero." } + ] + }, + { + "id": "adadelta", + "label": "Adadelta", + "params": [ + { "name": "beta", "label": "Decay β", "symbol": "β", "kind": "number", "min": 0, "max": 1, "maxExclusive": true, "default": 0.9, "description": "Decay rate of the moving averages of squared gradients and squared updates." }, + { "name": "epsilon", "label": "Epsilon ε", "symbol": "ε", "kind": "number", "min": 0, "minExclusive": true, "default": 0.001, "description": "Sets the first step size, and avoids dividing by zero." } + ] + } + ] +} +`;$({packages:["numpy","sympy"],files:{"manager.py":Y,"logic.py":Z,"algorithms.json":K}})})(); diff --git a/dist/assets/pyodide.worker-Cq5E6qzM.js b/dist/assets/pyodide.worker-Cq5E6qzM.js deleted file mode 100644 index a9a18eb0451dc3640b6ae4d6b10d9c17141d28c9..0000000000000000000000000000000000000000 --- a/dist/assets/pyodide.worker-Cq5E6qzM.js +++ /dev/null @@ -1,1020 +0,0 @@ -(function(){"use strict";var y=`import numpy as np -from sympy import ( - lambdify, - symbols, - sin, - cos, - tan, - asin, - acos, - atan, - exp, - log, - sqrt, - pi, - Abs, -) - -from sympy.parsing.sympy_parser import ( - standard_transformations, - implicit_multiplication_application, - convert_xor, - parse_expr, -) - -from optimization_logic import * - - -class OptimizationManager: - def __init__(self): - self.function_values = {"x": [], "y": []} - self.trajectory_values = {"x": [], "y": []} - self.settings = {} - - def handle_update_settings(self, new_settings) -> dict[str, dict] | None: - if new_settings == self.settings: - return None - - non_relayout_settings = (new_settings.keys() | self.settings.keys()) - {"xlim", "ylim"} - non_relayout_settings_changed = any( - new_settings.get(k) != self.settings.get(k) - for k in non_relayout_settings - ) - - self.settings = new_settings - - function = new_settings.get("functionExpr", "").strip() - mode = new_settings.get("mode", "").lower().strip() - xlim = new_settings.get("xlim", []) - ylim = new_settings.get("ylim", []) - - if not self._is_valid_function(function, mode, xlim, ylim): - return { - "trajectoryValues": {"x": [], "y": []}, - "functionValues": {"x": [], "y": []}, - } - - if non_relayout_settings_changed: - self._reset_trajectory() - - if not self._function_changed(function, mode): - return { - "trajectoryValues": self.trajectory_values, - } - - try: - self._compute_function_values(function, mode, xlim, ylim) - except Exception as e: - self.function_values = {"x": [], "y": []} - self.trajectory_values = {"x": [], "y": []} - - return { - "functionValues": self.function_values, - "trajectoryValues": self.trajectory_values, - } - - def handle_reset(self) -> dict[str, list]: - self._reset_trajectory() - return { - "trajectoryValues": self.trajectory_values, - } - - def handle_next_step(self) -> dict[str, list]: - current_steps = len(self.trajectory_values["x"]) - self._compute_trajectory_values(self.settings, current_steps + 1) - return { - "trajectoryValues": self.trajectory_values, - } - - def handle_prev_step(self) -> dict[str, list]: - current_steps = len(self.trajectory_values["x"]) - if current_steps > 1: - self._compute_trajectory_values(self.settings, current_steps - 1) - return { - "trajectoryValues": self.trajectory_values, - } - - def handle_play(self) -> dict[str, list]: - pass - - def handle_pause(self) -> dict[str, list]: - pass - - def _is_valid_function( - self, function: str, mode: str, xlim: list, ylim: list - ) -> bool: - # axis limit checks - if len(xlim) != 2 or len(ylim) != 2: - return False - if xlim[0] >= xlim[1] or ylim[0] >= ylim[1]: - return False - - # function expression check - try: - expr = self._parse_function(function) - except Exception as e: - return False - - if mode == "univariate" and symbols("y") in expr.free_symbols: - return False - - return True - - def _function_changed(self, function: str, mode: str) -> bool: - function = function.strip() - previous_function = self.settings.get("function", "").strip() - previous_mode = self.settings.get("mode", "") - return function != previous_function or mode != previous_mode - - def _reset_trajectory(self) -> None: - try: - self._compute_trajectory_values(self.settings, steps=1) - except Exception as e: - self.trajectory_values = {"x": [], "y": []} - - def _parse_function(self, function: str) -> Expr: - if not function.strip(): - raise ValueError("Function expression cannot be empty") - - x, y = symbols("x y") - allowed_locals = { - 'x': x, - 'y': y, - 'sin': sin, - 'cos': cos, - 'tan': tan, - 'asin': asin, - 'acos': acos, - 'atan': atan, - 'log': log, - 'ln': log, - 'sqrt': sqrt, - 'abs': Abs, - 'exp': exp, - 'e': exp(1), - 'pi': pi, - 'π': pi, - } - - try: - parsed_function = parse_expr( - function, - local_dict=allowed_locals, - transformations=standard_transformations + ( - implicit_multiplication_application, - convert_xor, - ), - evaluate=True, - ) - except Exception as e: - raise ValueError(f"Invalid function expression: {e}") - - unknown_symbols = parsed_function.free_symbols - {x, y} - if unknown_symbols: - unknown_names = ", ".join(sorted(str(s) for s in unknown_symbols)) - raise ValueError(f"Unknown variable(s): {unknown_names}. Allowed: x, y") - - return parsed_function - - def _compute_function_values(self, function: str, mode: str, xlim: list, ylim: list) -> None: - expr = self._parse_function(function) - - if mode == "univariate": - x = np.linspace(xlim[0], xlim[1], 101) - f = lambdify('x', expr, modules=['numpy']) - y = f(x) - - if not isinstance(y, np.ndarray): - y = np.full_like(x, y) - - self.function_values = { - "x": x.tolist(), - "y": y.tolist(), - } - - elif mode == "bivariate": - x = np.linspace(xlim[0], xlim[1], 101) - y = np.linspace(ylim[0], ylim[1], 101) - X, Y = np.meshgrid(x, y) - f = lambdify(('x', 'y'), expr, modules=['numpy']) - gradient_x = lambdify(('x', 'y'), expr.diff('x'), modules=['numpy']) - gradient_y = lambdify(('x', 'y'), expr.diff('y'), modules=['numpy']) - Z = f(X, Y) - gradient_x_values = gradient_x(X, Y) - gradient_y_values = gradient_y(X, Y) - - if not isinstance(Z, np.ndarray): - Z = np.full_like(X, Z) - if not isinstance(gradient_x_values, np.ndarray): - gradient_x_values = np.full_like(X, gradient_x_values) - if not isinstance(gradient_y_values, np.ndarray): - gradient_y_values = np.full_like(Y, gradient_y_values) - - self.function_values = { - "x": x.tolist(), - "y": y.tolist(), - "z": Z.tolist(), - "gradientX": gradient_x_values.tolist(), - "gradientY": gradient_y_values.tolist(), - } - - else: - raise ValueError("Unsupported mode") - - def _compute_trajectory_values(self, settings: dict, steps: int) -> None: - mode = settings.get("mode", "").lower().strip() - algorithm = settings.get("algorithm", "").lower().strip().replace(" ", "_") - function = self._parse_function(settings.get("functionExpr", "").strip()) - - if mode == "univariate": - if algorithm == "gradient_descent": - self.trajectory_values = gd_univariate( - function, - float(settings["x0"]), - float(settings["learningRate"]), - float(settings["momentum"]), - steps, - ) - elif algorithm == "nesterov": - self.trajectory_values = nesterov_univariate( - function, - float(settings["x0"]), - float(settings["learningRate"]), - float(settings["momentum"]), - steps, - ) - elif algorithm == "adam": - self.trajectory_values = adam_univariate( - function, - float(settings["x0"]), - float(settings["learningRate"]), - float(settings["beta1"]), - float(settings["beta2"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "adagrad": - self.trajectory_values = adagrad_univariate( - function, - float(settings["x0"]), - float(settings["learningRate"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "rmsprop": - self.trajectory_values = rmsprop_univariate( - function, - float(settings["x0"]), - float(settings["learningRate"]), - float(settings["beta"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "adadelta": - self.trajectory_values = adadelta_univariate( - function, - float(settings["x0"]), - float(settings["beta"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "newton": - self.trajectory_values = newton_univariate( - function, - float(settings["x0"]), - steps, - ) - else: - raise ValueError("Unsupported algorithm for univariate mode") - - elif mode == "bivariate": - if algorithm == "gradient_descent": - self.trajectory_values = gd_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["learningRate"]), - float(settings["momentum"]), - steps, - ) - elif algorithm == "nesterov": - self.trajectory_values = nesterov_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["learningRate"]), - float(settings["momentum"]), - steps, - ) - elif algorithm == "adam": - self.trajectory_values = adam_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["learningRate"]), - float(settings["beta1"]), - float(settings["beta2"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "adagrad": - self.trajectory_values = adagrad_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["learningRate"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "rmsprop": - self.trajectory_values = rmsprop_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["learningRate"]), - float(settings["beta"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "adadelta": - self.trajectory_values = adadelta_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - float(settings["beta"]), - float(settings["epsilon"]), - steps, - ) - elif algorithm == "newton": - self.trajectory_values = newton_bivariate( - function, - float(settings["x0"]), - float(settings["y0"]), - steps, - ) - else: - raise ValueError("Unsupported algorithm for bivariate mode") -`,u=`import numpy as np -from sympy import lambdify, Expr - - -def _gradient_values(fx, fy, x: float, y: float) -> list: - return [float(fx(x, y)), float(fy(x, y))] - - -def _hessian_values(fxx, fxy, fyy, x: float, y: float) -> list: - return [ - [float(fxx(x, y)), float(fxy(x, y))], - [float(fxy(x, y)), float(fyy(x, y))], - ] - - -def gd_univariate( - function: Expr, - x0: float, - learning_rate: float, - momentum: float, - steps: int, -) -> dict: - """ - Perform gradient descent on a univariate function. - - Assumes function is valid and in terms of x - """ - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - for i in range(steps - 1): - if i == 0: - m = 0 - else: - m = momentum * (x_values[-1] - x_values[-2]) - - x = x - learning_rate * f_prime(x) + m - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def gd_bivariate( - function: Expr, - x0: float, - y0: float, - learning_rate: float, - momentum: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - for i in range(steps - 1): - if i == 0: - mx = 0 - my = 0 - else: - mx = momentum * (x_values[-1] - x_values[-2]) - my = momentum * (y_values[-1] - y_values[-2]) - - x_new = x - learning_rate * fx(x, y) + mx - y_new = y - learning_rate * fy(x, y) + my - x = x_new - y = y_new - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def nesterov_univariate( - function: Expr, - x0: float, - learning_rate: float, - momentum: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - for i in range(steps - 1): - if i == 0: - m = 0 - else: - m = momentum * (x_values[-1] - x_values[-2]) - - x_lookahead = x + m - x = x_lookahead - learning_rate * f_prime(x_lookahead) - - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def nesterov_bivariate( - function: Expr, - x0: float, - y0: float, - learning_rate: float, - momentum: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - for i in range(steps - 1): - if i == 0: - mx = 0 - my = 0 - else: - mx = momentum * (x_values[-1] - x_values[-2]) - my = momentum * (y_values[-1] - y_values[-2]) - - x_lookahead = x + mx - y_lookahead = y + my - - x = x_lookahead - learning_rate * fx(x_lookahead, y_lookahead) - y = y_lookahead - learning_rate * fy(x_lookahead, y_lookahead) - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def newton_univariate( - function: Expr, - x0: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - for i in range(steps - 1): - x = x - f_prime(x) / f_prime_prime(x) - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def newton_bivariate( - function: Expr, - x0: float, - y0: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - for i in range(steps - 1): - hessian = np.array( - [ - [fxx(x, y), fxy(x, y)], - [fxy(x, y), fyy(x, y)], - ], - ) - grad = np.array([fx(x, y), fy(x, y)]) - - try: - # delta = hessian^-1 * grad - delta = np.linalg.solve(hessian, grad) - except np.linalg.LinAlgError: - # singular hessian - cannot proceed - break - - x = x - delta[0] - y = y - delta[1] - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def adagrad_univariate( - function: Expr, - x0: float, - learning_rate: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - v = 0 # accumulated squared gradients - for i in range(steps - 1): - g = f_prime(x) - v += g ** 2 - x = x - (learning_rate / (np.sqrt(v + epsilon))) * g - - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def adagrad_bivariate( - function: Expr, - x0: float, - y0: float, - learning_rate: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - # accumulated squared gradients - vx = 0 - vy = 0 - for i in range(steps - 1): - gx = fx(x, y) - gy = fy(x, y) - vx += gx ** 2 - vy += gy ** 2 - - x = x - (learning_rate / (np.sqrt(vx + epsilon))) * gx - y = y - (learning_rate / (np.sqrt(vy + epsilon))) * gy - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def rmsprop_univariate( - function: Expr, - x0: float, - learning_rate: float, - beta: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - v = 0 # exponentially weighted average of squared gradients - for i in range(steps - 1): - g = f_prime(x) - v = beta * v + (1 - beta) * g ** 2 - x = x - (learning_rate / (np.sqrt(v + epsilon))) * g - - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def rmsprop_bivariate( - function: Expr, - x0: float, - y0: float, - learning_rate: float, - beta: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - # exponentially weighted average of squared gradients - vx = 0 - vy = 0 - for i in range(steps - 1): - gx = fx(x, y) - gy = fy(x, y) - vx = beta * vx + (1 - beta) * gx ** 2 - vy = beta * vy + (1 - beta) * gy ** 2 - - x = x - (learning_rate / (np.sqrt(vx + epsilon))) * gx - y = y - (learning_rate / (np.sqrt(vy + epsilon))) * gy - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def adadelta_univariate( - function: Expr, - x0: float, - beta: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - v = 0 # exponentially weighted average of squared gradients - s = 0 # exponentially weighted average of squared updates - for i in range(steps - 1): - g = f_prime(x) - v = beta * v + (1 - beta) * g ** 2 - delta_x = - (np.sqrt(s + epsilon) / np.sqrt(v + epsilon)) * g - x = x + delta_x - - s = beta * s + (1 - beta) * delta_x ** 2 - - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def adadelta_bivariate( - function: Expr, - x0: float, - y0: float, - beta: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - # exponentially weighted average of squared gradients - vx = 0 - vy = 0 - # exponentially weighted average of squared updates - sx = 0 - sy = 0 - for i in range(steps - 1): - gx = fx(x, y) - gy = fy(x, y) - vx = beta * vx + (1 - beta) * gx ** 2 - vy = beta * vy + (1 - beta) * gy ** 2 - - delta_x = - (np.sqrt(sx + epsilon) / np.sqrt(vx + epsilon)) * gx - delta_y = - (np.sqrt(sy + epsilon) / np.sqrt(vy + epsilon)) * gy - - x = x + delta_x - y = y + delta_y - - sx = beta * sx + (1 - beta) * delta_x ** 2 - sy = beta * sy + (1 - beta) * delta_y ** 2 - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } - - -def adam_univariate( - function: Expr, - x0: float, - learning_rate: float, - beta1: float, - beta2: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify('x', function, modules=['numpy']) - f_prime = lambdify('x', function.diff('x'), modules=['numpy']) - f_prime_prime = lambdify('x', function.diff('x', 2), modules=['numpy']) - - x_values = [x0] - y_values = [f(x0)] - derivative_values = [f_prime(x0)] - second_derivative_values = [f_prime_prime(x0)] - - x = x0 - m = 0 # first moment - v = 0 # second moment - for i in range(steps - 1): - g = f_prime(x) - m = beta1 * m + (1 - beta1) * g - v = beta2 * v + (1 - beta2) * g ** 2 - - m_hat = m / (1 - beta1 ** (i + 1)) - v_hat = v / (1 - beta2 ** (i + 1)) - - x = x - (learning_rate / (np.sqrt(v_hat) + epsilon)) * m_hat - - x_values.append(x) - y_values.append(f(x)) - derivative_values.append(f_prime(x)) - second_derivative_values.append(f_prime_prime(x)) - - return { - "x": x_values, - "y": y_values, - "derivative": derivative_values, - "secondDerivative": second_derivative_values, - } - - -def adam_bivariate( - function: Expr, - x0: float, - y0: float, - learning_rate: float, - beta1: float, - beta2: float, - epsilon: float, - steps: int, -) -> dict: - f = lambdify(('x', 'y'), function, modules=['numpy']) - fx = lambdify(('x', 'y'), function.diff('x'), modules=['numpy']) - fy = lambdify(('x', 'y'), function.diff('y'), modules=['numpy']) - fxx = lambdify(('x', 'y'), function.diff('x', 2), modules=['numpy']) - fyy = lambdify(('x', 'y'), function.diff('y', 2), modules=['numpy']) - fxy = lambdify(('x', 'y'), function.diff('x', 'y'), modules=['numpy']) - - x_values = [x0] - y_values = [y0] - z_values = [f(x0, y0)] - gradient_values = [_gradient_values(fx, fy, x0, y0)] - hessian_values = [_hessian_values(fxx, fxy, fyy, x0, y0)] - - x = x0 - y = y0 - # first moments - mx = 0 - my = 0 - # second moments - vx = 0 - vy = 0 - for i in range(steps - 1): - gx = fx(x, y) - gy = fy(x, y) - - mx = beta1 * mx + (1 - beta1) * gx - my = beta1 * my + (1 - beta1) * gy - - vx = beta2 * vx + (1 - beta2) * gx ** 2 - vy = beta2 * vy + (1 - beta2) * gy ** 2 - - mx_hat = mx / (1 - beta1 ** (i + 1)) - my_hat = my / (1 - beta1 ** (i + 1)) - - vx_hat = vx / (1 - beta2 ** (i + 1)) - vy_hat = vy / (1 - beta2 ** (i + 1)) - - x = x - (learning_rate / (np.sqrt(vx_hat) + epsilon)) * mx_hat - y = y - (learning_rate / (np.sqrt(vy_hat) + epsilon)) * my_hat - - x_values.append(x) - y_values.append(y) - z_values.append(f(x, y)) - gradient_values.append(_gradient_values(fx, fy, x, y)) - hessian_values.append(_hessian_values(fxx, fxy, fyy, x, y)) - - return { - "x": x_values, - "y": y_values, - "z": z_values, - "gradient": gradient_values, - "hessian": hessian_values, - } -`;const x="https://cdn.jsdelivr.net/pyodide/v0.26.1/full/pyodide.mjs";let e=null,t=null;async function d(){const{loadPyodide:a}=await import(x);e=await a({indexURL:"https://cdn.jsdelivr.net/pyodide/v0.26.1/full/"}),await e.loadPackage(["numpy","sympy"]),e.FS.writeFile("optimization_logic.py",u),e.FS.writeFile("optimization_manager.py",y),e.runPython("from optimization_manager import OptimizationManager; manager = OptimizationManager();"),t=e.globals.get("manager"),t||console.error("Failed to initialize optimization manager"),self.postMessage({type:"READY"})}function s(a){if(!a)return null;try{const n=a.toJs({dict_converter:Object.fromEntries});a.destroy&&a.destroy(),self.postMessage({type:"RESULT",data:n})}catch(n){console.error("Error handling Python result:",n)}}self.onmessage=async a=>{const n=a.data;if(!t){console.warn("Pyodide is not ready yet");return}switch(n.type){case"COMPARE":{const p=n.settings.map((m,r)=>{const o=e.globals.get("OptimizationManager"),i=o();o.destroy();const f=e.toPy(m);try{i.handle_update_settings(f)?.destroy(),i._compute_trajectory_values(f,n.iteration+1);const l=i.trajectory_values;try{return{id:n.ids[r],values:l.toJs({dict_converter:Object.fromEntries})}}finally{l.destroy()}}catch(l){return{id:n.ids[r],values:{x:[],y:[]},error:String(l)}}finally{f.destroy(),i.destroy()}});self.postMessage({type:"COMPARISON_RESULT",requestId:n.requestId,trajectories:p});break}case"INIT":const _=e.toPy(n.settings);s(t.handle_update_settings(_));break;case"NEXT_STEP":s(t.handle_next_step());break;case"PREV_STEP":s(t.handle_prev_step());break;case"RESET":s(t.handle_reset());break;default:console.error("Unknown message type:",n);break}},d()})(); diff --git a/dist/index.html b/dist/index.html index dbcd119e765161948db77ece732c2ee3a8eac3a8..bfae435454d2d2dc47b14d947ff4b53e690c70a2 100644 --- a/dist/index.html +++ b/dist/index.html @@ -4,9 +4,9 @@ - Optimization - - + Optimisation + +
diff --git a/frontends/react/.vite/deps/_metadata.json b/frontends/react/.vite/deps/_metadata.json deleted file mode 100644 index 30ed2d4f071f6c52abf0e382d80670d9261f6f65..0000000000000000000000000000000000000000 --- a/frontends/react/.vite/deps/_metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "hash": "4e23559c", - "configHash": "ed310ce2", - "lockfileHash": "e3b0c442", - "browserHash": "6ecb434a", - "optimized": {}, - "chunks": {} -} \ No newline at end of file diff --git a/frontends/react/.vite/deps/package.json b/frontends/react/.vite/deps/package.json deleted file mode 100644 index 3dbc1ca591c0557e35b6004aeba250e6a70b56e3..0000000000000000000000000000000000000000 --- a/frontends/react/.vite/deps/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/frontends/react/index.html b/frontends/react/index.html index 0b13075f81dfa3ab2875ad9a73d8f27d5929c7e9..6de1cd6bace528a3ec437d0d86f773cb702d9ff4 100644 --- a/frontends/react/index.html +++ b/frontends/react/index.html @@ -4,7 +4,7 @@ - Optimization + Optimisation
diff --git a/frontends/react/package-lock.json b/frontends/react/package-lock.json index 98c4f9f87354f46530a7d8acc8ff25ad97472f22..a7e56f2c8553ac1f5ee5002b60754a76599b7d4c 100644 --- a/frontends/react/package-lock.json +++ b/frontends/react/package-lock.json @@ -8,8 +8,10 @@ "name": "optimization", "version": "0.0.0", "dependencies": { - "@elvis/ui": "github:joel-woodfield/elvis-ui", + "@elvis/pyodide": "file:../../../../packages/pyodide", + "@elvis/ui": "file:../../../../packages/ui", "@tailwindcss/vite": "^4.1.18", + "lucide-react": "^1.62.0", "plotly.js": "^3.3.1", "react": "^19.2.0", "react-dom": "^19.2.0", @@ -20,6 +22,7 @@ "devDependencies": { "@eslint/js": "^9.39.1", "@types/node": "^24.10.1", + "@types/plotly.js": "^3.0.9", "@types/react": "^19.2.5", "@types/react-dom": "^19.2.3", "@types/react-plotly.js": "^2.6.4", @@ -34,6 +37,43 @@ "vite": "^7.2.4" } }, + "../../../../packages/pyodide": { + "name": "@elvis/pyodide", + "version": "1.0.0", + "dependencies": { + "comlink": "^4.4.2" + }, + "devDependencies": { + "@types/react": "^19.3.0", + "typescript": "~5.9.3" + }, + "peerDependencies": { + "react": ">=19" + } + }, + "../../../../packages/ui": { + "name": "@elvis/ui", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@fontsource-variable/instrument-sans": "^5.3.0", + "@fontsource/ibm-plex-mono": "^5.3.0", + "papaparse": "^5.7.0" + }, + "devDependencies": { + "@types/papaparse": "^5.5.2", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "lucide-react": "^1.62.0", + "typescript": "^5.9.3", + "vitest": "^5.0.5" + }, + "peerDependencies": { + "lucide-react": ">=1.62.0", + "react": ">=19", + "react-dom": ">=19" + } + }, "node_modules/@babel/code-frame": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", @@ -328,14 +368,13 @@ "findup": "bin/findup.js" } }, + "node_modules/@elvis/pyodide": { + "resolved": "../../../../packages/pyodide", + "link": true + }, "node_modules/@elvis/ui": { - "version": "1.0.0", - "resolved": "git+ssh://git@github.com/joel-woodfield/elvis-ui.git#d37548939e8cb372e5f22dc87dd8e4359ab66fda", - "license": "ISC", - "peerDependencies": { - "react": ">=19", - "react-dom": ">=19" - } + "resolved": "../../../../packages/ui", + "link": true }, "node_modules/@esbuild/aix-ppc64": { "version": "0.27.2", @@ -4977,6 +5016,21 @@ "yallist": "^3.0.2" } }, + "node_modules/lucide-react": { + "version": "1.67.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.67.0.tgz", + "integrity": "sha512-z7kd21YNm/Gw3E7mTnq5dTuvV+yc+OEwA//oDENSG1SbZ/NVgKdjxALJFNdGoC0Ji7HaJR2Dha9ev7VUPxy9CQ==", + "license": "ISC", + "peerDependencies": { + "@types/react": "*", + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", diff --git a/frontends/react/package.json b/frontends/react/package.json index ba2ce7826b309d347faeb09b473221be4beb6a39..9fcbc9f4eefdf726ebc4d7d56c3d73cb9b614be9 100644 --- a/frontends/react/package.json +++ b/frontends/react/package.json @@ -10,8 +10,10 @@ "preview": "vite preview" }, "dependencies": { - "@elvis/ui": "github:joel-woodfield/elvis-ui", + "@elvis/pyodide": "file:../../../../packages/pyodide", + "@elvis/ui": "file:../../../../packages/ui", "@tailwindcss/vite": "^4.1.18", + "lucide-react": "^1.62.0", "plotly.js": "^3.3.1", "react": "^19.2.0", "react-dom": "^19.2.0", @@ -22,6 +24,7 @@ "devDependencies": { "@eslint/js": "^9.39.1", "@types/node": "^24.10.1", + "@types/plotly.js": "^3.0.9", "@types/react": "^19.2.5", "@types/react-dom": "^19.2.3", "@types/react-plotly.js": "^2.6.4", diff --git a/frontends/react/src/AlgorithmControls.tsx b/frontends/react/src/AlgorithmControls.tsx deleted file mode 100644 index 2019865111fdc1015aa3443d62bdea3217d54d90..0000000000000000000000000000000000000000 --- a/frontends/react/src/AlgorithmControls.tsx +++ /dev/null @@ -1,167 +0,0 @@ -import { useEffect, useState } from "react"; -import { InputField } from "@elvis/ui"; -import { SUPPORTED_ALGORITHMS, type SettingsUi } from "./types"; -export const DEFAULT_HYPERPARAMETERS = { - "Gradient Descent": { learningRate: "0.1", momentum: "0.0" }, - "Nesterov": { learningRate: "0.1", momentum: "0.1" }, - "Adam": { learningRate: "0.1", beta1: "0.9", beta2: "0.999", epsilon: "1e-8" }, - "Adagrad": { learningRate: "0.1", epsilon: "1e-8" }, - "RMSProp": { learningRate: "0.1", beta: "0.9", epsilon: "1e-8" }, - "Adadelta": { beta: "0.9", epsilon: "1e-3" }, - "Newton": {} -} - - -export default function AlgorithmControls({ settings, setSettings, onRandomInitialPoint, showInitialPoint = true }: { - settings: SettingsUi; - setSettings: (settings: SettingsUi) => void; - onRandomInitialPoint?: () => void; - showInitialPoint?: boolean; -}) { - function updateSettings(key: keyof SettingsUi, value: string) { - if (key === "algorithm") { - const defaults = DEFAULT_HYPERPARAMETERS[value as keyof typeof DEFAULT_HYPERPARAMETERS]; - setSettings({ mode: settings.mode, functionExpr: settings.functionExpr, x0: settings.x0, y0: settings.y0, algorithm: value as SettingsUi["algorithm"], ...defaults }); - } else { - setSettings({ ...settings, [key]: value }); - } - } - - const [initialPointInput, setInitialPointInput] = useState(() => - [settings.x0 ?? "", settings.y0 ?? ""].filter((part) => part !== "").join(", ") - ); - - useEffect(() => { - if (settings.mode === "Bivariate") { - setInitialPointInput([settings.x0 ?? "", settings.y0 ?? ""].filter((part) => part !== "").join(", ")); - } - }, [settings.mode, settings.x0, settings.y0]); - - function handleInitialPointChange(value: string) { - setInitialPointInput(value); - - if (settings.mode === "Bivariate") { - const parts = value.split(",").map((part) => part.trim()); - const [xValue, yValue] = parts; - - setSettings({ - ...settings, - x0: xValue ?? "", - y0: yValue ?? settings.y0 ?? "", - }); - } else { - updateSettings("x0", value); - } - } - - return <> -
- -
- -
-
- {showInitialPoint && (settings.mode === "Bivariate" ? ( -
- -
- handleInitialPointChange(event.target.value)} - className="h-10 w-full rounded border border-stone-300 px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-stone-400" - /> - -
-
- ) : ( -
- -
- updateSettings("x0", event.target.value)} - className="h-10 w-full rounded border border-stone-300 px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-stone-400" - /> - -
-
- ))} - -
- {["Gradient Descent", "Nesterov", "Adam", "Adagrad", "RMSProp"].includes(settings.algorithm) && ( - <> - updateSettings("learningRate", value)} - /> - - )} - {["Gradient Descent", "Nesterov"].includes(settings.algorithm) && ( - <> - updateSettings("momentum", value)} - /> - - )} - {settings.algorithm === "Adam" && ( - <> - updateSettings("beta1", value)} - /> - updateSettings("beta2", value)} - /> - - )} - {["RMSProp", "Adadelta"].includes(settings.algorithm) && ( - <> - updateSettings("beta", value)} - /> - - )} - {["Adam", "Adagrad", "RMSProp", "Adadelta"].includes(settings.algorithm) && ( - <> - updateSettings("epsilon", value)} - /> - - )} -
- ; -} diff --git a/frontends/react/src/App.tsx b/frontends/react/src/App.tsx index 3c3194181c862793b184c59213ec85ce4809324b..ef43218ecfcd431951ec42bf5e374680b85161da 100644 --- a/frontends/react/src/App.tsx +++ b/frontends/react/src/App.tsx @@ -1,198 +1,243 @@ -import { useEffect, useState, useRef } from "react"; -import OptimizationPlot from "./OptimizationPlot.tsx"; -import Sidebar from "./Sidebar.tsx"; -import ComparePanel from "./ComparePanel"; -import type { BivariatePlotView, ComparisonEntry, SettingsUi } from "./types.ts"; -import usePyodide from "./usePyodide.ts"; - -const INITIAL_SETTINGS_UI: SettingsUi = { - mode: "Univariate", - functionExpr: "x^2", - algorithm: "Gradient Descent", - x0: "0.5", - y0: "0.5", - learningRate: "0.1", - momentum: "0.0", -}; - -const INITIAL_XLIM: [number, number] = [-1, 1]; -const INITIAL_YLIM: [number, number] = [-1, 1]; - -const COMPARISON_COLORS = [ - "#0072B2", "#E69F00", "#009E73", "#D55E00", "#CC79A7", "#6F4EBA", - "#A6761D", "#E7298A", "#1B9E77", "#7570B3", "#E6AB02", "#666666", +import { useEffect, useState } from "react"; +import { ChevronDown, X } from "lucide-react"; +import { + AppLayout, + Button, + Checkbox, + ColorPicker, + Dropdown, + IconButton, + InputField, + InputSection, + SegmentedControl, + StepControls, +} from "@elvis/ui"; + +import { RUN_COLORS } from "./colors"; +import { ALL_PRESETS, CUSTOM, PRESETS } from "./functions"; +import HistoryPlot from "./HistoryPlot"; +import OptimisationPlot from "./OptimisationPlot"; +import OptimiserControls from "./OptimiserControls"; +import RunSummary from "./RunSummary"; +import Usage from "./Usage"; +import useOptimisation, { gradientNorm, type RunEditor, type Trajectory } from "./useOptimisation"; + +const PRESET_GROUPS = [ + { label: "Univariate: f(x)", options: PRESETS[1].map((p) => p.name) }, + { label: "Bivariate: f(x, y)", options: PRESETS[2].map((p) => p.name) }, +]; + +const PLOT_OPTIONS = [ + { value: "contour", label: "Contour" }, + { value: "surface", label: "Surface" }, ] as const; -function comparisonColor(id: number): string { - if (id <= COMPARISON_COLORS.length) return COMPARISON_COLORS[id - 1]; - // Continue with non-repeating golden-angle hues for unusually large comparisons. - return `hsl(${((id - 1) * 137.508) % 360}, 72%, 40%)`; -} +const helpClass = "text-sm text-ink-muted"; export default function App() { - const [settingsUi, setSettingsUi] = useState(INITIAL_SETTINGS_UI); - const [compareActive, setCompareActive] = useState(false); - const [entries, setEntries] = useState([]); - const [comparisonIteration, setComparisonIteration] = useState(0); - const [comparisonAnimating, setComparisonAnimating] = useState(false); - const nextId = useRef(1); - const [isAnimating, setIsAnimating] = useState(false); - const [showGradientField, setShowGradientField] = useState(false); - const [bivariatePlotView, setBivariatePlotView] = useState("Contour heatmap"); - const xlimRef = useRef<[number, number]>(INITIAL_XLIM); - const ylimRef = useRef<[number, number]>(INITIAL_YLIM); - const settings = { ...settingsUi, xlim: xlimRef.current, ylim: ylimRef.current }; - - function handleSettingsUiChange(newSettings: SettingsUi) { - setIsAnimating(false); - if (newSettings.mode !== settingsUi.mode || newSettings.functionExpr !== settingsUi.functionExpr - || newSettings.x0 !== settingsUi.x0 || newSettings.y0 !== settingsUi.y0) { - setComparisonAnimating(false); - setComparisonIteration(0); - setEntries(previous => previous.map(entry => ({ ...entry, settings: { ...entry.settings, mode: newSettings.mode, functionExpr: newSettings.functionExpr } }))); - } - setSettingsUi(newSettings); - api.sendInit({ ...newSettings, xlim: xlimRef.current, ylim: ylimRef.current }); - } - - function setAxisLimits(xlim: [number, number], ylim: [number, number]) { - xlimRef.current = xlim; - ylimRef.current = ylim; - api.sendInit({ ...settingsUi, xlim, ylim }); - } - - function handleRandomInitialPoint() { - const xRange = xlimRef.current[1] - xlimRef.current[0]; - const yRange = ylimRef.current[1] - ylimRef.current[0]; - const newX0 = (xlimRef.current[0] + Math.random() * xRange * 0.95).toFixed(2); - const newY0 = (ylimRef.current[0] + Math.random() * yRange * 0.95).toFixed(2); - const newSettings = { ...settingsUi, x0: newX0, y0: newY0 }; - handleSettingsUiChange(newSettings); - } - - const api = usePyodide(settings); - const { compare, comparisonBusy, isLoading } = api; - useEffect(() => { - if (!isLoading) compare(entries.map(entry => ({ ...entry.settings, xlim: xlimRef.current, ylim: ylimRef.current })), entries.map(entry => entry.id), comparisonIteration); - }, [entries, comparisonIteration, compare, isLoading]); - + const app = useOptimisation(); + const preset = ALL_PRESETS.find((p) => p.expression === app.expression); + const twoVariables = app.variables === 2; + // The optimiser being edited (the others are collapsed); clicking the plot moves its start + const [openCard, setOpenCard] = useState(1); + const open = app.optimisers.find((o) => o.id === openCard); + const clickable = !(twoVariables && app.surface); + // The view-controls row above the plot comes and goes with y; Plotly only + // re-measures its box on window resize useEffect(() => { - if (!comparisonAnimating || comparisonBusy || isLoading) return; - const timeout = window.setTimeout(() => setComparisonIteration(value => value + 1), 200); - return () => window.clearTimeout(timeout); - }, [comparisonAnimating, comparisonBusy, isLoading, comparisonIteration]); - - const sendNextStep = api.sendNextStep; - const currentIteration = api.currentIteration; - const totalIterations = Math.max((api.plotData.trajectoryValues?.x.length ?? 1) - 1, 0); - - useEffect(() => { - if (!isAnimating) return; - const intervalId = window.setInterval(() => sendNextStep(), 200); - return () => window.clearInterval(intervalId); - }, [isAnimating, sendNextStep]); - - //if (api.isLoading) { - //return ; - //} + window.dispatchEvent(new Event("resize")); + }, [twoVariables]); return ( -
-
-
-
-
Optimization Trajectory Visualizer
- {/*
*/} -
- - {api.isLoading ? "Loading Python runtime…" : "Python runtime ready"} -
-
- -
-
- {settingsUi.mode === "Bivariate" && ( -
- {(["Contour heatmap", "Function surface"] as const).map((view) => ( - + } + examples={

Examples are coming soon.

} + tabs={[{ label: "Configure", content: <> + + { + const chosen = ALL_PRESETS.find((p) => p.name === name); + if (chosen) { + app.choosePreset(chosen); + } + }} + /> + + {app.optimisers.length > 0 && ( +
    + {app.optimisers.map((o) => ( + app.setOptimiserName(o.id, name)} + editor={o.editor} + trajectory={app.trajectories.find((t) => t.id === o.id)} + taken={app.optimisers.map((other) => other.color)} + open={openCard === o.id} + onToggle={() => setOpenCard(openCard === o.id ? null : o.id)} + onColorChange={(color) => app.setOptimiserColor(o.id, color)} + onRemove={() => app.removeOptimiser(o.id)} + twoVariables={twoVariables} + onResetStart={() => app.resetStart(o.editor)} + onRandomStart={() => app.randomStart(o.editor)} + hint={clickable ? "Or click the plot to move this initial point." : undefined} + /> ))} -
+ )} - ({ ...entry, values: api.comparison.find(item => item.id === entry.id)?.values })) : undefined} - isLoading={api.isLoading} - xlim={xlimRef.current} - ylim={ylimRef.current} - setAxisLimits={setAxisLimits} - currentIteration={currentIteration} - showGradientField={showGradientField} - bivariatePlotView={bivariatePlotView} +
+ )} + app.startAt(open.editor, x, y) : null} + surface={app.surface} + arrows={app.showArrows} + /> + + ); +} + +// f at a run's latest point, if it has one +function CurrentValue({ trajectory }: { trajectory?: Trajectory }) { + const last = trajectory?.path[trajectory.path.length - 1]; + return last ? f = {Number(last.value.toPrecision(3))} : null; +} - onReset={() => { - setIsAnimating(false); - api.sendReset(); - }} - onNextStep={api.sendNextStep} - onPrevStep={api.sendPrevStep} - onAnimate={() => setIsAnimating(true)} - onPause={() => setIsAnimating(false)} - isAnimating={isAnimating} - currentIteration={currentIteration} - totalIterations={totalIterations} - showGradientField={showGradientField} - onShowGradientFieldChange={setShowGradientField} - /> -
-
-
-
+interface RunCardProps { + id: number; + color: string; + name: string; + // The name as shown: the typed one, else the automatic one + shownName: string; + onNameChange: (name: string) => void; + editor: RunEditor; + trajectory?: Trajectory; + open: boolean; + onToggle: () => void; + onColorChange: (color: string) => void; + onRemove: () => void; + // Colours used by the optimisers, this one included + taken: string[]; + twoVariables: boolean; + onResetStart: () => void; + onRandomStart: () => void; + hint?: string; +} + +// An optimiser in the list: one line with its colour, name and f, which +// opens to its settings and initial point +function RunCard({ id, color, name, shownName, onNameChange, editor, trajectory, open, onToggle, onColorChange, onRemove, taken, twoVariables, onResetStart, onRandomStart, hint }: RunCardProps) { + return ( +
  • +
    + + {/* Reads as plain text until hovered or focused. Untyped, it shows the + automatic name as its placeholder, in the text colour. It gives way + when space is short; the latest f beside it doesn't */} + onNameChange(e.target.value)} + placeholder={shownName} + aria-label={`Name of optimiser ${id}`} + title="Rename" + className="h-8 w-40 min-w-0 rounded border border-transparent bg-transparent px-1.5 text-sm text-ink placeholder:text-ink hover:border-line focus:border-ink focus:outline-none focus:placeholder:text-ink-muted" + /> + + + + +
    + {open && ( +
    + +
    + )} +
  • ); } diff --git a/frontends/react/src/ComparePanel.tsx b/frontends/react/src/ComparePanel.tsx deleted file mode 100644 index b8b9301a2c9d9e06351bc02c98386ba84e26135f..0000000000000000000000000000000000000000 --- a/frontends/react/src/ComparePanel.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { useState } from "react"; -import AlgorithmControls, { DEFAULT_HYPERPARAMETERS } from "./AlgorithmControls"; -import type { ComparisonEntry, ComparisonTrajectory, SettingsUi } from "./types"; - -export default function ComparePanel({ settings, entries, trajectories, onAdd, onRemove, onToggleVisibility, iteration, busy, ready, animating, onAction }: { - settings: SettingsUi; - entries: ComparisonEntry[]; - trajectories: ComparisonTrajectory[]; - onAdd: (settings: SettingsUi) => void; - onRemove: (id: number) => void; - onToggleVisibility: (id: number) => void; - iteration: number; - busy: boolean; - ready: boolean; - animating: boolean; - onAction: (action: string) => void; -}) { - const [draft, setDraft] = useState(settings); - const configured: SettingsUi = { algorithm: draft.algorithm, x0: draft.x0, y0: draft.y0, - mode: settings.mode, functionExpr: settings.functionExpr, - ...Object.fromEntries(Object.entries(DEFAULT_HYPERPARAMETERS[draft.algorithm]).map(([key, fallback]) => [key, draft[key as keyof SettingsUi] ?? fallback])) }; - const valid = [configured.x0, ...(configured.mode === "Bivariate" ? [configured.y0] : []), - ...Object.entries(configured).filter(([key]) => ["learningRate", "momentum", "beta", "beta1", "beta2", "epsilon"].includes(key)).map(([, value]) => value) - ].every(value => value !== undefined && value.trim() !== "" && Number.isFinite(Number(value))); - return <> - setDraft({ ...configured, x0: (Math.random() * 2 - 1).toFixed(2), y0: (Math.random() * 2 - 1).toFixed(2) })} /> - -
    Selected algorithms
    - {entries.length === 0 &&

    Add algorithms to compare their trajectories on the same objective.

    } -
      - {entries.map((entry, index) =>
    • -
      - - {index + 1}. {entry.settings.algorithm} - - -
      -
      {Object.entries(entry.settings).filter(([key]) => !["mode", "functionExpr", "algorithm"].includes(key) && (key !== "y0" || settings.mode === "Bivariate")).map(([key, value]) => `${key}: ${value}`).join(", ")}
      - {trajectories.find(item => item.id === entry.id)?.error &&

      Unable to compute this trajectory. Check its settings.

      } -
    • )} -
    -
    Iteration {iteration}{busy ? " · Computing…" : ""}
    -
    - {["Animate", "Previous", "Next", "Reset", "Pause"].map(action => )} -
    - ; -} diff --git a/frontends/react/src/HistoryPlot.tsx b/frontends/react/src/HistoryPlot.tsx new file mode 100644 index 0000000000000000000000000000000000000000..26bca99de1d1baf970ba84ba671f27896adc68ca --- /dev/null +++ b/frontends/react/src/HistoryPlot.tsx @@ -0,0 +1,59 @@ +import Plot from "react-plotly.js"; +import type { Data } from "plotly.js"; +import { usePlotStyle } from "@elvis/ui"; + +import type { Point } from "./types"; +import type { Trajectory } from "./useOptimisation"; + +// A log axis can't show 0, so smaller values are drawn here (hover shows the real value) +const LOG_FLOOR = 1e-16; + +interface HistoryPlotProps { + trajectories: Trajectory[]; + // What is plotted, e.g. "f"; also used in the hover text + name: string; + value: (p: Point) => number; + log?: boolean; +} + +// A value at each iteration, one line per run +export default function HistoryPlot({ trajectories, name, value, log = false }: HistoryPlotProps) { + const style = usePlotStyle(); + const data = trajectories.map((t) => { + const values = t.path.map(value); + return { + x: t.path.map((_, k) => k), + y: log ? values.map((v) => Math.max(v, LOG_FLOOR)) : values, + customdata: values, + type: "scatter", + mode: "lines+markers", + name: t.label, + line: { color: style.color(t.color), width: 2 }, + marker: { color: style.color(t.color), size: 4 }, + hovertemplate: `%{fullData.name}
    iteration %{x}
    ${name} = %{customdata:.4g}`, + }; + }) as Data[]; + + return ( +
    + + {name} at each iteration{log && " (log scale)"} + +
    + +
    +
    + ); +} diff --git a/frontends/react/src/IterationHistoryPlot.tsx b/frontends/react/src/IterationHistoryPlot.tsx deleted file mode 100644 index b098683e507b06157fe429b950277a031fab3908..0000000000000000000000000000000000000000 --- a/frontends/react/src/IterationHistoryPlot.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import Plot from "react-plotly.js"; -import type { SettingsUi, TrajectoryValues } from "./types.ts"; - -interface IterationHistoryPlotProps { - mode: SettingsUi["mode"]; - trajectoryValues?: TrajectoryValues | null; - currentIteration: number; -} - -export default function IterationHistoryPlot({ mode, trajectoryValues, currentIteration }: IterationHistoryPlotProps) { - const xValues = trajectoryValues?.x ?? []; - const yValues = trajectoryValues?.y ?? []; - const objectiveValues = mode === "Bivariate" ? trajectoryValues?.z ?? [] : yValues; - const iterations = xValues.map((_, index) => index); - - const traces = mode === "Bivariate" - ? [ - { name: "x", values: xValues, color: "#2563eb" }, - { name: "y", values: yValues, color: "#16a34a" }, - { name: "Objective", values: objectiveValues, color: "#dc2626" }, - ] - : [ - { name: "x", values: xValues, color: "#2563eb" }, - { name: "Objective", values: objectiveValues, color: "#dc2626" }, - ]; - - return ( -
    - ({ - x: iterations.slice(0, trace.values.length), - y: trace.values, - name: trace.name, - type: "scatter" as const, - mode: "lines+markers" as const, - line: { color: trace.color, width: 2 }, - marker: { color: trace.color, size: 5 }, - hovertemplate: `${trace.name}: %{y:.5g}`, - })), - ...traces.map((trace) => ({ - x: trace.values[currentIteration] !== undefined ? [currentIteration] : [], - y: trace.values[currentIteration] !== undefined ? [trace.values[currentIteration]] : [], - name: `${trace.name} selected`, - type: "scatter" as const, - mode: "markers" as const, - marker: { color: trace.color, size: 11, line: { color: "white", width: 2 } }, - hoverinfo: "skip" as const, - showlegend: false, - })), - ]} - layout={{ - title: { text: "Optimization history", font: { size: 14 } }, - xaxis: { - title: { text: "Iteration" }, - showticklabels: false, - ticks: "", - rangemode: "tozero", - }, - yaxis: { title: { text: "Value" }, automargin: true }, - legend: { orientation: "h", x: 0.5, xanchor: "center", y: 1.12 }, - margin: { t: 58, r: 18, b: 45, l: 55 }, - hovermode: "x unified", - paper_bgcolor: "transparent", - plot_bgcolor: "transparent", - }} - style={{ width: "100%", height: "100%" }} - config={{ responsive: true, displayModeBar: false }} - /> -
    - ); -} diff --git a/frontends/react/src/OptimisationPlot.tsx b/frontends/react/src/OptimisationPlot.tsx new file mode 100644 index 0000000000000000000000000000000000000000..d8475a890e76e43c572ee9471f9c52401cf42519 --- /dev/null +++ b/frontends/react/src/OptimisationPlot.tsx @@ -0,0 +1,247 @@ +import { useRef, useState, type RefObject } from "react"; +import { usePlotlyClick, usePlotStyle, type PlotStyle } from "@elvis/ui"; +import Plot from "react-plotly.js"; +import type { Camera, Data, Layout } from "plotly.js"; + +import type { Trajectory } from "./useOptimisation"; +import type { FunctionValues, Range, SurfaceValues } from "./types"; + +interface OptimisationPlotProps { + values: FunctionValues | null; + trajectories: Trajectory[]; + xRange: RefObject; + yRange: RefObject; + onViewChange: (x: Range, y: Range) => void; + // Called with data coordinates when the plot is clicked; null ignores clicks + onClick: ((x: number, y: number) => void) | null; + // With two variables: a 3D surface instead of a contour map + surface: boolean; + arrows: boolean; +} + +const CONFIG = { scrollZoom: true, displayModeBar: true, doubleClick: false, responsive: true } as const; +const LEGEND = { x: 0.02, y: 0.98, xanchor: "left", yanchor: "top" } as const; + +export default function OptimisationPlot({ values, trajectories, xRange, yRange, onViewChange, onClick, surface, arrows }: OptimisationPlotProps) { + const plotRef = useRef(null); + const style = usePlotStyle(); + // The 3D camera as the student last left it. Plotly resets it on each redraw + // while stepping (uirevision alone doesn't keep it), so it's passed back in. + const [camera, setCamera] = useState | undefined>(undefined); + // While the student drags the surface, the frame they started on; a redraw + // from stepping would otherwise cancel the drag + const [held, setHeld] = useState<{ data: Data[]; layout: Partial } | null>(null); + // el exists at runtime only + // eslint-disable-next-line @typescript-eslint/no-explicit-any + usePlotlyClick(() => (plotRef.current as any)?.el, surface ? null : onClick); + + const twoVariables = values !== null && "y" in values; + const showLegend = trajectories.length > 1; + + if (twoVariables && surface) { + const data = [surfaceTrace(values), ...trajectories.flatMap((t) => pathTraces(t, style, true))]; + const layout: Partial = { + // Keep the camera while stepping + uirevision: "surface", + ...style.layout, + showlegend: showLegend, + legend: { ...LEGEND, bgcolor: style.legend }, + margin: { t: 20, r: 20, b: 20, l: 20 }, + scene: { + camera, + aspectmode: "cube", + xaxis: { ...style.axis, title: { text: "x" }, range: [...xRange.current] }, + yaxis: { ...style.axis, title: { text: "y" }, range: [...yRange.current] }, + zaxis: { ...style.axis, title: { text: "f(x, y)" } }, + }, + }; + return ( +
    { + setHeld({ data, layout }); + // Catch up once the drag ends, after Plotly has reported the new camera + window.addEventListener("pointerup", () => setTimeout(() => setHeld(null), 50), { once: true }); + }} + > + { + const moved = (event as { "scene.camera"?: Partial })["scene.camera"]; + if (moved) { + setCamera(moved); + } + }} + config={CONFIG} + style={{ width: "100%", height: "100%" }} + /> +
    + ); + } + + const data: Data[] = []; + if (values && "y" in values) { + data.push(contourTrace(values)); + if (arrows) { + data.push(...arrowTraces(values, xRange.current, yRange.current)); + } + } else if (values) { + data.push({ + x: values.x, + y: values.f, + type: "scatter", + mode: "lines", + line: { color: style.ink, width: 2 }, + name: "f(x)", + showlegend: false, + hovertemplate: "x = %{x:.4g}
    f(x) = %{y:.4g}", + }); + } + data.push(...trajectories.flatMap((t) => pathTraces(t, style, false, twoVariables))); + + const layout: Partial = { + dragmode: "pan", + // Keep the user's pan and zoom while stepping; a new range (e.g. from a preset) still applies + uirevision: "view", + ...style.layout, + showlegend: showLegend, + legend: { ...LEGEND, bgcolor: style.legend }, + margin: { t: 40, r: 40, b: 40, l: 40 }, + xaxis: { ...style.axis, title: { text: "x" }, range: [...xRange.current] }, + yaxis: { ...style.axis, title: { text: twoVariables ? "y" : "f(x)" }, range: [...yRange.current] }, + }; + + return ( +
    + { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const full = (plotRef.current as any)?.el?._fullLayout; + const x = (full?.xaxis?.range ?? [event["xaxis.range[0]"], event["xaxis.range[1]"]]) as Range; + const y = (full?.yaxis?.range ?? [event["yaxis.range[0]"], event["yaxis.range[1]"]]) as Range; + const changed = x[0] !== xRange.current[0] || x[1] !== xRange.current[1] || y[0] !== yRange.current[0] || y[1] !== yRange.current[1]; + if (changed && x.every(Number.isFinite) && y.every(Number.isFinite)) { + onViewChange([x[0], x[1]], [y[0], y[1]]); + } + }} + config={CONFIG} + style={{ width: "100%", height: "100%", minWidth: 0 }} + /> +
    + ); +} + +function contourTrace(values: SurfaceValues): Data { + return { + x: values.x, + y: values.y, + z: values.f, + type: "contour", + colorscale: "Viridis", + contours: { coloring: "heatmap", showlines: false }, + colorbar: { thickness: 12, title: { text: "f" } }, + hovertemplate: "x = %{x:.3g}, y = %{y:.3g}
    f = %{z:.4g}", + } as Data; +} + +function surfaceTrace(values: SurfaceValues): Data { + return { + x: values.x, + y: values.y, + z: values.f, + type: "surface", + colorscale: "Viridis", + opacity: 0.85, + colorbar: { thickness: 12, title: { text: "f" } }, + hovertemplate: "x = %{x:.3g}, y = %{y:.3g}
    f = %{z:.4g}", + } as Data; +} + +// A run's path and, larger, its current point +function pathTraces(t: Trajectory, style: PlotStyle, threeD: boolean, twoVariables = true): Data[] { + const color = style.color(t.color); + const xs = t.path.map((p) => p.position[0]); + const ys = twoVariables ? t.path.map((p) => p.position[1]) : t.path.map((p) => p.value); + const fs = t.path.map((p) => p.value); + // Hover shows the value and both derivatives: f′ and f″, or ∇f and the Hessian + const hover = t.path.map((p) => [p.value, ...p.gradient, ...p.hessian.flat()]); + const hovertemplate = twoVariables + ? "x = %{x:.4g}, y = %{y:.4g}
    f = %{customdata[0]:.4g}
    " + + "∇f = (%{customdata[1]:.4g}, %{customdata[2]:.4g})
    " + + "∇²f = [[%{customdata[3]:.4g}, %{customdata[4]:.4g}], [%{customdata[5]:.4g}, %{customdata[6]:.4g}]]%{fullData.name}" + : "x = %{x:.4g}
    f(x) = %{y:.4g}
    f′(x) = %{customdata[1]:.4g}
    f″(x) = %{customdata[2]:.4g}%{fullData.name}"; + const last = t.path.length - 1; + if (threeD) { + return [ + { x: xs, y: ys, z: fs, type: "scatter3d", mode: "lines+markers", name: t.label, legendgroup: t.label, + line: { color, width: 5 }, marker: { color, size: 2.5 }, hoverinfo: "skip" }, + { x: xs.slice(last), y: ys.slice(last), z: fs.slice(last), type: "scatter3d", mode: "markers", name: t.label, + legendgroup: t.label, showlegend: false, marker: { color, size: 6, line: { color: style.halo, width: 1 } }, hoverinfo: "skip" }, + ] as Data[]; + } + return [ + { x: xs, y: ys, customdata: hover, type: "scatter", mode: "lines+markers", name: t.label, legendgroup: t.label, + line: { color, width: 2 }, marker: { color, size: 7 }, hovertemplate }, + { x: xs.slice(last), y: ys.slice(last), customdata: hover.slice(last), type: "scatter", mode: "markers", name: t.label, + legendgroup: t.label, showlegend: false, marker: { color, size: 14, line: { color: style.halo, width: 2 } }, hovertemplate }, + ] as Data[]; +} + +// The gradient as arrows (pointing uphill), scaled so a typical arrow spans +// most of the gap between grid points +function arrowTraces({ arrows }: SurfaceValues, [x0, x1]: Range, [y0, y1]: Range): Data[] { + // Arrows per side of the grid + const side = Math.sqrt(arrows.x.length); + // Lengths as fractions of the view, so x and y scale alike + const lengths = arrows.u.map((u, i) => Math.hypot((u ?? NaN) / (x1 - x0), (arrows.v[i] ?? NaN) / (y1 - y0))); + const finite = lengths.filter((l) => Number.isFinite(l) && l > 0).sort((a, b) => a - b); + const typical = finite[Math.floor(0.9 * (finite.length - 1))] ?? 1; + + const shaftX: (number | null)[] = []; + const shaftY: (number | null)[] = []; + // A marker only on each head + const sizes: number[] = []; + const headX: number[] = []; + const headY: number[] = []; + const hover: number[][] = []; + arrows.x.forEach((x, i) => { + const u = arrows.u[i]; + const v = arrows.v[i]; + if (u === null || v === null || !(lengths[i] > 0)) { + return; + } + // At most 0.9 of a grid cell (1 / side of the view) + const scale = (0.9 * Math.min(1, lengths[i] / typical)) / (lengths[i] * side); + const dx = u * scale; + const dy = v * scale; + const y = arrows.y[i]; + shaftX.push(x, x + dx, null); + shaftY.push(y, y + dy, null); + sizes.push(0, 6, 0); + headX.push(x + dx); + headY.push(y + dy); + hover.push([x, y, u, v]); + }); + + const color = "rgba(255, 255, 255, 0.85)"; + return [ + // angleref "previous" turns each head along the line from its tail, in + // screen space, so heads stay on their shafts however the plot is stretched + { + x: shaftX, y: shaftY, type: "scatter", mode: "lines+markers", line: { color, width: 1 }, hoverinfo: "skip", showlegend: false, + marker: { symbol: "triangle-up", size: sizes, color, angleref: "previous" }, + }, + // Invisible heads, for the hover text + { + x: headX, y: headY, customdata: hover, type: "scatter", mode: "markers", showlegend: false, + marker: { size: 6, opacity: 0 }, + hovertemplate: "x = %{customdata[0]:.3g}, y = %{customdata[1]:.3g}
    ∇f = (%{customdata[2]:.3g}, %{customdata[3]:.3g})", + }, + ] as Data[]; +} diff --git a/frontends/react/src/OptimiserControls.tsx b/frontends/react/src/OptimiserControls.tsx new file mode 100644 index 0000000000000000000000000000000000000000..cf4a083951a022c84da5a8676fc5b36a90d718dc --- /dev/null +++ b/frontends/react/src/OptimiserControls.tsx @@ -0,0 +1,86 @@ +import { useId, useState } from "react"; +import { Dices, Info, RotateCcw } from "lucide-react"; +import { AllSettings, Dialog, Dropdown, IconButton, InputField, ParamControls, type ParamValue } from "@elvis/ui"; + +import { ALGORITHMS, algorithmById } from "./algorithms"; +import type { RunEditor } from "./useOptimisation"; + +const helpClass = "text-sm text-ink-muted"; + +interface OptimiserControlsProps { + editor: RunEditor; + twoVariables: boolean; + onResetStart: () => void; + onRandomStart: () => void; + // Extra help under the start point, e.g. that the plot can be clicked + hint?: string; +} + +// An optimiser's algorithm, settings and start point, inside its card +export default function OptimiserControls({ editor, twoVariables, onResetStart, onRandomStart, hint }: OptimiserControlsProps) { + const active = algorithmById(editor.algorithm); + const [infoOpen, setInfoOpen] = useState(false); + const id = useId(); + const hasSettings = active.params.length > 0; + const changed = Object.keys(editor.params).length > 0; + + function setOne(name: string, value: ParamValue) { + editor.changeParams({ ...editor.params, [name]: value }); + } + + function resetOne(name: string) { + editor.changeParams(Object.fromEntries(Object.entries(editor.params).filter(([key]) => key !== name))); + } + + return ( + <> + {/* The algorithm, with its settings' details and a reset beside it */} +
    +
    + a.label)} + activeOption={active.label} + onChange={(label) => editor.changeAlgorithm(ALGORITHMS.find((a) => a.label === label)!.id)} + /> +
    + setInfoOpen(true)} disabled={!hasSettings}> + + + editor.changeParams({})} disabled={!changed}> + + +
    + {/* Up to 4 settings side by side, each shown by its symbol */} + + setInfoOpen(false)} wide> + editor.changeParams({})} /> + +
    + {/* One label for the coordinates; with two variables each box says which */} +
    + Initial point +
    +
    + editor.changeStart(0, t)} mono /> +
    + {twoVariables && ( +
    + editor.changeStart(1, t)} mono /> +
    + )} + + + + + + +
    +
    + {!editor.startValid &&

    The initial point must be numbers.

    } + {hint &&

    {hint}

    } +
    + + ); +} diff --git a/frontends/react/src/OptimizationPlot.tsx b/frontends/react/src/OptimizationPlot.tsx deleted file mode 100644 index 705ac57b47bc1d2827203a9b5e3eb9a854c5798c..0000000000000000000000000000000000000000 --- a/frontends/react/src/OptimizationPlot.tsx +++ /dev/null @@ -1,394 +0,0 @@ -import { useMemo, useRef } from "react"; -import Plot from "react-plotly.js"; -import type { BivariatePlotView, ComparisonEntry, TrajectoryValues, PlotData } from "./types"; -import { Card } from "@elvis/ui"; - -interface OptimizationPlotProps { - comparisons?: (ComparisonEntry & { values?: TrajectoryValues })[]; - data: PlotData; - isLoading: boolean; - xlim: [number, number]; - ylim: [number, number]; - setAxisLimits: (xlim: [number, number], ylim: [number, number]) => void; - currentIteration: number; - showGradientField: boolean; - bivariatePlotView: BivariatePlotView; -} - -export default function OptimizationPlot({ comparisons, data, isLoading, xlim, ylim, setAxisLimits, currentIteration, showGradientField, bivariatePlotView }: OptimizationPlotProps) { - - const isSurface = bivariatePlotView === "Function surface" && Boolean(data.functionValues?.z); - const comparisonTraces = (comparisons ?? []).flatMap((entry, index) => entry.visible ? [ - { x: entry.values?.x ?? [], y: entry.values?.y ?? [], z: isSurface ? entry.values?.z ?? [] : undefined, - type: isSurface ? "scatter3d" as const : "scatter" as const, mode: "lines+markers" as const, - name: `${index + 1}. ${entry.settings.algorithm}`, legendgroup: String(entry.id), showlegend: true, - line: { color: entry.color, width: isSurface ? 6 : 2 }, - marker: { color: entry.color, size: isSurface ? 2.5 : 6 } }, - { x: entry.values?.x.slice(-1) ?? [], y: entry.values?.y.slice(-1) ?? [], z: isSurface ? entry.values?.z?.slice(-1) ?? [] : undefined, - type: isSurface ? "scatter3d" as const : "scatter" as const, mode: "markers" as const, - name: `${index + 1}. ${entry.settings.algorithm}`, legendgroup: String(entry.id), showlegend: false, - marker: { color: entry.color, size: isSurface ? 4 : 12, line: { color: "white", width: isSurface ? 1 : 2 } } } - ] : []); - // data - let x: number[] = data.functionValues ? data.functionValues.x : []; - let y: number[] = data.functionValues ? data.functionValues.y : []; - let z: number[][] = data.functionValues && data.functionValues.z ? data.functionValues.z : []; - let gradientX: number[][] = data.functionValues?.gradientX ?? []; - let gradientY: number[][] = data.functionValues?.gradientY ?? []; - - console.log('gradientX', gradientX) - console.log('gradientY', gradientY) - - - let trajX: number[] = data.trajectoryValues ? data.trajectoryValues.x : []; - let trajY: number[] = data.trajectoryValues ? data.trajectoryValues.y : []; - let trajZ: number[] = data.trajectoryValues && data.trajectoryValues.z ? data.trajectoryValues.z : []; - - const colorScaleRange = useMemo<[number, number] | null>(() => { - if (z.length === 0) return null; - - let zMin = Infinity; - let zMax = -Infinity; - for (const row of z) { - for (const value of row) { - if (!Number.isFinite(value)) continue; - zMin = Math.min(zMin, value); - zMax = Math.max(zMax, value); - } - } - - if (!Number.isFinite(zMin) || !Number.isFinite(zMax)) return null; - const padding = zMax === zMin ? Math.max(Math.abs(zMin) * 0.1, 1) : (zMax - zMin) * 0.1; - return [zMin - padding, zMax + padding]; - }, [z]); - - const gradientField = useMemo(() => { - const emptyField = { - shaftX: [] as (number | null)[], - shaftY: [] as (number | null)[], - headX: [] as number[], - headY: [] as number[], - headAngles: [] as number[], - hoverData: [] as number[][], - }; - if ( - !showGradientField - || gradientX.length !== y.length - || gradientY.length !== y.length - || x.length === 0 - || y.length === 0 - ) return emptyField; - - const rowStep = 5 //Math.max(1, Math.ceil(y.length / 10)); - const columnStep = 5 //Math.max(1, Math.ceil(x.length / 10)); - const shaftX: (number | null)[] = []; - const shaftY: (number | null)[] = []; - const headX: number[] = []; - const headY: number[] = []; - const headAngles: number[] = []; - const hoverData: number[][] = []; - - const gradientLengths: number[] = []; - - for (let row = 0; row < gradientX.length; row++) { - for (let column = 0; column < gradientX[row].length; column++) { - const gx = gradientX[row][column]; - const gy = gradientY[row][column]; - - const length = Math.hypot(gx, gy); - - if (Number.isFinite(length)) { - gradientLengths.push(length); - } - } - } - - const averageGradientLength = gradientLengths.length > 0 ? - gradientLengths.reduce((sum, length) => sum + length, 0) / gradientLengths.length - : 0; - - console.log('average_grad_length', averageGradientLength); - console.log('cell diagonal', Math.hypot(x[columnStep]-x[0], y[rowStep]-y[0])); - const grad_scale = 1.8*averageGradientLength / Math.hypot(x[columnStep]-x[0], y[rowStep]-y[0]); - console.log('grad_scale', grad_scale); - - for (let row = 0; row < y.length; row += rowStep) { - if (!gradientX[row] || !gradientY[row]) continue; - for (let column = 0; column < x.length; column += columnStep) { - const gx = gradientX[row][column]; - const gy = gradientY[row][column]; - const magnitude = Math.hypot(gx, gy); - if (!Number.isFinite(magnitude) || magnitude === 0) continue; - - const vx = gx / grad_scale; - const vy = gy / grad_scale; - const arrowX = x[column] + vx; - const arrowY = y[row] + vy; - shaftX.push(x[column], arrowX, null); - shaftY.push(y[row], arrowY, null); - headX.push(arrowX); - headY.push(arrowY); - // Plotly marker angles rotate clockwise from the upward direction. - headAngles.push(Math.atan2(vx, vy) * 180 / Math.PI); - hoverData.push([x[column], y[row], gx, gy]); - } - } - - return { shaftX, shaftY, headX, headY, headAngles, hoverData }; - }, [showGradientField, x, y, gradientX, gradientY]); - - const plotRef = useRef(null); - const layoutRef = useRef({ - dragmode: 'pan', - showlegend: false, - xaxis: { - title: { text: 'x' }, - range: xlim, - }, - yaxis: { - title: { text: 'y' }, - range: ylim, - }, - margin: { t: 40, r: 40, b: 40, l: 40 } - }) - - const hasNoData = !data.functionValues && !data.trajectoryValues; - - function zoomSurfaceAxes(event: React.WheelEvent) { - event.preventDefault(); - const factor = event.deltaY > 0 ? 1.2 : 1 / 1.2; - const resizeRange = (range: [number, number]): [number, number] => { - const center = (range[0] + range[1]) / 2; - const halfWidth = (range[1] - range[0]) * factor / 2; - return [center - halfWidth, center + halfWidth]; - }; - setAxisLimits(resizeRange(xlim), resizeRange(ylim)); - } - - if (isLoading && hasNoData) { - return ( - -
    -
    Loading...
    -
    -
    - ); - } - - if (z.length === 0) { - return ( - - { - const x0 = event['xaxis.range[0]']; - const x1 = event['xaxis.range[1]']; - const y0 = event['yaxis.range[0]']; - const y1 = event['yaxis.range[1]']; - - if ( - typeof x0 === "number" - && typeof x1 === "number" - && typeof y0 === "number" - && typeof y1 === "number" - ) { - setAxisLimits([x0, x1], [y0, y1]); - } - }} - data={[ - { - x: x, - y: y, - type: 'scatter', - mode: 'lines', - line: { color: '#1f77b4', width: 2 }, - hoverinfo: "skip", - showlegend: false, - }, - { - x: trajX, - y: trajY, - type: 'scatter', - mode: 'lines+markers', - line: { color: '#d97871', width: 2 }, - marker: { color: '#d97871', size: 10 }, - hoverinfo: "skip", - showlegend: false, - }, - { - x: trajX[currentIteration] !== undefined ? [trajX[currentIteration]] : [], - y: trajY[currentIteration] !== undefined ? [trajY[currentIteration]] : [], - type: 'scatter', - mode: 'markers', - marker: { color: 'red', size: 12 }, - hoverinfo: "skip", - showlegend: false, - } - ,...comparisonTraces - ]} - layout={{ ...layoutRef.current, showlegend: comparisons !== undefined, legend: { x: 0.02, y: 0.98, xanchor: "left", yanchor: "top", bgcolor: "rgba(255,255,255,0.75)" } }} - style={{ width: '100%', height: '100%' }} - config={{ - responsive: true, - displayModeBar: true, - scrollZoom: true, - }} - /> - - ); - } else { - if (isSurface) { - return ( -
    - - y: %{y:.5g}
    z: %{z:.5g}', - }, - { - x: trajX, y: trajY, z: trajZ, - type: 'scatter3d', mode: 'lines+markers', - line: { color: '#d97871', width: 6 }, - marker: { color: '#d97871', size: 2.5 }, - hoverinfo: 'skip', showlegend: false, - }, - { - x: trajX[currentIteration] !== undefined ? [trajX[currentIteration]] : [], - y: trajY[currentIteration] !== undefined ? [trajY[currentIteration]] : [], - z: trajZ[currentIteration] !== undefined ? [trajZ[currentIteration]] : [], - type: 'scatter3d', mode: 'markers', - marker: { color: 'red', size: 7 }, - hoverinfo: 'skip', showlegend: false, - }, - ...comparisonTraces, - ]} - layout={{ - // Keep the user's camera angle while animation updates the trajectory data. - uirevision: 'bivariate-surface', - dragmode: 'orbit', - showlegend: comparisons !== undefined, - legend: { x: 0.02, y: 0.98, xanchor: 'left', yanchor: 'top', bgcolor: 'rgba(255,255,255,0.75)' }, - scene: { - aspectmode: 'cube', - xaxis: { title: { text: 'x' }, range: xlim, autorange: false }, - yaxis: { title: { text: 'y' }, range: ylim, autorange: false }, - zaxis: { title: { text: 'z' }, range: colorScaleRange ?? undefined, autorange: false }, - }, - margin: { t: 30, r: 20, b: 20, l: 20 }, - }} - style={{ width: '100%', height: '100%' }} - config={{ responsive: true, displayModeBar: true, scrollZoom: false }} - /> -
    -
    - ); - } - - return ( - - { - const x0 = event['xaxis.range[0]']; - const x1 = event['xaxis.range[1]']; - const y0 = event['yaxis.range[0]']; - const y1 = event['yaxis.range[1]']; - - if ( - typeof x0 === "number" - && typeof x1 === "number" - && typeof y0 === "number" - && typeof y1 === "number" - ) { - setAxisLimits([x0, x1], [y0, y1]); - } - }} - data={[ - { - x: x, - y: y, - z: z, - zmin: colorScaleRange?.[0], - zmax: colorScaleRange?.[1], - type: 'contour', - colorscale: 'Viridis', - hoverinfo: "skip", - showlegend: false, - contours: { - coloring: "heatmap", - showlines: false, - } - }, - { - x: gradientField.shaftX, - y: gradientField.shaftY, - type: 'scatter', - mode: 'lines', - line: { color: 'rgba(255, 255, 255, 0.8)', width: 1 }, - hoverinfo: 'skip', - showlegend: false, - cliponaxis: true, - }, - { - x: gradientField.headX, - y: gradientField.headY, - customdata: gradientField.hoverData, - type: 'scatter', - mode: 'markers', - marker: { - symbol: 'triangle-up', - size: 5, - color: 'rgba(255, 255, 255, 0.8)', - angle: gradientField.headAngles, - angleref: 'up', - } as any, - hovertemplate: - 'x: %{customdata[0]:.5g}
    ' - + 'y: %{customdata[1]:.5g}
    ' - + 'gx: %{customdata[2]:.5g}
    ' - + 'gy: %{customdata[3]:.5g}', - showlegend: false, - cliponaxis: true, - }, - { - x: trajX, - y: trajY, - customdata: trajZ, - type: 'scatter', - mode: 'lines+markers', - line: { color: '#d97871', width: 2 }, - marker: { color: '#d97871', size: 10 }, - hovertemplate: 'x: %{x:.5g}
    y: %{y:.5g}
    f(x, y): %{customdata:.5g}', - showlegend: false, - }, - { - x: trajX[currentIteration] !== undefined ? [trajX[currentIteration]] : [], - y: trajY[currentIteration] !== undefined ? [trajY[currentIteration]] : [], - customdata: trajZ[currentIteration] !== undefined ? [trajZ[currentIteration]] : [], - type: 'scatter', - mode: 'markers', - marker: { color: 'red', size: 12 }, - hovertemplate: 'x: %{x:.5g}
    y: %{y:.5g}
    f(x, y): %{customdata:.5g}', - showlegend: false, - } - ,...comparisonTraces - ]} - layout={{ ...layoutRef.current, annotations: [], showlegend: comparisons !== undefined, legend: { x: 0.02, y: 0.98, xanchor: "left", yanchor: "top", bgcolor: "rgba(255,255,255,0.75)" } }} - style={{ width: '100%', height: '100%' }} - config={{ - responsive: true, - displayModeBar: true, - scrollZoom: true, - }} - /> -
    - ); - } -} diff --git a/frontends/react/src/RunSummary.tsx b/frontends/react/src/RunSummary.tsx new file mode 100644 index 0000000000000000000000000000000000000000..b3afd764e83a6ac2da18ad9e69c9d65a59e21a27 --- /dev/null +++ b/frontends/react/src/RunSummary.tsx @@ -0,0 +1,53 @@ +import { themeColor, useTheme } from "@elvis/ui"; + +import type { Trajectory } from "./useOptimisation"; + +// 3 significant figures; very small or large values in scientific notation +function format(v: number): string { + const a = Math.abs(v); + return a !== 0 && (a < 1e-3 || a >= 1e5) ? v.toExponential(2) : String(Number(v.toPrecision(3))); +} + +// How far the latest iteration moved, ‖xₖ − xₖ₋₁‖; null before the first step +function lastStep(t: Trajectory): number | null { + const n = t.path.length; + if (n < 2) { + return null; + } + const [a, b] = [t.path[n - 2].position, t.path[n - 1].position]; + return Math.hypot(...b.map((x, i) => x - a[i])); +} + +// One row per optimiser: its latest f and how far its latest step moved +export default function RunSummary({ trajectories }: { trajectories: Trajectory[] }) { + const theme = useTheme(); + return ( + + + + + + + + + + {trajectories.map((t) => { + const last = t.path[t.path.length - 1]; + const step = lastStep(t); + return ( + + + + + + ); + })} + +
    OptimiserfLast step ‖Δx‖
    + + + {t.label} + + {last ? format(last.value) : "–"}{step === null ? "–" : format(step)}
    + ); +} diff --git a/frontends/react/src/Sidebar.tsx b/frontends/react/src/Sidebar.tsx deleted file mode 100644 index 1b085ee07a489cec3e93b1ac103bbaf57c87b669..0000000000000000000000000000000000000000 --- a/frontends/react/src/Sidebar.tsx +++ /dev/null @@ -1,383 +0,0 @@ -import type { ReactNode } from "react"; -import AlgorithmControls from "./AlgorithmControls"; -import { useCallback, useEffect, useRef, useState } from "react"; -import ReactMarkdown from "react-markdown"; -import { InputField, Tabs, Card } from "@elvis/ui"; -import { type SettingsUi, type TrajectoryValues } from "./types.ts"; -import usageMarkdown from "./usage.md?raw"; -import IterationHistoryPlot from "./IterationHistoryPlot.tsx"; - - -const UNIVARIATE_FUNCTION_OPTIONS = { - "--Custom--": "x^2", - "Quadratic": "x^2", - "Local Minima": "x^2 - 0.1cos(20x)", - "Plateau": "x^4", -} - -const BIVARIATE_FUNCTION_OPTIONS = { - "--Custom--": "x^2 + 3y^2", - "Quadratic": "x^2 + 3y^2", - "Small": "(0.05x)^2 + 3(0.05y)^2", - "Ackley": "-20exp(-0.2 sqrt(0.5(x^2 + y^2))) - exp(0.5(cos(2 pi x) + cos(2 pi y))) + e + 20", - "Rasteringin": "20 + (x^2 - 10cos(2 pi x)) + (y^2 - 10cos(2 pi y))", - "Rosenbrock": "(1 - x)^2 + 100(y - x^2)^2", -} - - -interface SidebarProps { - comparison: ReactNode, - onTabChange: (tab: string) => void, - settings: SettingsUi, - setSettings: (settings: SettingsUi) => void, - onRandomInitialPoint: () => void, - trajectoryValues?: TrajectoryValues | null, - - onReset?: () => void, - onNextStep?: () => void, - onPrevStep?: () => void, - onAnimate?: () => void, - onPause?: () => void, - isAnimating?: boolean, - currentIteration: number, - totalIterations: number, - showGradientField: boolean, - onShowGradientFieldChange: (show: boolean) => void, -} - -export default function Sidebar({ - comparison, - onTabChange, - settings, - setSettings, - onRandomInitialPoint, - trajectoryValues, - onReset, - onNextStep, - onPrevStep, - onAnimate, - onPause, - isAnimating = false, - currentIteration, - totalIterations, - showGradientField, - onShowGradientFieldChange, -}: SidebarProps) { - const tabs = ["Settings", "Optimize", "Compare", "Usage"] as const; - const [activeTab, setActiveTab] = useState<(typeof tabs)[number]>("Settings"); - - const [functionOption, setFunctionOption] = useState("--Custom--"); - function updateSettings(key: keyof SettingsUi, value: string) { - setSettings({ ...settings, [key]: value }); - } - - function handleProblemSettingChange(value: string) { - const [mode, option] = value.split("::") as [SettingsUi["mode"], string]; - const selectedOption = option ?? "--Custom--"; - const expr = mode === "Bivariate" - ? BIVARIATE_FUNCTION_OPTIONS[selectedOption as keyof typeof BIVARIATE_FUNCTION_OPTIONS] - : UNIVARIATE_FUNCTION_OPTIONS[selectedOption as keyof typeof UNIVARIATE_FUNCTION_OPTIONS]; - - setFunctionOption(selectedOption); - setSettings({ ...settings, mode, functionExpr: expr }); - } - - function getCurrentValue(values?: T[] | null): T | null { - return values?.[currentIteration] ?? null; - } - - const currentX = getCurrentValue(trajectoryValues?.x); - const currentY = getCurrentValue(trajectoryValues?.y); - - // univariate only - const currentDerivative = getCurrentValue(trajectoryValues?.derivative); - const currentSecondDerivative = getCurrentValue(trajectoryValues?.secondDerivative); - - // bivariate only - const currentZ = getCurrentValue(trajectoryValues?.z); - const currentGradient = getCurrentValue(trajectoryValues?.gradient); - const currentHessian = getCurrentValue(trajectoryValues?.hessian); - - const holdIntervalRef = useRef(null); - - const stopHolding = useCallback(() => { - if (holdIntervalRef.current !== null) { - window.clearInterval(holdIntervalRef.current); - holdIntervalRef.current = null; - } - }, []); - - const startHolding = useCallback((action?: () => void) => { - if (!action || holdIntervalRef.current !== null) return; - action(); - holdIntervalRef.current = window.setInterval(action, 200); - }, []); - - useEffect(() => { - function handleKeyDown(event: KeyboardEvent) { - if (activeTab !== "Optimize") return; - const target = event.target as HTMLElement | null; - if (target?.matches("input, textarea, select, [contenteditable='true']")) return; - if (event.repeat) return; - if (event.key === "ArrowLeft") { - event.preventDefault(); - startHolding(onPrevStep); - } else if (event.key === "ArrowRight") { - event.preventDefault(); - startHolding(onNextStep); - } - } - - function handleKeyUp(event: KeyboardEvent) { - if (event.key === "ArrowLeft" || event.key === "ArrowRight") stopHolding(); - } - - window.addEventListener("keydown", handleKeyDown); - window.addEventListener("keyup", handleKeyUp); - window.addEventListener("blur", stopHolding); - return () => { - stopHolding(); - window.removeEventListener("keydown", handleKeyDown); - window.removeEventListener("keyup", handleKeyUp); - window.removeEventListener("blur", stopHolding); - }; - }, [activeTab, onNextStep, onPrevStep, startHolding, stopHolding]); - - return ( - -
    - { setActiveTab(tab); onTabChange(tab); }} /> -
    - - {/* Tab content */} -
    - {activeTab === "Settings" && ( - <> -
    - -
    - -
    -
    - updateSettings("functionExpr", value)} - readonly={functionOption !== "--Custom--"} - rows={3} - /> - - {settings.mode === "Bivariate" && ( -
    - Gradient field -
    - - -
    -
    - )} - - - - )} - - {activeTab === "Optimize" && ( - <> - -
    -
    - Current values - - Iteration {currentIteration} of {totalIterations} - -
    - { settings.mode === "Univariate" && ( - <> -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    - - )} - { settings.mode === "Bivariate" && ( - <> -
    - - -
    -
    - - -
    -
    - - v.toFixed(4)).join(", ")}]` : ""} - readOnly - className="w-full rounded border border-stone-300 bg-stone-50 px-2 py-1 text-sm" - /> -
    -
    - - `[${row.map(v => v.toFixed(4)).join(", ")}]`).join(", ")}]` : ""} - readOnly - className="w-full rounded border border-stone-300 bg-stone-50 px-2 py-1 text-sm" - /> -
    - - )} -
    -
    -
    - - - -
    -
    - - -
    -
    - - )} - - {activeTab === "Compare" && comparison} - - {activeTab === "Usage" && ( -

    {children}

    , - h2: ({ children }) =>

    {children}

    , - h3: ({ children }) =>

    {children}

    , - p: ({ children }) =>

    {children}

    , - ul: ({ children }) =>
      {children}
    , - ol: ({ children }) =>
      {children}
    , - li: ({ children }) =>
  • {children}
  • , - }} - > - {usageMarkdown} -
    - )} -
    -
    - ); -} diff --git a/frontends/react/src/Usage.tsx b/frontends/react/src/Usage.tsx new file mode 100644 index 0000000000000000000000000000000000000000..743b29c2a59379457229c8179f4a102b08f186c3 --- /dev/null +++ b/frontends/react/src/Usage.tsx @@ -0,0 +1,21 @@ +import ReactMarkdown from "react-markdown"; + +import usageMarkdown from "./usage.md?raw"; + +export default function Usage() { + return ( +
    +

    {children}

    , + p: ({ children }) =>

    {children}

    , + ol: ({ children }) =>
      {children}
    , + li: ({ children }) =>
  • {children}
  • , + code: ({ children }) => {children}, + }} + > + {usageMarkdown} +
    +
    + ); +} diff --git a/frontends/react/src/algorithms.ts b/frontends/react/src/algorithms.ts new file mode 100644 index 0000000000000000000000000000000000000000..58598a6e4cedd4b58cefac4cb9cfc320e294b51b --- /dev/null +++ b/frontends/react/src/algorithms.ts @@ -0,0 +1,11 @@ +import type { ModelSpec } from "@elvis/ui"; + +import spec from "../../../backend/src/algorithms.json"; + +// The optimisers, from the spec shared with the Python backend. JSON imports +// type "kind" as string, so the shape is checked by backend/tests instead. +export const ALGORITHMS = spec.algorithms as unknown as ModelSpec[]; + +export function algorithmById(id: string): ModelSpec { + return ALGORITHMS.find((a) => a.id === id) ?? ALGORITHMS[0]; +} diff --git a/frontends/react/src/colors.ts b/frontends/react/src/colors.ts new file mode 100644 index 0000000000000000000000000000000000000000..1b2e65b6bb7b39cd0b91bece5360567c8ea56faa --- /dev/null +++ b/frontends/react/src/colors.ts @@ -0,0 +1,15 @@ +// One colour per run, from the class colours in DESIGN.md (Okabe–Ito, Wine, +// Grey), ordered to stand out on the Viridis colour scale. Each new optimiser +// takes the first free one. Black is last: it is close to the f(x) curve. +export const RUN_COLORS = [ + { name: "Dark Orange", value: "#D55E00" }, + { name: "Pink", value: "#CC79A7" }, + { name: "Light Blue", value: "#56B4E9" }, + { name: "Light Orange", value: "#E69F00" }, + { name: "Wine", value: "#882255" }, + { name: "Green", value: "#009E73" }, + { name: "Grey", value: "#999999" }, + { name: "Dark Blue", value: "#0072B2" }, + { name: "Yellow", value: "#F0E442" }, + { name: "Black", value: "#000000" }, +]; diff --git a/frontends/react/src/contract.check.ts b/frontends/react/src/contract.check.ts new file mode 100644 index 0000000000000000000000000000000000000000..2e1e32a7437b4ee505ccbdc67ff73fa025c3c447 --- /dev/null +++ b/frontends/react/src/contract.check.ts @@ -0,0 +1,15 @@ +// Type-checks the contract examples (backend/contract/*.json) against +// OptimisationApi when tsc runs. Never imported by the app. +// The Python side is checked by backend/tests/test_contract.py. +import type { ContractExample } from "@elvis/pyodide"; + +import type { OptimisationApi } from "./python.ts"; +import gradientDescentQuadratic from "../../../backend/contract/gradient_descent_quadratic.json"; +import invalidFunction from "../../../backend/contract/invalid_function.json"; +import newtonSingularHessian from "../../../backend/contract/newton_singular_hessian.json"; +import pastTheEnd from "../../../backend/contract/past_the_end.json"; + +gradientDescentQuadratic satisfies ContractExample; +invalidFunction satisfies ContractExample; +newtonSingularHessian satisfies ContractExample; +pastTheEnd satisfies ContractExample; diff --git a/frontends/react/src/functions.ts b/frontends/react/src/functions.ts new file mode 100644 index 0000000000000000000000000000000000000000..b5da588dc1e1c8c6a4c6fc25bc20b5d8472fd719 --- /dev/null +++ b/frontends/react/src/functions.ts @@ -0,0 +1,38 @@ +import type { Range, Variables } from "./types"; + +export interface FunctionPreset { + name: string; + expression: string; + // The view it opens with (with one variable, y fits the curve), and where the runs start + x: Range; + y?: Range; + start: number[]; +} + +export const PRESETS: Record = { + 1: [ + { name: "Quadratic", expression: "x^2", x: [-1.5, 1.5], start: [1] }, + { name: "Local minima", expression: "x^2 - 0.1cos(20x)", x: [-1.5, 1.5], start: [1] }, + { name: "Plateau", expression: "x^4", x: [-1.5, 1.5], start: [1] }, + ], + 2: [ + { name: "Quadratic bowl", expression: "x^2 + 3y^2", x: [-1.5, 1.5], y: [-1.5, 1.5], start: [1, 1] }, + { name: "Small", expression: "(0.05x)^2 + 3(0.05y)^2", x: [-1.5, 1.5], y: [-1.5, 1.5], start: [1, 1] }, + { name: "Ackley", expression: "-20exp(-0.2 sqrt(0.5(x^2 + y^2))) - exp(0.5(cos(2 pi x) + cos(2 pi y))) + e + 20", x: [-4, 4], y: [-4, 4], start: [2.6, 1.7] }, + { name: "Rastrigin", expression: "20 + (x^2 - 10cos(2 pi x)) + (y^2 - 10cos(2 pi y))", x: [-5.12, 5.12], y: [-5.12, 5.12], start: [3.2, 2.1] }, + { name: "Rosenbrock", expression: "(1 - x)^2 + 100(y - x^2)^2", x: [-2, 2], y: [-1, 3], start: [-1.5, 2] }, + ], +}; + +export const ALL_PRESETS = [...PRESETS[1], ...PRESETS[2]]; + +export const CUSTOM = "Custom"; + +// The function names logic.py allows (ALLOWED_NAMES); none of them contain a y +const FUNCTION_NAMES = /asin|acos|atan|sin|cos|tan|sqrt|abs|exp|log|ln|pi/g; + +// 2 if the function uses y, else 1. Letters side by side multiply ("xy" is +// x·y), so any y left once the function names are removed counts. +export function detectVariables(expression: string): Variables { + return /y/.test(expression.replace(FUNCTION_NAMES, "")) ? 2 : 1; +} diff --git a/frontends/react/src/index.css b/frontends/react/src/index.css index 821e768c81b08f061c6fd71a91d24e70e6d03057..3cd2654267f6834109ac3306e6a4929fccab7397 100644 --- a/frontends/react/src/index.css +++ b/frontends/react/src/index.css @@ -1,16 +1,3 @@ @import "tailwindcss"; +@import "@elvis/ui/theme.css"; @source "../node_modules/@elvis/ui/dist"; - -.title { - font-size: 32px; - font-weight: bold; - /* background: #ffffff; */ -} - -.desc { -} - -.status { flex: none; display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.75); padding: 8px 12px; border-radius: 999px; } -.status span { width: 8px; height: 8px; border-radius: 50%; background: #d69b25; box-shadow: 0 0 0 4px #f8ebca; } -.status.ready span { background: #2c9b68; box-shadow: 0 0 0 4px #d9f0e5; }.status.error span { background: #c74848; box-shadow: 0 0 0 4px #f5dddd; } - diff --git a/frontends/react/src/pyodide.worker.ts b/frontends/react/src/pyodide.worker.ts index 950d1c752e2919a4a6ef251b0f6c55c31bf4257d..d078f61d0278e71026137d7aeaa4990b08a378e6 100644 --- a/frontends/react/src/pyodide.worker.ts +++ b/frontends/react/src/pyodide.worker.ts @@ -1,105 +1,10 @@ -const PYODIDE_URL = "https://cdn.jsdelivr.net/pyodide/v0.26.1/full/pyodide.mjs"; +import { exposePython } from "@elvis/pyodide/worker"; -// @ts-ignore -import managerCode from "../../../backend/src/optimization_manager.py?raw"; -import logicCode from "../../../backend/src/optimization_logic.py?raw"; -import type { WorkerMessage } from "./types"; +import managerCode from "../../../backend/src/manager.py?raw"; +import logicCode from "../../../backend/src/logic.py?raw"; +import algorithmsSpec from "../../../backend/src/algorithms.json?raw"; -let pyodide: any = null; -let manager: any = null; - -async function init() { - const { loadPyodide } = await import(/* @vite-ignore */ PYODIDE_URL); - - pyodide = await loadPyodide({ - indexURL: "https://cdn.jsdelivr.net/pyodide/v0.26.1/full/" - }); - - await pyodide.loadPackage(["numpy", "sympy"]); - - pyodide.FS.writeFile("optimization_logic.py", logicCode); - pyodide.FS.writeFile("optimization_manager.py", managerCode); - - pyodide.runPython(`from optimization_manager import OptimizationManager; manager = OptimizationManager();`); - - manager = pyodide.globals.get("manager"); - - if (!manager) { - console.error("Failed to initialize optimization manager"); - } - - self.postMessage({ type: "READY" }); -} - -function handlePythonResult(result: any) { - if (!result) { - return null; - } - - try { - const data = result.toJs({ dict_converter: Object.fromEntries }); - - if (result.destroy) { - result.destroy(); - } - - self.postMessage({ type: "RESULT", data: data }); - } catch (error) { - console.error("Error handling Python result:", error); - } -} - -self.onmessage = async (event) => { - const message = event.data as WorkerMessage; - - if (!manager) { - console.warn("Pyodide is not ready yet"); - return; - } - - switch (message.type) { - case "COMPARE": { - const trajectories = message.settings.map((settings, index) => { - const managerClass = pyodide.globals.get("OptimizationManager"); - const comparisonManager = managerClass(); - managerClass.destroy(); - const pythonSettings = pyodide.toPy(settings); - try { - comparisonManager.handle_update_settings(pythonSettings)?.destroy(); - comparisonManager._compute_trajectory_values(pythonSettings, message.iteration + 1); - const values = comparisonManager.trajectory_values; - try { - return { id: message.ids[index], values: values.toJs({ dict_converter: Object.fromEntries }) }; - } finally { values.destroy(); } - } catch (error) { - return { id: message.ids[index], values: { x: [], y: [] }, error: String(error) }; - } finally { - pythonSettings.destroy(); - comparisonManager.destroy(); - } - }); - self.postMessage({ type: "COMPARISON_RESULT", requestId: message.requestId, trajectories }); - break; - } - case "INIT": - const pythonSettings = pyodide.toPy(message.settings); - handlePythonResult(manager.handle_update_settings(pythonSettings)); - break; - case "NEXT_STEP": - handlePythonResult(manager.handle_next_step()); - break; - case "PREV_STEP": - handlePythonResult(manager.handle_prev_step()); - break; - case "RESET": - handlePythonResult(manager.handle_reset()); - break; - default: - console.error("Unknown message type:", message); - break; - - } -} - -// Start of execution -init(); +exposePython({ + packages: ["numpy", "sympy"], + files: { "manager.py": managerCode, "logic.py": logicCode, "algorithms.json": algorithmsSpec }, +}); diff --git a/frontends/react/src/python.ts b/frontends/react/src/python.ts new file mode 100644 index 0000000000000000000000000000000000000000..9f13929a4089ba07fd915f6c928e60900a8765df --- /dev/null +++ b/frontends/react/src/python.ts @@ -0,0 +1,18 @@ +import { createPython } from "@elvis/pyodide"; + +import type { FunctionValues, RunSettings, State } from "./types"; + +// The methods of backend/src/manager.py's Manager +export type OptimisationApi = { + // variables is 1 or 2; clears the runs + handle_set_function: { args: { variables: number; expression: string }; result: null }; + // null when no function is set + handle_function_values: { args: { x_range: number[]; y_range: number[] }; result: FunctionValues | null }; + handle_set_runs: { args: { runs: RunSettings[] }; result: null }; + // null once every run has stopped (or there are none) + handle_state: { args: { iteration: number }; result: State | null }; +}; + +export const python = createPython( + new Worker(new URL("./pyodide.worker.ts", import.meta.url), { type: "module" }), +); diff --git a/frontends/react/src/types.ts b/frontends/react/src/types.ts index 2df314cbeba6c58633685b47828dbc0dd741edb5..519e0b2cd8c1609e915f9a30c10f29cec87402e1 100644 --- a/frontends/react/src/types.ts +++ b/frontends/react/src/types.ts @@ -1,80 +1,51 @@ -export interface Settings { - mode: "Univariate" | "Bivariate"; - functionExpr: string; - algorithm: "Gradient Descent" | "Nesterov" | "Newton" | "Adam" | "Adagrad" | "RMSProp" | "Adadelta"; +import type { ParamValue } from "@elvis/ui"; - // plot axis limits - xlim: [number, number]; - ylim: [number, number]; +// 1 for f(x), 2 for f(x, y) +export type Variables = 1 | 2; - x0: string; - y0?: string; // Only for Bivariate +export type Range = [number, number]; - // Gradient descent / Nesterov hyperparameters - learningRate?: string; - momentum?: string; - - // Adam hyperparameters - beta1?: string; - beta2?: string; +// One optimiser to run: an id from backend/src/algorithms.json +export interface RunSettings { + algorithm: string; + // One coordinate per variable + start: number[]; + // Setting name -> value; missing settings use their defaults + params: Record; +} - // Various algorithm hyperparameters - beta?: string; - epsilon?: string; +// A point on a trajectory, with f and its derivatives there +export interface Point { + position: number[]; + value: number; + gradient: number[]; + hessian: number[][]; } -export type SettingsUi = Omit; +export interface RunState { + // null once the run has stopped; stopped then says why + point: Point | null; + stopped: string | null; +} -export type BivariatePlotView = "Contour heatmap" | "Function surface"; +// Every run after some number of iterations +export interface State { + runs: RunState[]; +} -export type PlotValues = { +// f sampled for the plot; null where f has no finite value +export interface CurveValues { x: number[]; - y: number[]; - z?: number[][]; - gradientX?: number[][]; - gradientY?: number[][]; + f: (number | null)[]; } -export type TrajectoryValues = { +export interface SurfaceValues { x: number[]; y: number[]; - - // univariate only - derivative?: number[]; - secondDerivative?: number[]; - - // bivariate only - z?: number[]; - gradient?: number[][]; - hessian?: number[][][]; -} - -export type PlotData = { - functionValues?: PlotValues; - trajectoryValues?: TrajectoryValues; + // Rows follow y, columns follow x + f: (number | null)[][]; + // The gradient at a coarser grid of points + arrows: { x: number[]; y: number[]; u: (number | null)[]; v: (number | null)[] }; } -export const SUPPORTED_MODES = ["Univariate", "Bivariate"] as const; - -export const SUPPORTED_ALGORITHMS = [ - "Gradient Descent", - "Nesterov", - "Newton", - "Adam", - "Adagrad", - "RMSProp", - "Adadelta" -] as const; - -export type WorkerMessage = - | { type: "COMPARE"; requestId: number; settings: Settings[]; ids: number[]; iteration: number } - | { type: "COMPARISON_RESULT"; requestId: number; trajectories: ComparisonTrajectory[] } - | { type: "READY" } - | { type: "RESULT"; data: PlotData } - | { type: "INIT"; settings: Settings } - | { type: "NEXT_STEP" } - | { type: "PREV_STEP" } - | { type: "RESET" }; - -export type ComparisonEntry = { id: number; settings: SettingsUi; color: string; visible: boolean }; -export type ComparisonTrajectory = { id: number; values: TrajectoryValues; error?: string }; +export type FunctionValues = CurveValues | SurfaceValues; diff --git a/frontends/react/src/usage.md b/frontends/react/src/usage.md index f86b12f5dc93e009e6a57694569bf0da8da728f9..526fa65c3494be890eed0206f639eb46786b80d8 100644 --- a/frontends/react/src/usage.md +++ b/frontends/react/src/usage.md @@ -1,34 +1,20 @@ -This visualizer allows you to define a function and minimize it using one of several iterative optimization algorithms. +Watch optimisers walk downhill on a function you choose, one iteration at a time, side by side. -## Settings +## Steps -In this tab, you can: +1. **Function** (Configure tab): pick a univariate f(x) or bivariate f(x, y) function from the list, or type your own in the box, e.g. `x^4 - 2x^2 + 0.3x` or `sin(x) cos(y)`. A function that uses `y` has two variables. You can use `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `exp`, `log` (or `ln`), `sqrt`, `abs`, `pi` and `e`; `2x` means `2*x`. +2. **Optimisers:** each optimiser is a card with its colour, name and latest f. The name is its algorithm's until you type your own: click it to rename (the plot legend uses it; clear it to go back), or click the rest of the card to open it, then pick an algorithm and change its settings in the boxes below it, e.g. η, the learning rate. Hover over a box for its name, or press ⓘ for every setting with a description. The reset arrow beside it puts the settings back to their defaults. +3. **Initial point:** type it, click on the plot (this moves the open optimiser's point), or press the dice for a random one. The reset arrow beside it goes back to the function's usual initial point. +4. **Step** (bottom of the panel, in every tab): press Play, or step forward and back. Type a number in the **×** box to move several iterations per step; each one is shown in turn. -- Select a preset function to optimize -- Or choose **--Custom--** to define your own function +Press **+ Add optimiser** for another one on the same function, starting from a random point; every optimiser steps together, from the start again after a change. Click an optimiser's colour to pick another, or × to remove it. Hover over a point on a path to see f there and its derivatives: f′ and f″, or the gradient ∇f and the Hessian ∇²f. -When entering a custom function: +The **Metrics** tab has a summary row per optimiser (its latest f, and how far its latest step moved, ‖Δx‖) and charts of f and of the gradient size ‖∇f‖ at each iteration, one line per optimiser. ‖∇f‖ is on a log scale, so steady convergence shows as a straight line. A run stops after 1000 iterations, or earlier if it diverges. -- Use **`x`** for univariate functions -- Use **`x`** and **`y`** for bivariate functions +## Two variables -## Optimize +The plot is a contour map of f, coloured from low (purple) to high (yellow). Above the plot, tick **Gradient field** to draw ∇f as arrows (contour only); they point uphill, so the optimiser moves against them. **Surface** (also above the plot) shows f in 3D; drag to turn it. -In this tab, you can: +## Plot -- Step through the optimization process -- See the optimizer’s trajectory - -## Plot Screen - -The plot is interactive: - -- Click and drag to pan -- Scroll to zoom - - -## Compare algorithms - -Open **Compare** after **Optimize**. Choose an algorithm, configure its initial point and parameters, and click **Add**. Repeat to compare different algorithms or parameter choices. Each entry has a matching trajectory color and can be removed. - -**Animate** advances all selected algorithms together. **Pause** stops playback; **Previous** and **Next** step through iterations; **Reset** returns to the initial points. Adding an algorithm restarts the comparison at iteration zero. Each added algorithm keeps its own initial point, shown in the selected algorithms list. The objective is shared with Settings. Changing the objective or the initial point in Settings restarts the comparison while preserving each algorithm’s configured initial point. +Drag to pan and scroll to zoom. The function is redrawn for the new view. diff --git a/frontends/react/src/useApi.ts b/frontends/react/src/useApi.ts deleted file mode 100644 index 29015485c6a917699a5254957e6293872970341e..0000000000000000000000000000000000000000 --- a/frontends/react/src/useApi.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { useState, useRef, useEffect } from "react"; -import WebSocketApi from "./websocket.ts"; -import type { PlotData, Settings } from "./types.ts"; - -export default function useApi(url: string) { - const api = useRef(new WebSocketApi()); - const [plotData, setPlotData] = useState({}); - - api.current.onMessage( - (data: unknown) => { - // todo data validation / type - setPlotData((prevData) => ({ ...prevData, ...(data as PlotData) })); - } - ) - - useEffect(() => { - api.current.connect(url); - return () => api.current.disconnect(); - }, [url]); - - return { - plotData, - sendInit: (settings: Settings) => api.current.sendInit(settings), - sendReset: () => api.current.sendReset(), - sendNextStep: () => api.current.sendNextStep(), - sendPrevStep: () => api.current.sendPrevStep(), - sendPlay: () => api.current.sendPlay(), - sendPause: () => api.current.sendPause(), - onReconnect: (handler: () => void) => api.current.onReconnect(handler), - }; -} \ No newline at end of file diff --git a/frontends/react/src/useOptimisation.ts b/frontends/react/src/useOptimisation.ts new file mode 100644 index 0000000000000000000000000000000000000000..51f548d80278d560cafee112b4e9d57a0f38242d --- /dev/null +++ b/frontends/react/src/useOptimisation.ts @@ -0,0 +1,387 @@ +import { useCallback, useEffect, useRef, useState } from "react"; +import { usePythonStatus } from "@elvis/pyodide"; +import { useStepper, type ParamValue } from "@elvis/ui"; + +import { ALGORITHMS } from "./algorithms"; +import { RUN_COLORS } from "./colors"; +import { ALL_PRESETS, detectVariables, PRESETS, type FunctionPreset } from "./functions"; +import { python } from "./python"; +import type { FunctionValues, Point, Range, RunSettings, State, Variables } from "./types"; + +// After typing stops, wait this long before rerunning +const TYPING_DELAY_MS = 500; +const STEP_INTERVAL_MS = 200; +// Wait this long after the view stops changing before redrawing the function +const VIEW_DEBOUNCE_MS = 150; +// Optimisers shown at once, one per colour +export const MAX_RUNS = RUN_COLORS.length; + +// A run Python is stepping +export interface Run { + id: number; + settings: RunSettings; + color: string; + label: string; +} + +// A run's points up to the stepper's iteration +export interface Trajectory extends Run { + path: Point[]; + // Why it ended, once it has + stopped: string | null; +} + +// The size of the gradient at a point +export const gradientNorm = (p: Point) => Math.hypot(...p.gradient); + +// The range covering the finite values, with 10% padding on each side +function paddedRange(values: (number | null)[]): Range | null { + const finite = values.filter((v): v is number => v !== null && Number.isFinite(v)); + if (finite.length === 0) { + return null; + } + const min = Math.min(...finite); + const max = Math.max(...finite); + const pad = max > min ? 0.1 * (max - min) : 1; + return [min - pad, max + pad]; +} + +// A coordinate picked on the plot, to about 3 significant figures of the view +function roundTo([a, b]: Range, value: number): string { + const decimals = Math.max(0, 2 - Math.floor(Math.log10(Math.abs(b - a)))); + return String(Number(value.toFixed(decimals))); +} + +// A start somewhere in the middle 90% of the view, as typed text +function randomStartText(variables: Variables, x: Range, y: Range): string[] { + const pick = ([a, b]: Range) => a + (0.05 + 0.9 * Math.random()) * (b - a); + const px = roundTo(x, pick(x)); + return variables === 1 ? [px] : [px, roundTo(y, pick(y))]; +} + +// One optimiser's settings as the student edits them, with the start kept as typed +interface RunDraft { + algorithm: string; + params: Record; + startText: string[]; +} + +// An optimiser in the list: its own settings, a fixed number, a colour and the +// name the student typed ("" to use its algorithm's name) +export interface Optimiser extends RunDraft { + id: number; + color: string; + name: string; +} + +// The names as shown: what the student typed, else the algorithm's name, numbered +// from 2 when an earlier optimiser already has that automatic name +function shownNames(optimisers: Optimiser[]): string[] { + const seen = new Map(); + return optimisers.map((o) => { + const typed = o.name.trim(); + if (typed) { + return typed; + } + const base = ALGORITHMS.find((a) => a.id === o.algorithm)?.label ?? o.algorithm; + const n = (seen.get(base) ?? 0) + 1; + seen.set(base, n); + return n === 1 ? base : `${base} ${n}`; + }); +} + +function newDraft(startText: string[]): RunDraft { + return { algorithm: "gradient_descent", params: {}, startText }; +} + +// Edits one optimiser's draft through update; onTyping runs before typed changes +function makeEditor(draft: RunDraft, update: (change: (d: RunDraft) => RunDraft) => void, onTyping: () => void) { + const start = draft.startText.map((t) => (t.trim() === "" ? NaN : Number(t))); + const settings: RunSettings = { algorithm: draft.algorithm, start, params: draft.params }; + return { + algorithm: draft.algorithm, + params: draft.params, + startText: draft.startText, + startValid: start.every(Number.isFinite), + settings, + setStartText(startText: string[]) { + update((d) => ({ ...d, startText })); + }, + changeAlgorithm(algorithm: string) { + update((d) => ({ ...d, algorithm, params: {} })); + }, + changeParams(params: Record) { + onTyping(); + update((d) => ({ ...d, params })); + }, + changeStart(index: number, text: string) { + onTyping(); + update((d) => ({ ...d, startText: d.startText.map((t, i) => (i === index ? text : t)) })); + }, + }; +} + +export type RunEditor = ReturnType; + +export default function useOptimisation() { + const pythonStatus = usePythonStatus(python); + const first = PRESETS[1][0]; + + const [expression, setExpression] = useState(first.expression); + // 1 or 2, from whether the function uses y + const variables = detectVariables(expression); + // Stepped together; none of them leads + const [optimisers, setOptimisers] = useState(() => [ + { id: 1, color: RUN_COLORS[0].value, name: "", ...newDraft(first.start.map(String)) }, + ]); + // The next optimiser's number + const nextId = useRef(2); + const [surface, setSurface] = useState(false); + const [showArrows, setShowArrows] = useState(false); + + const [functionError, setFunctionError] = useState(null); + const [runError, setRunError] = useState(null); + const [values, setValues] = useState(null); + const [runs, setRuns] = useState([]); + + // The plot's view; changed by panning and zooming, or by picking a preset + const xRange = useRef(first.x); + const yRange = useRef([-1, 1]); + // With one variable, fit the y axis to the next curve + const fitY = useRef(true); + // Counts requests for the function's values, so only the newest is shown + const valuesRequest = useRef(0); + const viewTimer = useRef>(undefined); + // Delay before the next rerun: TYPING_DELAY_MS after a keystroke, else 0 + const delay = useRef(0); + const typing = () => { + delay.current = TYPING_DELAY_MS; + }; + // Every run reruns from iteration 0 as any of them is edited + const editors = optimisers.map((o) => + makeEditor(o, (change) => setOptimisers((os) => os.map((x) => (x.id === o.id ? { ...x, ...change(x) } : x))), typing), + ); + // The function Python has, as "variables\nexpression" + const appliedFunction = useRef(null); + // Bumped by each rerun, so older responses are ignored + const version = useRef(0); + // Every state fetched since the last rerun, by iteration + const states = useRef([]); + + const names = shownNames(optimisers); + const allRuns: Run[] = optimisers.map((o, i) => ({ + id: o.id, + settings: editors[i].settings, + color: o.color, + label: names[i], + })); + const allSettings = allRuns.map((run) => run.settings); + const allValid = editors.every((e) => e.startValid); + + const fetchState = useCallback(async (iteration: number) => { + const v = version.current; + const result = await python.call("handle_state", { iteration }); + if (!result.ok) { + throw new Error(result.error.message); + } + if (result.data && v === version.current) { + states.current[iteration] = result.data; + } + return result.data; + }, []); + const step = useStepper(fetchState, { intervalMs: STEP_INTERVAL_MS }); + const { stepper } = step; + + async function refreshValues() { + const request = ++valuesRequest.current; + const result = await python.call("handle_function_values", { x_range: xRange.current, y_range: yRange.current }); + // A newer view's values are on their way; these are out of date + if (request !== valuesRequest.current) { + return; + } + if (!result.ok) { + console.error(`Python ${result.error.kind} error: ${result.error.message}`); + return; + } + const data = result.data; + if (data && !("y" in data) && fitY.current) { + yRange.current = paddedRange(data.f) ?? yRange.current; + } + fitY.current = false; + setValues(data); + } + + // Send the function (if it changed) and the runs to Python, then step from 0 + async function apply(functionKey: string, next: Run[]) { + const v = ++version.current; + stepper.pause(); + if (functionKey !== appliedFunction.current) { + appliedFunction.current = null; + const result = await python.call("handle_set_function", { variables, expression }); + if (v !== version.current) { + return; + } + setFunctionError(result.ok ? null : result.error.message); + if (!result.ok) { + setValues(null); + setRuns([]); + states.current = []; + await stepper.restart(); + return; + } + appliedFunction.current = functionKey; + fitY.current = true; + await refreshValues(); + if (v !== version.current) { + return; + } + } + const result = await python.call("handle_set_runs", { runs: next.map((run) => run.settings) }); + if (v !== version.current) { + return; + } + setRunError(result.ok ? null : result.error.message); + states.current = []; + setRuns(result.ok ? next : []); + await stepper.restart(); + } + + const functionKey = `${variables}\n${expression}`; + const settingsKey = JSON.stringify(allSettings); + useEffect(() => { + if (!allValid) { + return; + } + const timer = setTimeout(() => apply(functionKey, allRuns), delay.current); + return () => clearTimeout(timer); + // apply reads the latest state itself; rerun only when the settings change + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [functionKey, settingsKey]); + // A keystroke's pause is for the rerun it causes, if any (typing 0.10 over 0.1 + // causes none), so clear it after every render; runs after the effect above + useEffect(() => { + delay.current = 0; + }); + + // A new function, typed or from a preset (which also sets the view and start) + function setFunction(next: string, preset?: FunctionPreset) { + const n: Variables = detectVariables(next); + setExpression(next); + if (n !== variables) { + // Runs and plot data have the old number of coordinates + setRuns([]); + setValues(null); + if (!preset) { + // Keep x, start y at 0, and show y over the same range as x + const starts = (text: string[]) => (n === 2 ? [text[0], "0"] : [text[0]]); + setOptimisers((os) => os.map((o) => ({ ...o, startText: starts(o.startText) }))); + if (n === 2) { + yRange.current = xRange.current; + } + } + } + if (preset) { + // The first takes the preset's start; the rest are spread out so they don't overlap + const y = preset.y ?? yRange.current; + setOptimisers((os) => os.map((o, i) => ({ ...o, startText: i === 0 ? preset.start.map(String) : randomStartText(n, preset.x, y) }))); + xRange.current = preset.x; + if (preset.y) { + yRange.current = preset.y; + } + } + } + + function choosePreset(preset: FunctionPreset) { + setFunction(preset.expression, preset); + } + + function changeExpression(text: string) { + delay.current = TYPING_DELAY_MS; + setFunction(text); + } + + function startAt(editor: RunEditor, x: number, y: number) { + editor.setStartText(variables === 1 ? [roundTo(xRange.current, x)] : [roundTo(xRange.current, x), roundTo(yRange.current, y)]); + } + + function randomStart(editor: RunEditor) { + editor.setStartText(randomStartText(variables, xRange.current, yRange.current)); + } + + // The preset's start, or for a typed function the first preset's + function defaultStart(): number[] { + return (ALL_PRESETS.find((p) => p.expression === expression) ?? PRESETS[variables][0]).start; + } + + function resetStart(editor: RunEditor) { + editor.setStartText(defaultStart().map(String)); + } + + // A new optimiser with default settings, a random start (so it doesn't sit on + // another) and the first free colour; returns its id + function addOptimiser(): number { + const used = new Set(optimisers.map((o) => o.color)); + const color = RUN_COLORS.find((c) => !used.has(c.value))?.value ?? RUN_COLORS[0].value; + const id = nextId.current++; + setOptimisers([...optimisers, { id, color, name: "", ...newDraft(randomStartText(variables, xRange.current, yRange.current)) }]); + return id; + } + + function removeOptimiser(id: number) { + const rest = optimisers.filter((o) => o.id !== id); + if (rest.length === 0) { + nextId.current = 1; + } + setOptimisers(rest); + } + + // Zooming fires many view changes; Python runs calls one at a time, so only + // ask for the grid once the view has been still for a moment + function handleViewChange(x: Range, y: Range) { + xRange.current = x; + yRange.current = y; + clearTimeout(viewTimer.current); + viewTimer.current = setTimeout(refreshValues, VIEW_DEBOUNCE_MS); + } + + const shown = states.current.slice(0, step.iteration + 1); + const trajectories: Trajectory[] = runs.map((run, r) => { + // A colour or name changed since the last rerun applies straight away + const i = optimisers.findIndex((x) => x.id === run.id); + return { + ...run, + ...(i >= 0 && { color: optimisers[i].color, label: names[i] }), + path: shown.map((s) => s?.runs[r]?.point).filter((p): p is Point => !!p), + stopped: step.state?.runs[r]?.stopped ?? null, + }; + }); + + return { + pythonStatus, + variables, + expression, + changeExpression, + choosePreset, + functionError, + surface, + setSurface, + showArrows, + setShowArrows, + startAt, + randomStart, + resetStart, + runError, + optimisers: optimisers.map((o, i) => ({ id: o.id, color: o.color, name: o.name, shownName: names[i], editor: editors[i] })), + canAddOptimiser: optimisers.length < MAX_RUNS, + addOptimiser, + removeOptimiser, + setOptimiserColor: (id: number, color: string) => setOptimisers((os) => os.map((o) => (o.id === id ? { ...o, color } : o))), + setOptimiserName: (id: number, name: string) => setOptimisers((os) => os.map((o) => (o.id === id ? { ...o, name } : o))), + values, + xRange, + yRange, + handleViewChange, + trajectories, + step, + }; +} diff --git a/frontends/react/src/usePyodide.ts b/frontends/react/src/usePyodide.ts deleted file mode 100644 index 435c90915d2451c1b60f3d7b6248489f4ef2415d..0000000000000000000000000000000000000000 --- a/frontends/react/src/usePyodide.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { useCallback, useEffect, useRef, useState } from "react"; -import PyodideWorker from "./pyodide.worker.ts?worker"; -import type { ComparisonTrajectory, PlotData, Settings, WorkerMessage } from "./types.ts"; - - -export default function usePyodide(initialSettings: Settings) { - const [comparison, setComparison] = useState([]); - const [comparisonBusy, setComparisonBusy] = useState(false); - const comparisonRequest = useRef(0); - const compare = useCallback((settings: Settings[], ids: number[], iteration: number) => { - setComparisonBusy(true); - workerRef.current?.postMessage({ type: "COMPARE", requestId: ++comparisonRequest.current, settings, ids, iteration }); - }, []); - const [plotData, setPlotData] = useState({}); - const [currentIteration, setCurrentIteration] = useState(0); - const [isLoading, setIsLoading] = useState(true); - const workerRef = useRef(null); - const plotDataRef = useRef({}); - const currentIterationRef = useRef(0); - - function selectIteration(iteration: number) { - currentIterationRef.current = iteration; - setCurrentIteration(iteration); - } - - const sendInit = useCallback((settings: Settings) => { - if (workerRef.current) { - workerRef.current.postMessage({ type: "INIT", settings }); - } - }, []); - - const sendNextStep = useCallback(() => { - const lastPlottedIteration = Math.max((plotDataRef.current.trajectoryValues?.x.length ?? 1) - 1, 0); - if (currentIterationRef.current < lastPlottedIteration) { - selectIteration(currentIterationRef.current + 1); - return; - } - if (workerRef.current) { - workerRef.current.postMessage({ type: "NEXT_STEP" }); - } - }, []); - - const sendPrevStep = useCallback(() => { - selectIteration(Math.max(currentIterationRef.current - 1, 0)); - }, []); - - const sendReset = useCallback(() => { - selectIteration(0); - }, []); - - useEffect(() => { - const worker = new PyodideWorker(); - workerRef.current = worker; - - worker.onmessage = (event) => { - const message = event.data as WorkerMessage; - if (message.type === "COMPARISON_RESULT") { - if (message.requestId === comparisonRequest.current) { - setComparison(message.trajectories); - setComparisonBusy(false); - } - } else if (message.type === "READY") { - console.log("Pyodide is ready"); - setIsLoading(false); - sendInit(initialSettings); - } else if (message.type === "RESULT") { - // todo data validation / type - setPlotData((prevData) => { - const nextData = { - functionValues: message.data.functionValues || prevData.functionValues, - trajectoryValues: message.data.trajectoryValues || prevData.trajectoryValues, - }; - plotDataRef.current = nextData; - - if (message.data.trajectoryValues) { - const lastIteration = Math.max(message.data.trajectoryValues.x.length - 1, 0); - if (lastIteration <= 0 || lastIteration > currentIterationRef.current) { - selectIteration(lastIteration); - } - } - return nextData; - }); - } - }; - - return () => { - worker.terminate(); - }; - - }, []); - - return { - comparison, comparisonBusy, compare, - isLoading, - plotData, - currentIteration, - sendInit: sendInit, - sendReset: sendReset, - sendNextStep: sendNextStep, - sendPrevStep: sendPrevStep, - } -} diff --git a/frontends/react/src/websocket.ts b/frontends/react/src/websocket.ts deleted file mode 100644 index 704b815d1092e5a15f85ab0781866cda347e0249..0000000000000000000000000000000000000000 --- a/frontends/react/src/websocket.ts +++ /dev/null @@ -1,103 +0,0 @@ -import type { Settings } from "./types.ts"; - -type WebSocketMessage = - | { type: "init"; settings: Settings } - | { type: "reset" } - | { type: "next-step" } - | { type: "prev-step" } - | { type: "play" } - | { type: "pause" }; - -const RECONNECT_INTERVAL = 3000; // 3 seconds - -export default class WebSocketApi { - private socket: WebSocket | null = null; - private onMessageHandler: ((data: unknown) => void) | null = null; - private onReconnectHandler: (() => void) | null = null; - private pendingMessages: WebSocketMessage[] = []; - - connect(url: string) { - this.socket = new WebSocket(url); - this.socket.onopen = () => { - console.log("WebSocket connection established."); - - if (this.onReconnectHandler) { - this.onReconnectHandler(); - } - - for (const message of this.pendingMessages) { - this.sendMessage(message); - } - this.pendingMessages = []; - } - - this.socket.onclose = () => { - console.log("WebSocket connection closed - reconnecting..."); - setTimeout(() => { - this.connect(url); - }, RECONNECT_INTERVAL); - }; - - this.socket.onerror = (error) => { - console.error("WebSocket error:", error); - }; - - this.socket.onmessage = (event) => { - if (!this.onMessageHandler) return; - try { - const data = JSON.parse(event.data); - this.onMessageHandler(data); - } catch (parseError) { - console.error("WebSocket message parse error:", parseError); - } - }; - } - - disconnect() { - if (this.socket) { - this.socket.close(); - this.socket = null; - } - } - - sendInit(settings: Settings) { - this.sendMessage({ type: "init", settings }); - } - - sendReset() { - this.sendMessage({ type: "reset" }); - } - - sendNextStep() { - this.sendMessage({ type: "next-step" }); - } - - sendPrevStep() { - this.sendMessage({ type: "prev-step" }); - } - - sendPlay() { - this.sendMessage({ type: "play" }); - } - - sendPause() { - this.sendMessage({ type: "pause" }); - } - - onMessage(handler: (data: unknown) => void) { - this.onMessageHandler = handler; - } - - onReconnect(handler: () => void) { - this.onReconnectHandler = handler; - } - - private sendMessage(message: WebSocketMessage) { - if (this.socket?.readyState === WebSocket.OPEN) { - this.socket.send(JSON.stringify(message)); - } else { - console.log("WebSocket not connected, queuing message:", message); - this.pendingMessages.push(message); - } - } -} diff --git a/frontends/react/vite.config.ts b/frontends/react/vite.config.ts index 27e6ddd0a8d02c62951b013d25c2f8690f4f4e35..f570dca614f2b5a8c2577ce4615ae3d52a1d39c9 100644 --- a/frontends/react/vite.config.ts +++ b/frontends/react/vite.config.ts @@ -8,6 +8,16 @@ export default defineConfig({ react(), tailwindcss(), ], + // @elvis/ui is linked locally; use a single copy of its peer dependencies + resolve: { + dedupe: ["react", "react-dom", "lucide-react"], + }, + // Let the dev server read files (e.g. fonts) from elvis-code/packages + server: { + fs: { + allow: ["../../../.."], + }, + }, build: { outDir: "../../dist", emptyOutDir: true, diff --git a/old_code/README.md b/old_code/README.md deleted file mode 100644 index 61739abbd5a6700fe6d3960adc84e0fabc27531c..0000000000000000000000000000000000000000 --- a/old_code/README.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Optimization Trajectory -emoji: 🦀 -colorFrom: red -colorTo: purple -sdk: gradio -sdk_version: 5.46.0 -app_file: optimisation.py -pinned: false ---- - -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference diff --git a/old_code/bivariate.py b/old_code/bivariate.py deleted file mode 100644 index b91acef6d7531e98f9cdd89780521d6032144f6e..0000000000000000000000000000000000000000 --- a/old_code/bivariate.py +++ /dev/null @@ -1,603 +0,0 @@ -import io - -import gradio as gr -import matplotlib.colors as mcolors -import matplotlib.pyplot as plt -import numexpr -import numpy as np -from PIL import Image - -import logging -logging.basicConfig( - level=logging.INFO, # set minimum level to capture (DEBUG, INFO, WARNING, ERROR, CRITICAL) - format="%(asctime)s [%(levelname)s] %(message)s", # log format -) -logger = logging.getLogger("ELVIS") - -from optimisers import ( - get_gradient_2d, - get_hessian_2d, - get_gd_trajectory_2d, - get_nesterov_trajectory_2d, - get_adagrad_trajectory_2d, - get_rmsprop_trajectory_2d, - get_adadelta_trajectory_2d, - get_adam_trajectory_2d, - get_newton_trajectory_2d, -) - - -def format_gradient(xx, yy): - return f"[{xx}, {yy}]" - - -def format_hessian(xx, xy, yx, yy): - return f"[[{xx}, {xy}], [{yx}, {yy}]]" - - -class Bivariate: - DEFAULT_FUNCTION = "x**2 + 9 * y**2" - DEFAULT_INIT_X = 0.5 - DEFAULT_INIT_Y = 0.5 - - DEFAULT_OPTIMISER = "Gradient Descent" - DEFAULT_NUM_STEPS = 20 - DEFAULT_LEARNING_RATE = 0.1 - DEFAULT_MOMENTUM = 0 - - DEFAULT_EPS = 1e-8 - DEFAULT_RHO_RMSPROP = 0.99 - DEFAULT_RHO_ADADELTA = 0.9 - DEFAULT_EPS_ADADELTA = 1e-2 - DEFAULT_RHO1_ADAM = 0.9 - DEFAULT_RHO2_ADAM = 0.999 - - - def __init__(self, width=1200, height=900): - self.width = width - self.height = height - - self.function = self.DEFAULT_FUNCTION - self.initial_x = self.DEFAULT_INIT_X - self.initial_y = self.DEFAULT_INIT_Y - - # common optimisation hyperparameters - self.optimiser_type = self.DEFAULT_OPTIMISER - self.num_steps = self.DEFAULT_NUM_STEPS - self.learning_rate = self.DEFAULT_LEARNING_RATE - - # gradient descent and nesterov only - self.momentum = self.DEFAULT_MOMENTUM - - # adaptive gradients - self.rho_rmsprop = self.DEFAULT_RHO_RMSPROP - self.rho_adadelta = self.DEFAULT_RHO_ADADELTA - self.rho1_adam = self.DEFAULT_RHO1_ADAM - self.rho2_adam = self.DEFAULT_RHO2_ADAM - self.eps = self.DEFAULT_EPS - self.eps_adadelta = self.DEFAULT_EPS_ADADELTA - - self.trajectory_x, self.trajectory_y, self.trajectory_z = self.get_optimisation_trajectory() - self.trajectory_idx = 0 - self.plots = [] - self.generate_plots() - - def get_optimisation_trajectory(self): - if self.optimiser_type == "Gradient Descent": - return get_gd_trajectory_2d( - self.function, - self.initial_x, - self.initial_y, - self.learning_rate, - self.momentum, - self.num_steps, - ) - elif self.optimiser_type == "Nesterov": - return get_nesterov_trajectory_2d( - self.function, - self.initial_x, - self.initial_y, - self.learning_rate, - self.momentum, - self.num_steps, - ) - elif self.optimiser_type == "AdaGrad": - return get_adagrad_trajectory_2d( - self.function, - self.initial_x, - self.initial_y, - self.learning_rate, - self.eps, - self.num_steps, - ) - elif self.optimiser_type == "RMSProp": - return get_rmsprop_trajectory_2d( - self.function, - self.initial_x, - self.initial_y, - self.learning_rate, - self.rho_rmsprop, - self.eps, - self.num_steps, - ) - elif self.optimiser_type == "AdaDelta": - return get_adadelta_trajectory_2d( - self.function, - self.initial_x, - self.initial_y, - self.learning_rate, - self.rho_adadelta, - self.eps_adadelta, - self.num_steps, - ) - elif self.optimiser_type == "Adam": - return get_adam_trajectory_2d( - self.function, - self.initial_x, - self.initial_y, - self.learning_rate, - self.rho1_adam, - self.rho2_adam, - self.eps, - self.num_steps, - ) - elif self.optimiser_type == "Newton": - return get_newton_trajectory_2d( - self.function, - self.initial_x, - self.initial_y, - self.num_steps, - ) - else: - raise ValueError(f"Unknown optimiser type: {self.optimiser_type}") - - def generate_plots(self): - self.plots.clear() - - fig, ax = plt.subplots() - cbar = None - - # precompute for [-1, 1] domain - x = np.linspace(-1, 1, 100) - y = np.linspace(-1, 1, 100) - xx, yy = np.meshgrid(x, y) - - try: - zz = numexpr.evaluate(self.function, local_dict={'x': xx, 'y': yy}) - except Exception as e: - logger.error("Error evaluating function '%s': %s", function, e) - zz = np.zeros_like(xx) - - norm = mcolors.Normalize(vmin=zz.min(), vmax=zz.max()) - - for idx in range(self.num_steps): - x_radius = np.maximum(np.abs(np.min(self.trajectory_x[:idx + 1])), np.abs(np.max(self.trajectory_x[:idx + 1]))) - y_radius = np.maximum(np.abs(np.min(self.trajectory_y[:idx + 1])), np.abs(np.max(self.trajectory_y[:idx + 1]))) - radius = np.maximum(x_radius, y_radius) - - if radius > 1: - x = np.linspace(-1.2 * radius, 1.2 * radius, 100) - y = np.linspace(-1.2 * radius, 1.2 * radius, 100) - - xx, yy = np.meshgrid(x, y) - - try: - zz = numexpr.evaluate(self.function, local_dict={'x': xx, 'y': yy}) - except Exception as e: - logger.error("Error evaluating function '%s': %s", function, e) - zz = np.zeros_like(xx) - - ax.clear() - countour = ax.contourf(xx, yy, zz, levels=50, cmap='viridis', norm=norm) - ax.plot(self.trajectory_x[:idx + 1], self.trajectory_y[:idx + 1], marker='o', color='indianred') - ax.plot(self.trajectory_x[idx], self.trajectory_y[idx], marker='o', color='red') - - if cbar is None: - cbar = fig.colorbar(countour, ax=ax) - else: - cbar.update_normal(countour) - - ax.set_xlabel("x") - ax.set_ylabel("y") - cbar.set_label("f(x, y)") - - buf = io.BytesIO() - fig.savefig(buf, format="png", bbox_inches="tight", pad_inches=0) - plt.close(fig) - buf.seek(0) - img = Image.open(buf) - - self.plots.append(img) - - def update_plot(self): - plot = self.plots[self.trajectory_idx] - self.plot = plot - return plot - - def handle_trajectory_change(self): - self.trajectory_x, self.trajectory_y, self.trajectory_z = self.get_optimisation_trajectory() - self.trajectory_idx = 0 - self.generate_plots() - self.update_plot() - - def handle_slider_change(self, trajectory_idx): - self.trajectory_idx = trajectory_idx - return self.update_plot() - - def handle_trajectory_button(self): - if self.trajectory_idx < self.num_steps - 1: - self.trajectory_idx += 1 - # plot is updated from slider changing - return self.trajectory_idx - - def handle_function_change(self, function): - self.function = function - self.handle_trajectory_change() - - gradient = get_gradient_2d(function) - hessian = get_hessian_2d(function) - return format_gradient(*gradient), format_hessian(*hessian), self.trajectory_idx, self.plot - - def handle_learning_rate_change(self, learning_rate): - self.learning_rate = learning_rate - self.handle_trajectory_change() - return self.trajectory_idx, self.plot - - def handle_momentum_change(self, momentum): - self.momentum = momentum - self.handle_trajectory_change() - return self.trajectory_idx, self.plot - - def handle_rho_rmsprop_change(self, rho_rmsprop): - self.rho_rmsprop = rho_rmsprop - self.handle_trajectory_change() - return self.trajectory_idx, self.plot - - def handle_rho_adadelta_change(self, rho_adadelta): - self.rho_adadelta = rho_adadelta - self.handle_trajectory_change() - return self.trajectory_idx, self.plot - - def handle_rho1_adam_change(self, rho1_adam): - self.rho1_adam = rho1_adam - self.handle_trajectory_change() - return self.trajectory_idx, self.plot - - def handle_rho2_adam_change(self, rho2_adam): - self.rho2_adam = rho2_adam - self.handle_trajectory_change() - return self.trajectory_idx, self.plot - - def handle_eps_change(self, eps): - self.eps = eps - self.handle_trajectory_change() - return self.trajectory_idx, self.plot - - def handle_eps_adadelta_change(self, eps_adadelta): - self.eps_adadelta = eps_adadelta - self.handle_trajectory_change() - return self.trajectory_idx, self.plot - - def handle_initial_x_change(self, initial_x): - self.initial_x = initial_x - self.handle_trajectory_change() - return self.trajectory_idx, self.plot - - def handle_initial_y_change(self, initial_y): - self.initial_y = initial_y - self.handle_trajectory_change() - return self.trajectory_idx, self.plot - - def handle_optimiser_change(self, optimiser_type): - self.optimiser_type = optimiser_type - self.handle_trajectory_change() - - if optimiser_type == "Gradient Descent": - hessian_update = gr.update(visible=False) - learning_rate_update = gr.update(visible=True) - momentum_update = gr.update(visible=True) - rho_rmsprop_update = gr.update(visible=False) - rho_adadelta_update = gr.update(visible=False) - rho1_adam_upate = gr.update(visible=False) - rho2_adam_update = gr.update(visible=False) - eps_update = gr.update(visible=False) - eps_adadelta_update = gr.update(visible=False) - elif optimiser_type == "Newton": - hessian_update = gr.update(visible=True) - learning_rate_update = gr.update(visible=False) - momentum_update = gr.update(visible=False) - rho_rmsprop_update = gr.update(visible=False) - rho_adadelta_update = gr.update(visible=False) - rho1_adam_upate = gr.update(visible=False) - rho2_adam_update = gr.update(visible=False) - eps_update = gr.update(visible=False) - eps_adadelta_update = gr.update(visible=False) - elif optimiser_type == "Nesterov": - hessian_update = gr.update(visible=False) - learning_rate_update = gr.update(visible=True) - momentum_update = gr.update(visible=True) - rho_rmsprop_update = gr.update(visible=False) - rho_adadelta_update = gr.update(visible=False) - rho1_adam_upate = gr.update(visible=False) - rho2_adam_update = gr.update(visible=False) - eps_update = gr.update(visible=False) - eps_adadelta_update = gr.update(visible=False) - elif optimiser_type == "AdaGrad": - hessian_update = gr.update(visible=False) - learning_rate_update = gr.update(visible=True) - momentum_update = gr.update(visible=False) - rho_rmsprop_update = gr.update(visible=False) - rho_adadelta_update = gr.update(visible=False) - rho1_adam_upate = gr.update(visible=False) - rho2_adam_update = gr.update(visible=False) - eps_update = gr.update(visible=True) - eps_adadelta_update = gr.update(visible=False) - elif optimiser_type == "RMSProp": - hessian_update = gr.update(visible=False) - learning_rate_update = gr.update(visible=True) - momentum_update = gr.update(visible=False) - rho_rmsprop_update = gr.update(visible=True) - rho_adadelta_update = gr.update(visible=False) - rho1_adam_upate = gr.update(visible=False) - rho2_adam_update = gr.update(visible=False) - eps_update = gr.update(visible=True) - eps_adadelta_update = gr.update(visible=False) - elif optimiser_type == "AdaDelta": - hessian_update = gr.update(visible=False) - learning_rate_update = gr.update(visible=True) - momentum_update = gr.update(visible=False) - rho_rmsprop_update = gr.update(visible=False) - rho_adadelta_update = gr.update(visible=True) - rho1_adam_upate = gr.update(visible=False) - rho2_adam_update = gr.update(visible=False) - eps_update = gr.update(visible=False) - eps_adadelta_update = gr.update(visible=True) - elif optimiser_type == "Adam": - hessian_update = gr.update(visible=False) - learning_rate_update = gr.update(visible=True) - momentum_update = gr.update(visible=False) - rho_rmsprop_update = gr.update(visible=False) - rho_adadelta_update = gr.update(visible=False) - rho1_adam_upate = gr.update(visible=True) - rho2_adam_update = gr.update(visible=True) - eps_update = gr.update(visible=True) - eps_adadelta_update = gr.update(visible=False) - else: - raise ValueError(f"Unknown optimiser type: {optimiser_type}") - - return ( - hessian_update, - learning_rate_update, - momentum_update, - rho_rmsprop_update, - rho_adadelta_update, - rho1_adam_upate, - rho2_adam_update, - eps_update, - eps_adadelta_update, - self.trajectory_idx, - self.plot, - ) - - def reset(self): - self.function = self.DEFAULT_FUNCTION - self.initial_x = self.DEFAULT_INIT_X - self.initial_y = self.DEFAULT_INIT_Y - - self.num_steps = self.DEFAULT_NUM_STEPS - self.optimiser_type = self.DEFAULT_OPTIMISER - self.learning_rate = self.DEFAULT_LEARNING_RATE - - # gradient descent and nesterov only - self.momentum = self.DEFAULT_MOMENTUM - - # adaptive gradients - self.rho_rmsprop = self.DEFAULT_RHO_RMSPROP - self.rho_adadelta = self.DEFAULT_RHO_ADADELTA - self.rho1_adam = self.DEFAULT_RHO1_ADAM - self.rho2_adam = self.DEFAULT_RHO2_ADAM - self.eps = self.DEFAULT_EPS - self.eps_adadelta = self.DEFAULT_EPS_ADADELTA - - self.trajectory_x, self.trajectory_y, self.trajectory_z = self.get_optimisation_trajectory() - self.trajectory_idx = 0 - - self.plots = [] - self.generate_plots() - - def build(self): - with gr.Tab("Bivariate"): - with gr.Row(): - with gr.Column(scale=2): - self.plot = gr.Image( - value=self.update_plot(), - container=True, - ) - - with gr.Column(scale=1): - with gr.Tab("Settings"): - function = gr.Textbox( - label="Function", - value=self.function, - interactive=True, - container=True, - ) - gradient = gr.Textbox( - label="Gradient", - value=format_gradient(*get_gradient_2d(self.function)), - interactive=False, - container=True, - ) - hessian = gr.Textbox( - label="Hessian", - value=format_hessian(*get_hessian_2d(self.function)), - interactive=False, - container=True, - visible=False, - ) - - with gr.Row(): - optimiser_type = gr.Dropdown( - label="Optimiser", - choices=["Gradient Descent", "Nesterov", "AdaGrad", "RMSProp", "AdaDelta", "Adam", "Newton"], - value=self.optimiser_type, - interactive=True, - container=True, - ) - - with gr.Row(): - initial_x = gr.Number( - label="Initial x", - value=self.initial_x, - interactive=True, - container=True, - ) - initial_y = gr.Number( - label="Initial y", - value=self.initial_y, - interactive=True, - container=True, - ) - - # hyperparameter row - with gr.Row(): - learning_rate = gr.Number( - label="Learning Rate", - value=self.learning_rate, - interactive=True, - container=True, - ) - momentum = gr.Number( - label="Momentum", - value=self.momentum, - interactive=True, - container=True, - ) - rho_rmsprop = gr.Number( - label="rho", - value=self.DEFAULT_RHO_RMSPROP, - interactive=True, - container=True, - visible=False, - ) - rho_adadelta = gr.Number( - label="rho", - value=self.DEFAULT_RHO_ADADELTA, - interactive=True, - container=True, - visible=False, - ) - rho1_adam = gr.Number( - label="rho1", - value=self.DEFAULT_RHO1_ADAM, - interactive=True, - container=True, - visible=False, - ) - rho2_adam = gr.Number( - label="rho2", - value=self.DEFAULT_RHO2_ADAM, - interactive=True, - container=True, - visible=False, - ) - eps = gr.Number( - label="Epsilon", - value=self.eps, - interactive=True, - container=True, - visible=False, - ) - eps_adadelta = gr.Number( - label="Epsilon", - value=self.eps_adadelta, - interactive=True, - container=True, - visible=False, - ) - - with gr.Tab("Trajectory"): - trajectory_slider = gr.Slider( - label="Optimisation step", - minimum=0, - maximum=self.num_steps - 1, - step=1, - value=0, - interactive=True, - ) - - trajectory_button = gr.Button("Optimisation step") - - function.submit( - self.handle_function_change, - inputs=[function], - outputs=[gradient, hessian, trajectory_slider, self.plot], - ) - - optimiser_type.change( - self.handle_optimiser_change, - inputs=[optimiser_type], - outputs=[hessian, learning_rate, momentum, rho_rmsprop, rho_adadelta, rho1_adam, rho2_adam, eps, eps_adadelta, trajectory_slider, self.plot], - ) - - initial_x.submit( - self.handle_initial_x_change, - inputs=[initial_x], - outputs=[trajectory_slider, self.plot], - ) - initial_y.submit( - self.handle_initial_y_change, - inputs=[initial_y], - outputs=[trajectory_slider, self.plot], - ) - - learning_rate.submit( - self.handle_learning_rate_change, - inputs=[learning_rate], - outputs=[trajectory_slider, self.plot], - ) - momentum.submit( - self.handle_momentum_change, - inputs=[momentum], - outputs=[trajectory_slider, self.plot], - ) - rho_rmsprop.submit( - self.handle_rho_rmsprop_change, - inputs=[rho_rmsprop], - outputs=[trajectory_slider, self.plot], - ) - rho_adadelta.submit( - self.handle_rho_adadelta_change, - inputs=[rho_adadelta], - outputs=[trajectory_slider, self.plot], - ) - rho1_adam.submit( - self.handle_rho1_adam_change, - inputs=[rho1_adam], - outputs=[trajectory_slider, self.plot], - ) - rho2_adam.submit( - self.handle_rho2_adam_change, - inputs=[rho2_adam], - outputs=[trajectory_slider, self.plot], - ) - eps.submit( - self.handle_eps_change, - inputs=[eps], - outputs=[trajectory_slider, self.plot], - ) - eps_adadelta.submit( - self.handle_eps_adadelta_change, - inputs=[eps_adadelta], - outputs=[trajectory_slider, self.plot], - ) - - trajectory_slider.change( - self.handle_slider_change, - inputs=[trajectory_slider], - outputs=[self.plot], - ) - trajectory_button.click( - self.handle_trajectory_button, - outputs=[trajectory_slider], - ) diff --git a/old_code/optimisation.py b/old_code/optimisation.py deleted file mode 100644 index 65e3087a40b76e76e1252fcb2ac9ad380f964f84..0000000000000000000000000000000000000000 --- a/old_code/optimisation.py +++ /dev/null @@ -1,27 +0,0 @@ -import gradio as gr - -from bivariate import Bivariate -from univariate import Univariate - -class Optimisation: - def __init__(self, width=1200, height=900): - self.width = width - self.height = height - self.univariate = Univariate(width, height) - self.bivariate = Bivariate(width, height) - - def on_load(self): - self.univariate.reset() - self.bivariate.reset() - - def launch(self): - with gr.Blocks() as demo: - gr.HTML("
    Optimisation trajectory visualizer
    ") - self.univariate.build() - self.bivariate.build() - demo.load(self.on_load) - - demo.launch() - -visualizer = Optimisation(width=1200, height=900) -visualizer.launch() diff --git a/old_code/optimisers.py b/old_code/optimisers.py deleted file mode 100755 index 20f4cc7ca21cf43420424930f535bb5553a1ff67..0000000000000000000000000000000000000000 --- a/old_code/optimisers.py +++ /dev/null @@ -1,312 +0,0 @@ -import numexpr -import numpy as np -import sympy - -def get_gradient_1d(function): - x = sympy.symbols('x') - expr = sympy.sympify(function) - grad_x = sympy.diff(expr, x) - return grad_x - - -def get_hessian_1d(function): - x = sympy.symbols('x') - expr = sympy.sympify(function) - hess_x = sympy.diff(expr, x, 2) - return hess_x - - -def get_gradient_2d(function): - x, y = sympy.symbols('x y') - expr = sympy.sympify(function) - grad_x = sympy.diff(expr, x) - grad_y = sympy.diff(expr, y) - return grad_x, grad_y - - -def get_hessian_2d(function): - x, y = sympy.symbols('x y') - expr = sympy.sympify(function) - hess_xx = sympy.diff(expr, x, 2) - hess_yy = sympy.diff(expr, y, 2) - hess_xy = sympy.diff(expr, x, y) - hess_yx = sympy.diff(expr, y, x) - return hess_xx, hess_xy, hess_yx, hess_yy - - -def get_optimizer_trajectory_1d(function, initial_x, optimiser_type, learning_rate, momentum, num_steps): - if optimiser_type == "Gradient Descent": - return get_gd_trajectory_1d(function, initial_x, learning_rate, momentum, num_steps) - elif optimiser_type == "Newton": - return get_newton_trajectory_1d(function, initial_x, num_steps) - else: - raise ValueError(f"Unsupported optimiser type: {optimiser_type}") - - -def get_gd_trajectory_1d(function, initial_x, learning_rate, momentum, num_steps): - grad_x = get_gradient_1d(function) - - trajectory_x = np.zeros(num_steps + 1) - trajectory_y = np.zeros(num_steps + 1) - trajectory_x[0] = initial_x - trajectory_y[0] = numexpr.evaluate(function, local_dict={'x': initial_x}) - - for i in range(num_steps): - grad_x_val = float(grad_x.evalf(subs={'x': trajectory_x[i]})) - if i == 0: - momentum_x = 0 - else: - momentum_x = momentum * (trajectory_x[i] - trajectory_x[i - 1]) - - trajectory_x[i + 1] = trajectory_x[i] - learning_rate * grad_x_val + momentum_x - trajectory_y[i + 1] = numexpr.evaluate(function, local_dict={'x': trajectory_x[i + 1]}) - - return trajectory_x, trajectory_y - - -def get_newton_trajectory_1d(function, initial_x, num_steps): - grad_x = get_gradient_1d(function) - hess_x = get_hessian_1d(function) - - trajectory_x = np.zeros(num_steps + 1) - trajectory_y = np.zeros(num_steps + 1) - trajectory_x[0] = initial_x - trajectory_y[0] = numexpr.evaluate(function, local_dict={'x': initial_x}) - - for i in range(num_steps): - grad_x_val = float(grad_x.evalf(subs={'x': trajectory_x[i]})) - hess_x_val = float(hess_x.evalf(subs={'x': trajectory_x[i]})) - - if hess_x_val == 0: - break - trajectory_x[i + 1] = trajectory_x[i] - grad_x_val / hess_x_val - trajectory_y[i + 1] = numexpr.evaluate(function, local_dict={'x': trajectory_x[i + 1]}) - - return trajectory_x, trajectory_y - - -def get_gd_trajectory_2d(function, initial_x, initial_y, learning_rate, momentum, num_steps): - grad_x, grad_y = get_gradient_2d(function) - - trajectory_x = np.zeros(num_steps + 1) - trajectory_y = np.zeros(num_steps + 1) - trajectory_z = np.zeros(num_steps + 1) - trajectory_x[0] = initial_x - trajectory_y[0] = initial_y - trajectory_z[0] = numexpr.evaluate(function, local_dict={'x': initial_x, 'y': initial_y}) - - for i in range(num_steps): - grad_x_val = float(grad_x.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - grad_y_val = float(grad_y.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - - if i == 0: - momentum_x = 0 - momentum_y = 0 - else: - momentum_x = momentum * (trajectory_x[i] - trajectory_x[i - 1]) - momentum_y = momentum * (trajectory_y[i] - trajectory_y[i - 1]) - - trajectory_x[i + 1] = trajectory_x[i] - learning_rate * grad_x_val + momentum_x - trajectory_y[i + 1] = trajectory_y[i] - learning_rate * grad_y_val + momentum_y - trajectory_z[i + 1] = numexpr.evaluate(function, local_dict={'x': trajectory_x[i + 1], 'y': trajectory_y[i + 1]}) - - return trajectory_x, trajectory_y, trajectory_z - - -def get_nesterov_trajectory_2d(function, initial_x, initial_y, learning_rate, momentum, num_steps): - grad_x, grad_y = get_gradient_2d(function) - - trajectory_x = np.zeros(num_steps + 1) - trajectory_y = np.zeros(num_steps + 1) - trajectory_z = np.zeros(num_steps + 1) - trajectory_x[0] = initial_x - trajectory_y[0] = initial_y - trajectory_z[0] = numexpr.evaluate(function, local_dict={'x': initial_x, 'y': initial_y}) - - for i in range(num_steps): - if i == 0: - momentum_x = 0 - momentum_y = 0 - else: - momentum_x = momentum * (trajectory_x[i] - trajectory_x[i - 1]) - momentum_y = momentum * (trajectory_y[i] - trajectory_y[i - 1]) - - x = trajectory_x[i] + momentum_x - y = trajectory_y[i] + momentum_y - grad_x_val = float(grad_x.evalf(subs={'x': x, 'y': y})) - grad_y_val = float(grad_y.evalf(subs={'x': x, 'y': y})) - - trajectory_x[i + 1] = trajectory_x[i] - learning_rate * grad_x_val - trajectory_y[i + 1] = trajectory_y[i] - learning_rate * grad_y_val - trajectory_z[i + 1] = numexpr.evaluate(function, local_dict={'x': trajectory_x[i + 1], 'y': trajectory_y[i + 1]}) - - return trajectory_x, trajectory_y, trajectory_z - - -def get_adam_trajectory_2d(function, initial_x, initial_y, learning_rate, rho1, rho2, epsilon, num_steps): - grad_x, grad_y = get_gradient_2d(function) - - trajectory_x = np.zeros(num_steps + 1) - trajectory_y = np.zeros(num_steps + 1) - trajectory_z = np.zeros(num_steps + 1) - trajectory_x[0] = initial_x - trajectory_y[0] = initial_y - trajectory_z[0] = numexpr.evaluate(function, local_dict={'x': initial_x, 'y': initial_y}) - - m_x, m_y = 0, 0 - v_x, v_y = 0, 0 - epsilon = 1e-8 - - for i in range(num_steps): - grad_x_val = float(grad_x.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - grad_y_val = float(grad_y.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - - m_x = rho1 * m_x + (1 - rho1) * grad_x_val - m_y = rho1 * m_y + (1 - rho1) * grad_y_val - - v_x = rho2 * v_x + (1 - rho2) * (grad_x_val ** 2) - v_y = rho2 * v_y + (1 - rho2) * (grad_y_val ** 2) - - m_hat_x = m_x / (1 - rho1 ** (i + 1)) - m_hat_y = m_y / (1 - rho1 ** (i + 1)) - - v_hat_x = v_x / (1 - rho2 ** (i + 1)) - v_hat_y = v_y / (1 - rho2 ** (i + 1)) - - trajectory_x[i + 1] = trajectory_x[i] - learning_rate * m_hat_x / np.sqrt(v_hat_x + epsilon) - trajectory_y[i + 1] = trajectory_y[i] - learning_rate * m_hat_y / np.sqrt(v_hat_y + epsilon) - trajectory_z[i + 1] = numexpr.evaluate(function, local_dict={'x': trajectory_x[i + 1], 'y': trajectory_y[i + 1]}) - - return trajectory_x, trajectory_y, trajectory_z - - -def get_newton_trajectory_2d(function, initial_x, initial_y, num_steps): - grad_x, grad_y = get_gradient_2d(function) - hess_xx, hess_xy, hess_yx, hess_yy = get_hessian_2d(function) - - trajectory_x = np.zeros(num_steps + 1) - trajectory_y = np.zeros(num_steps + 1) - trajectory_z = np.zeros(num_steps + 1) - trajectory_x[0] = initial_x - trajectory_y[0] = initial_y - trajectory_z[0] = numexpr.evaluate(function, local_dict={'x': initial_x, 'y': initial_y}) - - for i in range(num_steps): - grad_x_val = float(grad_x.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - grad_y_val = float(grad_y.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - - hess_xx_val = float(hess_xx.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - hess_xy_val = float(hess_xy.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - hess_yx_val = float(hess_yx.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - hess_yy_val = float(hess_yy.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - - hessian_matrix = np.array( - [ - [hess_xx_val, hess_xy_val], - [hess_yx_val, hess_yy_val] - ], - ) - - gradient_vector = np.array([grad_x_val, grad_y_val]) - - try: - hessian_inv = np.linalg.inv(hessian_matrix) - except np.linalg.LinAlgError: - break - - step = hessian_inv @ gradient_vector - - trajectory_x[i + 1] = trajectory_x[i] - step[0] - trajectory_y[i + 1] = trajectory_y[i] - step[1] - trajectory_z[i + 1] = numexpr.evaluate(function, local_dict={'x': trajectory_x[i + 1], 'y': trajectory_y[i + 1]}) - - return trajectory_x, trajectory_y, trajectory_z - - -def get_adagrad_trajectory_2d(function, initial_x, initial_y, learning_rate, epsilon, num_steps): - grad_x, grad_y = get_gradient_2d(function) - - trajectory_x = np.zeros(num_steps + 1) - trajectory_y = np.zeros(num_steps + 1) - trajectory_z = np.zeros(num_steps + 1) - trajectory_x[0] = initial_x - trajectory_y[0] = initial_y - trajectory_z[0] = numexpr.evaluate(function, local_dict={'x': initial_x, 'y': initial_y}) - - v_x = 0 - v_y = 0 - - for i in range(num_steps): - grad_x_val = float(grad_x.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - grad_y_val = float(grad_y.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - - v_x += grad_x_val ** 2 - v_y += grad_y_val ** 2 - - trajectory_x[i + 1] = trajectory_x[i] - learning_rate / np.sqrt(v_x + epsilon) * grad_x_val - trajectory_y[i + 1] = trajectory_y[i] - learning_rate / np.sqrt(v_y + epsilon) * grad_y_val - trajectory_z[i + 1] = numexpr.evaluate(function, local_dict={'x': trajectory_x[i + 1], 'y': trajectory_y[i + 1]}) - - return trajectory_x, trajectory_y, trajectory_z - - -def get_rmsprop_trajectory_2d(function, initial_x, initial_y, learning_rate, rho, epsilon, num_steps): - grad_x, grad_y = get_gradient_2d(function) - - trajectory_x = np.zeros(num_steps + 1) - trajectory_y = np.zeros(num_steps + 1) - trajectory_z = np.zeros(num_steps + 1) - trajectory_x[0] = initial_x - trajectory_y[0] = initial_y - trajectory_z[0] = numexpr.evaluate(function, local_dict={'x': initial_x, 'y': initial_y}) - - v_x = 0 - v_y = 0 - - for i in range(num_steps): - grad_x_val = float(grad_x.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - grad_y_val = float(grad_y.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - - v_x = rho * v_x + (1 - rho) * (grad_x_val ** 2) - v_y = rho * v_y + (1 - rho) * (grad_y_val ** 2) - - trajectory_x[i + 1] = trajectory_x[i] - learning_rate / np.sqrt(v_x + epsilon) * grad_x_val - trajectory_y[i + 1] = trajectory_y[i] - learning_rate / np.sqrt(v_y + epsilon) * grad_y_val - trajectory_z[i + 1] = numexpr.evaluate(function, local_dict={'x': trajectory_x[i + 1], 'y': trajectory_y[i + 1]}) - - return trajectory_x, trajectory_y, trajectory_z - - -def get_adadelta_trajectory_2d(function, initial_x, initial_y, learning_rate, rho, epsilon, num_steps): - grad_x, grad_y = get_gradient_2d(function) - - trajectory_x = np.zeros(num_steps + 1) - trajectory_y = np.zeros(num_steps + 1) - trajectory_z = np.zeros(num_steps + 1) - trajectory_x[0] = initial_x - trajectory_y[0] = initial_y - trajectory_z[0] = numexpr.evaluate(function, local_dict={'x': initial_x, 'y': initial_y}) - - v_x = 0 - v_y = 0 - s_x = 0 - s_y = 0 - - for i in range(num_steps): - grad_x_val = float(grad_x.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - grad_y_val = float(grad_y.evalf(subs={'x': trajectory_x[i], 'y': trajectory_y[i]})) - - v_x = rho * v_x + (1 - rho) * (grad_x_val ** 2) - v_y = rho * v_y + (1 - rho) * (grad_y_val ** 2) - - del_x = np.sqrt(s_x + epsilon) / np.sqrt(v_x + epsilon) * grad_x_val - del_y = np.sqrt(s_y + epsilon) / np.sqrt(v_y + epsilon) * grad_y_val - - s_x = rho * s_x + (1 - rho) * del_x ** 2 - s_y = rho * s_y + (1 - rho) * del_y ** 2 - - trajectory_x[i + 1] = trajectory_x[i] - learning_rate * del_x - trajectory_y[i + 1] = trajectory_y[i] - learning_rate * del_y - trajectory_z[i + 1] = numexpr.evaluate(function, local_dict={'x': trajectory_x[i + 1], 'y': trajectory_y[i + 1]}) - - return trajectory_x, trajectory_y, trajectory_z diff --git a/old_code/requirements.txt b/old_code/requirements.txt deleted file mode 100644 index c0790ec2b0eb8fa0f9f7ea8f9a6f7c8f9a05d1c5..0000000000000000000000000000000000000000 --- a/old_code/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -matplotlib -mpu -numexpr -numpy -pandas -pillow -plotly -scikit-learn -sympy diff --git a/old_code/univariate.py b/old_code/univariate.py deleted file mode 100644 index 6281aa7e99c4f02cd24e800666b304656ccab351..0000000000000000000000000000000000000000 --- a/old_code/univariate.py +++ /dev/null @@ -1,261 +0,0 @@ -import io - -import gradio as gr -import matplotlib.pyplot as plt -import numexpr -import numpy as np -from PIL import Image - -import logging -logging.basicConfig( - level=logging.INFO, # set minimum level to capture (DEBUG, INFO, WARNING, ERROR, CRITICAL) - format="%(asctime)s [%(levelname)s] %(message)s", # log format -) -logger = logging.getLogger("ELVIS") - -from optimisers import get_gradient_1d, get_hessian_1d, get_optimizer_trajectory_1d - - -class Univariate: - DEFAULT_UNIVARIATE = "x ** 2" - DEFAULT_INIT_X = 0.5 - - def __init__(self, width, height): - self.canvas_width = width - self.canvas_height = height - - self.optimiser_type = "Gradient Descent" - self.learning_rate = 0.1 - self.num_steps = 20 - self.momentum = 0 - - self.function = self.DEFAULT_UNIVARIATE - - self.initial_x = self.DEFAULT_INIT_X - - self.trajectory_x, self.trajectory_y = get_optimizer_trajectory_1d( - self.DEFAULT_UNIVARIATE, - self.DEFAULT_INIT_X, - self.optimiser_type, - self.learning_rate, - self.momentum, - self.num_steps, - ) - - self.trajectory_idx = 0 - self.plots = [] - self.generate_plots() - - def generate_plots(self): - self.plots.clear() - - fig, ax = plt.subplots() - - for idx in range(self.num_steps): - traj_x_min = np.min(self.trajectory_x[:idx + 1]) - traj_x_max = np.max(self.trajectory_x[:idx + 1]) - x_radius = np.maximum(np.abs(traj_x_min), np.abs(traj_x_max)) - - if x_radius > 1: - x = np.linspace(-1.2 * x_radius, 1.2 * x_radius, 100) - else: - x = np.linspace(-1, 1, 100) - - try: - y = numexpr.evaluate(self.function, local_dict={'x': x}) - except Exception as e: - logger.error("Error evaluating function '%s': %s", function, e) - y = np.zeros_like(x) - - ax.clear() - ax.plot(x, y) - ax.set_xlabel("x") - ax.set_ylabel("f(x)") - ax.plot(self.trajectory_x[:idx + 1], self.trajectory_y[:idx + 1], marker='o', color='indianred') - ax.plot(self.trajectory_x[idx], self.trajectory_y[idx], marker='o', color='red') - - buf = io.BytesIO() - fig.savefig(buf, format="png", bbox_inches="tight", pad_inches=0) - plt.close(fig) - buf.seek(0) - img = Image.open(buf) - - # Append the generated plot to the list - self.plots.append(img) - - def update_plot(self): - plot = self.plots[self.trajectory_idx] - self.univariate_plot = plot - return plot - - def update_optimiser_type(self, optimiser_type): - self.optimiser_type = optimiser_type - - def update_trajectory(self): - trajectory_x, trajectory_y = get_optimizer_trajectory_1d( - self.function, - self.initial_x, - self.optimiser_type, - self.learning_rate, - self.momentum, - self.num_steps, - ) - self.trajectory_x = trajectory_x - self.trajectory_y = trajectory_y - - def update_trajectory_slider(self, trajectory_idx): - self.trajectory_idx = trajectory_idx - - def update_learning_rate(self, learning_rate): - self.learning_rate = learning_rate - - def update_initial_x(self, initial_x): - self.initial_x = initial_x - - def update_function(self, function): - self.function = function - - def show_relevant_params(self, optimiser_type): - if optimiser_type == "Gradient Descent": - learning_rate = gr.update(visible=True) - hessian = gr.update(visible=False) - momentum = gr.update(visible=True) - else: - learning_rate = gr.update(visible=False) - hessian = gr.update(visible=True) - momentum = gr.update(visible=False) - return hessian, learning_rate, momentum - - def handle_trajectory_change(self): - self.update_trajectory() - self.generate_plots() - - self.handle_slider_change(0) # reset slider - self.update_plot() - - def handle_optimiser_type_change(self, optimiser_type): - self.update_optimiser_type(optimiser_type) - self.handle_trajectory_change() - hessian_update, learning_rate_update, momentum_update = self.show_relevant_params(optimiser_type) - return self.trajectory_idx, hessian_update, learning_rate_update, momentum_update, self.univariate_plot - - def handle_learning_rate_change(self, learning_rate): - self.update_learning_rate(learning_rate) - self.handle_trajectory_change() - return self.trajectory_idx, self.univariate_plot - - def handle_momentum_change(self, momentum): - self.momentum = momentum - self.handle_trajectory_change() - return self.trajectory_idx, self.univariate_plot - - def handle_slider_change(self, trajectory_idx): - self.update_trajectory_slider(trajectory_idx) - self.update_plot() - return self.univariate_plot - - def handle_trajectory_button(self): - if self.trajectory_idx < self.num_steps - 1: - self.trajectory_idx += 1 - # plot is updated from slider changing - return self.trajectory_idx - - def handle_initial_x_change(self, initial_x): - self.update_initial_x(initial_x) - self.handle_trajectory_change() - return self.trajectory_idx, self.univariate_plot - - def handle_function_change(self, function): - self.update_function(function) - self.handle_trajectory_change() - gradient = f"{get_gradient_1d(function)}" - hessian = f"{get_hessian_1d(function)}" - return self.trajectory_idx, gradient, hessian, self.univariate_plot - - def reset(self): - self.optimiser_type = "Gradient Descent" - self.learning_rate = 0.1 - self.num_steps = 20 - - self.function = self.DEFAULT_UNIVARIATE - - self.initial_x = self.DEFAULT_INIT_X - - self.trajectory_x, self.trajectory_y = get_optimizer_trajectory_1d( - self.DEFAULT_UNIVARIATE, - self.DEFAULT_INIT_X, - self.optimiser_type, - self.learning_rate, - self.momentum, - self.num_steps, - ) - - self.trajectory_idx = 0 - self.plots = [] - self.generate_plots() - - def build(self): - with gr.Tab("Univariate"): - with gr.Row(): - with gr.Column(scale=2): - self.univariate_plot = gr.Image( - value=self.update_plot(), - container=True, - ) - - with gr.Column(scale=1): - with gr.Tab("Settings"): - function = gr.Textbox(label="Function", value=self.DEFAULT_UNIVARIATE, interactive=True) - gradient = gr.Textbox( - label="Derivative", - value=f"{get_gradient_1d(self.DEFAULT_UNIVARIATE)}", - interactive=False, - ) - hessian = gr.Textbox( - label="Second Derivative", - value=f"{get_hessian_1d(self.DEFAULT_UNIVARIATE)}", - interactive=False, - visible=False, - ) - - optimiser_type = gr.Dropdown( - label="Optimiser", - choices=["Gradient Descent", "Newton"], - value="Gradient Descent", - interactive=True, - ) - - initial_x = gr.Number(label="Initial X", value=self.DEFAULT_INIT_X, interactive=True) - - with gr.Row(): - learning_rate = gr.Number(label="Learning Rate", value=self.learning_rate, interactive=True) - momentum = gr.Number(label="Momentum", value=self.momentum, interactive=True) - - with gr.Tab("Optimize"): - trajectory_slider = gr.Slider( - label="Optimisation Step", - minimum=0, - maximum=self.num_steps - 1, - step=1, - value=0, - interactive=True, - ) - - trajectory_button = gr.Button("Optimisation Step") - - function.submit(self.handle_function_change, inputs=[function], outputs=[trajectory_slider, gradient, hessian, self.univariate_plot]) - - initial_x.submit(self.handle_initial_x_change, inputs=[initial_x], outputs=[trajectory_slider, self.univariate_plot]) - - learning_rate.submit(self.handle_learning_rate_change, inputs=[learning_rate], outputs=[trajectory_slider, self.univariate_plot]) - momentum.submit(self.handle_momentum_change, inputs=[momentum], outputs=[trajectory_slider, self.univariate_plot]) - - optimiser_type.change( - self.handle_optimiser_type_change, - inputs=[optimiser_type], - outputs=[trajectory_slider, hessian, learning_rate, momentum, self.univariate_plot] - ) - - trajectory_slider.change(self.handle_slider_change, inputs=[trajectory_slider], outputs=[self.univariate_plot]) - trajectory_button.click(self.handle_trajectory_button, outputs=[trajectory_slider]) - diff --git a/old_code/usage.md b/old_code/usage.md deleted file mode 100644 index 9350beecead91a2e438be5580ea56ae278b72dde..0000000000000000000000000000000000000000 --- a/old_code/usage.md +++ /dev/null @@ -1 +0,0 @@ -**Quick start**